diff --git a/.github/workflows/common-e2e.yml b/.github/workflows/common-e2e.yml index 1d47753b1..3808e9272 100644 --- a/.github/workflows/common-e2e.yml +++ b/.github/workflows/common-e2e.yml @@ -37,6 +37,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Run Server run: docker compose -f docker-compose.ci.yml up -d env: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 69117b215..0ada9c650 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,6 +25,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build run: yarn build @@ -50,6 +53,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build if: steps.cache-build.outputs.cache-hit != 'true' run: yarn build @@ -79,6 +85,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build if: steps.cache-build.outputs.cache-hit != 'true' run: yarn build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1c29b7dd..96c27abcc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build run: yarn build @@ -50,6 +53,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build if: steps.cache-build.outputs.cache-hit != 'true' run: yarn build @@ -79,6 +85,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build if: steps.cache-build.outputs.cache-hit != 'true' run: yarn build @@ -137,6 +146,9 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' + - name: Install + run: yarn install --immutable + - name: Build if: steps.cache-build.outputs.cache-hit != 'true' run: yarn build diff --git a/.gitignore b/.gitignore index ec4077845..6cab8419d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ newrelic_agent.log !.yarn/patches !.yarn/plugins !.yarn/releases -!.yarn/unplugged !.yarn/sdks !.yarn/versions diff --git a/.pnp.cjs b/.pnp.cjs index abafa20d5..f73443339 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -121,22 +121,22 @@ const RAW_RUNTIME_STATE = [null, {\ "packageLocation": "./",\ "packageDependencies": [\ - ["@commitlint/cli", "npm:17.6.3"],\ - ["@commitlint/config-conventional", "npm:17.6.3"],\ - ["@lerna-lite/cli", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.3.0"],\ - ["@lerna-lite/list", "npm:2.3.0"],\ + ["@commitlint/cli", "npm:17.6.5"],\ + ["@commitlint/config-conventional", "npm:17.6.5"],\ + ["@lerna-lite/cli", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.4.0"],\ + ["@lerna-lite/list", "npm:2.4.0"],\ ["@lerna-lite/publish", "npm:2.4.0"],\ - ["@lerna-lite/run", "npm:2.3.0"],\ - ["@lerna-lite/version", "npm:2.3.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@lerna-lite/run", "npm:2.4.0"],\ + ["@lerna-lite/version", "npm:2.4.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ - ["eslint", "npm:8.39.0"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.8.0"],\ ["ini", "npm:3.0.1"],\ - ["newrelic", "npm:10.1.0"],\ - ["npm-check-updates", "npm:16.10.9"],\ - ["ts-node", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1"],\ + ["newrelic", "npm:10.1.2"],\ + ["npm-check-updates", "npm:16.10.12"],\ + ["ts-node", "virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:10.9.1"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ ],\ "linkType": "SOFT"\ @@ -159,7 +159,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@aws-crypto/crc32", "npm:3.0.0"],\ ["@aws-crypto/util", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.310.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["tslib", "npm:1.14.1"]\ ],\ "linkType": "HARD"\ @@ -171,7 +171,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@aws-crypto/crc32c", "npm:3.0.0"],\ ["@aws-crypto/util", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.310.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["tslib", "npm:1.14.1"]\ ],\ "linkType": "HARD"\ @@ -195,7 +195,7 @@ const RAW_RUNTIME_STATE = ["@aws-crypto/ie11-detection", "npm:3.0.0"],\ ["@aws-crypto/supports-web-crypto", "npm:3.0.0"],\ ["@aws-crypto/util", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.310.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-locate-window", "npm:3.310.0"],\ ["@aws-sdk/util-utf8-browser", "npm:3.259.0"],\ ["tslib", "npm:1.14.1"]\ @@ -212,7 +212,7 @@ const RAW_RUNTIME_STATE = ["@aws-crypto/sha256-js", "npm:3.0.0"],\ ["@aws-crypto/supports-web-crypto", "npm:3.0.0"],\ ["@aws-crypto/util", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.310.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-locate-window", "npm:3.310.0"],\ ["@aws-sdk/util-utf8-browser", "npm:3.259.0"],\ ["tslib", "npm:1.14.1"]\ @@ -226,7 +226,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ ["@aws-crypto/util", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.310.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["tslib", "npm:1.14.1"]\ ],\ "linkType": "HARD"\ @@ -247,7 +247,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-crypto-util-npm-3.0.0-6c4b38c78e-6ed4cd1c57.zip/node_modules/@aws-crypto/util/",\ "packageDependencies": [\ ["@aws-crypto/util", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.310.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-utf8-browser", "npm:3.259.0"],\ ["tslib", "npm:1.14.1"]\ ],\ @@ -255,12 +255,12 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@aws-sdk/abort-controller", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-abort-controller-npm-3.329.0-330df022b1-86f90b191d.zip/node_modules/@aws-sdk/abort-controller/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-abort-controller-npm-3.342.0-7cd20f7457-53f49d69eb.zip/node_modules/@aws-sdk/abort-controller/",\ "packageDependencies": [\ - ["@aws-sdk/abort-controller", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/abort-controller", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -270,527 +270,533 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-chunked-blob-reader-npm-3.310.0-1a751a969c-9cc50513a9.zip/node_modules/@aws-sdk/chunked-blob-reader/",\ "packageDependencies": [\ ["@aws-sdk/chunked-blob-reader", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/client-s3", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-client-s3-npm-3.332.0-b8db621e0d-08bd1ae694.zip/node_modules/@aws-sdk/client-s3/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-client-s3-npm-3.342.0-a2692091c5-9f3b9171dd.zip/node_modules/@aws-sdk/client-s3/",\ "packageDependencies": [\ - ["@aws-sdk/client-s3", "npm:3.332.0"],\ + ["@aws-sdk/client-s3", "npm:3.342.0"],\ ["@aws-crypto/sha1-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ - ["@aws-sdk/client-sts", "npm:3.332.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-node", "npm:3.332.0"],\ - ["@aws-sdk/eventstream-serde-browser", "npm:3.329.0"],\ - ["@aws-sdk/eventstream-serde-config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/eventstream-serde-node", "npm:3.329.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/hash-blob-browser", "npm:3.329.0"],\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/hash-stream-node", "npm:3.329.0"],\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/md5-js", "npm:3.329.0"],\ - ["@aws-sdk/middleware-bucket-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-expect-continue", "npm:3.329.0"],\ - ["@aws-sdk/middleware-flexible-checksums", "npm:3.331.0"],\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/middleware-location-constraint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/middleware-sdk-s3", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/middleware-signing", "npm:3.329.0"],\ - ["@aws-sdk/middleware-ssec", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/signature-v4-multi-region", "virtual:b8db621e0d35f45cf59bd6b60bbb57d0c723471a62c90fdc377d8aa78d7ba67bf923f9191d8d8133984e588fd6e0cae02985527562b0ac3e2f9863aff748181f#npm:3.329.0"],\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ + ["@aws-sdk/client-sts", "npm:3.342.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-node", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-serde-browser", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-serde-config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-serde-node", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/hash-blob-browser", "npm:3.342.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/hash-stream-node", "npm:3.342.0"],\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/md5-js", "npm:3.342.0"],\ + ["@aws-sdk/middleware-bucket-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-expect-continue", "npm:3.342.0"],\ + ["@aws-sdk/middleware-flexible-checksums", "npm:3.342.0"],\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/middleware-location-constraint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/middleware-sdk-s3", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/middleware-signing", "npm:3.342.0"],\ + ["@aws-sdk/middleware-ssec", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/signature-v4-multi-region", "virtual:a2692091c56671014ef90dfc527c269ffce74fb9107ac79a6fecc78ba99f8f84ad4e9d9854c2d0b58ee2fc1a7821570f01d9315a903e969369ce0d5c13a1b681#npm:3.342.0"],\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/util-stream-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-stream-node", "npm:3.331.0"],\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/util-stream-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-stream-node", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["@aws-sdk/util-waiter", "npm:3.329.0"],\ + ["@aws-sdk/util-waiter", "npm:3.342.0"],\ ["@aws-sdk/xml-builder", "npm:3.310.0"],\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ ["fast-xml-parser", "npm:4.1.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/client-sns", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-client-sns-npm-3.332.0-1150185943-72345e1f6b.zip/node_modules/@aws-sdk/client-sns/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-client-sns-npm-3.342.0-94ce02a19b-8d7ccac0ed.zip/node_modules/@aws-sdk/client-sns/",\ "packageDependencies": [\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ ["@aws-crypto/sha256-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ - ["@aws-sdk/client-sts", "npm:3.332.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-node", "npm:3.332.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/middleware-signing", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ + ["@aws-sdk/client-sts", "npm:3.342.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-node", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/middleware-signing", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ ["fast-xml-parser", "npm:4.1.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/client-sqs", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-client-sqs-npm-3.332.0-dc87108762-2a5c0d8a82.zip/node_modules/@aws-sdk/client-sqs/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-client-sqs-npm-3.342.0-f4e06f69ac-e08dd27f26.zip/node_modules/@aws-sdk/client-sqs/",\ "packageDependencies": [\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@aws-crypto/sha256-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ - ["@aws-sdk/client-sts", "npm:3.332.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-node", "npm:3.332.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/md5-js", "npm:3.329.0"],\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/middleware-sdk-sqs", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/middleware-signing", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ + ["@aws-sdk/client-sts", "npm:3.342.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-node", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/md5-js", "npm:3.342.0"],\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/middleware-sdk-sqs", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/middleware-signing", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ ["fast-xml-parser", "npm:4.1.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/client-sso", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-client-sso-npm-3.332.0-0a33ec496a-ec0660f92e.zip/node_modules/@aws-sdk/client-sso/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-client-sso-npm-3.342.0-be2d1dcabe-78748ec6a8.zip/node_modules/@aws-sdk/client-sso/",\ "packageDependencies": [\ - ["@aws-sdk/client-sso", "npm:3.332.0"],\ + ["@aws-sdk/client-sso", "npm:3.342.0"],\ ["@aws-crypto/sha256-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/client-sso-oidc", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.332.0-3680aa51b1-84948c90b7.zip/node_modules/@aws-sdk/client-sso-oidc/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.342.0-ead49d3554-083c2beff3.zip/node_modules/@aws-sdk/client-sso-oidc/",\ "packageDependencies": [\ - ["@aws-sdk/client-sso-oidc", "npm:3.332.0"],\ + ["@aws-sdk/client-sso-oidc", "npm:3.342.0"],\ ["@aws-crypto/sha256-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/client-sts", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-client-sts-npm-3.332.0-0aada08970-ebf88a07d3.zip/node_modules/@aws-sdk/client-sts/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-client-sts-npm-3.342.0-ccdc6f5bcc-14475bf1b4.zip/node_modules/@aws-sdk/client-sts/",\ "packageDependencies": [\ - ["@aws-sdk/client-sts", "npm:3.332.0"],\ + ["@aws-sdk/client-sts", "npm:3.342.0"],\ ["@aws-crypto/sha256-browser", "npm:3.0.0"],\ ["@aws-crypto/sha256-js", "npm:3.0.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-node", "npm:3.332.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/middleware-sdk-sts", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/middleware-signing", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-node", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/middleware-sdk-sts", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/middleware-signing", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ ["fast-xml-parser", "npm:4.1.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/config-resolver", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-config-resolver-npm-3.329.0-ad937b6b5a-96a66188db.zip/node_modules/@aws-sdk/config-resolver/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-config-resolver-npm-3.342.0-e26ef459a6-94007fc7e1.zip/node_modules/@aws-sdk/config-resolver/",\ "packageDependencies": [\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-config-provider", "npm:3.310.0"],\ - ["@aws-sdk/util-middleware", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/util-middleware", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-env", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-env-npm-3.329.0-a157793370-f55a57adfb.zip/node_modules/@aws-sdk/credential-provider-env/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-env-npm-3.342.0-be06d46059-5bb6a1891d.zip/node_modules/@aws-sdk/credential-provider-env/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-env", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-env", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-imds", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.329.0-04ff9ca00d-6ec90ae7e4.zip/node_modules/@aws-sdk/credential-provider-imds/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.342.0-8d4fef6a87-a5fb146d98.zip/node_modules/@aws-sdk/credential-provider-imds/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-imds", "npm:3.329.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-imds", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-ini", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.332.0-e91eb4fd31-b87946f4b7.zip/node_modules/@aws-sdk/credential-provider-ini/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.342.0-07eb48b0d6-b00358cd28.zip/node_modules/@aws-sdk/credential-provider-ini/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-ini", "npm:3.332.0"],\ - ["@aws-sdk/credential-provider-env", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-imds", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-process", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-sso", "npm:3.332.0"],\ - ["@aws-sdk/credential-provider-web-identity", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-ini", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-env", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-imds", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-process", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-sso", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-web-identity", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-node", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-node-npm-3.332.0-98efbe4c6c-8900cd7448.zip/node_modules/@aws-sdk/credential-provider-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-node-npm-3.342.0-c2c35e314b-ac5214f8da.zip/node_modules/@aws-sdk/credential-provider-node/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-node", "npm:3.332.0"],\ - ["@aws-sdk/credential-provider-env", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-imds", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-ini", "npm:3.332.0"],\ - ["@aws-sdk/credential-provider-process", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-sso", "npm:3.332.0"],\ - ["@aws-sdk/credential-provider-web-identity", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-node", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-env", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-imds", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-ini", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-process", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-sso", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-web-identity", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-process", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-process-npm-3.329.0-a4e22c58e7-ad125b9c5e.zip/node_modules/@aws-sdk/credential-provider-process/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-process-npm-3.342.0-78f1a885e7-b0c909eacf.zip/node_modules/@aws-sdk/credential-provider-process/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-process", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-process", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-sso", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.332.0-251ccf4225-5738d9eae1.zip/node_modules/@aws-sdk/credential-provider-sso/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.342.0-7fd27a0dfa-85a8c3814a.zip/node_modules/@aws-sdk/credential-provider-sso/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-sso", "npm:3.332.0"],\ - ["@aws-sdk/client-sso", "npm:3.332.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/token-providers", "npm:3.332.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-sso", "npm:3.342.0"],\ + ["@aws-sdk/client-sso", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/token-providers", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/credential-provider-web-identity", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.329.0-64a1517f92-cfdf8074d2.zip/node_modules/@aws-sdk/credential-provider-web-identity/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.342.0-a6febeebb2-6989324b98.zip/node_modules/@aws-sdk/credential-provider-web-identity/",\ "packageDependencies": [\ - ["@aws-sdk/credential-provider-web-identity", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/credential-provider-web-identity", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/eventstream-codec", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-codec-npm-3.329.0-9dfec6396f-aef44310a5.zip/node_modules/@aws-sdk/eventstream-codec/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-codec-npm-3.342.0-599f1c19f8-b735b3ea18.zip/node_modules/@aws-sdk/eventstream-codec/",\ "packageDependencies": [\ - ["@aws-sdk/eventstream-codec", "npm:3.329.0"],\ + ["@aws-sdk/eventstream-codec", "npm:3.342.0"],\ ["@aws-crypto/crc32", "npm:3.0.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-hex-encoding", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/eventstream-serde-browser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.329.0-1167a363f7-9b0c2503c8.zip/node_modules/@aws-sdk/eventstream-serde-browser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.342.0-c17f73b20c-345f411702.zip/node_modules/@aws-sdk/eventstream-serde-browser/",\ "packageDependencies": [\ - ["@aws-sdk/eventstream-serde-browser", "npm:3.329.0"],\ - ["@aws-sdk/eventstream-serde-universal", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/eventstream-serde-browser", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-serde-universal", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/eventstream-serde-config-resolver", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.329.0-5ab3df4a81-4aad3bdd73.zip/node_modules/@aws-sdk/eventstream-serde-config-resolver/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.342.0-5dc510958f-cd08f6a605.zip/node_modules/@aws-sdk/eventstream-serde-config-resolver/",\ "packageDependencies": [\ - ["@aws-sdk/eventstream-serde-config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/eventstream-serde-config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/eventstream-serde-node", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.329.0-ff54965da7-4852c098cb.zip/node_modules/@aws-sdk/eventstream-serde-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.342.0-c4f337309c-5267253359.zip/node_modules/@aws-sdk/eventstream-serde-node/",\ "packageDependencies": [\ - ["@aws-sdk/eventstream-serde-node", "npm:3.329.0"],\ - ["@aws-sdk/eventstream-serde-universal", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/eventstream-serde-node", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-serde-universal", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/eventstream-serde-universal", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.329.0-b41268f65c-c269cb96a5.zip/node_modules/@aws-sdk/eventstream-serde-universal/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.342.0-04f7b47201-18ae41b141.zip/node_modules/@aws-sdk/eventstream-serde-universal/",\ "packageDependencies": [\ - ["@aws-sdk/eventstream-serde-universal", "npm:3.329.0"],\ - ["@aws-sdk/eventstream-codec", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/eventstream-serde-universal", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-codec", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/fetch-http-handler", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.329.0-2d5e8249a0-d0961fb2ed.zip/node_modules/@aws-sdk/fetch-http-handler/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.342.0-4a4e467fec-63e3544b61.zip/node_modules/@aws-sdk/fetch-http-handler/",\ "packageDependencies": [\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/querystring-builder", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/querystring-builder", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/hash-blob-browser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-hash-blob-browser-npm-3.329.0-a4d3b0413c-5a46f85c60.zip/node_modules/@aws-sdk/hash-blob-browser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-hash-blob-browser-npm-3.342.0-066e11f2e4-a5669c25e7.zip/node_modules/@aws-sdk/hash-blob-browser/",\ "packageDependencies": [\ - ["@aws-sdk/hash-blob-browser", "npm:3.329.0"],\ + ["@aws-sdk/hash-blob-browser", "npm:3.342.0"],\ ["@aws-sdk/chunked-blob-reader", "npm:3.310.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/hash-node", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-hash-node-npm-3.329.0-a7c67f51ba-7eaa0387ec.zip/node_modules/@aws-sdk/hash-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-hash-node-npm-3.342.0-9dc83dff11-aed80c2ff0.zip/node_modules/@aws-sdk/hash-node/",\ "packageDependencies": [\ - ["@aws-sdk/hash-node", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/hash-node", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-buffer-from", "npm:3.310.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/hash-stream-node", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-hash-stream-node-npm-3.329.0-4f10e067ba-738f9d92be.zip/node_modules/@aws-sdk/hash-stream-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-hash-stream-node-npm-3.342.0-a4913a1144-3a5f01d6ec.zip/node_modules/@aws-sdk/hash-stream-node/",\ "packageDependencies": [\ - ["@aws-sdk/hash-stream-node", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/hash-stream-node", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/invalid-dependency", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-invalid-dependency-npm-3.329.0-09565fa8f1-d81664bb97.zip/node_modules/@aws-sdk/invalid-dependency/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-invalid-dependency-npm-3.342.0-39864c708e-999dd99885.zip/node_modules/@aws-sdk/invalid-dependency/",\ "packageDependencies": [\ - ["@aws-sdk/invalid-dependency", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/invalid-dependency", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -800,377 +806,378 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-is-array-buffer-npm-3.310.0-1a5a04a172-a7edb85440.zip/node_modules/@aws-sdk/is-array-buffer/",\ "packageDependencies": [\ ["@aws-sdk/is-array-buffer", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/md5-js", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-md5-js-npm-3.329.0-62455ff652-3157a9019d.zip/node_modules/@aws-sdk/md5-js/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-md5-js-npm-3.342.0-03063be6e0-32187b5846.zip/node_modules/@aws-sdk/md5-js/",\ "packageDependencies": [\ - ["@aws-sdk/md5-js", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/md5-js", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-bucket-endpoint", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.329.0-4d66fde78a-904a121931.zip/node_modules/@aws-sdk/middleware-bucket-endpoint/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.342.0-624a90470f-d84299c6b7.zip/node_modules/@aws-sdk/middleware-bucket-endpoint/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-bucket-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/middleware-bucket-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-arn-parser", "npm:3.310.0"],\ ["@aws-sdk/util-config-provider", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-content-length", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-content-length-npm-3.329.0-572714587f-b6e8b7d79a.zip/node_modules/@aws-sdk/middleware-content-length/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-content-length-npm-3.342.0-56f02d1875-1514517542.zip/node_modules/@aws-sdk/middleware-content-length/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-content-length", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-content-length", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-endpoint", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.329.0-0500d0a5da-407dd4e705.zip/node_modules/@aws-sdk/middleware-endpoint/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.342.0-0e31647f55-252122a44b.zip/node_modules/@aws-sdk/middleware-endpoint/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-endpoint", "npm:3.329.0"],\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ - ["@aws-sdk/util-middleware", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-endpoint", "npm:3.342.0"],\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ + ["@aws-sdk/util-middleware", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-expect-continue", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.329.0-99e881171e-4fa5c1213c.zip/node_modules/@aws-sdk/middleware-expect-continue/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.342.0-02ac8e3ba4-77e9090e12.zip/node_modules/@aws-sdk/middleware-expect-continue/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-expect-continue", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-expect-continue", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-flexible-checksums", [\ - ["npm:3.331.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.331.0-4c9d7da9e7-cbfc42a47f.zip/node_modules/@aws-sdk/middleware-flexible-checksums/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.342.0-c9718f53ef-c1f5d6b03a.zip/node_modules/@aws-sdk/middleware-flexible-checksums/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-flexible-checksums", "npm:3.331.0"],\ + ["@aws-sdk/middleware-flexible-checksums", "npm:3.342.0"],\ ["@aws-crypto/crc32", "npm:3.0.0"],\ ["@aws-crypto/crc32c", "npm:3.0.0"],\ ["@aws-sdk/is-array-buffer", "npm:3.310.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-host-header", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-host-header-npm-3.329.0-e3a2c4eb17-f0470b64e8.zip/node_modules/@aws-sdk/middleware-host-header/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-host-header-npm-3.342.0-b4c3ff14b2-e2fffc9e6e.zip/node_modules/@aws-sdk/middleware-host-header/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-host-header", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-host-header", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-location-constraint", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.329.0-8540f0677e-3fb7da295e.zip/node_modules/@aws-sdk/middleware-location-constraint/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.342.0-3f42e0f9ba-e5280dd6e6.zip/node_modules/@aws-sdk/middleware-location-constraint/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-location-constraint", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-location-constraint", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-logger", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-logger-npm-3.329.0-a83672165b-b8b4732902.zip/node_modules/@aws-sdk/middleware-logger/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-logger-npm-3.342.0-df42508fd6-dd21063fcf.zip/node_modules/@aws-sdk/middleware-logger/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-logger", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-logger", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-recursion-detection", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.329.0-9530d1707a-7dff5457a7.zip/node_modules/@aws-sdk/middleware-recursion-detection/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.342.0-c62ee6ac40-db1969cf8b.zip/node_modules/@aws-sdk/middleware-recursion-detection/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-recursion-detection", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-recursion-detection", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-retry", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-retry-npm-3.329.0-f85eca00a2-9d66667c56.zip/node_modules/@aws-sdk/middleware-retry/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-retry-npm-3.342.0-d5517fccfd-523f92bb27.zip/node_modules/@aws-sdk/middleware-retry/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-retry", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/service-error-classification", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/util-middleware", "npm:3.329.0"],\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"],\ + ["@aws-sdk/middleware-retry", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/service-error-classification", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/util-middleware", "npm:3.342.0"],\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"],\ ["uuid", "npm:8.3.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-sdk-s3", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.329.0-a4fe70ab4c-8045000e8f.zip/node_modules/@aws-sdk/middleware-sdk-s3/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.342.0-2c728e24ae-9566084c94.zip/node_modules/@aws-sdk/middleware-sdk-s3/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-sdk-s3", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/middleware-sdk-s3", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-arn-parser", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-sdk-sqs", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.329.0-53e6711cf6-9d1e875bfb.zip/node_modules/@aws-sdk/middleware-sdk-sqs/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.342.0-d5c9d0d879-19853b3446.zip/node_modules/@aws-sdk/middleware-sdk-sqs/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-sdk-sqs", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/middleware-sdk-sqs", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-hex-encoding", "npm:3.310.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-sdk-sts", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.329.0-b8e0612c39-845b3f43bb.zip/node_modules/@aws-sdk/middleware-sdk-sts/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.342.0-8a277a2a67-39c8d9ae7e.zip/node_modules/@aws-sdk/middleware-sdk-sts/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-sdk-sts", "npm:3.329.0"],\ - ["@aws-sdk/middleware-signing", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-sdk-sts", "npm:3.342.0"],\ + ["@aws-sdk/middleware-signing", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-serde", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-serde-npm-3.329.0-70b1cb397b-d200e91340.zip/node_modules/@aws-sdk/middleware-serde/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-serde-npm-3.342.0-639212e00d-9620ae05af.zip/node_modules/@aws-sdk/middleware-serde/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-serde", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-serde", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-signing", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-signing-npm-3.329.0-fafebbac45-06103d8a7d.zip/node_modules/@aws-sdk/middleware-signing/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-signing-npm-3.342.0-e6a817dad1-ccbede8d93.zip/node_modules/@aws-sdk/middleware-signing/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-signing", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/signature-v4", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/util-middleware", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-signing", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/signature-v4", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/util-middleware", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-ssec", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-ssec-npm-3.329.0-481068fcc0-60d044f82d.zip/node_modules/@aws-sdk/middleware-ssec/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-ssec-npm-3.342.0-d6bbb89594-d4f0daae97.zip/node_modules/@aws-sdk/middleware-ssec/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-ssec", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-ssec", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-stack", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-stack-npm-3.329.0-deb18647d9-80f34d8ff6.zip/node_modules/@aws-sdk/middleware-stack/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-stack-npm-3.342.0-c0157485e2-1529e1a9b7.zip/node_modules/@aws-sdk/middleware-stack/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/middleware-user-agent", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.332.0-477b2b503f-75bfe862c1.zip/node_modules/@aws-sdk/middleware-user-agent/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.342.0-f097e2f310-e308f45750.zip/node_modules/@aws-sdk/middleware-user-agent/",\ "packageDependencies": [\ - ["@aws-sdk/middleware-user-agent", "npm:3.332.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/middleware-user-agent", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/node-config-provider", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-node-config-provider-npm-3.329.0-bea365bcec-2af283e3f5.zip/node_modules/@aws-sdk/node-config-provider/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-node-config-provider-npm-3.342.0-926e20a014-6b3a6a132e.zip/node_modules/@aws-sdk/node-config-provider/",\ "packageDependencies": [\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/node-http-handler", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-node-http-handler-npm-3.329.0-d3b0d332dc-6b688a94f0.zip/node_modules/@aws-sdk/node-http-handler/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-node-http-handler-npm-3.342.0-fb790820b0-02c12aa1f8.zip/node_modules/@aws-sdk/node-http-handler/",\ "packageDependencies": [\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/abort-controller", "npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/querystring-builder", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/abort-controller", "npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/querystring-builder", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/property-provider", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-property-provider-npm-3.329.0-8f019ecd0f-e11809cea3.zip/node_modules/@aws-sdk/property-provider/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-property-provider-npm-3.342.0-023018a9c0-17996d9f76.zip/node_modules/@aws-sdk/property-provider/",\ "packageDependencies": [\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/protocol-http", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-protocol-http-npm-3.329.0-9599f077f6-459a46d8c0.zip/node_modules/@aws-sdk/protocol-http/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-protocol-http-npm-3.342.0-a8ea022684-223a433d48.zip/node_modules/@aws-sdk/protocol-http/",\ "packageDependencies": [\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/querystring-builder", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-querystring-builder-npm-3.329.0-2df4fb67f1-681efb98ac.zip/node_modules/@aws-sdk/querystring-builder/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-querystring-builder-npm-3.342.0-8d56a52973-4e383be6ef.zip/node_modules/@aws-sdk/querystring-builder/",\ "packageDependencies": [\ - ["@aws-sdk/querystring-builder", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/querystring-builder", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-uri-escape", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/querystring-parser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-querystring-parser-npm-3.329.0-4b1a1e0fb5-9ed54dc61d.zip/node_modules/@aws-sdk/querystring-parser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-querystring-parser-npm-3.342.0-5463bc8cc6-4134368032.zip/node_modules/@aws-sdk/querystring-parser/",\ "packageDependencies": [\ - ["@aws-sdk/querystring-parser", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/querystring-parser", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/service-error-classification", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-service-error-classification-npm-3.329.0-c85b83bd81-215b61f2cc.zip/node_modules/@aws-sdk/service-error-classification/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-service-error-classification-npm-3.342.0-4bb5c4998b-539998f7b0.zip/node_modules/@aws-sdk/service-error-classification/",\ "packageDependencies": [\ - ["@aws-sdk/service-error-classification", "npm:3.329.0"]\ + ["@aws-sdk/service-error-classification", "npm:3.342.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/shared-ini-file-loader", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.329.0-b4fe16c15a-4dda8a5a79.zip/node_modules/@aws-sdk/shared-ini-file-loader/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.342.0-2715e0fd8d-c81cbddccc.zip/node_modules/@aws-sdk/shared-ini-file-loader/",\ "packageDependencies": [\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/signature-v4", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-signature-v4-npm-3.329.0-0702b2b15c-aba37d7f61.zip/node_modules/@aws-sdk/signature-v4/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-signature-v4-npm-3.342.0-5a4105c487-f667c81ecf.zip/node_modules/@aws-sdk/signature-v4/",\ "packageDependencies": [\ - ["@aws-sdk/signature-v4", "npm:3.329.0"],\ + ["@aws-sdk/signature-v4", "npm:3.342.0"],\ + ["@aws-sdk/eventstream-codec", "npm:3.342.0"],\ ["@aws-sdk/is-array-buffer", "npm:3.310.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-hex-encoding", "npm:3.310.0"],\ - ["@aws-sdk/util-middleware", "npm:3.329.0"],\ + ["@aws-sdk/util-middleware", "npm:3.342.0"],\ ["@aws-sdk/util-uri-escape", "npm:3.310.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/signature-v4-multi-region", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.329.0-1b40e0f10c-1e7ad0e74e.zip/node_modules/@aws-sdk/signature-v4-multi-region/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.342.0-cba446ba60-e086c0a4ea.zip/node_modules/@aws-sdk/signature-v4-multi-region/",\ "packageDependencies": [\ - ["@aws-sdk/signature-v4-multi-region", "npm:3.329.0"]\ + ["@aws-sdk/signature-v4-multi-region", "npm:3.342.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:b8db621e0d35f45cf59bd6b60bbb57d0c723471a62c90fdc377d8aa78d7ba67bf923f9191d8d8133984e588fd6e0cae02985527562b0ac3e2f9863aff748181f#npm:3.329.0", {\ - "packageLocation": "./.yarn/__virtual__/@aws-sdk-signature-v4-multi-region-virtual-7742d7c71f/0/cache/@aws-sdk-signature-v4-multi-region-npm-3.329.0-1b40e0f10c-1e7ad0e74e.zip/node_modules/@aws-sdk/signature-v4-multi-region/",\ + ["virtual:a2692091c56671014ef90dfc527c269ffce74fb9107ac79a6fecc78ba99f8f84ad4e9d9854c2d0b58ee2fc1a7821570f01d9315a903e969369ce0d5c13a1b681#npm:3.342.0", {\ + "packageLocation": "./.yarn/__virtual__/@aws-sdk-signature-v4-multi-region-virtual-613f4a0a1e/0/cache/@aws-sdk-signature-v4-multi-region-npm-3.342.0-cba446ba60-e086c0a4ea.zip/node_modules/@aws-sdk/signature-v4-multi-region/",\ "packageDependencies": [\ - ["@aws-sdk/signature-v4-multi-region", "virtual:b8db621e0d35f45cf59bd6b60bbb57d0c723471a62c90fdc377d8aa78d7ba67bf923f9191d8d8133984e588fd6e0cae02985527562b0ac3e2f9863aff748181f#npm:3.329.0"],\ - ["@aws-sdk/protocol-http", "npm:3.329.0"],\ - ["@aws-sdk/signature-v4", "npm:3.329.0"],\ + ["@aws-sdk/signature-v4-multi-region", "virtual:a2692091c56671014ef90dfc527c269ffce74fb9107ac79a6fecc78ba99f8f84ad4e9d9854c2d0b58ee2fc1a7821570f01d9315a903e969369ce0d5c13a1b681#npm:3.342.0"],\ + ["@aws-sdk/protocol-http", "npm:3.342.0"],\ + ["@aws-sdk/signature-v4", "npm:3.342.0"],\ ["@aws-sdk/signature-v4-crt", null],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@types/aws-sdk__signature-v4-crt", null],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "packagePeers": [\ "@aws-sdk/signature-v4-crt",\ @@ -1180,57 +1187,49 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@aws-sdk/smithy-client", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-smithy-client-npm-3.329.0-7cced1d303-45f87ed846.zip/node_modules/@aws-sdk/smithy-client/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-smithy-client-npm-3.342.0-0fae178127-e7a5c54479.zip/node_modules/@aws-sdk/smithy-client/",\ "packageDependencies": [\ - ["@aws-sdk/smithy-client", "npm:3.329.0"],\ - ["@aws-sdk/middleware-stack", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/smithy-client", "npm:3.342.0"],\ + ["@aws-sdk/middleware-stack", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/token-providers", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-token-providers-npm-3.332.0-9ddcf5ab88-0e04a9d0d6.zip/node_modules/@aws-sdk/token-providers/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-token-providers-npm-3.342.0-fc5052268f-25bedb2560.zip/node_modules/@aws-sdk/token-providers/",\ "packageDependencies": [\ - ["@aws-sdk/token-providers", "npm:3.332.0"],\ - ["@aws-sdk/client-sso-oidc", "npm:3.332.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/shared-ini-file-loader", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/token-providers", "npm:3.342.0"],\ + ["@aws-sdk/client-sso-oidc", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/shared-ini-file-loader", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/types", [\ - ["npm:3.310.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-types-npm-3.310.0-a69559b984-dea8ff0327.zip/node_modules/@aws-sdk/types/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-types-npm-3.342.0-9a22255552-e72bd40015.zip/node_modules/@aws-sdk/types/",\ "packageDependencies": [\ - ["@aws-sdk/types", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-types-npm-3.329.0-06a5c61fa9-28aff60622.zip/node_modules/@aws-sdk/types/",\ - "packageDependencies": [\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/url-parser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-url-parser-npm-3.329.0-70076d0522-9ca336e5bb.zip/node_modules/@aws-sdk/url-parser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-url-parser-npm-3.342.0-4a5ceacadc-0aab9fc60c.zip/node_modules/@aws-sdk/url-parser/",\ "packageDependencies": [\ - ["@aws-sdk/url-parser", "npm:3.329.0"],\ - ["@aws-sdk/querystring-parser", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/url-parser", "npm:3.342.0"],\ + ["@aws-sdk/querystring-parser", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1240,7 +1239,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-arn-parser-npm-3.310.0-06bb539cba-3d73b997d0.zip/node_modules/@aws-sdk/util-arn-parser/",\ "packageDependencies": [\ ["@aws-sdk/util-arn-parser", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1251,7 +1250,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-buffer-from", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1261,7 +1260,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-body-length-browser-npm-3.310.0-32f77bd9c6-ef2ff1e30b.zip/node_modules/@aws-sdk/util-body-length-browser/",\ "packageDependencies": [\ ["@aws-sdk/util-body-length-browser", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1271,7 +1270,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-body-length-node-npm-3.310.0-dff3170f3a-1b5c403a22.zip/node_modules/@aws-sdk/util-body-length-node/",\ "packageDependencies": [\ ["@aws-sdk/util-body-length-node", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1282,7 +1281,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@aws-sdk/util-buffer-from", "npm:3.310.0"],\ ["@aws-sdk/is-array-buffer", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1292,46 +1291,46 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-config-provider-npm-3.310.0-15877c83d4-e6d643c2e3.zip/node_modules/@aws-sdk/util-config-provider/",\ "packageDependencies": [\ ["@aws-sdk/util-config-provider", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-defaults-mode-browser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.329.0-c5d6a57d9a-ccff18607b.zip/node_modules/@aws-sdk/util-defaults-mode-browser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.342.0-21b1a48f56-1791b2098f.zip/node_modules/@aws-sdk/util-defaults-mode-browser/",\ "packageDependencies": [\ - ["@aws-sdk/util-defaults-mode-browser", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/util-defaults-mode-browser", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["bowser", "npm:2.11.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-defaults-mode-node", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.329.0-fd81099dd9-f927efbc3d.zip/node_modules/@aws-sdk/util-defaults-mode-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.342.0-32a006daa1-2aaceef844.zip/node_modules/@aws-sdk/util-defaults-mode-node/",\ "packageDependencies": [\ - ["@aws-sdk/util-defaults-mode-node", "npm:3.329.0"],\ - ["@aws-sdk/config-resolver", "npm:3.329.0"],\ - ["@aws-sdk/credential-provider-imds", "npm:3.329.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/property-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/util-defaults-mode-node", "npm:3.342.0"],\ + ["@aws-sdk/config-resolver", "npm:3.342.0"],\ + ["@aws-sdk/credential-provider-imds", "npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/property-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-endpoints", [\ - ["npm:3.332.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-endpoints-npm-3.332.0-8713e2eaa5-1974420c77.zip/node_modules/@aws-sdk/util-endpoints/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-endpoints-npm-3.342.0-4f4386f7a0-b93ab766a6.zip/node_modules/@aws-sdk/util-endpoints/",\ "packageDependencies": [\ - ["@aws-sdk/util-endpoints", "npm:3.332.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/util-endpoints", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1341,7 +1340,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-hex-encoding-npm-3.310.0-aef31b4def-4278f82d7c.zip/node_modules/@aws-sdk/util-hex-encoding/",\ "packageDependencies": [\ ["@aws-sdk/util-hex-encoding", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1351,56 +1350,56 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-locate-window-npm-3.310.0-0bb775a2bf-f9bb866eac.zip/node_modules/@aws-sdk/util-locate-window/",\ "packageDependencies": [\ ["@aws-sdk/util-locate-window", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-middleware", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-middleware-npm-3.329.0-659548e387-0493c049ae.zip/node_modules/@aws-sdk/util-middleware/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-middleware-npm-3.342.0-82315fe65e-124e68ffe8.zip/node_modules/@aws-sdk/util-middleware/",\ "packageDependencies": [\ - ["@aws-sdk/util-middleware", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/util-middleware", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-retry", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-retry-npm-3.329.0-39c3180797-3612d19ae4.zip/node_modules/@aws-sdk/util-retry/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-retry-npm-3.342.0-969adc3ffe-ef695eb274.zip/node_modules/@aws-sdk/util-retry/",\ "packageDependencies": [\ - ["@aws-sdk/util-retry", "npm:3.329.0"],\ - ["@aws-sdk/service-error-classification", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/util-retry", "npm:3.342.0"],\ + ["@aws-sdk/service-error-classification", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-stream-browser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-stream-browser-npm-3.329.0-4ba913c033-cf5f8ed1a1.zip/node_modules/@aws-sdk/util-stream-browser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-stream-browser-npm-3.342.0-4a01f965f4-b29e4b4d00.zip/node_modules/@aws-sdk/util-stream-browser/",\ "packageDependencies": [\ - ["@aws-sdk/util-stream-browser", "npm:3.329.0"],\ - ["@aws-sdk/fetch-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/util-stream-browser", "npm:3.342.0"],\ + ["@aws-sdk/fetch-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-base64", "npm:3.310.0"],\ ["@aws-sdk/util-hex-encoding", "npm:3.310.0"],\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-stream-node", [\ - ["npm:3.331.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-stream-node-npm-3.331.0-0e02a12ca4-9519a1718d.zip/node_modules/@aws-sdk/util-stream-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-stream-node-npm-3.342.0-b59f69b0e2-99c2e126e2.zip/node_modules/@aws-sdk/util-stream-node/",\ "packageDependencies": [\ - ["@aws-sdk/util-stream-node", "npm:3.331.0"],\ - ["@aws-sdk/node-http-handler", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/util-stream-node", "npm:3.342.0"],\ + ["@aws-sdk/node-http-handler", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@aws-sdk/util-buffer-from", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1410,40 +1409,40 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-uri-escape-npm-3.310.0-c20e335602-98b604ad21.zip/node_modules/@aws-sdk/util-uri-escape/",\ "packageDependencies": [\ ["@aws-sdk/util-uri-escape", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-user-agent-browser", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.329.0-14a80d95c5-04f10b65e7.zip/node_modules/@aws-sdk/util-user-agent-browser/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.342.0-7ce482acc1-2dc9690a77.zip/node_modules/@aws-sdk/util-user-agent-browser/",\ "packageDependencies": [\ - ["@aws-sdk/util-user-agent-browser", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/util-user-agent-browser", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["bowser", "npm:2.11.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-user-agent-node", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.329.0-178e22c724-cebebd6e4d.zip/node_modules/@aws-sdk/util-user-agent-node/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.342.0-de2b4e3eb1-5703e2a13f.zip/node_modules/@aws-sdk/util-user-agent-node/",\ "packageDependencies": [\ - ["@aws-sdk/util-user-agent-node", "npm:3.329.0"]\ + ["@aws-sdk/util-user-agent-node", "npm:3.342.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0", {\ - "packageLocation": "./.yarn/__virtual__/@aws-sdk-util-user-agent-node-virtual-fc85c3182d/0/cache/@aws-sdk-util-user-agent-node-npm-3.329.0-178e22c724-cebebd6e4d.zip/node_modules/@aws-sdk/util-user-agent-node/",\ + ["virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0", {\ + "packageLocation": "./.yarn/__virtual__/@aws-sdk-util-user-agent-node-virtual-2ee983303c/0/cache/@aws-sdk-util-user-agent-node-npm-3.342.0-de2b4e3eb1-5703e2a13f.zip/node_modules/@aws-sdk/util-user-agent-node/",\ "packageDependencies": [\ - ["@aws-sdk/util-user-agent-node", "virtual:0a33ec496a246b6826f86bb51aee9298ece098492ff8ee3de973e5c3363ee5431a024c7aa6775468b238ee89292fd7c07f4cd6f60bd0ce227aa67645c08fdeae#npm:3.329.0"],\ - ["@aws-sdk/node-config-provider", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ + ["@aws-sdk/util-user-agent-node", "virtual:be2d1dcabe55972b52a042ce47afb71a23121250d688902c36244c1e8d388457ad5dfd9f2934390858a8dbf8233f8ba876e709e631dbbbb6b5cf5e923473581b#npm:3.342.0"],\ + ["@aws-sdk/node-config-provider", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ ["@types/aws-crt", null],\ ["aws-crt", null],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "packagePeers": [\ "@types/aws-crt",\ @@ -1458,7 +1457,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@aws-sdk/util-utf8", "npm:3.310.0"],\ ["@aws-sdk/util-buffer-from", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1468,19 +1467,19 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-util-utf8-browser-npm-3.259.0-343a1dba08-32092ea40f.zip/node_modules/@aws-sdk/util-utf8-browser/",\ "packageDependencies": [\ ["@aws-sdk/util-utf8-browser", "npm:3.259.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@aws-sdk/util-waiter", [\ - ["npm:3.329.0", {\ - "packageLocation": "./.yarn/cache/@aws-sdk-util-waiter-npm-3.329.0-c0bf2618c8-f32fd95b7d.zip/node_modules/@aws-sdk/util-waiter/",\ + ["npm:3.342.0", {\ + "packageLocation": "./.yarn/cache/@aws-sdk-util-waiter-npm-3.342.0-9933a11c25-404a4ebece.zip/node_modules/@aws-sdk/util-waiter/",\ "packageDependencies": [\ - ["@aws-sdk/util-waiter", "npm:3.329.0"],\ - ["@aws-sdk/abort-controller", "npm:3.329.0"],\ - ["@aws-sdk/types", "npm:3.329.0"],\ - ["tslib", "npm:2.5.0"]\ + ["@aws-sdk/util-waiter", "npm:3.342.0"],\ + ["@aws-sdk/abort-controller", "npm:3.342.0"],\ + ["@aws-sdk/types", "npm:3.342.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1490,7 +1489,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@aws-sdk-xml-builder-npm-3.310.0-5c3886db44-339d09d715.zip/node_modules/@aws-sdk/xml-builder/",\ "packageDependencies": [\ ["@aws-sdk/xml-builder", "npm:3.310.0"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -1506,29 +1505,29 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/compat-data", [\ - ["npm:7.21.7", {\ - "packageLocation": "./.yarn/cache/@babel-compat-data-npm-7.21.7-62e7f604b1-4a1451f70f.zip/node_modules/@babel/compat-data/",\ + ["npm:7.22.3", {\ + "packageLocation": "./.yarn/cache/@babel-compat-data-npm-7.22.3-7b67f6cb95-87573507cb.zip/node_modules/@babel/compat-data/",\ "packageDependencies": [\ - ["@babel/compat-data", "npm:7.21.7"]\ + ["@babel/compat-data", "npm:7.22.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@babel/core", [\ - ["npm:7.21.8", {\ - "packageLocation": "./.yarn/cache/@babel-core-npm-7.21.8-236525e651-81e8853407.zip/node_modules/@babel/core/",\ + ["npm:7.22.1", {\ + "packageLocation": "./.yarn/cache/@babel-core-npm-7.22.1-4ec1915241-8fd937c298.zip/node_modules/@babel/core/",\ "packageDependencies": [\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@ampproject/remapping", "npm:2.2.1"],\ ["@babel/code-frame", "npm:7.21.4"],\ - ["@babel/generator", "npm:7.21.5"],\ - ["@babel/helper-compilation-targets", "virtual:236525e65171af5122d956afa7f1e21185d6a0eead38e7b3787a37c459cac573c1780a1c3350b46271bbc6a1baa02fae13a95688c5f51a63fa08d7ca7a6dd9a4#npm:7.21.5"],\ - ["@babel/helper-module-transforms", "npm:7.21.5"],\ - ["@babel/helpers", "npm:7.21.5"],\ - ["@babel/parser", "npm:7.21.8"],\ - ["@babel/template", "npm:7.20.7"],\ - ["@babel/traverse", "npm:7.21.5"],\ - ["@babel/types", "npm:7.21.5"],\ + ["@babel/generator", "npm:7.22.3"],\ + ["@babel/helper-compilation-targets", "virtual:4ec1915241a55102cd89412178079226c6c3c25c9551bd72b4a663e73c28021f47c6621b59555f399bb0e3072da0356d22712e2ecb03b659a6d554e2ddf6a468#npm:7.22.1"],\ + ["@babel/helper-module-transforms", "npm:7.22.1"],\ + ["@babel/helpers", "npm:7.22.3"],\ + ["@babel/parser", "npm:7.22.4"],\ + ["@babel/template", "npm:7.21.9"],\ + ["@babel/traverse", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"],\ ["convert-source-map", "npm:1.9.0"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ ["gensync", "npm:1.0.0-beta.2"],\ @@ -1539,11 +1538,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/generator", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-generator-npm-7.21.5-576849ce71-8ae5c7ece0.zip/node_modules/@babel/generator/",\ + ["npm:7.22.3", {\ + "packageLocation": "./.yarn/cache/@babel-generator-npm-7.22.3-da14afacf5-29543a50bb.zip/node_modules/@babel/generator/",\ "packageDependencies": [\ - ["@babel/generator", "npm:7.21.5"],\ - ["@babel/types", "npm:7.21.5"],\ + ["@babel/generator", "npm:7.22.3"],\ + ["@babel/types", "npm:7.22.4"],\ ["@jridgewell/gen-mapping", "npm:0.3.3"],\ ["@jridgewell/trace-mapping", "npm:0.3.18"],\ ["jsesc", "npm:2.5.2"]\ @@ -1552,22 +1551,22 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/helper-compilation-targets", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-helper-compilation-targets-npm-7.21.5-999fc74b3f-d716fa2845.zip/node_modules/@babel/helper-compilation-targets/",\ + ["npm:7.22.1", {\ + "packageLocation": "./.yarn/cache/@babel-helper-compilation-targets-npm-7.22.1-4f7cfd1a17-41b4c96c17.zip/node_modules/@babel/helper-compilation-targets/",\ "packageDependencies": [\ - ["@babel/helper-compilation-targets", "npm:7.21.5"]\ + ["@babel/helper-compilation-targets", "npm:7.22.1"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:236525e65171af5122d956afa7f1e21185d6a0eead38e7b3787a37c459cac573c1780a1c3350b46271bbc6a1baa02fae13a95688c5f51a63fa08d7ca7a6dd9a4#npm:7.21.5", {\ - "packageLocation": "./.yarn/__virtual__/@babel-helper-compilation-targets-virtual-ee2513f4cd/0/cache/@babel-helper-compilation-targets-npm-7.21.5-999fc74b3f-d716fa2845.zip/node_modules/@babel/helper-compilation-targets/",\ + ["virtual:4ec1915241a55102cd89412178079226c6c3c25c9551bd72b4a663e73c28021f47c6621b59555f399bb0e3072da0356d22712e2ecb03b659a6d554e2ddf6a468#npm:7.22.1", {\ + "packageLocation": "./.yarn/__virtual__/@babel-helper-compilation-targets-virtual-786beb9c5c/0/cache/@babel-helper-compilation-targets-npm-7.22.1-4f7cfd1a17-41b4c96c17.zip/node_modules/@babel/helper-compilation-targets/",\ "packageDependencies": [\ - ["@babel/helper-compilation-targets", "virtual:236525e65171af5122d956afa7f1e21185d6a0eead38e7b3787a37c459cac573c1780a1c3350b46271bbc6a1baa02fae13a95688c5f51a63fa08d7ca7a6dd9a4#npm:7.21.5"],\ - ["@babel/compat-data", "npm:7.21.7"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/helper-compilation-targets", "virtual:4ec1915241a55102cd89412178079226c6c3c25c9551bd72b4a663e73c28021f47c6621b59555f399bb0e3072da0356d22712e2ecb03b659a6d554e2ddf6a468#npm:7.22.1"],\ + ["@babel/compat-data", "npm:7.22.3"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-validator-option", "npm:7.21.0"],\ ["@types/babel__core", null],\ - ["browserslist", "npm:4.21.5"],\ + ["browserslist", "npm:4.21.7"],\ ["lru-cache", "npm:5.1.1"],\ ["semver", "npm:6.3.0"]\ ],\ @@ -1579,10 +1578,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/helper-environment-visitor", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-helper-environment-visitor-npm-7.21.5-7d7d1d1996-b9177ab55a.zip/node_modules/@babel/helper-environment-visitor/",\ + ["npm:7.22.1", {\ + "packageLocation": "./.yarn/cache/@babel-helper-environment-visitor-npm-7.22.1-e00fbc528d-0849bb9a9d.zip/node_modules/@babel/helper-environment-visitor/",\ "packageDependencies": [\ - ["@babel/helper-environment-visitor", "npm:7.21.5"]\ + ["@babel/helper-environment-visitor", "npm:7.22.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -1592,8 +1591,8 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@babel-helper-function-name-npm-7.21.0-a17ce5a05a-8dd9f12d53.zip/node_modules/@babel/helper-function-name/",\ "packageDependencies": [\ ["@babel/helper-function-name", "npm:7.21.0"],\ - ["@babel/template", "npm:7.20.7"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/template", "npm:7.21.9"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1603,7 +1602,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@babel-helper-hoist-variables-npm-7.18.6-6eb061f405-462ef0d14f.zip/node_modules/@babel/helper-hoist-variables/",\ "packageDependencies": [\ ["@babel/helper-hoist-variables", "npm:7.18.6"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1613,24 +1612,24 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@babel-helper-module-imports-npm-7.21.4-e4cd6b4e21-e16de39ce0.zip/node_modules/@babel/helper-module-imports/",\ "packageDependencies": [\ ["@babel/helper-module-imports", "npm:7.21.4"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@babel/helper-module-transforms", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-helper-module-transforms-npm-7.21.5-f21e36f6a3-024306552d.zip/node_modules/@babel/helper-module-transforms/",\ + ["npm:7.22.1", {\ + "packageLocation": "./.yarn/cache/@babel-helper-module-transforms-npm-7.22.1-bd7615b6f7-f4d4a4aabf.zip/node_modules/@babel/helper-module-transforms/",\ "packageDependencies": [\ - ["@babel/helper-module-transforms", "npm:7.21.5"],\ - ["@babel/helper-environment-visitor", "npm:7.21.5"],\ + ["@babel/helper-module-transforms", "npm:7.22.1"],\ + ["@babel/helper-environment-visitor", "npm:7.22.1"],\ ["@babel/helper-module-imports", "npm:7.21.4"],\ ["@babel/helper-simple-access", "npm:7.21.5"],\ ["@babel/helper-split-export-declaration", "npm:7.18.6"],\ ["@babel/helper-validator-identifier", "npm:7.19.1"],\ - ["@babel/template", "npm:7.20.7"],\ - ["@babel/traverse", "npm:7.21.5"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/template", "npm:7.21.9"],\ + ["@babel/traverse", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1649,7 +1648,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@babel-helper-simple-access-npm-7.21.5-adbdd3a62b-ba5cf630a5.zip/node_modules/@babel/helper-simple-access/",\ "packageDependencies": [\ ["@babel/helper-simple-access", "npm:7.21.5"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1659,7 +1658,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@babel-helper-split-export-declaration-npm-7.18.6-53ebf8ad4c-a7834c5b54.zip/node_modules/@babel/helper-split-export-declaration/",\ "packageDependencies": [\ ["@babel/helper-split-export-declaration", "npm:7.18.6"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1692,13 +1691,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/helpers", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-helpers-npm-7.21.5-86b407bd6a-55c2ca9987.zip/node_modules/@babel/helpers/",\ + ["npm:7.22.3", {\ + "packageLocation": "./.yarn/cache/@babel-helpers-npm-7.22.3-0e890dfceb-fe9bed4b88.zip/node_modules/@babel/helpers/",\ "packageDependencies": [\ - ["@babel/helpers", "npm:7.21.5"],\ - ["@babel/template", "npm:7.20.7"],\ - ["@babel/traverse", "npm:7.21.5"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/helpers", "npm:7.22.3"],\ + ["@babel/template", "npm:7.21.9"],\ + ["@babel/traverse", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1716,11 +1715,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/parser", [\ - ["npm:7.21.8", {\ - "packageLocation": "./.yarn/cache/@babel-parser-npm-7.21.8-2fefc717c4-bd71a12bc7.zip/node_modules/@babel/parser/",\ + ["npm:7.22.4", {\ + "packageLocation": "./.yarn/cache/@babel-parser-npm-7.22.4-32183c89ee-98c5dc2de7.zip/node_modules/@babel/parser/",\ "packageDependencies": [\ - ["@babel/parser", "npm:7.21.8"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/parser", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -1737,7 +1736,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-async-generators-virtual-352c7415ae/0/cache/@babel-plugin-syntax-async-generators-npm-7.8.4-d10cf993c9-518ee81097.zip/node_modules/@babel/plugin-syntax-async-generators/",\ "packageDependencies": [\ ["@babel/plugin-syntax-async-generators", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1751,9 +1750,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-async-generators-virtual-87484c77eb/0/cache/@babel-plugin-syntax-async-generators-npm-7.8.4-d10cf993c9-518ee81097.zip/node_modules/@babel/plugin-syntax-async-generators/",\ "packageDependencies": [\ ["@babel/plugin-syntax-async-generators", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -1774,7 +1773,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-bigint-virtual-6bb39105cd/0/cache/@babel-plugin-syntax-bigint-npm-7.8.3-b05d971e6c-7c7ac943e4.zip/node_modules/@babel/plugin-syntax-bigint/",\ "packageDependencies": [\ ["@babel/plugin-syntax-bigint", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1788,9 +1787,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-bigint-virtual-80997e8856/0/cache/@babel-plugin-syntax-bigint-npm-7.8.3-b05d971e6c-7c7ac943e4.zip/node_modules/@babel/plugin-syntax-bigint/",\ "packageDependencies": [\ ["@babel/plugin-syntax-bigint", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -1811,7 +1810,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-class-properties-virtual-7cea8114d0/0/cache/@babel-plugin-syntax-class-properties-npm-7.12.13-002ee9d930-7a9d076a55.zip/node_modules/@babel/plugin-syntax-class-properties/",\ "packageDependencies": [\ ["@babel/plugin-syntax-class-properties", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.12.13"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1825,9 +1824,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-class-properties-virtual-d01d291cc8/0/cache/@babel-plugin-syntax-class-properties-npm-7.12.13-002ee9d930-7a9d076a55.zip/node_modules/@babel/plugin-syntax-class-properties/",\ "packageDependencies": [\ ["@babel/plugin-syntax-class-properties", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.12.13"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -1848,7 +1847,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-import-meta-virtual-b62af335d8/0/cache/@babel-plugin-syntax-import-meta-npm-7.10.4-4a0a0158bc-8513fb2d40.zip/node_modules/@babel/plugin-syntax-import-meta/",\ "packageDependencies": [\ ["@babel/plugin-syntax-import-meta", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.10.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1862,9 +1861,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-import-meta-virtual-a122931e1a/0/cache/@babel-plugin-syntax-import-meta-npm-7.10.4-4a0a0158bc-8513fb2d40.zip/node_modules/@babel/plugin-syntax-import-meta/",\ "packageDependencies": [\ ["@babel/plugin-syntax-import-meta", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.10.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -1885,7 +1884,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-json-strings-virtual-b58bb69866/0/cache/@babel-plugin-syntax-json-strings-npm-7.8.3-6dc7848179-d21aa96f15.zip/node_modules/@babel/plugin-syntax-json-strings/",\ "packageDependencies": [\ ["@babel/plugin-syntax-json-strings", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1899,9 +1898,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-json-strings-virtual-89eb76435b/0/cache/@babel-plugin-syntax-json-strings-npm-7.8.3-6dc7848179-d21aa96f15.zip/node_modules/@babel/plugin-syntax-json-strings/",\ "packageDependencies": [\ ["@babel/plugin-syntax-json-strings", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -1922,7 +1921,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-jsx-virtual-1ab67235ee/0/cache/@babel-plugin-syntax-jsx-npm-7.21.4-52d55c7a43-ee15877843.zip/node_modules/@babel/plugin-syntax-jsx/",\ "packageDependencies": [\ ["@babel/plugin-syntax-jsx", "virtual:2187ce2f072cb5e40780d7cadfa7b959443960e4540d0f21cd80557a038cdba80efd8f7fbdbc902d4001bb391176118d0a81d6bfa2fe326dc4a5ba08f0c3c8b7#npm:7.21.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1945,7 +1944,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-logical-assignment-operators-virtual-6f23e618a8/0/cache/@babel-plugin-syntax-logical-assignment-operators-npm-7.10.4-72ae00fdf6-3a01f61a5b.zip/node_modules/@babel/plugin-syntax-logical-assignment-operators/",\ "packageDependencies": [\ ["@babel/plugin-syntax-logical-assignment-operators", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.10.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1959,9 +1958,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-logical-assignment-operators-virtual-2bb58ec5d8/0/cache/@babel-plugin-syntax-logical-assignment-operators-npm-7.10.4-72ae00fdf6-3a01f61a5b.zip/node_modules/@babel/plugin-syntax-logical-assignment-operators/",\ "packageDependencies": [\ ["@babel/plugin-syntax-logical-assignment-operators", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.10.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -1982,7 +1981,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-nullish-coalescing-operator-virtual-f544659eee/0/cache/@babel-plugin-syntax-nullish-coalescing-operator-npm-7.8.3-8a723173b5-cc19c595a6.zip/node_modules/@babel/plugin-syntax-nullish-coalescing-operator/",\ "packageDependencies": [\ ["@babel/plugin-syntax-nullish-coalescing-operator", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -1996,9 +1995,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-nullish-coalescing-operator-virtual-f8e874edbc/0/cache/@babel-plugin-syntax-nullish-coalescing-operator-npm-7.8.3-8a723173b5-cc19c595a6.zip/node_modules/@babel/plugin-syntax-nullish-coalescing-operator/",\ "packageDependencies": [\ ["@babel/plugin-syntax-nullish-coalescing-operator", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -2019,7 +2018,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-numeric-separator-virtual-0da074a235/0/cache/@babel-plugin-syntax-numeric-separator-npm-7.10.4-81444be605-32689c1628.zip/node_modules/@babel/plugin-syntax-numeric-separator/",\ "packageDependencies": [\ ["@babel/plugin-syntax-numeric-separator", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.10.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -2033,9 +2032,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-numeric-separator-virtual-aaef89f7e4/0/cache/@babel-plugin-syntax-numeric-separator-npm-7.10.4-81444be605-32689c1628.zip/node_modules/@babel/plugin-syntax-numeric-separator/",\ "packageDependencies": [\ ["@babel/plugin-syntax-numeric-separator", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.10.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -2056,7 +2055,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-object-rest-spread-virtual-88b5eebb9d/0/cache/@babel-plugin-syntax-object-rest-spread-npm-7.8.3-60bd05b6ae-868f8cd0c2.zip/node_modules/@babel/plugin-syntax-object-rest-spread/",\ "packageDependencies": [\ ["@babel/plugin-syntax-object-rest-spread", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -2070,9 +2069,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-object-rest-spread-virtual-f04c82208f/0/cache/@babel-plugin-syntax-object-rest-spread-npm-7.8.3-60bd05b6ae-868f8cd0c2.zip/node_modules/@babel/plugin-syntax-object-rest-spread/",\ "packageDependencies": [\ ["@babel/plugin-syntax-object-rest-spread", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -2093,7 +2092,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-optional-catch-binding-virtual-f3a68d5182/0/cache/@babel-plugin-syntax-optional-catch-binding-npm-7.8.3-ce337427d8-c6277360d5.zip/node_modules/@babel/plugin-syntax-optional-catch-binding/",\ "packageDependencies": [\ ["@babel/plugin-syntax-optional-catch-binding", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -2107,9 +2106,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-optional-catch-binding-virtual-ff8e09290e/0/cache/@babel-plugin-syntax-optional-catch-binding-npm-7.8.3-ce337427d8-c6277360d5.zip/node_modules/@babel/plugin-syntax-optional-catch-binding/",\ "packageDependencies": [\ ["@babel/plugin-syntax-optional-catch-binding", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -2130,7 +2129,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-optional-chaining-virtual-fec78cf19f/0/cache/@babel-plugin-syntax-optional-chaining-npm-7.8.3-f3f3c79579-fd81239a2b.zip/node_modules/@babel/plugin-syntax-optional-chaining/",\ "packageDependencies": [\ ["@babel/plugin-syntax-optional-chaining", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -2144,9 +2143,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-optional-chaining-virtual-c23636477f/0/cache/@babel-plugin-syntax-optional-chaining-npm-7.8.3-f3f3c79579-fd81239a2b.zip/node_modules/@babel/plugin-syntax-optional-chaining/",\ "packageDependencies": [\ ["@babel/plugin-syntax-optional-chaining", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -2167,7 +2166,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-top-level-await-virtual-c6392fcf17/0/cache/@babel-plugin-syntax-top-level-await-npm-7.14.5-60a0a2e83b-d62a60c7ad.zip/node_modules/@babel/plugin-syntax-top-level-await/",\ "packageDependencies": [\ ["@babel/plugin-syntax-top-level-await", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.14.5"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -2181,9 +2180,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-top-level-await-virtual-0c1a632c36/0/cache/@babel-plugin-syntax-top-level-await-npm-7.14.5-60a0a2e83b-d62a60c7ad.zip/node_modules/@babel/plugin-syntax-top-level-await/",\ "packageDependencies": [\ ["@babel/plugin-syntax-top-level-await", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.14.5"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -2204,7 +2203,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@babel-plugin-syntax-typescript-virtual-9b5081e357/0/cache/@babel-plugin-syntax-typescript-npm-7.21.4-bcb1097f7e-4ead663420.zip/node_modules/@babel/plugin-syntax-typescript/",\ "packageDependencies": [\ ["@babel/plugin-syntax-typescript", "virtual:2187ce2f072cb5e40780d7cadfa7b959443960e4540d0f21cd80557a038cdba80efd8f7fbdbc902d4001bb391176118d0a81d6bfa2fe326dc4a5ba08f0c3c8b7#npm:7.21.4"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/helper-plugin-utils", "npm:7.21.5"],\ ["@types/babel__core", null]\ ],\ @@ -2215,31 +2214,41 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["@babel/template", [\ - ["npm:7.20.7", {\ - "packageLocation": "./.yarn/cache/@babel-template-npm-7.20.7-c157fc5838-a655fb476b.zip/node_modules/@babel/template/",\ + ["@babel/runtime", [\ + ["npm:7.22.3", {\ + "packageLocation": "./.yarn/cache/@babel-runtime-npm-7.22.3-0fd780f66a-f42e4e8ef5.zip/node_modules/@babel/runtime/",\ "packageDependencies": [\ - ["@babel/template", "npm:7.20.7"],\ + ["@babel/runtime", "npm:7.22.3"],\ + ["regenerator-runtime", "npm:0.13.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@babel/template", [\ + ["npm:7.21.9", {\ + "packageLocation": "./.yarn/cache/@babel-template-npm-7.21.9-4016aa4c60-c57a31ccba.zip/node_modules/@babel/template/",\ + "packageDependencies": [\ + ["@babel/template", "npm:7.21.9"],\ ["@babel/code-frame", "npm:7.21.4"],\ - ["@babel/parser", "npm:7.21.8"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/parser", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@babel/traverse", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-traverse-npm-7.21.5-1ca322a4d6-b6b54c978a.zip/node_modules/@babel/traverse/",\ + ["npm:7.22.4", {\ + "packageLocation": "./.yarn/cache/@babel-traverse-npm-7.22.4-7501c8e8f8-9e1d2d08f4.zip/node_modules/@babel/traverse/",\ "packageDependencies": [\ - ["@babel/traverse", "npm:7.21.5"],\ + ["@babel/traverse", "npm:7.22.4"],\ ["@babel/code-frame", "npm:7.21.4"],\ - ["@babel/generator", "npm:7.21.5"],\ - ["@babel/helper-environment-visitor", "npm:7.21.5"],\ + ["@babel/generator", "npm:7.22.3"],\ + ["@babel/helper-environment-visitor", "npm:7.22.1"],\ ["@babel/helper-function-name", "npm:7.21.0"],\ ["@babel/helper-hoist-variables", "npm:7.18.6"],\ ["@babel/helper-split-export-declaration", "npm:7.18.6"],\ - ["@babel/parser", "npm:7.21.8"],\ - ["@babel/types", "npm:7.21.5"],\ + ["@babel/parser", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ ["globals", "npm:11.12.0"]\ ],\ @@ -2247,10 +2256,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@babel/types", [\ - ["npm:7.21.5", {\ - "packageLocation": "./.yarn/cache/@babel-types-npm-7.21.5-3c8c157928-779c3c9552.zip/node_modules/@babel/types/",\ + ["npm:7.22.4", {\ + "packageLocation": "./.yarn/cache/@babel-types-npm-7.22.4-7dadf03e9d-17c986be01.zip/node_modules/@babel/types/",\ "packageDependencies": [\ - ["@babel/types", "npm:7.21.5"],\ + ["@babel/types", "npm:7.22.4"],\ ["@babel/helper-string-parser", "npm:7.21.5"],\ ["@babel/helper-validator-identifier", "npm:7.19.1"],\ ["to-fast-properties", "npm:2.0.0"]\ @@ -2321,6 +2330,47 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["@chevrotain/cst-dts-gen", [\ + ["npm:10.5.0", {\ + "packageLocation": "./.yarn/cache/@chevrotain-cst-dts-gen-npm-10.5.0-96bdf6daf3-e690e1e567.zip/node_modules/@chevrotain/cst-dts-gen/",\ + "packageDependencies": [\ + ["@chevrotain/cst-dts-gen", "npm:10.5.0"],\ + ["@chevrotain/gast", "npm:10.5.0"],\ + ["@chevrotain/types", "npm:10.5.0"],\ + ["lodash", "npm:4.17.21"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@chevrotain/gast", [\ + ["npm:10.5.0", {\ + "packageLocation": "./.yarn/cache/@chevrotain-gast-npm-10.5.0-c98fd4883a-d0fa1434e0.zip/node_modules/@chevrotain/gast/",\ + "packageDependencies": [\ + ["@chevrotain/gast", "npm:10.5.0"],\ + ["@chevrotain/types", "npm:10.5.0"],\ + ["lodash", "npm:4.17.21"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@chevrotain/types", [\ + ["npm:10.5.0", {\ + "packageLocation": "./.yarn/cache/@chevrotain-types-npm-10.5.0-29d3508ef3-a12f552399.zip/node_modules/@chevrotain/types/",\ + "packageDependencies": [\ + ["@chevrotain/types", "npm:10.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@chevrotain/utils", [\ + ["npm:10.5.0", {\ + "packageLocation": "./.yarn/cache/@chevrotain-utils-npm-10.5.0-1c062e1720-b0e5ae2f2c.zip/node_modules/@chevrotain/utils/",\ + "packageDependencies": [\ + ["@chevrotain/utils", "npm:10.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@colors/colors", [\ ["npm:1.5.0", {\ "packageLocation": "./.yarn/cache/@colors-colors-npm-1.5.0-875af3a8b4-5e08870799.zip/node_modules/@colors/colors/",\ @@ -2331,12 +2381,12 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@commitlint/cli", [\ - ["npm:17.6.3", {\ - "packageLocation": "./.yarn/cache/@commitlint-cli-npm-17.6.3-583c622f77-118e138474.zip/node_modules/@commitlint/cli/",\ + ["npm:17.6.5", {\ + "packageLocation": "./.yarn/cache/@commitlint-cli-npm-17.6.5-1dd10cbe12-9bc387ae28.zip/node_modules/@commitlint/cli/",\ "packageDependencies": [\ - ["@commitlint/cli", "npm:17.6.3"],\ + ["@commitlint/cli", "npm:17.6.5"],\ ["@commitlint/format", "npm:17.4.4"],\ - ["@commitlint/lint", "npm:17.6.3"],\ + ["@commitlint/lint", "npm:17.6.5"],\ ["@commitlint/load", "npm:17.5.0"],\ ["@commitlint/read", "npm:17.5.1"],\ ["@commitlint/types", "npm:17.4.4"],\ @@ -2350,10 +2400,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@commitlint/config-conventional", [\ - ["npm:17.6.3", {\ - "packageLocation": "./.yarn/cache/@commitlint-config-conventional-npm-17.6.3-dc84eb5c43-8ebd54fde6.zip/node_modules/@commitlint/config-conventional/",\ + ["npm:17.6.5", {\ + "packageLocation": "./.yarn/cache/@commitlint-config-conventional-npm-17.6.5-ef8d82de49-e1e74bd1d4.zip/node_modules/@commitlint/config-conventional/",\ "packageDependencies": [\ - ["@commitlint/config-conventional", "npm:17.6.3"],\ + ["@commitlint/config-conventional", "npm:17.6.5"],\ ["conventional-changelog-conventionalcommits", "npm:5.0.0"]\ ],\ "linkType": "HARD"\ @@ -2406,10 +2456,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@commitlint/is-ignored", [\ - ["npm:17.6.3", {\ - "packageLocation": "./.yarn/cache/@commitlint-is-ignored-npm-17.6.3-570445525b-a7267396d6.zip/node_modules/@commitlint/is-ignored/",\ + ["npm:17.6.5", {\ + "packageLocation": "./.yarn/cache/@commitlint-is-ignored-npm-17.6.5-eb9c495070-f0b88f925d.zip/node_modules/@commitlint/is-ignored/",\ "packageDependencies": [\ - ["@commitlint/is-ignored", "npm:17.6.3"],\ + ["@commitlint/is-ignored", "npm:17.6.5"],\ ["@commitlint/types", "npm:17.4.4"],\ ["semver", "npm:7.5.0"]\ ],\ @@ -2417,13 +2467,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@commitlint/lint", [\ - ["npm:17.6.3", {\ - "packageLocation": "./.yarn/cache/@commitlint-lint-npm-17.6.3-fbda5b486d-6ba065cf07.zip/node_modules/@commitlint/lint/",\ + ["npm:17.6.5", {\ + "packageLocation": "./.yarn/cache/@commitlint-lint-npm-17.6.5-4378eb0cdb-16d7ae7f69.zip/node_modules/@commitlint/lint/",\ "packageDependencies": [\ - ["@commitlint/lint", "npm:17.6.3"],\ - ["@commitlint/is-ignored", "npm:17.6.3"],\ - ["@commitlint/parse", "npm:17.4.4"],\ - ["@commitlint/rules", "npm:17.6.1"],\ + ["@commitlint/lint", "npm:17.6.5"],\ + ["@commitlint/is-ignored", "npm:17.6.5"],\ + ["@commitlint/parse", "npm:17.6.5"],\ + ["@commitlint/rules", "npm:17.6.5"],\ ["@commitlint/types", "npm:17.4.4"]\ ],\ "linkType": "HARD"\ @@ -2438,7 +2488,7 @@ const RAW_RUNTIME_STATE = ["@commitlint/execute-rule", "npm:17.4.0"],\ ["@commitlint/resolve-extends", "npm:17.4.4"],\ ["@commitlint/types", "npm:17.4.4"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["chalk", "npm:4.1.2"],\ ["cosmiconfig", "npm:8.1.3"],\ ["cosmiconfig-typescript-loader", "virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:4.3.0"],\ @@ -2462,10 +2512,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@commitlint/parse", [\ - ["npm:17.4.4", {\ - "packageLocation": "./.yarn/cache/@commitlint-parse-npm-17.4.4-0475cff25c-354301638f.zip/node_modules/@commitlint/parse/",\ + ["npm:17.6.5", {\ + "packageLocation": "./.yarn/cache/@commitlint-parse-npm-17.6.5-af228ed605-017eb4ddd1.zip/node_modules/@commitlint/parse/",\ "packageDependencies": [\ - ["@commitlint/parse", "npm:17.4.4"],\ + ["@commitlint/parse", "npm:17.6.5"],\ ["@commitlint/types", "npm:17.4.4"],\ ["conventional-changelog-angular", "npm:5.0.13"],\ ["conventional-commits-parser", "npm:3.2.4"]\ @@ -2503,10 +2553,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@commitlint/rules", [\ - ["npm:17.6.1", {\ - "packageLocation": "./.yarn/cache/@commitlint-rules-npm-17.6.1-50fd353ff2-7e7c552fa9.zip/node_modules/@commitlint/rules/",\ + ["npm:17.6.5", {\ + "packageLocation": "./.yarn/cache/@commitlint-rules-npm-17.6.5-8317b1f8b5-29ee0da954.zip/node_modules/@commitlint/rules/",\ "packageDependencies": [\ - ["@commitlint/rules", "npm:17.6.1"],\ + ["@commitlint/rules", "npm:17.6.5"],\ ["@commitlint/ensure", "npm:17.4.4"],\ ["@commitlint/message", "npm:17.4.2"],\ ["@commitlint/to-lines", "npm:17.4.0"],\ @@ -2587,13 +2637,13 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:d92bace04d6d26247b24721a8766993aa3a98c631265bb389d6aa7c17b2a0708ccc877f009bd6a9cb50b8597fbe776c68dae7621d198ff292ee4bc23bd4b012f#npm:4.4.0", {\ - "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-75945d7e20/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-b9d700a83a.zip/node_modules/@eslint-community/eslint-utils/",\ + ["virtual:0e83e90d273f68a1bd1543dde3480eaf525801444ba81cbede9215242f0a1bd9563c2ba1980136297cb6880745c63575691537145c6b548460570102de527f4e#npm:4.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@eslint-community-eslint-utils-virtual-2f910f7a1e/0/cache/@eslint-community-eslint-utils-npm-4.4.0-d1791bd5a3-b9d700a83a.zip/node_modules/@eslint-community/eslint-utils/",\ "packageDependencies": [\ - ["@eslint-community/eslint-utils", "virtual:d92bace04d6d26247b24721a8766993aa3a98c631265bb389d6aa7c17b2a0708ccc877f009bd6a9cb50b8597fbe776c68dae7621d198ff292ee4bc23bd4b012f#npm:4.4.0"],\ + ["@eslint-community/eslint-utils", "virtual:0e83e90d273f68a1bd1543dde3480eaf525801444ba81cbede9215242f0a1bd9563c2ba1980136297cb6880745c63575691537145c6b548460570102de527f4e#npm:4.4.0"],\ ["@types/eslint", null],\ - ["eslint", "npm:8.39.0"],\ - ["eslint-visitor-keys", "npm:3.4.0"]\ + ["eslint", "npm:8.41.0"],\ + ["eslint-visitor-keys", "npm:3.4.1"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -2612,13 +2662,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@eslint/eslintrc", [\ - ["npm:2.0.2", {\ - "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.0.2-d308674d86-95c94b88d3.zip/node_modules/@eslint/eslintrc/",\ + ["npm:2.0.3", {\ + "packageLocation": "./.yarn/cache/@eslint-eslintrc-npm-2.0.3-531b6e79f7-41c404e8cb.zip/node_modules/@eslint/eslintrc/",\ "packageDependencies": [\ - ["@eslint/eslintrc", "npm:2.0.2"],\ + ["@eslint/eslintrc", "npm:2.0.3"],\ ["ajv", "npm:6.12.6"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["espree", "npm:9.5.1"],\ + ["espree", "npm:9.5.2"],\ ["globals", "npm:13.20.0"],\ ["ignore", "npm:5.2.4"],\ ["import-fresh", "npm:3.3.0"],\ @@ -2630,10 +2680,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@eslint/js", [\ - ["npm:8.39.0", {\ - "packageLocation": "./.yarn/cache/@eslint-js-npm-8.39.0-558d35aa2d-731360c47e.zip/node_modules/@eslint/js/",\ + ["npm:8.41.0", {\ + "packageLocation": "./.yarn/cache/@eslint-js-npm-8.41.0-7597c33d09-7f4b1d920b.zip/node_modules/@eslint/js/",\ "packageDependencies": [\ - ["@eslint/js", "npm:8.39.0"]\ + ["@eslint/js", "npm:8.41.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -2653,7 +2703,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@grpc/grpc-js", "npm:1.8.14"],\ ["@grpc/proto-loader", "npm:0.7.7"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -2739,7 +2789,7 @@ const RAW_RUNTIME_STATE = "string-width",\ "npm:4.2.3"\ ]],\ - ["strip-ansi", "npm:7.0.1"],\ + ["strip-ansi", "npm:7.1.0"],\ ["strip-ansi-cjs", [\ "strip-ansi",\ "npm:6.0.1"\ @@ -2791,7 +2841,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@jest/console", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["chalk", "npm:4.1.2"],\ ["jest-message-util", "npm:29.5.0"],\ ["jest-util", "npm:29.5.0"],\ @@ -2817,7 +2867,7 @@ const RAW_RUNTIME_STATE = ["@jest/test-result", "npm:29.5.0"],\ ["@jest/transform", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/node-notifier", null],\ ["ansi-escapes", "npm:4.3.2"],\ ["chalk", "npm:4.1.2"],\ @@ -2857,7 +2907,7 @@ const RAW_RUNTIME_STATE = ["@jest/environment", "npm:29.5.0"],\ ["@jest/fake-timers", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["jest-mock", "npm:29.5.0"]\ ],\ "linkType": "HARD"\ @@ -2890,8 +2940,8 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@jest/fake-timers", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@sinonjs/fake-timers", "npm:10.0.2"],\ - ["@types/node", "npm:20.1.0"],\ + ["@sinonjs/fake-timers", "npm:10.2.0"],\ + ["@types/node", "npm:20.2.5"],\ ["jest-message-util", "npm:29.5.0"],\ ["jest-mock", "npm:29.5.0"],\ ["jest-util", "npm:29.5.0"]\ @@ -2930,7 +2980,7 @@ const RAW_RUNTIME_STATE = ["@jest/transform", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ ["@jridgewell/trace-mapping", "npm:0.3.18"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/node-notifier", null],\ ["chalk", "npm:4.1.2"],\ ["collect-v8-coverage", "npm:1.0.1"],\ @@ -3011,7 +3061,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@jest-transform-npm-29.5.0-0a2f81b553-6cd3ab565d.zip/node_modules/@jest/transform/",\ "packageDependencies": [\ ["@jest/transform", "npm:29.5.0"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@jest/types", "npm:29.5.0"],\ ["@jridgewell/trace-mapping", "npm:0.3.18"],\ ["babel-plugin-istanbul", "npm:6.1.1"],\ @@ -3038,7 +3088,7 @@ const RAW_RUNTIME_STATE = ["@jest/schemas", "npm:29.4.3"],\ ["@types/istanbul-lib-coverage", "npm:2.0.4"],\ ["@types/istanbul-reports", "npm:3.0.1"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/yargs", "npm:17.0.24"],\ ["chalk", "npm:4.1.2"]\ ],\ @@ -3130,13 +3180,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/cli", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip/node_modules/@lerna-lite/cli/",\ - "packageDependencies": [\ - ["@lerna-lite/cli", "npm:2.3.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ ["npm:2.4.0", {\ "packageLocation": "./.yarn/cache/@lerna-lite-cli-npm-2.4.0-e29fb88577-49ba068860.zip/node_modules/@lerna-lite/cli/",\ "packageDependencies": [\ @@ -3163,7 +3206,7 @@ const RAW_RUNTIME_STATE = ["@types/lerna-lite__version", null],\ ["@types/lerna-lite__watch", null],\ ["dedent", "npm:0.7.0"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["import-local", "npm:3.1.0"],\ ["load-json-file", "npm:7.0.1"],\ ["npmlog", "npm:7.0.1"],\ @@ -3204,7 +3247,7 @@ const RAW_RUNTIME_STATE = ["@types/lerna-lite__version", null],\ ["@types/lerna-lite__watch", null],\ ["dedent", "npm:0.7.0"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["import-local", "npm:3.1.0"],\ ["load-json-file", "npm:7.0.1"],\ ["npmlog", "npm:7.0.1"],\ @@ -3226,17 +3269,58 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.3.0", {\ - "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-301648c425/0/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip/node_modules/@lerna-lite/cli/",\ + ["virtual:5d35434245e6dc416c837781d0829bc6816f03df54dcd944cbef75a5f96b53fcfaa8ec0d6040f3650d9fddc80377aa43bef50287fe2cc859ea5c7955b183a9df#npm:2.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-f22f3df115/0/cache/@lerna-lite-cli-npm-2.4.0-e29fb88577-49ba068860.zip/node_modules/@lerna-lite/cli/",\ "packageDependencies": [\ - ["@lerna-lite/cli", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ + ["@lerna-lite/cli", "virtual:5d35434245e6dc416c837781d0829bc6816f03df54dcd944cbef75a5f96b53fcfaa8ec0d6040f3650d9fddc80377aa43bef50287fe2cc859ea5c7955b183a9df#npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ ["@lerna-lite/exec", null],\ - ["@lerna-lite/init", "npm:2.3.0"],\ - ["@lerna-lite/list", "npm:2.3.0"],\ + ["@lerna-lite/init", "npm:2.4.0"],\ + ["@lerna-lite/list", null],\ + ["@lerna-lite/publish", null],\ + ["@lerna-lite/run", "npm:2.4.0"],\ + ["@lerna-lite/version", null],\ + ["@lerna-lite/watch", null],\ + ["@types/lerna-lite__exec", null],\ + ["@types/lerna-lite__list", null],\ + ["@types/lerna-lite__publish", null],\ + ["@types/lerna-lite__run", null],\ + ["@types/lerna-lite__version", null],\ + ["@types/lerna-lite__watch", null],\ + ["dedent", "npm:0.7.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["import-local", "npm:3.1.0"],\ + ["load-json-file", "npm:7.0.1"],\ + ["npmlog", "npm:7.0.1"],\ + ["yargs", "npm:17.7.2"]\ + ],\ + "packagePeers": [\ + "@lerna-lite/exec",\ + "@lerna-lite/list",\ + "@lerna-lite/publish",\ + "@lerna-lite/run",\ + "@lerna-lite/version",\ + "@lerna-lite/watch",\ + "@types/lerna-lite__exec",\ + "@types/lerna-lite__list",\ + "@types/lerna-lite__publish",\ + "@types/lerna-lite__run",\ + "@types/lerna-lite__version",\ + "@types/lerna-lite__watch"\ + ],\ + "linkType": "HARD"\ + }],\ + ["virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-0ab931b60d/0/cache/@lerna-lite-cli-npm-2.4.0-e29fb88577-49ba068860.zip/node_modules/@lerna-lite/cli/",\ + "packageDependencies": [\ + ["@lerna-lite/cli", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ + ["@lerna-lite/exec", null],\ + ["@lerna-lite/init", "npm:2.4.0"],\ + ["@lerna-lite/list", "npm:2.4.0"],\ ["@lerna-lite/publish", "npm:2.4.0"],\ - ["@lerna-lite/run", "npm:2.3.0"],\ - ["@lerna-lite/version", "npm:2.3.0"],\ + ["@lerna-lite/run", "npm:2.4.0"],\ + ["@lerna-lite/version", "npm:2.4.0"],\ ["@lerna-lite/watch", null],\ ["@types/lerna-lite__exec", null],\ ["@types/lerna-lite__list", null],\ @@ -3245,7 +3329,7 @@ const RAW_RUNTIME_STATE = ["@types/lerna-lite__version", null],\ ["@types/lerna-lite__watch", null],\ ["dedent", "npm:0.7.0"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["import-local", "npm:3.1.0"],\ ["load-json-file", "npm:7.0.1"],\ ["npmlog", "npm:7.0.1"],\ @@ -3267,96 +3351,14 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:b7082df028cbee2be058d4fbad4adae929432b7ec0e6ab018b1cae77fbd44383ab4e154f7327ce24a9835dbeb80dd92bd479cb4b73941bbd3399ba723f459295#npm:2.3.0", {\ - "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-a241421902/0/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip/node_modules/@lerna-lite/cli/",\ + ["virtual:e8f076a19302ba4152c0c7c4ea58e84f060514ec725379bb35f32e0cd3301cf52f7c628eec0bc9a85d9c4f388a987aeae403e229531d19bd89a8a56f58c20382#npm:2.4.0", {\ + "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-433eddd1a2/0/cache/@lerna-lite-cli-npm-2.4.0-e29fb88577-49ba068860.zip/node_modules/@lerna-lite/cli/",\ "packageDependencies": [\ - ["@lerna-lite/cli", "virtual:b7082df028cbee2be058d4fbad4adae929432b7ec0e6ab018b1cae77fbd44383ab4e154f7327ce24a9835dbeb80dd92bd479cb4b73941bbd3399ba723f459295#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ + ["@lerna-lite/cli", "virtual:e8f076a19302ba4152c0c7c4ea58e84f060514ec725379bb35f32e0cd3301cf52f7c628eec0bc9a85d9c4f388a987aeae403e229531d19bd89a8a56f58c20382#npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ ["@lerna-lite/exec", null],\ - ["@lerna-lite/init", "npm:2.3.0"],\ - ["@lerna-lite/list", null],\ - ["@lerna-lite/publish", null],\ - ["@lerna-lite/run", "npm:2.3.0"],\ - ["@lerna-lite/version", null],\ - ["@lerna-lite/watch", null],\ - ["@types/lerna-lite__exec", null],\ - ["@types/lerna-lite__list", null],\ - ["@types/lerna-lite__publish", null],\ - ["@types/lerna-lite__run", null],\ - ["@types/lerna-lite__version", null],\ - ["@types/lerna-lite__watch", null],\ - ["dedent", "npm:0.7.0"],\ - ["dotenv", "npm:16.0.3"],\ - ["import-local", "npm:3.1.0"],\ - ["load-json-file", "npm:7.0.1"],\ - ["npmlog", "npm:7.0.1"],\ - ["yargs", "npm:17.7.2"]\ - ],\ - "packagePeers": [\ - "@lerna-lite/exec",\ - "@lerna-lite/list",\ - "@lerna-lite/publish",\ - "@lerna-lite/run",\ - "@lerna-lite/version",\ - "@lerna-lite/watch",\ - "@types/lerna-lite__exec",\ - "@types/lerna-lite__list",\ - "@types/lerna-lite__publish",\ - "@types/lerna-lite__run",\ - "@types/lerna-lite__version",\ - "@types/lerna-lite__watch"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:cd148d07cc4d6fb3cf86fddbe67821aee93d4c7bcd213ab920ca6d4c101737082e593d9fd10b8fe402fb87fe951a7945db648353c93f3d79e7877d3cbef02304#npm:2.3.0", {\ - "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-73713985d4/0/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip/node_modules/@lerna-lite/cli/",\ - "packageDependencies": [\ - ["@lerna-lite/cli", "virtual:cd148d07cc4d6fb3cf86fddbe67821aee93d4c7bcd213ab920ca6d4c101737082e593d9fd10b8fe402fb87fe951a7945db648353c93f3d79e7877d3cbef02304#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["@lerna-lite/exec", null],\ - ["@lerna-lite/init", "npm:2.3.0"],\ - ["@lerna-lite/list", null],\ - ["@lerna-lite/publish", null],\ - ["@lerna-lite/run", null],\ - ["@lerna-lite/version", "npm:2.3.0"],\ - ["@lerna-lite/watch", null],\ - ["@types/lerna-lite__exec", null],\ - ["@types/lerna-lite__list", null],\ - ["@types/lerna-lite__publish", null],\ - ["@types/lerna-lite__run", null],\ - ["@types/lerna-lite__version", null],\ - ["@types/lerna-lite__watch", null],\ - ["dedent", "npm:0.7.0"],\ - ["dotenv", "npm:16.0.3"],\ - ["import-local", "npm:3.1.0"],\ - ["load-json-file", "npm:7.0.1"],\ - ["npmlog", "npm:7.0.1"],\ - ["yargs", "npm:17.7.2"]\ - ],\ - "packagePeers": [\ - "@lerna-lite/exec",\ - "@lerna-lite/list",\ - "@lerna-lite/publish",\ - "@lerna-lite/run",\ - "@lerna-lite/version",\ - "@lerna-lite/watch",\ - "@types/lerna-lite__exec",\ - "@types/lerna-lite__list",\ - "@types/lerna-lite__publish",\ - "@types/lerna-lite__run",\ - "@types/lerna-lite__version",\ - "@types/lerna-lite__watch"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:d70431a5a3a08db8b641cb5eca39ffe2362700bfb60c54f3ed24b8ae0956dba9e75914616048ca5add01019c96993bda1b9c0f2711ad52cd5d1e84bb3fe006b5#npm:2.3.0", {\ - "packageLocation": "./.yarn/__virtual__/@lerna-lite-cli-virtual-4fd57c17ca/0/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip/node_modules/@lerna-lite/cli/",\ - "packageDependencies": [\ - ["@lerna-lite/cli", "virtual:d70431a5a3a08db8b641cb5eca39ffe2362700bfb60c54f3ed24b8ae0956dba9e75914616048ca5add01019c96993bda1b9c0f2711ad52cd5d1e84bb3fe006b5#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["@lerna-lite/exec", null],\ - ["@lerna-lite/init", "npm:2.3.0"],\ - ["@lerna-lite/list", "npm:2.3.0"],\ + ["@lerna-lite/init", "npm:2.4.0"],\ + ["@lerna-lite/list", "npm:2.4.0"],\ ["@lerna-lite/publish", null],\ ["@lerna-lite/run", null],\ ["@lerna-lite/version", null],\ @@ -3368,7 +3370,7 @@ const RAW_RUNTIME_STATE = ["@types/lerna-lite__version", null],\ ["@types/lerna-lite__watch", null],\ ["dedent", "npm:0.7.0"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["import-local", "npm:3.1.0"],\ ["load-json-file", "npm:7.0.1"],\ ["npmlog", "npm:7.0.1"],\ @@ -3392,39 +3394,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/core", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-core-npm-2.3.0-1e82030d81-54a0dc2558.zip/node_modules/@lerna-lite/core/",\ - "packageDependencies": [\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["@npmcli/run-script", "npm:6.0.1"],\ - ["chalk", "npm:5.2.0"],\ - ["clone-deep", "npm:4.0.1"],\ - ["config-chain", "npm:1.1.13"],\ - ["cosmiconfig", "npm:8.1.3"],\ - ["dedent", "npm:0.7.0"],\ - ["execa", "npm:7.1.1"],\ - ["fs-extra", "npm:11.1.1"],\ - ["glob-parent", "npm:6.0.2"],\ - ["globby", "npm:13.1.4"],\ - ["inquirer", "npm:9.2.2"],\ - ["is-ci", "npm:3.0.1"],\ - ["json5", "npm:2.2.3"],\ - ["load-json-file", "npm:7.0.1"],\ - ["minimatch", "npm:9.0.0"],\ - ["npm-package-arg", "npm:10.1.0"],\ - ["npmlog", "npm:7.0.1"],\ - ["p-map", "npm:6.0.0"],\ - ["p-queue", "npm:7.3.4"],\ - ["resolve-from", "npm:5.0.0"],\ - ["semver", "npm:7.5.0"],\ - ["slash", "npm:5.0.1"],\ - ["strong-log-transformer", "npm:2.1.0"],\ - ["write-file-atomic", "npm:5.0.1"],\ - ["write-json-file", "npm:5.0.0"],\ - ["write-pkg", "npm:5.1.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.4.0", {\ "packageLocation": "./.yarn/cache/@lerna-lite-core-npm-2.4.0-31a2234f99-2020a69410.zip/node_modules/@lerna-lite/core/",\ "packageDependencies": [\ @@ -3443,7 +3412,7 @@ const RAW_RUNTIME_STATE = ["is-ci", "npm:3.0.1"],\ ["json5", "npm:2.2.3"],\ ["load-json-file", "npm:7.0.1"],\ - ["minimatch", "npm:9.0.0"],\ + ["minimatch", "npm:9.0.1"],\ ["npm-package-arg", "npm:10.1.0"],\ ["npmlog", "npm:7.0.1"],\ ["p-map", "npm:6.0.0"],\ @@ -3460,11 +3429,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/filter-packages", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-filter-packages-npm-2.3.0-9c6f43e793-3f943deb39.zip/node_modules/@lerna-lite/filter-packages/",\ + ["npm:2.4.0", {\ + "packageLocation": "./.yarn/cache/@lerna-lite-filter-packages-npm-2.4.0-b3f9b1f680-91718a038e.zip/node_modules/@lerna-lite/filter-packages/",\ "packageDependencies": [\ - ["@lerna-lite/filter-packages", "npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ + ["@lerna-lite/filter-packages", "npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ ["multimatch", "npm:6.0.0"],\ ["npmlog", "npm:7.0.1"]\ ],\ @@ -3472,17 +3441,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/init", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-init-npm-2.3.0-23124918db-f087c5e417.zip/node_modules/@lerna-lite/init/",\ - "packageDependencies": [\ - ["@lerna-lite/init", "npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["fs-extra", "npm:11.1.1"],\ - ["p-map", "npm:6.0.0"],\ - ["write-json-file", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.4.0", {\ "packageLocation": "./.yarn/cache/@lerna-lite-init-npm-2.4.0-5b6724cede-3d22543c85.zip/node_modules/@lerna-lite/init/",\ "packageDependencies": [\ @@ -3496,24 +3454,24 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/list", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-list-npm-2.3.0-d70431a5a3-1f3f62fa07.zip/node_modules/@lerna-lite/list/",\ + ["npm:2.4.0", {\ + "packageLocation": "./.yarn/cache/@lerna-lite-list-npm-2.4.0-e8f076a193-73748b74a9.zip/node_modules/@lerna-lite/list/",\ "packageDependencies": [\ - ["@lerna-lite/list", "npm:2.3.0"],\ - ["@lerna-lite/cli", "virtual:d70431a5a3a08db8b641cb5eca39ffe2362700bfb60c54f3ed24b8ae0956dba9e75914616048ca5add01019c96993bda1b9c0f2711ad52cd5d1e84bb3fe006b5#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["@lerna-lite/filter-packages", "npm:2.3.0"],\ - ["@lerna-lite/listable", "npm:2.3.0"]\ + ["@lerna-lite/list", "npm:2.4.0"],\ + ["@lerna-lite/cli", "virtual:e8f076a19302ba4152c0c7c4ea58e84f060514ec725379bb35f32e0cd3301cf52f7c628eec0bc9a85d9c4f388a987aeae403e229531d19bd89a8a56f58c20382#npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ + ["@lerna-lite/filter-packages", "npm:2.4.0"],\ + ["@lerna-lite/listable", "npm:2.4.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@lerna-lite/listable", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-listable-npm-2.3.0-bad0f58ba4-bb096246d9.zip/node_modules/@lerna-lite/listable/",\ + ["npm:2.4.0", {\ + "packageLocation": "./.yarn/cache/@lerna-lite-listable-npm-2.4.0-1a26bf12f1-11e10c2a6e.zip/node_modules/@lerna-lite/listable/",\ "packageDependencies": [\ - ["@lerna-lite/listable", "npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ + ["@lerna-lite/listable", "npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ ["chalk", "npm:5.2.0"],\ ["columnify", "npm:1.6.0"]\ ],\ @@ -3521,11 +3479,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/profiler", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-profiler-npm-2.3.0-62a2755663-bd55c4c2ce.zip/node_modules/@lerna-lite/profiler/",\ + ["npm:2.4.0", {\ + "packageLocation": "./.yarn/cache/@lerna-lite-profiler-npm-2.4.0-3cd0b87020-76330c00c9.zip/node_modules/@lerna-lite/profiler/",\ "packageDependencies": [\ - ["@lerna-lite/profiler", "npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ + ["@lerna-lite/profiler", "npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ ["fs-extra", "npm:11.1.1"],\ ["npmlog", "npm:7.0.1"],\ ["upath", "npm:2.0.1"]\ @@ -3549,7 +3507,7 @@ const RAW_RUNTIME_STATE = ["glob", "npm:10.2.6"],\ ["has-unicode", "npm:2.0.1"],\ ["libnpmaccess", "npm:7.0.2"],\ - ["libnpmpublish", "npm:7.2.0"],\ + ["libnpmpublish", "npm:7.3.0"],\ ["normalize-path", "npm:3.0.0"],\ ["npm-package-arg", "npm:10.1.0"],\ ["npm-packlist", "npm:7.0.4"],\ @@ -3569,14 +3527,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/run", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-run-npm-2.3.0-b7082df028-332634708d.zip/node_modules/@lerna-lite/run/",\ + ["npm:2.4.0", {\ + "packageLocation": "./.yarn/cache/@lerna-lite-run-npm-2.4.0-5d35434245-cb03607392.zip/node_modules/@lerna-lite/run/",\ "packageDependencies": [\ - ["@lerna-lite/run", "npm:2.3.0"],\ - ["@lerna-lite/cli", "virtual:b7082df028cbee2be058d4fbad4adae929432b7ec0e6ab018b1cae77fbd44383ab4e154f7327ce24a9835dbeb80dd92bd479cb4b73941bbd3399ba723f459295#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["@lerna-lite/filter-packages", "npm:2.3.0"],\ - ["@lerna-lite/profiler", "npm:2.3.0"],\ + ["@lerna-lite/run", "npm:2.4.0"],\ + ["@lerna-lite/cli", "virtual:5d35434245e6dc416c837781d0829bc6816f03df54dcd944cbef75a5f96b53fcfaa8ec0d6040f3650d9fddc80377aa43bef50287fe2cc859ea5c7955b183a9df#npm:2.4.0"],\ + ["@lerna-lite/core", "npm:2.4.0"],\ + ["@lerna-lite/filter-packages", "npm:2.4.0"],\ + ["@lerna-lite/profiler", "npm:2.4.0"],\ ["chalk", "npm:5.2.0"],\ ["fs-extra", "npm:11.1.1"],\ ["npmlog", "npm:7.0.1"],\ @@ -3586,45 +3544,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@lerna-lite/version", [\ - ["npm:2.3.0", {\ - "packageLocation": "./.yarn/cache/@lerna-lite-version-npm-2.3.0-cd148d07cc-3b59519c01.zip/node_modules/@lerna-lite/version/",\ - "packageDependencies": [\ - ["@lerna-lite/version", "npm:2.3.0"],\ - ["@lerna-lite/cli", "virtual:cd148d07cc4d6fb3cf86fddbe67821aee93d4c7bcd213ab920ca6d4c101737082e593d9fd10b8fe402fb87fe951a7945db648353c93f3d79e7877d3cbef02304#npm:2.3.0"],\ - ["@lerna-lite/core", "npm:2.3.0"],\ - ["@octokit/plugin-enterprise-rest", "npm:6.0.1"],\ - ["@octokit/rest", "npm:19.0.7"],\ - ["chalk", "npm:5.2.0"],\ - ["conventional-changelog-angular", "npm:5.0.13"],\ - ["conventional-changelog-core", "npm:4.2.4"],\ - ["conventional-changelog-writer", "npm:5.0.1"],\ - ["conventional-commits-parser", "npm:3.2.4"],\ - ["conventional-recommended-bump", "npm:6.1.0"],\ - ["dedent", "npm:0.7.0"],\ - ["fs-extra", "npm:11.1.1"],\ - ["get-stream", "npm:6.0.1"],\ - ["git-url-parse", "npm:13.1.0"],\ - ["graceful-fs", "npm:4.2.11"],\ - ["is-stream", "npm:3.0.0"],\ - ["load-json-file", "npm:7.0.1"],\ - ["make-dir", "npm:3.1.0"],\ - ["minimatch", "npm:9.0.0"],\ - ["new-github-release-url", "npm:2.0.0"],\ - ["node-fetch", "npm:3.3.1"],\ - ["npm-package-arg", "npm:10.1.0"],\ - ["npmlog", "npm:7.0.1"],\ - ["p-map", "npm:6.0.0"],\ - ["p-pipe", "npm:4.0.0"],\ - ["p-reduce", "npm:3.0.0"],\ - ["pify", "npm:6.1.0"],\ - ["semver", "npm:7.5.0"],\ - ["slash", "npm:5.0.1"],\ - ["temp-dir", "npm:3.0.0"],\ - ["uuid", "npm:9.0.0"],\ - ["write-json-file", "npm:5.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:2.4.0", {\ "packageLocation": "./.yarn/cache/@lerna-lite-version-npm-2.4.0-02c72ba459-d3168a7847.zip/node_modules/@lerna-lite/version/",\ "packageDependencies": [\ @@ -3647,7 +3566,7 @@ const RAW_RUNTIME_STATE = ["is-stream", "npm:3.0.0"],\ ["load-json-file", "npm:7.0.1"],\ ["make-dir", "npm:3.1.0"],\ - ["minimatch", "npm:9.0.0"],\ + ["minimatch", "npm:9.0.1"],\ ["new-github-release-url", "npm:2.0.0"],\ ["node-fetch", "npm:3.3.1"],\ ["npm-package-arg", "npm:10.1.0"],\ @@ -3673,12 +3592,22 @@ const RAW_RUNTIME_STATE = ["detect-libc", "npm:2.0.1"],\ ["https-proxy-agent", "npm:5.0.1"],\ ["make-dir", "npm:3.1.0"],\ - ["node-fetch", "virtual:1b72fec7bb0f7f65631883ba39976a89b23a387bb935170eee37fef528f0caab0bcc7663f8211ff33a22ee11d361aa1b8f34bec752dd83d1882c9de3d3bc1fbf#npm:2.6.9"],\ + ["node-fetch", "virtual:0f92dfe7f9dc4fd492639d4a5b7805c2b27442bf599fd4f370b22a7966ba078f5d4525e2a8e8af29369f20e1833ed084bd52be59679efaa6c1c6c10cdbcd8baa#npm:2.6.11"],\ ["nopt", "npm:5.0.0"],\ ["npmlog", "npm:5.0.1"],\ ["rimraf", "npm:3.0.2"],\ - ["semver", "npm:7.5.0"],\ - ["tar", "npm:6.1.14"]\ + ["semver", "npm:7.5.1"],\ + ["tar", "npm:6.1.15"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@mrleebo/prisma-ast", [\ + ["npm:0.5.2", {\ + "packageLocation": "./.yarn/cache/@mrleebo-prisma-ast-npm-0.5.2-538c9d793e-69a7f3c188.zip/node_modules/@mrleebo/prisma-ast/",\ + "packageDependencies": [\ + ["@mrleebo/prisma-ast", "npm:0.5.2"],\ + ["chevrotain", "npm:10.5.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -3691,12 +3620,12 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:5.0.5", {\ - "packageLocation": "./.yarn/__virtual__/@newrelic-aws-sdk-virtual-5caff1efb6/0/cache/@newrelic-aws-sdk-npm-5.0.5-e65a4f66a8-a62d6810ee.zip/node_modules/@newrelic/aws-sdk/",\ + ["virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:5.0.5", {\ + "packageLocation": "./.yarn/__virtual__/@newrelic-aws-sdk-virtual-38d14a1ccd/0/cache/@newrelic-aws-sdk-npm-5.0.5-e65a4f66a8-a62d6810ee.zip/node_modules/@newrelic/aws-sdk/",\ "packageDependencies": [\ - ["@newrelic/aws-sdk", "virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:5.0.5"],\ + ["@newrelic/aws-sdk", "virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:5.0.5"],\ ["@types/newrelic", null],\ - ["newrelic", "npm:10.1.0"]\ + ["newrelic", "npm:10.1.2"]\ ],\ "packagePeers": [\ "@types/newrelic",\ @@ -3713,12 +3642,12 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:7.2.0", {\ - "packageLocation": "./.yarn/__virtual__/@newrelic-koa-virtual-2fa52ef306/0/cache/@newrelic-koa-npm-7.2.0-94fd4c62e5-a7f8abeee8.zip/node_modules/@newrelic/koa/",\ + ["virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:7.2.0", {\ + "packageLocation": "./.yarn/__virtual__/@newrelic-koa-virtual-1696b107ba/0/cache/@newrelic-koa-npm-7.2.0-94fd4c62e5-a7f8abeee8.zip/node_modules/@newrelic/koa/",\ "packageDependencies": [\ - ["@newrelic/koa", "virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:7.2.0"],\ + ["@newrelic/koa", "virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:7.2.0"],\ ["@types/newrelic", null],\ - ["newrelic", "npm:10.1.0"]\ + ["newrelic", "npm:10.1.2"]\ ],\ "packagePeers": [\ "@types/newrelic",\ @@ -3748,12 +3677,12 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:6.0.0", {\ - "packageLocation": "./.yarn/__virtual__/@newrelic-superagent-virtual-772907f5e5/0/cache/@newrelic-superagent-npm-6.0.0-db8b77d0f3-b77997b792.zip/node_modules/@newrelic/superagent/",\ + ["virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:6.0.0", {\ + "packageLocation": "./.yarn/__virtual__/@newrelic-superagent-virtual-8d4b7cd096/0/cache/@newrelic-superagent-npm-6.0.0-db8b77d0f3-b77997b792.zip/node_modules/@newrelic/superagent/",\ "packageDependencies": [\ - ["@newrelic/superagent", "virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:6.0.0"],\ + ["@newrelic/superagent", "virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:6.0.0"],\ ["@types/newrelic", null],\ - ["newrelic", "npm:10.1.0"]\ + ["newrelic", "npm:10.1.2"]\ ],\ "packagePeers": [\ "@types/newrelic",\ @@ -3774,8 +3703,8 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/@newrelic-winston-enricher-virtual-c32d28b076/0/cache/@newrelic-winston-enricher-npm-4.0.1-ef1230a3ce-e45880f6ec.zip/node_modules/@newrelic/winston-enricher/",\ "packageDependencies": [\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ - ["newrelic", "npm:10.1.0"]\ + ["@types/newrelic", "npm:9.14.0"],\ + ["newrelic", "npm:10.1.2"]\ ],\ "packagePeers": [\ "@types/newrelic",\ @@ -3829,14 +3758,14 @@ const RAW_RUNTIME_STATE = ["@npmcli/node-gyp", "npm:3.0.0"],\ ["@npmcli/package-json", "npm:3.1.0"],\ ["@npmcli/query", "npm:3.0.0"],\ - ["@npmcli/run-script", "npm:6.0.1"],\ + ["@npmcli/run-script", "npm:6.0.2"],\ ["bin-links", "npm:4.0.1"],\ ["cacache", "npm:17.1.3"],\ ["common-ancestor-path", "npm:1.0.1"],\ ["hosted-git-info", "npm:6.1.1"],\ ["json-parse-even-better-errors", "npm:3.0.0"],\ ["json-stringify-nice", "npm:1.1.4"],\ - ["minimatch", "npm:9.0.0"],\ + ["minimatch", "npm:9.0.1"],\ ["nopt", "npm:7.1.0"],\ ["npm-install-checks", "npm:6.1.1"],\ ["npm-package-arg", "npm:10.1.0"],\ @@ -3849,7 +3778,7 @@ const RAW_RUNTIME_STATE = ["promise-all-reject-late", "npm:1.0.1"],\ ["promise-call-limit", "npm:1.0.2"],\ ["read-package-json-fast", "npm:3.0.2"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["ssri", "npm:10.0.4"],\ ["treeverse", "npm:3.0.0"],\ ["walk-up-path", "npm:3.0.1"]\ @@ -3863,7 +3792,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@npmcli/fs", "npm:1.1.1"],\ ["@gar/promisify", "npm:1.1.3"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }],\ @@ -3872,7 +3801,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@npmcli/fs", "npm:2.1.2"],\ ["@gar/promisify", "npm:1.1.3"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }],\ @@ -3880,7 +3809,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-c17d9f6a57.zip/node_modules/@npmcli/fs/",\ "packageDependencies": [\ ["@npmcli/fs", "npm:3.1.0"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -3896,7 +3825,7 @@ const RAW_RUNTIME_STATE = ["proc-log", "npm:3.0.0"],\ ["promise-inflight", "virtual:4e2088ed0df52533102f445d7e7aeba6560b7effa0cabbc7cc20dd1e36a86dd838cc541de4414688f4ce3ec77b0ad5298cea6de581350d934ceb35c3e0fe3462#npm:1.0.1"],\ ["promise-retry", "npm:2.0.1"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["which", "npm:3.0.1"]\ ],\ "linkType": "HARD"\ @@ -3919,8 +3848,8 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@npmcli/map-workspaces", "npm:3.0.4"],\ ["@npmcli/name-from-folder", "npm:2.0.0"],\ - ["glob", "npm:10.2.2"],\ - ["minimatch", "npm:9.0.0"],\ + ["glob", "npm:10.2.6"],\ + ["minimatch", "npm:9.0.1"],\ ["read-package-json-fast", "npm:3.0.2"]\ ],\ "linkType": "HARD"\ @@ -3931,10 +3860,10 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@npmcli-metavuln-calculator-npm-5.0.1-b28e316793-7aba3fb70b.zip/node_modules/@npmcli/metavuln-calculator/",\ "packageDependencies": [\ ["@npmcli/metavuln-calculator", "npm:5.0.1"],\ - ["cacache", "npm:17.1.0"],\ + ["cacache", "npm:17.1.3"],\ ["json-parse-even-better-errors", "npm:3.0.0"],\ ["pacote", "npm:15.2.0"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -3982,7 +3911,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@npmcli-package-json-npm-3.1.0-ba411bfc47-ebfa841624.zip/node_modules/@npmcli/package-json/",\ "packageDependencies": [\ ["@npmcli/package-json", "npm:3.1.0"],\ - ["glob", "npm:10.2.2"],\ + ["glob", "npm:10.2.6"],\ ["json-parse-even-better-errors", "npm:3.0.0"],\ ["normalize-package-data", "npm:5.0.0"],\ ["npm-normalize-package-bin", "npm:3.0.1"]\ @@ -4011,18 +3940,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@npmcli/run-script", [\ - ["npm:6.0.1", {\ - "packageLocation": "./.yarn/cache/@npmcli-run-script-npm-6.0.1-6f91090d19-97a944045a.zip/node_modules/@npmcli/run-script/",\ - "packageDependencies": [\ - ["@npmcli/run-script", "npm:6.0.1"],\ - ["@npmcli/node-gyp", "npm:3.0.0"],\ - ["@npmcli/promise-spawn", "npm:6.0.2"],\ - ["node-gyp", "npm:9.3.1"],\ - ["read-package-json-fast", "npm:3.0.2"],\ - ["which", "npm:3.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:6.0.2", {\ "packageLocation": "./.yarn/cache/@npmcli-run-script-npm-6.0.2-6a98dec431-783cc4dd14.zip/node_modules/@npmcli/run-script/",\ "packageDependencies": [\ @@ -4041,35 +3958,21 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@octokit-auth-token-npm-3.0.3-6fba099166-c24a659529.zip/node_modules/@octokit/auth-token/",\ "packageDependencies": [\ ["@octokit/auth-token", "npm:3.0.3"],\ - ["@octokit/types", "npm:9.2.1"]\ + ["@octokit/types", "npm:9.2.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@octokit/core", [\ - ["npm:4.2.0", {\ - "packageLocation": "./.yarn/cache/@octokit-core-npm-4.2.0-0f3a7f3979-19e6914cf8.zip/node_modules/@octokit/core/",\ - "packageDependencies": [\ - ["@octokit/core", "npm:4.2.0"],\ - ["@octokit/auth-token", "npm:3.0.3"],\ - ["@octokit/graphql", "npm:5.0.5"],\ - ["@octokit/request", "npm:6.2.3"],\ - ["@octokit/request-error", "npm:3.0.3"],\ - ["@octokit/types", "npm:9.2.1"],\ - ["before-after-hook", "npm:2.2.3"],\ - ["universal-user-agent", "npm:6.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:4.2.1", {\ "packageLocation": "./.yarn/cache/@octokit-core-npm-4.2.1-ed461a1d34-684a190793.zip/node_modules/@octokit/core/",\ "packageDependencies": [\ ["@octokit/core", "npm:4.2.1"],\ ["@octokit/auth-token", "npm:3.0.3"],\ - ["@octokit/graphql", "npm:5.0.5"],\ - ["@octokit/request", "npm:6.2.3"],\ + ["@octokit/graphql", "npm:5.0.6"],\ + ["@octokit/request", "npm:6.2.5"],\ ["@octokit/request-error", "npm:3.0.3"],\ - ["@octokit/types", "npm:9.2.1"],\ + ["@octokit/types", "npm:9.2.3"],\ ["before-after-hook", "npm:2.2.3"],\ ["universal-user-agent", "npm:6.0.0"]\ ],\ @@ -4081,7 +3984,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@octokit-endpoint-npm-7.0.5-82841b7e23-16bfc1b5d1.zip/node_modules/@octokit/endpoint/",\ "packageDependencies": [\ ["@octokit/endpoint", "npm:7.0.5"],\ - ["@octokit/types", "npm:9.2.1"],\ + ["@octokit/types", "npm:9.2.3"],\ ["is-plain-object", "npm:5.0.0"],\ ["universal-user-agent", "npm:6.0.0"]\ ],\ @@ -4089,25 +3992,18 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@octokit/graphql", [\ - ["npm:5.0.5", {\ - "packageLocation": "./.yarn/cache/@octokit-graphql-npm-5.0.5-0534ea7757-c16cc2a2ed.zip/node_modules/@octokit/graphql/",\ + ["npm:5.0.6", {\ + "packageLocation": "./.yarn/cache/@octokit-graphql-npm-5.0.6-26fb5b6074-532c5aa6b8.zip/node_modules/@octokit/graphql/",\ "packageDependencies": [\ - ["@octokit/graphql", "npm:5.0.5"],\ - ["@octokit/request", "npm:6.2.3"],\ - ["@octokit/types", "npm:9.2.1"],\ + ["@octokit/graphql", "npm:5.0.6"],\ + ["@octokit/request", "npm:6.2.5"],\ + ["@octokit/types", "npm:9.2.3"],\ ["universal-user-agent", "npm:6.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@octokit/openapi-types", [\ - ["npm:17.1.1", {\ - "packageLocation": "./.yarn/cache/@octokit-openapi-types-npm-17.1.1-af436862ac-17c7992dc7.zip/node_modules/@octokit/openapi-types/",\ - "packageDependencies": [\ - ["@octokit/openapi-types", "npm:17.1.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:17.2.0", {\ "packageLocation": "./.yarn/cache/@octokit-openapi-types-npm-17.2.0-e9456595e7-5f3e3df6a2.zip/node_modules/@octokit/openapi-types/",\ "packageDependencies": [\ @@ -4126,13 +4022,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@octokit/plugin-paginate-rest", [\ - ["npm:6.0.0", {\ - "packageLocation": "./.yarn/cache/@octokit-plugin-paginate-rest-npm-6.0.0-ccfed9f0b1-6b28bb329c.zip/node_modules/@octokit/plugin-paginate-rest/",\ - "packageDependencies": [\ - ["@octokit/plugin-paginate-rest", "npm:6.0.0"]\ - ],\ - "linkType": "SOFT"\ - }],\ ["npm:6.1.2", {\ "packageLocation": "./.yarn/cache/@octokit-plugin-paginate-rest-npm-6.1.2-3b2443d1e8-f3132eecfe.zip/node_modules/@octokit/plugin-paginate-rest/",\ "packageDependencies": [\ @@ -4154,20 +4043,6 @@ const RAW_RUNTIME_STATE = "@types/octokit__core"\ ],\ "linkType": "HARD"\ - }],\ - ["virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:6.0.0", {\ - "packageLocation": "./.yarn/__virtual__/@octokit-plugin-paginate-rest-virtual-72e3f88ea8/0/cache/@octokit-plugin-paginate-rest-npm-6.0.0-ccfed9f0b1-6b28bb329c.zip/node_modules/@octokit/plugin-paginate-rest/",\ - "packageDependencies": [\ - ["@octokit/plugin-paginate-rest", "virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:6.0.0"],\ - ["@octokit/core", "npm:4.2.0"],\ - ["@octokit/types", "npm:9.2.1"],\ - ["@types/octokit__core", null]\ - ],\ - "packagePeers": [\ - "@octokit/core",\ - "@types/octokit__core"\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["@octokit/plugin-request-log", [\ @@ -4190,29 +4065,9 @@ const RAW_RUNTIME_STATE = "@types/octokit__core"\ ],\ "linkType": "HARD"\ - }],\ - ["virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:1.0.4", {\ - "packageLocation": "./.yarn/__virtual__/@octokit-plugin-request-log-virtual-0943509472/0/cache/@octokit-plugin-request-log-npm-1.0.4-9ab5a2f888-862693e736.zip/node_modules/@octokit/plugin-request-log/",\ - "packageDependencies": [\ - ["@octokit/plugin-request-log", "virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:1.0.4"],\ - ["@octokit/core", "npm:4.2.0"],\ - ["@types/octokit__core", null]\ - ],\ - "packagePeers": [\ - "@octokit/core",\ - "@types/octokit__core"\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["@octokit/plugin-rest-endpoint-methods", [\ - ["npm:7.0.1", {\ - "packageLocation": "./.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-0eddc079cb.zip/node_modules/@octokit/plugin-rest-endpoint-methods/",\ - "packageDependencies": [\ - ["@octokit/plugin-rest-endpoint-methods", "npm:7.0.1"]\ - ],\ - "linkType": "SOFT"\ - }],\ ["npm:7.1.2", {\ "packageLocation": "./.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.1.2-a791f6ceb4-9c58ca45d7.zip/node_modules/@octokit/plugin-rest-endpoint-methods/",\ "packageDependencies": [\ @@ -4234,33 +4089,18 @@ const RAW_RUNTIME_STATE = "@types/octokit__core"\ ],\ "linkType": "HARD"\ - }],\ - ["virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:7.0.1", {\ - "packageLocation": "./.yarn/__virtual__/@octokit-plugin-rest-endpoint-methods-virtual-0c8887dc8d/0/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-0eddc079cb.zip/node_modules/@octokit/plugin-rest-endpoint-methods/",\ - "packageDependencies": [\ - ["@octokit/plugin-rest-endpoint-methods", "virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:7.0.1"],\ - ["@octokit/core", "npm:4.2.0"],\ - ["@octokit/types", "npm:9.2.1"],\ - ["@types/octokit__core", null],\ - ["deprecation", "npm:2.3.1"]\ - ],\ - "packagePeers": [\ - "@octokit/core",\ - "@types/octokit__core"\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["@octokit/request", [\ - ["npm:6.2.3", {\ - "packageLocation": "./.yarn/cache/@octokit-request-npm-6.2.3-1b72fec7bb-d70a57f897.zip/node_modules/@octokit/request/",\ + ["npm:6.2.5", {\ + "packageLocation": "./.yarn/cache/@octokit-request-npm-6.2.5-0f92dfe7f9-0d1ba3c7e3.zip/node_modules/@octokit/request/",\ "packageDependencies": [\ - ["@octokit/request", "npm:6.2.3"],\ + ["@octokit/request", "npm:6.2.5"],\ ["@octokit/endpoint", "npm:7.0.5"],\ ["@octokit/request-error", "npm:3.0.3"],\ - ["@octokit/types", "npm:9.2.1"],\ + ["@octokit/types", "npm:9.2.3"],\ ["is-plain-object", "npm:5.0.0"],\ - ["node-fetch", "virtual:1b72fec7bb0f7f65631883ba39976a89b23a387bb935170eee37fef528f0caab0bcc7663f8211ff33a22ee11d361aa1b8f34bec752dd83d1882c9de3d3bc1fbf#npm:2.6.9"],\ + ["node-fetch", "virtual:0f92dfe7f9dc4fd492639d4a5b7805c2b27442bf599fd4f370b22a7966ba078f5d4525e2a8e8af29369f20e1833ed084bd52be59679efaa6c1c6c10cdbcd8baa#npm:2.6.11"],\ ["universal-user-agent", "npm:6.0.0"]\ ],\ "linkType": "HARD"\ @@ -4271,7 +4111,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@octokit-request-error-npm-3.0.3-cbba4d6220-f433403794.zip/node_modules/@octokit/request-error/",\ "packageDependencies": [\ ["@octokit/request-error", "npm:3.0.3"],\ - ["@octokit/types", "npm:9.2.1"],\ + ["@octokit/types", "npm:9.2.3"],\ ["deprecation", "npm:2.3.1"],\ ["once", "npm:1.4.0"]\ ],\ @@ -4289,17 +4129,6 @@ const RAW_RUNTIME_STATE = ["@octokit/plugin-rest-endpoint-methods", "virtual:6a50f10c37a77a421844d8a2d536dc43b4849ce245df9e9c8d1e875cddcbc1806c88abec01a51d57e7456dbb76e61839697ed4fe5c713eec90216b98c581e0fd#npm:7.1.2"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:19.0.7", {\ - "packageLocation": "./.yarn/cache/@octokit-rest-npm-19.0.7-f05ed3b2ee-32f2d756e1.zip/node_modules/@octokit/rest/",\ - "packageDependencies": [\ - ["@octokit/rest", "npm:19.0.7"],\ - ["@octokit/core", "npm:4.2.0"],\ - ["@octokit/plugin-paginate-rest", "virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:6.0.0"],\ - ["@octokit/plugin-request-log", "virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:1.0.4"],\ - ["@octokit/plugin-rest-endpoint-methods", "virtual:f05ed3b2eee771b6eb88b2f56d0bcd414e2bea9dc7ed6c6d707b985da62cf3e4f822c442b215daf45c42b7f35c47ed344eec1776d7343413a02cb555d3920b14#npm:7.0.1"]\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["@octokit/tsconfig", [\ @@ -4312,14 +4141,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@octokit/types", [\ - ["npm:9.2.1", {\ - "packageLocation": "./.yarn/cache/@octokit-types-npm-9.2.1-b55f39cc91-dc13c05e78.zip/node_modules/@octokit/types/",\ - "packageDependencies": [\ - ["@octokit/types", "npm:9.2.1"],\ - ["@octokit/openapi-types", "npm:17.1.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:9.2.3", {\ "packageLocation": "./.yarn/cache/@octokit-types-npm-9.2.3-7489397f39-8c780a0a0d.zip/node_modules/@octokit/types/",\ "packageDependencies": [\ @@ -4390,7 +4211,7 @@ const RAW_RUNTIME_STATE = ["@peculiar/asn1-android", "npm:2.3.6"],\ ["@peculiar/asn1-schema", "npm:2.3.6"],\ ["asn1js", "npm:3.0.5"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -4403,7 +4224,7 @@ const RAW_RUNTIME_STATE = ["@peculiar/asn1-schema", "npm:2.3.6"],\ ["@peculiar/asn1-x509", "npm:2.3.6"],\ ["asn1js", "npm:3.0.5"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -4416,7 +4237,7 @@ const RAW_RUNTIME_STATE = ["@peculiar/asn1-schema", "npm:2.3.6"],\ ["@peculiar/asn1-x509", "npm:2.3.6"],\ ["asn1js", "npm:3.0.5"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -4428,7 +4249,7 @@ const RAW_RUNTIME_STATE = ["@peculiar/asn1-schema", "npm:2.3.6"],\ ["asn1js", "npm:3.0.5"],\ ["pvtsutils", "npm:1.3.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -4440,9 +4261,9 @@ const RAW_RUNTIME_STATE = ["@peculiar/asn1-x509", "npm:2.3.6"],\ ["@peculiar/asn1-schema", "npm:2.3.6"],\ ["asn1js", "npm:3.0.5"],\ - ["ipaddr.js", "npm:2.0.1"],\ + ["ipaddr.js", "npm:2.1.0"],\ ["pvtsutils", "npm:1.3.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -4594,7 +4415,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@simplewebauthn/iso-webcrypto", "npm:7.2.0"],\ ["@simplewebauthn/typescript-types", "npm:7.0.0"],\ - ["@types/node", "npm:18.16.4"]\ + ["@types/node", "npm:18.16.16"]\ ],\ "linkType": "HARD"\ }]\ @@ -4612,10 +4433,10 @@ const RAW_RUNTIME_STATE = ["@peculiar/asn1-x509", "npm:2.3.6"],\ ["@simplewebauthn/iso-webcrypto", "npm:7.2.0"],\ ["@simplewebauthn/typescript-types", "npm:7.0.0"],\ - ["@types/debug", "npm:4.1.7"],\ - ["@types/node", "npm:18.16.4"],\ - ["cbor-x", "npm:1.5.2"],\ - ["cross-fetch", "npm:3.1.5"],\ + ["@types/debug", "npm:4.1.8"],\ + ["@types/node", "npm:18.16.16"],\ + ["cbor-x", "npm:1.5.3"],\ + ["cross-fetch", "npm:3.1.6"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"]\ ],\ "linkType": "HARD"\ @@ -4640,30 +4461,51 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@sindresorhus/is", [\ - ["npm:5.3.0", {\ - "packageLocation": "./.yarn/cache/@sindresorhus-is-npm-5.3.0-9deec66459-f43c7625f3.zip/node_modules/@sindresorhus/is/",\ + ["npm:5.4.0", {\ + "packageLocation": "./.yarn/cache/@sindresorhus-is-npm-5.4.0-d6eb7bf6eb-972a33ba22.zip/node_modules/@sindresorhus/is/",\ "packageDependencies": [\ - ["@sindresorhus/is", "npm:5.3.0"]\ + ["@sindresorhus/is", "npm:5.4.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@sinonjs/commons", [\ - ["npm:2.0.0", {\ - "packageLocation": "./.yarn/cache/@sinonjs-commons-npm-2.0.0-3716f24f20-c0781f895a.zip/node_modules/@sinonjs/commons/",\ + ["npm:3.0.0", {\ + "packageLocation": "./.yarn/cache/@sinonjs-commons-npm-3.0.0-fa72ff71a1-7cf247acf4.zip/node_modules/@sinonjs/commons/",\ "packageDependencies": [\ - ["@sinonjs/commons", "npm:2.0.0"],\ + ["@sinonjs/commons", "npm:3.0.0"],\ ["type-detect", "npm:4.0.8"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@sinonjs/fake-timers", [\ - ["npm:10.0.2", {\ - "packageLocation": "./.yarn/cache/@sinonjs-fake-timers-npm-10.0.2-c5fa80f1cc-71871b8698.zip/node_modules/@sinonjs/fake-timers/",\ + ["npm:10.2.0", {\ + "packageLocation": "./.yarn/cache/@sinonjs-fake-timers-npm-10.2.0-cc1159e8aa-07348f4aae.zip/node_modules/@sinonjs/fake-timers/",\ "packageDependencies": [\ - ["@sinonjs/fake-timers", "npm:10.0.2"],\ - ["@sinonjs/commons", "npm:2.0.0"]\ + ["@sinonjs/fake-timers", "npm:10.2.0"],\ + ["@sinonjs/commons", "npm:3.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@smithy/protocol-http", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/@smithy-protocol-http-npm-1.0.1-7acb4f139f-489ef06e88.zip/node_modules/@smithy/protocol-http/",\ + "packageDependencies": [\ + ["@smithy/protocol-http", "npm:1.0.1"],\ + ["@smithy/types", "npm:1.0.0"],\ + ["tslib", "npm:2.5.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@smithy/types", [\ + ["npm:1.0.0", {\ + "packageLocation": "./.yarn/cache/@smithy-types-npm-1.0.0-79a6ff2b27-d034933aab.zip/node_modules/@smithy/types/",\ + "packageDependencies": [\ + ["@smithy/types", "npm:1.0.0"],\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -4682,8 +4524,8 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/analytics/",\ "packageDependencies": [\ ["@standardnotes/analytics", "workspace:packages/analytics"],\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ @@ -4691,42 +4533,42 @@ const RAW_RUNTIME_STATE = ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ ["@standardnotes/time", "workspace:packages/time"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/mixpanel", "npm:2.14.4"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["dayjs", "npm:1.11.7"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["inversify", "npm:6.0.1"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["mixpanel", "npm:0.17.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.15"],\ + ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ ["@standardnotes/api", [\ - ["npm:1.26.5", {\ - "packageLocation": "./.yarn/cache/@standardnotes-api-npm-1.26.5-0785e522d1-d2e8d73456.zip/node_modules/@standardnotes/api/",\ + ["npm:1.26.10", {\ + "packageLocation": "./.yarn/cache/@standardnotes-api-npm-1.26.10-f6165cafd3-3c3561aec8.zip/node_modules/@standardnotes/api/",\ "packageDependencies": [\ - ["@standardnotes/api", "npm:1.26.5"],\ + ["@standardnotes/api", "npm:1.26.10"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ - ["@standardnotes/encryption", "npm:1.21.33"],\ - ["@standardnotes/models", "npm:1.45.0"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/encryption", "npm:1.21.38"],\ + ["@standardnotes/models", "npm:1.45.5"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/security", "workspace:packages/security"],\ ["@standardnotes/utils", "npm:1.16.5"],\ ["reflect-metadata", "npm:0.1.13"]\ @@ -4748,35 +4590,35 @@ const RAW_RUNTIME_STATE = ["@types/cors", "npm:2.8.13"],\ ["@types/express", "npm:4.17.17"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/jsonwebtoken", "npm:9.0.2"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ ["@types/prettyjson", "npm:0.0.30"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["axios", "npm:1.4.0"],\ ["cors", "npm:2.8.5"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ ["express-robots-txt", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:1.0.0"],\ - ["helmet", "npm:6.1.5"],\ + ["helmet", "npm:6.2.0"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["jsonwebtoken", "npm:9.0.0"],\ - ["newrelic", "npm:10.1.0"],\ + ["newrelic", "npm:10.1.2"],\ ["nodemon", "npm:2.0.22"],\ - ["npm-check-updates", "npm:16.10.9"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["prettier", "npm:2.8.8"],\ ["prettyjson", "npm:1.2.5"],\ ["reflect-metadata", "npm:0.1.13"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -4786,21 +4628,21 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/auth/",\ "packageDependencies": [\ ["@standardnotes/auth-server", "workspace:packages/auth"],\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@cbor-extract/cbor-extract-linux-arm64", "npm:2.1.1"],\ ["@cbor-extract/cbor-extract-linux-x64", "npm:2.1.1"],\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ ["@simplewebauthn/server", "npm:7.2.0"],\ ["@simplewebauthn/typescript-types", "npm:7.0.0"],\ - ["@standardnotes/api", "npm:1.26.5"],\ + ["@standardnotes/api", "npm:1.26.10"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ - ["@standardnotes/features", "npm:1.59.3"],\ + ["@standardnotes/features", "npm:1.59.5"],\ ["@standardnotes/predicates", "workspace:packages/predicates"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/security", "workspace:packages/security"],\ ["@standardnotes/settings", "workspace:packages/settings"],\ ["@standardnotes/sncrypto-common", "npm:1.13.3"],\ @@ -4810,42 +4652,42 @@ const RAW_RUNTIME_STATE = ["@types/cors", "npm:2.8.13"],\ ["@types/express", "npm:4.17.17"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ ["@types/otplib", "npm:10.0.0"],\ ["@types/prettyjson", "npm:0.0.30"],\ ["@types/ua-parser-js", "npm:0.7.36"],\ ["@types/uuid", "npm:8.3.4"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["axios", "npm:1.4.0"],\ ["bcryptjs", "npm:2.4.3"],\ ["cors", "npm:2.8.5"],\ ["dayjs", "npm:1.11.7"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ ["nodemon", "npm:2.0.22"],\ - ["npm-check-updates", "npm:16.10.9"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["otplib", "npm:12.0.1"],\ ["prettier", "npm:2.8.8"],\ ["prettyjson", "npm:1.2.5"],\ ["reflect-metadata", "npm:0.1.13"],\ ["sqlite3", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:5.1.6"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.15"],\ + ["typeorm", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ ["ua-parser-js", "npm:1.0.35"],\ ["uuid", "npm:9.0.0"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -4855,11 +4697,11 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/common/",\ "packageDependencies": [\ ["@standardnotes/common", "workspace:packages/common"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/node", "npm:20.2.5"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["prettier", "npm:2.8.8"],\ @@ -4875,12 +4717,12 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/domain-core/",\ "packageDependencies": [\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/node", "npm:20.2.5"],\ ["@types/uuid", "npm:8.3.4"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["prettier", "npm:2.8.8"],\ @@ -4898,10 +4740,10 @@ const RAW_RUNTIME_STATE = ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/predicates", "workspace:packages/predicates"],\ ["@standardnotes/security", "workspace:packages/security"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["prettier", "npm:2.8.8"],\ @@ -4916,37 +4758,37 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/domain-events-infra/",\ "packageDependencies": [\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ - ["newrelic", "npm:10.1.0"],\ + ["newrelic", "npm:10.1.2"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["sqs-consumer", "virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:6.2.1"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ ["@standardnotes/encryption", [\ - ["npm:1.21.33", {\ - "packageLocation": "./.yarn/cache/@standardnotes-encryption-npm-1.21.33-cf277e08e5-087a72a88e.zip/node_modules/@standardnotes/encryption/",\ + ["npm:1.21.38", {\ + "packageLocation": "./.yarn/cache/@standardnotes-encryption-npm-1.21.38-d08c3d4766-1393840523.zip/node_modules/@standardnotes/encryption/",\ "packageDependencies": [\ - ["@standardnotes/encryption", "npm:1.21.33"],\ + ["@standardnotes/encryption", "npm:1.21.38"],\ ["@standardnotes/common", "workspace:packages/common"],\ - ["@standardnotes/models", "npm:1.45.0"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/models", "npm:1.45.5"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/sncrypto-common", "npm:1.13.3"],\ ["@standardnotes/utils", "npm:1.16.5"],\ ["reflect-metadata", "npm:0.1.13"]\ @@ -4959,39 +4801,39 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/event-store/",\ "packageDependencies": [\ ["@standardnotes/event-store", "workspace:packages/event-store"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ ["@standardnotes/time", "workspace:packages/time"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ - ["@types/nodemailer", "npm:6.4.7"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ + ["@types/nodemailer", "npm:6.4.8"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["inversify", "npm:6.0.1"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.15"],\ + ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ ["@standardnotes/features", [\ - ["npm:1.59.3", {\ - "packageLocation": "./.yarn/cache/@standardnotes-features-npm-1.59.3-420adc3bc8-b6d1fba15b.zip/node_modules/@standardnotes/features/",\ + ["npm:1.59.5", {\ + "packageLocation": "./.yarn/cache/@standardnotes-features-npm-1.59.5-83c83acde9-173b1f5d52.zip/node_modules/@standardnotes/features/",\ "packageDependencies": [\ - ["@standardnotes/features", "npm:1.59.3"],\ + ["@standardnotes/features", "npm:1.59.5"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/security", "workspace:packages/security"],\ @@ -5005,9 +4847,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/files/",\ "packageDependencies": [\ ["@standardnotes/files-server", "workspace:packages/files"],\ - ["@aws-sdk/client-s3", "npm:3.332.0"],\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-s3", "npm:3.342.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ @@ -5019,39 +4861,39 @@ const RAW_RUNTIME_STATE = ["@types/cors", "npm:2.8.13"],\ ["@types/express", "npm:4.17.17"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/jsonwebtoken", "npm:9.0.2"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ ["@types/prettyjson", "npm:0.0.30"],\ ["@types/uuid", "npm:8.3.4"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["connect-busboy", "npm:1.0.0"],\ ["cors", "npm:2.8.5"],\ ["dayjs", "npm:1.11.7"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ ["express-robots-txt", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:1.0.0"],\ ["express-winston", "virtual:b442cf0427cc365d1c137f7340f9b81f9b204561afe791a8564ae9590c3a7fc4b5f793aaf8817b946f75a3cb64d03ef8790eb847f8b576b41e700da7b00c240c#npm:4.2.0"],\ - ["helmet", "npm:6.1.5"],\ + ["helmet", "npm:6.2.0"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["jsonwebtoken", "npm:9.0.0"],\ - ["newrelic", "npm:10.1.0"],\ + ["newrelic", "npm:10.1.2"],\ ["nodemon", "npm:2.0.22"],\ - ["npm-check-updates", "npm:16.10.9"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["prettier", "npm:2.8.8"],\ ["prettyjson", "npm:1.2.5"],\ ["reflect-metadata", "npm:0.1.13"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ ["uuid", "npm:9.0.0"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -5071,34 +4913,34 @@ const RAW_RUNTIME_STATE = ["@types/cors", "npm:2.8.13"],\ ["@types/express", "npm:4.17.17"],\ ["@types/prettyjson", "npm:0.0.30"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["cors", "npm:2.8.5"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ ["express-robots-txt", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:1.0.0"],\ - ["helmet", "npm:6.1.5"],\ + ["helmet", "npm:6.2.0"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["prettier", "npm:2.8.8"],\ ["prettyjson", "npm:1.2.5"],\ ["reflect-metadata", "npm:0.1.13"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ ]],\ ["@standardnotes/models", [\ - ["npm:1.45.0", {\ - "packageLocation": "./.yarn/cache/@standardnotes-models-npm-1.45.0-fedf5b3306-dd47c916e9.zip/node_modules/@standardnotes/models/",\ + ["npm:1.45.5", {\ + "packageLocation": "./.yarn/cache/@standardnotes-models-npm-1.45.5-29326e959c-15f26c11b2.zip/node_modules/@standardnotes/models/",\ "packageDependencies": [\ - ["@standardnotes/models", "npm:1.45.0"],\ + ["@standardnotes/models", "npm:1.45.5"],\ ["@standardnotes/common", "workspace:packages/common"],\ - ["@standardnotes/features", "npm:1.59.3"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/features", "npm:1.59.5"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/utils", "npm:1.16.5"],\ ["lodash", "npm:4.17.21"]\ ],\ @@ -5110,10 +4952,10 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/predicates/",\ "packageDependencies": [\ ["@standardnotes/predicates", "workspace:packages/predicates"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["prettier", "npm:2.8.8"],\ @@ -5124,12 +4966,12 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@standardnotes/responses", [\ - ["npm:1.13.21", {\ - "packageLocation": "./.yarn/cache/@standardnotes-responses-npm-1.13.21-90b7bf5e6a-3b0a65b68c.zip/node_modules/@standardnotes/responses/",\ + ["npm:1.13.24", {\ + "packageLocation": "./.yarn/cache/@standardnotes-responses-npm-1.13.24-3b4167c7ea-3bcfee90f0.zip/node_modules/@standardnotes/responses/",\ "packageDependencies": [\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/common", "workspace:packages/common"],\ - ["@standardnotes/features", "npm:1.59.3"],\ + ["@standardnotes/features", "npm:1.59.5"],\ ["@standardnotes/security", "workspace:packages/security"],\ ["reflect-metadata", "npm:0.1.13"]\ ],\ @@ -5141,43 +4983,43 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/revisions/",\ "packageDependencies": [\ ["@standardnotes/revisions-server", "workspace:packages/revisions"],\ - ["@aws-sdk/client-s3", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-s3", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ - ["@standardnotes/api", "npm:1.26.5"],\ + ["@standardnotes/api", "npm:1.26.10"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/security", "workspace:packages/security"],\ ["@standardnotes/time", "workspace:packages/time"],\ ["@types/cors", "npm:2.8.13"],\ ["@types/dotenv", "npm:8.2.0"],\ ["@types/express", "npm:4.17.17"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["cors", "npm:2.8.5"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ - ["npm-check-updates", "npm:16.10.9"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["sqlite3", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:5.1.6"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.15"],\ + ["typeorm", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -5187,8 +5029,8 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/scheduler/",\ "packageDependencies": [\ ["@standardnotes/scheduler-server", "workspace:packages/scheduler"],\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ @@ -5196,27 +5038,27 @@ const RAW_RUNTIME_STATE = ["@standardnotes/predicates", "workspace:packages/predicates"],\ ["@standardnotes/time", "workspace:packages/time"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["dayjs", "npm:1.11.7"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["inversify", "npm:6.0.1"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ - ["npm-check-updates", "npm:16.10.9"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.15"],\ + ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -5226,11 +5068,11 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/security/",\ "packageDependencies": [\ ["@standardnotes/security", "workspace:packages/security"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/jsonwebtoken", "npm:9.0.2"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["jsonwebtoken", "npm:9.0.0"],\ @@ -5247,22 +5089,22 @@ const RAW_RUNTIME_STATE = "packageLocation": "./",\ "packageDependencies": [\ ["@standardnotes/server-monorepo", "workspace:."],\ - ["@commitlint/cli", "npm:17.6.3"],\ - ["@commitlint/config-conventional", "npm:17.6.3"],\ - ["@lerna-lite/cli", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.3.0"],\ - ["@lerna-lite/list", "npm:2.3.0"],\ + ["@commitlint/cli", "npm:17.6.5"],\ + ["@commitlint/config-conventional", "npm:17.6.5"],\ + ["@lerna-lite/cli", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:2.4.0"],\ + ["@lerna-lite/list", "npm:2.4.0"],\ ["@lerna-lite/publish", "npm:2.4.0"],\ - ["@lerna-lite/run", "npm:2.3.0"],\ - ["@lerna-lite/version", "npm:2.3.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@lerna-lite/run", "npm:2.4.0"],\ + ["@lerna-lite/version", "npm:2.4.0"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ - ["eslint", "npm:8.39.0"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.8.0"],\ ["ini", "npm:3.0.1"],\ - ["newrelic", "npm:10.1.0"],\ - ["npm-check-updates", "npm:16.10.9"],\ - ["ts-node", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1"],\ + ["newrelic", "npm:10.1.2"],\ + ["npm-check-updates", "npm:16.10.12"],\ + ["ts-node", "virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:10.9.1"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ ],\ "linkType": "SOFT"\ @@ -5274,9 +5116,9 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@standardnotes/settings", "workspace:packages/settings"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ @@ -5301,20 +5143,20 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@standardnotes/sncrypto-node", "workspace:packages/sncrypto-node"],\ ["@standardnotes/sncrypto-common", "npm:1.13.3"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/node", "npm:20.2.5"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["regenerator-runtime", "npm:0.13.11"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["ts-loader", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:9.4.2"],\ + ["ts-loader", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:9.4.3"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.82.0"]\ + ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.85.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -5324,56 +5166,56 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/syncing-server/",\ "packageDependencies": [\ ["@standardnotes/syncing-server", "workspace:packages/syncing-server"],\ - ["@aws-sdk/client-s3", "npm:3.332.0"],\ - ["@aws-sdk/client-sns", "npm:3.332.0"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-s3", "npm:3.342.0"],\ + ["@aws-sdk/client-sns", "npm:3.342.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ - ["@standardnotes/api", "npm:1.26.5"],\ + ["@standardnotes/api", "npm:1.26.10"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/security", "workspace:packages/security"],\ ["@standardnotes/settings", "workspace:packages/settings"],\ ["@standardnotes/time", "workspace:packages/time"],\ ["@types/cors", "npm:2.8.13"],\ ["@types/dotenv", "npm:8.2.0"],\ ["@types/express", "npm:4.17.17"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/jsonwebtoken", "npm:9.0.2"],\ - ["@types/newrelic", "npm:9.13.0"],\ + ["@types/newrelic", "npm:9.14.0"],\ ["@types/node", "npm:20.2.5"],\ ["@types/prettyjson", "npm:0.0.30"],\ ["@types/ua-parser-js", "npm:0.7.36"],\ ["@types/uuid", "npm:8.3.4"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["axios", "npm:1.4.0"],\ ["cors", "npm:2.8.5"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ - ["helmet", "npm:6.1.5"],\ + ["helmet", "npm:6.2.0"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["jsonwebtoken", "npm:9.0.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ ["nodemon", "npm:2.0.22"],\ - ["npm-check-updates", "npm:16.10.9"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["prettier", "npm:2.8.8"],\ ["prettyjson", "npm:1.2.5"],\ ["reflect-metadata", "npm:0.1.13"],\ ["sqlite3", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:5.1.6"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.15"],\ + ["typeorm", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ ["ua-parser-js", "npm:1.0.35"],\ ["uuid", "npm:9.0.0"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -5383,12 +5225,12 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/time/",\ "packageDependencies": [\ ["@standardnotes/time", "workspace:packages/time"],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/microtime", "npm:2.1.0"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["dayjs", "npm:1.11.7"],\ - ["eslint", "npm:8.39.0"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["microtime", "npm:3.1.1"],\ @@ -5418,41 +5260,41 @@ const RAW_RUNTIME_STATE = "packageLocation": "./packages/websockets/",\ "packageDependencies": [\ ["@standardnotes/websockets-server", "workspace:packages/websockets"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.1"],\ - ["@standardnotes/api", "npm:1.26.5"],\ + ["@standardnotes/api", "npm:1.26.10"],\ ["@standardnotes/common", "workspace:packages/common"],\ ["@standardnotes/domain-core", "workspace:packages/domain-core"],\ ["@standardnotes/domain-events", "workspace:packages/domain-events"],\ ["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\ - ["@standardnotes/responses", "npm:1.13.21"],\ + ["@standardnotes/responses", "npm:1.13.24"],\ ["@standardnotes/security", "workspace:packages/security"],\ ["@standardnotes/utils", "npm:1.16.5"],\ ["@types/cors", "npm:2.8.13"],\ ["@types/express", "npm:4.17.17"],\ ["@types/ioredis", "npm:5.0.0"],\ - ["@types/jest", "npm:29.5.1"],\ - ["@types/newrelic", "npm:9.13.0"],\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@types/jest", "npm:29.5.2"],\ + ["@types/newrelic", "npm:9.14.0"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["axios", "npm:1.4.0"],\ ["cors", "npm:2.8.5"],\ - ["dotenv", "npm:16.0.3"],\ - ["eslint", "npm:8.39.0"],\ + ["dotenv", "npm:16.1.3"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-plugin-prettier", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:4.2.1"],\ ["express", "npm:4.18.2"],\ ["inversify", "npm:6.0.1"],\ ["inversify-express-utils", "npm:6.4.3"],\ ["ioredis", "npm:5.3.2"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ - ["mysql2", "npm:3.2.4"],\ - ["newrelic", "npm:10.1.0"],\ + ["mysql2", "npm:3.3.3"],\ + ["newrelic", "npm:10.1.2"],\ ["prettier", "npm:2.8.8"],\ ["reflect-metadata", "npm:0.1.13"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ - ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.15"],\ + ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.16"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "linkType": "SOFT"\ }]\ @@ -5511,10 +5353,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@tsconfig/node16", [\ - ["npm:1.0.3", {\ - "packageLocation": "./.yarn/cache/@tsconfig-node16-npm-1.0.3-6a4a30eda2-4280081089.zip/node_modules/@tsconfig/node16/",\ + ["npm:1.0.4", {\ + "packageLocation": "./.yarn/cache/@tsconfig-node16-npm-1.0.4-b7cb87d859-d75e4f7d3e.zip/node_modules/@tsconfig/node16/",\ "packageDependencies": [\ - ["@tsconfig/node16", "npm:1.0.3"]\ + ["@tsconfig/node16", "npm:1.0.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -5534,21 +5376,21 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@tufjs/models", "npm:1.0.4"],\ ["@tufjs/canonical-json", "npm:1.0.0"],\ - ["minimatch", "npm:9.0.0"]\ + ["minimatch", "npm:9.0.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/babel__core", [\ - ["npm:7.20.0", {\ - "packageLocation": "./.yarn/cache/@types-babel__core-npm-7.20.0-cf2ab39970-bf92f75954.zip/node_modules/@types/babel__core/",\ + ["npm:7.20.1", {\ + "packageLocation": "./.yarn/cache/@types-babel__core-npm-7.20.1-f44761b6b6-49e743a5bf.zip/node_modules/@types/babel__core/",\ "packageDependencies": [\ - ["@types/babel__core", "npm:7.20.0"],\ - ["@babel/parser", "npm:7.21.8"],\ - ["@babel/types", "npm:7.21.5"],\ + ["@types/babel__core", "npm:7.20.1"],\ + ["@babel/parser", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"],\ ["@types/babel__generator", "npm:7.6.4"],\ ["@types/babel__template", "npm:7.4.1"],\ - ["@types/babel__traverse", "npm:7.18.5"]\ + ["@types/babel__traverse", "npm:7.20.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -5558,7 +5400,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-babel__generator-npm-7.6.4-03e776f956-2e66f16ed0.zip/node_modules/@types/babel__generator/",\ "packageDependencies": [\ ["@types/babel__generator", "npm:7.6.4"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -5568,18 +5410,18 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-babel__template-npm-7.4.1-fe1db49e53-ba9a947c2d.zip/node_modules/@types/babel__template/",\ "packageDependencies": [\ ["@types/babel__template", "npm:7.4.1"],\ - ["@babel/parser", "npm:7.21.8"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@babel/parser", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/babel__traverse", [\ - ["npm:7.18.5", {\ - "packageLocation": "./.yarn/cache/@types-babel__traverse-npm-7.18.5-4ee746f3a7-470a501a0d.zip/node_modules/@types/babel__traverse/",\ + ["npm:7.20.0", {\ + "packageLocation": "./.yarn/cache/@types-babel__traverse-npm-7.20.0-c5a0b2eb9a-dec5fb642f.zip/node_modules/@types/babel__traverse/",\ "packageDependencies": [\ - ["@types/babel__traverse", "npm:7.18.5"],\ - ["@babel/types", "npm:7.21.5"]\ + ["@types/babel__traverse", "npm:7.20.0"],\ + ["@babel/types", "npm:7.22.4"]\ ],\ "linkType": "HARD"\ }]\ @@ -5599,7 +5441,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@types/body-parser", "npm:1.19.2"],\ ["@types/connect", "npm:3.4.35"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5609,7 +5451,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-busboy-npm-1.5.0-0e24e7f08d-2abe975aa3.zip/node_modules/@types/busboy/",\ "packageDependencies": [\ ["@types/busboy", "npm:1.5.0"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5619,7 +5461,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-connect-npm-3.4.35-7337eee0a3-1fffce36ab.zip/node_modules/@types/connect/",\ "packageDependencies": [\ ["@types/connect", "npm:3.4.35"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5631,7 +5473,7 @@ const RAW_RUNTIME_STATE = ["@types/connect-busboy", "npm:1.0.0"],\ ["@types/busboy", "npm:1.5.0"],\ ["@types/express", "npm:4.17.17"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5641,16 +5483,16 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-cors-npm-2.8.13-4b8ac1068f-9c8b1c7322.zip/node_modules/@types/cors/",\ "packageDependencies": [\ ["@types/cors", "npm:2.8.13"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/debug", [\ - ["npm:4.1.7", {\ - "packageLocation": "./.yarn/cache/@types-debug-npm-4.1.7-f54c81f8db-ba0607de3a.zip/node_modules/@types/debug/",\ + ["npm:4.1.8", {\ + "packageLocation": "./.yarn/cache/@types-debug-npm-4.1.8-a04e2ca136-9c190e8129.zip/node_modules/@types/debug/",\ "packageDependencies": [\ - ["@types/debug", "npm:4.1.7"],\ + ["@types/debug", "npm:4.1.8"],\ ["@types/ms", "npm:0.7.31"]\ ],\ "linkType": "HARD"\ @@ -5661,18 +5503,18 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-dotenv-npm-8.2.0-f4d0e3d65b-13f90a36f7.zip/node_modules/@types/dotenv/",\ "packageDependencies": [\ ["@types/dotenv", "npm:8.2.0"],\ - ["dotenv", "npm:16.0.3"]\ + ["dotenv", "npm:16.1.3"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/eslint", [\ - ["npm:8.37.0", {\ - "packageLocation": "./.yarn/cache/@types-eslint-npm-8.37.0-1f765f44f3-5a1b547b4f.zip/node_modules/@types/eslint/",\ + ["npm:8.40.0", {\ + "packageLocation": "./.yarn/cache/@types-eslint-npm-8.40.0-f83ac3705a-64e7807d11.zip/node_modules/@types/eslint/",\ "packageDependencies": [\ - ["@types/eslint", "npm:8.37.0"],\ + ["@types/eslint", "npm:8.40.0"],\ ["@types/estree", "npm:1.0.1"],\ - ["@types/json-schema", "npm:7.0.11"]\ + ["@types/json-schema", "npm:7.0.12"]\ ],\ "linkType": "HARD"\ }]\ @@ -5682,7 +5524,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-eslint-scope-npm-3.7.4-c11d226d71-c0a026bc2b.zip/node_modules/@types/eslint-scope/",\ "packageDependencies": [\ ["@types/eslint-scope", "npm:3.7.4"],\ - ["@types/eslint", "npm:8.37.0"],\ + ["@types/eslint", "npm:8.40.0"],\ ["@types/estree", "npm:1.0.1"]\ ],\ "linkType": "HARD"\ @@ -5703,7 +5545,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@types/express", "npm:4.17.17"],\ ["@types/body-parser", "npm:1.19.2"],\ - ["@types/express-serve-static-core", "npm:4.17.34"],\ + ["@types/express-serve-static-core", "npm:4.17.35"],\ ["@types/qs", "npm:6.9.7"],\ ["@types/serve-static", "npm:1.15.1"]\ ],\ @@ -5711,11 +5553,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/express-serve-static-core", [\ - ["npm:4.17.34", {\ - "packageLocation": "./.yarn/cache/@types-express-serve-static-core-npm-4.17.34-b1081fd10c-db0f42fb7b.zip/node_modules/@types/express-serve-static-core/",\ + ["npm:4.17.35", {\ + "packageLocation": "./.yarn/cache/@types-express-serve-static-core-npm-4.17.35-c86e5f6e4a-20d48d5792.zip/node_modules/@types/express-serve-static-core/",\ "packageDependencies": [\ - ["@types/express-serve-static-core", "npm:4.17.34"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/express-serve-static-core", "npm:4.17.35"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/qs", "npm:6.9.7"],\ ["@types/range-parser", "npm:1.2.4"],\ ["@types/send", "npm:0.17.1"]\ @@ -5728,7 +5570,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-graceful-fs-npm-4.1.6-1eadcf742d-dc2e227d91.zip/node_modules/@types/graceful-fs/",\ "packageDependencies": [\ ["@types/graceful-fs", "npm:4.1.6"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5782,10 +5624,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/jest", [\ - ["npm:29.5.1", {\ - "packageLocation": "./.yarn/cache/@types-jest-npm-29.5.1-0eddfd7e9a-1a67d4fe2d.zip/node_modules/@types/jest/",\ + ["npm:29.5.2", {\ + "packageLocation": "./.yarn/cache/@types-jest-npm-29.5.2-1a72e55a50-999a7c560e.zip/node_modules/@types/jest/",\ "packageDependencies": [\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["expect", "npm:29.5.0"],\ ["pretty-format", "npm:29.5.0"]\ ],\ @@ -5793,10 +5635,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/json-schema", [\ - ["npm:7.0.11", {\ - "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.11-79462ae5ca-8e5c6dd393.zip/node_modules/@types/json-schema/",\ + ["npm:7.0.12", {\ + "packageLocation": "./.yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-3a4aae29f9.zip/node_modules/@types/json-schema/",\ "packageDependencies": [\ - ["@types/json-schema", "npm:7.0.11"]\ + ["@types/json-schema", "npm:7.0.12"]\ ],\ "linkType": "HARD"\ }]\ @@ -5806,7 +5648,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-jsonwebtoken-npm-9.0.2-7af15f7b9b-4b1ecf9c0b.zip/node_modules/@types/jsonwebtoken/",\ "packageDependencies": [\ ["@types/jsonwebtoken", "npm:9.0.2"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5882,26 +5724,19 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/newrelic", [\ - ["npm:9.13.0", {\ - "packageLocation": "./.yarn/cache/@types-newrelic-npm-9.13.0-a283f22b65-d0269b05c4.zip/node_modules/@types/newrelic/",\ + ["npm:9.14.0", {\ + "packageLocation": "./.yarn/cache/@types-newrelic-npm-9.14.0-4668da51a1-2ec951bd8f.zip/node_modules/@types/newrelic/",\ "packageDependencies": [\ - ["@types/newrelic", "npm:9.13.0"]\ + ["@types/newrelic", "npm:9.14.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@types/node", [\ - ["npm:18.16.4", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-18.16.4-9852dff702-a7a5662d65.zip/node_modules/@types/node/",\ + ["npm:18.16.16", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-18.16.16-8a41330dc3-946bd4d8e6.zip/node_modules/@types/node/",\ "packageDependencies": [\ - ["@types/node", "npm:18.16.4"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:20.1.0", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.1.0-c5561d67cd-299fe2b032.zip/node_modules/@types/node/",\ - "packageDependencies": [\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:18.16.16"]\ ],\ "linkType": "HARD"\ }],\ @@ -5914,11 +5749,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/nodemailer", [\ - ["npm:6.4.7", {\ - "packageLocation": "./.yarn/cache/@types-nodemailer-npm-6.4.7-8618621ba9-4fefece349.zip/node_modules/@types/nodemailer/",\ + ["npm:6.4.8", {\ + "packageLocation": "./.yarn/cache/@types-nodemailer-npm-6.4.8-04975b93f9-8febb43b8a.zip/node_modules/@types/nodemailer/",\ "packageDependencies": [\ - ["@types/nodemailer", "npm:6.4.7"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/nodemailer", "npm:6.4.8"],\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -5943,10 +5778,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/prettier", [\ - ["npm:2.7.2", {\ - "packageLocation": "./.yarn/cache/@types-prettier-npm-2.7.2-6b2e2f518f-d4d09d291e.zip/node_modules/@types/prettier/",\ + ["npm:2.7.3", {\ + "packageLocation": "./.yarn/cache/@types-prettier-npm-2.7.3-497316f37c-940c06437f.zip/node_modules/@types/prettier/",\ "packageDependencies": [\ - ["@types/prettier", "npm:2.7.2"]\ + ["@types/prettier", "npm:2.7.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -5979,10 +5814,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/semver", [\ - ["npm:7.3.13", {\ - "packageLocation": "./.yarn/cache/@types-semver-npm-7.3.13-56212b60da-a76156ff60.zip/node_modules/@types/semver/",\ + ["npm:7.5.0", {\ + "packageLocation": "./.yarn/cache/@types-semver-npm-7.5.0-4823ff34be-dac255fae6.zip/node_modules/@types/semver/",\ "packageDependencies": [\ - ["@types/semver", "npm:7.3.13"]\ + ["@types/semver", "npm:7.5.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -5993,7 +5828,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@types/send", "npm:0.17.1"],\ ["@types/mime", "npm:1.3.2"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -6004,7 +5839,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@types/serve-static", "npm:1.15.1"],\ ["@types/mime", "npm:3.0.1"],\ - ["@types/node", "npm:20.1.0"]\ + ["@types/node", "npm:20.2.5"]\ ],\ "linkType": "HARD"\ }]\ @@ -6065,32 +5900,32 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@typescript-eslint/eslint-plugin", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.2-ac649dc670-777969bdcc.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.8-255dbedf93-47fb031799.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ - ["@typescript-eslint/eslint-plugin", "npm:5.59.2"]\ + ["@typescript-eslint/eslint-plugin", "npm:5.59.8"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-e393e2efbf/0/cache/@typescript-eslint-eslint-plugin-npm-5.59.2-ac649dc670-777969bdcc.zip/node_modules/@typescript-eslint/eslint-plugin/",\ + ["virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-eslint-plugin-virtual-39388bed22/0/cache/@typescript-eslint-eslint-plugin-npm-5.59.8-255dbedf93-47fb031799.zip/node_modules/@typescript-eslint/eslint-plugin/",\ "packageDependencies": [\ - ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["@eslint-community/regexpp", "npm:4.5.1"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ ["@types/typescript-eslint__parser", null],\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ - ["@typescript-eslint/scope-manager", "npm:5.59.2"],\ - ["@typescript-eslint/type-utils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2"],\ - ["@typescript-eslint/utils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ + ["@typescript-eslint/scope-manager", "npm:5.59.8"],\ + ["@typescript-eslint/type-utils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8"],\ + ["@typescript-eslint/utils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["eslint", "npm:8.39.0"],\ + ["eslint", "npm:8.41.0"],\ ["grapheme-splitter", "npm:1.0.4"],\ ["ignore", "npm:5.2.4"],\ ["natural-compare-lite", "npm:1.4.0"],\ - ["semver", "npm:7.5.0"],\ - ["tsutils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:3.21.0"],\ + ["semver", "npm:7.5.1"],\ + ["tsutils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ ],\ "packagePeers": [\ @@ -6105,24 +5940,24 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@typescript-eslint/parser", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-parser-npm-5.59.2-74b298efa1-86d9a46672.zip/node_modules/@typescript-eslint/parser/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-parser-npm-5.59.8-ceb8b0eaa0-e912585cf3.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ - ["@typescript-eslint/parser", "npm:5.59.2"]\ + ["@typescript-eslint/parser", "npm:5.59.8"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-a1bb638baf/0/cache/@typescript-eslint-parser-npm-5.59.2-74b298efa1-86d9a46672.zip/node_modules/@typescript-eslint/parser/",\ + ["virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-parser-virtual-e8e6d00381/0/cache/@typescript-eslint-parser-npm-5.59.8-ceb8b0eaa0-e912585cf3.zip/node_modules/@typescript-eslint/parser/",\ "packageDependencies": [\ - ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\ + ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.8"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ - ["@typescript-eslint/scope-manager", "npm:5.59.2"],\ - ["@typescript-eslint/types", "npm:5.59.2"],\ - ["@typescript-eslint/typescript-estree", "virtual:f2198afe752c00bc6f83b3c5c7d3bb4adb4511fd221c659855d746115cc29905d6d01cb4f41996d128ac87b5dc0f1d3dcb6ee1d90bd5ddcdfea6938c740368f9#npm:5.59.2"],\ + ["@typescript-eslint/scope-manager", "npm:5.59.8"],\ + ["@typescript-eslint/types", "npm:5.59.8"],\ + ["@typescript-eslint/typescript-estree", "virtual:324cfb1fa0a2310088acfa4157b7802167297b7dc05ce5858c7d17384b91d26d46b32bcc17660a59b838c86f329e23757758526cdf783b596e58a41f3ab4a0e9#npm:5.59.8"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["eslint", "npm:8.39.0"],\ + ["eslint", "npm:8.41.0"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ ],\ "packagePeers": [\ @@ -6135,35 +5970,35 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@typescript-eslint/scope-manager", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-scope-manager-npm-5.59.2-d06d5664e0-4cd52a2f00.zip/node_modules/@typescript-eslint/scope-manager/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-scope-manager-npm-5.59.8-d925c50275-e561598f5c.zip/node_modules/@typescript-eslint/scope-manager/",\ "packageDependencies": [\ - ["@typescript-eslint/scope-manager", "npm:5.59.2"],\ - ["@typescript-eslint/types", "npm:5.59.2"],\ - ["@typescript-eslint/visitor-keys", "npm:5.59.2"]\ + ["@typescript-eslint/scope-manager", "npm:5.59.8"],\ + ["@typescript-eslint/types", "npm:5.59.8"],\ + ["@typescript-eslint/visitor-keys", "npm:5.59.8"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@typescript-eslint/type-utils", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-type-utils-npm-5.59.2-144edc1eaa-bc3aa3e29b.zip/node_modules/@typescript-eslint/type-utils/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-type-utils-npm-5.59.8-61b85480e4-a2add3cf3f.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ - ["@typescript-eslint/type-utils", "npm:5.59.2"]\ + ["@typescript-eslint/type-utils", "npm:5.59.8"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-f2198afe75/0/cache/@typescript-eslint-type-utils-npm-5.59.2-144edc1eaa-bc3aa3e29b.zip/node_modules/@typescript-eslint/type-utils/",\ + ["virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-type-utils-virtual-324cfb1fa0/0/cache/@typescript-eslint-type-utils-npm-5.59.8-61b85480e4-a2add3cf3f.zip/node_modules/@typescript-eslint/type-utils/",\ "packageDependencies": [\ - ["@typescript-eslint/type-utils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2"],\ + ["@typescript-eslint/type-utils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8"],\ ["@types/eslint", null],\ ["@types/typescript", null],\ - ["@typescript-eslint/typescript-estree", "virtual:f2198afe752c00bc6f83b3c5c7d3bb4adb4511fd221c659855d746115cc29905d6d01cb4f41996d128ac87b5dc0f1d3dcb6ee1d90bd5ddcdfea6938c740368f9#npm:5.59.2"],\ - ["@typescript-eslint/utils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2"],\ + ["@typescript-eslint/typescript-estree", "virtual:324cfb1fa0a2310088acfa4157b7802167297b7dc05ce5858c7d17384b91d26d46b32bcc17660a59b838c86f329e23757758526cdf783b596e58a41f3ab4a0e9#npm:5.59.8"],\ + ["@typescript-eslint/utils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["eslint", "npm:8.39.0"],\ - ["tsutils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:3.21.0"],\ + ["eslint", "npm:8.41.0"],\ + ["tsutils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:3.21.0"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ ],\ "packagePeers": [\ @@ -6176,35 +6011,35 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@typescript-eslint/types", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-types-npm-5.59.2-09958c5a9f-4d565653b8.zip/node_modules/@typescript-eslint/types/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-types-npm-5.59.8-aac9636f23-d92f641719.zip/node_modules/@typescript-eslint/types/",\ "packageDependencies": [\ - ["@typescript-eslint/types", "npm:5.59.2"]\ + ["@typescript-eslint/types", "npm:5.59.8"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@typescript-eslint/typescript-estree", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.2-13171b9290-01f7a9abb9.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.8-8d25500a8f-94f08e72ba.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "npm:5.59.2"]\ + ["@typescript-eslint/typescript-estree", "npm:5.59.8"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:bd9c725d6bfcd61c04e7547fb98ef16209de9d6206fd33ffd917fd7cfa4e601248558d8430aebf430b67f1d2ab23439132fe2b8cbd793e3e12c8e98d00161679#npm:5.59.2", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-bf62ef1c6f/0/cache/@typescript-eslint-typescript-estree-npm-5.59.2-13171b9290-01f7a9abb9.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["virtual:324cfb1fa0a2310088acfa4157b7802167297b7dc05ce5858c7d17384b91d26d46b32bcc17660a59b838c86f329e23757758526cdf783b596e58a41f3ab4a0e9#npm:5.59.8", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-7705ca7c6b/0/cache/@typescript-eslint-typescript-estree-npm-5.59.8-8d25500a8f-94f08e72ba.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:bd9c725d6bfcd61c04e7547fb98ef16209de9d6206fd33ffd917fd7cfa4e601248558d8430aebf430b67f1d2ab23439132fe2b8cbd793e3e12c8e98d00161679#npm:5.59.2"],\ + ["@typescript-eslint/typescript-estree", "virtual:324cfb1fa0a2310088acfa4157b7802167297b7dc05ce5858c7d17384b91d26d46b32bcc17660a59b838c86f329e23757758526cdf783b596e58a41f3ab4a0e9#npm:5.59.8"],\ ["@types/typescript", null],\ - ["@typescript-eslint/types", "npm:5.59.2"],\ - ["@typescript-eslint/visitor-keys", "npm:5.59.2"],\ + ["@typescript-eslint/types", "npm:5.59.8"],\ + ["@typescript-eslint/visitor-keys", "npm:5.59.8"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ - ["semver", "npm:7.5.0"],\ - ["tsutils", "virtual:bf62ef1c6ffb8fd658e7f83333428938df10db976eec79995f23db479ad786a83e0f34b8fc6208940aa64f91a8cafb627f1c9a5209766f28b0eb4d279a7e0fec#npm:3.21.0"],\ - ["typescript", null]\ + ["semver", "npm:7.5.1"],\ + ["tsutils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:3.21.0"],\ + ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -6212,19 +6047,19 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:f2198afe752c00bc6f83b3c5c7d3bb4adb4511fd221c659855d746115cc29905d6d01cb4f41996d128ac87b5dc0f1d3dcb6ee1d90bd5ddcdfea6938c740368f9#npm:5.59.2", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-2eafbba050/0/cache/@typescript-eslint-typescript-estree-npm-5.59.2-13171b9290-01f7a9abb9.zip/node_modules/@typescript-eslint/typescript-estree/",\ + ["virtual:fcb617ee99b2af3881ae95250bcf6cfcb517a07dce8227a9488c7a2465773dd7facec58f236b76302d0ff405ea50ca5b20bd5859ea4fc39c729a77fc5cc2ac30#npm:5.59.8", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-typescript-estree-virtual-ca06b20d81/0/cache/@typescript-eslint-typescript-estree-npm-5.59.8-8d25500a8f-94f08e72ba.zip/node_modules/@typescript-eslint/typescript-estree/",\ "packageDependencies": [\ - ["@typescript-eslint/typescript-estree", "virtual:f2198afe752c00bc6f83b3c5c7d3bb4adb4511fd221c659855d746115cc29905d6d01cb4f41996d128ac87b5dc0f1d3dcb6ee1d90bd5ddcdfea6938c740368f9#npm:5.59.2"],\ + ["@typescript-eslint/typescript-estree", "virtual:fcb617ee99b2af3881ae95250bcf6cfcb517a07dce8227a9488c7a2465773dd7facec58f236b76302d0ff405ea50ca5b20bd5859ea4fc39c729a77fc5cc2ac30#npm:5.59.8"],\ ["@types/typescript", null],\ - ["@typescript-eslint/types", "npm:5.59.2"],\ - ["@typescript-eslint/visitor-keys", "npm:5.59.2"],\ + ["@typescript-eslint/types", "npm:5.59.8"],\ + ["@typescript-eslint/visitor-keys", "npm:5.59.8"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ ["globby", "npm:11.1.0"],\ ["is-glob", "npm:4.0.3"],\ - ["semver", "npm:7.5.0"],\ - ["tsutils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:3.21.0"],\ - ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ + ["semver", "npm:7.5.1"],\ + ["tsutils", "virtual:ca06b20d81832ed7bc000f8e9cff2595c76b19dab6b2c075cbd8b2a146fd3a9ad51a5b929a979ab00364139a9943427a2ad4d48530e82470e718317f2f6b5539#npm:3.21.0"],\ + ["typescript", null]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -6234,27 +6069,27 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@typescript-eslint/utils", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-utils-npm-5.59.2-6eb4bb6d5c-18d221a1ed.zip/node_modules/@typescript-eslint/utils/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-utils-npm-5.59.8-24495aa535-814d79eeb5.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ - ["@typescript-eslint/utils", "npm:5.59.2"]\ + ["@typescript-eslint/utils", "npm:5.59.8"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2", {\ - "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-bd9c725d6b/0/cache/@typescript-eslint-utils-npm-5.59.2-6eb4bb6d5c-18d221a1ed.zip/node_modules/@typescript-eslint/utils/",\ + ["virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8", {\ + "packageLocation": "./.yarn/__virtual__/@typescript-eslint-utils-virtual-fcb617ee99/0/cache/@typescript-eslint-utils-npm-5.59.8-24495aa535-814d79eeb5.zip/node_modules/@typescript-eslint/utils/",\ "packageDependencies": [\ - ["@typescript-eslint/utils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:5.59.2"],\ - ["@eslint-community/eslint-utils", "virtual:d92bace04d6d26247b24721a8766993aa3a98c631265bb389d6aa7c17b2a0708ccc877f009bd6a9cb50b8597fbe776c68dae7621d198ff292ee4bc23bd4b012f#npm:4.4.0"],\ + ["@typescript-eslint/utils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:5.59.8"],\ + ["@eslint-community/eslint-utils", "virtual:0e83e90d273f68a1bd1543dde3480eaf525801444ba81cbede9215242f0a1bd9563c2ba1980136297cb6880745c63575691537145c6b548460570102de527f4e#npm:4.4.0"],\ ["@types/eslint", null],\ - ["@types/json-schema", "npm:7.0.11"],\ - ["@types/semver", "npm:7.3.13"],\ - ["@typescript-eslint/scope-manager", "npm:5.59.2"],\ - ["@typescript-eslint/types", "npm:5.59.2"],\ - ["@typescript-eslint/typescript-estree", "virtual:bd9c725d6bfcd61c04e7547fb98ef16209de9d6206fd33ffd917fd7cfa4e601248558d8430aebf430b67f1d2ab23439132fe2b8cbd793e3e12c8e98d00161679#npm:5.59.2"],\ - ["eslint", "npm:8.39.0"],\ + ["@types/json-schema", "npm:7.0.12"],\ + ["@types/semver", "npm:7.5.0"],\ + ["@typescript-eslint/scope-manager", "npm:5.59.8"],\ + ["@typescript-eslint/types", "npm:5.59.8"],\ + ["@typescript-eslint/typescript-estree", "virtual:fcb617ee99b2af3881ae95250bcf6cfcb517a07dce8227a9488c7a2465773dd7facec58f236b76302d0ff405ea50ca5b20bd5859ea4fc39c729a77fc5cc2ac30#npm:5.59.8"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-scope", "npm:5.1.1"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -6264,12 +6099,12 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@typescript-eslint/visitor-keys", [\ - ["npm:5.59.2", {\ - "packageLocation": "./.yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.2-c61569dee5-de546e6677.zip/node_modules/@typescript-eslint/visitor-keys/",\ + ["npm:5.59.8", {\ + "packageLocation": "./.yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.8-bd7eb812d7-859bf38ac7.zip/node_modules/@typescript-eslint/visitor-keys/",\ "packageDependencies": [\ - ["@typescript-eslint/visitor-keys", "npm:5.59.2"],\ - ["@typescript-eslint/types", "npm:5.59.2"],\ - ["eslint-visitor-keys", "npm:3.4.0"]\ + ["@typescript-eslint/visitor-keys", "npm:5.59.8"],\ + ["@typescript-eslint/types", "npm:5.59.8"],\ + ["eslint-visitor-keys", "npm:3.4.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -6284,171 +6119,171 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@webassemblyjs/ast", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.5-ad883e230f-c8b88cb98c.zip/node_modules/@webassemblyjs/ast/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-8d376b04d2.zip/node_modules/@webassemblyjs/ast/",\ "packageDependencies": [\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/helper-numbers", "npm:1.11.5"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.5"]\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/floating-point-hex-parser", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.5-01ff4bf952-0fd24f6feb.zip/node_modules/@webassemblyjs/floating-point-hex-parser/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-574a1b5daf.zip/node_modules/@webassemblyjs/floating-point-hex-parser/",\ "packageDependencies": [\ - ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.5"]\ + ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/helper-api-error", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.5-553acf3c94-b8047772c5.zip/node_modules/@webassemblyjs/helper-api-error/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-b5302eee13.zip/node_modules/@webassemblyjs/helper-api-error/",\ "packageDependencies": [\ - ["@webassemblyjs/helper-api-error", "npm:1.11.5"]\ + ["@webassemblyjs/helper-api-error", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/helper-buffer", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.5-76356c5b6d-010b11dbef.zip/node_modules/@webassemblyjs/helper-buffer/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b9536a8f5f.zip/node_modules/@webassemblyjs/helper-buffer/",\ "packageDependencies": [\ - ["@webassemblyjs/helper-buffer", "npm:1.11.5"]\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/helper-numbers", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.5-efa2500e8e-bff0ef813d.zip/node_modules/@webassemblyjs/helper-numbers/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-a1f6b9db54.zip/node_modules/@webassemblyjs/helper-numbers/",\ "packageDependencies": [\ - ["@webassemblyjs/helper-numbers", "npm:1.11.5"],\ - ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.5"],\ - ["@webassemblyjs/helper-api-error", "npm:1.11.5"],\ + ["@webassemblyjs/helper-numbers", "npm:1.11.6"],\ + ["@webassemblyjs/floating-point-hex-parser", "npm:1.11.6"],\ + ["@webassemblyjs/helper-api-error", "npm:1.11.6"],\ ["@xtuc/long", "npm:4.2.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/helper-wasm-bytecode", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.5-2f1be836c6-33a9f88a0b.zip/node_modules/@webassemblyjs/helper-wasm-bytecode/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-2563ee4cdc.zip/node_modules/@webassemblyjs/helper-wasm-bytecode/",\ "packageDependencies": [\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.5"]\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/helper-wasm-section", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.5-b74ded6c5d-d6204a24e7.zip/node_modules/@webassemblyjs/helper-wasm-section/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-0edb6fff2b.zip/node_modules/@webassemblyjs/helper-wasm-section/",\ "packageDependencies": [\ - ["@webassemblyjs/helper-wasm-section", "npm:1.11.5"],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/helper-buffer", "npm:1.11.5"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-gen", "npm:1.11.5"]\ + ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/ieee754", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-ieee754-npm-1.11.5-42a1b795b4-111a10e446.zip/node_modules/@webassemblyjs/ieee754/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-2f17b3d8bd.zip/node_modules/@webassemblyjs/ieee754/",\ "packageDependencies": [\ - ["@webassemblyjs/ieee754", "npm:1.11.5"],\ + ["@webassemblyjs/ieee754", "npm:1.11.6"],\ ["@xtuc/ieee754", "npm:1.2.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/leb128", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-leb128-npm-1.11.5-7e82c71f81-0e2cd55445.zip/node_modules/@webassemblyjs/leb128/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-10edfc6b7e.zip/node_modules/@webassemblyjs/leb128/",\ "packageDependencies": [\ - ["@webassemblyjs/leb128", "npm:1.11.5"],\ + ["@webassemblyjs/leb128", "npm:1.11.6"],\ ["@xtuc/long", "npm:4.2.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/utf8", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-utf8-npm-1.11.5-775c246fbf-8f1ab885c6.zip/node_modules/@webassemblyjs/utf8/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-6fa95283a6.zip/node_modules/@webassemblyjs/utf8/",\ "packageDependencies": [\ - ["@webassemblyjs/utf8", "npm:1.11.5"]\ + ["@webassemblyjs/utf8", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/wasm-edit", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.5-9643f15610-34b9ec8beb.zip/node_modules/@webassemblyjs/wasm-edit/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-66831a6ad2.zip/node_modules/@webassemblyjs/wasm-edit/",\ "packageDependencies": [\ - ["@webassemblyjs/wasm-edit", "npm:1.11.5"],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/helper-buffer", "npm:1.11.5"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.5"],\ - ["@webassemblyjs/helper-wasm-section", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-gen", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-opt", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-parser", "npm:1.11.5"],\ - ["@webassemblyjs/wast-printer", "npm:1.11.5"]\ + ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-section", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ + ["@webassemblyjs/wast-printer", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/wasm-gen", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.5-a3a569938d-889c804f48.zip/node_modules/@webassemblyjs/wasm-gen/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-a4746a13ce.zip/node_modules/@webassemblyjs/wasm-gen/",\ "packageDependencies": [\ - ["@webassemblyjs/wasm-gen", "npm:1.11.5"],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.5"],\ - ["@webassemblyjs/ieee754", "npm:1.11.5"],\ - ["@webassemblyjs/leb128", "npm:1.11.5"],\ - ["@webassemblyjs/utf8", "npm:1.11.5"]\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/ieee754", "npm:1.11.6"],\ + ["@webassemblyjs/leb128", "npm:1.11.6"],\ + ["@webassemblyjs/utf8", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/wasm-opt", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.5-efd2b45433-af4ab63fab.zip/node_modules/@webassemblyjs/wasm-opt/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-aa9fc4f9cd.zip/node_modules/@webassemblyjs/wasm-opt/",\ "packageDependencies": [\ - ["@webassemblyjs/wasm-opt", "npm:1.11.5"],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/helper-buffer", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-gen", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-parser", "npm:1.11.5"]\ + ["@webassemblyjs/wasm-opt", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-buffer", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-gen", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/wasm-parser", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.5-c3794b38b2-a7f20c9a9c.zip/node_modules/@webassemblyjs/wasm-parser/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-22984aafc0.zip/node_modules/@webassemblyjs/wasm-parser/",\ "packageDependencies": [\ - ["@webassemblyjs/wasm-parser", "npm:1.11.5"],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/helper-api-error", "npm:1.11.5"],\ - ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.5"],\ - ["@webassemblyjs/ieee754", "npm:1.11.5"],\ - ["@webassemblyjs/leb128", "npm:1.11.5"],\ - ["@webassemblyjs/utf8", "npm:1.11.5"]\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/helper-api-error", "npm:1.11.6"],\ + ["@webassemblyjs/helper-wasm-bytecode", "npm:1.11.6"],\ + ["@webassemblyjs/ieee754", "npm:1.11.6"],\ + ["@webassemblyjs/leb128", "npm:1.11.6"],\ + ["@webassemblyjs/utf8", "npm:1.11.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@webassemblyjs/wast-printer", [\ - ["npm:1.11.5", {\ - "packageLocation": "./.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.5-b5f768e688-ffca102c33.zip/node_modules/@webassemblyjs/wast-printer/",\ + ["npm:1.11.6", {\ + "packageLocation": "./.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-5e797fe94d.zip/node_modules/@webassemblyjs/wast-printer/",\ "packageDependencies": [\ - ["@webassemblyjs/wast-printer", "npm:1.11.5"],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ + ["@webassemblyjs/wast-printer", "npm:1.11.6"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ ["@xtuc/long", "npm:4.2.2"]\ ],\ "linkType": "HARD"\ @@ -6530,17 +6365,17 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["acorn-import-assertions", [\ - ["npm:1.8.0", {\ - "packageLocation": "./.yarn/cache/acorn-import-assertions-npm-1.8.0-e9a9d57e27-7963bf636b.zip/node_modules/acorn-import-assertions/",\ + ["npm:1.9.0", {\ + "packageLocation": "./.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-acfc128938.zip/node_modules/acorn-import-assertions/",\ "packageDependencies": [\ - ["acorn-import-assertions", "npm:1.8.0"]\ + ["acorn-import-assertions", "npm:1.9.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:3c1089f73ac314bb9f9d735ca9a49cc2729efc4037ebbfdb2e1f8217d10c3ef1eb90309898c7aa16b7e7de83ec50c1dbb3fe7f5d4db2293c391051e3c327d614#npm:1.8.0", {\ - "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-0e6ac62356/0/cache/acorn-import-assertions-npm-1.8.0-e9a9d57e27-7963bf636b.zip/node_modules/acorn-import-assertions/",\ + ["virtual:88795c40c2ab4c9a5f946a0376f07534ed5d01eb42a9beed2b4861c019e6c904e417f85b54c9865f2ffb69d101a8278dc1dad6e8b4e1ce7c248c5a76436b9a5d#npm:1.9.0", {\ + "packageLocation": "./.yarn/__virtual__/acorn-import-assertions-virtual-4c5f4a15ce/0/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-acfc128938.zip/node_modules/acorn-import-assertions/",\ "packageDependencies": [\ - ["acorn-import-assertions", "virtual:3c1089f73ac314bb9f9d735ca9a49cc2729efc4037ebbfdb2e1f8217d10c3ef1eb90309898c7aa16b7e7de83ec50c1dbb3fe7f5d4db2293c391051e3c327d614#npm:1.8.0"],\ + ["acorn-import-assertions", "virtual:88795c40c2ab4c9a5f946a0376f07534ed5d01eb42a9beed2b4861c019e6c904e417f85b54c9865f2ffb69d101a8278dc1dad6e8b4e1ce7c248c5a76436b9a5d#npm:1.9.0"],\ ["@types/acorn", null],\ ["acorn", "npm:8.8.2"]\ ],\ @@ -6559,10 +6394,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:057dc7b3c1f6024b5a316c7e5d452c8397d903f7ff9736e8d71b89efc60141dc4c8c777c0c1057fa0d3bf0d3dd59eec8694b4efb6f0fb20c747ec060bab7195d#npm:5.3.2", {\ - "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-232e493aa9/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-868f313daf.zip/node_modules/acorn-jsx/",\ + ["virtual:5fc9506cdac3b623f10b3f7adb0b64c62d2c6059855d74020d649d3c7df60271229590b28e7061203e031c21cd88cfd7344e13902ceb1f7776b1da6a18ef4ad8#npm:5.3.2", {\ + "packageLocation": "./.yarn/__virtual__/acorn-jsx-virtual-b5f3bb1aa9/0/cache/acorn-jsx-npm-5.3.2-d7594599ea-868f313daf.zip/node_modules/acorn-jsx/",\ "packageDependencies": [\ - ["acorn-jsx", "virtual:057dc7b3c1f6024b5a316c7e5d452c8397d903f7ff9736e8d71b89efc60141dc4c8c777c0c1057fa0d3bf0d3dd59eec8694b4efb6f0fb20c747ec060bab7195d#npm:5.3.2"],\ + ["acorn-jsx", "virtual:5fc9506cdac3b623f10b3f7adb0b64c62d2c6059855d74020d649d3c7df60271229590b28e7061203e031c21cd88cfd7344e13902ceb1f7776b1da6a18ef4ad8#npm:5.3.2"],\ ["@types/acorn", null],\ ["acorn", "npm:8.8.2"]\ ],\ @@ -6800,7 +6635,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["are-we-there-yet", "npm:4.0.0"],\ ["delegates", "npm:1.0.0"],\ - ["readable-stream", "npm:4.3.0"]\ + ["readable-stream", "npm:4.4.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -6890,7 +6725,7 @@ const RAW_RUNTIME_STATE = ["asn1js", "npm:3.0.5"],\ ["pvtsutils", "npm:1.3.2"],\ ["pvutils", "npm:1.1.3"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -6937,9 +6772,9 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/babel-jest-virtual-df00ac435e/0/cache/babel-jest-npm-29.5.0-7423e21d96-77be7fcdb7.zip/node_modules/babel-jest/",\ "packageDependencies": [\ ["babel-jest", "virtual:19c52a5c872e71ec610be6cbd68ada378efc765c5803f5526bf65e10c8bc9891c9d97388155f555343a3ff74f9f368b5d53a49a63e91c43e0ff045c8fce68263#npm:29.5.0"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@jest/transform", "npm:29.5.0"],\ - ["@types/babel__core", "npm:7.20.0"],\ + ["@types/babel__core", "npm:7.20.1"],\ ["babel-plugin-istanbul", "npm:6.1.1"],\ ["babel-preset-jest", "virtual:df00ac435e60c4b290078bc8021be08523c3783b83090a79fddf2f1d971481ddc98fad132bc97968b1bc7213c57fe0aafecee8586d5a4e5f9eb0699ac725d275#npm:29.5.0"],\ ["chalk", "npm:4.1.2"],\ @@ -6971,10 +6806,10 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/babel-plugin-jest-hoist-npm-29.5.0-3760955b96-b9a8ede95b.zip/node_modules/babel-plugin-jest-hoist/",\ "packageDependencies": [\ ["babel-plugin-jest-hoist", "npm:29.5.0"],\ - ["@babel/template", "npm:7.20.7"],\ - ["@babel/types", "npm:7.21.5"],\ - ["@types/babel__core", "npm:7.20.0"],\ - ["@types/babel__traverse", "npm:7.18.5"]\ + ["@babel/template", "npm:7.21.9"],\ + ["@babel/types", "npm:7.22.4"],\ + ["@types/babel__core", "npm:7.20.1"],\ + ["@types/babel__traverse", "npm:7.20.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -6991,7 +6826,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/babel-preset-current-node-syntax-virtual-26c2536b89/0/cache/babel-preset-current-node-syntax-npm-1.0.1-849ec71e32-5ed78936db.zip/node_modules/babel-preset-current-node-syntax/",\ "packageDependencies": [\ ["babel-preset-current-node-syntax", "virtual:2187ce2f072cb5e40780d7cadfa7b959443960e4540d0f21cd80557a038cdba80efd8f7fbdbc902d4001bb391176118d0a81d6bfa2fe326dc4a5ba08f0c3c8b7#npm:1.0.1"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/plugin-syntax-async-generators", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.4"],\ ["@babel/plugin-syntax-bigint", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.8.3"],\ ["@babel/plugin-syntax-class-properties", "virtual:26c2536b8920395089ed3558fb3169c272b0fcdeba7d1226dcb479172e998b3920f72c07d3c36809af114f0b7ebcbe247d339701b3c9a613e32099a4f05d4478#npm:7.12.13"],\ @@ -7016,7 +6851,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/babel-preset-current-node-syntax-virtual-7d91782c86/0/cache/babel-preset-current-node-syntax-npm-1.0.1-849ec71e32-5ed78936db.zip/node_modules/babel-preset-current-node-syntax/",\ "packageDependencies": [\ ["babel-preset-current-node-syntax", "virtual:f1691910e48d1d93e2cf63028bd30134a1e2507fc02a0d413fbec7c5e06486f1982c8dc2b7b76e1879677502bb464d91bfdafd1aa09eb7abd8ceec212576695d#npm:1.0.1"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@babel/plugin-syntax-async-generators", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.4"],\ ["@babel/plugin-syntax-bigint", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ ["@babel/plugin-syntax-class-properties", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.12.13"],\ @@ -7029,7 +6864,7 @@ const RAW_RUNTIME_STATE = ["@babel/plugin-syntax-optional-catch-binding", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ ["@babel/plugin-syntax-optional-chaining", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.8.3"],\ ["@babel/plugin-syntax-top-level-await", "virtual:7d91782c86832301d3c26ad1eab898cf179026add5b06debd8d0b22fef147d456bad642741164250a795e0ff6f8b9f5aac40667d16b504fdaf40c85b3018b2db#npm:7.14.5"],\ - ["@types/babel__core", "npm:7.20.0"]\ + ["@types/babel__core", "npm:7.20.1"]\ ],\ "packagePeers": [\ "@babel/core",\ @@ -7050,8 +6885,8 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/babel-preset-jest-virtual-f1691910e4/0/cache/babel-preset-jest-npm-29.5.0-1e9ee3b405-033e70f9ab.zip/node_modules/babel-preset-jest/",\ "packageDependencies": [\ ["babel-preset-jest", "virtual:df00ac435e60c4b290078bc8021be08523c3783b83090a79fddf2f1d971481ddc98fad132bc97968b1bc7213c57fe0aafecee8586d5a4e5f9eb0699ac725d275#npm:29.5.0"],\ - ["@babel/core", "npm:7.21.8"],\ - ["@types/babel__core", "npm:7.20.0"],\ + ["@babel/core", "npm:7.22.1"],\ + ["@types/babel__core", "npm:7.20.1"],\ ["babel-plugin-jest-hoist", "npm:29.5.0"],\ ["babel-preset-current-node-syntax", "virtual:f1691910e48d1d93e2cf63028bd30134a1e2507fc02a0d413fbec7c5e06486f1982c8dc2b7b76e1879677502bb464d91bfdafd1aa09eb7abd8ceec212576695d#npm:1.0.1"]\ ],\ @@ -7172,10 +7007,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["boxen", [\ - ["npm:7.0.2", {\ - "packageLocation": "./.yarn/cache/boxen-npm-7.0.2-f9b4d11ba9-842bde7829.zip/node_modules/boxen/",\ + ["npm:7.1.0", {\ + "packageLocation": "./.yarn/cache/boxen-npm-7.1.0-621131dc92-9f7632f55f.zip/node_modules/boxen/",\ "packageDependencies": [\ - ["boxen", "npm:7.0.2"],\ + ["boxen", "npm:7.1.0"],\ ["ansi-align", "npm:3.0.1"],\ ["camelcase", "npm:7.0.1"],\ ["chalk", "npm:5.2.0"],\ @@ -7218,14 +7053,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["browserslist", [\ - ["npm:4.21.5", {\ - "packageLocation": "./.yarn/cache/browserslist-npm-4.21.5-e3b9e9d029-66c055357f.zip/node_modules/browserslist/",\ + ["npm:4.21.7", {\ + "packageLocation": "./.yarn/cache/browserslist-npm-4.21.7-36caf91554-53860c8ab8.zip/node_modules/browserslist/",\ "packageDependencies": [\ - ["browserslist", "npm:4.21.5"],\ - ["caniuse-lite", "npm:1.0.30001482"],\ - ["electron-to-chromium", "npm:1.4.384"],\ - ["node-releases", "npm:2.0.10"],\ - ["update-browserslist-db", "virtual:e3b9e9d029ed690d72cbb29196ba0a23f15b398eeb926347678187be937db870a04cbf984eecc8e0ec9c290158a9cd8607d12f0188665abe039fa4a9051a22ac#npm:1.0.11"]\ + ["browserslist", "npm:4.21.7"],\ + ["caniuse-lite", "npm:1.0.30001492"],\ + ["electron-to-chromium", "npm:1.4.416"],\ + ["node-releases", "npm:2.0.12"],\ + ["update-browserslist-db", "virtual:36caf91554dac89a3f358f56f66ad80dc64d857177a5d24ed45f959d4a3df13ab436c15c5a53b1877973f2b1210f779aec20e0aa5d0876811aa58c9c83dd4f9c#npm:1.0.11"]\ ],\ "linkType": "HARD"\ }]\ @@ -7293,7 +7128,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/builtins-npm-5.0.1-6d4820dd76-d84d5abbe1.zip/node_modules/builtins/",\ "packageDependencies": [\ ["builtins", "npm:5.0.1"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -7347,7 +7182,7 @@ const RAW_RUNTIME_STATE = ["promise-inflight", "virtual:4e2088ed0df52533102f445d7e7aeba6560b7effa0cabbc7cc20dd1e36a86dd838cc541de4414688f4ce3ec77b0ad5298cea6de581350d934ceb35c3e0fe3462#npm:1.0.1"],\ ["rimraf", "npm:3.0.2"],\ ["ssri", "npm:8.0.1"],\ - ["tar", "npm:6.1.14"],\ + ["tar", "npm:6.1.15"],\ ["unique-filename", "npm:1.1.1"]\ ],\ "linkType": "HARD"\ @@ -7372,37 +7207,18 @@ const RAW_RUNTIME_STATE = ["promise-inflight", "virtual:4e2088ed0df52533102f445d7e7aeba6560b7effa0cabbc7cc20dd1e36a86dd838cc541de4414688f4ce3ec77b0ad5298cea6de581350d934ceb35c3e0fe3462#npm:1.0.1"],\ ["rimraf", "npm:3.0.2"],\ ["ssri", "npm:9.0.1"],\ - ["tar", "npm:6.1.14"],\ + ["tar", "npm:6.1.15"],\ ["unique-filename", "npm:2.0.1"]\ ],\ "linkType": "HARD"\ }],\ - ["npm:17.1.0", {\ - "packageLocation": "./.yarn/cache/cacache-npm-17.1.0-122252b60e-8b86bdcd40.zip/node_modules/cacache/",\ - "packageDependencies": [\ - ["cacache", "npm:17.1.0"],\ - ["@npmcli/fs", "npm:3.1.0"],\ - ["fs-minipass", "npm:3.0.2"],\ - ["glob", "npm:10.2.2"],\ - ["lru-cache", "npm:7.18.3"],\ - ["minipass", "npm:5.0.0"],\ - ["minipass-collect", "npm:1.0.2"],\ - ["minipass-flush", "npm:1.0.5"],\ - ["minipass-pipeline", "npm:1.2.4"],\ - ["p-map", "npm:4.0.0"],\ - ["ssri", "npm:10.0.4"],\ - ["tar", "npm:6.1.14"],\ - ["unique-filename", "npm:3.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:17.1.3", {\ "packageLocation": "./.yarn/cache/cacache-npm-17.1.3-f75f768a29-19b4f65a5b.zip/node_modules/cacache/",\ "packageDependencies": [\ ["cacache", "npm:17.1.3"],\ ["@npmcli/fs", "npm:3.1.0"],\ ["fs-minipass", "npm:3.0.2"],\ - ["glob", "npm:10.2.2"],\ + ["glob", "npm:10.2.6"],\ ["lru-cache", "npm:7.18.3"],\ ["minipass", "npm:5.0.0"],\ ["minipass-collect", "npm:1.0.2"],\ @@ -7410,7 +7226,7 @@ const RAW_RUNTIME_STATE = ["minipass-pipeline", "npm:1.2.4"],\ ["p-map", "npm:4.0.0"],\ ["ssri", "npm:10.0.4"],\ - ["tar", "npm:6.1.14"],\ + ["tar", "npm:6.1.15"],\ ["unique-filename", "npm:3.0.0"]\ ],\ "linkType": "HARD"\ @@ -7447,7 +7263,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["call-bind", "npm:1.0.2"],\ ["function-bind", "npm:1.1.1"],\ - ["get-intrinsic", "npm:1.2.0"]\ + ["get-intrinsic", "npm:1.2.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -7497,10 +7313,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["caniuse-lite", [\ - ["npm:1.0.30001482", {\ - "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001482-266bfb6271-73e24665e8.zip/node_modules/caniuse-lite/",\ + ["npm:1.0.30001492", {\ + "packageLocation": "./.yarn/cache/caniuse-lite-npm-1.0.30001492-90c5710f02-216895408d.zip/node_modules/caniuse-lite/",\ "packageDependencies": [\ - ["caniuse-lite", "npm:1.0.30001482"]\ + ["caniuse-lite", "npm:1.0.30001492"]\ ],\ "linkType": "HARD"\ }]\ @@ -7523,10 +7339,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["cbor-x", [\ - ["npm:1.5.2", {\ - "packageLocation": "./.yarn/cache/cbor-x-npm-1.5.2-5d9e919527-366e1caaa1.zip/node_modules/cbor-x/",\ + ["npm:1.5.3", {\ + "packageLocation": "./.yarn/cache/cbor-x-npm-1.5.3-1d452dd267-d4df85b339.zip/node_modules/cbor-x/",\ "packageDependencies": [\ - ["cbor-x", "npm:1.5.2"],\ + ["cbor-x", "npm:1.5.3"],\ ["cbor-extract", "npm:2.1.1"]\ ],\ "linkType": "HARD"\ @@ -7578,6 +7394,21 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["chevrotain", [\ + ["npm:10.5.0", {\ + "packageLocation": "./.yarn/cache/chevrotain-npm-10.5.0-1ff4e87f41-06229e2617.zip/node_modules/chevrotain/",\ + "packageDependencies": [\ + ["chevrotain", "npm:10.5.0"],\ + ["@chevrotain/cst-dts-gen", "npm:10.5.0"],\ + ["@chevrotain/gast", "npm:10.5.0"],\ + ["@chevrotain/types", "npm:10.5.0"],\ + ["@chevrotain/utils", "npm:10.5.0"],\ + ["lodash", "npm:4.17.21"],\ + ["regexp-to-ast", "npm:0.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["chokidar", [\ ["npm:3.5.3", {\ "packageLocation": "./.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-eb45bf6464.zip/node_modules/chokidar/",\ @@ -8205,7 +8036,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["cosmiconfig-typescript-loader", "virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:4.3.0"],\ ["@types/cosmiconfig", null],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/ts-node", null],\ ["@types/typescript", null],\ ["cosmiconfig", "npm:8.1.3"],\ @@ -8234,11 +8065,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["cross-fetch", [\ - ["npm:3.1.5", {\ - "packageLocation": "./.yarn/cache/cross-fetch-npm-3.1.5-e414995db9-83fa7b1318.zip/node_modules/cross-fetch/",\ + ["npm:3.1.6", {\ + "packageLocation": "./.yarn/cache/cross-fetch-npm-3.1.6-cdb982d446-a8989fca82.zip/node_modules/cross-fetch/",\ "packageDependencies": [\ - ["cross-fetch", "npm:3.1.5"],\ - ["node-fetch", "virtual:e414995db9c779306e687c7a7c66965e66d0cd7270f6b9fc4f00cc9772c5d50b305ab83e142e0e21dbf10968f7437cbdfcb170d05f4bde68707ac7d0082c9cca#npm:2.6.7"]\ + ["cross-fetch", "npm:3.1.6"],\ + ["node-fetch", "virtual:0f92dfe7f9dc4fd492639d4a5b7805c2b27442bf599fd4f370b22a7966ba078f5d4525e2a8e8af29369f20e1833ed084bd52be59679efaa6c1c6c10cdbcd8baa#npm:2.6.11"]\ ],\ "linkType": "HARD"\ }]\ @@ -8292,6 +8123,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["date-fns", [\ + ["npm:2.30.0", {\ + "packageLocation": "./.yarn/cache/date-fns-npm-2.30.0-895c790e0f-1edbb6ae2e.zip/node_modules/date-fns/",\ + "packageDependencies": [\ + ["date-fns", "npm:2.30.0"],\ + ["@babel/runtime", "npm:7.22.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["dateformat", [\ ["npm:3.0.3", {\ "packageLocation": "./.yarn/cache/dateformat-npm-3.0.3-ed02e5ddbd-b88a9e5399.zip/node_modules/dateformat/",\ @@ -8607,10 +8448,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["dotenv", [\ - ["npm:16.0.3", {\ - "packageLocation": "./.yarn/cache/dotenv-npm-16.0.3-4cc29121dc-abce82d99b.zip/node_modules/dotenv/",\ + ["npm:16.1.3", {\ + "packageLocation": "./.yarn/cache/dotenv-npm-16.1.3-4df6c2511f-8508f40434.zip/node_modules/dotenv/",\ "packageDependencies": [\ - ["dotenv", "npm:16.0.3"]\ + ["dotenv", "npm:16.1.3"]\ ],\ "linkType": "HARD"\ }]\ @@ -8653,10 +8494,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["electron-to-chromium", [\ - ["npm:1.4.384", {\ - "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.384-577a69752b-3f318c499e.zip/node_modules/electron-to-chromium/",\ + ["npm:1.4.416", {\ + "packageLocation": "./.yarn/cache/electron-to-chromium-npm-1.4.416-661d1e05e2-d337a9c626.zip/node_modules/electron-to-chromium/",\ "packageDependencies": [\ - ["electron-to-chromium", "npm:1.4.384"]\ + ["electron-to-chromium", "npm:1.4.416"]\ ],\ "linkType": "HARD"\ }]\ @@ -8715,10 +8556,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["enhanced-resolve", [\ - ["npm:5.13.0", {\ - "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.13.0-81a67f2a17-ff54c25302.zip/node_modules/enhanced-resolve/",\ + ["npm:5.14.1", {\ + "packageLocation": "./.yarn/cache/enhanced-resolve-npm-5.14.1-738959d0ac-d0dca4a78a.zip/node_modules/enhanced-resolve/",\ "packageDependencies": [\ - ["enhanced-resolve", "npm:5.13.0"],\ + ["enhanced-resolve", "npm:5.14.1"],\ ["graceful-fs", "npm:4.2.11"],\ ["tapable", "npm:2.2.1"]\ ],\ @@ -8820,14 +8661,14 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["eslint", [\ - ["npm:8.39.0", {\ - "packageLocation": "./.yarn/cache/eslint-npm-8.39.0-d92bace04d-742b8d2c87.zip/node_modules/eslint/",\ + ["npm:8.41.0", {\ + "packageLocation": "./.yarn/cache/eslint-npm-8.41.0-0e83e90d27-82a4a6fd28.zip/node_modules/eslint/",\ "packageDependencies": [\ - ["eslint", "npm:8.39.0"],\ - ["@eslint-community/eslint-utils", "virtual:d92bace04d6d26247b24721a8766993aa3a98c631265bb389d6aa7c17b2a0708ccc877f009bd6a9cb50b8597fbe776c68dae7621d198ff292ee4bc23bd4b012f#npm:4.4.0"],\ + ["eslint", "npm:8.41.0"],\ + ["@eslint-community/eslint-utils", "virtual:0e83e90d273f68a1bd1543dde3480eaf525801444ba81cbede9215242f0a1bd9563c2ba1980136297cb6880745c63575691537145c6b548460570102de527f4e#npm:4.4.0"],\ ["@eslint-community/regexpp", "npm:4.5.1"],\ - ["@eslint/eslintrc", "npm:2.0.2"],\ - ["@eslint/js", "npm:8.39.0"],\ + ["@eslint/eslintrc", "npm:2.0.3"],\ + ["@eslint/js", "npm:8.41.0"],\ ["@humanwhocodes/config-array", "npm:0.11.8"],\ ["@humanwhocodes/module-importer", "npm:1.0.1"],\ ["@nodelib/fs.walk", "npm:1.2.8"],\ @@ -8838,8 +8679,8 @@ const RAW_RUNTIME_STATE = ["doctrine", "npm:3.0.0"],\ ["escape-string-regexp", "npm:4.0.0"],\ ["eslint-scope", "npm:7.2.0"],\ - ["eslint-visitor-keys", "npm:3.4.0"],\ - ["espree", "npm:9.5.1"],\ + ["eslint-visitor-keys", "npm:3.4.1"],\ + ["espree", "npm:9.5.2"],\ ["esquery", "npm:1.5.0"],\ ["esutils", "npm:2.0.3"],\ ["fast-deep-equal", "npm:3.1.3"],\ @@ -8847,13 +8688,12 @@ const RAW_RUNTIME_STATE = ["find-up", "npm:5.0.0"],\ ["glob-parent", "npm:6.0.2"],\ ["globals", "npm:13.20.0"],\ - ["grapheme-splitter", "npm:1.0.4"],\ + ["graphemer", "npm:1.4.0"],\ ["ignore", "npm:5.2.4"],\ ["import-fresh", "npm:3.3.0"],\ ["imurmurhash", "npm:0.1.4"],\ ["is-glob", "npm:4.0.3"],\ ["is-path-inside", "npm:3.0.3"],\ - ["js-sdsl", "npm:4.4.0"],\ ["js-yaml", "npm:4.1.0"],\ ["json-stable-stringify-without-jsonify", "npm:1.0.1"],\ ["levn", "npm:0.4.1"],\ @@ -8881,7 +8721,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.8.0"],\ ["@types/eslint", null],\ - ["eslint", "npm:8.39.0"]\ + ["eslint", "npm:8.41.0"]\ ],\ "packagePeers": [\ "@types/eslint",\ @@ -8905,7 +8745,7 @@ const RAW_RUNTIME_STATE = ["@types/eslint", null],\ ["@types/eslint-config-prettier", null],\ ["@types/prettier", null],\ - ["eslint", "npm:8.39.0"],\ + ["eslint", "npm:8.41.0"],\ ["eslint-config-prettier", null],\ ["prettier", "npm:2.8.8"],\ ["prettier-linter-helpers", "npm:1.0.0"]\ @@ -8942,22 +8782,22 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["eslint-visitor-keys", [\ - ["npm:3.4.0", {\ - "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.0-dc8683d774-c55d5b9300.zip/node_modules/eslint-visitor-keys/",\ + ["npm:3.4.1", {\ + "packageLocation": "./.yarn/cache/eslint-visitor-keys-npm-3.4.1-a5d0a58208-97db79746b.zip/node_modules/eslint-visitor-keys/",\ "packageDependencies": [\ - ["eslint-visitor-keys", "npm:3.4.0"]\ + ["eslint-visitor-keys", "npm:3.4.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["espree", [\ - ["npm:9.5.1", {\ - "packageLocation": "./.yarn/cache/espree-npm-9.5.1-057dc7b3c1-cdf0058252.zip/node_modules/espree/",\ + ["npm:9.5.2", {\ + "packageLocation": "./.yarn/cache/espree-npm-9.5.2-5fc9506cda-05c52faae1.zip/node_modules/espree/",\ "packageDependencies": [\ - ["espree", "npm:9.5.1"],\ + ["espree", "npm:9.5.2"],\ ["acorn", "npm:8.8.2"],\ - ["acorn-jsx", "virtual:057dc7b3c1f6024b5a316c7e5d452c8397d903f7ff9736e8d71b89efc60141dc4c8c777c0c1057fa0d3bf0d3dd59eec8694b4efb6f0fb20c747ec060bab7195d#npm:5.3.2"],\ - ["eslint-visitor-keys", "npm:3.4.0"]\ + ["acorn-jsx", "virtual:5fc9506cdac3b623f10b3f7adb0b64c62d2c6059855d74020d649d3c7df60271229590b28e7061203e031c21cd88cfd7344e13902ceb1f7776b1da6a18ef4ad8#npm:5.3.2"],\ + ["eslint-visitor-keys", "npm:3.4.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -9186,7 +9026,7 @@ const RAW_RUNTIME_STATE = ["@types/winston", null],\ ["chalk", "npm:2.4.2"],\ ["lodash", "npm:4.17.21"],\ - ["winston", "npm:3.8.2"]\ + ["winston", "npm:3.9.0"]\ ],\ "packagePeers": [\ "@types/winston",\ @@ -9217,10 +9057,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["fast-diff", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/fast-diff-npm-1.2.0-5ba4171bb6-e75206672f.zip/node_modules/fast-diff/",\ + ["npm:1.3.0", {\ + "packageLocation": "./.yarn/cache/fast-diff-npm-1.3.0-9f19e3b743-424cdf4f5f.zip/node_modules/fast-diff/",\ "packageDependencies": [\ - ["fast-diff", "npm:1.2.0"]\ + ["fast-diff", "npm:1.3.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -9448,7 +9288,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["foreground-child", "npm:3.1.1"],\ ["cross-spawn", "npm:7.0.3"],\ - ["signal-exit", "npm:4.0.1"]\ + ["signal-exit", "npm:4.0.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -9609,7 +9449,7 @@ const RAW_RUNTIME_STATE = ["color-support", "npm:1.1.3"],\ ["console-control-strings", "npm:1.1.0"],\ ["has-unicode", "npm:2.0.1"],\ - ["signal-exit", "npm:4.0.1"],\ + ["signal-exit", "npm:4.0.2"],\ ["string-width", "npm:4.2.3"],\ ["strip-ansi", "npm:6.0.1"],\ ["wide-align", "npm:1.1.5"]\ @@ -9646,12 +9486,13 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["get-intrinsic", [\ - ["npm:1.2.0", {\ - "packageLocation": "./.yarn/cache/get-intrinsic-npm-1.2.0-eb08ea9b1d-6db1e52147.zip/node_modules/get-intrinsic/",\ + ["npm:1.2.1", {\ + "packageLocation": "./.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-d1d5511cfe.zip/node_modules/get-intrinsic/",\ "packageDependencies": [\ - ["get-intrinsic", "npm:1.2.0"],\ + ["get-intrinsic", "npm:1.2.1"],\ ["function-bind", "npm:1.1.1"],\ ["has", "npm:1.0.3"],\ + ["has-proto", "npm:1.0.1"],\ ["has-symbols", "npm:1.0.3"]\ ],\ "linkType": "HARD"\ @@ -9765,27 +9606,15 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["glob", [\ - ["npm:10.2.2", {\ - "packageLocation": "./.yarn/cache/glob-npm-10.2.2-4cf80ebee7-9ca0e52241.zip/node_modules/glob/",\ - "packageDependencies": [\ - ["glob", "npm:10.2.2"],\ - ["foreground-child", "npm:3.1.1"],\ - ["jackspeak", "npm:2.2.0"],\ - ["minimatch", "npm:9.0.0"],\ - ["minipass", "npm:5.0.0"],\ - ["path-scurry", "npm:1.7.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:10.2.6", {\ "packageLocation": "./.yarn/cache/glob-npm-10.2.6-dcc609070c-edd296a1a2.zip/node_modules/glob/",\ "packageDependencies": [\ ["glob", "npm:10.2.6"],\ ["foreground-child", "npm:3.1.1"],\ - ["jackspeak", "npm:2.2.0"],\ + ["jackspeak", "npm:2.2.1"],\ ["minimatch", "npm:9.0.1"],\ ["minipass", "npm:6.0.2"],\ - ["path-scurry", "npm:1.7.0"]\ + ["path-scurry", "npm:1.9.2"]\ ],\ "linkType": "HARD"\ }],\ @@ -9813,17 +9642,6 @@ const RAW_RUNTIME_STATE = ["once", "npm:1.4.0"]\ ],\ "linkType": "HARD"\ - }],\ - ["npm:9.3.5", {\ - "packageLocation": "./.yarn/cache/glob-npm-9.3.5-2f602083f0-e5cd25695c.zip/node_modules/glob/",\ - "packageDependencies": [\ - ["glob", "npm:9.3.5"],\ - ["fs.realpath", "npm:1.0.0"],\ - ["minimatch", "npm:8.0.4"],\ - ["minipass", "npm:4.2.8"],\ - ["path-scurry", "npm:1.7.0"]\ - ],\ - "linkType": "HARD"\ }]\ ]],\ ["glob-parent", [\ @@ -9916,11 +9734,11 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["got", [\ - ["npm:12.6.0", {\ - "packageLocation": "./.yarn/cache/got-npm-12.6.0-09c7ff19c5-2d5a329769.zip/node_modules/got/",\ + ["npm:12.6.1", {\ + "packageLocation": "./.yarn/cache/got-npm-12.6.1-5b6a816a1e-be216dd251.zip/node_modules/got/",\ "packageDependencies": [\ - ["got", "npm:12.6.0"],\ - ["@sindresorhus/is", "npm:5.3.0"],\ + ["got", "npm:12.6.1"],\ + ["@sindresorhus/is", "npm:5.4.0"],\ ["@szmarczak/http-timer", "npm:5.0.1"],\ ["cacheable-lookup", "npm:7.0.0"],\ ["cacheable-request", "npm:10.2.10"],\ @@ -9960,6 +9778,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["graphemer", [\ + ["npm:1.4.0", {\ + "packageLocation": "./.yarn/cache/graphemer-npm-1.4.0-0627732d35-a4ee139533.zip/node_modules/graphemer/",\ + "packageDependencies": [\ + ["graphemer", "npm:1.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["handlebars", [\ ["npm:4.7.7", {\ "packageLocation": "./.yarn/cache/handlebars-npm-4.7.7-a9ccfabf80-132aa454ca.zip/node_modules/handlebars/",\ @@ -10009,6 +9836,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["has-proto", [\ + ["npm:1.0.1", {\ + "packageLocation": "./.yarn/cache/has-proto-npm-1.0.1-631ea9d820-0aa0de6013.zip/node_modules/has-proto/",\ + "packageDependencies": [\ + ["has-proto", "npm:1.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["has-symbols", [\ ["npm:1.0.3", {\ "packageLocation": "./.yarn/cache/has-symbols-npm-1.0.3-1986bff2c4-2d0abb3382.zip/node_modules/has-symbols/",\ @@ -10037,10 +9873,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["helmet", [\ - ["npm:6.1.5", {\ - "packageLocation": "./.yarn/cache/helmet-npm-6.1.5-523f0fdda8-0c6b62e3a7.zip/node_modules/helmet/",\ + ["npm:6.2.0", {\ + "packageLocation": "./.yarn/cache/helmet-npm-6.2.0-43622c54ea-014ec4e5d3.zip/node_modules/helmet/",\ "packageDependencies": [\ - ["helmet", "npm:6.1.5"]\ + ["helmet", "npm:6.2.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -10257,7 +10093,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/ignore-walk-npm-6.0.3-ebca6b06c4-3d001d6a1e.zip/node_modules/ignore-walk/",\ "packageDependencies": [\ ["ignore-walk", "npm:6.0.3"],\ - ["minimatch", "npm:9.0.0"]\ + ["minimatch", "npm:9.0.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -10362,37 +10198,15 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:4.1.0", {\ - "packageLocation": "./.yarn/cache/ini-npm-4.1.0-af70e81291-7bbdc8a0cd.zip/node_modules/ini/",\ + ["npm:4.1.1", {\ + "packageLocation": "./.yarn/cache/ini-npm-4.1.1-01c2cbda7b-0351902b49.zip/node_modules/ini/",\ "packageDependencies": [\ - ["ini", "npm:4.1.0"]\ + ["ini", "npm:4.1.1"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["inquirer", [\ - ["npm:9.2.2", {\ - "packageLocation": "./.yarn/cache/inquirer-npm-9.2.2-90bcedd6ec-6a154464de.zip/node_modules/inquirer/",\ - "packageDependencies": [\ - ["inquirer", "npm:9.2.2"],\ - ["ansi-escapes", "npm:4.3.2"],\ - ["chalk", "npm:5.2.0"],\ - ["cli-cursor", "npm:3.1.0"],\ - ["cli-width", "npm:4.0.0"],\ - ["external-editor", "npm:3.1.0"],\ - ["figures", "npm:5.0.0"],\ - ["lodash", "npm:4.17.21"],\ - ["mute-stream", "npm:1.0.0"],\ - ["ora", "npm:5.4.1"],\ - ["run-async", "npm:2.4.1"],\ - ["rxjs", "npm:7.8.1"],\ - ["string-width", "npm:4.2.3"],\ - ["strip-ansi", "npm:7.0.1"],\ - ["through", "npm:2.3.8"],\ - ["wrap-ansi", "npm:6.2.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:9.2.6", {\ "packageLocation": "./.yarn/cache/inquirer-npm-9.2.6-f7257ad8c1-bf38d97063.zip/node_modules/inquirer/",\ "packageDependencies": [\ @@ -10472,10 +10286,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:2.0.1", {\ - "packageLocation": "./.yarn/cache/ipaddr.js-npm-2.0.1-04e97280d7-04ce6c896c.zip/node_modules/ipaddr.js/",\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/ipaddr.js-npm-2.1.0-7091ce1549-1ec53ec679.zip/node_modules/ipaddr.js/",\ "packageDependencies": [\ - ["ipaddr.js", "npm:2.0.1"]\ + ["ipaddr.js", "npm:2.1.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -10517,10 +10331,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["is-core-module", [\ - ["npm:2.12.0", {\ - "packageLocation": "./.yarn/cache/is-core-module-npm-2.12.0-3bcb45a24f-5619b73eee.zip/node_modules/is-core-module/",\ + ["npm:2.12.1", {\ + "packageLocation": "./.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-ad50fa9887.zip/node_modules/is-core-module/",\ "packageDependencies": [\ - ["is-core-module", "npm:2.12.0"],\ + ["is-core-module", "npm:2.12.1"],\ ["has", "npm:1.0.3"]\ ],\ "linkType": "HARD"\ @@ -10781,8 +10595,8 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/istanbul-lib-instrument-npm-5.2.1-1b3ad719a9-838cd5b112.zip/node_modules/istanbul-lib-instrument/",\ "packageDependencies": [\ ["istanbul-lib-instrument", "npm:5.2.1"],\ - ["@babel/core", "npm:7.21.8"],\ - ["@babel/parser", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ + ["@babel/parser", "npm:7.22.4"],\ ["@istanbuljs/schema", "npm:0.1.3"],\ ["istanbul-lib-coverage", "npm:3.2.0"],\ ["semver", "npm:6.3.0"]\ @@ -10826,10 +10640,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["jackspeak", [\ - ["npm:2.2.0", {\ - "packageLocation": "./.yarn/cache/jackspeak-npm-2.2.0-5383861524-d967d29e54.zip/node_modules/jackspeak/",\ + ["npm:2.2.1", {\ + "packageLocation": "./.yarn/cache/jackspeak-npm-2.2.1-0644c98bfe-b7c66988fb.zip/node_modules/jackspeak/",\ "packageDependencies": [\ - ["jackspeak", "npm:2.2.0"],\ + ["jackspeak", "npm:2.2.1"],\ ["@isaacs/cliui", "npm:8.0.2"],\ ["@pkgjs/parseargs", "npm:0.11.0"]\ ],\ @@ -10882,7 +10696,7 @@ const RAW_RUNTIME_STATE = ["@jest/expect", "npm:29.5.0"],\ ["@jest/test-result", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["chalk", "npm:4.1.2"],\ ["co", "npm:4.6.0"],\ ["dedent", "npm:0.7.0"],\ @@ -10948,7 +10762,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/jest-config-virtual-d2f99b3763/0/cache/jest-config-npm-29.5.0-15ac67fe8b-5131b9f06c.zip/node_modules/jest-config/",\ "packageDependencies": [\ ["jest-config", "virtual:7110165b2111b7a2061d970349365d3abc707aaa92e28e961aa2f631dcc7226a71c8349c7ec8c6509a94ffb9c9b5c9c0b0666d589f0baf1c514b6f8c2614df29#npm:29.5.0"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@jest/test-sequencer", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ ["@types/node", null],\ @@ -10985,10 +10799,10 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/jest-config-virtual-19c52a5c87/0/cache/jest-config-npm-29.5.0-15ac67fe8b-5131b9f06c.zip/node_modules/jest-config/",\ "packageDependencies": [\ ["jest-config", "virtual:cbfc4e4a06405e0be238659aac00829c44e1a8c84a8aa17d4a326cfb23de27e0e5e40bb9698ec5eaeb682116721c3fab921bb9d9882ecf033475292bf4a14762#npm:29.5.0"],\ - ["@babel/core", "npm:7.21.8"],\ + ["@babel/core", "npm:7.22.1"],\ ["@jest/test-sequencer", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/ts-node", null],\ ["babel-jest", "virtual:19c52a5c872e71ec610be6cbd68ada378efc765c5803f5526bf65e10c8bc9891c9d97388155f555343a3ff74f9f368b5d53a49a63e91c43e0ff045c8fce68263#npm:29.5.0"],\ ["chalk", "npm:4.1.2"],\ @@ -11064,7 +10878,7 @@ const RAW_RUNTIME_STATE = ["@jest/environment", "npm:29.5.0"],\ ["@jest/fake-timers", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["jest-mock", "npm:29.5.0"],\ ["jest-util", "npm:29.5.0"]\ ],\ @@ -11087,7 +10901,7 @@ const RAW_RUNTIME_STATE = ["jest-haste-map", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ ["@types/graceful-fs", "npm:4.1.6"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["anymatch", "npm:3.1.3"],\ ["fb-watchman", "npm:2.0.2"],\ ["fsevents", "patch:fsevents@npm%3A2.3.2#optional!builtin::version=2.3.2&hash=df0bf1"],\ @@ -11149,7 +10963,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["jest-mock", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["jest-util", "npm:29.5.0"]\ ],\ "linkType": "HARD"\ @@ -11225,7 +11039,7 @@ const RAW_RUNTIME_STATE = ["@jest/test-result", "npm:29.5.0"],\ ["@jest/transform", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["chalk", "npm:4.1.2"],\ ["emittery", "npm:0.13.1"],\ ["graceful-fs", "npm:4.2.11"],\ @@ -11257,7 +11071,7 @@ const RAW_RUNTIME_STATE = ["@jest/test-result", "npm:29.5.0"],\ ["@jest/transform", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["chalk", "npm:4.1.2"],\ ["cjs-module-lexer", "npm:1.2.2"],\ ["collect-v8-coverage", "npm:1.0.1"],\ @@ -11281,17 +11095,17 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/jest-snapshot-npm-29.5.0-2187ce2f07-986d1a4016.zip/node_modules/jest-snapshot/",\ "packageDependencies": [\ ["jest-snapshot", "npm:29.5.0"],\ - ["@babel/core", "npm:7.21.8"],\ - ["@babel/generator", "npm:7.21.5"],\ + ["@babel/core", "npm:7.22.1"],\ + ["@babel/generator", "npm:7.22.3"],\ ["@babel/plugin-syntax-jsx", "virtual:2187ce2f072cb5e40780d7cadfa7b959443960e4540d0f21cd80557a038cdba80efd8f7fbdbc902d4001bb391176118d0a81d6bfa2fe326dc4a5ba08f0c3c8b7#npm:7.21.4"],\ ["@babel/plugin-syntax-typescript", "virtual:2187ce2f072cb5e40780d7cadfa7b959443960e4540d0f21cd80557a038cdba80efd8f7fbdbc902d4001bb391176118d0a81d6bfa2fe326dc4a5ba08f0c3c8b7#npm:7.21.4"],\ - ["@babel/traverse", "npm:7.21.5"],\ - ["@babel/types", "npm:7.21.5"],\ + ["@babel/traverse", "npm:7.22.4"],\ + ["@babel/types", "npm:7.22.4"],\ ["@jest/expect-utils", "npm:29.5.0"],\ ["@jest/transform", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/babel__traverse", "npm:7.18.5"],\ - ["@types/prettier", "npm:2.7.2"],\ + ["@types/babel__traverse", "npm:7.20.0"],\ + ["@types/prettier", "npm:2.7.3"],\ ["babel-preset-current-node-syntax", "virtual:2187ce2f072cb5e40780d7cadfa7b959443960e4540d0f21cd80557a038cdba80efd8f7fbdbc902d4001bb391176118d0a81d6bfa2fe326dc4a5ba08f0c3c8b7#npm:1.0.1"],\ ["chalk", "npm:4.1.2"],\ ["expect", "npm:29.5.0"],\ @@ -11303,7 +11117,7 @@ const RAW_RUNTIME_STATE = ["jest-util", "npm:29.5.0"],\ ["natural-compare", "npm:1.4.0"],\ ["pretty-format", "npm:29.5.0"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -11314,7 +11128,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["jest-util", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["chalk", "npm:4.1.2"],\ ["ci-info", "npm:3.8.0"],\ ["graceful-fs", "npm:4.2.11"],\ @@ -11345,7 +11159,7 @@ const RAW_RUNTIME_STATE = ["jest-watcher", "npm:29.5.0"],\ ["@jest/test-result", "npm:29.5.0"],\ ["@jest/types", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["ansi-escapes", "npm:4.3.2"],\ ["chalk", "npm:4.1.2"],\ ["emittery", "npm:0.13.1"],\ @@ -11360,7 +11174,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/jest-worker-npm-27.5.1-1c110b5894-dc5167cc25.zip/node_modules/jest-worker/",\ "packageDependencies": [\ ["jest-worker", "npm:27.5.1"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["merge-stream", "npm:2.0.0"],\ ["supports-color", "npm:8.1.1"]\ ],\ @@ -11370,7 +11184,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/jest-worker-npm-29.5.0-70da3388f1-95e135890a.zip/node_modules/jest-worker/",\ "packageDependencies": [\ ["jest-worker", "npm:29.5.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["jest-util", "npm:29.5.0"],\ ["merge-stream", "npm:2.0.0"],\ ["supports-color", "npm:8.1.1"]\ @@ -11387,15 +11201,6 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ - ["js-sdsl", [\ - ["npm:4.4.0", {\ - "packageLocation": "./.yarn/cache/js-sdsl-npm-4.4.0-e8ec19da4a-8c85413f74.zip/node_modules/js-sdsl/",\ - "packageDependencies": [\ - ["js-sdsl", "npm:4.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["js-tokens", [\ ["npm:4.0.0", {\ "packageLocation": "./.yarn/cache/js-tokens-npm-4.0.0-0ac852e9e2-47d1c18dc6.zip/node_modules/js-tokens/",\ @@ -11576,7 +11381,7 @@ const RAW_RUNTIME_STATE = ["jws", "npm:3.2.2"],\ ["lodash", "npm:4.17.21"],\ ["ms", "npm:2.1.3"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -11708,16 +11513,16 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["libnpmpublish", [\ - ["npm:7.2.0", {\ - "packageLocation": "./.yarn/cache/libnpmpublish-npm-7.2.0-20e435842a-ae1c23f524.zip/node_modules/libnpmpublish/",\ + ["npm:7.3.0", {\ + "packageLocation": "./.yarn/cache/libnpmpublish-npm-7.3.0-006fc4afe8-831b45ed01.zip/node_modules/libnpmpublish/",\ "packageDependencies": [\ - ["libnpmpublish", "npm:7.2.0"],\ + ["libnpmpublish", "npm:7.3.0"],\ ["ci-info", "npm:3.8.0"],\ ["normalize-package-data", "npm:5.0.0"],\ ["npm-package-arg", "npm:10.1.0"],\ ["npm-registry-fetch", "npm:14.0.5"],\ ["proc-log", "npm:3.0.0"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["sigstore", "npm:1.5.2"],\ ["ssri", "npm:10.0.4"]\ ],\ @@ -12062,7 +11867,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["make-fetch-happen", "npm:11.1.1"],\ ["agentkeepalive", "npm:4.3.0"],\ - ["cacache", "npm:17.1.0"],\ + ["cacache", "npm:17.1.3"],\ ["http-cache-semantics", "npm:4.1.1"],\ ["http-proxy-agent", "npm:5.0.0"],\ ["https-proxy-agent", "npm:5.0.1"],\ @@ -12303,22 +12108,6 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:8.0.4", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-8.0.4-bf57f0e98a-eea8425c44.zip/node_modules/minimatch/",\ - "packageDependencies": [\ - ["minimatch", "npm:8.0.4"],\ - ["brace-expansion", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ - ["npm:9.0.0", {\ - "packageLocation": "./.yarn/cache/minimatch-npm-9.0.0-c6737cb1be-07983996ed.zip/node_modules/minimatch/",\ - "packageDependencies": [\ - ["minimatch", "npm:9.0.0"],\ - ["brace-expansion", "npm:2.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:9.0.1", {\ "packageLocation": "./.yarn/cache/minimatch-npm-9.0.1-277fdc6fbd-6648745fd9.zip/node_modules/minimatch/",\ "packageDependencies": [\ @@ -12558,10 +12347,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["mysql2", [\ - ["npm:3.2.4", {\ - "packageLocation": "./.yarn/cache/mysql2-npm-3.2.4-ebe6a0a7dc-01a668bad3.zip/node_modules/mysql2/",\ + ["npm:3.3.3", {\ + "packageLocation": "./.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-a4e8f2967f.zip/node_modules/mysql2/",\ "packageDependencies": [\ - ["mysql2", "npm:3.2.4"],\ + ["mysql2", "npm:3.3.3"],\ ["denque", "npm:2.1.0"],\ ["generate-function", "npm:2.3.1"],\ ["iconv-lite", "npm:0.6.3"],\ @@ -12653,17 +12442,18 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["newrelic", [\ - ["npm:10.1.0", {\ - "packageLocation": "./.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/",\ + ["npm:10.1.2", {\ + "packageLocation": "./.yarn/cache/newrelic-npm-10.1.2-55e3dc82b6-48f989612e.zip/node_modules/newrelic/",\ "packageDependencies": [\ - ["newrelic", "npm:10.1.0"],\ + ["newrelic", "npm:10.1.2"],\ ["@contrast/fn-inspect", "npm:3.3.1"],\ ["@grpc/grpc-js", "npm:1.8.14"],\ ["@grpc/proto-loader", "npm:0.7.7"],\ - ["@newrelic/aws-sdk", "virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:5.0.5"],\ - ["@newrelic/koa", "virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:7.2.0"],\ + ["@mrleebo/prisma-ast", "npm:0.5.2"],\ + ["@newrelic/aws-sdk", "virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:5.0.5"],\ + ["@newrelic/koa", "virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:7.2.0"],\ ["@newrelic/native-metrics", "npm:9.0.0"],\ - ["@newrelic/superagent", "virtual:6c0218eb35e7b4d794c27d53b6d08e55a14926f8208503d7c87c5523c7eddab81e73a33d20c113bf2e2243835770668bf82b9f2cc9457ebefec57f8228eac1e5#npm:6.0.0"],\ + ["@newrelic/superagent", "virtual:55e3dc82b6215f1567488e1cf62d898e236bf3fbb50d0f85fa481e584fac63bce8480242a1c9ce6901898128305adc0bb1c4191c1961e5ceb4d5440c5de64545#npm:6.0.0"],\ ["@tyriar/fibonacci-heap", "npm:2.0.9"],\ ["concat-stream", "npm:2.0.0"],\ ["https-proxy-agent", "npm:5.0.1"],\ @@ -12704,17 +12494,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["node-fetch", [\ - ["npm:2.6.7", {\ - "packageLocation": "./.yarn/cache/node-fetch-npm-2.6.7-777aa2a6df-05c03fe66f.zip/node_modules/node-fetch/",\ + ["npm:2.6.11", {\ + "packageLocation": "./.yarn/cache/node-fetch-npm-2.6.11-160e4174c3-3e7af7c002.zip/node_modules/node-fetch/",\ "packageDependencies": [\ - ["node-fetch", "npm:2.6.7"]\ - ],\ - "linkType": "SOFT"\ - }],\ - ["npm:2.6.9", {\ - "packageLocation": "./.yarn/cache/node-fetch-npm-2.6.9-9fc9a54529-8457cf62f5.zip/node_modules/node-fetch/",\ - "packageDependencies": [\ - ["node-fetch", "npm:2.6.9"]\ + ["node-fetch", "npm:2.6.11"]\ ],\ "linkType": "SOFT"\ }],\ @@ -12728,24 +12511,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:1b72fec7bb0f7f65631883ba39976a89b23a387bb935170eee37fef528f0caab0bcc7663f8211ff33a22ee11d361aa1b8f34bec752dd83d1882c9de3d3bc1fbf#npm:2.6.9", {\ - "packageLocation": "./.yarn/__virtual__/node-fetch-virtual-27a4c2fe3a/0/cache/node-fetch-npm-2.6.9-9fc9a54529-8457cf62f5.zip/node_modules/node-fetch/",\ + ["virtual:0f92dfe7f9dc4fd492639d4a5b7805c2b27442bf599fd4f370b22a7966ba078f5d4525e2a8e8af29369f20e1833ed084bd52be59679efaa6c1c6c10cdbcd8baa#npm:2.6.11", {\ + "packageLocation": "./.yarn/__virtual__/node-fetch-virtual-4ee7420f8b/0/cache/node-fetch-npm-2.6.11-160e4174c3-3e7af7c002.zip/node_modules/node-fetch/",\ "packageDependencies": [\ - ["node-fetch", "virtual:1b72fec7bb0f7f65631883ba39976a89b23a387bb935170eee37fef528f0caab0bcc7663f8211ff33a22ee11d361aa1b8f34bec752dd83d1882c9de3d3bc1fbf#npm:2.6.9"],\ - ["@types/encoding", null],\ - ["encoding", null],\ - ["whatwg-url", "npm:5.0.0"]\ - ],\ - "packagePeers": [\ - "@types/encoding",\ - "encoding"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:e414995db9c779306e687c7a7c66965e66d0cd7270f6b9fc4f00cc9772c5d50b305ab83e142e0e21dbf10968f7437cbdfcb170d05f4bde68707ac7d0082c9cca#npm:2.6.7", {\ - "packageLocation": "./.yarn/__virtual__/node-fetch-virtual-10f4bc17d9/0/cache/node-fetch-npm-2.6.7-777aa2a6df-05c03fe66f.zip/node_modules/node-fetch/",\ - "packageDependencies": [\ - ["node-fetch", "virtual:e414995db9c779306e687c7a7c66965e66d0cd7270f6b9fc4f00cc9772c5d50b305ab83e142e0e21dbf10968f7437cbdfcb170d05f4bde68707ac7d0082c9cca#npm:2.6.7"],\ + ["node-fetch", "virtual:0f92dfe7f9dc4fd492639d4a5b7805c2b27442bf599fd4f370b22a7966ba078f5d4525e2a8e8af29369f20e1833ed084bd52be59679efaa6c1c6c10cdbcd8baa#npm:2.6.11"],\ ["@types/encoding", null],\ ["encoding", null],\ ["whatwg-url", "npm:5.0.0"]\ @@ -12769,8 +12538,8 @@ const RAW_RUNTIME_STATE = ["nopt", "npm:5.0.0"],\ ["npmlog", "npm:6.0.2"],\ ["rimraf", "npm:3.0.2"],\ - ["semver", "npm:7.5.0"],\ - ["tar", "npm:6.1.14"],\ + ["semver", "npm:7.5.1"],\ + ["tar", "npm:6.1.15"],\ ["which", "npm:2.0.2"]\ ],\ "linkType": "HARD"\ @@ -12786,8 +12555,8 @@ const RAW_RUNTIME_STATE = ["nopt", "npm:6.0.0"],\ ["npmlog", "npm:6.0.2"],\ ["rimraf", "npm:3.0.2"],\ - ["semver", "npm:7.5.0"],\ - ["tar", "npm:6.1.14"],\ + ["semver", "npm:7.5.1"],\ + ["tar", "npm:6.1.15"],\ ["which", "npm:2.0.2"]\ ],\ "linkType": "HARD"\ @@ -12821,10 +12590,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["node-releases", [\ - ["npm:2.0.10", {\ - "packageLocation": "./.yarn/cache/node-releases-npm-2.0.10-f8e2d9a776-2047e77c66.zip/node_modules/node-releases/",\ + ["npm:2.0.12", {\ + "packageLocation": "./.yarn/cache/node-releases-npm-2.0.12-888ed1398a-ae9ed0c2ed.zip/node_modules/node-releases/",\ "packageDependencies": [\ - ["node-releases", "npm:2.0.10"]\ + ["node-releases", "npm:2.0.12"]\ ],\ "linkType": "HARD"\ }]\ @@ -12899,8 +12668,8 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["normalize-package-data", "npm:3.0.3"],\ ["hosted-git-info", "npm:4.1.0"],\ - ["is-core-module", "npm:2.12.0"],\ - ["semver", "npm:7.5.0"],\ + ["is-core-module", "npm:2.12.1"],\ + ["semver", "npm:7.5.1"],\ ["validate-npm-package-license", "npm:3.0.4"]\ ],\ "linkType": "HARD"\ @@ -12910,8 +12679,8 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["normalize-package-data", "npm:5.0.0"],\ ["hosted-git-info", "npm:6.1.1"],\ - ["is-core-module", "npm:2.12.0"],\ - ["semver", "npm:7.5.0"],\ + ["is-core-module", "npm:2.12.1"],\ + ["semver", "npm:7.5.1"],\ ["validate-npm-package-license", "npm:3.0.4"]\ ],\ "linkType": "HARD"\ @@ -12946,10 +12715,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["npm-check-updates", [\ - ["npm:16.10.9", {\ - "packageLocation": "./.yarn/cache/npm-check-updates-npm-16.10.9-33c9c7db2d-72ec7248a6.zip/node_modules/npm-check-updates/",\ + ["npm:16.10.12", {\ + "packageLocation": "./.yarn/cache/npm-check-updates-npm-16.10.12-52621487c3-4ec825b97d.zip/node_modules/npm-check-updates/",\ "packageDependencies": [\ - ["npm-check-updates", "npm:16.10.9"],\ + ["npm-check-updates", "npm:16.10.12"],\ ["chalk", "npm:5.2.0"],\ ["cli-table3", "npm:0.6.3"],\ ["commander", "npm:10.0.1"],\ @@ -12959,12 +12728,12 @@ const RAW_RUNTIME_STATE = ["get-stdin", "npm:8.0.0"],\ ["globby", "npm:11.1.0"],\ ["hosted-git-info", "npm:5.2.1"],\ - ["ini", "npm:4.1.0"],\ + ["ini", "npm:4.1.1"],\ ["js-yaml", "npm:4.1.0"],\ ["json-parse-helpfulerror", "npm:1.0.3"],\ ["jsonlines", "npm:0.1.1"],\ ["lodash", "npm:4.17.21"],\ - ["minimatch", "npm:8.0.4"],\ + ["minimatch", "npm:9.0.1"],\ ["p-map", "npm:4.0.0"],\ ["pacote", "npm:15.1.1"],\ ["parse-github-url", "npm:1.0.2"],\ @@ -12972,8 +12741,8 @@ const RAW_RUNTIME_STATE = ["prompts-ncu", "npm:3.0.0"],\ ["rc-config-loader", "npm:4.1.2"],\ ["remote-git-tags", "npm:3.0.0"],\ - ["rimraf", "npm:4.4.1"],\ - ["semver", "npm:7.5.0"],\ + ["rimraf", "npm:5.0.1"],\ + ["semver", "npm:7.5.1"],\ ["semver-utils", "npm:1.1.4"],\ ["source-map-support", "npm:0.5.21"],\ ["spawn-please", "npm:2.0.1"],\ @@ -12989,7 +12758,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/npm-install-checks-npm-6.1.1-e05db36ccf-cba20c4f1e.zip/node_modules/npm-install-checks/",\ "packageDependencies": [\ ["npm-install-checks", "npm:6.1.1"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -13010,7 +12779,7 @@ const RAW_RUNTIME_STATE = ["npm-package-arg", "npm:10.1.0"],\ ["hosted-git-info", "npm:6.1.1"],\ ["proc-log", "npm:3.0.0"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["validate-npm-package-name", "npm:5.0.0"]\ ],\ "linkType": "HARD"\ @@ -13034,7 +12803,7 @@ const RAW_RUNTIME_STATE = ["npm-install-checks", "npm:6.1.1"],\ ["npm-normalize-package-bin", "npm:3.0.1"],\ ["npm-package-arg", "npm:10.1.0"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -13365,10 +13134,10 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/package-json-npm-8.1.0-79fa6df898-fffc33d76c.zip/node_modules/package-json/",\ "packageDependencies": [\ ["package-json", "npm:8.1.0"],\ - ["got", "npm:12.6.0"],\ + ["got", "npm:12.6.1"],\ ["registry-auth-token", "npm:5.0.2"],\ ["registry-url", "npm:6.0.1"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -13381,8 +13150,8 @@ const RAW_RUNTIME_STATE = ["@npmcli/git", "npm:4.0.4"],\ ["@npmcli/installed-package-contents", "npm:2.0.2"],\ ["@npmcli/promise-spawn", "npm:6.0.2"],\ - ["@npmcli/run-script", "npm:6.0.1"],\ - ["cacache", "npm:17.1.0"],\ + ["@npmcli/run-script", "npm:6.0.2"],\ + ["cacache", "npm:17.1.3"],\ ["fs-minipass", "npm:3.0.2"],\ ["minipass", "npm:4.2.8"],\ ["npm-package-arg", "npm:10.1.0"],\ @@ -13393,9 +13162,9 @@ const RAW_RUNTIME_STATE = ["promise-retry", "npm:2.0.1"],\ ["read-package-json", "npm:6.0.3"],\ ["read-package-json-fast", "npm:3.0.2"],\ - ["sigstore", "npm:1.4.0"],\ + ["sigstore", "npm:1.5.2"],\ ["ssri", "npm:10.0.4"],\ - ["tar", "npm:6.1.14"]\ + ["tar", "npm:6.1.15"]\ ],\ "linkType": "HARD"\ }],\ @@ -13406,8 +13175,8 @@ const RAW_RUNTIME_STATE = ["@npmcli/git", "npm:4.0.4"],\ ["@npmcli/installed-package-contents", "npm:2.0.2"],\ ["@npmcli/promise-spawn", "npm:6.0.2"],\ - ["@npmcli/run-script", "npm:6.0.1"],\ - ["cacache", "npm:17.1.0"],\ + ["@npmcli/run-script", "npm:6.0.2"],\ + ["cacache", "npm:17.1.3"],\ ["fs-minipass", "npm:3.0.2"],\ ["minipass", "npm:5.0.0"],\ ["npm-package-arg", "npm:10.1.0"],\ @@ -13420,7 +13189,7 @@ const RAW_RUNTIME_STATE = ["read-package-json-fast", "npm:3.0.2"],\ ["sigstore", "npm:1.5.2"],\ ["ssri", "npm:10.0.4"],\ - ["tar", "npm:6.1.14"]\ + ["tar", "npm:6.1.15"]\ ],\ "linkType": "HARD"\ }]\ @@ -13584,12 +13353,12 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["path-scurry", [\ - ["npm:1.7.0", {\ - "packageLocation": "./.yarn/cache/path-scurry-npm-1.7.0-e40ac7023f-b51b3abc6b.zip/node_modules/path-scurry/",\ + ["npm:1.9.2", {\ + "packageLocation": "./.yarn/cache/path-scurry-npm-1.9.2-e4789f2bee-c60ad5b0de.zip/node_modules/path-scurry/",\ "packageDependencies": [\ - ["path-scurry", "npm:1.7.0"],\ + ["path-scurry", "npm:1.9.2"],\ ["lru-cache", "npm:9.1.1"],\ - ["minipass", "npm:5.0.0"]\ + ["minipass", "npm:6.0.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -13714,7 +13483,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/prettier-linter-helpers-npm-1.0.0-6925131a7e-e9b17d00ae.zip/node_modules/prettier-linter-helpers/",\ "packageDependencies": [\ ["prettier-linter-helpers", "npm:1.0.0"],\ - ["fast-diff", "npm:1.2.0"]\ + ["fast-diff", "npm:1.3.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -13875,7 +13644,7 @@ const RAW_RUNTIME_STATE = ["@protobufjs/path", "npm:1.1.2"],\ ["@protobufjs/pool", "npm:1.1.0"],\ ["@protobufjs/utf8", "npm:1.1.0"],\ - ["@types/node", "npm:20.1.0"],\ + ["@types/node", "npm:20.2.5"],\ ["long", "npm:5.2.3"]\ ],\ "linkType": "HARD"\ @@ -13952,7 +13721,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/pvtsutils-npm-1.3.2-e1483da905-eb22d3df60.zip/node_modules/pvtsutils/",\ "packageDependencies": [\ ["pvtsutils", "npm:1.3.2"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -14091,7 +13860,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/read-package-json-npm-6.0.3-7ccdda3c7f-ac9db7a86d.zip/node_modules/read-package-json/",\ "packageDependencies": [\ ["read-package-json", "npm:6.0.3"],\ - ["glob", "npm:10.2.2"],\ + ["glob", "npm:10.2.6"],\ ["json-parse-even-better-errors", "npm:3.0.0"],\ ["normalize-package-data", "npm:5.0.0"],\ ["npm-normalize-package-bin", "npm:3.0.1"]\ @@ -14179,10 +13948,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:4.3.0", {\ - "packageLocation": "./.yarn/cache/readable-stream-npm-4.3.0-11c60fc281-14fa31e8b1.zip/node_modules/readable-stream/",\ + ["npm:4.4.0", {\ + "packageLocation": "./.yarn/cache/readable-stream-npm-4.4.0-780b78fcb6-4cacc2f32e.zip/node_modules/readable-stream/",\ "packageDependencies": [\ - ["readable-stream", "npm:4.3.0"],\ + ["readable-stream", "npm:4.4.0"],\ ["abort-controller", "npm:3.0.0"],\ ["buffer", "npm:6.0.3"],\ ["events", "npm:3.3.0"],\ @@ -14249,6 +14018,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["regexp-to-ast", [\ + ["npm:0.5.0", {\ + "packageLocation": "./.yarn/cache/regexp-to-ast-npm-0.5.0-1e96b9f3a0-7f03ab0518.zip/node_modules/regexp-to-ast/",\ + "packageDependencies": [\ + ["regexp-to-ast", "npm:0.5.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["registry-auth-token", [\ ["npm:5.0.2", {\ "packageLocation": "./.yarn/cache/registry-auth-token-npm-5.0.2-26eb592d5d-bcfc586c04.zip/node_modules/registry-auth-token/",\ @@ -14301,7 +14079,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/resolve-patch-ac9d7e4cbf-9b982fd1fd.zip/node_modules/resolve/",\ "packageDependencies": [\ ["resolve", "patch:resolve@npm%3A1.22.3#optional!builtin::version=1.22.3&hash=c3c19d"],\ - ["is-core-module", "npm:2.12.0"],\ + ["is-core-module", "npm:2.12.1"],\ ["path-parse", "npm:1.0.7"],\ ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ ],\ @@ -14410,23 +14188,16 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:4.4.1", {\ - "packageLocation": "./.yarn/cache/rimraf-npm-4.4.1-80b02e041a-1dcc3cb6a1.zip/node_modules/rimraf/",\ + ["npm:5.0.1", {\ + "packageLocation": "./.yarn/cache/rimraf-npm-5.0.1-26fb251a1d-52dae5032c.zip/node_modules/rimraf/",\ "packageDependencies": [\ - ["rimraf", "npm:4.4.1"],\ - ["glob", "npm:9.3.5"]\ + ["rimraf", "npm:5.0.1"],\ + ["glob", "npm:10.2.6"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["run-async", [\ - ["npm:2.4.1", {\ - "packageLocation": "./.yarn/cache/run-async-npm-2.4.1-a94bb90861-bf03d6deaa.zip/node_modules/run-async/",\ - "packageDependencies": [\ - ["run-async", "npm:2.4.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:3.0.0", {\ "packageLocation": "./.yarn/cache/run-async-npm-3.0.0-bfba9a6e47-18831602b5.zip/node_modules/run-async/",\ "packageDependencies": [\ @@ -14450,7 +14221,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/rxjs-npm-7.8.1-41c443a75b-d7daafba42.zip/node_modules/rxjs/",\ "packageDependencies": [\ ["rxjs", "npm:7.8.1"],\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -14494,7 +14265,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/schema-utils-npm-3.1.2-d97c6dc247-11d35f997e.zip/node_modules/schema-utils/",\ "packageDependencies": [\ ["schema-utils", "npm:3.1.2"],\ - ["@types/json-schema", "npm:7.0.11"],\ + ["@types/json-schema", "npm:7.0.12"],\ ["ajv", "npm:6.12.6"],\ ["ajv-keywords", "virtual:d97c6dc2470a09df291ffabfb628805522422b4f82428e8e42ce0cc9d601f6a37284e97b09b5fd9028947806f788dfbb1247f98a767c37a3ec2763f05bc38dec#npm:3.5.2"]\ ],\ @@ -14545,7 +14316,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/semver-diff-npm-4.0.0-33162befa2-dd701ceed8.zip/node_modules/semver-diff/",\ "packageDependencies": [\ ["semver-diff", "npm:4.0.0"],\ - ["semver", "npm:7.5.0"]\ + ["semver", "npm:7.5.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -14677,7 +14448,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["side-channel", "npm:1.0.4"],\ ["call-bind", "npm:1.0.2"],\ - ["get-intrinsic", "npm:1.2.0"],\ + ["get-intrinsic", "npm:1.2.1"],\ ["object-inspect", "npm:1.12.3"]\ ],\ "linkType": "HARD"\ @@ -14691,32 +14462,22 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:4.0.1", {\ - "packageLocation": "./.yarn/cache/signal-exit-npm-4.0.1-8535b81e83-ef082de589.zip/node_modules/signal-exit/",\ + ["npm:4.0.2", {\ + "packageLocation": "./.yarn/cache/signal-exit-npm-4.0.2-e3f0e8ed25-8d05e3167e.zip/node_modules/signal-exit/",\ "packageDependencies": [\ - ["signal-exit", "npm:4.0.1"]\ + ["signal-exit", "npm:4.0.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["sigstore", [\ - ["npm:1.4.0", {\ - "packageLocation": "./.yarn/cache/sigstore-npm-1.4.0-7a4f656b53-3e2540f19a.zip/node_modules/sigstore/",\ - "packageDependencies": [\ - ["sigstore", "npm:1.4.0"],\ - ["@sigstore/protobuf-specs", "npm:0.1.0"],\ - ["make-fetch-happen", "npm:11.1.1"],\ - ["tuf-js", "npm:1.1.5"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:1.5.2", {\ "packageLocation": "./.yarn/cache/sigstore-npm-1.5.2-b102310995-92977e20a4.zip/node_modules/sigstore/",\ "packageDependencies": [\ ["sigstore", "npm:1.5.2"],\ ["@sigstore/protobuf-specs", "npm:0.1.0"],\ ["make-fetch-happen", "npm:11.1.1"],\ - ["tuf-js", "npm:1.1.5"]\ + ["tuf-js", "npm:1.1.6"]\ ],\ "linkType": "HARD"\ }]\ @@ -14765,13 +14526,6 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:5.0.1", {\ - "packageLocation": "./.yarn/cache/slash-npm-5.0.1-f9de4366f8-dbbf13cc79.zip/node_modules/slash/",\ - "packageDependencies": [\ - ["slash", "npm:5.0.1"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:5.1.0", {\ "packageLocation": "./.yarn/cache/slash-npm-5.1.0-718a84282e-b690dceaaf.zip/node_modules/slash/",\ "packageDependencies": [\ @@ -14956,7 +14710,7 @@ const RAW_RUNTIME_STATE = ["@types/node-gyp", null],\ ["node-addon-api", "npm:4.3.0"],\ ["node-gyp", "npm:8.4.1"],\ - ["tar", "npm:6.1.14"]\ + ["tar", "npm:6.1.15"]\ ],\ "packagePeers": [\ "@types/node-gyp"\ @@ -14985,7 +14739,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/__virtual__/sqs-consumer-virtual-603a7c5831/0/cache/sqs-consumer-npm-6.2.1-857abd3d30-eba3c37353.zip/node_modules/sqs-consumer/",\ "packageDependencies": [\ ["sqs-consumer", "virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:6.2.1"],\ - ["@aws-sdk/client-sqs", "npm:3.332.0"],\ + ["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@types/aws-sdk__client-sqs", null],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"]\ ],\ @@ -15096,7 +14850,7 @@ const RAW_RUNTIME_STATE = ["string-width", "npm:5.1.2"],\ ["eastasianwidth", "npm:0.2.0"],\ ["emoji-regex", "npm:9.2.2"],\ - ["strip-ansi", "npm:7.0.1"]\ + ["strip-ansi", "npm:7.1.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -15128,10 +14882,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:7.0.1", {\ - "packageLocation": "./.yarn/cache/strip-ansi-npm-7.0.1-668c121204-552123468a.zip/node_modules/strip-ansi/",\ + ["npm:7.1.0", {\ + "packageLocation": "./.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-09f81cbad0.zip/node_modules/strip-ansi/",\ "packageDependencies": [\ - ["strip-ansi", "npm:7.0.1"],\ + ["strip-ansi", "npm:7.1.0"],\ ["ansi-regex", "npm:6.0.1"]\ ],\ "linkType": "HARD"\ @@ -15268,19 +15022,6 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["tar", [\ - ["npm:6.1.14", {\ - "packageLocation": "./.yarn/cache/tar-npm-6.1.14-282ba98561-5aeff09f56.zip/node_modules/tar/",\ - "packageDependencies": [\ - ["tar", "npm:6.1.14"],\ - ["chownr", "npm:2.0.0"],\ - ["fs-minipass", "npm:2.1.0"],\ - ["minipass", "npm:5.0.0"],\ - ["minizlib", "npm:2.1.2"],\ - ["mkdirp", "npm:1.0.4"],\ - ["yallist", "npm:4.0.0"]\ - ],\ - "linkType": "HARD"\ - }],\ ["npm:6.1.15", {\ "packageLocation": "./.yarn/cache/tar-npm-6.1.15-44c3e71720-815c25f881.zip/node_modules/tar/",\ "packageDependencies": [\ @@ -15305,10 +15046,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["terser", [\ - ["npm:5.17.1", {\ - "packageLocation": "./.yarn/cache/terser-npm-5.17.1-5b220f4a17-d42eefe438.zip/node_modules/terser/",\ + ["npm:5.17.6", {\ + "packageLocation": "./.yarn/cache/terser-npm-5.17.6-8931b8d439-bb36bd1816.zip/node_modules/terser/",\ "packageDependencies": [\ - ["terser", "npm:5.17.1"],\ + ["terser", "npm:5.17.6"],\ ["@jridgewell/source-map", "npm:0.3.3"],\ ["acorn", "npm:8.8.2"],\ ["commander", "npm:2.20.3"],\ @@ -15318,17 +15059,17 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["terser-webpack-plugin", [\ - ["npm:5.3.7", {\ - "packageLocation": "./.yarn/cache/terser-webpack-plugin-npm-5.3.7-4bfad49798-d9a53e1836.zip/node_modules/terser-webpack-plugin/",\ + ["npm:5.3.9", {\ + "packageLocation": "./.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-c9e69dfff6.zip/node_modules/terser-webpack-plugin/",\ "packageDependencies": [\ - ["terser-webpack-plugin", "npm:5.3.7"]\ + ["terser-webpack-plugin", "npm:5.3.9"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:3c1089f73ac314bb9f9d735ca9a49cc2729efc4037ebbfdb2e1f8217d10c3ef1eb90309898c7aa16b7e7de83ec50c1dbb3fe7f5d4db2293c391051e3c327d614#npm:5.3.7", {\ - "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-771edd817d/0/cache/terser-webpack-plugin-npm-5.3.7-4bfad49798-d9a53e1836.zip/node_modules/terser-webpack-plugin/",\ + ["virtual:88795c40c2ab4c9a5f946a0376f07534ed5d01eb42a9beed2b4861c019e6c904e417f85b54c9865f2ffb69d101a8278dc1dad6e8b4e1ce7c248c5a76436b9a5d#npm:5.3.9", {\ + "packageLocation": "./.yarn/__virtual__/terser-webpack-plugin-virtual-4647d2eb13/0/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-c9e69dfff6.zip/node_modules/terser-webpack-plugin/",\ "packageDependencies": [\ - ["terser-webpack-plugin", "virtual:3c1089f73ac314bb9f9d735ca9a49cc2729efc4037ebbfdb2e1f8217d10c3ef1eb90309898c7aa16b7e7de83ec50c1dbb3fe7f5d4db2293c391051e3c327d614#npm:5.3.7"],\ + ["terser-webpack-plugin", "virtual:88795c40c2ab4c9a5f946a0376f07534ed5d01eb42a9beed2b4861c019e6c904e417f85b54c9865f2ffb69d101a8278dc1dad6e8b4e1ce7c248c5a76436b9a5d#npm:5.3.9"],\ ["@jridgewell/trace-mapping", "npm:0.3.18"],\ ["@swc/core", null],\ ["@types/esbuild", null],\ @@ -15339,9 +15080,9 @@ const RAW_RUNTIME_STATE = ["jest-worker", "npm:27.5.1"],\ ["schema-utils", "npm:3.1.2"],\ ["serialize-javascript", "npm:6.0.1"],\ - ["terser", "npm:5.17.1"],\ + ["terser", "npm:5.17.6"],\ ["uglify-js", null],\ - ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.82.0"]\ + ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.85.0"]\ ],\ "packagePeers": [\ "@swc/core",\ @@ -15562,7 +15303,7 @@ const RAW_RUNTIME_STATE = ["@types/babel-jest", null],\ ["@types/babel__core", null],\ ["@types/esbuild", null],\ - ["@types/jest", "npm:29.5.1"],\ + ["@types/jest", "npm:29.5.2"],\ ["@types/jest__types", null],\ ["@types/typescript", null],\ ["babel-jest", null],\ @@ -15574,7 +15315,7 @@ const RAW_RUNTIME_STATE = ["json5", "npm:2.2.3"],\ ["lodash.memoize", "npm:4.1.2"],\ ["make-error", "npm:1.3.6"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ ["yargs-parser", "npm:21.1.1"]\ ],\ @@ -15596,25 +15337,25 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["ts-loader", [\ - ["npm:9.4.2", {\ - "packageLocation": "./.yarn/cache/ts-loader-npm-9.4.2-ad41a3f9dc-c93a9c27f0.zip/node_modules/ts-loader/",\ + ["npm:9.4.3", {\ + "packageLocation": "./.yarn/cache/ts-loader-npm-9.4.3-e0b7d45adb-61bc1012db.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["ts-loader", "npm:9.4.2"]\ + ["ts-loader", "npm:9.4.3"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:9.4.2", {\ - "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-e5b96bf07f/0/cache/ts-loader-npm-9.4.2-ad41a3f9dc-c93a9c27f0.zip/node_modules/ts-loader/",\ + ["virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:9.4.3", {\ + "packageLocation": "./.yarn/__virtual__/ts-loader-virtual-5f84c52a7d/0/cache/ts-loader-npm-9.4.3-e0b7d45adb-61bc1012db.zip/node_modules/ts-loader/",\ "packageDependencies": [\ - ["ts-loader", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:9.4.2"],\ + ["ts-loader", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:9.4.3"],\ ["@types/typescript", null],\ ["@types/webpack", null],\ ["chalk", "npm:4.1.2"],\ - ["enhanced-resolve", "npm:5.13.0"],\ + ["enhanced-resolve", "npm:5.14.1"],\ ["micromatch", "npm:4.0.5"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.82.0"]\ + ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.85.0"]\ ],\ "packagePeers": [\ "@types/typescript",\ @@ -15633,42 +15374,6 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1", {\ - "packageLocation": "./.yarn/__virtual__/ts-node-virtual-ac01688ebc/0/cache/ts-node-npm-10.9.1-6c268be7f4-c4caff4b9b.zip/node_modules/ts-node/",\ - "packageDependencies": [\ - ["ts-node", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1"],\ - ["@cspotcode/source-map-support", "npm:0.8.1"],\ - ["@swc/core", null],\ - ["@swc/wasm", null],\ - ["@tsconfig/node10", "npm:1.0.9"],\ - ["@tsconfig/node12", "npm:1.0.11"],\ - ["@tsconfig/node14", "npm:1.0.3"],\ - ["@tsconfig/node16", "npm:1.0.3"],\ - ["@types/node", "npm:20.2.5"],\ - ["@types/swc__core", null],\ - ["@types/swc__wasm", null],\ - ["@types/typescript", null],\ - ["acorn", "npm:8.8.2"],\ - ["acorn-walk", "npm:8.2.0"],\ - ["arg", "npm:4.1.3"],\ - ["create-require", "npm:1.1.1"],\ - ["diff", "npm:4.0.2"],\ - ["make-error", "npm:1.3.6"],\ - ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"],\ - ["v8-compile-cache-lib", "npm:3.0.1"],\ - ["yn", "npm:3.1.1"]\ - ],\ - "packagePeers": [\ - "@swc/core",\ - "@swc/wasm",\ - "@types/node",\ - "@types/swc__core",\ - "@types/swc__wasm",\ - "@types/typescript",\ - "typescript"\ - ],\ - "linkType": "HARD"\ - }],\ ["virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:10.9.1", {\ "packageLocation": "./.yarn/__virtual__/ts-node-virtual-4c9d9a7987/0/cache/ts-node-npm-10.9.1-6c268be7f4-c4caff4b9b.zip/node_modules/ts-node/",\ "packageDependencies": [\ @@ -15679,8 +15384,8 @@ const RAW_RUNTIME_STATE = ["@tsconfig/node10", "npm:1.0.9"],\ ["@tsconfig/node12", "npm:1.0.11"],\ ["@tsconfig/node14", "npm:1.0.3"],\ - ["@tsconfig/node16", "npm:1.0.3"],\ - ["@types/node", "npm:20.1.0"],\ + ["@tsconfig/node16", "npm:1.0.4"],\ + ["@types/node", "npm:20.2.5"],\ ["@types/swc__core", null],\ ["@types/swc__wasm", null],\ ["@types/typescript", null],\ @@ -15714,10 +15419,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["npm:2.5.0", {\ - "packageLocation": "./.yarn/cache/tslib-npm-2.5.0-bb364efebd-5a6ee935f5.zip/node_modules/tslib/",\ + ["npm:2.5.2", {\ + "packageLocation": "./.yarn/cache/tslib-npm-2.5.2-3f1b58afbb-ed22e23f3d.zip/node_modules/tslib/",\ "packageDependencies": [\ - ["tslib", "npm:2.5.0"]\ + ["tslib", "npm:2.5.2"]\ ],\ "linkType": "HARD"\ }]\ @@ -15730,24 +15435,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:bf62ef1c6ffb8fd658e7f83333428938df10db976eec79995f23db479ad786a83e0f34b8fc6208940aa64f91a8cafb627f1c9a5209766f28b0eb4d279a7e0fec#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-9d88453900/0/cache/tsutils-npm-3.21.0-347e6636c5-723459d516.zip/node_modules/tsutils/",\ + ["virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-3ad16564a0/0/cache/tsutils-npm-3.21.0-347e6636c5-723459d516.zip/node_modules/tsutils/",\ "packageDependencies": [\ - ["tsutils", "virtual:bf62ef1c6ffb8fd658e7f83333428938df10db976eec79995f23db479ad786a83e0f34b8fc6208940aa64f91a8cafb627f1c9a5209766f28b0eb4d279a7e0fec#npm:3.21.0"],\ - ["@types/typescript", null],\ - ["tslib", "npm:1.14.1"],\ - ["typescript", null]\ - ],\ - "packagePeers": [\ - "@types/typescript",\ - "typescript"\ - ],\ - "linkType": "HARD"\ - }],\ - ["virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:3.21.0", {\ - "packageLocation": "./.yarn/__virtual__/tsutils-virtual-efba093a59/0/cache/tsutils-npm-3.21.0-347e6636c5-723459d516.zip/node_modules/tsutils/",\ - "packageDependencies": [\ - ["tsutils", "virtual:e393e2efbffebe091eab45748511654278c4ce36d9f497027429d4899a918f01fe51038789a7412f2a18eb3a8c933898b76a4c80159e82a524049b3c0ee03de2#npm:3.21.0"],\ + ["tsutils", "virtual:39388bed223ddbce0d44acc203a1485ae46c267cbf9a4235c873101dd46794d5d451d3ffec8cd2f10f4ef8a595a45361c82ed2e82f691a9fad381895d9f1855d#npm:3.21.0"],\ ["@types/typescript", null],\ ["tslib", "npm:1.14.1"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin::version=5.0.4&hash=b5f058"]\ @@ -15757,14 +15448,29 @@ const RAW_RUNTIME_STATE = "typescript"\ ],\ "linkType": "HARD"\ + }],\ + ["virtual:ca06b20d81832ed7bc000f8e9cff2595c76b19dab6b2c075cbd8b2a146fd3a9ad51a5b929a979ab00364139a9943427a2ad4d48530e82470e718317f2f6b5539#npm:3.21.0", {\ + "packageLocation": "./.yarn/__virtual__/tsutils-virtual-cc150446a8/0/cache/tsutils-npm-3.21.0-347e6636c5-723459d516.zip/node_modules/tsutils/",\ + "packageDependencies": [\ + ["tsutils", "virtual:ca06b20d81832ed7bc000f8e9cff2595c76b19dab6b2c075cbd8b2a146fd3a9ad51a5b929a979ab00364139a9943427a2ad4d48530e82470e718317f2f6b5539#npm:3.21.0"],\ + ["@types/typescript", null],\ + ["tslib", "npm:1.14.1"],\ + ["typescript", null]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "typescript"\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["tuf-js", [\ - ["npm:1.1.5", {\ - "packageLocation": "./.yarn/cache/tuf-js-npm-1.1.5-140b0f1312-2eef3f7df7.zip/node_modules/tuf-js/",\ + ["npm:1.1.6", {\ + "packageLocation": "./.yarn/cache/tuf-js-npm-1.1.6-976a3cf45a-d13ae54a51.zip/node_modules/tuf-js/",\ "packageDependencies": [\ - ["tuf-js", "npm:1.1.5"],\ + ["tuf-js", "npm:1.1.6"],\ ["@tufjs/models", "npm:1.0.4"],\ + ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ ["make-fetch-happen", "npm:11.1.1"]\ ],\ "linkType": "HARD"\ @@ -15871,17 +15577,17 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["typeorm", [\ - ["npm:0.3.15", {\ - "packageLocation": "./.yarn/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip/node_modules/typeorm/",\ + ["npm:0.3.16", {\ + "packageLocation": "./.yarn/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip/node_modules/typeorm/",\ "packageDependencies": [\ - ["typeorm", "npm:0.3.15"]\ + ["typeorm", "npm:0.3.16"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.15", {\ - "packageLocation": "./.yarn/__virtual__/typeorm-virtual-df054ce402/0/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip/node_modules/typeorm/",\ + ["virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.16", {\ + "packageLocation": "./.yarn/__virtual__/typeorm-virtual-3f6407120b/0/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip/node_modules/typeorm/",\ "packageDependencies": [\ - ["typeorm", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.15"],\ + ["typeorm", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.16"],\ ["@google-cloud/spanner", null],\ ["@sap/hana-client", null],\ ["@sqltools/formatter", "npm:1.2.5"],\ @@ -15907,15 +15613,16 @@ const RAW_RUNTIME_STATE = ["buffer", "npm:6.0.3"],\ ["chalk", "npm:4.1.2"],\ ["cli-highlight", "npm:2.1.11"],\ + ["date-fns", "npm:2.30.0"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["glob", "npm:8.1.0"],\ ["hdb-pool", null],\ ["ioredis", "npm:5.3.2"],\ ["mkdirp", "npm:2.1.6"],\ ["mongodb", null],\ ["mssql", null],\ - ["mysql2", "npm:3.2.4"],\ + ["mysql2", "npm:3.3.3"],\ ["oracledb", null],\ ["pg", null],\ ["pg-native", null],\ @@ -15926,7 +15633,7 @@ const RAW_RUNTIME_STATE = ["sql.js", null],\ ["sqlite3", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:5.1.6"],\ ["ts-node", null],\ - ["tslib", "npm:2.5.0"],\ + ["tslib", "npm:2.5.2"],\ ["typeorm-aurora-data-api-driver", null],\ ["uuid", "npm:9.0.0"],\ ["yargs", "npm:17.7.2"]\ @@ -15969,10 +15676,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.15", {\ - "packageLocation": "./.yarn/__virtual__/typeorm-virtual-7fe891193c/0/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip/node_modules/typeorm/",\ + ["virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.16", {\ + "packageLocation": "./.yarn/__virtual__/typeorm-virtual-6adc0d3ce7/0/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip/node_modules/typeorm/",\ "packageDependencies": [\ - ["typeorm", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.15"],\ + ["typeorm", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:0.3.16"],\ ["@google-cloud/spanner", null],\ ["@sap/hana-client", null],\ ["@sqltools/formatter", "npm:1.2.5"],\ @@ -15998,15 +15705,16 @@ const RAW_RUNTIME_STATE = ["buffer", "npm:6.0.3"],\ ["chalk", "npm:4.1.2"],\ ["cli-highlight", "npm:2.1.11"],\ + ["date-fns", "npm:2.30.0"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["glob", "npm:8.1.0"],\ ["hdb-pool", null],\ ["ioredis", null],\ ["mkdirp", "npm:2.1.6"],\ ["mongodb", null],\ ["mssql", null],\ - ["mysql2", "npm:3.2.4"],\ + ["mysql2", "npm:3.3.3"],\ ["oracledb", null],\ ["pg", null],\ ["pg-native", null],\ @@ -16017,7 +15725,7 @@ const RAW_RUNTIME_STATE = ["sql.js", null],\ ["sqlite3", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:5.1.6"],\ ["ts-node", null],\ - ["tslib", "npm:2.5.0"],\ + ["tslib", "npm:2.5.2"],\ ["typeorm-aurora-data-api-driver", null],\ ["uuid", "npm:9.0.0"],\ ["yargs", "npm:17.7.2"]\ @@ -16060,10 +15768,10 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "HARD"\ }],\ - ["virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.15", {\ - "packageLocation": "./.yarn/__virtual__/typeorm-virtual-f4ad097ed3/0/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip/node_modules/typeorm/",\ + ["virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.16", {\ + "packageLocation": "./.yarn/__virtual__/typeorm-virtual-fc9b7b780b/0/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip/node_modules/typeorm/",\ "packageDependencies": [\ - ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.15"],\ + ["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.16"],\ ["@google-cloud/spanner", null],\ ["@sap/hana-client", null],\ ["@sqltools/formatter", "npm:1.2.5"],\ @@ -16089,15 +15797,16 @@ const RAW_RUNTIME_STATE = ["buffer", "npm:6.0.3"],\ ["chalk", "npm:4.1.2"],\ ["cli-highlight", "npm:2.1.11"],\ + ["date-fns", "npm:2.30.0"],\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"],\ - ["dotenv", "npm:16.0.3"],\ + ["dotenv", "npm:16.1.3"],\ ["glob", "npm:8.1.0"],\ ["hdb-pool", null],\ ["ioredis", "npm:5.3.2"],\ ["mkdirp", "npm:2.1.6"],\ ["mongodb", null],\ ["mssql", null],\ - ["mysql2", "npm:3.2.4"],\ + ["mysql2", "npm:3.3.3"],\ ["oracledb", null],\ ["pg", null],\ ["pg-native", null],\ @@ -16108,7 +15817,7 @@ const RAW_RUNTIME_STATE = ["sql.js", null],\ ["sqlite3", null],\ ["ts-node", null],\ - ["tslib", "npm:2.5.0"],\ + ["tslib", "npm:2.5.2"],\ ["typeorm-aurora-data-api-driver", null],\ ["uuid", "npm:9.0.0"],\ ["yargs", "npm:17.7.2"]\ @@ -16303,12 +16012,12 @@ const RAW_RUNTIME_STATE = ],\ "linkType": "SOFT"\ }],\ - ["virtual:e3b9e9d029ed690d72cbb29196ba0a23f15b398eeb926347678187be937db870a04cbf984eecc8e0ec9c290158a9cd8607d12f0188665abe039fa4a9051a22ac#npm:1.0.11", {\ - "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-fb3cb9060c/0/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-adce84b01c.zip/node_modules/update-browserslist-db/",\ + ["virtual:36caf91554dac89a3f358f56f66ad80dc64d857177a5d24ed45f959d4a3df13ab436c15c5a53b1877973f2b1210f779aec20e0aa5d0876811aa58c9c83dd4f9c#npm:1.0.11", {\ + "packageLocation": "./.yarn/__virtual__/update-browserslist-db-virtual-aeff013789/0/cache/update-browserslist-db-npm-1.0.11-2c8e64258f-adce84b01c.zip/node_modules/update-browserslist-db/",\ "packageDependencies": [\ - ["update-browserslist-db", "virtual:e3b9e9d029ed690d72cbb29196ba0a23f15b398eeb926347678187be937db870a04cbf984eecc8e0ec9c290158a9cd8607d12f0188665abe039fa4a9051a22ac#npm:1.0.11"],\ + ["update-browserslist-db", "virtual:36caf91554dac89a3f358f56f66ad80dc64d857177a5d24ed45f959d4a3df13ab436c15c5a53b1877973f2b1210f779aec20e0aa5d0876811aa58c9c83dd4f9c#npm:1.0.11"],\ ["@types/browserslist", null],\ - ["browserslist", "npm:4.21.5"],\ + ["browserslist", "npm:4.21.7"],\ ["escalade", "npm:3.1.1"],\ ["picocolors", "npm:1.0.0"]\ ],\ @@ -16324,7 +16033,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/update-notifier-npm-6.0.2-76fda24881-7dc615b8c6.zip/node_modules/update-notifier/",\ "packageDependencies": [\ ["update-notifier", "npm:6.0.2"],\ - ["boxen", "npm:7.0.2"],\ + ["boxen", "npm:7.1.0"],\ ["chalk", "npm:5.2.0"],\ ["configstore", "npm:6.0.0"],\ ["has-yarn", "npm:3.0.0"],\ @@ -16335,7 +16044,7 @@ const RAW_RUNTIME_STATE = ["is-yarn-global", "npm:0.4.1"],\ ["latest-version", "npm:7.0.0"],\ ["pupa", "npm:3.1.0"],\ - ["semver", "npm:7.5.0"],\ + ["semver", "npm:7.5.1"],\ ["semver-diff", "npm:4.0.0"],\ ["xdg-basedir", "npm:5.1.0"]\ ],\ @@ -16496,28 +16205,28 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["webpack", [\ - ["npm:5.82.0", {\ - "packageLocation": "./.yarn/cache/webpack-npm-5.82.0-f71a254df9-bd9641a552.zip/node_modules/webpack/",\ + ["npm:5.85.0", {\ + "packageLocation": "./.yarn/cache/webpack-npm-5.85.0-11652af5db-9a91ad3995.zip/node_modules/webpack/",\ "packageDependencies": [\ - ["webpack", "npm:5.82.0"]\ + ["webpack", "npm:5.85.0"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.82.0", {\ - "packageLocation": "./.yarn/__virtual__/webpack-virtual-3c1089f73a/0/cache/webpack-npm-5.82.0-f71a254df9-bd9641a552.zip/node_modules/webpack/",\ + ["virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.85.0", {\ + "packageLocation": "./.yarn/__virtual__/webpack-virtual-88795c40c2/0/cache/webpack-npm-5.85.0-11652af5db-9a91ad3995.zip/node_modules/webpack/",\ "packageDependencies": [\ - ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.82.0"],\ + ["webpack", "virtual:251b55e6186f136d0456117ba65ba163d1a38b49e5d09875aa42c66c71e5a9085f9a3cc24c7aae5da7499c53d95e6948b9284db4d7d1f035f288826df740c6bf#npm:5.85.0"],\ ["@types/eslint-scope", "npm:3.7.4"],\ ["@types/estree", "npm:1.0.1"],\ ["@types/webpack-cli", null],\ - ["@webassemblyjs/ast", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-edit", "npm:1.11.5"],\ - ["@webassemblyjs/wasm-parser", "npm:1.11.5"],\ + ["@webassemblyjs/ast", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-edit", "npm:1.11.6"],\ + ["@webassemblyjs/wasm-parser", "npm:1.11.6"],\ ["acorn", "npm:8.8.2"],\ - ["acorn-import-assertions", "virtual:3c1089f73ac314bb9f9d735ca9a49cc2729efc4037ebbfdb2e1f8217d10c3ef1eb90309898c7aa16b7e7de83ec50c1dbb3fe7f5d4db2293c391051e3c327d614#npm:1.8.0"],\ - ["browserslist", "npm:4.21.5"],\ + ["acorn-import-assertions", "virtual:88795c40c2ab4c9a5f946a0376f07534ed5d01eb42a9beed2b4861c019e6c904e417f85b54c9865f2ffb69d101a8278dc1dad6e8b4e1ce7c248c5a76436b9a5d#npm:1.9.0"],\ + ["browserslist", "npm:4.21.7"],\ ["chrome-trace-event", "npm:1.0.3"],\ - ["enhanced-resolve", "npm:5.13.0"],\ + ["enhanced-resolve", "npm:5.14.1"],\ ["es-module-lexer", "npm:1.2.1"],\ ["eslint-scope", "npm:5.1.1"],\ ["events", "npm:3.3.0"],\ @@ -16529,7 +16238,7 @@ const RAW_RUNTIME_STATE = ["neo-async", "npm:2.6.2"],\ ["schema-utils", "npm:3.1.2"],\ ["tapable", "npm:2.2.1"],\ - ["terser-webpack-plugin", "virtual:3c1089f73ac314bb9f9d735ca9a49cc2729efc4037ebbfdb2e1f8217d10c3ef1eb90309898c7aa16b7e7de83ec50c1dbb3fe7f5d4db2293c391051e3c327d614#npm:5.3.7"],\ + ["terser-webpack-plugin", "virtual:88795c40c2ab4c9a5f946a0376f07534ed5d01eb42a9beed2b4861c019e6c904e417f85b54c9865f2ffb69d101a8278dc1dad6e8b4e1ce7c248c5a76436b9a5d#npm:5.3.9"],\ ["watchpack", "npm:2.4.0"],\ ["webpack-cli", null],\ ["webpack-sources", "npm:3.2.3"]\ @@ -16600,10 +16309,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["winston", [\ - ["npm:3.8.2", {\ - "packageLocation": "./.yarn/cache/winston-npm-3.8.2-2035e9cac4-50d7712f49.zip/node_modules/winston/",\ + ["npm:3.9.0", {\ + "packageLocation": "./.yarn/cache/winston-npm-3.9.0-88b81bb8c3-8395f2942e.zip/node_modules/winston/",\ "packageDependencies": [\ - ["winston", "npm:3.8.2"],\ + ["winston", "npm:3.9.0"],\ ["@colors/colors", "npm:1.5.0"],\ ["@dabh/diagnostics", "npm:2.0.3"],\ ["async", "npm:3.2.4"],\ @@ -16676,7 +16385,7 @@ const RAW_RUNTIME_STATE = ["wrap-ansi", "npm:8.1.0"],\ ["ansi-styles", "npm:6.2.1"],\ ["string-width", "npm:5.1.2"],\ - ["strip-ansi", "npm:7.0.1"]\ + ["strip-ansi", "npm:7.1.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -16716,7 +16425,7 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["write-file-atomic", "npm:5.0.1"],\ ["imurmurhash", "npm:0.1.4"],\ - ["signal-exit", "npm:4.0.1"]\ + ["signal-exit", "npm:4.0.2"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/.yarn/cache/@aws-sdk-abort-controller-npm-3.329.0-330df022b1-86f90b191d.zip b/.yarn/cache/@aws-sdk-abort-controller-npm-3.329.0-330df022b1-86f90b191d.zip deleted file mode 100644 index 4847e34cc..000000000 Binary files a/.yarn/cache/@aws-sdk-abort-controller-npm-3.329.0-330df022b1-86f90b191d.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-abort-controller-npm-3.310.0-952bfdb762-0f0fd8b9fe.zip b/.yarn/cache/@aws-sdk-abort-controller-npm-3.342.0-7cd20f7457-53f49d69eb.zip similarity index 54% rename from .yarn/cache/@aws-sdk-abort-controller-npm-3.310.0-952bfdb762-0f0fd8b9fe.zip rename to .yarn/cache/@aws-sdk-abort-controller-npm-3.342.0-7cd20f7457-53f49d69eb.zip index b4f01a379..e15b124e3 100644 Binary files a/.yarn/cache/@aws-sdk-abort-controller-npm-3.310.0-952bfdb762-0f0fd8b9fe.zip and b/.yarn/cache/@aws-sdk-abort-controller-npm-3.342.0-7cd20f7457-53f49d69eb.zip differ diff --git a/.yarn/cache/@aws-sdk-client-s3-npm-3.332.0-b8db621e0d-08bd1ae694.zip b/.yarn/cache/@aws-sdk-client-s3-npm-3.332.0-b8db621e0d-08bd1ae694.zip deleted file mode 100644 index 2837aa943..000000000 Binary files a/.yarn/cache/@aws-sdk-client-s3-npm-3.332.0-b8db621e0d-08bd1ae694.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-s3-npm-3.342.0-a2692091c5-9f3b9171dd.zip b/.yarn/cache/@aws-sdk-client-s3-npm-3.342.0-a2692091c5-9f3b9171dd.zip new file mode 100644 index 000000000..ce0aa2614 Binary files /dev/null and b/.yarn/cache/@aws-sdk-client-s3-npm-3.342.0-a2692091c5-9f3b9171dd.zip differ diff --git a/.yarn/cache/@aws-sdk-client-sns-npm-3.332.0-1150185943-72345e1f6b.zip b/.yarn/cache/@aws-sdk-client-sns-npm-3.332.0-1150185943-72345e1f6b.zip deleted file mode 100644 index f58602d20..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sns-npm-3.332.0-1150185943-72345e1f6b.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sns-npm-3.342.0-94ce02a19b-8d7ccac0ed.zip b/.yarn/cache/@aws-sdk-client-sns-npm-3.342.0-94ce02a19b-8d7ccac0ed.zip new file mode 100644 index 000000000..128587b75 Binary files /dev/null and b/.yarn/cache/@aws-sdk-client-sns-npm-3.342.0-94ce02a19b-8d7ccac0ed.zip differ diff --git a/.yarn/cache/@aws-sdk-client-sqs-npm-3.327.0-5e3dbf5dc0-cc1a4bfa8b.zip b/.yarn/cache/@aws-sdk-client-sqs-npm-3.327.0-5e3dbf5dc0-cc1a4bfa8b.zip deleted file mode 100644 index 96e1b4ee6..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sqs-npm-3.327.0-5e3dbf5dc0-cc1a4bfa8b.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sqs-npm-3.332.0-dc87108762-2a5c0d8a82.zip b/.yarn/cache/@aws-sdk-client-sqs-npm-3.332.0-dc87108762-2a5c0d8a82.zip deleted file mode 100644 index aed846684..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sqs-npm-3.332.0-dc87108762-2a5c0d8a82.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sqs-npm-3.342.0-f4e06f69ac-e08dd27f26.zip b/.yarn/cache/@aws-sdk-client-sqs-npm-3.342.0-f4e06f69ac-e08dd27f26.zip new file mode 100644 index 000000000..0ebca808f Binary files /dev/null and b/.yarn/cache/@aws-sdk-client-sqs-npm-3.342.0-f4e06f69ac-e08dd27f26.zip differ diff --git a/.yarn/cache/@aws-sdk-client-sso-npm-3.327.0-63404b3816-c11e99c85f.zip b/.yarn/cache/@aws-sdk-client-sso-npm-3.327.0-63404b3816-c11e99c85f.zip deleted file mode 100644 index c7fb8bf1b..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sso-npm-3.327.0-63404b3816-c11e99c85f.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sso-npm-3.332.0-0a33ec496a-ec0660f92e.zip b/.yarn/cache/@aws-sdk-client-sso-npm-3.332.0-0a33ec496a-ec0660f92e.zip deleted file mode 100644 index 2e56eb3c3..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sso-npm-3.332.0-0a33ec496a-ec0660f92e.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sso-npm-3.342.0-be2d1dcabe-78748ec6a8.zip b/.yarn/cache/@aws-sdk-client-sso-npm-3.342.0-be2d1dcabe-78748ec6a8.zip new file mode 100644 index 000000000..4b882b539 Binary files /dev/null and b/.yarn/cache/@aws-sdk-client-sso-npm-3.342.0-be2d1dcabe-78748ec6a8.zip differ diff --git a/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.327.0-bbbc5ed637-7429ae92c9.zip b/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.327.0-bbbc5ed637-7429ae92c9.zip deleted file mode 100644 index dd9f0f2a9..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.327.0-bbbc5ed637-7429ae92c9.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.332.0-3680aa51b1-84948c90b7.zip b/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.332.0-3680aa51b1-84948c90b7.zip deleted file mode 100644 index 98f7b569a..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.332.0-3680aa51b1-84948c90b7.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.342.0-ead49d3554-083c2beff3.zip b/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.342.0-ead49d3554-083c2beff3.zip new file mode 100644 index 000000000..dc4b540bd Binary files /dev/null and b/.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.342.0-ead49d3554-083c2beff3.zip differ diff --git a/.yarn/cache/@aws-sdk-client-sts-npm-3.327.0-b8ec2c0a4c-730d25b8dc.zip b/.yarn/cache/@aws-sdk-client-sts-npm-3.327.0-b8ec2c0a4c-730d25b8dc.zip deleted file mode 100644 index a78dc788d..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sts-npm-3.327.0-b8ec2c0a4c-730d25b8dc.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sts-npm-3.332.0-0aada08970-ebf88a07d3.zip b/.yarn/cache/@aws-sdk-client-sts-npm-3.332.0-0aada08970-ebf88a07d3.zip deleted file mode 100644 index f4468a193..000000000 Binary files a/.yarn/cache/@aws-sdk-client-sts-npm-3.332.0-0aada08970-ebf88a07d3.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-client-sts-npm-3.342.0-ccdc6f5bcc-14475bf1b4.zip b/.yarn/cache/@aws-sdk-client-sts-npm-3.342.0-ccdc6f5bcc-14475bf1b4.zip new file mode 100644 index 000000000..acc0aa311 Binary files /dev/null and b/.yarn/cache/@aws-sdk-client-sts-npm-3.342.0-ccdc6f5bcc-14475bf1b4.zip differ diff --git a/.yarn/cache/@aws-sdk-config-resolver-npm-3.310.0-19f7a048b9-980f73e75b.zip b/.yarn/cache/@aws-sdk-config-resolver-npm-3.310.0-19f7a048b9-980f73e75b.zip deleted file mode 100644 index 9bee8023d..000000000 Binary files a/.yarn/cache/@aws-sdk-config-resolver-npm-3.310.0-19f7a048b9-980f73e75b.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-config-resolver-npm-3.329.0-ad937b6b5a-96a66188db.zip b/.yarn/cache/@aws-sdk-config-resolver-npm-3.342.0-e26ef459a6-94007fc7e1.zip similarity index 96% rename from .yarn/cache/@aws-sdk-config-resolver-npm-3.329.0-ad937b6b5a-96a66188db.zip rename to .yarn/cache/@aws-sdk-config-resolver-npm-3.342.0-e26ef459a6-94007fc7e1.zip index 2ba791add..dac2a0d82 100644 Binary files a/.yarn/cache/@aws-sdk-config-resolver-npm-3.329.0-ad937b6b5a-96a66188db.zip and b/.yarn/cache/@aws-sdk-config-resolver-npm-3.342.0-e26ef459a6-94007fc7e1.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.329.0-a157793370-f55a57adfb.zip b/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.329.0-a157793370-f55a57adfb.zip deleted file mode 100644 index 76aff9f85..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.329.0-a157793370-f55a57adfb.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.310.0-3c07b3cdb1-b416df1446.zip b/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.342.0-be06d46059-5bb6a1891d.zip similarity index 95% rename from .yarn/cache/@aws-sdk-credential-provider-env-npm-3.310.0-3c07b3cdb1-b416df1446.zip rename to .yarn/cache/@aws-sdk-credential-provider-env-npm-3.342.0-be06d46059-5bb6a1891d.zip index 3eb3ffb3a..0e72c51b4 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.310.0-3c07b3cdb1-b416df1446.zip and b/.yarn/cache/@aws-sdk-credential-provider-env-npm-3.342.0-be06d46059-5bb6a1891d.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.329.0-04ff9ca00d-6ec90ae7e4.zip b/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.329.0-04ff9ca00d-6ec90ae7e4.zip deleted file mode 100644 index 95a2805c5..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.329.0-04ff9ca00d-6ec90ae7e4.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.310.0-c9cfae3fa2-edc6cdecf5.zip b/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.342.0-8d4fef6a87-a5fb146d98.zip similarity index 92% rename from .yarn/cache/@aws-sdk-credential-provider-imds-npm-3.310.0-c9cfae3fa2-edc6cdecf5.zip rename to .yarn/cache/@aws-sdk-credential-provider-imds-npm-3.342.0-8d4fef6a87-a5fb146d98.zip index efa54a168..7f734b5fb 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.310.0-c9cfae3fa2-edc6cdecf5.zip and b/.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.342.0-8d4fef6a87-a5fb146d98.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.327.0-7110c57dd4-f5707ac740.zip b/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.327.0-7110c57dd4-f5707ac740.zip deleted file mode 100644 index f2ff60659..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.327.0-7110c57dd4-f5707ac740.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.332.0-e91eb4fd31-b87946f4b7.zip b/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.342.0-07eb48b0d6-b00358cd28.zip similarity index 88% rename from .yarn/cache/@aws-sdk-credential-provider-ini-npm-3.332.0-e91eb4fd31-b87946f4b7.zip rename to .yarn/cache/@aws-sdk-credential-provider-ini-npm-3.342.0-07eb48b0d6-b00358cd28.zip index 7707aa4ae..45b6e60ca 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.332.0-e91eb4fd31-b87946f4b7.zip and b/.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.342.0-07eb48b0d6-b00358cd28.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.332.0-98efbe4c6c-8900cd7448.zip b/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.332.0-98efbe4c6c-8900cd7448.zip deleted file mode 100644 index 2be6c5e21..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.332.0-98efbe4c6c-8900cd7448.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.327.0-80aee1d4af-04f10696da.zip b/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.342.0-c2c35e314b-ac5214f8da.zip similarity index 87% rename from .yarn/cache/@aws-sdk-credential-provider-node-npm-3.327.0-80aee1d4af-04f10696da.zip rename to .yarn/cache/@aws-sdk-credential-provider-node-npm-3.342.0-c2c35e314b-ac5214f8da.zip index 0f0835fa9..121c75065 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.327.0-80aee1d4af-04f10696da.zip and b/.yarn/cache/@aws-sdk-credential-provider-node-npm-3.342.0-c2c35e314b-ac5214f8da.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.329.0-a4e22c58e7-ad125b9c5e.zip b/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.329.0-a4e22c58e7-ad125b9c5e.zip deleted file mode 100644 index 324ae0aba..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.329.0-a4e22c58e7-ad125b9c5e.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.310.0-8da41775a2-6cd97bd81b.zip b/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.342.0-78f1a885e7-b0c909eacf.zip similarity index 95% rename from .yarn/cache/@aws-sdk-credential-provider-process-npm-3.310.0-8da41775a2-6cd97bd81b.zip rename to .yarn/cache/@aws-sdk-credential-provider-process-npm-3.342.0-78f1a885e7-b0c909eacf.zip index c292d4f85..0ffdee4f5 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.310.0-8da41775a2-6cd97bd81b.zip and b/.yarn/cache/@aws-sdk-credential-provider-process-npm-3.342.0-78f1a885e7-b0c909eacf.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.327.0-809c65b349-177071c9d4.zip b/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.327.0-809c65b349-177071c9d4.zip deleted file mode 100644 index 984e4fe6c..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.327.0-809c65b349-177071c9d4.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.332.0-251ccf4225-5738d9eae1.zip b/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.342.0-7fd27a0dfa-85a8c3814a.zip similarity index 89% rename from .yarn/cache/@aws-sdk-credential-provider-sso-npm-3.332.0-251ccf4225-5738d9eae1.zip rename to .yarn/cache/@aws-sdk-credential-provider-sso-npm-3.342.0-7fd27a0dfa-85a8c3814a.zip index f587663e7..74543307a 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.332.0-251ccf4225-5738d9eae1.zip and b/.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.342.0-7fd27a0dfa-85a8c3814a.zip differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.329.0-64a1517f92-cfdf8074d2.zip b/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.329.0-64a1517f92-cfdf8074d2.zip deleted file mode 100644 index 4995eaf6f..000000000 Binary files a/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.329.0-64a1517f92-cfdf8074d2.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.310.0-5c6a4253d7-86d9547399.zip b/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.342.0-a6febeebb2-6989324b98.zip similarity index 97% rename from .yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.310.0-5c6a4253d7-86d9547399.zip rename to .yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.342.0-a6febeebb2-6989324b98.zip index f8be9e105..63a862370 100644 Binary files a/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.310.0-5c6a4253d7-86d9547399.zip and b/.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.342.0-a6febeebb2-6989324b98.zip differ diff --git a/.yarn/cache/@aws-sdk-eventstream-codec-npm-3.329.0-9dfec6396f-aef44310a5.zip b/.yarn/cache/@aws-sdk-eventstream-codec-npm-3.329.0-9dfec6396f-aef44310a5.zip deleted file mode 100644 index 62d125ba9..000000000 Binary files a/.yarn/cache/@aws-sdk-eventstream-codec-npm-3.329.0-9dfec6396f-aef44310a5.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-eventstream-codec-npm-3.342.0-599f1c19f8-b735b3ea18.zip b/.yarn/cache/@aws-sdk-eventstream-codec-npm-3.342.0-599f1c19f8-b735b3ea18.zip new file mode 100644 index 000000000..5acc118ec Binary files /dev/null and b/.yarn/cache/@aws-sdk-eventstream-codec-npm-3.342.0-599f1c19f8-b735b3ea18.zip differ diff --git a/.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.329.0-1167a363f7-9b0c2503c8.zip b/.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.342.0-c17f73b20c-345f411702.zip similarity index 84% rename from .yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.329.0-1167a363f7-9b0c2503c8.zip rename to .yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.342.0-c17f73b20c-345f411702.zip index f72083368..f5ce4cc34 100644 Binary files a/.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.329.0-1167a363f7-9b0c2503c8.zip and b/.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.342.0-c17f73b20c-345f411702.zip differ diff --git a/.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.329.0-5ab3df4a81-4aad3bdd73.zip b/.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.342.0-5dc510958f-cd08f6a605.zip similarity index 78% rename from .yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.329.0-5ab3df4a81-4aad3bdd73.zip rename to .yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.342.0-5dc510958f-cd08f6a605.zip index e16e741fa..85a68a48c 100644 Binary files a/.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.329.0-5ab3df4a81-4aad3bdd73.zip and b/.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.342.0-5dc510958f-cd08f6a605.zip differ diff --git a/.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.329.0-ff54965da7-4852c098cb.zip b/.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.342.0-c4f337309c-5267253359.zip similarity index 87% rename from .yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.329.0-ff54965da7-4852c098cb.zip rename to .yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.342.0-c4f337309c-5267253359.zip index dd1010135..5c7ad432e 100644 Binary files a/.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.329.0-ff54965da7-4852c098cb.zip and b/.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.342.0-c4f337309c-5267253359.zip differ diff --git a/.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.329.0-b41268f65c-c269cb96a5.zip b/.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.342.0-04f7b47201-18ae41b141.zip similarity index 64% rename from .yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.329.0-b41268f65c-c269cb96a5.zip rename to .yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.342.0-04f7b47201-18ae41b141.zip index 122a37d9c..fabe80812 100644 Binary files a/.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.329.0-b41268f65c-c269cb96a5.zip and b/.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.342.0-04f7b47201-18ae41b141.zip differ diff --git a/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.310.0-ee35f1de97-566b1b2a9c.zip b/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.310.0-ee35f1de97-566b1b2a9c.zip deleted file mode 100644 index 903cc59aa..000000000 Binary files a/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.310.0-ee35f1de97-566b1b2a9c.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.329.0-2d5e8249a0-d0961fb2ed.zip b/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.342.0-4a4e467fec-63e3544b61.zip similarity index 84% rename from .yarn/cache/@aws-sdk-fetch-http-handler-npm-3.329.0-2d5e8249a0-d0961fb2ed.zip rename to .yarn/cache/@aws-sdk-fetch-http-handler-npm-3.342.0-4a4e467fec-63e3544b61.zip index d57014c06..218912b3e 100644 Binary files a/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.329.0-2d5e8249a0-d0961fb2ed.zip and b/.yarn/cache/@aws-sdk-fetch-http-handler-npm-3.342.0-4a4e467fec-63e3544b61.zip differ diff --git a/.yarn/cache/@aws-sdk-hash-blob-browser-npm-3.329.0-a4d3b0413c-5a46f85c60.zip b/.yarn/cache/@aws-sdk-hash-blob-browser-npm-3.342.0-066e11f2e4-a5669c25e7.zip similarity index 83% rename from .yarn/cache/@aws-sdk-hash-blob-browser-npm-3.329.0-a4d3b0413c-5a46f85c60.zip rename to .yarn/cache/@aws-sdk-hash-blob-browser-npm-3.342.0-066e11f2e4-a5669c25e7.zip index d0bed8c2c..27782e288 100644 Binary files a/.yarn/cache/@aws-sdk-hash-blob-browser-npm-3.329.0-a4d3b0413c-5a46f85c60.zip and b/.yarn/cache/@aws-sdk-hash-blob-browser-npm-3.342.0-066e11f2e4-a5669c25e7.zip differ diff --git a/.yarn/cache/@aws-sdk-hash-node-npm-3.329.0-a7c67f51ba-7eaa0387ec.zip b/.yarn/cache/@aws-sdk-hash-node-npm-3.329.0-a7c67f51ba-7eaa0387ec.zip deleted file mode 100644 index 0741bc9da..000000000 Binary files a/.yarn/cache/@aws-sdk-hash-node-npm-3.329.0-a7c67f51ba-7eaa0387ec.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-hash-node-npm-3.310.0-2398ed730c-d0b0a99912.zip b/.yarn/cache/@aws-sdk-hash-node-npm-3.342.0-9dc83dff11-aed80c2ff0.zip similarity index 84% rename from .yarn/cache/@aws-sdk-hash-node-npm-3.310.0-2398ed730c-d0b0a99912.zip rename to .yarn/cache/@aws-sdk-hash-node-npm-3.342.0-9dc83dff11-aed80c2ff0.zip index fd09ffd5f..31283f0a2 100644 Binary files a/.yarn/cache/@aws-sdk-hash-node-npm-3.310.0-2398ed730c-d0b0a99912.zip and b/.yarn/cache/@aws-sdk-hash-node-npm-3.342.0-9dc83dff11-aed80c2ff0.zip differ diff --git a/.yarn/cache/@aws-sdk-hash-stream-node-npm-3.329.0-4f10e067ba-738f9d92be.zip b/.yarn/cache/@aws-sdk-hash-stream-node-npm-3.342.0-a4913a1144-3a5f01d6ec.zip similarity index 84% rename from .yarn/cache/@aws-sdk-hash-stream-node-npm-3.329.0-4f10e067ba-738f9d92be.zip rename to .yarn/cache/@aws-sdk-hash-stream-node-npm-3.342.0-a4913a1144-3a5f01d6ec.zip index cadcb9c71..8f56b4330 100644 Binary files a/.yarn/cache/@aws-sdk-hash-stream-node-npm-3.329.0-4f10e067ba-738f9d92be.zip and b/.yarn/cache/@aws-sdk-hash-stream-node-npm-3.342.0-a4913a1144-3a5f01d6ec.zip differ diff --git a/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.310.0-994c726098-2275aecde5.zip b/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.310.0-994c726098-2275aecde5.zip deleted file mode 100644 index 975c9a665..000000000 Binary files a/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.310.0-994c726098-2275aecde5.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.329.0-09565fa8f1-d81664bb97.zip b/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.342.0-39864c708e-999dd99885.zip similarity index 84% rename from .yarn/cache/@aws-sdk-invalid-dependency-npm-3.329.0-09565fa8f1-d81664bb97.zip rename to .yarn/cache/@aws-sdk-invalid-dependency-npm-3.342.0-39864c708e-999dd99885.zip index bfb0f3cf4..8b38409fa 100644 Binary files a/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.329.0-09565fa8f1-d81664bb97.zip and b/.yarn/cache/@aws-sdk-invalid-dependency-npm-3.342.0-39864c708e-999dd99885.zip differ diff --git a/.yarn/cache/@aws-sdk-md5-js-npm-3.310.0-ad3c6b0a79-e0ea528190.zip b/.yarn/cache/@aws-sdk-md5-js-npm-3.310.0-ad3c6b0a79-e0ea528190.zip deleted file mode 100644 index ee7238180..000000000 Binary files a/.yarn/cache/@aws-sdk-md5-js-npm-3.310.0-ad3c6b0a79-e0ea528190.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-md5-js-npm-3.329.0-62455ff652-3157a9019d.zip b/.yarn/cache/@aws-sdk-md5-js-npm-3.342.0-03063be6e0-32187b5846.zip similarity index 89% rename from .yarn/cache/@aws-sdk-md5-js-npm-3.329.0-62455ff652-3157a9019d.zip rename to .yarn/cache/@aws-sdk-md5-js-npm-3.342.0-03063be6e0-32187b5846.zip index 39f51d138..9d5751b3a 100644 Binary files a/.yarn/cache/@aws-sdk-md5-js-npm-3.329.0-62455ff652-3157a9019d.zip and b/.yarn/cache/@aws-sdk-md5-js-npm-3.342.0-03063be6e0-32187b5846.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.329.0-4d66fde78a-904a121931.zip b/.yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.342.0-624a90470f-d84299c6b7.zip similarity index 90% rename from .yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.329.0-4d66fde78a-904a121931.zip rename to .yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.342.0-624a90470f-d84299c6b7.zip index 2644a6274..40ccecef8 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.329.0-4d66fde78a-904a121931.zip and b/.yarn/cache/@aws-sdk-middleware-bucket-endpoint-npm-3.342.0-624a90470f-d84299c6b7.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.325.0-f64f07798a-9524973793.zip b/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.325.0-f64f07798a-9524973793.zip deleted file mode 100644 index a9cb58c7c..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.325.0-f64f07798a-9524973793.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.329.0-572714587f-b6e8b7d79a.zip b/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.342.0-56f02d1875-1514517542.zip similarity index 77% rename from .yarn/cache/@aws-sdk-middleware-content-length-npm-3.329.0-572714587f-b6e8b7d79a.zip rename to .yarn/cache/@aws-sdk-middleware-content-length-npm-3.342.0-56f02d1875-1514517542.zip index 74d98b225..3c36d058f 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.329.0-572714587f-b6e8b7d79a.zip and b/.yarn/cache/@aws-sdk-middleware-content-length-npm-3.342.0-56f02d1875-1514517542.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.329.0-0500d0a5da-407dd4e705.zip b/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.329.0-0500d0a5da-407dd4e705.zip deleted file mode 100644 index 020c2b825..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.329.0-0500d0a5da-407dd4e705.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.325.0-f001285c40-615efc3438.zip b/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.342.0-0e31647f55-252122a44b.zip similarity index 88% rename from .yarn/cache/@aws-sdk-middleware-endpoint-npm-3.325.0-f001285c40-615efc3438.zip rename to .yarn/cache/@aws-sdk-middleware-endpoint-npm-3.342.0-0e31647f55-252122a44b.zip index 590a9d6b0..ff5e867f5 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.325.0-f001285c40-615efc3438.zip and b/.yarn/cache/@aws-sdk-middleware-endpoint-npm-3.342.0-0e31647f55-252122a44b.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.329.0-99e881171e-4fa5c1213c.zip b/.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.342.0-02ac8e3ba4-77e9090e12.zip similarity index 80% rename from .yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.329.0-99e881171e-4fa5c1213c.zip rename to .yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.342.0-02ac8e3ba4-77e9090e12.zip index dedb13b55..afa65935f 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.329.0-99e881171e-4fa5c1213c.zip and b/.yarn/cache/@aws-sdk-middleware-expect-continue-npm-3.342.0-02ac8e3ba4-77e9090e12.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.331.0-4c9d7da9e7-cbfc42a47f.zip b/.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.342.0-c9718f53ef-c1f5d6b03a.zip similarity index 90% rename from .yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.331.0-4c9d7da9e7-cbfc42a47f.zip rename to .yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.342.0-c9718f53ef-c1f5d6b03a.zip index 6ec5e3ce1..697e70aff 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.331.0-4c9d7da9e7-cbfc42a47f.zip and b/.yarn/cache/@aws-sdk-middleware-flexible-checksums-npm-3.342.0-c9718f53ef-c1f5d6b03a.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.325.0-4c98784d0e-0acb0c412a.zip b/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.325.0-4c98784d0e-0acb0c412a.zip deleted file mode 100644 index 2f598f022..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.325.0-4c98784d0e-0acb0c412a.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.329.0-e3a2c4eb17-f0470b64e8.zip b/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.342.0-b4c3ff14b2-e2fffc9e6e.zip similarity index 62% rename from .yarn/cache/@aws-sdk-middleware-host-header-npm-3.329.0-e3a2c4eb17-f0470b64e8.zip rename to .yarn/cache/@aws-sdk-middleware-host-header-npm-3.342.0-b4c3ff14b2-e2fffc9e6e.zip index 802d2e9f1..6865a2082 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.329.0-e3a2c4eb17-f0470b64e8.zip and b/.yarn/cache/@aws-sdk-middleware-host-header-npm-3.342.0-b4c3ff14b2-e2fffc9e6e.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.329.0-8540f0677e-3fb7da295e.zip b/.yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.342.0-3f42e0f9ba-e5280dd6e6.zip similarity index 83% rename from .yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.329.0-8540f0677e-3fb7da295e.zip rename to .yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.342.0-3f42e0f9ba-e5280dd6e6.zip index aa5329bda..9d3ab7812 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.329.0-8540f0677e-3fb7da295e.zip and b/.yarn/cache/@aws-sdk-middleware-location-constraint-npm-3.342.0-3f42e0f9ba-e5280dd6e6.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-logger-npm-3.325.0-75e3280897-c672c3159c.zip b/.yarn/cache/@aws-sdk-middleware-logger-npm-3.325.0-75e3280897-c672c3159c.zip deleted file mode 100644 index a479d7787..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-logger-npm-3.325.0-75e3280897-c672c3159c.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-logger-npm-3.329.0-a83672165b-b8b4732902.zip b/.yarn/cache/@aws-sdk-middleware-logger-npm-3.342.0-df42508fd6-dd21063fcf.zip similarity index 83% rename from .yarn/cache/@aws-sdk-middleware-logger-npm-3.329.0-a83672165b-b8b4732902.zip rename to .yarn/cache/@aws-sdk-middleware-logger-npm-3.342.0-df42508fd6-dd21063fcf.zip index 4828bcb9d..8f8c7de6b 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-logger-npm-3.329.0-a83672165b-b8b4732902.zip and b/.yarn/cache/@aws-sdk-middleware-logger-npm-3.342.0-df42508fd6-dd21063fcf.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.325.0-9115e29a9f-23dd2098d1.zip b/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.325.0-9115e29a9f-23dd2098d1.zip deleted file mode 100644 index 08a230178..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.325.0-9115e29a9f-23dd2098d1.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.329.0-9530d1707a-7dff5457a7.zip b/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.342.0-c62ee6ac40-db1969cf8b.zip similarity index 85% rename from .yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.329.0-9530d1707a-7dff5457a7.zip rename to .yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.342.0-c62ee6ac40-db1969cf8b.zip index b44180557..6c2b59e71 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.329.0-9530d1707a-7dff5457a7.zip and b/.yarn/cache/@aws-sdk-middleware-recursion-detection-npm-3.342.0-c62ee6ac40-db1969cf8b.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-retry-npm-3.327.0-8bad44412c-fad677af76.zip b/.yarn/cache/@aws-sdk-middleware-retry-npm-3.327.0-8bad44412c-fad677af76.zip deleted file mode 100644 index 2a5299bb8..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-retry-npm-3.327.0-8bad44412c-fad677af76.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-retry-npm-3.329.0-f85eca00a2-9d66667c56.zip b/.yarn/cache/@aws-sdk-middleware-retry-npm-3.342.0-d5517fccfd-523f92bb27.zip similarity index 88% rename from .yarn/cache/@aws-sdk-middleware-retry-npm-3.329.0-f85eca00a2-9d66667c56.zip rename to .yarn/cache/@aws-sdk-middleware-retry-npm-3.342.0-d5517fccfd-523f92bb27.zip index 4b369f1a4..2e0e79ab6 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-retry-npm-3.329.0-f85eca00a2-9d66667c56.zip and b/.yarn/cache/@aws-sdk-middleware-retry-npm-3.342.0-d5517fccfd-523f92bb27.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.329.0-a4fe70ab4c-8045000e8f.zip b/.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.342.0-2c728e24ae-9566084c94.zip similarity index 61% rename from .yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.329.0-a4fe70ab4c-8045000e8f.zip rename to .yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.342.0-2c728e24ae-9566084c94.zip index 5add3351c..c46c1485e 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.329.0-a4fe70ab4c-8045000e8f.zip and b/.yarn/cache/@aws-sdk-middleware-sdk-s3-npm-3.342.0-2c728e24ae-9566084c94.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.326.0-930996bae0-6cf46dede4.zip b/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.326.0-930996bae0-6cf46dede4.zip deleted file mode 100644 index 070999db1..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.326.0-930996bae0-6cf46dede4.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.329.0-53e6711cf6-9d1e875bfb.zip b/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.342.0-d5c9d0d879-19853b3446.zip similarity index 85% rename from .yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.329.0-53e6711cf6-9d1e875bfb.zip rename to .yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.342.0-d5c9d0d879-19853b3446.zip index c97f3fcf8..dbfb8d80d 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.329.0-53e6711cf6-9d1e875bfb.zip and b/.yarn/cache/@aws-sdk-middleware-sdk-sqs-npm-3.342.0-d5c9d0d879-19853b3446.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.326.0-130556e893-cc0650fea6.zip b/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.326.0-130556e893-cc0650fea6.zip deleted file mode 100644 index b33c29071..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.326.0-130556e893-cc0650fea6.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.329.0-b8e0612c39-845b3f43bb.zip b/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.342.0-8a277a2a67-39c8d9ae7e.zip similarity index 85% rename from .yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.329.0-b8e0612c39-845b3f43bb.zip rename to .yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.342.0-8a277a2a67-39c8d9ae7e.zip index c629256c5..84c4a11e2 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.329.0-b8e0612c39-845b3f43bb.zip and b/.yarn/cache/@aws-sdk-middleware-sdk-sts-npm-3.342.0-8a277a2a67-39c8d9ae7e.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-serde-npm-3.325.0-aa84fcacd5-8019efc312.zip b/.yarn/cache/@aws-sdk-middleware-serde-npm-3.325.0-aa84fcacd5-8019efc312.zip deleted file mode 100644 index b9b0f01cc..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-serde-npm-3.325.0-aa84fcacd5-8019efc312.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-serde-npm-3.329.0-70b1cb397b-d200e91340.zip b/.yarn/cache/@aws-sdk-middleware-serde-npm-3.342.0-639212e00d-9620ae05af.zip similarity index 87% rename from .yarn/cache/@aws-sdk-middleware-serde-npm-3.329.0-70b1cb397b-d200e91340.zip rename to .yarn/cache/@aws-sdk-middleware-serde-npm-3.342.0-639212e00d-9620ae05af.zip index 2b2bf753d..fe1633ec5 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-serde-npm-3.329.0-70b1cb397b-d200e91340.zip and b/.yarn/cache/@aws-sdk-middleware-serde-npm-3.342.0-639212e00d-9620ae05af.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-signing-npm-3.325.0-7721310b2f-0343e4b4ad.zip b/.yarn/cache/@aws-sdk-middleware-signing-npm-3.325.0-7721310b2f-0343e4b4ad.zip deleted file mode 100644 index 85d1e43c5..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-signing-npm-3.325.0-7721310b2f-0343e4b4ad.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-signing-npm-3.329.0-fafebbac45-06103d8a7d.zip b/.yarn/cache/@aws-sdk-middleware-signing-npm-3.329.0-fafebbac45-06103d8a7d.zip deleted file mode 100644 index 6389c9205..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-signing-npm-3.329.0-fafebbac45-06103d8a7d.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-signing-npm-3.342.0-e6a817dad1-ccbede8d93.zip b/.yarn/cache/@aws-sdk-middleware-signing-npm-3.342.0-e6a817dad1-ccbede8d93.zip new file mode 100644 index 000000000..d2bd42723 Binary files /dev/null and b/.yarn/cache/@aws-sdk-middleware-signing-npm-3.342.0-e6a817dad1-ccbede8d93.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-ssec-npm-3.329.0-481068fcc0-60d044f82d.zip b/.yarn/cache/@aws-sdk-middleware-ssec-npm-3.342.0-d6bbb89594-d4f0daae97.zip similarity index 85% rename from .yarn/cache/@aws-sdk-middleware-ssec-npm-3.329.0-481068fcc0-60d044f82d.zip rename to .yarn/cache/@aws-sdk-middleware-ssec-npm-3.342.0-d6bbb89594-d4f0daae97.zip index 48f11040f..a94978ac9 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-ssec-npm-3.329.0-481068fcc0-60d044f82d.zip and b/.yarn/cache/@aws-sdk-middleware-ssec-npm-3.342.0-d6bbb89594-d4f0daae97.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-stack-npm-3.325.0-ba3c91ba55-7223b76201.zip b/.yarn/cache/@aws-sdk-middleware-stack-npm-3.325.0-ba3c91ba55-7223b76201.zip deleted file mode 100644 index 1ab54a507..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-stack-npm-3.325.0-ba3c91ba55-7223b76201.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-stack-npm-3.329.0-deb18647d9-80f34d8ff6.zip b/.yarn/cache/@aws-sdk-middleware-stack-npm-3.342.0-c0157485e2-1529e1a9b7.zip similarity index 86% rename from .yarn/cache/@aws-sdk-middleware-stack-npm-3.329.0-deb18647d9-80f34d8ff6.zip rename to .yarn/cache/@aws-sdk-middleware-stack-npm-3.342.0-c0157485e2-1529e1a9b7.zip index 992fd52ae..4ff6015f4 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-stack-npm-3.329.0-deb18647d9-80f34d8ff6.zip and b/.yarn/cache/@aws-sdk-middleware-stack-npm-3.342.0-c0157485e2-1529e1a9b7.zip differ diff --git a/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.332.0-477b2b503f-75bfe862c1.zip b/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.332.0-477b2b503f-75bfe862c1.zip deleted file mode 100644 index 8775a2537..000000000 Binary files a/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.332.0-477b2b503f-75bfe862c1.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.327.0-4fcf512a66-c3908a5020.zip b/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.342.0-f097e2f310-e308f45750.zip similarity index 87% rename from .yarn/cache/@aws-sdk-middleware-user-agent-npm-3.327.0-4fcf512a66-c3908a5020.zip rename to .yarn/cache/@aws-sdk-middleware-user-agent-npm-3.342.0-f097e2f310-e308f45750.zip index bb01c78d3..a1afacef8 100644 Binary files a/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.327.0-4fcf512a66-c3908a5020.zip and b/.yarn/cache/@aws-sdk-middleware-user-agent-npm-3.342.0-f097e2f310-e308f45750.zip differ diff --git a/.yarn/cache/@aws-sdk-node-config-provider-npm-3.310.0-afefa02381-9c7e17db89.zip b/.yarn/cache/@aws-sdk-node-config-provider-npm-3.310.0-afefa02381-9c7e17db89.zip deleted file mode 100644 index d9a88d3d9..000000000 Binary files a/.yarn/cache/@aws-sdk-node-config-provider-npm-3.310.0-afefa02381-9c7e17db89.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-node-config-provider-npm-3.329.0-bea365bcec-2af283e3f5.zip b/.yarn/cache/@aws-sdk-node-config-provider-npm-3.342.0-926e20a014-6b3a6a132e.zip similarity index 87% rename from .yarn/cache/@aws-sdk-node-config-provider-npm-3.329.0-bea365bcec-2af283e3f5.zip rename to .yarn/cache/@aws-sdk-node-config-provider-npm-3.342.0-926e20a014-6b3a6a132e.zip index 8f0fccf4e..06a61c7e0 100644 Binary files a/.yarn/cache/@aws-sdk-node-config-provider-npm-3.329.0-bea365bcec-2af283e3f5.zip and b/.yarn/cache/@aws-sdk-node-config-provider-npm-3.342.0-926e20a014-6b3a6a132e.zip differ diff --git a/.yarn/cache/@aws-sdk-node-http-handler-npm-3.321.1-feebdd6c44-386b87a4a6.zip b/.yarn/cache/@aws-sdk-node-http-handler-npm-3.321.1-feebdd6c44-386b87a4a6.zip deleted file mode 100644 index b8206947b..000000000 Binary files a/.yarn/cache/@aws-sdk-node-http-handler-npm-3.321.1-feebdd6c44-386b87a4a6.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-node-http-handler-npm-3.329.0-d3b0d332dc-6b688a94f0.zip b/.yarn/cache/@aws-sdk-node-http-handler-npm-3.342.0-fb790820b0-02c12aa1f8.zip similarity index 64% rename from .yarn/cache/@aws-sdk-node-http-handler-npm-3.329.0-d3b0d332dc-6b688a94f0.zip rename to .yarn/cache/@aws-sdk-node-http-handler-npm-3.342.0-fb790820b0-02c12aa1f8.zip index fe7e25ebc..6e367b1c8 100644 Binary files a/.yarn/cache/@aws-sdk-node-http-handler-npm-3.329.0-d3b0d332dc-6b688a94f0.zip and b/.yarn/cache/@aws-sdk-node-http-handler-npm-3.342.0-fb790820b0-02c12aa1f8.zip differ diff --git a/.yarn/cache/@aws-sdk-property-provider-npm-3.329.0-8f019ecd0f-e11809cea3.zip b/.yarn/cache/@aws-sdk-property-provider-npm-3.329.0-8f019ecd0f-e11809cea3.zip deleted file mode 100644 index fab02238d..000000000 Binary files a/.yarn/cache/@aws-sdk-property-provider-npm-3.329.0-8f019ecd0f-e11809cea3.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-property-provider-npm-3.310.0-453169ff51-820dd3ffc9.zip b/.yarn/cache/@aws-sdk-property-provider-npm-3.342.0-023018a9c0-17996d9f76.zip similarity index 89% rename from .yarn/cache/@aws-sdk-property-provider-npm-3.310.0-453169ff51-820dd3ffc9.zip rename to .yarn/cache/@aws-sdk-property-provider-npm-3.342.0-023018a9c0-17996d9f76.zip index 24a7a8f19..cac44a6b5 100644 Binary files a/.yarn/cache/@aws-sdk-property-provider-npm-3.310.0-453169ff51-820dd3ffc9.zip and b/.yarn/cache/@aws-sdk-property-provider-npm-3.342.0-023018a9c0-17996d9f76.zip differ diff --git a/.yarn/cache/@aws-sdk-protocol-http-npm-3.329.0-9599f077f6-459a46d8c0.zip b/.yarn/cache/@aws-sdk-protocol-http-npm-3.329.0-9599f077f6-459a46d8c0.zip deleted file mode 100644 index cd3c99491..000000000 Binary files a/.yarn/cache/@aws-sdk-protocol-http-npm-3.329.0-9599f077f6-459a46d8c0.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-protocol-http-npm-3.310.0-c99398f42b-920d072e6a.zip b/.yarn/cache/@aws-sdk-protocol-http-npm-3.342.0-a8ea022684-223a433d48.zip similarity index 94% rename from .yarn/cache/@aws-sdk-protocol-http-npm-3.310.0-c99398f42b-920d072e6a.zip rename to .yarn/cache/@aws-sdk-protocol-http-npm-3.342.0-a8ea022684-223a433d48.zip index 464979a1d..cc7decc7b 100644 Binary files a/.yarn/cache/@aws-sdk-protocol-http-npm-3.310.0-c99398f42b-920d072e6a.zip and b/.yarn/cache/@aws-sdk-protocol-http-npm-3.342.0-a8ea022684-223a433d48.zip differ diff --git a/.yarn/cache/@aws-sdk-querystring-builder-npm-3.329.0-2df4fb67f1-681efb98ac.zip b/.yarn/cache/@aws-sdk-querystring-builder-npm-3.329.0-2df4fb67f1-681efb98ac.zip deleted file mode 100644 index e31326331..000000000 Binary files a/.yarn/cache/@aws-sdk-querystring-builder-npm-3.329.0-2df4fb67f1-681efb98ac.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-querystring-builder-npm-3.310.0-5d36893a9c-d6551e9d96.zip b/.yarn/cache/@aws-sdk-querystring-builder-npm-3.342.0-8d56a52973-4e383be6ef.zip similarity index 84% rename from .yarn/cache/@aws-sdk-querystring-builder-npm-3.310.0-5d36893a9c-d6551e9d96.zip rename to .yarn/cache/@aws-sdk-querystring-builder-npm-3.342.0-8d56a52973-4e383be6ef.zip index 7cbdf50f5..258281a5d 100644 Binary files a/.yarn/cache/@aws-sdk-querystring-builder-npm-3.310.0-5d36893a9c-d6551e9d96.zip and b/.yarn/cache/@aws-sdk-querystring-builder-npm-3.342.0-8d56a52973-4e383be6ef.zip differ diff --git a/.yarn/cache/@aws-sdk-querystring-parser-npm-3.329.0-4b1a1e0fb5-9ed54dc61d.zip b/.yarn/cache/@aws-sdk-querystring-parser-npm-3.329.0-4b1a1e0fb5-9ed54dc61d.zip deleted file mode 100644 index 107334520..000000000 Binary files a/.yarn/cache/@aws-sdk-querystring-parser-npm-3.329.0-4b1a1e0fb5-9ed54dc61d.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-querystring-parser-npm-3.310.0-ff0f440f02-cac388e0b1.zip b/.yarn/cache/@aws-sdk-querystring-parser-npm-3.342.0-5463bc8cc6-4134368032.zip similarity index 81% rename from .yarn/cache/@aws-sdk-querystring-parser-npm-3.310.0-ff0f440f02-cac388e0b1.zip rename to .yarn/cache/@aws-sdk-querystring-parser-npm-3.342.0-5463bc8cc6-4134368032.zip index fdecc9520..2d41a426a 100644 Binary files a/.yarn/cache/@aws-sdk-querystring-parser-npm-3.310.0-ff0f440f02-cac388e0b1.zip and b/.yarn/cache/@aws-sdk-querystring-parser-npm-3.342.0-5463bc8cc6-4134368032.zip differ diff --git a/.yarn/cache/@aws-sdk-service-error-classification-npm-3.327.0-72f519337f-d773e8ccdf.zip b/.yarn/cache/@aws-sdk-service-error-classification-npm-3.327.0-72f519337f-d773e8ccdf.zip deleted file mode 100644 index e921ed38e..000000000 Binary files a/.yarn/cache/@aws-sdk-service-error-classification-npm-3.327.0-72f519337f-d773e8ccdf.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-service-error-classification-npm-3.329.0-c85b83bd81-215b61f2cc.zip b/.yarn/cache/@aws-sdk-service-error-classification-npm-3.342.0-4bb5c4998b-539998f7b0.zip similarity index 90% rename from .yarn/cache/@aws-sdk-service-error-classification-npm-3.329.0-c85b83bd81-215b61f2cc.zip rename to .yarn/cache/@aws-sdk-service-error-classification-npm-3.342.0-4bb5c4998b-539998f7b0.zip index 0967dd3ea..cf6b8bce8 100644 Binary files a/.yarn/cache/@aws-sdk-service-error-classification-npm-3.329.0-c85b83bd81-215b61f2cc.zip and b/.yarn/cache/@aws-sdk-service-error-classification-npm-3.342.0-4bb5c4998b-539998f7b0.zip differ diff --git a/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.310.0-0b2d617eb0-387a68d103.zip b/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.310.0-0b2d617eb0-387a68d103.zip deleted file mode 100644 index 2efb17f8d..000000000 Binary files a/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.310.0-0b2d617eb0-387a68d103.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.329.0-b4fe16c15a-4dda8a5a79.zip b/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.342.0-2715e0fd8d-c81cbddccc.zip similarity index 90% rename from .yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.329.0-b4fe16c15a-4dda8a5a79.zip rename to .yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.342.0-2715e0fd8d-c81cbddccc.zip index 87a23d011..89c7306e0 100644 Binary files a/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.329.0-b4fe16c15a-4dda8a5a79.zip and b/.yarn/cache/@aws-sdk-shared-ini-file-loader-npm-3.342.0-2715e0fd8d-c81cbddccc.zip differ diff --git a/.yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.329.0-1b40e0f10c-1e7ad0e74e.zip b/.yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.342.0-cba446ba60-e086c0a4ea.zip similarity index 84% rename from .yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.329.0-1b40e0f10c-1e7ad0e74e.zip rename to .yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.342.0-cba446ba60-e086c0a4ea.zip index 275b5d1e3..2e0f9a4e4 100644 Binary files a/.yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.329.0-1b40e0f10c-1e7ad0e74e.zip and b/.yarn/cache/@aws-sdk-signature-v4-multi-region-npm-3.342.0-cba446ba60-e086c0a4ea.zip differ diff --git a/.yarn/cache/@aws-sdk-signature-v4-npm-3.310.0-c9abec0600-0bf52f2e2b.zip b/.yarn/cache/@aws-sdk-signature-v4-npm-3.310.0-c9abec0600-0bf52f2e2b.zip deleted file mode 100644 index de8206b3a..000000000 Binary files a/.yarn/cache/@aws-sdk-signature-v4-npm-3.310.0-c9abec0600-0bf52f2e2b.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-signature-v4-npm-3.329.0-0702b2b15c-aba37d7f61.zip b/.yarn/cache/@aws-sdk-signature-v4-npm-3.342.0-5a4105c487-f667c81ecf.zip similarity index 67% rename from .yarn/cache/@aws-sdk-signature-v4-npm-3.329.0-0702b2b15c-aba37d7f61.zip rename to .yarn/cache/@aws-sdk-signature-v4-npm-3.342.0-5a4105c487-f667c81ecf.zip index ad1f90e4e..6ca5d1ab6 100644 Binary files a/.yarn/cache/@aws-sdk-signature-v4-npm-3.329.0-0702b2b15c-aba37d7f61.zip and b/.yarn/cache/@aws-sdk-signature-v4-npm-3.342.0-5a4105c487-f667c81ecf.zip differ diff --git a/.yarn/cache/@aws-sdk-smithy-client-npm-3.325.0-7668ab632f-b3722bd6ce.zip b/.yarn/cache/@aws-sdk-smithy-client-npm-3.325.0-7668ab632f-b3722bd6ce.zip deleted file mode 100644 index e2c3b9990..000000000 Binary files a/.yarn/cache/@aws-sdk-smithy-client-npm-3.325.0-7668ab632f-b3722bd6ce.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-smithy-client-npm-3.329.0-7cced1d303-45f87ed846.zip b/.yarn/cache/@aws-sdk-smithy-client-npm-3.342.0-0fae178127-e7a5c54479.zip similarity index 88% rename from .yarn/cache/@aws-sdk-smithy-client-npm-3.329.0-7cced1d303-45f87ed846.zip rename to .yarn/cache/@aws-sdk-smithy-client-npm-3.342.0-0fae178127-e7a5c54479.zip index c7dfb8b24..896940cc5 100644 Binary files a/.yarn/cache/@aws-sdk-smithy-client-npm-3.329.0-7cced1d303-45f87ed846.zip and b/.yarn/cache/@aws-sdk-smithy-client-npm-3.342.0-0fae178127-e7a5c54479.zip differ diff --git a/.yarn/cache/@aws-sdk-token-providers-npm-3.332.0-9ddcf5ab88-0e04a9d0d6.zip b/.yarn/cache/@aws-sdk-token-providers-npm-3.332.0-9ddcf5ab88-0e04a9d0d6.zip deleted file mode 100644 index 5f217fb0a..000000000 Binary files a/.yarn/cache/@aws-sdk-token-providers-npm-3.332.0-9ddcf5ab88-0e04a9d0d6.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-token-providers-npm-3.327.0-e2accc1e2b-5ad947776c.zip b/.yarn/cache/@aws-sdk-token-providers-npm-3.342.0-fc5052268f-25bedb2560.zip similarity index 88% rename from .yarn/cache/@aws-sdk-token-providers-npm-3.327.0-e2accc1e2b-5ad947776c.zip rename to .yarn/cache/@aws-sdk-token-providers-npm-3.342.0-fc5052268f-25bedb2560.zip index 275239836..83ae7c54d 100644 Binary files a/.yarn/cache/@aws-sdk-token-providers-npm-3.327.0-e2accc1e2b-5ad947776c.zip and b/.yarn/cache/@aws-sdk-token-providers-npm-3.342.0-fc5052268f-25bedb2560.zip differ diff --git a/.yarn/cache/@aws-sdk-types-npm-3.329.0-06a5c61fa9-28aff60622.zip b/.yarn/cache/@aws-sdk-types-npm-3.329.0-06a5c61fa9-28aff60622.zip deleted file mode 100644 index 095aeb044..000000000 Binary files a/.yarn/cache/@aws-sdk-types-npm-3.329.0-06a5c61fa9-28aff60622.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-types-npm-3.310.0-a69559b984-dea8ff0327.zip b/.yarn/cache/@aws-sdk-types-npm-3.342.0-9a22255552-e72bd40015.zip similarity index 69% rename from .yarn/cache/@aws-sdk-types-npm-3.310.0-a69559b984-dea8ff0327.zip rename to .yarn/cache/@aws-sdk-types-npm-3.342.0-9a22255552-e72bd40015.zip index 9948668b2..e569fed9b 100644 Binary files a/.yarn/cache/@aws-sdk-types-npm-3.310.0-a69559b984-dea8ff0327.zip and b/.yarn/cache/@aws-sdk-types-npm-3.342.0-9a22255552-e72bd40015.zip differ diff --git a/.yarn/cache/@aws-sdk-url-parser-npm-3.329.0-70076d0522-9ca336e5bb.zip b/.yarn/cache/@aws-sdk-url-parser-npm-3.329.0-70076d0522-9ca336e5bb.zip deleted file mode 100644 index 06cf96be8..000000000 Binary files a/.yarn/cache/@aws-sdk-url-parser-npm-3.329.0-70076d0522-9ca336e5bb.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-url-parser-npm-3.310.0-1760f24059-74fbdf4626.zip b/.yarn/cache/@aws-sdk-url-parser-npm-3.342.0-4a5ceacadc-0aab9fc60c.zip similarity index 82% rename from .yarn/cache/@aws-sdk-url-parser-npm-3.310.0-1760f24059-74fbdf4626.zip rename to .yarn/cache/@aws-sdk-url-parser-npm-3.342.0-4a5ceacadc-0aab9fc60c.zip index efe6f175a..e56e5a542 100644 Binary files a/.yarn/cache/@aws-sdk-url-parser-npm-3.310.0-1760f24059-74fbdf4626.zip and b/.yarn/cache/@aws-sdk-url-parser-npm-3.342.0-4a5ceacadc-0aab9fc60c.zip differ diff --git a/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.325.0-e03bca038a-e3381e8d31.zip b/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.325.0-e03bca038a-e3381e8d31.zip deleted file mode 100644 index 26a350940..000000000 Binary files a/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.325.0-e03bca038a-e3381e8d31.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.329.0-c5d6a57d9a-ccff18607b.zip b/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.342.0-21b1a48f56-1791b2098f.zip similarity index 87% rename from .yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.329.0-c5d6a57d9a-ccff18607b.zip rename to .yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.342.0-21b1a48f56-1791b2098f.zip index 783ef6877..df38cf216 100644 Binary files a/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.329.0-c5d6a57d9a-ccff18607b.zip and b/.yarn/cache/@aws-sdk-util-defaults-mode-browser-npm-3.342.0-21b1a48f56-1791b2098f.zip differ diff --git a/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.329.0-fd81099dd9-f927efbc3d.zip b/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.329.0-fd81099dd9-f927efbc3d.zip deleted file mode 100644 index 0f37525cf..000000000 Binary files a/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.329.0-fd81099dd9-f927efbc3d.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.325.0-1836f557e1-7da217a5e8.zip b/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.342.0-32a006daa1-2aaceef844.zip similarity index 80% rename from .yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.325.0-1836f557e1-7da217a5e8.zip rename to .yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.342.0-32a006daa1-2aaceef844.zip index f380669bd..df4260ac8 100644 Binary files a/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.325.0-1836f557e1-7da217a5e8.zip and b/.yarn/cache/@aws-sdk-util-defaults-mode-node-npm-3.342.0-32a006daa1-2aaceef844.zip differ diff --git a/.yarn/cache/@aws-sdk-util-endpoints-npm-3.327.0-ab44f3fae0-f9b1cfeb1a.zip b/.yarn/cache/@aws-sdk-util-endpoints-npm-3.327.0-ab44f3fae0-f9b1cfeb1a.zip deleted file mode 100644 index 0e7820d62..000000000 Binary files a/.yarn/cache/@aws-sdk-util-endpoints-npm-3.327.0-ab44f3fae0-f9b1cfeb1a.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-endpoints-npm-3.332.0-8713e2eaa5-1974420c77.zip b/.yarn/cache/@aws-sdk-util-endpoints-npm-3.342.0-4f4386f7a0-b93ab766a6.zip similarity index 90% rename from .yarn/cache/@aws-sdk-util-endpoints-npm-3.332.0-8713e2eaa5-1974420c77.zip rename to .yarn/cache/@aws-sdk-util-endpoints-npm-3.342.0-4f4386f7a0-b93ab766a6.zip index 819c5f368..de486c878 100644 Binary files a/.yarn/cache/@aws-sdk-util-endpoints-npm-3.332.0-8713e2eaa5-1974420c77.zip and b/.yarn/cache/@aws-sdk-util-endpoints-npm-3.342.0-4f4386f7a0-b93ab766a6.zip differ diff --git a/.yarn/cache/@aws-sdk-util-middleware-npm-3.329.0-659548e387-0493c049ae.zip b/.yarn/cache/@aws-sdk-util-middleware-npm-3.329.0-659548e387-0493c049ae.zip deleted file mode 100644 index 4a688c05a..000000000 Binary files a/.yarn/cache/@aws-sdk-util-middleware-npm-3.329.0-659548e387-0493c049ae.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-middleware-npm-3.310.0-ad33a1ec39-7a206a6b5e.zip b/.yarn/cache/@aws-sdk-util-middleware-npm-3.342.0-82315fe65e-124e68ffe8.zip similarity index 93% rename from .yarn/cache/@aws-sdk-util-middleware-npm-3.310.0-ad33a1ec39-7a206a6b5e.zip rename to .yarn/cache/@aws-sdk-util-middleware-npm-3.342.0-82315fe65e-124e68ffe8.zip index c0cdde017..4b571e2b3 100644 Binary files a/.yarn/cache/@aws-sdk-util-middleware-npm-3.310.0-ad33a1ec39-7a206a6b5e.zip and b/.yarn/cache/@aws-sdk-util-middleware-npm-3.342.0-82315fe65e-124e68ffe8.zip differ diff --git a/.yarn/cache/@aws-sdk-util-retry-npm-3.327.0-5eebe9c620-12b3d6b2f1.zip b/.yarn/cache/@aws-sdk-util-retry-npm-3.327.0-5eebe9c620-12b3d6b2f1.zip deleted file mode 100644 index 9f4bca37a..000000000 Binary files a/.yarn/cache/@aws-sdk-util-retry-npm-3.327.0-5eebe9c620-12b3d6b2f1.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-retry-npm-3.329.0-39c3180797-3612d19ae4.zip b/.yarn/cache/@aws-sdk-util-retry-npm-3.342.0-969adc3ffe-ef695eb274.zip similarity index 65% rename from .yarn/cache/@aws-sdk-util-retry-npm-3.329.0-39c3180797-3612d19ae4.zip rename to .yarn/cache/@aws-sdk-util-retry-npm-3.342.0-969adc3ffe-ef695eb274.zip index 07f684d27..471195540 100644 Binary files a/.yarn/cache/@aws-sdk-util-retry-npm-3.329.0-39c3180797-3612d19ae4.zip and b/.yarn/cache/@aws-sdk-util-retry-npm-3.342.0-969adc3ffe-ef695eb274.zip differ diff --git a/.yarn/cache/@aws-sdk-util-stream-browser-npm-3.329.0-4ba913c033-cf5f8ed1a1.zip b/.yarn/cache/@aws-sdk-util-stream-browser-npm-3.342.0-4a01f965f4-b29e4b4d00.zip similarity index 87% rename from .yarn/cache/@aws-sdk-util-stream-browser-npm-3.329.0-4ba913c033-cf5f8ed1a1.zip rename to .yarn/cache/@aws-sdk-util-stream-browser-npm-3.342.0-4a01f965f4-b29e4b4d00.zip index c7d23f8d4..9f3a78d15 100644 Binary files a/.yarn/cache/@aws-sdk-util-stream-browser-npm-3.329.0-4ba913c033-cf5f8ed1a1.zip and b/.yarn/cache/@aws-sdk-util-stream-browser-npm-3.342.0-4a01f965f4-b29e4b4d00.zip differ diff --git a/.yarn/cache/@aws-sdk-util-stream-node-npm-3.331.0-0e02a12ca4-9519a1718d.zip b/.yarn/cache/@aws-sdk-util-stream-node-npm-3.342.0-b59f69b0e2-99c2e126e2.zip similarity index 86% rename from .yarn/cache/@aws-sdk-util-stream-node-npm-3.331.0-0e02a12ca4-9519a1718d.zip rename to .yarn/cache/@aws-sdk-util-stream-node-npm-3.342.0-b59f69b0e2-99c2e126e2.zip index f34756402..921ec9410 100644 Binary files a/.yarn/cache/@aws-sdk-util-stream-node-npm-3.331.0-0e02a12ca4-9519a1718d.zip and b/.yarn/cache/@aws-sdk-util-stream-node-npm-3.342.0-b59f69b0e2-99c2e126e2.zip differ diff --git a/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.310.0-9f5d7e2671-6b99886964.zip b/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.310.0-9f5d7e2671-6b99886964.zip deleted file mode 100644 index 96b83da50..000000000 Binary files a/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.310.0-9f5d7e2671-6b99886964.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.329.0-14a80d95c5-04f10b65e7.zip b/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.342.0-7ce482acc1-2dc9690a77.zip similarity index 90% rename from .yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.329.0-14a80d95c5-04f10b65e7.zip rename to .yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.342.0-7ce482acc1-2dc9690a77.zip index e5ef8f289..ef9b60526 100644 Binary files a/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.329.0-14a80d95c5-04f10b65e7.zip and b/.yarn/cache/@aws-sdk-util-user-agent-browser-npm-3.342.0-7ce482acc1-2dc9690a77.zip differ diff --git a/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.329.0-178e22c724-cebebd6e4d.zip b/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.329.0-178e22c724-cebebd6e4d.zip deleted file mode 100644 index 9411f9a45..000000000 Binary files a/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.329.0-178e22c724-cebebd6e4d.zip and /dev/null differ diff --git a/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.310.0-7f7eb4a362-bb28f9f8e7.zip b/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.342.0-de2b4e3eb1-5703e2a13f.zip similarity index 91% rename from .yarn/cache/@aws-sdk-util-user-agent-node-npm-3.310.0-7f7eb4a362-bb28f9f8e7.zip rename to .yarn/cache/@aws-sdk-util-user-agent-node-npm-3.342.0-de2b4e3eb1-5703e2a13f.zip index ab383928c..4d4218974 100644 Binary files a/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.310.0-7f7eb4a362-bb28f9f8e7.zip and b/.yarn/cache/@aws-sdk-util-user-agent-node-npm-3.342.0-de2b4e3eb1-5703e2a13f.zip differ diff --git a/.yarn/cache/@aws-sdk-util-waiter-npm-3.329.0-c0bf2618c8-f32fd95b7d.zip b/.yarn/cache/@aws-sdk-util-waiter-npm-3.342.0-9933a11c25-404a4ebece.zip similarity index 87% rename from .yarn/cache/@aws-sdk-util-waiter-npm-3.329.0-c0bf2618c8-f32fd95b7d.zip rename to .yarn/cache/@aws-sdk-util-waiter-npm-3.342.0-9933a11c25-404a4ebece.zip index ad1c6699b..b185c7a76 100644 Binary files a/.yarn/cache/@aws-sdk-util-waiter-npm-3.329.0-c0bf2618c8-f32fd95b7d.zip and b/.yarn/cache/@aws-sdk-util-waiter-npm-3.342.0-9933a11c25-404a4ebece.zip differ diff --git a/.yarn/cache/@babel-compat-data-npm-7.21.7-62e7f604b1-4a1451f70f.zip b/.yarn/cache/@babel-compat-data-npm-7.22.3-7b67f6cb95-87573507cb.zip similarity index 63% rename from .yarn/cache/@babel-compat-data-npm-7.21.7-62e7f604b1-4a1451f70f.zip rename to .yarn/cache/@babel-compat-data-npm-7.22.3-7b67f6cb95-87573507cb.zip index f58769757..83667e9a2 100644 Binary files a/.yarn/cache/@babel-compat-data-npm-7.21.7-62e7f604b1-4a1451f70f.zip and b/.yarn/cache/@babel-compat-data-npm-7.22.3-7b67f6cb95-87573507cb.zip differ diff --git a/.yarn/cache/@babel-core-npm-7.21.8-236525e651-81e8853407.zip b/.yarn/cache/@babel-core-npm-7.21.8-236525e651-81e8853407.zip deleted file mode 100644 index f2edfd5dc..000000000 Binary files a/.yarn/cache/@babel-core-npm-7.21.8-236525e651-81e8853407.zip and /dev/null differ diff --git a/.yarn/cache/@babel-core-npm-7.22.1-4ec1915241-8fd937c298.zip b/.yarn/cache/@babel-core-npm-7.22.1-4ec1915241-8fd937c298.zip new file mode 100644 index 000000000..60e2d2df5 Binary files /dev/null and b/.yarn/cache/@babel-core-npm-7.22.1-4ec1915241-8fd937c298.zip differ diff --git a/.yarn/cache/@babel-generator-npm-7.21.5-576849ce71-8ae5c7ece0.zip b/.yarn/cache/@babel-generator-npm-7.21.5-576849ce71-8ae5c7ece0.zip deleted file mode 100644 index c1b34835e..000000000 Binary files a/.yarn/cache/@babel-generator-npm-7.21.5-576849ce71-8ae5c7ece0.zip and /dev/null differ diff --git a/.yarn/cache/@babel-generator-npm-7.22.3-da14afacf5-29543a50bb.zip b/.yarn/cache/@babel-generator-npm-7.22.3-da14afacf5-29543a50bb.zip new file mode 100644 index 000000000..7840dbc0f Binary files /dev/null and b/.yarn/cache/@babel-generator-npm-7.22.3-da14afacf5-29543a50bb.zip differ diff --git a/.yarn/cache/@babel-helper-compilation-targets-npm-7.21.5-999fc74b3f-d716fa2845.zip b/.yarn/cache/@babel-helper-compilation-targets-npm-7.21.5-999fc74b3f-d716fa2845.zip deleted file mode 100644 index d9633ef15..000000000 Binary files a/.yarn/cache/@babel-helper-compilation-targets-npm-7.21.5-999fc74b3f-d716fa2845.zip and /dev/null differ diff --git a/.yarn/cache/@babel-helper-compilation-targets-npm-7.22.1-4f7cfd1a17-41b4c96c17.zip b/.yarn/cache/@babel-helper-compilation-targets-npm-7.22.1-4f7cfd1a17-41b4c96c17.zip new file mode 100644 index 000000000..b72e70920 Binary files /dev/null and b/.yarn/cache/@babel-helper-compilation-targets-npm-7.22.1-4f7cfd1a17-41b4c96c17.zip differ diff --git a/.yarn/cache/@babel-helper-environment-visitor-npm-7.21.5-7d7d1d1996-b9177ab55a.zip b/.yarn/cache/@babel-helper-environment-visitor-npm-7.21.5-7d7d1d1996-b9177ab55a.zip deleted file mode 100644 index 6ef3285b2..000000000 Binary files a/.yarn/cache/@babel-helper-environment-visitor-npm-7.21.5-7d7d1d1996-b9177ab55a.zip and /dev/null differ diff --git a/.yarn/cache/@babel-helper-environment-visitor-npm-7.22.1-e00fbc528d-0849bb9a9d.zip b/.yarn/cache/@babel-helper-environment-visitor-npm-7.22.1-e00fbc528d-0849bb9a9d.zip new file mode 100644 index 000000000..a2df36955 Binary files /dev/null and b/.yarn/cache/@babel-helper-environment-visitor-npm-7.22.1-e00fbc528d-0849bb9a9d.zip differ diff --git a/.yarn/cache/@babel-helper-module-transforms-npm-7.21.5-f21e36f6a3-024306552d.zip b/.yarn/cache/@babel-helper-module-transforms-npm-7.21.5-f21e36f6a3-024306552d.zip deleted file mode 100644 index d1931db3d..000000000 Binary files a/.yarn/cache/@babel-helper-module-transforms-npm-7.21.5-f21e36f6a3-024306552d.zip and /dev/null differ diff --git a/.yarn/cache/@babel-helper-module-transforms-npm-7.22.1-bd7615b6f7-f4d4a4aabf.zip b/.yarn/cache/@babel-helper-module-transforms-npm-7.22.1-bd7615b6f7-f4d4a4aabf.zip new file mode 100644 index 000000000..f69332f46 Binary files /dev/null and b/.yarn/cache/@babel-helper-module-transforms-npm-7.22.1-bd7615b6f7-f4d4a4aabf.zip differ diff --git a/.yarn/cache/@babel-helpers-npm-7.21.5-86b407bd6a-55c2ca9987.zip b/.yarn/cache/@babel-helpers-npm-7.21.5-86b407bd6a-55c2ca9987.zip deleted file mode 100644 index e24cafa15..000000000 Binary files a/.yarn/cache/@babel-helpers-npm-7.21.5-86b407bd6a-55c2ca9987.zip and /dev/null differ diff --git a/.yarn/cache/@babel-helpers-npm-7.22.3-0e890dfceb-fe9bed4b88.zip b/.yarn/cache/@babel-helpers-npm-7.22.3-0e890dfceb-fe9bed4b88.zip new file mode 100644 index 000000000..4985f878e Binary files /dev/null and b/.yarn/cache/@babel-helpers-npm-7.22.3-0e890dfceb-fe9bed4b88.zip differ diff --git a/.yarn/cache/@babel-parser-npm-7.21.8-2fefc717c4-bd71a12bc7.zip b/.yarn/cache/@babel-parser-npm-7.21.8-2fefc717c4-bd71a12bc7.zip deleted file mode 100644 index a337c810c..000000000 Binary files a/.yarn/cache/@babel-parser-npm-7.21.8-2fefc717c4-bd71a12bc7.zip and /dev/null differ diff --git a/.yarn/cache/@babel-parser-npm-7.22.4-32183c89ee-98c5dc2de7.zip b/.yarn/cache/@babel-parser-npm-7.22.4-32183c89ee-98c5dc2de7.zip new file mode 100644 index 000000000..3f9d26342 Binary files /dev/null and b/.yarn/cache/@babel-parser-npm-7.22.4-32183c89ee-98c5dc2de7.zip differ diff --git a/.yarn/cache/@babel-runtime-npm-7.22.3-0fd780f66a-f42e4e8ef5.zip b/.yarn/cache/@babel-runtime-npm-7.22.3-0fd780f66a-f42e4e8ef5.zip new file mode 100644 index 000000000..788b12cc2 Binary files /dev/null and b/.yarn/cache/@babel-runtime-npm-7.22.3-0fd780f66a-f42e4e8ef5.zip differ diff --git a/.yarn/cache/@babel-template-npm-7.20.7-c157fc5838-a655fb476b.zip b/.yarn/cache/@babel-template-npm-7.20.7-c157fc5838-a655fb476b.zip deleted file mode 100644 index 9d0eea6c1..000000000 Binary files a/.yarn/cache/@babel-template-npm-7.20.7-c157fc5838-a655fb476b.zip and /dev/null differ diff --git a/.yarn/cache/@babel-template-npm-7.21.9-4016aa4c60-c57a31ccba.zip b/.yarn/cache/@babel-template-npm-7.21.9-4016aa4c60-c57a31ccba.zip new file mode 100644 index 000000000..2814d4624 Binary files /dev/null and b/.yarn/cache/@babel-template-npm-7.21.9-4016aa4c60-c57a31ccba.zip differ diff --git a/.yarn/cache/@babel-traverse-npm-7.21.5-1ca322a4d6-b6b54c978a.zip b/.yarn/cache/@babel-traverse-npm-7.21.5-1ca322a4d6-b6b54c978a.zip deleted file mode 100644 index 36f794b5a..000000000 Binary files a/.yarn/cache/@babel-traverse-npm-7.21.5-1ca322a4d6-b6b54c978a.zip and /dev/null differ diff --git a/.yarn/cache/@babel-traverse-npm-7.22.4-7501c8e8f8-9e1d2d08f4.zip b/.yarn/cache/@babel-traverse-npm-7.22.4-7501c8e8f8-9e1d2d08f4.zip new file mode 100644 index 000000000..925750144 Binary files /dev/null and b/.yarn/cache/@babel-traverse-npm-7.22.4-7501c8e8f8-9e1d2d08f4.zip differ diff --git a/.yarn/cache/@babel-types-npm-7.21.5-3c8c157928-779c3c9552.zip b/.yarn/cache/@babel-types-npm-7.21.5-3c8c157928-779c3c9552.zip deleted file mode 100644 index b29eea0a7..000000000 Binary files a/.yarn/cache/@babel-types-npm-7.21.5-3c8c157928-779c3c9552.zip and /dev/null differ diff --git a/.yarn/cache/@babel-types-npm-7.22.4-7dadf03e9d-17c986be01.zip b/.yarn/cache/@babel-types-npm-7.22.4-7dadf03e9d-17c986be01.zip new file mode 100644 index 000000000..5ea9df3e6 Binary files /dev/null and b/.yarn/cache/@babel-types-npm-7.22.4-7dadf03e9d-17c986be01.zip differ diff --git a/.yarn/cache/@chevrotain-cst-dts-gen-npm-10.5.0-96bdf6daf3-e690e1e567.zip b/.yarn/cache/@chevrotain-cst-dts-gen-npm-10.5.0-96bdf6daf3-e690e1e567.zip new file mode 100644 index 000000000..8d3051b08 Binary files /dev/null and b/.yarn/cache/@chevrotain-cst-dts-gen-npm-10.5.0-96bdf6daf3-e690e1e567.zip differ diff --git a/.yarn/cache/@chevrotain-gast-npm-10.5.0-c98fd4883a-d0fa1434e0.zip b/.yarn/cache/@chevrotain-gast-npm-10.5.0-c98fd4883a-d0fa1434e0.zip new file mode 100644 index 000000000..7ef1f158a Binary files /dev/null and b/.yarn/cache/@chevrotain-gast-npm-10.5.0-c98fd4883a-d0fa1434e0.zip differ diff --git a/.yarn/cache/@chevrotain-types-npm-10.5.0-29d3508ef3-a12f552399.zip b/.yarn/cache/@chevrotain-types-npm-10.5.0-29d3508ef3-a12f552399.zip new file mode 100644 index 000000000..09ef64a51 Binary files /dev/null and b/.yarn/cache/@chevrotain-types-npm-10.5.0-29d3508ef3-a12f552399.zip differ diff --git a/.yarn/cache/@chevrotain-utils-npm-10.5.0-1c062e1720-b0e5ae2f2c.zip b/.yarn/cache/@chevrotain-utils-npm-10.5.0-1c062e1720-b0e5ae2f2c.zip new file mode 100644 index 000000000..0091016d9 Binary files /dev/null and b/.yarn/cache/@chevrotain-utils-npm-10.5.0-1c062e1720-b0e5ae2f2c.zip differ diff --git a/.yarn/cache/@commitlint-cli-npm-17.6.3-583c622f77-118e138474.zip b/.yarn/cache/@commitlint-cli-npm-17.6.5-1dd10cbe12-9bc387ae28.zip similarity index 88% rename from .yarn/cache/@commitlint-cli-npm-17.6.3-583c622f77-118e138474.zip rename to .yarn/cache/@commitlint-cli-npm-17.6.5-1dd10cbe12-9bc387ae28.zip index 5f7e59f7e..6c4bc3586 100644 Binary files a/.yarn/cache/@commitlint-cli-npm-17.6.3-583c622f77-118e138474.zip and b/.yarn/cache/@commitlint-cli-npm-17.6.5-1dd10cbe12-9bc387ae28.zip differ diff --git a/.yarn/cache/@commitlint-config-conventional-npm-17.6.3-dc84eb5c43-8ebd54fde6.zip b/.yarn/cache/@commitlint-config-conventional-npm-17.6.5-ef8d82de49-e1e74bd1d4.zip similarity index 79% rename from .yarn/cache/@commitlint-config-conventional-npm-17.6.3-dc84eb5c43-8ebd54fde6.zip rename to .yarn/cache/@commitlint-config-conventional-npm-17.6.5-ef8d82de49-e1e74bd1d4.zip index 157e703d0..8f0d41f68 100644 Binary files a/.yarn/cache/@commitlint-config-conventional-npm-17.6.3-dc84eb5c43-8ebd54fde6.zip and b/.yarn/cache/@commitlint-config-conventional-npm-17.6.5-ef8d82de49-e1e74bd1d4.zip differ diff --git a/.yarn/cache/@commitlint-is-ignored-npm-17.6.3-570445525b-a7267396d6.zip b/.yarn/cache/@commitlint-is-ignored-npm-17.6.5-eb9c495070-f0b88f925d.zip similarity index 82% rename from .yarn/cache/@commitlint-is-ignored-npm-17.6.3-570445525b-a7267396d6.zip rename to .yarn/cache/@commitlint-is-ignored-npm-17.6.5-eb9c495070-f0b88f925d.zip index b394e16c1..3342588bd 100644 Binary files a/.yarn/cache/@commitlint-is-ignored-npm-17.6.3-570445525b-a7267396d6.zip and b/.yarn/cache/@commitlint-is-ignored-npm-17.6.5-eb9c495070-f0b88f925d.zip differ diff --git a/.yarn/cache/@commitlint-lint-npm-17.6.3-fbda5b486d-6ba065cf07.zip b/.yarn/cache/@commitlint-lint-npm-17.6.5-4378eb0cdb-16d7ae7f69.zip similarity index 77% rename from .yarn/cache/@commitlint-lint-npm-17.6.3-fbda5b486d-6ba065cf07.zip rename to .yarn/cache/@commitlint-lint-npm-17.6.5-4378eb0cdb-16d7ae7f69.zip index 55f13f0a8..83a19ac27 100644 Binary files a/.yarn/cache/@commitlint-lint-npm-17.6.3-fbda5b486d-6ba065cf07.zip and b/.yarn/cache/@commitlint-lint-npm-17.6.5-4378eb0cdb-16d7ae7f69.zip differ diff --git a/.yarn/cache/@commitlint-parse-npm-17.4.4-0475cff25c-354301638f.zip b/.yarn/cache/@commitlint-parse-npm-17.4.4-0475cff25c-354301638f.zip deleted file mode 100644 index 2fd94c599..000000000 Binary files a/.yarn/cache/@commitlint-parse-npm-17.4.4-0475cff25c-354301638f.zip and /dev/null differ diff --git a/.yarn/cache/@commitlint-parse-npm-17.6.5-af228ed605-017eb4ddd1.zip b/.yarn/cache/@commitlint-parse-npm-17.6.5-af228ed605-017eb4ddd1.zip new file mode 100644 index 000000000..07447ed90 Binary files /dev/null and b/.yarn/cache/@commitlint-parse-npm-17.6.5-af228ed605-017eb4ddd1.zip differ diff --git a/.yarn/cache/@commitlint-rules-npm-17.6.1-50fd353ff2-7e7c552fa9.zip b/.yarn/cache/@commitlint-rules-npm-17.6.5-8317b1f8b5-29ee0da954.zip similarity index 88% rename from .yarn/cache/@commitlint-rules-npm-17.6.1-50fd353ff2-7e7c552fa9.zip rename to .yarn/cache/@commitlint-rules-npm-17.6.5-8317b1f8b5-29ee0da954.zip index 72580451e..72caa749d 100644 Binary files a/.yarn/cache/@commitlint-rules-npm-17.6.1-50fd353ff2-7e7c552fa9.zip and b/.yarn/cache/@commitlint-rules-npm-17.6.5-8317b1f8b5-29ee0da954.zip differ diff --git a/.yarn/cache/@eslint-eslintrc-npm-2.0.2-d308674d86-95c94b88d3.zip b/.yarn/cache/@eslint-eslintrc-npm-2.0.3-531b6e79f7-41c404e8cb.zip similarity index 99% rename from .yarn/cache/@eslint-eslintrc-npm-2.0.2-d308674d86-95c94b88d3.zip rename to .yarn/cache/@eslint-eslintrc-npm-2.0.3-531b6e79f7-41c404e8cb.zip index 6435fa2a7..c9ade8fe9 100644 Binary files a/.yarn/cache/@eslint-eslintrc-npm-2.0.2-d308674d86-95c94b88d3.zip and b/.yarn/cache/@eslint-eslintrc-npm-2.0.3-531b6e79f7-41c404e8cb.zip differ diff --git a/.yarn/cache/@eslint-js-npm-8.39.0-558d35aa2d-731360c47e.zip b/.yarn/cache/@eslint-js-npm-8.41.0-7597c33d09-7f4b1d920b.zip similarity index 88% rename from .yarn/cache/@eslint-js-npm-8.39.0-558d35aa2d-731360c47e.zip rename to .yarn/cache/@eslint-js-npm-8.41.0-7597c33d09-7f4b1d920b.zip index 1cab48c52..21bec34af 100644 Binary files a/.yarn/cache/@eslint-js-npm-8.39.0-558d35aa2d-731360c47e.zip and b/.yarn/cache/@eslint-js-npm-8.41.0-7597c33d09-7f4b1d920b.zip differ diff --git a/.yarn/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip b/.yarn/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip deleted file mode 100644 index d522a27ff..000000000 Binary files a/.yarn/cache/@lerna-lite-cli-npm-2.3.0-8c6403c30f-8bf301d379.zip and /dev/null differ diff --git a/.yarn/cache/@lerna-lite-core-npm-2.3.0-1e82030d81-54a0dc2558.zip b/.yarn/cache/@lerna-lite-core-npm-2.3.0-1e82030d81-54a0dc2558.zip deleted file mode 100644 index 67f1d03f3..000000000 Binary files a/.yarn/cache/@lerna-lite-core-npm-2.3.0-1e82030d81-54a0dc2558.zip and /dev/null differ diff --git a/.yarn/cache/@lerna-lite-filter-packages-npm-2.3.0-9c6f43e793-3f943deb39.zip b/.yarn/cache/@lerna-lite-filter-packages-npm-2.4.0-b3f9b1f680-91718a038e.zip similarity index 87% rename from .yarn/cache/@lerna-lite-filter-packages-npm-2.3.0-9c6f43e793-3f943deb39.zip rename to .yarn/cache/@lerna-lite-filter-packages-npm-2.4.0-b3f9b1f680-91718a038e.zip index 901fd5f9a..31b2cd9c2 100644 Binary files a/.yarn/cache/@lerna-lite-filter-packages-npm-2.3.0-9c6f43e793-3f943deb39.zip and b/.yarn/cache/@lerna-lite-filter-packages-npm-2.4.0-b3f9b1f680-91718a038e.zip differ diff --git a/.yarn/cache/@lerna-lite-init-npm-2.3.0-23124918db-f087c5e417.zip b/.yarn/cache/@lerna-lite-init-npm-2.3.0-23124918db-f087c5e417.zip deleted file mode 100644 index b537efe6e..000000000 Binary files a/.yarn/cache/@lerna-lite-init-npm-2.3.0-23124918db-f087c5e417.zip and /dev/null differ diff --git a/.yarn/cache/@lerna-lite-list-npm-2.3.0-d70431a5a3-1f3f62fa07.zip b/.yarn/cache/@lerna-lite-list-npm-2.4.0-e8f076a193-73748b74a9.zip similarity index 83% rename from .yarn/cache/@lerna-lite-list-npm-2.3.0-d70431a5a3-1f3f62fa07.zip rename to .yarn/cache/@lerna-lite-list-npm-2.4.0-e8f076a193-73748b74a9.zip index 1b488e804..c3609cd41 100644 Binary files a/.yarn/cache/@lerna-lite-list-npm-2.3.0-d70431a5a3-1f3f62fa07.zip and b/.yarn/cache/@lerna-lite-list-npm-2.4.0-e8f076a193-73748b74a9.zip differ diff --git a/.yarn/cache/@lerna-lite-listable-npm-2.3.0-bad0f58ba4-bb096246d9.zip b/.yarn/cache/@lerna-lite-listable-npm-2.4.0-1a26bf12f1-11e10c2a6e.zip similarity index 76% rename from .yarn/cache/@lerna-lite-listable-npm-2.3.0-bad0f58ba4-bb096246d9.zip rename to .yarn/cache/@lerna-lite-listable-npm-2.4.0-1a26bf12f1-11e10c2a6e.zip index 93933f907..f071e79ad 100644 Binary files a/.yarn/cache/@lerna-lite-listable-npm-2.3.0-bad0f58ba4-bb096246d9.zip and b/.yarn/cache/@lerna-lite-listable-npm-2.4.0-1a26bf12f1-11e10c2a6e.zip differ diff --git a/.yarn/cache/@lerna-lite-profiler-npm-2.3.0-62a2755663-bd55c4c2ce.zip b/.yarn/cache/@lerna-lite-profiler-npm-2.4.0-3cd0b87020-76330c00c9.zip similarity index 80% rename from .yarn/cache/@lerna-lite-profiler-npm-2.3.0-62a2755663-bd55c4c2ce.zip rename to .yarn/cache/@lerna-lite-profiler-npm-2.4.0-3cd0b87020-76330c00c9.zip index b6a833a28..f4e4f9044 100644 Binary files a/.yarn/cache/@lerna-lite-profiler-npm-2.3.0-62a2755663-bd55c4c2ce.zip and b/.yarn/cache/@lerna-lite-profiler-npm-2.4.0-3cd0b87020-76330c00c9.zip differ diff --git a/.yarn/cache/@lerna-lite-run-npm-2.3.0-b7082df028-332634708d.zip b/.yarn/cache/@lerna-lite-run-npm-2.4.0-5d35434245-cb03607392.zip similarity index 89% rename from .yarn/cache/@lerna-lite-run-npm-2.3.0-b7082df028-332634708d.zip rename to .yarn/cache/@lerna-lite-run-npm-2.4.0-5d35434245-cb03607392.zip index cb2311b47..84525efae 100644 Binary files a/.yarn/cache/@lerna-lite-run-npm-2.3.0-b7082df028-332634708d.zip and b/.yarn/cache/@lerna-lite-run-npm-2.4.0-5d35434245-cb03607392.zip differ diff --git a/.yarn/cache/@lerna-lite-version-npm-2.3.0-cd148d07cc-3b59519c01.zip b/.yarn/cache/@lerna-lite-version-npm-2.3.0-cd148d07cc-3b59519c01.zip deleted file mode 100644 index f4b4a3f4d..000000000 Binary files a/.yarn/cache/@lerna-lite-version-npm-2.3.0-cd148d07cc-3b59519c01.zip and /dev/null differ diff --git a/.yarn/cache/@mrleebo-prisma-ast-npm-0.5.2-538c9d793e-69a7f3c188.zip b/.yarn/cache/@mrleebo-prisma-ast-npm-0.5.2-538c9d793e-69a7f3c188.zip new file mode 100644 index 000000000..9dfa5b6bc Binary files /dev/null and b/.yarn/cache/@mrleebo-prisma-ast-npm-0.5.2-538c9d793e-69a7f3c188.zip differ diff --git a/.yarn/cache/@npmcli-run-script-npm-6.0.1-6f91090d19-97a944045a.zip b/.yarn/cache/@npmcli-run-script-npm-6.0.1-6f91090d19-97a944045a.zip deleted file mode 100644 index f39b47eb8..000000000 Binary files a/.yarn/cache/@npmcli-run-script-npm-6.0.1-6f91090d19-97a944045a.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-core-npm-4.2.0-0f3a7f3979-19e6914cf8.zip b/.yarn/cache/@octokit-core-npm-4.2.0-0f3a7f3979-19e6914cf8.zip deleted file mode 100644 index 310ab8cd7..000000000 Binary files a/.yarn/cache/@octokit-core-npm-4.2.0-0f3a7f3979-19e6914cf8.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-graphql-npm-5.0.5-0534ea7757-c16cc2a2ed.zip b/.yarn/cache/@octokit-graphql-npm-5.0.5-0534ea7757-c16cc2a2ed.zip deleted file mode 100644 index 1a23f75b4..000000000 Binary files a/.yarn/cache/@octokit-graphql-npm-5.0.5-0534ea7757-c16cc2a2ed.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-graphql-npm-5.0.6-26fb5b6074-532c5aa6b8.zip b/.yarn/cache/@octokit-graphql-npm-5.0.6-26fb5b6074-532c5aa6b8.zip new file mode 100644 index 000000000..81bfe03ec Binary files /dev/null and b/.yarn/cache/@octokit-graphql-npm-5.0.6-26fb5b6074-532c5aa6b8.zip differ diff --git a/.yarn/cache/@octokit-openapi-types-npm-17.1.1-af436862ac-17c7992dc7.zip b/.yarn/cache/@octokit-openapi-types-npm-17.1.1-af436862ac-17c7992dc7.zip deleted file mode 100644 index 9451d530b..000000000 Binary files a/.yarn/cache/@octokit-openapi-types-npm-17.1.1-af436862ac-17c7992dc7.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-plugin-paginate-rest-npm-6.0.0-ccfed9f0b1-6b28bb329c.zip b/.yarn/cache/@octokit-plugin-paginate-rest-npm-6.0.0-ccfed9f0b1-6b28bb329c.zip deleted file mode 100644 index 541540207..000000000 Binary files a/.yarn/cache/@octokit-plugin-paginate-rest-npm-6.0.0-ccfed9f0b1-6b28bb329c.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-0eddc079cb.zip b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-0eddc079cb.zip deleted file mode 100644 index 69f3e44dc..000000000 Binary files a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-0eddc079cb.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-request-npm-6.2.3-1b72fec7bb-d70a57f897.zip b/.yarn/cache/@octokit-request-npm-6.2.3-1b72fec7bb-d70a57f897.zip deleted file mode 100644 index 1c5bd15fe..000000000 Binary files a/.yarn/cache/@octokit-request-npm-6.2.3-1b72fec7bb-d70a57f897.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-request-npm-6.2.5-0f92dfe7f9-0d1ba3c7e3.zip b/.yarn/cache/@octokit-request-npm-6.2.5-0f92dfe7f9-0d1ba3c7e3.zip new file mode 100644 index 000000000..3319a37ad Binary files /dev/null and b/.yarn/cache/@octokit-request-npm-6.2.5-0f92dfe7f9-0d1ba3c7e3.zip differ diff --git a/.yarn/cache/@octokit-rest-npm-19.0.7-f05ed3b2ee-32f2d756e1.zip b/.yarn/cache/@octokit-rest-npm-19.0.7-f05ed3b2ee-32f2d756e1.zip deleted file mode 100644 index 4a08f7445..000000000 Binary files a/.yarn/cache/@octokit-rest-npm-19.0.7-f05ed3b2ee-32f2d756e1.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-types-npm-9.2.1-b55f39cc91-dc13c05e78.zip b/.yarn/cache/@octokit-types-npm-9.2.1-b55f39cc91-dc13c05e78.zip deleted file mode 100644 index 11dd25f0d..000000000 Binary files a/.yarn/cache/@octokit-types-npm-9.2.1-b55f39cc91-dc13c05e78.zip and /dev/null differ diff --git a/.yarn/cache/@sindresorhus-is-npm-5.3.0-9deec66459-f43c7625f3.zip b/.yarn/cache/@sindresorhus-is-npm-5.3.0-9deec66459-f43c7625f3.zip deleted file mode 100644 index 26b26f68a..000000000 Binary files a/.yarn/cache/@sindresorhus-is-npm-5.3.0-9deec66459-f43c7625f3.zip and /dev/null differ diff --git a/.yarn/cache/@sindresorhus-is-npm-5.4.0-d6eb7bf6eb-972a33ba22.zip b/.yarn/cache/@sindresorhus-is-npm-5.4.0-d6eb7bf6eb-972a33ba22.zip new file mode 100644 index 000000000..b97708d65 Binary files /dev/null and b/.yarn/cache/@sindresorhus-is-npm-5.4.0-d6eb7bf6eb-972a33ba22.zip differ diff --git a/.yarn/cache/@sinonjs-commons-npm-2.0.0-3716f24f20-c0781f895a.zip b/.yarn/cache/@sinonjs-commons-npm-3.0.0-fa72ff71a1-7cf247acf4.zip similarity index 87% rename from .yarn/cache/@sinonjs-commons-npm-2.0.0-3716f24f20-c0781f895a.zip rename to .yarn/cache/@sinonjs-commons-npm-3.0.0-fa72ff71a1-7cf247acf4.zip index 27b3e9e5a..40c9479f0 100644 Binary files a/.yarn/cache/@sinonjs-commons-npm-2.0.0-3716f24f20-c0781f895a.zip and b/.yarn/cache/@sinonjs-commons-npm-3.0.0-fa72ff71a1-7cf247acf4.zip differ diff --git a/.yarn/cache/@sinonjs-fake-timers-npm-10.0.2-c5fa80f1cc-71871b8698.zip b/.yarn/cache/@sinonjs-fake-timers-npm-10.0.2-c5fa80f1cc-71871b8698.zip deleted file mode 100644 index 132d8769d..000000000 Binary files a/.yarn/cache/@sinonjs-fake-timers-npm-10.0.2-c5fa80f1cc-71871b8698.zip and /dev/null differ diff --git a/.yarn/cache/@sinonjs-fake-timers-npm-10.2.0-cc1159e8aa-07348f4aae.zip b/.yarn/cache/@sinonjs-fake-timers-npm-10.2.0-cc1159e8aa-07348f4aae.zip new file mode 100644 index 000000000..ecd9f83b4 Binary files /dev/null and b/.yarn/cache/@sinonjs-fake-timers-npm-10.2.0-cc1159e8aa-07348f4aae.zip differ diff --git a/.yarn/cache/@smithy-protocol-http-npm-1.0.1-7acb4f139f-489ef06e88.zip b/.yarn/cache/@smithy-protocol-http-npm-1.0.1-7acb4f139f-489ef06e88.zip new file mode 100644 index 000000000..022150ec3 Binary files /dev/null and b/.yarn/cache/@smithy-protocol-http-npm-1.0.1-7acb4f139f-489ef06e88.zip differ diff --git a/.yarn/cache/@smithy-types-npm-1.0.0-79a6ff2b27-d034933aab.zip b/.yarn/cache/@smithy-types-npm-1.0.0-79a6ff2b27-d034933aab.zip new file mode 100644 index 000000000..7c30e0f02 Binary files /dev/null and b/.yarn/cache/@smithy-types-npm-1.0.0-79a6ff2b27-d034933aab.zip differ diff --git a/.yarn/cache/@standardnotes-api-npm-1.26.5-0785e522d1-d2e8d73456.zip b/.yarn/cache/@standardnotes-api-npm-1.26.10-f6165cafd3-3c3561aec8.zip similarity index 83% rename from .yarn/cache/@standardnotes-api-npm-1.26.5-0785e522d1-d2e8d73456.zip rename to .yarn/cache/@standardnotes-api-npm-1.26.10-f6165cafd3-3c3561aec8.zip index e436f04c7..669c84dd5 100644 Binary files a/.yarn/cache/@standardnotes-api-npm-1.26.5-0785e522d1-d2e8d73456.zip and b/.yarn/cache/@standardnotes-api-npm-1.26.10-f6165cafd3-3c3561aec8.zip differ diff --git a/.yarn/cache/@standardnotes-encryption-npm-1.21.33-cf277e08e5-087a72a88e.zip b/.yarn/cache/@standardnotes-encryption-npm-1.21.38-d08c3d4766-1393840523.zip similarity index 82% rename from .yarn/cache/@standardnotes-encryption-npm-1.21.33-cf277e08e5-087a72a88e.zip rename to .yarn/cache/@standardnotes-encryption-npm-1.21.38-d08c3d4766-1393840523.zip index 4fbb6cc00..b6d100e1f 100644 Binary files a/.yarn/cache/@standardnotes-encryption-npm-1.21.33-cf277e08e5-087a72a88e.zip and b/.yarn/cache/@standardnotes-encryption-npm-1.21.38-d08c3d4766-1393840523.zip differ diff --git a/.yarn/cache/@standardnotes-features-npm-1.59.3-420adc3bc8-b6d1fba15b.zip b/.yarn/cache/@standardnotes-features-npm-1.59.3-420adc3bc8-b6d1fba15b.zip deleted file mode 100644 index 4a4f23740..000000000 Binary files a/.yarn/cache/@standardnotes-features-npm-1.59.3-420adc3bc8-b6d1fba15b.zip and /dev/null differ diff --git a/.yarn/cache/@standardnotes-features-npm-1.59.5-83c83acde9-173b1f5d52.zip b/.yarn/cache/@standardnotes-features-npm-1.59.5-83c83acde9-173b1f5d52.zip new file mode 100644 index 000000000..a13185dd8 Binary files /dev/null and b/.yarn/cache/@standardnotes-features-npm-1.59.5-83c83acde9-173b1f5d52.zip differ diff --git a/.yarn/cache/@standardnotes-models-npm-1.45.0-fedf5b3306-dd47c916e9.zip b/.yarn/cache/@standardnotes-models-npm-1.45.5-29326e959c-15f26c11b2.zip similarity index 79% rename from .yarn/cache/@standardnotes-models-npm-1.45.0-fedf5b3306-dd47c916e9.zip rename to .yarn/cache/@standardnotes-models-npm-1.45.5-29326e959c-15f26c11b2.zip index 313252d95..56d415a0b 100644 Binary files a/.yarn/cache/@standardnotes-models-npm-1.45.0-fedf5b3306-dd47c916e9.zip and b/.yarn/cache/@standardnotes-models-npm-1.45.5-29326e959c-15f26c11b2.zip differ diff --git a/.yarn/cache/@standardnotes-responses-npm-1.13.21-90b7bf5e6a-3b0a65b68c.zip b/.yarn/cache/@standardnotes-responses-npm-1.13.24-3b4167c7ea-3bcfee90f0.zip similarity index 60% rename from .yarn/cache/@standardnotes-responses-npm-1.13.21-90b7bf5e6a-3b0a65b68c.zip rename to .yarn/cache/@standardnotes-responses-npm-1.13.24-3b4167c7ea-3bcfee90f0.zip index 52e8ca44f..78dbdf3f2 100644 Binary files a/.yarn/cache/@standardnotes-responses-npm-1.13.21-90b7bf5e6a-3b0a65b68c.zip and b/.yarn/cache/@standardnotes-responses-npm-1.13.24-3b4167c7ea-3bcfee90f0.zip differ diff --git a/.yarn/cache/@tsconfig-node16-npm-1.0.3-6a4a30eda2-4280081089.zip b/.yarn/cache/@tsconfig-node16-npm-1.0.3-6a4a30eda2-4280081089.zip deleted file mode 100644 index 529485cb2..000000000 Binary files a/.yarn/cache/@tsconfig-node16-npm-1.0.3-6a4a30eda2-4280081089.zip and /dev/null differ diff --git a/.yarn/cache/@tsconfig-node16-npm-1.0.4-b7cb87d859-d75e4f7d3e.zip b/.yarn/cache/@tsconfig-node16-npm-1.0.4-b7cb87d859-d75e4f7d3e.zip new file mode 100644 index 000000000..a403a9287 Binary files /dev/null and b/.yarn/cache/@tsconfig-node16-npm-1.0.4-b7cb87d859-d75e4f7d3e.zip differ diff --git a/.yarn/cache/@types-babel__core-npm-7.20.0-cf2ab39970-bf92f75954.zip b/.yarn/cache/@types-babel__core-npm-7.20.0-cf2ab39970-bf92f75954.zip deleted file mode 100644 index 2dd91e17b..000000000 Binary files a/.yarn/cache/@types-babel__core-npm-7.20.0-cf2ab39970-bf92f75954.zip and /dev/null differ diff --git a/.yarn/cache/@types-babel__core-npm-7.20.1-f44761b6b6-49e743a5bf.zip b/.yarn/cache/@types-babel__core-npm-7.20.1-f44761b6b6-49e743a5bf.zip new file mode 100644 index 000000000..7161ee5ac Binary files /dev/null and b/.yarn/cache/@types-babel__core-npm-7.20.1-f44761b6b6-49e743a5bf.zip differ diff --git a/.yarn/cache/@types-babel__traverse-npm-7.18.5-4ee746f3a7-470a501a0d.zip b/.yarn/cache/@types-babel__traverse-npm-7.18.5-4ee746f3a7-470a501a0d.zip deleted file mode 100644 index db3fbd2b9..000000000 Binary files a/.yarn/cache/@types-babel__traverse-npm-7.18.5-4ee746f3a7-470a501a0d.zip and /dev/null differ diff --git a/.yarn/cache/@types-babel__traverse-npm-7.20.0-c5a0b2eb9a-dec5fb642f.zip b/.yarn/cache/@types-babel__traverse-npm-7.20.0-c5a0b2eb9a-dec5fb642f.zip new file mode 100644 index 000000000..2e3563dc2 Binary files /dev/null and b/.yarn/cache/@types-babel__traverse-npm-7.20.0-c5a0b2eb9a-dec5fb642f.zip differ diff --git a/.yarn/cache/@types-debug-npm-4.1.7-f54c81f8db-ba0607de3a.zip b/.yarn/cache/@types-debug-npm-4.1.7-f54c81f8db-ba0607de3a.zip deleted file mode 100644 index 4609b62b7..000000000 Binary files a/.yarn/cache/@types-debug-npm-4.1.7-f54c81f8db-ba0607de3a.zip and /dev/null differ diff --git a/.yarn/cache/@types-debug-npm-4.1.8-a04e2ca136-9c190e8129.zip b/.yarn/cache/@types-debug-npm-4.1.8-a04e2ca136-9c190e8129.zip new file mode 100644 index 000000000..a1a5ffa67 Binary files /dev/null and b/.yarn/cache/@types-debug-npm-4.1.8-a04e2ca136-9c190e8129.zip differ diff --git a/.yarn/cache/@types-eslint-npm-8.37.0-1f765f44f3-5a1b547b4f.zip b/.yarn/cache/@types-eslint-npm-8.40.0-f83ac3705a-64e7807d11.zip similarity index 62% rename from .yarn/cache/@types-eslint-npm-8.37.0-1f765f44f3-5a1b547b4f.zip rename to .yarn/cache/@types-eslint-npm-8.40.0-f83ac3705a-64e7807d11.zip index 4681e97cd..d51c40fdb 100644 Binary files a/.yarn/cache/@types-eslint-npm-8.37.0-1f765f44f3-5a1b547b4f.zip and b/.yarn/cache/@types-eslint-npm-8.40.0-f83ac3705a-64e7807d11.zip differ diff --git a/.yarn/cache/@types-express-serve-static-core-npm-4.17.34-b1081fd10c-db0f42fb7b.zip b/.yarn/cache/@types-express-serve-static-core-npm-4.17.34-b1081fd10c-db0f42fb7b.zip deleted file mode 100644 index 87179fe69..000000000 Binary files a/.yarn/cache/@types-express-serve-static-core-npm-4.17.34-b1081fd10c-db0f42fb7b.zip and /dev/null differ diff --git a/.yarn/cache/@types-express-serve-static-core-npm-4.17.35-c86e5f6e4a-20d48d5792.zip b/.yarn/cache/@types-express-serve-static-core-npm-4.17.35-c86e5f6e4a-20d48d5792.zip new file mode 100644 index 000000000..5908bad2e Binary files /dev/null and b/.yarn/cache/@types-express-serve-static-core-npm-4.17.35-c86e5f6e4a-20d48d5792.zip differ diff --git a/.yarn/cache/@types-jest-npm-29.5.1-0eddfd7e9a-1a67d4fe2d.zip b/.yarn/cache/@types-jest-npm-29.5.1-0eddfd7e9a-1a67d4fe2d.zip deleted file mode 100644 index 96a2b9732..000000000 Binary files a/.yarn/cache/@types-jest-npm-29.5.1-0eddfd7e9a-1a67d4fe2d.zip and /dev/null differ diff --git a/.yarn/cache/@types-jest-npm-29.5.2-1a72e55a50-999a7c560e.zip b/.yarn/cache/@types-jest-npm-29.5.2-1a72e55a50-999a7c560e.zip new file mode 100644 index 000000000..8c6fb082d Binary files /dev/null and b/.yarn/cache/@types-jest-npm-29.5.2-1a72e55a50-999a7c560e.zip differ diff --git a/.yarn/cache/@types-json-schema-npm-7.0.11-79462ae5ca-8e5c6dd393.zip b/.yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-3a4aae29f9.zip similarity index 67% rename from .yarn/cache/@types-json-schema-npm-7.0.11-79462ae5ca-8e5c6dd393.zip rename to .yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-3a4aae29f9.zip index d02bdffd6..70058f6b2 100644 Binary files a/.yarn/cache/@types-json-schema-npm-7.0.11-79462ae5ca-8e5c6dd393.zip and b/.yarn/cache/@types-json-schema-npm-7.0.12-f05cfc0e99-3a4aae29f9.zip differ diff --git a/.yarn/cache/@types-newrelic-npm-9.13.0-a283f22b65-d0269b05c4.zip b/.yarn/cache/@types-newrelic-npm-9.13.0-a283f22b65-d0269b05c4.zip deleted file mode 100644 index aa1dbce1c..000000000 Binary files a/.yarn/cache/@types-newrelic-npm-9.13.0-a283f22b65-d0269b05c4.zip and /dev/null differ diff --git a/.yarn/cache/@types-newrelic-npm-9.14.0-4668da51a1-2ec951bd8f.zip b/.yarn/cache/@types-newrelic-npm-9.14.0-4668da51a1-2ec951bd8f.zip new file mode 100644 index 000000000..4b958a60a Binary files /dev/null and b/.yarn/cache/@types-newrelic-npm-9.14.0-4668da51a1-2ec951bd8f.zip differ diff --git a/.yarn/cache/@types-node-npm-18.16.4-9852dff702-a7a5662d65.zip b/.yarn/cache/@types-node-npm-18.16.16-8a41330dc3-946bd4d8e6.zip similarity index 74% rename from .yarn/cache/@types-node-npm-18.16.4-9852dff702-a7a5662d65.zip rename to .yarn/cache/@types-node-npm-18.16.16-8a41330dc3-946bd4d8e6.zip index 265f1d626..87add21e7 100644 Binary files a/.yarn/cache/@types-node-npm-18.16.4-9852dff702-a7a5662d65.zip and b/.yarn/cache/@types-node-npm-18.16.16-8a41330dc3-946bd4d8e6.zip differ diff --git a/.yarn/cache/@types-node-npm-20.1.0-c5561d67cd-299fe2b032.zip b/.yarn/cache/@types-node-npm-20.1.0-c5561d67cd-299fe2b032.zip deleted file mode 100644 index 82d9c6580..000000000 Binary files a/.yarn/cache/@types-node-npm-20.1.0-c5561d67cd-299fe2b032.zip and /dev/null differ diff --git a/.yarn/cache/@types-nodemailer-npm-6.4.7-8618621ba9-4fefece349.zip b/.yarn/cache/@types-nodemailer-npm-6.4.8-04975b93f9-8febb43b8a.zip similarity index 75% rename from .yarn/cache/@types-nodemailer-npm-6.4.7-8618621ba9-4fefece349.zip rename to .yarn/cache/@types-nodemailer-npm-6.4.8-04975b93f9-8febb43b8a.zip index a95747c5d..3b7d795e4 100644 Binary files a/.yarn/cache/@types-nodemailer-npm-6.4.7-8618621ba9-4fefece349.zip and b/.yarn/cache/@types-nodemailer-npm-6.4.8-04975b93f9-8febb43b8a.zip differ diff --git a/.yarn/cache/@types-prettier-npm-2.7.2-6b2e2f518f-d4d09d291e.zip b/.yarn/cache/@types-prettier-npm-2.7.2-6b2e2f518f-d4d09d291e.zip deleted file mode 100644 index 84b2284ed..000000000 Binary files a/.yarn/cache/@types-prettier-npm-2.7.2-6b2e2f518f-d4d09d291e.zip and /dev/null differ diff --git a/.yarn/cache/@types-prettier-npm-2.7.3-497316f37c-940c06437f.zip b/.yarn/cache/@types-prettier-npm-2.7.3-497316f37c-940c06437f.zip new file mode 100644 index 000000000..5154db5d5 Binary files /dev/null and b/.yarn/cache/@types-prettier-npm-2.7.3-497316f37c-940c06437f.zip differ diff --git a/.yarn/cache/@types-semver-npm-7.3.13-56212b60da-a76156ff60.zip b/.yarn/cache/@types-semver-npm-7.5.0-4823ff34be-dac255fae6.zip similarity index 63% rename from .yarn/cache/@types-semver-npm-7.3.13-56212b60da-a76156ff60.zip rename to .yarn/cache/@types-semver-npm-7.5.0-4823ff34be-dac255fae6.zip index eb8e92610..1aa3ea150 100644 Binary files a/.yarn/cache/@types-semver-npm-7.3.13-56212b60da-a76156ff60.zip and b/.yarn/cache/@types-semver-npm-7.5.0-4823ff34be-dac255fae6.zip differ diff --git a/.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.2-ac649dc670-777969bdcc.zip b/.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.8-255dbedf93-47fb031799.zip similarity index 96% rename from .yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.2-ac649dc670-777969bdcc.zip rename to .yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.8-255dbedf93-47fb031799.zip index 9fb0e1bb4..ef73dabd9 100644 Binary files a/.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.2-ac649dc670-777969bdcc.zip and b/.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.59.8-255dbedf93-47fb031799.zip differ diff --git a/.yarn/cache/@typescript-eslint-parser-npm-5.59.2-74b298efa1-86d9a46672.zip b/.yarn/cache/@typescript-eslint-parser-npm-5.59.8-ceb8b0eaa0-e912585cf3.zip similarity index 79% rename from .yarn/cache/@typescript-eslint-parser-npm-5.59.2-74b298efa1-86d9a46672.zip rename to .yarn/cache/@typescript-eslint-parser-npm-5.59.8-ceb8b0eaa0-e912585cf3.zip index acf24cc48..5898ebbac 100644 Binary files a/.yarn/cache/@typescript-eslint-parser-npm-5.59.2-74b298efa1-86d9a46672.zip and b/.yarn/cache/@typescript-eslint-parser-npm-5.59.8-ceb8b0eaa0-e912585cf3.zip differ diff --git a/.yarn/cache/@typescript-eslint-scope-manager-npm-5.59.2-d06d5664e0-4cd52a2f00.zip b/.yarn/cache/@typescript-eslint-scope-manager-npm-5.59.8-d925c50275-e561598f5c.zip similarity index 90% rename from .yarn/cache/@typescript-eslint-scope-manager-npm-5.59.2-d06d5664e0-4cd52a2f00.zip rename to .yarn/cache/@typescript-eslint-scope-manager-npm-5.59.8-d925c50275-e561598f5c.zip index aff801923..0809bd198 100644 Binary files a/.yarn/cache/@typescript-eslint-scope-manager-npm-5.59.2-d06d5664e0-4cd52a2f00.zip and b/.yarn/cache/@typescript-eslint-scope-manager-npm-5.59.8-d925c50275-e561598f5c.zip differ diff --git a/.yarn/cache/@typescript-eslint-type-utils-npm-5.59.2-144edc1eaa-bc3aa3e29b.zip b/.yarn/cache/@typescript-eslint-type-utils-npm-5.59.8-61b85480e4-a2add3cf3f.zip similarity index 95% rename from .yarn/cache/@typescript-eslint-type-utils-npm-5.59.2-144edc1eaa-bc3aa3e29b.zip rename to .yarn/cache/@typescript-eslint-type-utils-npm-5.59.8-61b85480e4-a2add3cf3f.zip index 57abbeae0..3aa2a22f1 100644 Binary files a/.yarn/cache/@typescript-eslint-type-utils-npm-5.59.2-144edc1eaa-bc3aa3e29b.zip and b/.yarn/cache/@typescript-eslint-type-utils-npm-5.59.8-61b85480e4-a2add3cf3f.zip differ diff --git a/.yarn/cache/@typescript-eslint-types-npm-5.59.2-09958c5a9f-4d565653b8.zip b/.yarn/cache/@typescript-eslint-types-npm-5.59.8-aac9636f23-d92f641719.zip similarity index 92% rename from .yarn/cache/@typescript-eslint-types-npm-5.59.2-09958c5a9f-4d565653b8.zip rename to .yarn/cache/@typescript-eslint-types-npm-5.59.8-aac9636f23-d92f641719.zip index 53f99ad8c..2c85c2e88 100644 Binary files a/.yarn/cache/@typescript-eslint-types-npm-5.59.2-09958c5a9f-4d565653b8.zip and b/.yarn/cache/@typescript-eslint-types-npm-5.59.8-aac9636f23-d92f641719.zip differ diff --git a/.yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.2-13171b9290-01f7a9abb9.zip b/.yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.8-8d25500a8f-94f08e72ba.zip similarity index 94% rename from .yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.2-13171b9290-01f7a9abb9.zip rename to .yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.8-8d25500a8f-94f08e72ba.zip index 78e98ef2b..24ea6b45e 100644 Binary files a/.yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.2-13171b9290-01f7a9abb9.zip and b/.yarn/cache/@typescript-eslint-typescript-estree-npm-5.59.8-8d25500a8f-94f08e72ba.zip differ diff --git a/.yarn/cache/@typescript-eslint-utils-npm-5.59.2-6eb4bb6d5c-18d221a1ed.zip b/.yarn/cache/@typescript-eslint-utils-npm-5.59.8-24495aa535-814d79eeb5.zip similarity index 92% rename from .yarn/cache/@typescript-eslint-utils-npm-5.59.2-6eb4bb6d5c-18d221a1ed.zip rename to .yarn/cache/@typescript-eslint-utils-npm-5.59.8-24495aa535-814d79eeb5.zip index 62c8f3685..204c78acd 100644 Binary files a/.yarn/cache/@typescript-eslint-utils-npm-5.59.2-6eb4bb6d5c-18d221a1ed.zip and b/.yarn/cache/@typescript-eslint-utils-npm-5.59.8-24495aa535-814d79eeb5.zip differ diff --git a/.yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.2-c61569dee5-de546e6677.zip b/.yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.8-bd7eb812d7-859bf38ac7.zip similarity index 81% rename from .yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.2-c61569dee5-de546e6677.zip rename to .yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.8-bd7eb812d7-859bf38ac7.zip index 8365c6196..cdb049645 100644 Binary files a/.yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.2-c61569dee5-de546e6677.zip and b/.yarn/cache/@typescript-eslint-visitor-keys-npm-5.59.8-bd7eb812d7-859bf38ac7.zip differ diff --git a/.yarn/cache/@webassemblyjs-ast-npm-1.11.5-ad883e230f-c8b88cb98c.zip b/.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-8d376b04d2.zip similarity index 97% rename from .yarn/cache/@webassemblyjs-ast-npm-1.11.5-ad883e230f-c8b88cb98c.zip rename to .yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-8d376b04d2.zip index 9ef4d30dd..b7ae441d1 100644 Binary files a/.yarn/cache/@webassemblyjs-ast-npm-1.11.5-ad883e230f-c8b88cb98c.zip and b/.yarn/cache/@webassemblyjs-ast-npm-1.11.6-d3fd2bb49a-8d376b04d2.zip differ diff --git a/.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.5-01ff4bf952-0fd24f6feb.zip b/.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-574a1b5daf.zip similarity index 94% rename from .yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.5-01ff4bf952-0fd24f6feb.zip rename to .yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-574a1b5daf.zip index 0b633b4a3..8880d28c0 100644 Binary files a/.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.5-01ff4bf952-0fd24f6feb.zip and b/.yarn/cache/@webassemblyjs-floating-point-hex-parser-npm-1.11.6-3a9928fc76-574a1b5daf.zip differ diff --git a/.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.5-553acf3c94-b8047772c5.zip b/.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-b5302eee13.zip similarity index 92% rename from .yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.5-553acf3c94-b8047772c5.zip rename to .yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-b5302eee13.zip index 7f8e5569b..6b7385a55 100644 Binary files a/.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.5-553acf3c94-b8047772c5.zip and b/.yarn/cache/@webassemblyjs-helper-api-error-npm-1.11.6-75f6275ff4-b5302eee13.zip differ diff --git a/.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.5-76356c5b6d-010b11dbef.zip b/.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b9536a8f5f.zip similarity index 68% rename from .yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.5-76356c5b6d-010b11dbef.zip rename to .yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b9536a8f5f.zip index af50568e1..531d90be4 100644 Binary files a/.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.5-76356c5b6d-010b11dbef.zip and b/.yarn/cache/@webassemblyjs-helper-buffer-npm-1.11.6-69996544b0-b9536a8f5f.zip differ diff --git a/.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.5-efa2500e8e-bff0ef813d.zip b/.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-a1f6b9db54.zip similarity index 64% rename from .yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.5-efa2500e8e-bff0ef813d.zip rename to .yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-a1f6b9db54.zip index 86f2ca0fc..3c4609fb3 100644 Binary files a/.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.5-efa2500e8e-bff0ef813d.zip and b/.yarn/cache/@webassemblyjs-helper-numbers-npm-1.11.6-819ddab1da-a1f6b9db54.zip differ diff --git a/.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.5-2f1be836c6-33a9f88a0b.zip b/.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-2563ee4cdc.zip similarity index 95% rename from .yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.5-2f1be836c6-33a9f88a0b.zip rename to .yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-2563ee4cdc.zip index a7b32072d..efa9bb36a 100644 Binary files a/.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.5-2f1be836c6-33a9f88a0b.zip and b/.yarn/cache/@webassemblyjs-helper-wasm-bytecode-npm-1.11.6-3bc23747de-2563ee4cdc.zip differ diff --git a/.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.5-b74ded6c5d-d6204a24e7.zip b/.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-0edb6fff2b.zip similarity index 96% rename from .yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.5-b74ded6c5d-d6204a24e7.zip rename to .yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-0edb6fff2b.zip index 70e34a5e6..ce4685546 100644 Binary files a/.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.5-b74ded6c5d-d6204a24e7.zip and b/.yarn/cache/@webassemblyjs-helper-wasm-section-npm-1.11.6-344f8ff2af-0edb6fff2b.zip differ diff --git a/.yarn/cache/@webassemblyjs-ieee754-npm-1.11.5-42a1b795b4-111a10e446.zip b/.yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-2f17b3d8bd.zip similarity index 55% rename from .yarn/cache/@webassemblyjs-ieee754-npm-1.11.5-42a1b795b4-111a10e446.zip rename to .yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-2f17b3d8bd.zip index e22c78bd9..c0fc718e6 100644 Binary files a/.yarn/cache/@webassemblyjs-ieee754-npm-1.11.5-42a1b795b4-111a10e446.zip and b/.yarn/cache/@webassemblyjs-ieee754-npm-1.11.6-95c92f446a-2f17b3d8bd.zip differ diff --git a/.yarn/cache/@webassemblyjs-leb128-npm-1.11.5-7e82c71f81-0e2cd55445.zip b/.yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-10edfc6b7e.zip similarity index 93% rename from .yarn/cache/@webassemblyjs-leb128-npm-1.11.5-7e82c71f81-0e2cd55445.zip rename to .yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-10edfc6b7e.zip index cdb24f92f..60dd6315c 100644 Binary files a/.yarn/cache/@webassemblyjs-leb128-npm-1.11.5-7e82c71f81-0e2cd55445.zip and b/.yarn/cache/@webassemblyjs-leb128-npm-1.11.6-697d62da2e-10edfc6b7e.zip differ diff --git a/.yarn/cache/@webassemblyjs-utf8-npm-1.11.5-775c246fbf-8f1ab885c6.zip b/.yarn/cache/@webassemblyjs-utf8-npm-1.11.5-775c246fbf-8f1ab885c6.zip deleted file mode 100644 index 528e0898b..000000000 Binary files a/.yarn/cache/@webassemblyjs-utf8-npm-1.11.5-775c246fbf-8f1ab885c6.zip and /dev/null differ diff --git a/.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-6fa95283a6.zip b/.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-6fa95283a6.zip new file mode 100644 index 000000000..ebdbeaace Binary files /dev/null and b/.yarn/cache/@webassemblyjs-utf8-npm-1.11.6-102c4e5d68-6fa95283a6.zip differ diff --git a/.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.5-9643f15610-34b9ec8beb.zip b/.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-66831a6ad2.zip similarity index 97% rename from .yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.5-9643f15610-34b9ec8beb.zip rename to .yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-66831a6ad2.zip index 5367b5a61..7b008bcc5 100644 Binary files a/.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.5-9643f15610-34b9ec8beb.zip and b/.yarn/cache/@webassemblyjs-wasm-edit-npm-1.11.6-8d2703f828-66831a6ad2.zip differ diff --git a/.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.5-a3a569938d-889c804f48.zip b/.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-a4746a13ce.zip similarity index 78% rename from .yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.5-a3a569938d-889c804f48.zip rename to .yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-a4746a13ce.zip index 94894149a..17aefde83 100644 Binary files a/.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.5-a3a569938d-889c804f48.zip and b/.yarn/cache/@webassemblyjs-wasm-gen-npm-1.11.6-0ca036cab0-a4746a13ce.zip differ diff --git a/.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.5-efd2b45433-af4ab63fab.zip b/.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-aa9fc4f9cd.zip similarity index 94% rename from .yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.5-efd2b45433-af4ab63fab.zip rename to .yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-aa9fc4f9cd.zip index a24b116a3..adb973dfb 100644 Binary files a/.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.5-efd2b45433-af4ab63fab.zip and b/.yarn/cache/@webassemblyjs-wasm-opt-npm-1.11.6-8be3443975-aa9fc4f9cd.zip differ diff --git a/.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.5-c3794b38b2-a7f20c9a9c.zip b/.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-22984aafc0.zip similarity index 90% rename from .yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.5-c3794b38b2-a7f20c9a9c.zip rename to .yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-22984aafc0.zip index 2f49fa10b..5d0f83b8a 100644 Binary files a/.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.5-c3794b38b2-a7f20c9a9c.zip and b/.yarn/cache/@webassemblyjs-wasm-parser-npm-1.11.6-88e2433c21-22984aafc0.zip differ diff --git a/.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.5-b5f768e688-ffca102c33.zip b/.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-5e797fe94d.zip similarity index 85% rename from .yarn/cache/@webassemblyjs-wast-printer-npm-1.11.5-b5f768e688-ffca102c33.zip rename to .yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-5e797fe94d.zip index a1dd9dfff..ecc642b20 100644 Binary files a/.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.5-b5f768e688-ffca102c33.zip and b/.yarn/cache/@webassemblyjs-wast-printer-npm-1.11.6-3191861e3f-5e797fe94d.zip differ diff --git a/.yarn/cache/acorn-import-assertions-npm-1.8.0-e9a9d57e27-7963bf636b.zip b/.yarn/cache/acorn-import-assertions-npm-1.8.0-e9a9d57e27-7963bf636b.zip deleted file mode 100644 index 56782bb6a..000000000 Binary files a/.yarn/cache/acorn-import-assertions-npm-1.8.0-e9a9d57e27-7963bf636b.zip and /dev/null differ diff --git a/.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-acfc128938.zip b/.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-acfc128938.zip new file mode 100644 index 000000000..7b50f1970 Binary files /dev/null and b/.yarn/cache/acorn-import-assertions-npm-1.9.0-22f56507c7-acfc128938.zip differ diff --git a/.yarn/cache/boxen-npm-7.0.2-f9b4d11ba9-842bde7829.zip b/.yarn/cache/boxen-npm-7.0.2-f9b4d11ba9-842bde7829.zip deleted file mode 100644 index 457547ce0..000000000 Binary files a/.yarn/cache/boxen-npm-7.0.2-f9b4d11ba9-842bde7829.zip and /dev/null differ diff --git a/.yarn/cache/boxen-npm-7.1.0-621131dc92-9f7632f55f.zip b/.yarn/cache/boxen-npm-7.1.0-621131dc92-9f7632f55f.zip new file mode 100644 index 000000000..65823bbb2 Binary files /dev/null and b/.yarn/cache/boxen-npm-7.1.0-621131dc92-9f7632f55f.zip differ diff --git a/.yarn/cache/browserslist-npm-4.21.5-e3b9e9d029-66c055357f.zip b/.yarn/cache/browserslist-npm-4.21.5-e3b9e9d029-66c055357f.zip deleted file mode 100644 index 1db129f83..000000000 Binary files a/.yarn/cache/browserslist-npm-4.21.5-e3b9e9d029-66c055357f.zip and /dev/null differ diff --git a/.yarn/cache/browserslist-npm-4.21.7-36caf91554-53860c8ab8.zip b/.yarn/cache/browserslist-npm-4.21.7-36caf91554-53860c8ab8.zip new file mode 100644 index 000000000..710b6cb1f Binary files /dev/null and b/.yarn/cache/browserslist-npm-4.21.7-36caf91554-53860c8ab8.zip differ diff --git a/.yarn/cache/cacache-npm-17.1.0-122252b60e-8b86bdcd40.zip b/.yarn/cache/cacache-npm-17.1.0-122252b60e-8b86bdcd40.zip deleted file mode 100644 index b66757baf..000000000 Binary files a/.yarn/cache/cacache-npm-17.1.0-122252b60e-8b86bdcd40.zip and /dev/null differ diff --git a/.yarn/cache/caniuse-lite-npm-1.0.30001482-266bfb6271-73e24665e8.zip b/.yarn/cache/caniuse-lite-npm-1.0.30001482-266bfb6271-73e24665e8.zip deleted file mode 100644 index 2794c54e0..000000000 Binary files a/.yarn/cache/caniuse-lite-npm-1.0.30001482-266bfb6271-73e24665e8.zip and /dev/null differ diff --git a/.yarn/cache/caniuse-lite-npm-1.0.30001492-90c5710f02-216895408d.zip b/.yarn/cache/caniuse-lite-npm-1.0.30001492-90c5710f02-216895408d.zip new file mode 100644 index 000000000..9a65bbe40 Binary files /dev/null and b/.yarn/cache/caniuse-lite-npm-1.0.30001492-90c5710f02-216895408d.zip differ diff --git a/.yarn/cache/cbor-x-npm-1.5.2-5d9e919527-366e1caaa1.zip b/.yarn/cache/cbor-x-npm-1.5.2-5d9e919527-366e1caaa1.zip deleted file mode 100644 index e67b3b334..000000000 Binary files a/.yarn/cache/cbor-x-npm-1.5.2-5d9e919527-366e1caaa1.zip and /dev/null differ diff --git a/.yarn/cache/cbor-x-npm-1.5.3-1d452dd267-d4df85b339.zip b/.yarn/cache/cbor-x-npm-1.5.3-1d452dd267-d4df85b339.zip new file mode 100644 index 000000000..e4968da16 Binary files /dev/null and b/.yarn/cache/cbor-x-npm-1.5.3-1d452dd267-d4df85b339.zip differ diff --git a/.yarn/cache/chevrotain-npm-10.5.0-1ff4e87f41-06229e2617.zip b/.yarn/cache/chevrotain-npm-10.5.0-1ff4e87f41-06229e2617.zip new file mode 100644 index 000000000..4f7fc93ed Binary files /dev/null and b/.yarn/cache/chevrotain-npm-10.5.0-1ff4e87f41-06229e2617.zip differ diff --git a/.yarn/cache/cross-fetch-npm-3.1.5-e414995db9-83fa7b1318.zip b/.yarn/cache/cross-fetch-npm-3.1.6-cdb982d446-a8989fca82.zip similarity index 52% rename from .yarn/cache/cross-fetch-npm-3.1.5-e414995db9-83fa7b1318.zip rename to .yarn/cache/cross-fetch-npm-3.1.6-cdb982d446-a8989fca82.zip index 88d358c2d..677b2c377 100644 Binary files a/.yarn/cache/cross-fetch-npm-3.1.5-e414995db9-83fa7b1318.zip and b/.yarn/cache/cross-fetch-npm-3.1.6-cdb982d446-a8989fca82.zip differ diff --git a/.yarn/cache/date-fns-npm-2.30.0-895c790e0f-1edbb6ae2e.zip b/.yarn/cache/date-fns-npm-2.30.0-895c790e0f-1edbb6ae2e.zip new file mode 100644 index 000000000..83280de22 Binary files /dev/null and b/.yarn/cache/date-fns-npm-2.30.0-895c790e0f-1edbb6ae2e.zip differ diff --git a/.yarn/cache/dotenv-npm-16.0.3-4cc29121dc-abce82d99b.zip b/.yarn/cache/dotenv-npm-16.0.3-4cc29121dc-abce82d99b.zip deleted file mode 100644 index 5b3b08a94..000000000 Binary files a/.yarn/cache/dotenv-npm-16.0.3-4cc29121dc-abce82d99b.zip and /dev/null differ diff --git a/.yarn/cache/dotenv-npm-16.1.3-4df6c2511f-8508f40434.zip b/.yarn/cache/dotenv-npm-16.1.3-4df6c2511f-8508f40434.zip new file mode 100644 index 000000000..0630f8b1d Binary files /dev/null and b/.yarn/cache/dotenv-npm-16.1.3-4df6c2511f-8508f40434.zip differ diff --git a/.yarn/cache/electron-to-chromium-npm-1.4.384-577a69752b-3f318c499e.zip b/.yarn/cache/electron-to-chromium-npm-1.4.384-577a69752b-3f318c499e.zip deleted file mode 100644 index 17b644047..000000000 Binary files a/.yarn/cache/electron-to-chromium-npm-1.4.384-577a69752b-3f318c499e.zip and /dev/null differ diff --git a/.yarn/cache/electron-to-chromium-npm-1.4.416-661d1e05e2-d337a9c626.zip b/.yarn/cache/electron-to-chromium-npm-1.4.416-661d1e05e2-d337a9c626.zip new file mode 100644 index 000000000..ccf1541ea Binary files /dev/null and b/.yarn/cache/electron-to-chromium-npm-1.4.416-661d1e05e2-d337a9c626.zip differ diff --git a/.yarn/cache/enhanced-resolve-npm-5.13.0-81a67f2a17-ff54c25302.zip b/.yarn/cache/enhanced-resolve-npm-5.13.0-81a67f2a17-ff54c25302.zip deleted file mode 100644 index 233382eef..000000000 Binary files a/.yarn/cache/enhanced-resolve-npm-5.13.0-81a67f2a17-ff54c25302.zip and /dev/null differ diff --git a/.yarn/cache/enhanced-resolve-npm-5.14.1-738959d0ac-d0dca4a78a.zip b/.yarn/cache/enhanced-resolve-npm-5.14.1-738959d0ac-d0dca4a78a.zip new file mode 100644 index 000000000..32c00d951 Binary files /dev/null and b/.yarn/cache/enhanced-resolve-npm-5.14.1-738959d0ac-d0dca4a78a.zip differ diff --git a/.yarn/cache/eslint-npm-8.39.0-d92bace04d-742b8d2c87.zip b/.yarn/cache/eslint-npm-8.39.0-d92bace04d-742b8d2c87.zip deleted file mode 100644 index 810ba8e7e..000000000 Binary files a/.yarn/cache/eslint-npm-8.39.0-d92bace04d-742b8d2c87.zip and /dev/null differ diff --git a/.yarn/cache/eslint-npm-8.41.0-0e83e90d27-82a4a6fd28.zip b/.yarn/cache/eslint-npm-8.41.0-0e83e90d27-82a4a6fd28.zip new file mode 100644 index 000000000..14dc8d7c7 Binary files /dev/null and b/.yarn/cache/eslint-npm-8.41.0-0e83e90d27-82a4a6fd28.zip differ diff --git a/.yarn/cache/eslint-visitor-keys-npm-3.4.0-dc8683d774-c55d5b9300.zip b/.yarn/cache/eslint-visitor-keys-npm-3.4.0-dc8683d774-c55d5b9300.zip deleted file mode 100644 index 35c2e0d85..000000000 Binary files a/.yarn/cache/eslint-visitor-keys-npm-3.4.0-dc8683d774-c55d5b9300.zip and /dev/null differ diff --git a/.yarn/cache/eslint-visitor-keys-npm-3.4.1-a5d0a58208-97db79746b.zip b/.yarn/cache/eslint-visitor-keys-npm-3.4.1-a5d0a58208-97db79746b.zip new file mode 100644 index 000000000..40979001b Binary files /dev/null and b/.yarn/cache/eslint-visitor-keys-npm-3.4.1-a5d0a58208-97db79746b.zip differ diff --git a/.yarn/cache/espree-npm-9.5.1-057dc7b3c1-cdf0058252.zip b/.yarn/cache/espree-npm-9.5.2-5fc9506cda-05c52faae1.zip similarity index 93% rename from .yarn/cache/espree-npm-9.5.1-057dc7b3c1-cdf0058252.zip rename to .yarn/cache/espree-npm-9.5.2-5fc9506cda-05c52faae1.zip index 3e94d85e9..2996cf781 100644 Binary files a/.yarn/cache/espree-npm-9.5.1-057dc7b3c1-cdf0058252.zip and b/.yarn/cache/espree-npm-9.5.2-5fc9506cda-05c52faae1.zip differ diff --git a/.yarn/cache/fast-diff-npm-1.2.0-5ba4171bb6-e75206672f.zip b/.yarn/cache/fast-diff-npm-1.2.0-5ba4171bb6-e75206672f.zip deleted file mode 100644 index a600d3c7a..000000000 Binary files a/.yarn/cache/fast-diff-npm-1.2.0-5ba4171bb6-e75206672f.zip and /dev/null differ diff --git a/.yarn/cache/fast-diff-npm-1.3.0-9f19e3b743-424cdf4f5f.zip b/.yarn/cache/fast-diff-npm-1.3.0-9f19e3b743-424cdf4f5f.zip new file mode 100644 index 000000000..821c8be44 Binary files /dev/null and b/.yarn/cache/fast-diff-npm-1.3.0-9f19e3b743-424cdf4f5f.zip differ diff --git a/.yarn/cache/get-intrinsic-npm-1.2.0-eb08ea9b1d-6db1e52147.zip b/.yarn/cache/get-intrinsic-npm-1.2.0-eb08ea9b1d-6db1e52147.zip deleted file mode 100644 index 7e19c49ba..000000000 Binary files a/.yarn/cache/get-intrinsic-npm-1.2.0-eb08ea9b1d-6db1e52147.zip and /dev/null differ diff --git a/.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-d1d5511cfe.zip b/.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-d1d5511cfe.zip new file mode 100644 index 000000000..123741a46 Binary files /dev/null and b/.yarn/cache/get-intrinsic-npm-1.2.1-ae857fd610-d1d5511cfe.zip differ diff --git a/.yarn/cache/glob-npm-10.2.2-4cf80ebee7-9ca0e52241.zip b/.yarn/cache/glob-npm-10.2.2-4cf80ebee7-9ca0e52241.zip deleted file mode 100644 index 0c761ceb3..000000000 Binary files a/.yarn/cache/glob-npm-10.2.2-4cf80ebee7-9ca0e52241.zip and /dev/null differ diff --git a/.yarn/cache/glob-npm-9.3.5-2f602083f0-e5cd25695c.zip b/.yarn/cache/glob-npm-9.3.5-2f602083f0-e5cd25695c.zip deleted file mode 100644 index 761b48e84..000000000 Binary files a/.yarn/cache/glob-npm-9.3.5-2f602083f0-e5cd25695c.zip and /dev/null differ diff --git a/.yarn/cache/got-npm-12.6.0-09c7ff19c5-2d5a329769.zip b/.yarn/cache/got-npm-12.6.1-5b6a816a1e-be216dd251.zip similarity index 53% rename from .yarn/cache/got-npm-12.6.0-09c7ff19c5-2d5a329769.zip rename to .yarn/cache/got-npm-12.6.1-5b6a816a1e-be216dd251.zip index b80595882..61c928c77 100644 Binary files a/.yarn/cache/got-npm-12.6.0-09c7ff19c5-2d5a329769.zip and b/.yarn/cache/got-npm-12.6.1-5b6a816a1e-be216dd251.zip differ diff --git a/.yarn/cache/graphemer-npm-1.4.0-0627732d35-a4ee139533.zip b/.yarn/cache/graphemer-npm-1.4.0-0627732d35-a4ee139533.zip new file mode 100644 index 000000000..9a14087fd Binary files /dev/null and b/.yarn/cache/graphemer-npm-1.4.0-0627732d35-a4ee139533.zip differ diff --git a/.yarn/cache/has-proto-npm-1.0.1-631ea9d820-0aa0de6013.zip b/.yarn/cache/has-proto-npm-1.0.1-631ea9d820-0aa0de6013.zip new file mode 100644 index 000000000..6a7567062 Binary files /dev/null and b/.yarn/cache/has-proto-npm-1.0.1-631ea9d820-0aa0de6013.zip differ diff --git a/.yarn/cache/helmet-npm-6.1.5-523f0fdda8-0c6b62e3a7.zip b/.yarn/cache/helmet-npm-6.1.5-523f0fdda8-0c6b62e3a7.zip deleted file mode 100644 index 2129855f5..000000000 Binary files a/.yarn/cache/helmet-npm-6.1.5-523f0fdda8-0c6b62e3a7.zip and /dev/null differ diff --git a/.yarn/cache/helmet-npm-6.2.0-43622c54ea-014ec4e5d3.zip b/.yarn/cache/helmet-npm-6.2.0-43622c54ea-014ec4e5d3.zip new file mode 100644 index 000000000..e30d7ec0a Binary files /dev/null and b/.yarn/cache/helmet-npm-6.2.0-43622c54ea-014ec4e5d3.zip differ diff --git a/.yarn/cache/ini-npm-4.1.0-af70e81291-7bbdc8a0cd.zip b/.yarn/cache/ini-npm-4.1.0-af70e81291-7bbdc8a0cd.zip deleted file mode 100644 index 4093fdab7..000000000 Binary files a/.yarn/cache/ini-npm-4.1.0-af70e81291-7bbdc8a0cd.zip and /dev/null differ diff --git a/.yarn/cache/ini-npm-4.1.1-01c2cbda7b-0351902b49.zip b/.yarn/cache/ini-npm-4.1.1-01c2cbda7b-0351902b49.zip new file mode 100644 index 000000000..dbd8fd4fb Binary files /dev/null and b/.yarn/cache/ini-npm-4.1.1-01c2cbda7b-0351902b49.zip differ diff --git a/.yarn/cache/inquirer-npm-9.2.2-90bcedd6ec-6a154464de.zip b/.yarn/cache/inquirer-npm-9.2.2-90bcedd6ec-6a154464de.zip deleted file mode 100644 index 46f7dde81..000000000 Binary files a/.yarn/cache/inquirer-npm-9.2.2-90bcedd6ec-6a154464de.zip and /dev/null differ diff --git a/.yarn/cache/ipaddr.js-npm-2.0.1-04e97280d7-04ce6c896c.zip b/.yarn/cache/ipaddr.js-npm-2.0.1-04e97280d7-04ce6c896c.zip deleted file mode 100644 index 005972aaa..000000000 Binary files a/.yarn/cache/ipaddr.js-npm-2.0.1-04e97280d7-04ce6c896c.zip and /dev/null differ diff --git a/.yarn/cache/ipaddr.js-npm-2.1.0-7091ce1549-1ec53ec679.zip b/.yarn/cache/ipaddr.js-npm-2.1.0-7091ce1549-1ec53ec679.zip new file mode 100644 index 000000000..687e2e0ce Binary files /dev/null and b/.yarn/cache/ipaddr.js-npm-2.1.0-7091ce1549-1ec53ec679.zip differ diff --git a/.yarn/cache/is-core-module-npm-2.12.0-3bcb45a24f-5619b73eee.zip b/.yarn/cache/is-core-module-npm-2.12.0-3bcb45a24f-5619b73eee.zip deleted file mode 100644 index 523fa03f8..000000000 Binary files a/.yarn/cache/is-core-module-npm-2.12.0-3bcb45a24f-5619b73eee.zip and /dev/null differ diff --git a/.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-ad50fa9887.zip b/.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-ad50fa9887.zip new file mode 100644 index 000000000..55f6f3db0 Binary files /dev/null and b/.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-ad50fa9887.zip differ diff --git a/.yarn/cache/jackspeak-npm-2.2.0-5383861524-d967d29e54.zip b/.yarn/cache/jackspeak-npm-2.2.0-5383861524-d967d29e54.zip deleted file mode 100644 index 10afa8d06..000000000 Binary files a/.yarn/cache/jackspeak-npm-2.2.0-5383861524-d967d29e54.zip and /dev/null differ diff --git a/.yarn/cache/jackspeak-npm-2.2.1-0644c98bfe-b7c66988fb.zip b/.yarn/cache/jackspeak-npm-2.2.1-0644c98bfe-b7c66988fb.zip new file mode 100644 index 000000000..89df91db5 Binary files /dev/null and b/.yarn/cache/jackspeak-npm-2.2.1-0644c98bfe-b7c66988fb.zip differ diff --git a/.yarn/cache/js-sdsl-npm-4.4.0-e8ec19da4a-8c85413f74.zip b/.yarn/cache/js-sdsl-npm-4.4.0-e8ec19da4a-8c85413f74.zip deleted file mode 100644 index 3cdef1296..000000000 Binary files a/.yarn/cache/js-sdsl-npm-4.4.0-e8ec19da4a-8c85413f74.zip and /dev/null differ diff --git a/.yarn/cache/libnpmpublish-npm-7.2.0-20e435842a-ae1c23f524.zip b/.yarn/cache/libnpmpublish-npm-7.2.0-20e435842a-ae1c23f524.zip deleted file mode 100644 index b040cee47..000000000 Binary files a/.yarn/cache/libnpmpublish-npm-7.2.0-20e435842a-ae1c23f524.zip and /dev/null differ diff --git a/.yarn/cache/libnpmpublish-npm-7.3.0-006fc4afe8-831b45ed01.zip b/.yarn/cache/libnpmpublish-npm-7.3.0-006fc4afe8-831b45ed01.zip new file mode 100644 index 000000000..b883feee6 Binary files /dev/null and b/.yarn/cache/libnpmpublish-npm-7.3.0-006fc4afe8-831b45ed01.zip differ diff --git a/.yarn/cache/minimatch-npm-8.0.4-bf57f0e98a-eea8425c44.zip b/.yarn/cache/minimatch-npm-8.0.4-bf57f0e98a-eea8425c44.zip deleted file mode 100644 index 7947bbfb6..000000000 Binary files a/.yarn/cache/minimatch-npm-8.0.4-bf57f0e98a-eea8425c44.zip and /dev/null differ diff --git a/.yarn/cache/minimatch-npm-9.0.0-c6737cb1be-07983996ed.zip b/.yarn/cache/minimatch-npm-9.0.0-c6737cb1be-07983996ed.zip deleted file mode 100644 index 77fbee628..000000000 Binary files a/.yarn/cache/minimatch-npm-9.0.0-c6737cb1be-07983996ed.zip and /dev/null differ diff --git a/.yarn/cache/mysql2-npm-3.2.4-ebe6a0a7dc-01a668bad3.zip b/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-a4e8f2967f.zip similarity index 61% rename from .yarn/cache/mysql2-npm-3.2.4-ebe6a0a7dc-01a668bad3.zip rename to .yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-a4e8f2967f.zip index a0b94124c..549711902 100644 Binary files a/.yarn/cache/mysql2-npm-3.2.4-ebe6a0a7dc-01a668bad3.zip and b/.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-a4e8f2967f.zip differ diff --git a/.yarn/cache/newrelic-npm-10.1.0-6c0218eb35-4be5e5e0c1.zip b/.yarn/cache/newrelic-npm-10.1.2-55e3dc82b6-48f989612e.zip similarity index 69% rename from .yarn/cache/newrelic-npm-10.1.0-6c0218eb35-4be5e5e0c1.zip rename to .yarn/cache/newrelic-npm-10.1.2-55e3dc82b6-48f989612e.zip index 3fdc55978..5396d5e4f 100644 Binary files a/.yarn/cache/newrelic-npm-10.1.0-6c0218eb35-4be5e5e0c1.zip and b/.yarn/cache/newrelic-npm-10.1.2-55e3dc82b6-48f989612e.zip differ diff --git a/.yarn/cache/node-fetch-npm-2.6.9-9fc9a54529-8457cf62f5.zip b/.yarn/cache/node-fetch-npm-2.6.11-160e4174c3-3e7af7c002.zip similarity index 96% rename from .yarn/cache/node-fetch-npm-2.6.9-9fc9a54529-8457cf62f5.zip rename to .yarn/cache/node-fetch-npm-2.6.11-160e4174c3-3e7af7c002.zip index 68c7547fa..81d618921 100644 Binary files a/.yarn/cache/node-fetch-npm-2.6.9-9fc9a54529-8457cf62f5.zip and b/.yarn/cache/node-fetch-npm-2.6.11-160e4174c3-3e7af7c002.zip differ diff --git a/.yarn/cache/node-fetch-npm-2.6.7-777aa2a6df-05c03fe66f.zip b/.yarn/cache/node-fetch-npm-2.6.7-777aa2a6df-05c03fe66f.zip deleted file mode 100644 index 8f2ea49f5..000000000 Binary files a/.yarn/cache/node-fetch-npm-2.6.7-777aa2a6df-05c03fe66f.zip and /dev/null differ diff --git a/.yarn/cache/node-releases-npm-2.0.10-f8e2d9a776-2047e77c66.zip b/.yarn/cache/node-releases-npm-2.0.10-f8e2d9a776-2047e77c66.zip deleted file mode 100644 index 1f9c17e8e..000000000 Binary files a/.yarn/cache/node-releases-npm-2.0.10-f8e2d9a776-2047e77c66.zip and /dev/null differ diff --git a/.yarn/cache/node-releases-npm-2.0.12-888ed1398a-ae9ed0c2ed.zip b/.yarn/cache/node-releases-npm-2.0.12-888ed1398a-ae9ed0c2ed.zip new file mode 100644 index 000000000..0184e319b Binary files /dev/null and b/.yarn/cache/node-releases-npm-2.0.12-888ed1398a-ae9ed0c2ed.zip differ diff --git a/.yarn/cache/npm-check-updates-npm-16.10.9-33c9c7db2d-72ec7248a6.zip b/.yarn/cache/npm-check-updates-npm-16.10.12-52621487c3-4ec825b97d.zip similarity index 82% rename from .yarn/cache/npm-check-updates-npm-16.10.9-33c9c7db2d-72ec7248a6.zip rename to .yarn/cache/npm-check-updates-npm-16.10.12-52621487c3-4ec825b97d.zip index c4609fb86..7dea03e58 100644 Binary files a/.yarn/cache/npm-check-updates-npm-16.10.9-33c9c7db2d-72ec7248a6.zip and b/.yarn/cache/npm-check-updates-npm-16.10.12-52621487c3-4ec825b97d.zip differ diff --git a/.yarn/cache/path-scurry-npm-1.7.0-e40ac7023f-b51b3abc6b.zip b/.yarn/cache/path-scurry-npm-1.7.0-e40ac7023f-b51b3abc6b.zip deleted file mode 100644 index c7068c08f..000000000 Binary files a/.yarn/cache/path-scurry-npm-1.7.0-e40ac7023f-b51b3abc6b.zip and /dev/null differ diff --git a/.yarn/cache/path-scurry-npm-1.9.2-e4789f2bee-c60ad5b0de.zip b/.yarn/cache/path-scurry-npm-1.9.2-e4789f2bee-c60ad5b0de.zip new file mode 100644 index 000000000..41e9265c5 Binary files /dev/null and b/.yarn/cache/path-scurry-npm-1.9.2-e4789f2bee-c60ad5b0de.zip differ diff --git a/.yarn/cache/readable-stream-npm-4.3.0-11c60fc281-14fa31e8b1.zip b/.yarn/cache/readable-stream-npm-4.4.0-780b78fcb6-4cacc2f32e.zip similarity index 57% rename from .yarn/cache/readable-stream-npm-4.3.0-11c60fc281-14fa31e8b1.zip rename to .yarn/cache/readable-stream-npm-4.4.0-780b78fcb6-4cacc2f32e.zip index 5bdf02d65..65fdf4c81 100644 Binary files a/.yarn/cache/readable-stream-npm-4.3.0-11c60fc281-14fa31e8b1.zip and b/.yarn/cache/readable-stream-npm-4.4.0-780b78fcb6-4cacc2f32e.zip differ diff --git a/.yarn/cache/regexp-to-ast-npm-0.5.0-1e96b9f3a0-7f03ab0518.zip b/.yarn/cache/regexp-to-ast-npm-0.5.0-1e96b9f3a0-7f03ab0518.zip new file mode 100644 index 000000000..35f1e79ad Binary files /dev/null and b/.yarn/cache/regexp-to-ast-npm-0.5.0-1e96b9f3a0-7f03ab0518.zip differ diff --git a/.yarn/cache/rimraf-npm-4.4.1-80b02e041a-1dcc3cb6a1.zip b/.yarn/cache/rimraf-npm-5.0.1-26fb251a1d-52dae5032c.zip similarity index 67% rename from .yarn/cache/rimraf-npm-4.4.1-80b02e041a-1dcc3cb6a1.zip rename to .yarn/cache/rimraf-npm-5.0.1-26fb251a1d-52dae5032c.zip index b3081531a..90fd72f58 100644 Binary files a/.yarn/cache/rimraf-npm-4.4.1-80b02e041a-1dcc3cb6a1.zip and b/.yarn/cache/rimraf-npm-5.0.1-26fb251a1d-52dae5032c.zip differ diff --git a/.yarn/cache/run-async-npm-2.4.1-a94bb90861-bf03d6deaa.zip b/.yarn/cache/run-async-npm-2.4.1-a94bb90861-bf03d6deaa.zip deleted file mode 100644 index 08ef6b200..000000000 Binary files a/.yarn/cache/run-async-npm-2.4.1-a94bb90861-bf03d6deaa.zip and /dev/null differ diff --git a/.yarn/cache/signal-exit-npm-4.0.1-8535b81e83-ef082de589.zip b/.yarn/cache/signal-exit-npm-4.0.1-8535b81e83-ef082de589.zip deleted file mode 100644 index 3893b64a3..000000000 Binary files a/.yarn/cache/signal-exit-npm-4.0.1-8535b81e83-ef082de589.zip and /dev/null differ diff --git a/.yarn/cache/signal-exit-npm-4.0.2-e3f0e8ed25-8d05e3167e.zip b/.yarn/cache/signal-exit-npm-4.0.2-e3f0e8ed25-8d05e3167e.zip new file mode 100644 index 000000000..14b976a16 Binary files /dev/null and b/.yarn/cache/signal-exit-npm-4.0.2-e3f0e8ed25-8d05e3167e.zip differ diff --git a/.yarn/cache/sigstore-npm-1.4.0-7a4f656b53-3e2540f19a.zip b/.yarn/cache/sigstore-npm-1.4.0-7a4f656b53-3e2540f19a.zip deleted file mode 100644 index 91b78c1a0..000000000 Binary files a/.yarn/cache/sigstore-npm-1.4.0-7a4f656b53-3e2540f19a.zip and /dev/null differ diff --git a/.yarn/cache/slash-npm-5.0.1-f9de4366f8-dbbf13cc79.zip b/.yarn/cache/slash-npm-5.0.1-f9de4366f8-dbbf13cc79.zip deleted file mode 100644 index 951bed3bd..000000000 Binary files a/.yarn/cache/slash-npm-5.0.1-f9de4366f8-dbbf13cc79.zip and /dev/null differ diff --git a/.yarn/cache/strip-ansi-npm-7.0.1-668c121204-552123468a.zip b/.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-09f81cbad0.zip similarity index 62% rename from .yarn/cache/strip-ansi-npm-7.0.1-668c121204-552123468a.zip rename to .yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-09f81cbad0.zip index 86cbcaa34..dea567d45 100644 Binary files a/.yarn/cache/strip-ansi-npm-7.0.1-668c121204-552123468a.zip and b/.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-09f81cbad0.zip differ diff --git a/.yarn/cache/tar-npm-6.1.14-282ba98561-5aeff09f56.zip b/.yarn/cache/tar-npm-6.1.14-282ba98561-5aeff09f56.zip deleted file mode 100644 index 50d574c08..000000000 Binary files a/.yarn/cache/tar-npm-6.1.14-282ba98561-5aeff09f56.zip and /dev/null differ diff --git a/.yarn/cache/terser-npm-5.17.1-5b220f4a17-d42eefe438.zip b/.yarn/cache/terser-npm-5.17.1-5b220f4a17-d42eefe438.zip deleted file mode 100644 index b822ae0a7..000000000 Binary files a/.yarn/cache/terser-npm-5.17.1-5b220f4a17-d42eefe438.zip and /dev/null differ diff --git a/.yarn/cache/terser-npm-5.17.6-8931b8d439-bb36bd1816.zip b/.yarn/cache/terser-npm-5.17.6-8931b8d439-bb36bd1816.zip new file mode 100644 index 000000000..cd7640190 Binary files /dev/null and b/.yarn/cache/terser-npm-5.17.6-8931b8d439-bb36bd1816.zip differ diff --git a/.yarn/cache/terser-webpack-plugin-npm-5.3.7-4bfad49798-d9a53e1836.zip b/.yarn/cache/terser-webpack-plugin-npm-5.3.7-4bfad49798-d9a53e1836.zip deleted file mode 100644 index aef146824..000000000 Binary files a/.yarn/cache/terser-webpack-plugin-npm-5.3.7-4bfad49798-d9a53e1836.zip and /dev/null differ diff --git a/.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-c9e69dfff6.zip b/.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-c9e69dfff6.zip new file mode 100644 index 000000000..bb547ecd0 Binary files /dev/null and b/.yarn/cache/terser-webpack-plugin-npm-5.3.9-7ba1eb45f4-c9e69dfff6.zip differ diff --git a/.yarn/cache/ts-loader-npm-9.4.2-ad41a3f9dc-c93a9c27f0.zip b/.yarn/cache/ts-loader-npm-9.4.3-e0b7d45adb-61bc1012db.zip similarity index 66% rename from .yarn/cache/ts-loader-npm-9.4.2-ad41a3f9dc-c93a9c27f0.zip rename to .yarn/cache/ts-loader-npm-9.4.3-e0b7d45adb-61bc1012db.zip index 1501651d9..4ab286375 100644 Binary files a/.yarn/cache/ts-loader-npm-9.4.2-ad41a3f9dc-c93a9c27f0.zip and b/.yarn/cache/ts-loader-npm-9.4.3-e0b7d45adb-61bc1012db.zip differ diff --git a/.yarn/cache/tslib-npm-2.5.0-bb364efebd-5a6ee935f5.zip b/.yarn/cache/tslib-npm-2.5.0-bb364efebd-5a6ee935f5.zip deleted file mode 100644 index 0f8d4bb88..000000000 Binary files a/.yarn/cache/tslib-npm-2.5.0-bb364efebd-5a6ee935f5.zip and /dev/null differ diff --git a/.yarn/cache/tslib-npm-2.5.2-3f1b58afbb-ed22e23f3d.zip b/.yarn/cache/tslib-npm-2.5.2-3f1b58afbb-ed22e23f3d.zip new file mode 100644 index 000000000..5d9c7d2c9 Binary files /dev/null and b/.yarn/cache/tslib-npm-2.5.2-3f1b58afbb-ed22e23f3d.zip differ diff --git a/.yarn/cache/tuf-js-npm-1.1.5-140b0f1312-2eef3f7df7.zip b/.yarn/cache/tuf-js-npm-1.1.5-140b0f1312-2eef3f7df7.zip deleted file mode 100644 index 1f2263909..000000000 Binary files a/.yarn/cache/tuf-js-npm-1.1.5-140b0f1312-2eef3f7df7.zip and /dev/null differ diff --git a/.yarn/cache/tuf-js-npm-1.1.6-976a3cf45a-d13ae54a51.zip b/.yarn/cache/tuf-js-npm-1.1.6-976a3cf45a-d13ae54a51.zip new file mode 100644 index 000000000..de68980c5 Binary files /dev/null and b/.yarn/cache/tuf-js-npm-1.1.6-976a3cf45a-d13ae54a51.zip differ diff --git a/.yarn/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip b/.yarn/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip similarity index 82% rename from .yarn/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip rename to .yarn/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip index a2d65b4df..8ce4c4d54 100644 Binary files a/.yarn/cache/typeorm-npm-0.3.15-20a6c4f754-db890f14cb.zip and b/.yarn/cache/typeorm-npm-0.3.16-5ac12a7afc-19803f935e.zip differ diff --git a/.yarn/cache/webpack-npm-5.82.0-f71a254df9-bd9641a552.zip b/.yarn/cache/webpack-npm-5.82.0-f71a254df9-bd9641a552.zip deleted file mode 100644 index 370a55f2c..000000000 Binary files a/.yarn/cache/webpack-npm-5.82.0-f71a254df9-bd9641a552.zip and /dev/null differ diff --git a/.yarn/cache/webpack-npm-5.85.0-11652af5db-9a91ad3995.zip b/.yarn/cache/webpack-npm-5.85.0-11652af5db-9a91ad3995.zip new file mode 100644 index 000000000..835a3f51e Binary files /dev/null and b/.yarn/cache/webpack-npm-5.85.0-11652af5db-9a91ad3995.zip differ diff --git a/.yarn/cache/winston-npm-3.8.2-2035e9cac4-50d7712f49.zip b/.yarn/cache/winston-npm-3.8.2-2035e9cac4-50d7712f49.zip deleted file mode 100644 index c398dafe7..000000000 Binary files a/.yarn/cache/winston-npm-3.8.2-2035e9cac4-50d7712f49.zip and /dev/null differ diff --git a/.yarn/cache/winston-npm-3.9.0-88b81bb8c3-8395f2942e.zip b/.yarn/cache/winston-npm-3.9.0-88b81bb8c3-8395f2942e.zip new file mode 100644 index 000000000..c9d99ad7a Binary files /dev/null and b/.yarn/cache/winston-npm-3.9.0-88b81bb8c3-8395f2942e.zip differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/.ready b/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/README.md b/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/README.md deleted file mode 100644 index 9d469e8c1..000000000 --- a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/README.md +++ /dev/null @@ -1 +0,0 @@ -Platform specific binary for cbor-extract on darwin OS with arm64 architecture \ No newline at end of file diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/index.js b/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/node.abi108.glibc.node b/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/node.abi108.glibc.node deleted file mode 100755 index e9c08f768..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/node.abi108.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/node.napi.glibc.node b/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/node.napi.glibc.node deleted file mode 100755 index a0a98e6ba..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/node.napi.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/package.json b/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/package.json deleted file mode 100644 index 1518384ea..000000000 --- a/.yarn/unplugged/@cbor-extract-cbor-extract-darwin-arm64-npm-2.1.1-7f6025512f/node_modules/@cbor-extract/cbor-extract-darwin-arm64/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@cbor-extract/cbor-extract-darwin-arm64", - "version": "2.1.1", - "os": [ - "darwin" - ], - "cpu": [ - "arm64" - ], - "license": "MIT", - "author": "Kris Zyp", - "repository": { - "type": "git", - "url": "http://github.com/kriszyp/cbor-extract" - }, - "description": "Platform specific binary for cbor-extract on darwin OS with arm64 architecture" -} \ No newline at end of file diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/.ready b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/README.md b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/README.md deleted file mode 100644 index 56aa35d71..000000000 --- a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/README.md +++ /dev/null @@ -1 +0,0 @@ -Platform specific binary for cbor-extract on linux OS with arm64 architecture \ No newline at end of file diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/index.js b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.abi108.glibc.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.abi108.glibc.node deleted file mode 100755 index 296013967..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.abi108.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.abi108.musl.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.abi108.musl.node deleted file mode 100755 index b1f9cab1e..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.abi108.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.napi.glibc.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.napi.glibc.node deleted file mode 100755 index 182928ec5..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.napi.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.napi.musl.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.napi.musl.node deleted file mode 100755 index da4867d19..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/node.napi.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/package.json b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/package.json deleted file mode 100644 index 06c7fc0cd..000000000 --- a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-arm64-npm-2.1.1-23a641c278/node_modules/@cbor-extract/cbor-extract-linux-arm64/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@cbor-extract/cbor-extract-linux-arm64", - "version": "2.1.1", - "os": [ - "linux" - ], - "cpu": [ - "arm64" - ], - "license": "MIT", - "author": "Kris Zyp", - "repository": { - "type": "git", - "url": "http://github.com/kriszyp/cbor-extract" - }, - "description": "Platform specific binary for cbor-extract on linux OS with arm64 architecture" -} \ No newline at end of file diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/.ready b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/README.md b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/README.md deleted file mode 100644 index 3b2ec9402..000000000 --- a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/README.md +++ /dev/null @@ -1 +0,0 @@ -Platform specific binary for cbor-extract on linux OS with x64 architecture \ No newline at end of file diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/index.js b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.abi108.glibc.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.abi108.glibc.node deleted file mode 100755 index fed29e7ea..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.abi108.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.abi108.musl.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.abi108.musl.node deleted file mode 100755 index a33b91a2b..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.abi108.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.napi.glibc.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.napi.glibc.node deleted file mode 100755 index 94afaf26a..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.napi.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.napi.musl.node b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.napi.musl.node deleted file mode 100755 index 7e5e659a2..000000000 Binary files a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/node.napi.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/package.json b/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/package.json deleted file mode 100644 index af8f35627..000000000 --- a/.yarn/unplugged/@cbor-extract-cbor-extract-linux-x64-npm-2.1.1-4471164400/node_modules/@cbor-extract/cbor-extract-linux-x64/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@cbor-extract/cbor-extract-linux-x64", - "version": "2.1.1", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], - "license": "MIT", - "author": "Kris Zyp", - "repository": { - "type": "git", - "url": "http://github.com/kriszyp/cbor-extract" - }, - "description": "Platform specific binary for cbor-extract on linux OS with x64 architecture" -} \ No newline at end of file diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/.ready b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/LICENSE b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/LICENSE deleted file mode 100644 index d1386a9d0..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright 2022 Contrast Security, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/README.md b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/README.md deleted file mode 100644 index 7eceb7482..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# @contrast/fn-inspect - -[![Test](https://github.com/Contrast-Security-Inc/node-fn-inspect/actions/workflows/test.yml/badge.svg)](https://github.com/Contrast-Security-Inc/node-fn-inspect/actions/workflows/test.yml) - -This module exposes some useful information from the underlying v8 engine, -including: - -- file and line number given a function reference -- code events (i.e. `'LAZY_COMPILE'`) - -## Usage - -Getting details about a function: - -```js -const { funcInfo } = require('@contrast/fn-inspect'); - -function testFn() {} - -const results = funcInfo(testFn); -// => { lineNumber: 2, column: 15, file: 'example.js', method: 'testFn', type: 'Function' } -``` - -Registering a listener for code events: - -```js -const { setCodeEventListener } = require('@contrast/fn-inspect'); - -setCodeEventListener((event) => { - console.log(event); -}); -``` - -## Building locally - -`npm run build` will build the project for your current OS and architecture. - -`npm run download` will pull the most recent build artifacts from GitHub. - -## Publishing - -Simply run `npm version` and `git push && git push --tags`. CI will take care of -releasing on taggedcommits. diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/binding.gyp b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/binding.gyp deleted file mode 100644 index ec431d006..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/binding.gyp +++ /dev/null @@ -1,36 +0,0 @@ -{ - "variables" : { - "openssl_fips": "", - }, - "targets": [ - { - "target_name": "fninspect", - "sources": [ - "src/addon.cc", - "src/code-events.cc", - "src/event-queue.cc", - "src/func-info.cc" - ], - "include_dirs": [ - "> $(depfile) -# Add extra rules as in (2). -# We remove slashes and replace spaces with new lines; -# remove blank lines; -# delete the first line and append a colon to the remaining lines. -sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ - grep -v '^$$' |\ - sed -e 1d -e 's|$$|:|' \ - >> $(depfile) -rm $(depfile).raw -endef - -# Command definitions: -# - cmd_foo is the actual command to run; -# - quiet_cmd_foo is the brief-output summary of the command. - -quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c - -quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c - -quiet_cmd_objc = CXX($(TOOLSET)) $@ -cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< - -quiet_cmd_objcxx = CXX($(TOOLSET)) $@ -cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# Commands for precompiled header files. -quiet_cmd_pch_c = CXX($(TOOLSET)) $@ -cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ -cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_m = CXX($(TOOLSET)) $@ -cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< -quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ -cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# gyp-mac-tool is written next to the root Makefile by gyp. -# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd -# already. -quiet_cmd_mac_tool = MACTOOL $(4) $< -cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" - -quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ -cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) - -quiet_cmd_infoplist = INFOPLIST $@ -cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" - -quiet_cmd_touch = TOUCH $@ -cmd_touch = touch $@ - -quiet_cmd_copy = COPY $@ -# send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@") - -quiet_cmd_symlink = SYMLINK $@ -cmd_symlink = ln -sf "$<" "$@" - -quiet_cmd_alink = LIBTOOL-STATIC $@ -cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) - - -# Define an escape_quotes function to escape single quotes. -# This allows us to handle quotes properly as long as we always use -# use single quotes and escape_quotes. -escape_quotes = $(subst ','\'',$(1)) -# This comment is here just to include a ' to unconfuse syntax highlighting. -# Define an escape_vars function to escape '$' variable syntax. -# This allows us to read/write command lines with shell variables (e.g. -# $LD_LIBRARY_PATH), without triggering make substitution. -escape_vars = $(subst $$,$$$$,$(1)) -# Helper that expands to a shell command to echo a string exactly as it is in -# make. This uses printf instead of echo because printf's behaviour with respect -# to escape sequences is more portable than echo's across different shells -# (e.g., dash, bash). -exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' - -# Helper to compare the command we're about to run against the command -# we logged the last time we ran the command. Produces an empty -# string (false) when the commands match. -# Tricky point: Make has no string-equality test function. -# The kernel uses the following, but it seems like it would have false -# positives, where one string reordered its arguments. -# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ -# $(filter-out $(cmd_$@), $(cmd_$(1)))) -# We instead substitute each for the empty string into the other, and -# say they're equal if both substitutions produce the empty string. -# .d files contain ? instead of spaces, take that into account. -command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ - $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) - -# Helper that is non-empty when a prerequisite changes. -# Normally make does this implicitly, but we force rules to always run -# so we can check their command lines. -# $? -- new prerequisites -# $| -- order-only dependencies -prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) - -# Helper that executes all postbuilds until one fails. -define do_postbuilds - @E=0;\ - for p in $(POSTBUILDS); do\ - eval $$p;\ - E=$$?;\ - if [ $$E -ne 0 ]; then\ - break;\ - fi;\ - done;\ - if [ $$E -ne 0 ]; then\ - rm -rf "$@";\ - exit $$E;\ - fi -endef - -# do_cmd: run a command via the above cmd_foo names, if necessary. -# Should always run for a given target to handle command-line changes. -# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. -# Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains ? for -# spaces already and dirx strips the ? characters. -define do_cmd -$(if $(or $(command_changed),$(prereq_changed)), - @$(call exact_echo, $($(quiet)cmd_$(1))) - @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" - $(if $(findstring flock,$(word 2,$(cmd_$1))), - @$(cmd_$(1)) - @echo " $(quiet_cmd_$(1)): Finished", - @$(cmd_$(1)) - ) - @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) - @$(if $(2),$(fixup_dep)) - $(if $(and $(3), $(POSTBUILDS)), - $(call do_postbuilds) - ) -) -endef - -# Declare the "all" target first so it is the default, -# even though we don't have the deps yet. -.PHONY: all -all: - -# make looks for ways to re-generate included makefiles, but in our case, we -# don't have a direct way. Explicitly telling make that it has nothing to do -# for them makes it go faster. -%.d: ; - -# Use FORCE_DO_CMD to force a target to run. Should be coupled with -# do_cmd. -.PHONY: FORCE_DO_CMD -FORCE_DO_CMD: - -TOOLSET := target -# Suffix rules, putting all outputs into $(obj). -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD - @$(call do_cmd,objc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD - @$(call do_cmd,objcxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) - -# Try building from generated source, too. -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD - @$(call do_cmd,objc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD - @$(call do_cmd,objcxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) - -$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD - @$(call do_cmd,objc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD - @$(call do_cmd,objcxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) - - -ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ - $(findstring $(join ^,$(prefix)),\ - $(join ^,fninspect.target.mk)))),) - include fninspect.target.mk -endif - -quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/karolsojko/Library/Caches/node-gyp/20.0.0" "-Dnode_gyp_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp" "-Dnode_lib_file=/Users/karolsojko/Library/Caches/node-gyp/20.0.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/karolsojko/workspace/server/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/config.gypi -I/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/common.gypi "--toplevel-dir=." binding.gyp -Makefile: $(srcdir)/build/config.gypi $(srcdir)/../../../../node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../../../../Library/Caches/node-gyp/20.0.0/include/node/common.gypi $(srcdir)/binding.gyp - $(call do_cmd,regen_makefile) - -# "all" is a concatenation of the "all" targets from all the included -# sub-makefiles. This is just here to clarify. -all: - -# Add in dependency-tracking rules. $(all_deps) is the list of every single -# target in our tree. Only consider the ones with .d (dependency) info: -d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) -ifneq ($(d_files),) - include $(d_files) -endif diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/fninspect.node.d b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/fninspect.node.d deleted file mode 100644 index 4d6a01e33..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/fninspect.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/fninspect.node := c++ -bundle -arch x86_64 -arch arm64 -undefined dynamic_lookup -Wl,-search_paths_first -mmacosx-version-min=10.15 -arch arm64 -L./Release -stdlib=libc++ -o Release/fninspect.node Release/obj.target/fninspect/src/addon.o Release/obj.target/fninspect/src/code-events.o Release/obj.target/fninspect/src/event-queue.o Release/obj.target/fninspect/src/func-info.o diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/addon.o.d b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/addon.o.d deleted file mode 100644 index 72b078a8a..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/addon.o.d +++ /dev/null @@ -1,164 +0,0 @@ -cmd_Release/obj.target/fninspect/src/addon.o := c++ -o Release/obj.target/fninspect/src/addon.o ../src/addon.cc '-DNODE_GYP_MODULE_NAME=fninspect' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/v8/include -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -arch x86_64 -arch arm64 -MMD -MF ./Release/.deps/Release/obj.target/fninspect/src/addon.o.d.raw -c -Release/obj.target/fninspect/src/addon.o: ../src/addon.cc \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h \ - ../src/code-events.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-profiler.h \ - ../src/event-queue.h ../src/func-info.h -../src/addon.cc: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: -../src/code-events.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-profiler.h: -../src/event-queue.h: -../src/func-info.h: diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/code-events.o.d b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/code-events.o.d deleted file mode 100644 index 90d79ded0..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/code-events.o.d +++ /dev/null @@ -1,163 +0,0 @@ -cmd_Release/obj.target/fninspect/src/code-events.o := c++ -o Release/obj.target/fninspect/src/code-events.o ../src/code-events.cc '-DNODE_GYP_MODULE_NAME=fninspect' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/v8/include -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -arch x86_64 -arch arm64 -MMD -MF ./Release/.deps/Release/obj.target/fninspect/src/code-events.o.d.raw -c -Release/obj.target/fninspect/src/code-events.o: ../src/code-events.cc \ - ../src/code-events.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-profiler.h \ - ../src/event-queue.h -../src/code-events.cc: -../src/code-events.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-profiler.h: -../src/event-queue.h: diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/event-queue.o.d b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/event-queue.o.d deleted file mode 100644 index 3d33bf7f4..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/event-queue.o.d +++ /dev/null @@ -1,161 +0,0 @@ -cmd_Release/obj.target/fninspect/src/event-queue.o := c++ -o Release/obj.target/fninspect/src/event-queue.o ../src/event-queue.cc '-DNODE_GYP_MODULE_NAME=fninspect' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/v8/include -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -arch x86_64 -arch arm64 -MMD -MF ./Release/.deps/Release/obj.target/fninspect/src/event-queue.o.d.raw -c -Release/obj.target/fninspect/src/event-queue.o: ../src/event-queue.cc \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-profiler.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h \ - ../src/event-queue.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h -../src/event-queue.cc: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-profiler.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h: -../src/event-queue.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/func-info.o.d b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/func-info.o.d deleted file mode 100644 index 3b66f8786..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/.deps/Release/obj.target/fninspect/src/func-info.o.d +++ /dev/null @@ -1,159 +0,0 @@ -cmd_Release/obj.target/fninspect/src/func-info.o := c++ -o Release/obj.target/fninspect/src/func-info.o ../src/func-info.cc '-DNODE_GYP_MODULE_NAME=fninspect' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/v8/include -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -arch x86_64 -arch arm64 -MMD -MF ./Release/.deps/Release/obj.target/fninspect/src/func-info.o.d.raw -c -Release/obj.target/fninspect/src/func-info.o: ../src/func-info.cc \ - ../src/func-info.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h -../src/func-info.cc: -../src/func-info.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/uv/darwin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/v8-wasm.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/fninspect.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/fninspect.node deleted file mode 100755 index c539258c5..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/fninspect.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/addon.o b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/addon.o deleted file mode 100644 index a9c80433a..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/addon.o and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/code-events.o b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/code-events.o deleted file mode 100644 index a5afe24f9..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/code-events.o and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/event-queue.o b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/event-queue.o deleted file mode 100644 index 467e24619..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/event-queue.o and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/func-info.o b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/func-info.o deleted file mode 100644 index b981f194c..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/Release/obj.target/fninspect/src/func-info.o and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/binding.Makefile b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/binding.Makefile deleted file mode 100644 index ac0468a19..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/binding.Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# This file is generated by gyp; do not edit. - -export builddir_name ?= ./build/. -.PHONY: all -all: - $(MAKE) fninspect diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/config.gypi b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/config.gypi deleted file mode 100644 index f08290e1f..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/config.gypi +++ /dev/null @@ -1,415 +0,0 @@ -# Do not edit. File was generated by node-gyp's "configure" step -{ - "target_defaults": { - "cflags": [], - "default_configuration": "Release", - "defines": [], - "include_dirs": [], - "libraries": [], - "msvs_configuration_platform": "ARM64", - "xcode_configuration_platform": "arm64" - }, - "variables": { - "arm_fpu": "neon", - "asan": 0, - "coverage": "false", - "dcheck_always_on": 0, - "debug_nghttp2": "false", - "debug_node": "false", - "enable_lto": "false", - "enable_pgo_generate": "false", - "enable_pgo_use": "false", - "error_on_warn": "false", - "force_dynamic_crt": 0, - "host_arch": "arm64", - "icu_data_in": "../../deps/icu-tmp/icudt72l.dat", - "icu_endianness": "l", - "icu_gyp_path": "tools/icu/icu-generic.gyp", - "icu_path": "deps/icu-small", - "icu_small": "false", - "icu_ver_major": "72", - "is_debug": 0, - "libdir": "lib", - "llvm_version": "12.0", - "napi_build_version": "8", - "node_builtin_shareable_builtins": [ - "deps/cjs-module-lexer/lexer.js", - "deps/cjs-module-lexer/dist/lexer.js", - "deps/undici/undici.js" - ], - "node_byteorder": "little", - "node_debug_lib": "false", - "node_enable_d8": "false", - "node_enable_v8_vtunejit": "false", - "node_fipsinstall": "false", - "node_install_corepack": "true", - "node_install_npm": "true", - "node_library_files": [ - "lib/_http_agent.js", - "lib/_http_client.js", - "lib/_http_common.js", - "lib/_http_incoming.js", - "lib/_http_outgoing.js", - "lib/_http_server.js", - "lib/_stream_duplex.js", - "lib/_stream_passthrough.js", - "lib/_stream_readable.js", - "lib/_stream_transform.js", - "lib/_stream_wrap.js", - "lib/_stream_writable.js", - "lib/_tls_common.js", - "lib/_tls_wrap.js", - "lib/assert.js", - "lib/assert/strict.js", - "lib/async_hooks.js", - "lib/buffer.js", - "lib/child_process.js", - "lib/cluster.js", - "lib/console.js", - "lib/constants.js", - "lib/crypto.js", - "lib/dgram.js", - "lib/diagnostics_channel.js", - "lib/dns.js", - "lib/dns/promises.js", - "lib/domain.js", - "lib/events.js", - "lib/fs.js", - "lib/fs/promises.js", - "lib/http.js", - "lib/http2.js", - "lib/https.js", - "lib/inspector.js", - "lib/inspector/promises.js", - "lib/internal/abort_controller.js", - "lib/internal/assert.js", - "lib/internal/assert/assertion_error.js", - "lib/internal/assert/calltracker.js", - "lib/internal/async_hooks.js", - "lib/internal/blob.js", - "lib/internal/blocklist.js", - "lib/internal/bootstrap/node.js", - "lib/internal/bootstrap/realm.js", - "lib/internal/bootstrap/switches/does_not_own_process_state.js", - "lib/internal/bootstrap/switches/does_own_process_state.js", - "lib/internal/bootstrap/switches/is_main_thread.js", - "lib/internal/bootstrap/switches/is_not_main_thread.js", - "lib/internal/bootstrap/web/exposed-wildcard.js", - "lib/internal/bootstrap/web/exposed-window-or-worker.js", - "lib/internal/buffer.js", - "lib/internal/child_process.js", - "lib/internal/child_process/serialization.js", - "lib/internal/cli_table.js", - "lib/internal/cluster/child.js", - "lib/internal/cluster/primary.js", - "lib/internal/cluster/round_robin_handle.js", - "lib/internal/cluster/shared_handle.js", - "lib/internal/cluster/utils.js", - "lib/internal/cluster/worker.js", - "lib/internal/console/constructor.js", - "lib/internal/console/global.js", - "lib/internal/constants.js", - "lib/internal/crypto/aes.js", - "lib/internal/crypto/certificate.js", - "lib/internal/crypto/cfrg.js", - "lib/internal/crypto/cipher.js", - "lib/internal/crypto/diffiehellman.js", - "lib/internal/crypto/ec.js", - "lib/internal/crypto/hash.js", - "lib/internal/crypto/hashnames.js", - "lib/internal/crypto/hkdf.js", - "lib/internal/crypto/keygen.js", - "lib/internal/crypto/keys.js", - "lib/internal/crypto/mac.js", - "lib/internal/crypto/pbkdf2.js", - "lib/internal/crypto/random.js", - "lib/internal/crypto/rsa.js", - "lib/internal/crypto/scrypt.js", - "lib/internal/crypto/sig.js", - "lib/internal/crypto/util.js", - "lib/internal/crypto/webcrypto.js", - "lib/internal/crypto/webidl.js", - "lib/internal/crypto/x509.js", - "lib/internal/debugger/inspect.js", - "lib/internal/debugger/inspect_client.js", - "lib/internal/debugger/inspect_repl.js", - "lib/internal/dgram.js", - "lib/internal/dns/callback_resolver.js", - "lib/internal/dns/promises.js", - "lib/internal/dns/utils.js", - "lib/internal/encoding.js", - "lib/internal/error_serdes.js", - "lib/internal/errors.js", - "lib/internal/event_target.js", - "lib/internal/events/symbols.js", - "lib/internal/file.js", - "lib/internal/fixed_queue.js", - "lib/internal/freelist.js", - "lib/internal/freeze_intrinsics.js", - "lib/internal/fs/cp/cp-sync.js", - "lib/internal/fs/cp/cp.js", - "lib/internal/fs/dir.js", - "lib/internal/fs/promises.js", - "lib/internal/fs/read_file_context.js", - "lib/internal/fs/recursive_watch.js", - "lib/internal/fs/rimraf.js", - "lib/internal/fs/streams.js", - "lib/internal/fs/sync_write_stream.js", - "lib/internal/fs/utils.js", - "lib/internal/fs/watchers.js", - "lib/internal/heap_utils.js", - "lib/internal/histogram.js", - "lib/internal/http.js", - "lib/internal/http2/compat.js", - "lib/internal/http2/core.js", - "lib/internal/http2/util.js", - "lib/internal/idna.js", - "lib/internal/inspector_async_hook.js", - "lib/internal/js_stream_socket.js", - "lib/internal/legacy/processbinding.js", - "lib/internal/linkedlist.js", - "lib/internal/main/check_syntax.js", - "lib/internal/main/embedding.js", - "lib/internal/main/eval_stdin.js", - "lib/internal/main/eval_string.js", - "lib/internal/main/inspect.js", - "lib/internal/main/mksnapshot.js", - "lib/internal/main/print_help.js", - "lib/internal/main/prof_process.js", - "lib/internal/main/repl.js", - "lib/internal/main/run_main_module.js", - "lib/internal/main/test_runner.js", - "lib/internal/main/watch_mode.js", - "lib/internal/main/worker_thread.js", - "lib/internal/mime.js", - "lib/internal/modules/cjs/loader.js", - "lib/internal/modules/esm/assert.js", - "lib/internal/modules/esm/create_dynamic_module.js", - "lib/internal/modules/esm/fetch_module.js", - "lib/internal/modules/esm/formats.js", - "lib/internal/modules/esm/get_format.js", - "lib/internal/modules/esm/handle_process_exit.js", - "lib/internal/modules/esm/hooks.js", - "lib/internal/modules/esm/initialize_import_meta.js", - "lib/internal/modules/esm/load.js", - "lib/internal/modules/esm/loader.js", - "lib/internal/modules/esm/module_job.js", - "lib/internal/modules/esm/module_map.js", - "lib/internal/modules/esm/package_config.js", - "lib/internal/modules/esm/resolve.js", - "lib/internal/modules/esm/shared_constants.js", - "lib/internal/modules/esm/translators.js", - "lib/internal/modules/esm/utils.js", - "lib/internal/modules/esm/worker.js", - "lib/internal/modules/helpers.js", - "lib/internal/modules/package_json_reader.js", - "lib/internal/modules/run_main.js", - "lib/internal/net.js", - "lib/internal/options.js", - "lib/internal/per_context/domexception.js", - "lib/internal/per_context/messageport.js", - "lib/internal/per_context/primordials.js", - "lib/internal/perf/event_loop_delay.js", - "lib/internal/perf/event_loop_utilization.js", - "lib/internal/perf/nodetiming.js", - "lib/internal/perf/observe.js", - "lib/internal/perf/performance.js", - "lib/internal/perf/performance_entry.js", - "lib/internal/perf/resource_timing.js", - "lib/internal/perf/timerify.js", - "lib/internal/perf/usertiming.js", - "lib/internal/perf/utils.js", - "lib/internal/policy/manifest.js", - "lib/internal/policy/sri.js", - "lib/internal/priority_queue.js", - "lib/internal/process/esm_loader.js", - "lib/internal/process/execution.js", - "lib/internal/process/per_thread.js", - "lib/internal/process/permission.js", - "lib/internal/process/policy.js", - "lib/internal/process/pre_execution.js", - "lib/internal/process/promises.js", - "lib/internal/process/report.js", - "lib/internal/process/signal.js", - "lib/internal/process/task_queues.js", - "lib/internal/process/warning.js", - "lib/internal/process/worker_thread_only.js", - "lib/internal/promise_hooks.js", - "lib/internal/querystring.js", - "lib/internal/readline/callbacks.js", - "lib/internal/readline/emitKeypressEvents.js", - "lib/internal/readline/interface.js", - "lib/internal/readline/promises.js", - "lib/internal/readline/utils.js", - "lib/internal/repl.js", - "lib/internal/repl/await.js", - "lib/internal/repl/history.js", - "lib/internal/repl/utils.js", - "lib/internal/socket_list.js", - "lib/internal/socketaddress.js", - "lib/internal/source_map/prepare_stack_trace.js", - "lib/internal/source_map/source_map.js", - "lib/internal/source_map/source_map_cache.js", - "lib/internal/stream_base_commons.js", - "lib/internal/streams/add-abort-signal.js", - "lib/internal/streams/buffer_list.js", - "lib/internal/streams/compose.js", - "lib/internal/streams/destroy.js", - "lib/internal/streams/duplex.js", - "lib/internal/streams/duplexify.js", - "lib/internal/streams/end-of-stream.js", - "lib/internal/streams/from.js", - "lib/internal/streams/lazy_transform.js", - "lib/internal/streams/legacy.js", - "lib/internal/streams/operators.js", - "lib/internal/streams/passthrough.js", - "lib/internal/streams/pipeline.js", - "lib/internal/streams/readable.js", - "lib/internal/streams/state.js", - "lib/internal/streams/transform.js", - "lib/internal/streams/utils.js", - "lib/internal/streams/writable.js", - "lib/internal/structured_clone.js", - "lib/internal/test/binding.js", - "lib/internal/test/transfer.js", - "lib/internal/test_runner/coverage.js", - "lib/internal/test_runner/harness.js", - "lib/internal/test_runner/mock.js", - "lib/internal/test_runner/reporter/dot.js", - "lib/internal/test_runner/reporter/spec.js", - "lib/internal/test_runner/reporter/tap.js", - "lib/internal/test_runner/runner.js", - "lib/internal/test_runner/tap_checker.js", - "lib/internal/test_runner/tap_lexer.js", - "lib/internal/test_runner/tap_parser.js", - "lib/internal/test_runner/test.js", - "lib/internal/test_runner/tests_stream.js", - "lib/internal/test_runner/utils.js", - "lib/internal/test_runner/yaml_to_js.js", - "lib/internal/timers.js", - "lib/internal/tls/secure-context.js", - "lib/internal/tls/secure-pair.js", - "lib/internal/trace_events_async_hooks.js", - "lib/internal/tty.js", - "lib/internal/url.js", - "lib/internal/util.js", - "lib/internal/util/colors.js", - "lib/internal/util/comparisons.js", - "lib/internal/util/debuglog.js", - "lib/internal/util/embedding.js", - "lib/internal/util/inspect.js", - "lib/internal/util/inspector.js", - "lib/internal/util/iterable_weak_map.js", - "lib/internal/util/parse_args/parse_args.js", - "lib/internal/util/parse_args/utils.js", - "lib/internal/util/types.js", - "lib/internal/v8/startup_snapshot.js", - "lib/internal/v8_prof_polyfill.js", - "lib/internal/v8_prof_processor.js", - "lib/internal/validators.js", - "lib/internal/vm.js", - "lib/internal/vm/module.js", - "lib/internal/wasm_web_api.js", - "lib/internal/watch_mode/files_watcher.js", - "lib/internal/watchdog.js", - "lib/internal/webidl.js", - "lib/internal/webstreams/adapters.js", - "lib/internal/webstreams/compression.js", - "lib/internal/webstreams/encoding.js", - "lib/internal/webstreams/queuingstrategies.js", - "lib/internal/webstreams/readablestream.js", - "lib/internal/webstreams/transfer.js", - "lib/internal/webstreams/transformstream.js", - "lib/internal/webstreams/util.js", - "lib/internal/webstreams/writablestream.js", - "lib/internal/worker.js", - "lib/internal/worker/io.js", - "lib/internal/worker/js_transferable.js", - "lib/module.js", - "lib/net.js", - "lib/os.js", - "lib/path.js", - "lib/path/posix.js", - "lib/path/win32.js", - "lib/perf_hooks.js", - "lib/process.js", - "lib/punycode.js", - "lib/querystring.js", - "lib/readline.js", - "lib/readline/promises.js", - "lib/repl.js", - "lib/stream.js", - "lib/stream/consumers.js", - "lib/stream/promises.js", - "lib/stream/web.js", - "lib/string_decoder.js", - "lib/sys.js", - "lib/test.js", - "lib/test/reporters.js", - "lib/timers.js", - "lib/timers/promises.js", - "lib/tls.js", - "lib/trace_events.js", - "lib/tty.js", - "lib/url.js", - "lib/util.js", - "lib/util/types.js", - "lib/v8.js", - "lib/vm.js", - "lib/wasi.js", - "lib/worker_threads.js", - "lib/zlib.js" - ], - "node_module_version": 115, - "node_no_browser_globals": "false", - "node_prefix": "/", - "node_release_urlbase": "https://nodejs.org/download/release/", - "node_shared": "false", - "node_shared_brotli": "false", - "node_shared_cares": "false", - "node_shared_http_parser": "false", - "node_shared_libuv": "false", - "node_shared_nghttp2": "false", - "node_shared_nghttp3": "false", - "node_shared_ngtcp2": "false", - "node_shared_openssl": "false", - "node_shared_zlib": "false", - "node_tag": "", - "node_target_type": "executable", - "node_use_bundled_v8": "true", - "node_use_node_code_cache": "true", - "node_use_node_snapshot": "true", - "node_use_openssl": "true", - "node_use_v8_platform": "true", - "node_with_ltcg": "false", - "node_without_node_options": "false", - "openssl_is_fips": "false", - "openssl_quic": "true", - "ossfuzz": "false", - "shlib_suffix": "115.dylib", - "single_executable_application": "true", - "target_arch": "arm64", - "v8_enable_31bit_smis_on_64bit_arch": 0, - "v8_enable_gdbjit": 0, - "v8_enable_hugepage": 0, - "v8_enable_i18n_support": 1, - "v8_enable_inspector": 1, - "v8_enable_javascript_promise_hooks": 1, - "v8_enable_lite_mode": 0, - "v8_enable_object_print": 1, - "v8_enable_pointer_compression": 0, - "v8_enable_shared_ro_heap": 1, - "v8_enable_webassembly": 1, - "v8_no_strict_aliasing": 1, - "v8_optimized_debug": 1, - "v8_promise_internal_field_count": 1, - "v8_random_seed": 0, - "v8_trace_maps": 0, - "v8_use_siphash": 1, - "want_separate_host_toolset": 0, - "xcode_version": "12.0", - "nodedir": "/Users/karolsojko/Library/Caches/node-gyp/20.0.0", - "standalone_static_library": 1, - "user_agent": "yarn/4.0.0-rc.43 npm/? node/v20.0.0 darwin arm64" - } -} diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/fninspect.target.mk b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/fninspect.target.mk deleted file mode 100644 index 296d1ff05..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/fninspect.target.mk +++ /dev/null @@ -1,209 +0,0 @@ -# This file is generated by gyp; do not edit. - -TOOLSET := target -TARGET := fninspect -DEFS_Debug := \ - '-DNODE_GYP_MODULE_NAME=fninspect' \ - '-DUSING_UV_SHARED=1' \ - '-DUSING_V8_SHARED=1' \ - '-DV8_DEPRECATION_WARNINGS=1' \ - '-DV8_DEPRECATION_WARNINGS' \ - '-DV8_IMMINENT_DEPRECATION_WARNINGS' \ - '-D_GLIBCXX_USE_CXX11_ABI=1' \ - '-D_DARWIN_USE_64_BIT_INODE=1' \ - '-D_LARGEFILE_SOURCE' \ - '-D_FILE_OFFSET_BITS=64' \ - '-DOPENSSL_NO_PINSHARED' \ - '-DOPENSSL_THREADS' \ - '-DBUILDING_NODE_EXTENSION' \ - '-DDEBUG' \ - '-D_DEBUG' \ - '-DV8_ENABLE_CHECKS' - -# Flags passed to all source files. -CFLAGS_Debug := \ - -O0 \ - -gdwarf-2 \ - -mmacosx-version-min=10.15 \ - -arch arm64 \ - -Wall \ - -Wendif-labels \ - -W \ - -Wno-unused-parameter - -# Flags passed to only C files. -CFLAGS_C_Debug := \ - -fno-strict-aliasing \ - -arch x86_64 \ - -arch arm64 - -# Flags passed to only C++ files. -CFLAGS_CC_Debug := \ - -std=gnu++17 \ - -stdlib=libc++ \ - -fno-rtti \ - -fno-exceptions \ - -fno-strict-aliasing \ - -arch x86_64 \ - -arch arm64 - -# Flags passed to only ObjC files. -CFLAGS_OBJC_Debug := - -# Flags passed to only ObjC++ files. -CFLAGS_OBJCC_Debug := - -INCS_Debug := \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/src \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/config \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/openssl/include \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/uv/include \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/zlib \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/v8/include \ - -I$(srcdir)/../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan - -DEFS_Release := \ - '-DNODE_GYP_MODULE_NAME=fninspect' \ - '-DUSING_UV_SHARED=1' \ - '-DUSING_V8_SHARED=1' \ - '-DV8_DEPRECATION_WARNINGS=1' \ - '-DV8_DEPRECATION_WARNINGS' \ - '-DV8_IMMINENT_DEPRECATION_WARNINGS' \ - '-D_GLIBCXX_USE_CXX11_ABI=1' \ - '-D_DARWIN_USE_64_BIT_INODE=1' \ - '-D_LARGEFILE_SOURCE' \ - '-D_FILE_OFFSET_BITS=64' \ - '-DOPENSSL_NO_PINSHARED' \ - '-DOPENSSL_THREADS' \ - '-DBUILDING_NODE_EXTENSION' - -# Flags passed to all source files. -CFLAGS_Release := \ - -O3 \ - -gdwarf-2 \ - -mmacosx-version-min=10.15 \ - -arch arm64 \ - -Wall \ - -Wendif-labels \ - -W \ - -Wno-unused-parameter - -# Flags passed to only C files. -CFLAGS_C_Release := \ - -fno-strict-aliasing \ - -arch x86_64 \ - -arch arm64 - -# Flags passed to only C++ files. -CFLAGS_CC_Release := \ - -std=gnu++17 \ - -stdlib=libc++ \ - -fno-rtti \ - -fno-exceptions \ - -fno-strict-aliasing \ - -arch x86_64 \ - -arch arm64 - -# Flags passed to only ObjC files. -CFLAGS_OBJC_Release := - -# Flags passed to only ObjC++ files. -CFLAGS_OBJCC_Release := - -INCS_Release := \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/include/node \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/src \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/config \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/openssl/openssl/include \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/uv/include \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/zlib \ - -I/Users/karolsojko/Library/Caches/node-gyp/20.0.0/deps/v8/include \ - -I$(srcdir)/../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan - -OBJS := \ - $(obj).target/$(TARGET)/src/addon.o \ - $(obj).target/$(TARGET)/src/code-events.o \ - $(obj).target/$(TARGET)/src/event-queue.o \ - $(obj).target/$(TARGET)/src/func-info.o - -# Add to the list of files we specially track dependencies for. -all_deps += $(OBJS) - -# CFLAGS et al overrides must be target-local. -# See "Target-specific Variable Values" in the GNU Make manual. -$(OBJS): TOOLSET := $(TOOLSET) -$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) -$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) -$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE)) -$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE)) - -# Suffix rules, putting all outputs into $(obj). - -$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) - -# Try building from generated source, too. - -$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) - -$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) - -# End of this set of suffix rules -### Rules for final target. -LDFLAGS_Debug := \ - -arch x86_64 \ - -arch arm64 \ - -undefined dynamic_lookup \ - -Wl,-search_paths_first \ - -mmacosx-version-min=10.15 \ - -arch arm64 \ - -L$(builddir) \ - -stdlib=libc++ - -LIBTOOLFLAGS_Debug := \ - -arch x86_64 \ - -arch arm64 \ - -undefined dynamic_lookup \ - -Wl,-search_paths_first - -LDFLAGS_Release := \ - -arch x86_64 \ - -arch arm64 \ - -undefined dynamic_lookup \ - -Wl,-search_paths_first \ - -mmacosx-version-min=10.15 \ - -arch arm64 \ - -L$(builddir) \ - -stdlib=libc++ - -LIBTOOLFLAGS_Release := \ - -arch x86_64 \ - -arch arm64 \ - -undefined dynamic_lookup \ - -Wl,-search_paths_first - -LIBS := - -$(builddir)/fninspect.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) -$(builddir)/fninspect.node: LIBS := $(LIBS) -$(builddir)/fninspect.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE)) -$(builddir)/fninspect.node: TOOLSET := $(TOOLSET) -$(builddir)/fninspect.node: $(OBJS) FORCE_DO_CMD - $(call do_cmd,solink_module) - -all_deps += $(builddir)/fninspect.node -# Add target alias -.PHONY: fninspect -fninspect: $(builddir)/fninspect.node - -# Short alias for building this executable. -.PHONY: fninspect.node -fninspect.node: $(builddir)/fninspect.node - -# Add executable to "all" target. -.PHONY: all -all: $(builddir)/fninspect.node - diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/gyp-mac-tool b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/gyp-mac-tool deleted file mode 100755 index ffef860c4..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/build/gyp-mac-tool +++ /dev/null @@ -1,772 +0,0 @@ -#!/usr/bin/env python3 -# Generated by gyp. Do not edit. -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions to perform Xcode-style build steps. - -These functions are executed via gyp-mac-tool when using the Makefile generator. -""" - - -import fcntl -import fnmatch -import glob -import json -import os -import plistlib -import re -import shutil -import struct -import subprocess -import sys -import tempfile - - -def main(args): - executor = MacTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) - - -class MacTool: - """This class performs all the Mac tooling steps. The methods can either be - executed directly, or dispatched from an argument list.""" - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace("-", "") - - def ExecCopyBundleResource(self, source, dest, convert_to_binary): - """Copies a resource file to the bundle/Resources directory, performing any - necessary compilation on each resource.""" - convert_to_binary = convert_to_binary == "True" - extension = os.path.splitext(source)[1].lower() - if os.path.isdir(source): - # Copy tree. - # TODO(thakis): This copies file attributes like mtime, while the - # single-file branch below doesn't. This should probably be changed to - # be consistent with the single-file branch. - if os.path.exists(dest): - shutil.rmtree(dest) - shutil.copytree(source, dest) - elif extension == ".xib": - return self._CopyXIBFile(source, dest) - elif extension == ".storyboard": - return self._CopyXIBFile(source, dest) - elif extension == ".strings" and not convert_to_binary: - self._CopyStringsFile(source, dest) - else: - if os.path.exists(dest): - os.unlink(dest) - shutil.copy(source, dest) - - if convert_to_binary and extension in (".plist", ".strings"): - self._ConvertToBinary(dest) - - def _CopyXIBFile(self, source, dest): - """Compiles a XIB file with ibtool into a binary plist in the bundle.""" - - # ibtool sometimes crashes with relative paths. See crbug.com/314728. - base = os.path.dirname(os.path.realpath(__file__)) - if os.path.relpath(source): - source = os.path.join(base, source) - if os.path.relpath(dest): - dest = os.path.join(base, dest) - - args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"] - - if os.environ["XCODE_VERSION_ACTUAL"] > "0700": - args.extend(["--auto-activate-custom-fonts"]) - if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ: - args.extend( - [ - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - ] - ) - else: - args.extend( - [ - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - ] - ) - - args.extend( - ["--output-format", "human-readable-text", "--compile", dest, source] - ) - - ibtool_section_re = re.compile(r"/\*.*\*/") - ibtool_re = re.compile(r".*note:.*is clipping its content") - try: - stdout = subprocess.check_output(args) - except subprocess.CalledProcessError as e: - print(e.output) - raise - current_section_header = None - for line in stdout.splitlines(): - if ibtool_section_re.match(line): - current_section_header = line - elif not ibtool_re.match(line): - if current_section_header: - print(current_section_header) - current_section_header = None - print(line) - return 0 - - def _ConvertToBinary(self, dest): - subprocess.check_call( - ["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest] - ) - - def _CopyStringsFile(self, source, dest): - """Copies a .strings file using iconv to reconvert the input into UTF-16.""" - input_code = self._DetectInputEncoding(source) or "UTF-8" - - # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call - # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints - # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing - # semicolon in dictionary. - # on invalid files. Do the same kind of validation. - import CoreFoundation - - with open(source, "rb") as in_file: - s = in_file.read() - d = CoreFoundation.CFDataCreate(None, s, len(s)) - _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) - if error: - return - - with open(dest, "wb") as fp: - fp.write(s.decode(input_code).encode("UTF-16")) - - def _DetectInputEncoding(self, file_name): - """Reads the first few bytes from file_name and tries to guess the text - encoding. Returns None as a guess if it can't detect it.""" - with open(file_name, "rb") as fp: - try: - header = fp.read(3) - except Exception: - return None - if header.startswith(b"\xFE\xFF"): - return "UTF-16" - elif header.startswith(b"\xFF\xFE"): - return "UTF-16" - elif header.startswith(b"\xEF\xBB\xBF"): - return "UTF-8" - else: - return None - - def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): - """Copies the |source| Info.plist to the destination directory |dest|.""" - # Read the source Info.plist into memory. - with open(source) as fd: - lines = fd.read() - - # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). - plist = plistlib.readPlistFromString(lines) - if keys: - plist.update(json.loads(keys[0])) - lines = plistlib.writePlistToString(plist) - - # Go through all the environment variables and replace them as variables in - # the file. - IDENT_RE = re.compile(r"[_/\s]") - for key in os.environ: - if key.startswith("_"): - continue - evar = "${%s}" % key - evalue = os.environ[key] - lines = lines.replace(lines, evar, evalue) - - # Xcode supports various suffices on environment variables, which are - # all undocumented. :rfc1034identifier is used in the standard project - # template these days, and :identifier was used earlier. They are used to - # convert non-url characters into things that look like valid urls -- - # except that the replacement character for :identifier, '_' isn't valid - # in a URL either -- oops, hence :rfc1034identifier was born. - evar = "${%s:identifier}" % key - evalue = IDENT_RE.sub("_", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - evar = "${%s:rfc1034identifier}" % key - evalue = IDENT_RE.sub("-", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - # Remove any keys with values that haven't been replaced. - lines = lines.splitlines() - for i in range(len(lines)): - if lines[i].strip().startswith("${"): - lines[i] = None - lines[i - 1] = None - lines = "\n".join(line for line in lines if line is not None) - - # Write out the file with variables replaced. - with open(dest, "w") as fd: - fd.write(lines) - - # Now write out PkgInfo file now that the Info.plist file has been - # "compiled". - self._WritePkgInfo(dest) - - if convert_to_binary == "True": - self._ConvertToBinary(dest) - - def _WritePkgInfo(self, info_plist): - """This writes the PkgInfo file from the data stored in Info.plist.""" - plist = plistlib.readPlist(info_plist) - if not plist: - return - - # Only create PkgInfo for executable types. - package_type = plist["CFBundlePackageType"] - if package_type != "APPL": - return - - # The format of PkgInfo is eight characters, representing the bundle type - # and bundle signature, each four characters. If that is missing, four - # '?' characters are used instead. - signature_code = plist.get("CFBundleSignature", "????") - if len(signature_code) != 4: # Wrong length resets everything, too. - signature_code = "?" * 4 - - dest = os.path.join(os.path.dirname(info_plist), "PkgInfo") - with open(dest, "w") as fp: - fp.write(f"{package_type}{signature_code}") - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - fcntl.flock(fd, fcntl.LOCK_EX) - return subprocess.call(cmd_list) - - def ExecFilterLibtool(self, *cmd_list): - """Calls libtool and filters out '/path/to/libtool: file: foo.o has no - symbols'.""" - libtool_re = re.compile( - r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$" - ) - libtool_re5 = re.compile( - r"^.*libtool: warning for library: " - + r".* the table of contents is empty " - + r"\(no object file members in the library define global symbols\)$" - ) - env = os.environ.copy() - # Ref: - # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c - # The problem with this flag is that it resets the file mtime on the file to - # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. - env["ZERO_AR_DATE"] = "1" - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) - err = libtoolout.communicate()[1].decode("utf-8") - for line in err.splitlines(): - if not libtool_re.match(line) and not libtool_re5.match(line): - print(line, file=sys.stderr) - # Unconditionally touch the output .a file on the command line if present - # and the command succeeded. A bit hacky. - if not libtoolout.returncode: - for i in range(len(cmd_list) - 1): - if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"): - os.utime(cmd_list[i + 1], None) - break - return libtoolout.returncode - - def ExecPackageIosFramework(self, framework): - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - module_path = os.path.join(framework, "Modules") - if not os.path.exists(module_path): - os.mkdir(module_path) - module_template = ( - "framework module %s {\n" - ' umbrella header "%s.h"\n' - "\n" - " export *\n" - " module * { export * }\n" - "}\n" % (binary, binary) - ) - - with open(os.path.join(module_path, "module.modulemap"), "w") as module_file: - module_file.write(module_template) - - def ExecPackageFramework(self, framework, version): - """Takes a path to Something.framework and the Current version of that and - sets up all the symlinks.""" - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - - CURRENT = "Current" - RESOURCES = "Resources" - VERSIONS = "Versions" - - if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): - # Binary-less frameworks don't seem to contain symlinks (see e.g. - # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). - return - - # Move into the framework directory to set the symlinks correctly. - pwd = os.getcwd() - os.chdir(framework) - - # Set up the Current version. - self._Relink(version, os.path.join(VERSIONS, CURRENT)) - - # Set up the root symlinks. - self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) - self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) - - # Back to where we were before! - os.chdir(pwd) - - def _Relink(self, dest, link): - """Creates a symlink to |dest| named |link|. If |link| already exists, - it is overwritten.""" - if os.path.lexists(link): - os.remove(link) - os.symlink(dest, link) - - def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): - framework_name = os.path.basename(framework).split(".")[0] - all_headers = [os.path.abspath(header) for header in all_headers] - filelist = {} - for header in all_headers: - filename = os.path.basename(header) - filelist[filename] = header - filelist[os.path.join(framework_name, filename)] = header - WriteHmap(out, filelist) - - def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers): - header_path = os.path.join(framework, "Headers") - if not os.path.exists(header_path): - os.makedirs(header_path) - for header in copy_headers: - shutil.copy(header, os.path.join(header_path, os.path.basename(header))) - - def ExecCompileXcassets(self, keys, *inputs): - """Compiles multiple .xcassets files into a single .car file. - - This invokes 'actool' to compile all the inputs .xcassets files. The - |keys| arguments is a json-encoded dictionary of extra arguments to - pass to 'actool' when the asset catalogs contains an application icon - or a launch image. - - Note that 'actool' does not create the Assets.car file if the asset - catalogs does not contains imageset. - """ - command_line = [ - "xcrun", - "actool", - "--output-format", - "human-readable-text", - "--compress-pngs", - "--notices", - "--warnings", - "--errors", - ] - is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ - if is_iphone_target: - platform = os.environ["CONFIGURATION"].split("-")[-1] - if platform not in ("iphoneos", "iphonesimulator"): - platform = "iphonesimulator" - command_line.extend( - [ - "--platform", - platform, - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]), - ] - ) - else: - command_line.extend( - [ - "--platform", - "macosx", - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]), - ] - ) - if keys: - keys = json.loads(keys) - for key, value in keys.items(): - arg_name = "--" + key - if isinstance(value, bool): - if value: - command_line.append(arg_name) - elif isinstance(value, list): - for v in value: - command_line.append(arg_name) - command_line.append(str(v)) - else: - command_line.append(arg_name) - command_line.append(str(value)) - # Note: actool crashes if inputs path are relative, so use os.path.abspath - # to get absolute path name for inputs. - command_line.extend(map(os.path.abspath, inputs)) - subprocess.check_call(command_line) - - def ExecMergeInfoPlist(self, output, *inputs): - """Merge multiple .plist files into a single .plist file.""" - merged_plist = {} - for path in inputs: - plist = self._LoadPlistMaybeBinary(path) - self._MergePlist(merged_plist, plist) - plistlib.writePlist(merged_plist, output) - - def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): - """Code sign a bundle. - - This function tries to code sign an iOS bundle, following the same - algorithm as Xcode: - 1. pick the provisioning profile that best match the bundle identifier, - and copy it into the bundle as embedded.mobileprovision, - 2. copy Entitlements.plist from user or SDK next to the bundle, - 3. code sign the bundle. - """ - substitutions, overrides = self._InstallProvisioningProfile( - provisioning, self._GetCFBundleIdentifier() - ) - entitlements_path = self._InstallEntitlements( - entitlements, substitutions, overrides - ) - - args = ["codesign", "--force", "--sign", key] - if preserve == "True": - args.extend(["--deep", "--preserve-metadata=identifier,entitlements"]) - else: - args.extend(["--entitlements", entitlements_path]) - args.extend(["--timestamp=none", path]) - subprocess.check_call(args) - - def _InstallProvisioningProfile(self, profile, bundle_identifier): - """Installs embedded.mobileprovision into the bundle. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple containing two dictionary: variables substitutions and values - to overrides when generating the entitlements file. - """ - source_path, provisioning_data, team_id = self._FindProvisioningProfile( - profile, bundle_identifier - ) - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], - os.environ["CONTENTS_FOLDER_PATH"], - "embedded.mobileprovision", - ) - shutil.copy2(source_path, target_path) - substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".") - return substitutions, provisioning_data["Entitlements"] - - def _FindProvisioningProfile(self, profile, bundle_identifier): - """Finds the .mobileprovision file to use for signing the bundle. - - Checks all the installed provisioning profiles (or if the user specified - the PROVISIONING_PROFILE variable, only consult it) and select the most - specific that correspond to the bundle identifier. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple of the path to the selected provisioning profile, the data of - the embedded plist in the provisioning profile and the team identifier - to use for code signing. - - Raises: - SystemExit: if no .mobileprovision can be used to sign the bundle. - """ - profiles_dir = os.path.join( - os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles" - ) - if not os.path.isdir(profiles_dir): - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - provisioning_profiles = None - if profile: - profile_path = os.path.join(profiles_dir, profile + ".mobileprovision") - if os.path.exists(profile_path): - provisioning_profiles = [profile_path] - if not provisioning_profiles: - provisioning_profiles = glob.glob( - os.path.join(profiles_dir, "*.mobileprovision") - ) - valid_provisioning_profiles = {} - for profile_path in provisioning_profiles: - profile_data = self._LoadProvisioningProfile(profile_path) - app_id_pattern = profile_data.get("Entitlements", {}).get( - "application-identifier", "" - ) - for team_identifier in profile_data.get("TeamIdentifier", []): - app_id = f"{team_identifier}.{bundle_identifier}" - if fnmatch.fnmatch(app_id, app_id_pattern): - valid_provisioning_profiles[app_id_pattern] = ( - profile_path, - profile_data, - team_identifier, - ) - if not valid_provisioning_profiles: - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - # If the user has multiple provisioning profiles installed that can be - # used for ${bundle_identifier}, pick the most specific one (ie. the - # provisioning profile whose pattern is the longest). - selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) - return valid_provisioning_profiles[selected_key] - - def _LoadProvisioningProfile(self, profile_path): - """Extracts the plist embedded in a provisioning profile. - - Args: - profile_path: string, path to the .mobileprovision file - - Returns: - Content of the plist embedded in the provisioning profile as a dictionary. - """ - with tempfile.NamedTemporaryFile() as temp: - subprocess.check_call( - ["security", "cms", "-D", "-i", profile_path, "-o", temp.name] - ) - return self._LoadPlistMaybeBinary(temp.name) - - def _MergePlist(self, merged_plist, plist): - """Merge |plist| into |merged_plist|.""" - for key, value in plist.items(): - if isinstance(value, dict): - merged_value = merged_plist.get(key, {}) - if isinstance(merged_value, dict): - self._MergePlist(merged_value, value) - merged_plist[key] = merged_value - else: - merged_plist[key] = value - else: - merged_plist[key] = value - - def _LoadPlistMaybeBinary(self, plist_path): - """Loads into a memory a plist possibly encoded in binary format. - - This is a wrapper around plistlib.readPlist that tries to convert the - plist to the XML format if it can't be parsed (assuming that it is in - the binary format). - - Args: - plist_path: string, path to a plist file, in XML or binary format - - Returns: - Content of the plist as a dictionary. - """ - try: - # First, try to read the file using plistlib that only supports XML, - # and if an exception is raised, convert a temporary copy to XML and - # load that copy. - return plistlib.readPlist(plist_path) - except Exception: - pass - with tempfile.NamedTemporaryFile() as temp: - shutil.copy2(plist_path, temp.name) - subprocess.check_call(["plutil", "-convert", "xml1", temp.name]) - return plistlib.readPlist(temp.name) - - def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): - """Constructs a dictionary of variable substitutions for Entitlements.plist. - - Args: - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - app_identifier_prefix: string, value for AppIdentifierPrefix - - Returns: - Dictionary of substitutions to apply when generating Entitlements.plist. - """ - return { - "CFBundleIdentifier": bundle_identifier, - "AppIdentifierPrefix": app_identifier_prefix, - } - - def _GetCFBundleIdentifier(self): - """Extracts CFBundleIdentifier value from Info.plist in the bundle. - - Returns: - Value of CFBundleIdentifier in the Info.plist located in the bundle. - """ - info_plist_path = os.path.join( - os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"] - ) - info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) - return info_plist_data["CFBundleIdentifier"] - - def _InstallEntitlements(self, entitlements, substitutions, overrides): - """Generates and install the ${BundleName}.xcent entitlements file. - - Expands variables "$(variable)" pattern in the source entitlements file, - add extra entitlements defined in the .mobileprovision file and the copy - the generated plist to "${BundlePath}.xcent". - - Args: - entitlements: string, optional, path to the Entitlements.plist template - to use, defaults to "${SDKROOT}/Entitlements.plist" - substitutions: dictionary, variable substitutions - overrides: dictionary, values to add to the entitlements - - Returns: - Path to the generated entitlements file. - """ - source_path = entitlements - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent" - ) - if not source_path: - source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist") - shutil.copy2(source_path, target_path) - data = self._LoadPlistMaybeBinary(target_path) - data = self._ExpandVariables(data, substitutions) - if overrides: - for key in overrides: - if key not in data: - data[key] = overrides[key] - plistlib.writePlist(data, target_path) - return target_path - - def _ExpandVariables(self, data, substitutions): - """Expands variables "$(variable)" in data. - - Args: - data: object, can be either string, list or dictionary - substitutions: dictionary, variable substitutions to perform - - Returns: - Copy of data where each references to "$(variable)" has been replaced - by the corresponding value found in substitutions, or left intact if - the key was not found. - """ - if isinstance(data, str): - for key, value in substitutions.items(): - data = data.replace("$(%s)" % key, value) - return data - if isinstance(data, list): - return [self._ExpandVariables(v, substitutions) for v in data] - if isinstance(data, dict): - return {k: self._ExpandVariables(data[k], substitutions) for k in data} - return data - - -def NextGreaterPowerOf2(x): - return 2 ** (x).bit_length() - - -def WriteHmap(output_name, filelist): - """Generates a header map based on |filelist|. - - Per Mark Mentovai: - A header map is structured essentially as a hash table, keyed by names used - in #includes, and providing pathnames to the actual files. - - The implementation below and the comment above comes from inspecting: - http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt - while also looking at the implementation in clang in: - https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp - """ - magic = 1751998832 - version = 1 - _reserved = 0 - count = len(filelist) - capacity = NextGreaterPowerOf2(count) - strings_offset = 24 + (12 * capacity) - max_value_length = max(len(value) for value in filelist.values()) - - out = open(output_name, "wb") - out.write( - struct.pack( - " void, interval?: number): void; - - /** Stop listening for v8 code events */ - stopListening(): void; -}; - -export = fnInspect; diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/index.js b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/index.js deleted file mode 100644 index d24dfc4dc..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/index.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const binding = require('node-gyp-build')(__dirname); - -let codeEventsInited = false; -let codeEventListener = null; -let timer = null; - -module.exports = { - /** - * Retrieves name, type, column, lineNumber and file from a function reference - * - * @param {Function} fn function reference to obtain info - * @return {FunctionInfo | null} - */ - funcInfo(fn) { - const info = binding.funcInfo(fn); - if (info === null) return null; - - info.type = fn.constructor.name; - return info; - }, - - /** - * Sets the function for processing v8 code events. - * Will start listening for code events if not already listening. - * starts a timer which polls for an available code event once every `interval` value. - * - * @param {Function} cb callback function to call - * @param {number} [interval=1] how often to get code events in ms - */ - setCodeEventListener(cb, interval = 1) { - if (codeEventsInited) { - codeEventListener = cb; - return; - } - - binding.initHandler(); - codeEventsInited = true; - codeEventListener = cb; - timer = setInterval(() => { - const codeEvent = binding.getNextCodeEvent(); - if (codeEvent) codeEventListener(codeEvent); - }, interval); - }, - - /** - * Stop listening for v8 code events - */ - stopListening() { - if (!codeEventsInited) return; - - clearInterval(timer); - binding.deinitHandler(); - codeEventListener = null; - codeEventsInited = false; - }, -}; diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/package.json b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/package.json deleted file mode 100644 index 5b772e232..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@contrast/fn-inspect", - "version": "3.3.1", - "description": "Retrieve function name and line number from a function reference", - "keywords": [ - "instrumentation" - ], - "author": "Contrast Security", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/Contrast-Security-Inc/node-fn-inspect.git" - }, - "bugs": { - "url": "https://github.com/Contrast-Security-Inc/node-fn-inspect/issues" - }, - "homepage": "https://github.com/Contrast-Security-Inc/node-fn-inspect#readme", - "files": [ - "prebuilds/", - "src/", - "binding.gyp", - "index.d.ts", - "index.js" - ], - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "install": "node-gyp-build", - "prepare": "husky install", - "build": "prebuildify -t 12.13.0 -t 14.15.0 -t 16.9.1 -t 18.7.0 --strip", - "build:linux": "prebuildify-cross -i centos7-devtoolset7 -i alpine -i linux-arm64 -t 12.13.0 -t 14.15.0 -t 16.9.1 -t 18.7.0 --strip", - "build:darwin": "npm run build -- --arch x64+arm64", - "build:win32": "npm run build", - "clean": "rimraf build/ coverage/ prebuilds/", - "download": "node scripts/download-artifacts.js", - "test": "c8 --reporter lcov --reporter text mocha .", - "test:valgrind": "valgrind --xml=yes --xml-file=./valgrind.xml --trace-children=yes --leak-check=full --show-leak-kinds=all mocha . && node scripts/parse-valgrind.js" - }, - "engines": { - "node": ">=12.13.0" - }, - "dependencies": { - "nan": "^2.16.0", - "node-gyp-build": "^4.4.0" - }, - "devDependencies": { - "@contrast/eslint-config": "^3.1.1", - "@ls-lint/ls-lint": "^1.11.2", - "@octokit/rest": "^18.12.0", - "c8": "^7.11.3", - "chai": "^4.3.6", - "husky": "^8.0.1", - "inquirer": "^8.2.4", - "lint-staged": "^13.0.1", - "mocha": "^10.0.0", - "node-gyp": "^9.0.0", - "prebuildify": "^5.0.0", - "prebuildify-cross": "^5.0.0", - "rimraf": "^3.0.2", - "unzipper": "^0.10.11", - "xml-js": "^1.6.11" - } -} diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi108.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi108.node deleted file mode 100644 index 75f62ed13..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi108.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi72.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi72.node deleted file mode 100644 index 35956f2ab..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi72.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi83.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi83.node deleted file mode 100644 index 51eb02733..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi83.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi93.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi93.node deleted file mode 100644 index 704c659ac..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/node.abi93.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi108.armv8.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi108.armv8.node deleted file mode 100644 index f1c50a68b..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi108.armv8.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi72.armv8.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi72.armv8.node deleted file mode 100644 index 32f390ed9..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi72.armv8.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi83.armv8.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi83.armv8.node deleted file mode 100644 index f46831060..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi83.armv8.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi93.armv8.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi93.armv8.node deleted file mode 100644 index f857bec2d..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/node.abi93.armv8.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi108.glibc.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi108.glibc.node deleted file mode 100644 index 6e85951e6..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi108.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi108.musl.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi108.musl.node deleted file mode 100644 index e45839210..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi108.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi72.glibc.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi72.glibc.node deleted file mode 100644 index 12d9f8f77..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi72.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi72.musl.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi72.musl.node deleted file mode 100644 index 07c4f31ce..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi72.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi83.glibc.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi83.glibc.node deleted file mode 100644 index 49123beb3..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi83.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi83.musl.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi83.musl.node deleted file mode 100644 index d3338a959..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi83.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi93.glibc.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi93.glibc.node deleted file mode 100644 index 6de8ec7a2..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi93.glibc.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi93.musl.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi93.musl.node deleted file mode 100644 index cf9647f79..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/node.abi93.musl.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi108.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi108.node deleted file mode 100644 index ae4970f2b..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi108.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi72.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi72.node deleted file mode 100644 index 5541fa6ca..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi72.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi83.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi83.node deleted file mode 100644 index f2b242a31..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi83.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi93.node b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi93.node deleted file mode 100644 index 2517a58ad..000000000 Binary files a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/node.abi93.node and /dev/null differ diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/addon.cc b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/addon.cc deleted file mode 100644 index 0c0aa9e1f..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/addon.cc +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#include "code-events.h" -#include "func-info.h" - -NAN_MODULE_INIT(Init) { - NAN_EXPORT(target, initHandler); - NAN_EXPORT(target, deinitHandler); - NAN_EXPORT(target, getNextCodeEvent); - - NAN_EXPORT(target, funcInfo); -} - -NODE_MODULE(addon, Init) diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/code-events.cc b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/code-events.cc deleted file mode 100644 index 877cf174d..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/code-events.cc +++ /dev/null @@ -1,75 +0,0 @@ -#include "code-events.h" -#include "event-queue.h" - -using namespace v8; - -class FnInspectCodeEventHandler : public CodeEventHandler { - public: - FnInspectCodeEventHandler(Isolate *isolate) : CodeEventHandler(isolate) { - this->isolate = isolate; - } - - void Handle(CodeEvent *event) { - /* - * If Handle() is invoked from a worker thread (i.e. during - * garbage collection) we don't have access to the isolate - * so just bail - */ - if (Isolate::GetCurrent() != isolate) { - return; - } - events.enqueue(event); - } - - EventNode *dequeue() { - return this->events.dequeue(); - } - - unsigned int eventCount() { - return this->events.length; - } - - private: - Isolate *isolate; - EventQueue events; -}; - -FnInspectCodeEventHandler *handler; - -NAN_METHOD(initHandler) { - handler = new FnInspectCodeEventHandler(info.GetIsolate()); - handler->Enable(); -} - -NAN_METHOD(deinitHandler) { - handler->Disable(); - - delete handler; - handler = NULL; -} - -NAN_METHOD(getNextCodeEvent) { - EventNode *node = handler->dequeue(); - - if (!node) - return; - - Local obj = Nan::New(); - - Nan::Set(obj, - Nan::New("script").ToLocalChecked(), - Nan::New(node->script).ToLocalChecked()); - Nan::Set(obj, - Nan::New("func").ToLocalChecked(), - Nan::New(node->func).ToLocalChecked()); - Nan::Set(obj, - Nan::New("type").ToLocalChecked(), - Nan::New(node->type).ToLocalChecked()); - Nan::Set(obj, - Nan::New("lineNumber").ToLocalChecked(), - Nan::New(node->lineNumber)); - - info.GetReturnValue().Set(obj); - - delete node; -} diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/code-events.h b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/code-events.h deleted file mode 100644 index 5c629b025..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/code-events.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "event-queue.h" - -NAN_METHOD(initHandler); -NAN_METHOD(deinitHandler); -NAN_METHOD(getNextCodeEvent); diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/event-queue.cc b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/event-queue.cc deleted file mode 100644 index 047f40b16..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/event-queue.cc +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include - -#include "event-queue.h" - -using namespace v8; - -EventQueue::EventQueue() { - this->head = NULL; - this->tail = NULL; - this->length = 0; -} - -EventQueue::~EventQueue() { - EventNode *tmp; - while (this->head) { - tmp = this->head; - ; - this->head = this->head->next; - delete tmp; - } -} - -void EventQueue::enqueue(CodeEvent *event) { - if (Nan::Utf8String(event->GetScriptName()).length() == 0) - return; - - EventNode *node = new EventNode(); - - node->type = strdup(CodeEvent::GetCodeEventTypeName(event->GetCodeType())); - node->script = strdup(*Nan::Utf8String(event->GetScriptName())); - node->func = strdup(*Nan::Utf8String(event->GetFunctionName())); - node->lineNumber = event->GetScriptLine(); - - if (this->tail) { - this->tail->next = node; - this->tail = node; - } else { - this->head = node; - this->tail = node; - } - - this->length += 1; -} - -EventNode *EventQueue::dequeue() { - EventNode *node = this->head; - - if (!node) - return NULL; - - this->head = this->head->next; - - if (this->head == NULL) { - this->tail = NULL; - } - - this->length -= 1; - - return node; -} diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/event-queue.h b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/event-queue.h deleted file mode 100644 index 84ab2220c..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/event-queue.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#include -#include -#include - -using namespace v8; - -class EventNode { - public: - char *type; - char *script; - char *func; - int lineNumber; - EventNode *next; - ~EventNode() { - free(this->type); - free(this->script); - free(this->func); - } -}; - -/** - * Implements a simple queue of code events that can be - * consumed. - * - * Thread-Safety: There's no locking on these methods so - * they aren't thread safe. However this should be OK - * as the expectation is these methods are only ever called - * from the main JS thread and they are blocking, there will - * only ever be a single thread calling it as a time. We - * may want to revisit this if we ever want to support - * handling events from worker_threads. - */ -class EventQueue { - public: - EventQueue(); - ~EventQueue(); - void enqueue(CodeEvent *event); - EventNode *dequeue(); - unsigned int length; - - private: - EventNode *head; - EventNode *tail; -}; diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/func-info.cc b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/func-info.cc deleted file mode 100644 index bed295cb6..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/func-info.cc +++ /dev/null @@ -1,28 +0,0 @@ -#include "func-info.h" - -using namespace v8; - -NAN_METHOD(funcInfo) { - if (info.Length() < 1 || info[0].IsEmpty() || !info[0]->IsFunction()) { - info.GetReturnValue().Set(Nan::Null()); - return; - } - - Local fn = info[0].As(); - - Local obj = Nan::New(); - Local resourceName = fn->GetScriptOrigin().ResourceName(); - - if (!resourceName.IsEmpty()) { - Nan::Set(obj, Nan::New("file").ToLocalChecked(), resourceName); - Nan::Set(obj, - Nan::New("lineNumber").ToLocalChecked(), - Nan::New(fn->GetScriptLineNumber())); - Nan::Set(obj, Nan::New("method").ToLocalChecked(), fn->GetName()); - Nan::Set(obj, - Nan::New("column").ToLocalChecked(), - Nan::New(fn->GetScriptColumnNumber())); - } - - info.GetReturnValue().Set(obj); -} diff --git a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/func-info.h b/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/func-info.h deleted file mode 100644 index e828e6891..000000000 --- a/.yarn/unplugged/@contrast-fn-inspect-npm-3.3.1-3a415085d5/node_modules/@contrast/fn-inspect/src/func-info.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include -#include - -NAN_METHOD(funcInfo); diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/.ready b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/CHANGELOG.md b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/CHANGELOG.md deleted file mode 100644 index c1af926d6..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/CHANGELOG.md +++ /dev/null @@ -1,305 +0,0 @@ -### v9.0.0 (2022-08-01) - -* **BREAKING** Removed support for Node 12. - - The minimum supported version is now Node v14. For further information on our support policy, see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent. - -* Added support for Node 18. - -* Fixed GC binder to properly record Garbage Collection metrics in Node 18. - -* Resolved several dev-dependency audit warnings. - -* Bumped minimum `nan` version to ^2.16.0. - -### v8.0.0 (2022-03-22) - -* **BREAKING** Removed RUSageMeter. This was used to get resource usage statistics via `libuv`. It is no longer needed since Node.js version 12 has support via `process.cpuUsage`. - -* Fixed spelling in compatibility documentation. - -* Added integration tests for downloading with proxy. - -* Fixed the download tests to skip when running on branch or unsupported architectures. - -### v7.1.2 (2022-02-23) - -* Added `windows-latest` run for Node 16 only back to CI. - -* Added clarifying language to agent impacts when the module fails to install to install script. - * Indicated which page the missing metrics impact. - * Added new blurb to failure as the initial message can be missed/skimmed-over when there is significant build process logging. - * Indicated it is safe to run in production. - -### v7.1.1 (2022-02-16) - -* Replaced usage of `proxy-agent` with `https-proxy-agent`. - -* Bumped `nan` to ^2.15.0. - -* Updated `add-to-board` to use org level `NODE_AGENT_GH_TOKEN` - -* Changed trigger on binary upload to wait for release of module instead of waiting for a tag that starts with `v` to be created - -* Updated CI workflow to use `windows-2019` image instead of `windows-latest`. - -### v7.1.0 (2022-01-11) - -* Added ability to download pre-builts through a proxy host. - * Use `NR_NATIVE_METRICS_PROXY_HOST= npm i @newrelic/native-metrics`. - -* Fixed deprecated code, updated `fs.existsSync` to `fs.accessSync` and using `NULL` vs. the more modern `nullptr`. - -* Added workflow to automate preparing release notes by reusing the newrelic/node-newrelic/.github/workflows/prep-release.yml@main workflow from agent repository. - -* Added job to automatically add issues/pr to Node.js Engineering board - -### v7.0.2 (2021-08-26): - -* Updated code to only check `node-gyp` version when the module needs to be built to avoid hanging node and subsequently causing OOM errors. -* Added a pre-commit hook to check if package.json changes and run `oss third-party manifest` and `oss third-party notices`. This will ensure the `third_party_manifest.json` and `THIRD_PARTY_NOTICES.md` are up to date. -* Fixed intermittent timeout issue with the server smoke integration test. - - Excluded native metric install setup time from server soak test timeout. -* Added `@newrelic/eslint-config` to rely on a centralized eslint ruleset. -* Added `husky` + `lint-staged` to run linting on all staged js files. -* Added integration tests for pre-build and upload tasks. -* Upgraded setup-node CI job to v2 and changed the linting node version to `lts/*` for future proofing. - -### v7.0.1 (2021-07-20): - -* Added support for Node 16. -* **BREAKING** Removed support for Node 10. - - The minimum supported version is now Node v12. For further information on our support policy, see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent. - -* Updated release workflow to run on Node v12.x, 14.x, and v16.x. -* Added files list to package.json instead of relying on `.npmignore`. -* Removed unused `bin/test-all-node.sh`. -* Removed semver check for Resource Unit meter availability. -* Fixed v7.0.0 by adding `binding.gyp` to package.json files list. - -### v7.0.0 (2021-07-20): - -* **This release has been deprecated.** Please use version 7.0.1 or higher. - -### v6.0.2 (2021-06-16): - -* Changes hasCalledBack from a constant to a variable to avoid failure when it gets reassigned. -Thank you @paulgoertzen-merico for the bug fix. -* Added 'no-const-assign' lint rule. - -### v6.0.1 (2021-06-15): - -* Created a standalone upload script to avoid issues where aws-sdk does not exist. -* Bumped tap to ^15.0.9. -* Replaced deprecated tap methods with preferred ones. -* Updated CONTRIBUTING.md to reference the New Relic org wide Code of Conduct. -* Added lib/upload.js to the .npmignore as it is not needed for the module to function. -* Bumped nan to ^2.14.2. - -### v6.0.0 (2020-11-03): - -* Removed Node v8.x from ci. -* Updated README to be consistent with OSS template. -* Added open source policy workflow. -* Supressing warnings during installation on alpine docker image. - Thank you @eyedean for the contribution. -* Updated name and job-name in release workflow. -* Filtered out tags for CI workflow to prevent running on tag push for releases. The release job handles full testing. - -### v5.3.0 (2020-08-06): - -* Updated to Apache 2.0 license. -* Added third party notices file and metadata for dependencies. -* Updated README with more detail. -* Added issue templates for bugs and enhancements. -* Added code of conduct file. -* Updated contributing guide. -* Added pull request template. -* Migrated CI to GitHub Actions. -* Added copyright headers to all source files. -* Added additional items to .npmignore. - -### v5.2.0 (2020-06-01): - -* Added special binary naming case to enable usage in Electron environments. - - Enables the module to be used in Electron environments when built with tools that add 'electron' to `npm_config_runtime` or `npm_config_disturl` (such as `electron-rebuild` or `electron-builder`). In this case, the ABI is left-off of the file name. - - Many thanks to @frankrobert-ls for raising the issue and providing a patch! - - Please Note: Electron is not officially supported and other issues may still exist with the module in these environments. - -### v5.1.0 (2020-05-06): - -* Upgraded `nan` to ^2.14.1 to resolve 'GetContents' deprecation warning with Node 14. - - Includes addition of Node 14 coverage and builds. Many thanks to @abetomo for the contribution. - -### v5.0.0 (2019-10-16): - -* **BREAKING** Removed support for Node 6, 7, 9 and 11. - - The minimum supported version of the native metrics module is now Node v8. For further information on our support policy, see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent. - -* Added support for Node v12. - -### v4.1.0 (2019-02-07): - -* Added support for insecure (http) binary hosts. Use at your own discretion. - - The default host remains as New Relic's binary repository behind an `https` - server. To use an `http` endpoint you must manually configure it yourself. - - Special thanks to Adam Brett (@adambrett) and Guilherme Nagatomo (@guilhermehn) - for contributing this feature. - -### v4.0.0 (2019-01-22): - -* **BREAKING**: Dropped support for Node versions <6. - -* Added pre-execution log message calling out that this is an optional - dependency in the agent. - -* Simplified final error by removing most of the confusing `Failed to...` - messages. - -### v3.1.2 (2018-10-22): - -* Corrected check for build flags to base on gyp version, not Node version. - - Previously, when checking if the old `\t:` syntax should be used, this looked - for Node <10.8.0. Now this looks for node-gyp <3.7.0. This accounts for - situations where users install their own versions of node-gyp. - - Special thanks to Eric Boureau (@eboureau) for contributing this fix. - -### v3.1.1 (2018-09-10): - -* Fixed building the module on Windows with Node v10.8.0 or greater. - - Special thanks to Elmar Burke (@elmarburke) for this contribution! - -### v3.1.0 (2018-07-02): - -* Added support for caching prebuilt binaries for firewalled deployments. - - Simply set the `NR_NATIVE_METRICS_DOWNLOAD_HOST` environment variable to the - protocol and host for the download (e.g. `http://your-internal-cache/`) and - `NR_NATIVE_METRICS_REMOTE_PATH` to the path to the download folder (e.g. - `path/to/downloads/folder`). - - Special thanks to Adam Brett (@adambrett) for contributing this feature. - -* Added support and pre-built binaries for Node 10. - -### v3.0.0 (2018-06-04): - -* **BREAKING** Removed support for Node 0.12. - - The minimum supported version of the native metrics module is now Node v4. - -* **BREAKING** Removed `gc` event in favor of `getGCMetrics()` method. - - The `gc` event will no longer be emitted for each garbage collection by V8. - Instead, metrics for garbage collections are aggregated in C++ and can be - retrieved by calling `getGCMetrics()`. Like `getLoopMetrics()`, this new - method will reset the aggregated metrics. - -* Added pre-built binaries for Node 5 and 7. - -### v2.4.0 (2018-04-20): - -* Added `NR_NATIVE_METRICS_NO_BUILD` and `NR_NATIVE_METRICS_NO_DOWNLOAD` - environment variables. - - These are just environment variable versions of the `--no-build` and - `--no-download` flags introduced in v2.3.0. - -### v2.3.0 (2018-04-19): - -* Added `--no-build` and `--no-download` flags for install script. - - These flags prevent the installer for the native metrics from either building - or downloading binaries. If both are specified, `--no-download` is ignored. - -### v2.2.0 (2018-02-12): - -* The package will now pull down pre-built binaries if compilation fails. - - After confirming that the binary downloading functionality works, the feature - has been enabled by default. The installation script will still default to a - fresh build where possible, using the download option as a fall back. - -* The process will no longer be held open due to pending timers. - - Previously, the timer used to calculate the CPU usage by a tick of the event - loop was left pending, causing the process to hang. - - -### v2.1.2 (2017-09-26): - -* Metric timers no longer hold the process open. - -Thanks to @samshull for the contribution! - -### v2.1.1 (2017-04-03): - -* Fixed build error on Windows thanks to Maximilian Haupt (@0x7f). - -* Added C++-layer unit testing using [gtest](https://github.com/google/googletest). - -* Updated readme with correct installation for the New Relic Agent v1. - -### v2.1.0 (2017-02-06): - -* Added an event loop CPU usage metric. - - The module will now report round trip CPU usage metrics for Node's event loop. This - metric can be read off with `nativeMetrics.getLoopMetrics()` and will - represent the amount of CPU time per tick of the event loop. - -### v2.0.2 (2017-01-19): - -* Removed pre-compiling binaries using the `node-pre-gyp` module. - - Previously we provided pre-compiled binaries for certain platforms and versions of Node. - However, this caused issues for customers using shrinkwrapping. In order to support - shrinkwrapping as well as all versions of Node and npm that our customers use, we have - decided to remove this feature. This means that in order to use this module, users now - need to have a compiler on the machine where it is being installed. - See [node-gyp] (https://www.npmjs.com/package/node-gyp#installation) for more - information on compiling native addons. - -### v2.0.0 (2017-01-04): - -* Removed support for Node 0.10. - - The `segfault-handler` dependency no longer compiles on Node 0.10 in our tests. - -* The `node-pre-gyp` module is now a bundled dependency. - - Previously it was installed using a preinstall script, which was causing an issue with - shrinkwrapping parent projects. Thanks to Robert Rossman (@Alaneor) for - the contribution! - -* Added License section to the Readme file. - -### v1.0.0 (2016-12-07): - -* General release. No code changes from v0.1.1. - -### v0.1.1 (2016-12-05): - -* Added guard against binding GC events more than once. - -* Removed OS X from Travis to temporarily get around extremely long builds. - Added script to run tests locally across multiple versions of Node. - -* Added test for checking licenses of dependencies. - -### v0.1.0 (2016-11-29): - -* Added `gc` event with duration and type of garbage collection. -* Added `usage` event with current and diff of resource usage stats. diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/CONTRIBUTING.md b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/CONTRIBUTING.md deleted file mode 100644 index 5683492d4..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/CONTRIBUTING.md +++ /dev/null @@ -1,98 +0,0 @@ -# Guidelines for Contributing Code - -New Relic welcomes code contributions by the Node community to this module, and -have taken effort to make this process easy for both contributors and our -development team. - -## Feature Requests - -Feature requests should be submitted in the [Issue tracker](../../issues), with -a description of the expected behavior & use case. Before submitting an Issue, -please search for similar ones in the [closed -issues](../../issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement). - -## Pull Requests - -We can only accept PRs for version v5.3.0 or greater due to open source -licensing restrictions. - -## Code of Conduct - -Before contributing please read the [code of conduct](https://github.com/newrelic/.github/blob/main/CODE_OF_CONDUCT.md) - -Note that our [code of conduct](https://github.com/newrelic/.github/blob/main/CODE_OF_CONDUCT.md) applies to all platforms -and venues related to this project; please follow it in all your interactions -with the project and its participants. - -## Contributor License Agreement - -Keep in mind that when you submit your Pull Request, you'll need to sign the -CLA via the click-through using CLA-Assistant. If you'd like to execute our -corporate CLA, or if you have any questions, please drop us an email at -opensource@newrelic.com. - -For more information about CLAs, please check out Alex Russell’s excellent -post, [“Why Do I Need to Sign -This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/). - -## Slack - -We host a public Slack with a dedicated channel for contributors and -maintainers of open source projects hosted by New Relic. If you are -contributing to this project, you're welcome to request access to the -\#oss-contributors channel in the newrelicusers.slack.com workspace. To request -access, see https://newrelicusers-signup.herokuapp.com/. - -## PR Guidelines - -### Version Support - -When contributing, keep in mind that New Relic customers (that's you!) are running many different versions of Node, some of them pretty old. Changes that depend on the newest version of Node will probably be rejected, especially if they replace something backwards compatible. - -Be aware that the instrumentation needs to work with a wide range of versions of the instrumented modules, and that code that looks nonsensical or overcomplicated may be that way for compatibility-related reasons. Read all the comments and check the related tests before deciding whether existing code is incorrect. - -If you’re planning on contributing a new feature or an otherwise complex contribution, we kindly ask you to start a conversation with the maintainer team by opening up an Github issue first. - -### General Guidelines - -In general, we try to limit adding third-party production dependencies. If one is necessary, please be prepared to make a clear case for the need. - -### Coding Style Guidelines/Conventions - -We use eslint to enforce certain coding standards. Please see our [.eslintrc](./.eslintrc.js) file for specific rule configuration. - -### Testing Guidelines - -The native metrics module includes a suite of unit and functional tests which should be used to -verify your changes don't break existing functionality. - -All tests are stored in `tests/` and are written using -[node-tap](https://www.npmjs.com/package/tap) with the extension `.tap.js`. - -#### Running Tests - -Running the test suite is simple. Just run: - - npm test - -This will install all the necessary modules and run the unit tests in standalone mode, followed by -the functional tests if all of the unit tests pass. - -To just run unit tests, run the following: - - npm run unit - -#### Writing Tests - -For most contributions it is strongly recommended to add additional tests which -exercise your changes. This helps us efficiently incorporate your changes into -our mainline codebase and provides a safeguard that your change won't be broken -by future development. Because of this, we require that all changes come with -tests. You are welcome to submit pull requests with untested changes, but they -won't be merged until you or the development team have an opportunity to write -tests for them. - -There are some rare cases where code changes do not result in changed -functionality (e.g. a performance optimization) and new tests are not required. -In general, including tests with your pull request dramatically increases the -chances it will be accepted. diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/LICENSE b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/README.md b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/README.md deleted file mode 100644 index 9613e643a..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/README.md +++ /dev/null @@ -1,181 +0,0 @@ -[![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus) - -# Native Metrics for New Relic Node.js Agent [![native-metrics CI][ci-badge]][ci-link] - -This module provides hooks into the native layer of Node.js to provide metrics for -the [New Relic Node.js Agent][npm-newrelic]. It gathers information that isn't -available at the JS layer about the V8 virtual machine and the process health. -It comes packaged with the New Relic Agent since v2, and there is nothing that -needs to be done. For Agent v1 you need only to install the module alongside -[`newrelic`][npm-newrelic]. - -## Installation and Getting Started - -Typically, most users use the version auto-installed by the agent. - -In some cases, installing a specific version is ideal. For example, new features or major changes might be released via a major version update to this module, prior to inclusion in the main New Relic Node.js agent. - -``` -$ npm install --save @newrelic/native-metrics -``` - -Note that this is a native module and thus must be compiled to function. -Pre-built binaries are provided for Linux servers running supported versions of -Node. If you are not using Linux or not using a supported version of Node, you -will need to have a compiler installed on the machine where this is to be -deployed. See [node-gyp](https://www.npmjs.com/package/node-gyp#installation) -for more information on compiling native addons. - -If you prepare and package deployments on one machine and install them on -another, the two machines must have the same operating system and architecture. -If they are not, you will need to re-build the native module after deploying in -order to get the correct binaries. - -During installation, the module will first attempt build from source on the -target machine. If that fails, it will attempt to download a pre-built binary -for your system. You can disable the download attempt by setting -`NR_NATIVE_METRICS_NO_DOWNLOAD` to `true` in your environment before -installation. - -```sh -$ export NR_NATIVE_METRICS_NO_DOWNLOAD=true -$ npm install @newrelic/native-metrics -``` - -If you would like to skip the build step and only attempt to download a -pre-build binary, set `NR_NATIVE_METRICS_NO_BUILD` to `true`. - -```sh -$ export NR_NATIVE_METRICS_NO_BUILD=true -$ npm install @newrelic/native-metrics -``` - -If both env vars are set, `NO_BUILD` will override `NO_DOWNLOAD`. - -If you are working behind a firewall and want to cache the downloads internally -you can set the value of the download host and remote path instead of forcing a -build: - -```sh -$ export NR_NATIVE_METRICS_DOWNLOAD_HOST=http://your-internal-cache/ -$ export NR_NATIVE_METRICS_REMOTE_PATH=path/to/download/folder/ -$ npm install @newrelic/native-metrics -``` - -You can also specify a proxy host to route requests through using the `NR_NATIVE_METRICS_PROXY_HOST` environment variable: - -```sh -$ export NR_NATIVE_METRICS_NO_BUILD=true -$ export NR_NATIVE_METRICS_PROXY_HOST=http://your-proxy-host/ -$ npm install @newrelic/native-metrics -``` - -For more information, please see the agent [installation guide][install-node] and [compatibility and requirements][compatibility]. - -## Usage - -```js -var getMetricEmitter = require('@newrelic/native-metrics') - -var emitter = getMetricEmitter() -if (emitter.gcEnabled) { - setInterval(() => { - var gcMetrics = emitter.getGCMetrics() - for (var type in gcMetrics) { - console.log('GC type name:', type) - console.log('GC type id:', gcMetrics[type].typeId) - console.log('GC metrics:', gcMetrics[type].metrics) - } - }, 1000) -} -if (emitter.usageEnabled) { - emitter.on('usage', (usage) => console.log(usage)) -} -if (emitter.loopEnabled) { - setInterval(() => { - var loopMetrics = emitter.getLoopMetrics() - console.log('Total time:', loopMetrics.usage.total) - console.log('Min time:', loopMetrics.usage.min) - console.log('Max time:', loopMetrics.usage.max) - console.log('Sum of squares:', loopMetrics.usage.sumOfSquares) - console.log('Count:', loopMetrics.usage.count) - }, 1000) -} -``` - -The metric emitter keeps a referenced timer running for its periodic sampling -events. For a graceful shutdown of the process call `NativeMetricEmitter#unbind`. - -```js -getMetricEmitter().unbind() // Process will now close gracefully. -``` - -If you would like to change the period of the sampling, simply unbind and then -call `NativeMetricEmitter#bind` with the new period. - -```js -var emitter = getMetricEmitter({timeout: 15000}) -emitter.unbind() -emitter.bind(10000) // Samples will now fire once every 10 seconds. -``` - -## Testing - -This module includes a list of unit and functional tests. To run these tests, use the following command - - $ npm run test - -You may also run individual test suites with the following commands - - $ npm run unit - $ npm run integration - -## Support - -Should you need assistance with New Relic products, you are in good hands with several support channels. - -If the issue has been confirmed as a bug or is a feature request, please file a GitHub issue. - -**Support Channels** - -* [New Relic Documentation](https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/introduction-new-relic-nodejs): Comprehensive guidance for using our platform -* [New Relic Community](https://discuss.newrelic.com/tags/nodeagent): The best place to engage in troubleshooting questions -* [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications -* [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level -* [New Relic Technical Support](https://support.newrelic.com/) 24/7/365 ticketed support. Read more about our [Technical Support Offerings](https://docs.newrelic.com/docs/licenses/license-information/general-usage-licenses/support-plan). - -## Privacy - -At New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise. - -We define "Personal Data" as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address and email address. - -Please review [New Relic’s General Data Privacy Notice](https://newrelic.com/termsandconditions/privacy) for more information. - -## Roadmap -See our [roadmap](https://github.com/newrelic/node-newrelic/blob/main/ROADMAP_Node.md), to learn more about our product vision, understand our plans, and provide us valuable feedback. - -## Contribute - -We encourage your contributions to improve Native Metrics for the New Relic Node.js Agent! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. - -If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at opensource@newrelic.com. - -To [all contributors](https://github.com/newrelic/node-native-metrics/graphs/contributors), we thank you! Without your contribution, this project would not be what it is today. - -If you would like to contribute to this project, please review [these guidelines](https://github.com/newrelic/node-native-metrics/blob/main/CONTRIBUTING.md). - -**A note about vulnerabilities** - -As noted in our [security policy](https://github.com/newrelic/node-native-metrics/security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals. - -If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic). - -## License -The Native Metrics for New Relic Node.js Agent package is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License. - -[ci-badge]: https://github.com/newrelic/node-native-metrics/workflows/native-metrics%20CI/badge.svg -[ci-link]: https://github.com/newrelic/node-native-metrics/actions?query=workflow%3A%22native-metrics+CI%22 -[npm-newrelic]: https://www.npmjs.com/package/newrelic -[install-node]: https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/install-nodejs-agent -[compatibility]: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/THIRD_PARTY_NOTICES.md b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/THIRD_PARTY_NOTICES.md deleted file mode 100644 index 94020e19c..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/THIRD_PARTY_NOTICES.md +++ /dev/null @@ -1,1104 +0,0 @@ -# Third Party Notices - -The Native Metrics for New Relic Node Agent uses source code from third party libraries which carry -their own copyright notices and license terms. These notices are provided -below. - -In the event that a required notice is missing or incorrect, please notify us -by e-mailing [open-source@newrelic.com](mailto:open-source@newrelic.com). - -For any licenses that require the disclosure of source -code, the source code can be found at [https://github.com/newrelic/node-native-metrics](https://github.com/newrelic/node-native-metrics). - -## Content - -**[dependencies](#dependencies)** - -* [https-proxy-agent](#https-proxy-agent) -* [nan](#nan) -* [semver](#semver) - -**[devDependencies](#devDependencies)** - -* [@newrelic/eslint-config](#newreliceslint-config) -* [@newrelic/newrelic-oss-cli](#newrelicnewrelic-oss-cli) -* [@newrelic/proxy](#newrelicproxy) -* [async](#async) -* [aws-sdk](#aws-sdk) -* [eslint-config-prettier](#eslint-config-prettier) -* [eslint-plugin-header](#eslint-plugin-header) -* [eslint-plugin-node](#eslint-plugin-node) -* [eslint-plugin-prettier](#eslint-plugin-prettier) -* [eslint](#eslint) -* [husky](#husky) -* [lint-staged](#lint-staged) -* [nock](#nock) -* [prettier](#prettier) -* [segfault-handler](#segfault-handler) -* [sinon](#sinon) -* [tap](#tap) - - -## dependencies - -### https-proxy-agent - -This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) ([v5.0.0](https://github.com/TooTallNate/node-https-proxy-agent/tree/v5.0.0)), distributed under the [MIT License](https://github.com/TooTallNate/node-https-proxy-agent/blob/v5.0.0/README.md): - -``` -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` - -### nan - -This product includes source derived from [nan](https://github.com/nodejs/nan) ([v2.16.0](https://github.com/nodejs/nan/tree/v2.16.0)), distributed under the [MIT License](https://github.com/nodejs/nan/blob/v2.16.0/LICENSE.md): - -``` -The MIT License (MIT) - -Copyright (c) 2018 [NAN contributors]() - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -``` - -### semver - -This product includes source derived from [semver](https://github.com/npm/node-semver) ([v5.7.1](https://github.com/npm/node-semver/tree/v5.7.1)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v5.7.1/LICENSE): - -``` -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -``` - - -## devDependencies - -### @newrelic/eslint-config - -This product includes source derived from [@newrelic/eslint-config](https://github.com/newrelic/eslint-config-newrelic) ([v0.0.4](https://github.com/newrelic/eslint-config-newrelic/tree/v0.0.4)), distributed under the [Apache-2.0 License](https://github.com/newrelic/eslint-config-newrelic/blob/v0.0.4/LICENSE): - -``` - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -``` - -### @newrelic/newrelic-oss-cli - -This product includes source derived from [@newrelic/newrelic-oss-cli](https://github.com/newrelic/newrelic-oss-cli) ([v0.1.2](https://github.com/newrelic/newrelic-oss-cli/tree/v0.1.2)), distributed under the [Apache-2.0 License](https://github.com/newrelic/newrelic-oss-cli/blob/v0.1.2/LICENSE): - -``` - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -``` - -### @newrelic/proxy - -This product includes source derived from [@newrelic/proxy](https://github.com/newrelic/proxy) ([v2.0.0](https://github.com/newrelic/proxy/tree/v2.0.0)), distributed under the [MIT License](https://github.com/newrelic/proxy/blob/v2.0.0/README.md): - -``` -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` - -### async - -This product includes source derived from [async](https://github.com/caolan/async) ([v3.2.3](https://github.com/caolan/async/tree/v3.2.3)), distributed under the [MIT License](https://github.com/caolan/async/blob/v3.2.3/LICENSE): - -``` -Copyright (c) 2010-2018 Caolan McMahon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -``` - -### aws-sdk - -This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.956.0](https://github.com/aws/aws-sdk-js/tree/v2.956.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js/blob/v2.956.0/LICENSE.txt): - -``` - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -``` - -### eslint-config-prettier - -This product includes source derived from [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) ([v8.3.0](https://github.com/prettier/eslint-config-prettier/tree/v8.3.0)), distributed under the [MIT License](https://github.com/prettier/eslint-config-prettier/blob/v8.3.0/LICENSE): - -``` -The MIT License (MIT) - -Copyright (c) 2017, 2018, 2019, 2020, 2021 Simon Lydell and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -``` - -### eslint-plugin-header - -This product includes source derived from [eslint-plugin-header](https://github.com/Stuk/eslint-plugin-header) ([v3.1.1](https://github.com/Stuk/eslint-plugin-header/tree/v3.1.1)), distributed under the [MIT License](https://github.com/Stuk/eslint-plugin-header/blob/v3.1.1/README.md): - -``` -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` - -### eslint-plugin-node - -This product includes source derived from [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) ([v11.1.0](https://github.com/mysticatea/eslint-plugin-node/tree/v11.1.0)), distributed under the [MIT License](https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/LICENSE): - -``` -The MIT License (MIT) - -Copyright (c) 2015 Toru Nagashima - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -``` - -### eslint-plugin-prettier - -This product includes source derived from [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) ([v3.4.0](https://github.com/prettier/eslint-plugin-prettier/tree/v3.4.0)), distributed under the [MIT License](https://github.com/prettier/eslint-plugin-prettier/blob/v3.4.0/LICENSE.md): - -``` -# The MIT License (MIT) - -Copyright © 2017 Andres Suarez and Teddy Katz - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the “Software”), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -``` - -### eslint - -This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v7.32.0](https://github.com/eslint/eslint/tree/v7.32.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v7.32.0/LICENSE): - -``` -Copyright JS Foundation and other contributors, https://js.foundation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -``` - -### husky - -This product includes source derived from [husky](https://github.com/typicode/husky) ([v7.0.1](https://github.com/typicode/husky/tree/v7.0.1)), distributed under the [MIT License](https://github.com/typicode/husky/blob/v7.0.1/LICENSE): - -``` -MIT License - -Copyright (c) 2021 typicode - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -``` - -### lint-staged - -This product includes source derived from [lint-staged](https://github.com/okonet/lint-staged) ([v11.1.1](https://github.com/okonet/lint-staged/tree/v11.1.1)), distributed under the [MIT License](https://github.com/okonet/lint-staged/blob/v11.1.1/LICENSE): - -``` -The MIT License (MIT) - -Copyright (c) 2016 Andrey Okonetchnikov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -``` - -### nock - -This product includes source derived from [nock](https://github.com/nock/nock) ([v13.1.1](https://github.com/nock/nock/tree/v13.1.1)), distributed under the [MIT License](https://github.com/nock/nock/blob/v13.1.1/LICENSE): - -``` -MIT License - -Copyright (c) 2011-2019 Pedro Teixeira and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -``` - -### prettier - -This product includes source derived from [prettier](https://github.com/prettier/prettier) ([v2.3.2](https://github.com/prettier/prettier/tree/v2.3.2)), distributed under the [MIT License](https://github.com/prettier/prettier/blob/v2.3.2/LICENSE): - -``` -Copyright © James Long and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -``` - -### segfault-handler - -This product includes source derived from [segfault-handler](https://github.com/ddopson/node-segfault-handler) ([v1.3.0](https://github.com/ddopson/node-segfault-handler/tree/v1.3.0)), distributed under the [BSD-3-Clause License](https://github.com/ddopson/node-segfault-handler/blob/v1.3.0/LICENSE): - -``` -Copyright (c) 2015-2019 Dave Dopson. -Copyright (c) 2019 Kenneth Geisshirt. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITYcAND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHERcIN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -``` - -### sinon - -This product includes source derived from [sinon](https://github.com/sinonjs/sinon) ([v11.1.2](https://github.com/sinonjs/sinon/tree/v11.1.2)), distributed under the [BSD-3-Clause License](https://github.com/sinonjs/sinon/blob/v11.1.2/LICENSE): - -``` -(The BSD License) - -Copyright (c) 2010-2017, Christian Johansen, christian@cjohansen.no -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Christian Johansen nor the names of his contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -``` - -### tap - -This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v16.0.1](https://github.com/tapjs/node-tap/tree/v16.0.1)), distributed under the [ISC License](https://github.com/tapjs/node-tap/blob/v16.0.1/LICENSE): - -``` -The ISC License - -Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -``` - - ------ - -Portions copyright Node.js contributors. Depending on your existing libraries and package management settings,your systems may call externally maintained libraries in addition to those listed above. See [here](https://nodejs.org/en/docs/meta/topics/dependencies/) and [here](https://github.com/nodejs/node/blob/v4.3.1/LICENSE) for additional details regarding externally maintained libraries and certain related licenses and notices. diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/THIRD_PARTY_NOTICES_FOOTER.md b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/THIRD_PARTY_NOTICES_FOOTER.md deleted file mode 100644 index 38872b3ce..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/THIRD_PARTY_NOTICES_FOOTER.md +++ /dev/null @@ -1,3 +0,0 @@ ------ - -Portions copyright Node.js contributors. Depending on your existing libraries and package management settings,your systems may call externally maintained libraries in addition to those listed above. See [here](https://nodejs.org/en/docs/meta/topics/dependencies/) and [here](https://github.com/nodejs/node/blob/v4.3.1/LICENSE) for additional details regarding externally maintained libraries and certain related licenses and notices. \ No newline at end of file diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/binding.gyp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/binding.gyp deleted file mode 100644 index 7cd9fc4b5..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/binding.gyp +++ /dev/null @@ -1,45 +0,0 @@ -{ - "targets": [{ - "target_name": "native_metrics", - "sources": [ - "src/native_metrics.cpp", - "src/GCBinder.hpp", - "src/GCBinder.cpp", - "src/LoopChecker.hpp", - "src/LoopChecker.cpp", - "src/Metric.hpp" - ], - "defines": [ - "NOMINMAX" - ], - "include_dirs": [ - "src", - "> $(depfile) -# Add extra rules as in (2). -# We remove slashes and replace spaces with new lines; -# remove blank lines; -# delete the first line and append a colon to the remaining lines. -sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ - grep -v '^$$' |\ - sed -e 1d -e 's|$$|:|' \ - >> $(depfile) -rm $(depfile).raw -endef - -# Command definitions: -# - cmd_foo is the actual command to run; -# - quiet_cmd_foo is the brief-output summary of the command. - -quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c - -quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c - -quiet_cmd_objc = CXX($(TOOLSET)) $@ -cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< - -quiet_cmd_objcxx = CXX($(TOOLSET)) $@ -cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# Commands for precompiled header files. -quiet_cmd_pch_c = CXX($(TOOLSET)) $@ -cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ -cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_m = CXX($(TOOLSET)) $@ -cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< -quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ -cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# gyp-mac-tool is written next to the root Makefile by gyp. -# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd -# already. -quiet_cmd_mac_tool = MACTOOL $(4) $< -cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" - -quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ -cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) - -quiet_cmd_infoplist = INFOPLIST $@ -cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" - -quiet_cmd_touch = TOUCH $@ -cmd_touch = touch $@ - -quiet_cmd_copy = COPY $@ -# send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@") - -quiet_cmd_symlink = SYMLINK $@ -cmd_symlink = ln -sf "$<" "$@" - -quiet_cmd_alink = LIBTOOL-STATIC $@ -cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) - - -# Define an escape_quotes function to escape single quotes. -# This allows us to handle quotes properly as long as we always use -# use single quotes and escape_quotes. -escape_quotes = $(subst ','\'',$(1)) -# This comment is here just to include a ' to unconfuse syntax highlighting. -# Define an escape_vars function to escape '$' variable syntax. -# This allows us to read/write command lines with shell variables (e.g. -# $LD_LIBRARY_PATH), without triggering make substitution. -escape_vars = $(subst $$,$$$$,$(1)) -# Helper that expands to a shell command to echo a string exactly as it is in -# make. This uses printf instead of echo because printf's behaviour with respect -# to escape sequences is more portable than echo's across different shells -# (e.g., dash, bash). -exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' - -# Helper to compare the command we're about to run against the command -# we logged the last time we ran the command. Produces an empty -# string (false) when the commands match. -# Tricky point: Make has no string-equality test function. -# The kernel uses the following, but it seems like it would have false -# positives, where one string reordered its arguments. -# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ -# $(filter-out $(cmd_$@), $(cmd_$(1)))) -# We instead substitute each for the empty string into the other, and -# say they're equal if both substitutions produce the empty string. -# .d files contain ? instead of spaces, take that into account. -command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ - $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) - -# Helper that is non-empty when a prerequisite changes. -# Normally make does this implicitly, but we force rules to always run -# so we can check their command lines. -# $? -- new prerequisites -# $| -- order-only dependencies -prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) - -# Helper that executes all postbuilds until one fails. -define do_postbuilds - @E=0;\ - for p in $(POSTBUILDS); do\ - eval $$p;\ - E=$$?;\ - if [ $$E -ne 0 ]; then\ - break;\ - fi;\ - done;\ - if [ $$E -ne 0 ]; then\ - rm -rf "$@";\ - exit $$E;\ - fi -endef - -# do_cmd: run a command via the above cmd_foo names, if necessary. -# Should always run for a given target to handle command-line changes. -# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. -# Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains ? for -# spaces already and dirx strips the ? characters. -define do_cmd -$(if $(or $(command_changed),$(prereq_changed)), - @$(call exact_echo, $($(quiet)cmd_$(1))) - @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" - $(if $(findstring flock,$(word 2,$(cmd_$1))), - @$(cmd_$(1)) - @echo " $(quiet_cmd_$(1)): Finished", - @$(cmd_$(1)) - ) - @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) - @$(if $(2),$(fixup_dep)) - $(if $(and $(3), $(POSTBUILDS)), - $(call do_postbuilds) - ) -) -endef - -# Declare the "all" target first so it is the default, -# even though we don't have the deps yet. -.PHONY: all -all: - -# make looks for ways to re-generate included makefiles, but in our case, we -# don't have a direct way. Explicitly telling make that it has nothing to do -# for them makes it go faster. -%.d: ; - -# Use FORCE_DO_CMD to force a target to run. Should be coupled with -# do_cmd. -.PHONY: FORCE_DO_CMD -FORCE_DO_CMD: - -TOOLSET := target -# Suffix rules, putting all outputs into $(obj). -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD - @$(call do_cmd,objc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD - @$(call do_cmd,objcxx,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) - -# Try building from generated source, too. -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD - @$(call do_cmd,objc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD - @$(call do_cmd,objcxx,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) - -$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD - @$(call do_cmd,cxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD - @$(call do_cmd,objc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD - @$(call do_cmd,objcxx,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD - @$(call do_cmd,cc,1) -$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD - @$(call do_cmd,cc,1) - - -ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ - $(findstring $(join ^,$(prefix)),\ - $(join ^,native_metrics.target.mk)))),) - include native_metrics.target.mk -endif - -quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/karolsojko/Library/Caches/node-gyp/20.2.0" "-Dnode_gyp_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp" "-Dnode_lib_file=/Users/karolsojko/Library/Caches/node-gyp/20.2.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/karolsojko/workspace/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi -I/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/common.gypi "--toplevel-dir=." binding.gyp -Makefile: $(srcdir)/build/config.gypi $(srcdir)/../../../../node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../Library/Caches/node-gyp/20.2.0/include/node/common.gypi - $(call do_cmd,regen_makefile) - -# "all" is a concatenation of the "all" targets from all the included -# sub-makefiles. This is just here to clarify. -all: - -# Add in dependency-tracking rules. $(all_deps) is the list of every single -# target in our tree. Only consider the ones with .d (dependency) info: -d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) -ifneq ($(d_files),) - include $(d_files) -endif diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/native_metrics.node.d b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/native_metrics.node.d deleted file mode 100644 index 81b81b3b0..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/native_metrics.node.d +++ /dev/null @@ -1 +0,0 @@ -cmd_Release/native_metrics.node := c++ -bundle -undefined dynamic_lookup -Wl,-search_paths_first -mmacosx-version-min=10.15 -arch arm64 -L./Release -stdlib=libc++ -o Release/native_metrics.node Release/obj.target/native_metrics/src/native_metrics.o Release/obj.target/native_metrics/src/GCBinder.o Release/obj.target/native_metrics/src/LoopChecker.o diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/GCBinder.o.d b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/GCBinder.o.d deleted file mode 100644 index 7e0a34807..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/GCBinder.o.d +++ /dev/null @@ -1,161 +0,0 @@ -cmd_Release/obj.target/native_metrics/src/GCBinder.o := c++ -o Release/obj.target/native_metrics/src/GCBinder.o ../src/GCBinder.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/GCBinder.o.d.raw -c -Release/obj.target/native_metrics/src/GCBinder.o: ../src/GCBinder.cpp \ - ../src/GCBinder.hpp \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h \ - ../src/Metric.hpp -../src/GCBinder.cpp: -../src/GCBinder.hpp: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: -../src/Metric.hpp: diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/LoopChecker.o.d b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/LoopChecker.o.d deleted file mode 100644 index fa22092c2..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/LoopChecker.o.d +++ /dev/null @@ -1,162 +0,0 @@ -cmd_Release/obj.target/native_metrics/src/LoopChecker.o := c++ -o Release/obj.target/native_metrics/src/LoopChecker.o ../src/LoopChecker.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/LoopChecker.o.d.raw -c -Release/obj.target/native_metrics/src/LoopChecker.o: \ - ../src/LoopChecker.cpp \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h \ - ../src/LoopChecker.hpp \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h \ - ../src/Metric.hpp -../src/LoopChecker.cpp: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h: -../src/LoopChecker.hpp: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: -../src/Metric.hpp: diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/native_metrics.o.d b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/native_metrics.o.d deleted file mode 100644 index 3c8aeb3e5..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/.deps/Release/obj.target/native_metrics/src/native_metrics.o.d +++ /dev/null @@ -1,162 +0,0 @@ -cmd_Release/obj.target/native_metrics/src/native_metrics.o := c++ -o Release/obj.target/native_metrics/src/native_metrics.o ../src/native_metrics.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/native_metrics.o.d.raw -c -Release/obj.target/native_metrics/src/native_metrics.o: \ - ../src/native_metrics.cpp \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h \ - /Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h \ - ../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h \ - ../src/GCBinder.hpp ../src/Metric.hpp ../src/LoopChecker.hpp -../src/native_metrics.cpp: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h: -/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h: -../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h: -../src/GCBinder.hpp: -../src/Metric.hpp: -../src/LoopChecker.hpp: diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/_newrelic_native_metrics-9_0_0-native_metrics-115-darwin-arm64.node b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/_newrelic_native_metrics-9_0_0-native_metrics-115-darwin-arm64.node deleted file mode 100755 index 785c7dc67..000000000 Binary files a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/_newrelic_native_metrics-9_0_0-native_metrics-115-darwin-arm64.node and /dev/null differ diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/GCBinder.o b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/GCBinder.o deleted file mode 100644 index 13f7da358..000000000 Binary files a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/GCBinder.o and /dev/null differ diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/LoopChecker.o b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/LoopChecker.o deleted file mode 100644 index c24dc9318..000000000 Binary files a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/LoopChecker.o and /dev/null differ diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/native_metrics.o b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/native_metrics.o deleted file mode 100644 index 9102b46e4..000000000 Binary files a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/Release/obj.target/native_metrics/src/native_metrics.o and /dev/null differ diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/binding.Makefile b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/binding.Makefile deleted file mode 100644 index 3c683fda3..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/binding.Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# This file is generated by gyp; do not edit. - -export builddir_name ?= ./build/. -.PHONY: all -all: - $(MAKE) native_metrics diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi deleted file mode 100644 index b569d4e66..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi +++ /dev/null @@ -1,412 +0,0 @@ -# Do not edit. File was generated by node-gyp's "configure" step -{ - "target_defaults": { - "cflags": [], - "default_configuration": "Release", - "defines": [], - "include_dirs": [], - "libraries": [], - "msvs_configuration_platform": "ARM64", - "xcode_configuration_platform": "arm64" - }, - "variables": { - "arm_fpu": "neon", - "asan": 0, - "coverage": "false", - "dcheck_always_on": 0, - "debug_nghttp2": "false", - "debug_node": "false", - "enable_lto": "false", - "enable_pgo_generate": "false", - "enable_pgo_use": "false", - "error_on_warn": "false", - "force_dynamic_crt": 0, - "host_arch": "arm64", - "icu_data_in": "../../deps/icu-tmp/icudt73l.dat", - "icu_endianness": "l", - "icu_gyp_path": "tools/icu/icu-generic.gyp", - "icu_path": "deps/icu-small", - "icu_small": "false", - "icu_ver_major": "73", - "is_debug": 0, - "libdir": "lib", - "llvm_version": "13.0", - "napi_build_version": "8", - "node_builtin_shareable_builtins": [ - "deps/cjs-module-lexer/lexer.js", - "deps/cjs-module-lexer/dist/lexer.js", - "deps/undici/undici.js" - ], - "node_byteorder": "little", - "node_debug_lib": "false", - "node_enable_d8": "false", - "node_enable_v8_vtunejit": "false", - "node_fipsinstall": "false", - "node_install_corepack": "true", - "node_install_npm": "true", - "node_library_files": [ - "lib/_http_agent.js", - "lib/_http_client.js", - "lib/_http_common.js", - "lib/_http_incoming.js", - "lib/_http_outgoing.js", - "lib/_http_server.js", - "lib/_stream_duplex.js", - "lib/_stream_passthrough.js", - "lib/_stream_readable.js", - "lib/_stream_transform.js", - "lib/_stream_wrap.js", - "lib/_stream_writable.js", - "lib/_tls_common.js", - "lib/_tls_wrap.js", - "lib/assert.js", - "lib/assert/strict.js", - "lib/async_hooks.js", - "lib/buffer.js", - "lib/child_process.js", - "lib/cluster.js", - "lib/console.js", - "lib/constants.js", - "lib/crypto.js", - "lib/dgram.js", - "lib/diagnostics_channel.js", - "lib/dns.js", - "lib/dns/promises.js", - "lib/domain.js", - "lib/events.js", - "lib/fs.js", - "lib/fs/promises.js", - "lib/http.js", - "lib/http2.js", - "lib/https.js", - "lib/inspector.js", - "lib/inspector/promises.js", - "lib/internal/abort_controller.js", - "lib/internal/assert.js", - "lib/internal/assert/assertion_error.js", - "lib/internal/assert/calltracker.js", - "lib/internal/async_hooks.js", - "lib/internal/blob.js", - "lib/internal/blocklist.js", - "lib/internal/bootstrap/node.js", - "lib/internal/bootstrap/realm.js", - "lib/internal/bootstrap/switches/does_not_own_process_state.js", - "lib/internal/bootstrap/switches/does_own_process_state.js", - "lib/internal/bootstrap/switches/is_main_thread.js", - "lib/internal/bootstrap/switches/is_not_main_thread.js", - "lib/internal/bootstrap/web/exposed-wildcard.js", - "lib/internal/bootstrap/web/exposed-window-or-worker.js", - "lib/internal/buffer.js", - "lib/internal/child_process.js", - "lib/internal/child_process/serialization.js", - "lib/internal/cli_table.js", - "lib/internal/cluster/child.js", - "lib/internal/cluster/primary.js", - "lib/internal/cluster/round_robin_handle.js", - "lib/internal/cluster/shared_handle.js", - "lib/internal/cluster/utils.js", - "lib/internal/cluster/worker.js", - "lib/internal/console/constructor.js", - "lib/internal/console/global.js", - "lib/internal/constants.js", - "lib/internal/crypto/aes.js", - "lib/internal/crypto/certificate.js", - "lib/internal/crypto/cfrg.js", - "lib/internal/crypto/cipher.js", - "lib/internal/crypto/diffiehellman.js", - "lib/internal/crypto/ec.js", - "lib/internal/crypto/hash.js", - "lib/internal/crypto/hashnames.js", - "lib/internal/crypto/hkdf.js", - "lib/internal/crypto/keygen.js", - "lib/internal/crypto/keys.js", - "lib/internal/crypto/mac.js", - "lib/internal/crypto/pbkdf2.js", - "lib/internal/crypto/random.js", - "lib/internal/crypto/rsa.js", - "lib/internal/crypto/scrypt.js", - "lib/internal/crypto/sig.js", - "lib/internal/crypto/util.js", - "lib/internal/crypto/webcrypto.js", - "lib/internal/crypto/webidl.js", - "lib/internal/crypto/x509.js", - "lib/internal/debugger/inspect.js", - "lib/internal/debugger/inspect_client.js", - "lib/internal/debugger/inspect_repl.js", - "lib/internal/dgram.js", - "lib/internal/dns/callback_resolver.js", - "lib/internal/dns/promises.js", - "lib/internal/dns/utils.js", - "lib/internal/encoding.js", - "lib/internal/error_serdes.js", - "lib/internal/errors.js", - "lib/internal/event_target.js", - "lib/internal/events/symbols.js", - "lib/internal/file.js", - "lib/internal/fixed_queue.js", - "lib/internal/freelist.js", - "lib/internal/freeze_intrinsics.js", - "lib/internal/fs/cp/cp-sync.js", - "lib/internal/fs/cp/cp.js", - "lib/internal/fs/dir.js", - "lib/internal/fs/promises.js", - "lib/internal/fs/read_file_context.js", - "lib/internal/fs/recursive_watch.js", - "lib/internal/fs/rimraf.js", - "lib/internal/fs/streams.js", - "lib/internal/fs/sync_write_stream.js", - "lib/internal/fs/utils.js", - "lib/internal/fs/watchers.js", - "lib/internal/heap_utils.js", - "lib/internal/histogram.js", - "lib/internal/http.js", - "lib/internal/http2/compat.js", - "lib/internal/http2/core.js", - "lib/internal/http2/util.js", - "lib/internal/idna.js", - "lib/internal/inspector_async_hook.js", - "lib/internal/js_stream_socket.js", - "lib/internal/legacy/processbinding.js", - "lib/internal/linkedlist.js", - "lib/internal/main/check_syntax.js", - "lib/internal/main/embedding.js", - "lib/internal/main/eval_stdin.js", - "lib/internal/main/eval_string.js", - "lib/internal/main/inspect.js", - "lib/internal/main/mksnapshot.js", - "lib/internal/main/print_help.js", - "lib/internal/main/prof_process.js", - "lib/internal/main/repl.js", - "lib/internal/main/run_main_module.js", - "lib/internal/main/test_runner.js", - "lib/internal/main/watch_mode.js", - "lib/internal/main/worker_thread.js", - "lib/internal/mime.js", - "lib/internal/modules/cjs/loader.js", - "lib/internal/modules/esm/assert.js", - "lib/internal/modules/esm/create_dynamic_module.js", - "lib/internal/modules/esm/fetch_module.js", - "lib/internal/modules/esm/formats.js", - "lib/internal/modules/esm/get_format.js", - "lib/internal/modules/esm/handle_process_exit.js", - "lib/internal/modules/esm/hooks.js", - "lib/internal/modules/esm/initialize_import_meta.js", - "lib/internal/modules/esm/load.js", - "lib/internal/modules/esm/loader.js", - "lib/internal/modules/esm/module_job.js", - "lib/internal/modules/esm/module_map.js", - "lib/internal/modules/esm/package_config.js", - "lib/internal/modules/esm/resolve.js", - "lib/internal/modules/esm/shared_constants.js", - "lib/internal/modules/esm/translators.js", - "lib/internal/modules/esm/utils.js", - "lib/internal/modules/esm/worker.js", - "lib/internal/modules/helpers.js", - "lib/internal/modules/package_json_reader.js", - "lib/internal/modules/run_main.js", - "lib/internal/net.js", - "lib/internal/options.js", - "lib/internal/per_context/domexception.js", - "lib/internal/per_context/messageport.js", - "lib/internal/per_context/primordials.js", - "lib/internal/perf/event_loop_delay.js", - "lib/internal/perf/event_loop_utilization.js", - "lib/internal/perf/nodetiming.js", - "lib/internal/perf/observe.js", - "lib/internal/perf/performance.js", - "lib/internal/perf/performance_entry.js", - "lib/internal/perf/resource_timing.js", - "lib/internal/perf/timerify.js", - "lib/internal/perf/usertiming.js", - "lib/internal/perf/utils.js", - "lib/internal/policy/manifest.js", - "lib/internal/policy/sri.js", - "lib/internal/priority_queue.js", - "lib/internal/process/esm_loader.js", - "lib/internal/process/execution.js", - "lib/internal/process/per_thread.js", - "lib/internal/process/permission.js", - "lib/internal/process/policy.js", - "lib/internal/process/pre_execution.js", - "lib/internal/process/promises.js", - "lib/internal/process/report.js", - "lib/internal/process/signal.js", - "lib/internal/process/task_queues.js", - "lib/internal/process/warning.js", - "lib/internal/process/worker_thread_only.js", - "lib/internal/promise_hooks.js", - "lib/internal/querystring.js", - "lib/internal/readline/callbacks.js", - "lib/internal/readline/emitKeypressEvents.js", - "lib/internal/readline/interface.js", - "lib/internal/readline/promises.js", - "lib/internal/readline/utils.js", - "lib/internal/repl.js", - "lib/internal/repl/await.js", - "lib/internal/repl/history.js", - "lib/internal/repl/utils.js", - "lib/internal/socket_list.js", - "lib/internal/socketaddress.js", - "lib/internal/source_map/prepare_stack_trace.js", - "lib/internal/source_map/source_map.js", - "lib/internal/source_map/source_map_cache.js", - "lib/internal/stream_base_commons.js", - "lib/internal/streams/add-abort-signal.js", - "lib/internal/streams/buffer_list.js", - "lib/internal/streams/compose.js", - "lib/internal/streams/destroy.js", - "lib/internal/streams/duplex.js", - "lib/internal/streams/duplexify.js", - "lib/internal/streams/end-of-stream.js", - "lib/internal/streams/from.js", - "lib/internal/streams/lazy_transform.js", - "lib/internal/streams/legacy.js", - "lib/internal/streams/operators.js", - "lib/internal/streams/passthrough.js", - "lib/internal/streams/pipeline.js", - "lib/internal/streams/readable.js", - "lib/internal/streams/state.js", - "lib/internal/streams/transform.js", - "lib/internal/streams/utils.js", - "lib/internal/streams/writable.js", - "lib/internal/structured_clone.js", - "lib/internal/test/binding.js", - "lib/internal/test/transfer.js", - "lib/internal/test_runner/coverage.js", - "lib/internal/test_runner/harness.js", - "lib/internal/test_runner/mock.js", - "lib/internal/test_runner/reporter/dot.js", - "lib/internal/test_runner/reporter/spec.js", - "lib/internal/test_runner/reporter/tap.js", - "lib/internal/test_runner/reporter/v8-serializer.js", - "lib/internal/test_runner/runner.js", - "lib/internal/test_runner/test.js", - "lib/internal/test_runner/tests_stream.js", - "lib/internal/test_runner/utils.js", - "lib/internal/timers.js", - "lib/internal/tls/secure-context.js", - "lib/internal/tls/secure-pair.js", - "lib/internal/trace_events_async_hooks.js", - "lib/internal/tty.js", - "lib/internal/url.js", - "lib/internal/util.js", - "lib/internal/util/colors.js", - "lib/internal/util/comparisons.js", - "lib/internal/util/debuglog.js", - "lib/internal/util/embedding.js", - "lib/internal/util/inspect.js", - "lib/internal/util/inspector.js", - "lib/internal/util/iterable_weak_map.js", - "lib/internal/util/parse_args/parse_args.js", - "lib/internal/util/parse_args/utils.js", - "lib/internal/util/types.js", - "lib/internal/v8/startup_snapshot.js", - "lib/internal/v8_prof_polyfill.js", - "lib/internal/v8_prof_processor.js", - "lib/internal/validators.js", - "lib/internal/vm.js", - "lib/internal/vm/module.js", - "lib/internal/wasm_web_api.js", - "lib/internal/watch_mode/files_watcher.js", - "lib/internal/watchdog.js", - "lib/internal/webidl.js", - "lib/internal/webstreams/adapters.js", - "lib/internal/webstreams/compression.js", - "lib/internal/webstreams/encoding.js", - "lib/internal/webstreams/queuingstrategies.js", - "lib/internal/webstreams/readablestream.js", - "lib/internal/webstreams/transfer.js", - "lib/internal/webstreams/transformstream.js", - "lib/internal/webstreams/util.js", - "lib/internal/webstreams/writablestream.js", - "lib/internal/worker.js", - "lib/internal/worker/io.js", - "lib/internal/worker/js_transferable.js", - "lib/module.js", - "lib/net.js", - "lib/os.js", - "lib/path.js", - "lib/path/posix.js", - "lib/path/win32.js", - "lib/perf_hooks.js", - "lib/process.js", - "lib/punycode.js", - "lib/querystring.js", - "lib/readline.js", - "lib/readline/promises.js", - "lib/repl.js", - "lib/stream.js", - "lib/stream/consumers.js", - "lib/stream/promises.js", - "lib/stream/web.js", - "lib/string_decoder.js", - "lib/sys.js", - "lib/test.js", - "lib/test/reporters.js", - "lib/timers.js", - "lib/timers/promises.js", - "lib/tls.js", - "lib/trace_events.js", - "lib/tty.js", - "lib/url.js", - "lib/util.js", - "lib/util/types.js", - "lib/v8.js", - "lib/vm.js", - "lib/wasi.js", - "lib/worker_threads.js", - "lib/zlib.js" - ], - "node_module_version": 115, - "node_no_browser_globals": "false", - "node_prefix": "/", - "node_release_urlbase": "https://nodejs.org/download/release/", - "node_shared": "false", - "node_shared_brotli": "false", - "node_shared_cares": "false", - "node_shared_http_parser": "false", - "node_shared_libuv": "false", - "node_shared_nghttp2": "false", - "node_shared_nghttp3": "false", - "node_shared_ngtcp2": "false", - "node_shared_openssl": "false", - "node_shared_zlib": "false", - "node_tag": "", - "node_target_type": "executable", - "node_use_bundled_v8": "true", - "node_use_node_code_cache": "true", - "node_use_node_snapshot": "true", - "node_use_openssl": "true", - "node_use_v8_platform": "true", - "node_with_ltcg": "false", - "node_without_node_options": "false", - "openssl_is_fips": "false", - "openssl_quic": "true", - "ossfuzz": "false", - "shlib_suffix": "115.dylib", - "single_executable_application": "true", - "target_arch": "arm64", - "v8_enable_31bit_smis_on_64bit_arch": 0, - "v8_enable_gdbjit": 0, - "v8_enable_hugepage": 0, - "v8_enable_i18n_support": 1, - "v8_enable_inspector": 1, - "v8_enable_javascript_promise_hooks": 1, - "v8_enable_lite_mode": 0, - "v8_enable_object_print": 1, - "v8_enable_pointer_compression": 0, - "v8_enable_shared_ro_heap": 1, - "v8_enable_webassembly": 1, - "v8_no_strict_aliasing": 1, - "v8_optimized_debug": 1, - "v8_promise_internal_field_count": 1, - "v8_random_seed": 0, - "v8_trace_maps": 0, - "v8_use_siphash": 1, - "want_separate_host_toolset": 0, - "xcode_version": "13.0", - "nodedir": "/Users/karolsojko/Library/Caches/node-gyp/20.2.0", - "standalone_static_library": 1, - "user_agent": "yarn/4.0.0-rc.43 npm/? node/v20.2.0 darwin arm64" - } -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/gyp-mac-tool b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/gyp-mac-tool deleted file mode 100755 index ffef860c4..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/gyp-mac-tool +++ /dev/null @@ -1,772 +0,0 @@ -#!/usr/bin/env python3 -# Generated by gyp. Do not edit. -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions to perform Xcode-style build steps. - -These functions are executed via gyp-mac-tool when using the Makefile generator. -""" - - -import fcntl -import fnmatch -import glob -import json -import os -import plistlib -import re -import shutil -import struct -import subprocess -import sys -import tempfile - - -def main(args): - executor = MacTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) - - -class MacTool: - """This class performs all the Mac tooling steps. The methods can either be - executed directly, or dispatched from an argument list.""" - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace("-", "") - - def ExecCopyBundleResource(self, source, dest, convert_to_binary): - """Copies a resource file to the bundle/Resources directory, performing any - necessary compilation on each resource.""" - convert_to_binary = convert_to_binary == "True" - extension = os.path.splitext(source)[1].lower() - if os.path.isdir(source): - # Copy tree. - # TODO(thakis): This copies file attributes like mtime, while the - # single-file branch below doesn't. This should probably be changed to - # be consistent with the single-file branch. - if os.path.exists(dest): - shutil.rmtree(dest) - shutil.copytree(source, dest) - elif extension == ".xib": - return self._CopyXIBFile(source, dest) - elif extension == ".storyboard": - return self._CopyXIBFile(source, dest) - elif extension == ".strings" and not convert_to_binary: - self._CopyStringsFile(source, dest) - else: - if os.path.exists(dest): - os.unlink(dest) - shutil.copy(source, dest) - - if convert_to_binary and extension in (".plist", ".strings"): - self._ConvertToBinary(dest) - - def _CopyXIBFile(self, source, dest): - """Compiles a XIB file with ibtool into a binary plist in the bundle.""" - - # ibtool sometimes crashes with relative paths. See crbug.com/314728. - base = os.path.dirname(os.path.realpath(__file__)) - if os.path.relpath(source): - source = os.path.join(base, source) - if os.path.relpath(dest): - dest = os.path.join(base, dest) - - args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"] - - if os.environ["XCODE_VERSION_ACTUAL"] > "0700": - args.extend(["--auto-activate-custom-fonts"]) - if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ: - args.extend( - [ - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - ] - ) - else: - args.extend( - [ - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - ] - ) - - args.extend( - ["--output-format", "human-readable-text", "--compile", dest, source] - ) - - ibtool_section_re = re.compile(r"/\*.*\*/") - ibtool_re = re.compile(r".*note:.*is clipping its content") - try: - stdout = subprocess.check_output(args) - except subprocess.CalledProcessError as e: - print(e.output) - raise - current_section_header = None - for line in stdout.splitlines(): - if ibtool_section_re.match(line): - current_section_header = line - elif not ibtool_re.match(line): - if current_section_header: - print(current_section_header) - current_section_header = None - print(line) - return 0 - - def _ConvertToBinary(self, dest): - subprocess.check_call( - ["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest] - ) - - def _CopyStringsFile(self, source, dest): - """Copies a .strings file using iconv to reconvert the input into UTF-16.""" - input_code = self._DetectInputEncoding(source) or "UTF-8" - - # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call - # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints - # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing - # semicolon in dictionary. - # on invalid files. Do the same kind of validation. - import CoreFoundation - - with open(source, "rb") as in_file: - s = in_file.read() - d = CoreFoundation.CFDataCreate(None, s, len(s)) - _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) - if error: - return - - with open(dest, "wb") as fp: - fp.write(s.decode(input_code).encode("UTF-16")) - - def _DetectInputEncoding(self, file_name): - """Reads the first few bytes from file_name and tries to guess the text - encoding. Returns None as a guess if it can't detect it.""" - with open(file_name, "rb") as fp: - try: - header = fp.read(3) - except Exception: - return None - if header.startswith(b"\xFE\xFF"): - return "UTF-16" - elif header.startswith(b"\xFF\xFE"): - return "UTF-16" - elif header.startswith(b"\xEF\xBB\xBF"): - return "UTF-8" - else: - return None - - def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): - """Copies the |source| Info.plist to the destination directory |dest|.""" - # Read the source Info.plist into memory. - with open(source) as fd: - lines = fd.read() - - # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). - plist = plistlib.readPlistFromString(lines) - if keys: - plist.update(json.loads(keys[0])) - lines = plistlib.writePlistToString(plist) - - # Go through all the environment variables and replace them as variables in - # the file. - IDENT_RE = re.compile(r"[_/\s]") - for key in os.environ: - if key.startswith("_"): - continue - evar = "${%s}" % key - evalue = os.environ[key] - lines = lines.replace(lines, evar, evalue) - - # Xcode supports various suffices on environment variables, which are - # all undocumented. :rfc1034identifier is used in the standard project - # template these days, and :identifier was used earlier. They are used to - # convert non-url characters into things that look like valid urls -- - # except that the replacement character for :identifier, '_' isn't valid - # in a URL either -- oops, hence :rfc1034identifier was born. - evar = "${%s:identifier}" % key - evalue = IDENT_RE.sub("_", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - evar = "${%s:rfc1034identifier}" % key - evalue = IDENT_RE.sub("-", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - # Remove any keys with values that haven't been replaced. - lines = lines.splitlines() - for i in range(len(lines)): - if lines[i].strip().startswith("${"): - lines[i] = None - lines[i - 1] = None - lines = "\n".join(line for line in lines if line is not None) - - # Write out the file with variables replaced. - with open(dest, "w") as fd: - fd.write(lines) - - # Now write out PkgInfo file now that the Info.plist file has been - # "compiled". - self._WritePkgInfo(dest) - - if convert_to_binary == "True": - self._ConvertToBinary(dest) - - def _WritePkgInfo(self, info_plist): - """This writes the PkgInfo file from the data stored in Info.plist.""" - plist = plistlib.readPlist(info_plist) - if not plist: - return - - # Only create PkgInfo for executable types. - package_type = plist["CFBundlePackageType"] - if package_type != "APPL": - return - - # The format of PkgInfo is eight characters, representing the bundle type - # and bundle signature, each four characters. If that is missing, four - # '?' characters are used instead. - signature_code = plist.get("CFBundleSignature", "????") - if len(signature_code) != 4: # Wrong length resets everything, too. - signature_code = "?" * 4 - - dest = os.path.join(os.path.dirname(info_plist), "PkgInfo") - with open(dest, "w") as fp: - fp.write(f"{package_type}{signature_code}") - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - fcntl.flock(fd, fcntl.LOCK_EX) - return subprocess.call(cmd_list) - - def ExecFilterLibtool(self, *cmd_list): - """Calls libtool and filters out '/path/to/libtool: file: foo.o has no - symbols'.""" - libtool_re = re.compile( - r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$" - ) - libtool_re5 = re.compile( - r"^.*libtool: warning for library: " - + r".* the table of contents is empty " - + r"\(no object file members in the library define global symbols\)$" - ) - env = os.environ.copy() - # Ref: - # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c - # The problem with this flag is that it resets the file mtime on the file to - # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. - env["ZERO_AR_DATE"] = "1" - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) - err = libtoolout.communicate()[1].decode("utf-8") - for line in err.splitlines(): - if not libtool_re.match(line) and not libtool_re5.match(line): - print(line, file=sys.stderr) - # Unconditionally touch the output .a file on the command line if present - # and the command succeeded. A bit hacky. - if not libtoolout.returncode: - for i in range(len(cmd_list) - 1): - if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"): - os.utime(cmd_list[i + 1], None) - break - return libtoolout.returncode - - def ExecPackageIosFramework(self, framework): - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - module_path = os.path.join(framework, "Modules") - if not os.path.exists(module_path): - os.mkdir(module_path) - module_template = ( - "framework module %s {\n" - ' umbrella header "%s.h"\n' - "\n" - " export *\n" - " module * { export * }\n" - "}\n" % (binary, binary) - ) - - with open(os.path.join(module_path, "module.modulemap"), "w") as module_file: - module_file.write(module_template) - - def ExecPackageFramework(self, framework, version): - """Takes a path to Something.framework and the Current version of that and - sets up all the symlinks.""" - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - - CURRENT = "Current" - RESOURCES = "Resources" - VERSIONS = "Versions" - - if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): - # Binary-less frameworks don't seem to contain symlinks (see e.g. - # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). - return - - # Move into the framework directory to set the symlinks correctly. - pwd = os.getcwd() - os.chdir(framework) - - # Set up the Current version. - self._Relink(version, os.path.join(VERSIONS, CURRENT)) - - # Set up the root symlinks. - self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) - self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) - - # Back to where we were before! - os.chdir(pwd) - - def _Relink(self, dest, link): - """Creates a symlink to |dest| named |link|. If |link| already exists, - it is overwritten.""" - if os.path.lexists(link): - os.remove(link) - os.symlink(dest, link) - - def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): - framework_name = os.path.basename(framework).split(".")[0] - all_headers = [os.path.abspath(header) for header in all_headers] - filelist = {} - for header in all_headers: - filename = os.path.basename(header) - filelist[filename] = header - filelist[os.path.join(framework_name, filename)] = header - WriteHmap(out, filelist) - - def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers): - header_path = os.path.join(framework, "Headers") - if not os.path.exists(header_path): - os.makedirs(header_path) - for header in copy_headers: - shutil.copy(header, os.path.join(header_path, os.path.basename(header))) - - def ExecCompileXcassets(self, keys, *inputs): - """Compiles multiple .xcassets files into a single .car file. - - This invokes 'actool' to compile all the inputs .xcassets files. The - |keys| arguments is a json-encoded dictionary of extra arguments to - pass to 'actool' when the asset catalogs contains an application icon - or a launch image. - - Note that 'actool' does not create the Assets.car file if the asset - catalogs does not contains imageset. - """ - command_line = [ - "xcrun", - "actool", - "--output-format", - "human-readable-text", - "--compress-pngs", - "--notices", - "--warnings", - "--errors", - ] - is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ - if is_iphone_target: - platform = os.environ["CONFIGURATION"].split("-")[-1] - if platform not in ("iphoneos", "iphonesimulator"): - platform = "iphonesimulator" - command_line.extend( - [ - "--platform", - platform, - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]), - ] - ) - else: - command_line.extend( - [ - "--platform", - "macosx", - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]), - ] - ) - if keys: - keys = json.loads(keys) - for key, value in keys.items(): - arg_name = "--" + key - if isinstance(value, bool): - if value: - command_line.append(arg_name) - elif isinstance(value, list): - for v in value: - command_line.append(arg_name) - command_line.append(str(v)) - else: - command_line.append(arg_name) - command_line.append(str(value)) - # Note: actool crashes if inputs path are relative, so use os.path.abspath - # to get absolute path name for inputs. - command_line.extend(map(os.path.abspath, inputs)) - subprocess.check_call(command_line) - - def ExecMergeInfoPlist(self, output, *inputs): - """Merge multiple .plist files into a single .plist file.""" - merged_plist = {} - for path in inputs: - plist = self._LoadPlistMaybeBinary(path) - self._MergePlist(merged_plist, plist) - plistlib.writePlist(merged_plist, output) - - def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): - """Code sign a bundle. - - This function tries to code sign an iOS bundle, following the same - algorithm as Xcode: - 1. pick the provisioning profile that best match the bundle identifier, - and copy it into the bundle as embedded.mobileprovision, - 2. copy Entitlements.plist from user or SDK next to the bundle, - 3. code sign the bundle. - """ - substitutions, overrides = self._InstallProvisioningProfile( - provisioning, self._GetCFBundleIdentifier() - ) - entitlements_path = self._InstallEntitlements( - entitlements, substitutions, overrides - ) - - args = ["codesign", "--force", "--sign", key] - if preserve == "True": - args.extend(["--deep", "--preserve-metadata=identifier,entitlements"]) - else: - args.extend(["--entitlements", entitlements_path]) - args.extend(["--timestamp=none", path]) - subprocess.check_call(args) - - def _InstallProvisioningProfile(self, profile, bundle_identifier): - """Installs embedded.mobileprovision into the bundle. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple containing two dictionary: variables substitutions and values - to overrides when generating the entitlements file. - """ - source_path, provisioning_data, team_id = self._FindProvisioningProfile( - profile, bundle_identifier - ) - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], - os.environ["CONTENTS_FOLDER_PATH"], - "embedded.mobileprovision", - ) - shutil.copy2(source_path, target_path) - substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".") - return substitutions, provisioning_data["Entitlements"] - - def _FindProvisioningProfile(self, profile, bundle_identifier): - """Finds the .mobileprovision file to use for signing the bundle. - - Checks all the installed provisioning profiles (or if the user specified - the PROVISIONING_PROFILE variable, only consult it) and select the most - specific that correspond to the bundle identifier. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple of the path to the selected provisioning profile, the data of - the embedded plist in the provisioning profile and the team identifier - to use for code signing. - - Raises: - SystemExit: if no .mobileprovision can be used to sign the bundle. - """ - profiles_dir = os.path.join( - os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles" - ) - if not os.path.isdir(profiles_dir): - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - provisioning_profiles = None - if profile: - profile_path = os.path.join(profiles_dir, profile + ".mobileprovision") - if os.path.exists(profile_path): - provisioning_profiles = [profile_path] - if not provisioning_profiles: - provisioning_profiles = glob.glob( - os.path.join(profiles_dir, "*.mobileprovision") - ) - valid_provisioning_profiles = {} - for profile_path in provisioning_profiles: - profile_data = self._LoadProvisioningProfile(profile_path) - app_id_pattern = profile_data.get("Entitlements", {}).get( - "application-identifier", "" - ) - for team_identifier in profile_data.get("TeamIdentifier", []): - app_id = f"{team_identifier}.{bundle_identifier}" - if fnmatch.fnmatch(app_id, app_id_pattern): - valid_provisioning_profiles[app_id_pattern] = ( - profile_path, - profile_data, - team_identifier, - ) - if not valid_provisioning_profiles: - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - # If the user has multiple provisioning profiles installed that can be - # used for ${bundle_identifier}, pick the most specific one (ie. the - # provisioning profile whose pattern is the longest). - selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) - return valid_provisioning_profiles[selected_key] - - def _LoadProvisioningProfile(self, profile_path): - """Extracts the plist embedded in a provisioning profile. - - Args: - profile_path: string, path to the .mobileprovision file - - Returns: - Content of the plist embedded in the provisioning profile as a dictionary. - """ - with tempfile.NamedTemporaryFile() as temp: - subprocess.check_call( - ["security", "cms", "-D", "-i", profile_path, "-o", temp.name] - ) - return self._LoadPlistMaybeBinary(temp.name) - - def _MergePlist(self, merged_plist, plist): - """Merge |plist| into |merged_plist|.""" - for key, value in plist.items(): - if isinstance(value, dict): - merged_value = merged_plist.get(key, {}) - if isinstance(merged_value, dict): - self._MergePlist(merged_value, value) - merged_plist[key] = merged_value - else: - merged_plist[key] = value - else: - merged_plist[key] = value - - def _LoadPlistMaybeBinary(self, plist_path): - """Loads into a memory a plist possibly encoded in binary format. - - This is a wrapper around plistlib.readPlist that tries to convert the - plist to the XML format if it can't be parsed (assuming that it is in - the binary format). - - Args: - plist_path: string, path to a plist file, in XML or binary format - - Returns: - Content of the plist as a dictionary. - """ - try: - # First, try to read the file using plistlib that only supports XML, - # and if an exception is raised, convert a temporary copy to XML and - # load that copy. - return plistlib.readPlist(plist_path) - except Exception: - pass - with tempfile.NamedTemporaryFile() as temp: - shutil.copy2(plist_path, temp.name) - subprocess.check_call(["plutil", "-convert", "xml1", temp.name]) - return plistlib.readPlist(temp.name) - - def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): - """Constructs a dictionary of variable substitutions for Entitlements.plist. - - Args: - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - app_identifier_prefix: string, value for AppIdentifierPrefix - - Returns: - Dictionary of substitutions to apply when generating Entitlements.plist. - """ - return { - "CFBundleIdentifier": bundle_identifier, - "AppIdentifierPrefix": app_identifier_prefix, - } - - def _GetCFBundleIdentifier(self): - """Extracts CFBundleIdentifier value from Info.plist in the bundle. - - Returns: - Value of CFBundleIdentifier in the Info.plist located in the bundle. - """ - info_plist_path = os.path.join( - os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"] - ) - info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) - return info_plist_data["CFBundleIdentifier"] - - def _InstallEntitlements(self, entitlements, substitutions, overrides): - """Generates and install the ${BundleName}.xcent entitlements file. - - Expands variables "$(variable)" pattern in the source entitlements file, - add extra entitlements defined in the .mobileprovision file and the copy - the generated plist to "${BundlePath}.xcent". - - Args: - entitlements: string, optional, path to the Entitlements.plist template - to use, defaults to "${SDKROOT}/Entitlements.plist" - substitutions: dictionary, variable substitutions - overrides: dictionary, values to add to the entitlements - - Returns: - Path to the generated entitlements file. - """ - source_path = entitlements - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent" - ) - if not source_path: - source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist") - shutil.copy2(source_path, target_path) - data = self._LoadPlistMaybeBinary(target_path) - data = self._ExpandVariables(data, substitutions) - if overrides: - for key in overrides: - if key not in data: - data[key] = overrides[key] - plistlib.writePlist(data, target_path) - return target_path - - def _ExpandVariables(self, data, substitutions): - """Expands variables "$(variable)" in data. - - Args: - data: object, can be either string, list or dictionary - substitutions: dictionary, variable substitutions to perform - - Returns: - Copy of data where each references to "$(variable)" has been replaced - by the corresponding value found in substitutions, or left intact if - the key was not found. - """ - if isinstance(data, str): - for key, value in substitutions.items(): - data = data.replace("$(%s)" % key, value) - return data - if isinstance(data, list): - return [self._ExpandVariables(v, substitutions) for v in data] - if isinstance(data, dict): - return {k: self._ExpandVariables(data[k], substitutions) for k in data} - return data - - -def NextGreaterPowerOf2(x): - return 2 ** (x).bit_length() - - -def WriteHmap(output_name, filelist): - """Generates a header map based on |filelist|. - - Per Mark Mentovai: - A header map is structured essentially as a hash table, keyed by names used - in #includes, and providing pathnames to the actual files. - - The implementation below and the comment above comes from inspecting: - http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt - while also looking at the implementation in clang in: - https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp - """ - magic = 1751998832 - version = 1 - _reserved = 0 - count = len(filelist) - capacity = NextGreaterPowerOf2(count) - strings_offset = 24 + (12 * capacity) - max_value_length = max(len(value) for value in filelist.values()) - - out = open(output_name, "wb") - out.write( - struct.pack( - "=18')) { - GC_TYPE_NAMES = { - 1: 'Scavenge', - 2: 'MinorMarkCompact', - 4: 'MarkSweepCompact', - 8: 'IncrementalMarking', - 16: 'ProcessWeakCallbacks', - 31: 'All' - } -} else { - GC_TYPE_NAMES = { - 1: 'Scavenge', - 2: 'MarkSweepCompact', - 4: 'IncrementalMarking', - 8: 'ProcessWeakCallbacks', - - 3: 'All', // Node v4 and earlier only have Scavenge and MarkSweepCompact. - 15: 'All' - } -} - -/** - * Constructs a metric emitter. This constructor is for internal use only. - * - * {@link NativeMetricEmitter#bind} is called as part of construction. - * - * @constructor - * @classdesc - * Emits events for various native events or periodic sampling. - * - * @param {number} [opts.timeout] - * The number of milliseconds between samplings. Defaults to 15 seconds. - */ -function NativeMetricEmitter(opts) { - opts = opts || { timeout: DEFAULT_TIMEOUT } - EventEmitter.call(this) - this.bound = false - this._timeout = null - - this._gcBinder = new natives.GCBinder() - this.gcEnabled = true - - this._loopChecker = new natives.LoopChecker() - this.loopEnabled = true - - this.bind(opts.timeout) -} -util.inherits(NativeMetricEmitter, EventEmitter) - -/** - * @interface LoopMetrics - * - * @description - * A mapping of loop concepts to metrics about them. All values are in - * microseconds. - * - * @property {Metric} usage - CPU usage per tick metrics. - */ - -/** - * @interface GCMetrics - * - * @description - * Garbage collection results. - * - * @property {number} typeId - The numeric ID of the gc type. - * @property {string} type - The nice name version of the gc type. - * @property {Metric} metrics - Accumulated metric data in milliseconds. - */ - -/** - * @interface Metric - * - * @description - * A bundle of values taken from some measurement. - * - * @property {number} total - The sum of all values measured. - * @property {number} min - The smallest value measured. - * @property {number} max - The largest value measured. - * @property {number} sumOfSquares - The sum of the square of each value. - * @property {number} count - The number of values measured. - */ - -/** - * Binds the emitter to the internal, V8 hooks to start populating data. - * - * @fires NativeMetricEmitter#gc - * @fires NativeMetricEmitter#usage - * - * @param {number} [timeout] - * The number of milliseconds between samplings. Defaults to 15 seconds. - */ -NativeMetricEmitter.prototype.bind = function bind() { - if (this.bound) { - return - } - - this._gcBinder.bind() - this._loopChecker.bind() - - this.bound = true -} - -/** - * Removes internal hooks and stops any open sampling timers. - */ -NativeMetricEmitter.prototype.unbind = function unbind() { - if (!this.bound) { - return - } - - this._gcBinder.unbind() - this._loopChecker.unbind() - this.bound = false -} - -/** - * Retrieves the current loop metrics and resets the counters. - * - * @return {LoopMetrics} The current loop metrics. - */ -NativeMetricEmitter.prototype.getLoopMetrics = function getLoopMetrics() { - return this._loopChecker.read() -} - -/** - * Retrieves the accumulated garbage collection metrics. - * - * After retrieval, the metrics are reset internally. Only GC types that have - * happened at least once since the last retrieval are returned. - * - * @return {object.} An object mapping GC type names to - * information on the GC events that happened. - */ -NativeMetricEmitter.prototype.getGCMetrics = function getGCMetrics() { - const gcMetrics = this._gcBinder.read() - const results = Object.create(null) - for (const typeId in gcMetrics) { - if (gcMetrics.hasOwnProperty(typeId) && gcMetrics[typeId].count > 0) { - const typeName = GC_TYPE_NAMES[String(typeId)] - results[typeName] = { - typeId: parseInt(typeId, 10), - type: typeName, - metrics: gcMetrics[typeId] - } - } - } - - return results -} - -let emitter = null - -/** - * Retrieves the {@link NativeMetricEmitter} singleton instance. - * - * @param {object} [opts] - * Options for constructing the emitter. See {@link NativeMetricEmitter} for - * default values. Only used on the first call to construct the instance. - */ -module.exports = function getMetricEmitter(opts) { - if (!emitter) { - emitter = new NativeMetricEmitter(opts) - } - return emitter -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/lib/common.js b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/lib/common.js deleted file mode 100644 index 3260f62a4..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/lib/common.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const path = require('path') -const common = module.exports - -common.PACKAGE_ROOT = path.resolve(__dirname, '..') -common.BUILD_PATH = path.resolve(common.PACKAGE_ROOT, './build/Release') -common.REMOTE_PATH = process.env.NR_NATIVE_METRICS_REMOTE_PATH || 'nodejs_agent/builds/' - -common.parseArgs = function parseArgs(_argv, _opts) { - const args = [] - for (let i = 0; i < _argv.length; ++i) { - if (/^--/.test(_argv[i])) { - _opts[_argv[i].substr(2)] = true - } else { - args.push(_argv[i]) - } - } - return args -} - -common.logStart = function logStart(cmd) { - /* eslint-disable no-console */ - console.log( - [ - '============================================================================', - `Attempting ${cmd} in native-metrics module. Please note that this is an`, - 'OPTIONAL dependency, and any resultant errors in this process will not', - 'affect the general performance of the New Relic agent, but event loop and', - 'garbage collection metrics will not be collected for the Node VMs page.', - '============================================================================', - '' - ].join('\n') - /* eslint-enable no-console */ - ) -} - -common.logFinish = function logFinish(cmd, target, err) { - /* eslint-disable no-console */ - if (err) { - console.error(`Failed to execute native-metrics ${cmd}: ${err.message}\n`) - - console.error( - [ - 'Failed install of this OPTIONAL dependency will not impact the general performance', - 'of the New Relic Node.js agent. You may safely run in production. Your application', - 'will be missing event loop and garbage collection metrics for the Node VMs page.', - 'To capture Node event loop and GC metrics, please resolve issues and reinstall.' - ].join('\n') - ) - - // eslint-disable-next-line no-process-exit - process.exit(1) - } else { - console.log(cmd + ' successful: ' + common.getFileName(target)) - } - /* eslint-enable no-console */ -} - -common.getFileName = function getFileName(target) { - const abi = process.versions.modules - const arch = process.arch - const platform = process.platform - const pkg = require('../package') - const pkgName = pkg.name.replace(/[^\w]/g, '_') - const pkgVersion = pkg.version.toString().replace(/[^\w]/g, '_') - - if (!abi || !arch || !target || !platform || !pkg || !pkgName || !pkgVersion) { - throw new Error('Missing information for naming compiled binary.') - } - - /** - * Electron forks Node and has its own custom ABI versions. Because of this, - * the ABI version.included in the binary filename causes issues related to - * mismatched Node versions. A quick + temporary fix for this is to strip out - * the ABI name for suspected Electron builds. Tools such as `electron-builder` - * and `electron-rebuild` will include environment variables to work with - * node-gyp. We can look at those env vars to see if they have been patched - * to contain the word 'electron'. - * For more context: https://github.com/newrelic/node-native-metrics/pull/75 - * It's worth pointing out that this is a patch and not a solution as this will - * have other (minor) repercussions - */ - if ( - (process.env.npm_config_runtime || '').includes('electron') || - (process.env.npm_config_disturl || '').includes('electron') - ) { - return [pkgName, pkgVersion, target, platform, arch].join('-') - } - - return [pkgName, pkgVersion, target, abi, platform, arch].join('-') -} - -common.getPackageFileName = function getPackageFileName(target) { - return common.getFileName(target) + '.gz' -} - -common.getBinFileName = function getBinFileName(target) { - return common.getFileName(target) + '.node' -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/lib/pre-build.js b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/lib/pre-build.js deleted file mode 100644 index 9675e5a4e..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/lib/pre-build.js +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// This file is largely based upon the work done for node-pre-gyp. We are not -// using that module directly due to issues we've run into with the intricacies -// of various node and npm versions that we must support. -// https://www.npmjs.com/package/node-pre-gyp - -// XXX This file must not have any deps. This file will run during the install -// XXX step of the module and we are _not_ guaranteed that the dependencies have -// XXX already installed. Core modules are okay. -const cp = require('child_process') -const fs = require('fs') -const http = require('http') -const https = require('https') -const os = require('os') -const path = require('path') -const semver = require('semver') -const zlib = require('zlib') -const ProxyAgent = require('https-proxy-agent') - -const { - getBinFileName, - getPackageFileName, - parseArgs, - logStart, - logFinish, - PACKAGE_ROOT, - BUILD_PATH, - REMOTE_PATH -} = require('./common') - -const CPU_COUNT = os.cpus().length -const IS_WIN = process.platform === 'win32' -const DOWNLOAD_HOST = - process.env.NR_NATIVE_METRICS_DOWNLOAD_HOST || 'https://download.newrelic.com/' - -const opts = {} -exports.load = load -exports.executeCli = executeCli - -if (require.main === module) { - const [, , cmd, target] = parseArgs(process.argv, opts) - executeCli(cmd, target) -} - -function load(target) { - return require(path.join(BUILD_PATH, getBinFileName(target))) -} - -function makePath(pathToMake, cb) { - const accessRights = fs.constants.R_OK | fs.constants.W_OK - - // We only want to make the parts after the package directory. - pathToMake = path.relative(PACKAGE_ROOT, pathToMake) - - // Now that we have a relative path, split it into the parts we need to make. - const pathParts = pathToMake.split(path.sep) - _make(-1, PACKAGE_ROOT) - - function _make(i, p) { - if (++i >= pathParts.length) { - return cb() - } - p = path.join(p, pathParts[i]) - - fs.access(p, accessRights, function fsAccessCB(err) { - if (!err) { - // It exists and we have read+write access! Move on to the next part. - return _make(i, p) - } else if (err.code !== 'ENOENT') { - // It exists but we don't have read+write access! This is a problem. - return cb(new Error('Do not have access to "' + p + '": ' + err)) - } - - // It probably does not exist, so try to make it. - fs.mkdir(p, function fsMkDirCB(mkdirErr) { - if (mkdirErr) { - return cb(mkdirErr) - } - _make(i, p) - }) - }) - } -} - -function findNodeGyp() { - // This code heavily borrows from node-pre-gyp. - // https://github.com/mapbox/node-pre-gyp/blob/e0b3b6/lib/util/compile.js#L18-L55 - - // First, look for it in the NPM environment variable. - let gypPath = null - if (process.env.npm_config_node_gyp) { - try { - gypPath = process.env.npm_config_node_gyp - fs.accessSync(gypPath) - return gypPath - } catch (err) { - // This method failed, hopefully the next will succeed... - } - } - - // Next, see if the package is installed somewhere. - try { - // eslint-disable-next-line node/no-missing-require - const gypPkgPath = require.resolve('node-gyp') - gypPath = path.resolve(gypPkgPath, '../../bin/node-gyp.js') - fs.accessSync(gypPath) - return gypPath - } catch (err) { - // This method failed, hopefully the next will succeed... - } - - // Then look for it in NPM's install location. - try { - // eslint-disable-next-line node/no-missing-require - const npmPkgPath = require.resolve('npm') - gypPath = path.resolve(npmPkgPath, '../../node_modules/node-gyp/bin/node-gyp.js') - fs.accessSync(gypPath) - return gypPath - } catch (err) { - // This method failed, hopefully the next will succeed... - } - - // All of that failed, now look for it next to node itself. - const nodeNpmPkgPath = path.resolve(process.execPath, '../../lib/node_modules/npm/') - gypPath = path.join(nodeNpmPkgPath, 'node_modules/node-gyp/bin/node-gyp.js') - try { - fs.accessSync(gypPath) - return gypPath - } catch { - return null - } -} - -function gypVersion() { - let cmd = null - const args = ['-v'] - const gyp = findNodeGyp() - if (gyp) { - args.unshift(gyp) // push_front - cmd = process.execPath - } else { - cmd = IS_WIN ? 'node-gyp.cmd' : 'node-gyp' - } - - const child = cp.spawnSync(cmd, args) - const match = /v(\d+\.\d+\.\d+)/.exec(child.stdout) - return match && match[1] -} - -function execGyp(args, cb) { - let cmd = null - const gyp = findNodeGyp() - if (gyp) { - args.unshift(gyp) // push_front - cmd = process.execPath - } else { - cmd = IS_WIN ? 'node-gyp.cmd' : 'node-gyp' - } - - const spawnOpts = {} - if (!opts.quiet) { - spawnOpts.stdio = [0, 1, 2] - } - console.log('> ' + cmd + ' ' + args.join(' ')) // eslint-disable-line no-console - - const child = cp.spawn(cmd, args, spawnOpts) - child.on('error', cb) - child.on('close', function onGypClose(code) { - if (code !== 0) { - cb(new Error('Command exited with non-zero code: ' + code)) - } else { - cb(null) - } - }) -} - -function build(target, rebuild, cb) { - const HAS_OLD_NODE_GYP_ARGS_FOR_WINDOWS = semver.lt(gypVersion() || '0.0.0', '3.7.0') - - if (IS_WIN && HAS_OLD_NODE_GYP_ARGS_FOR_WINDOWS) { - target = '/t:' + target - } - - const cmds = rebuild ? ['clean', 'configure'] : ['configure'] - - execGyp(cmds, function cleanCb(err) { - if (err) { - return cb(err) - } - - const jobs = Math.round(CPU_COUNT / 2) - execGyp(['build', '-j', jobs, target], cb) - }) -} - -function moveBuild(target, cb) { - const filePath = path.join(BUILD_PATH, target + '.node') - const destination = path.join(BUILD_PATH, getBinFileName(target)) - fs.rename(filePath, destination, cb) -} - -function download(target, cb) { - /* eslint-disable no-console */ - const fileName = getPackageFileName(target) - const url = DOWNLOAD_HOST + REMOTE_PATH + fileName - let client = null - let hasCalledBack = false - let options = {} - const proxyHost = process.env.NR_NATIVE_METRICS_PROXY_HOST - - if (proxyHost) { - const parsedUrl = new URL(DOWNLOAD_HOST) - options = parsedUrl - options.path = REMOTE_PATH + fileName - options.agent = new ProxyAgent(proxyHost) - client = /^https:/.test(proxyHost) ? https : http - } else { - options = url - if (DOWNLOAD_HOST.startsWith('https:')) { - client = https - } else { - console.log('Falling back to http, please consider enabling SSL on ' + DOWNLOAD_HOST) - client = http - } - } - - client.get(options, function getFile(res) { - if (res.statusCode === 404) { - return cb(new Error('No pre-built artifacts to download for your OS/architecture.')) - } else if (res.statusCode !== 200) { - return cb(new Error('Failed to download ' + url + ': code ' + res.statusCode)) - } - - const unzip = zlib.createGunzip() - const buffers = [] - let size = 0 - res.pipe(unzip).on('data', function onResData(data) { - buffers.push(data) - size += data.length - }) - - res.on('error', function onResError(err) { - if (!hasCalledBack) { - hasCalledBack = true - cb(new Error('Failed to download ' + url + ': ' + err.message)) - } - }) - - unzip.on('error', function onResError(err) { - if (!hasCalledBack) { - hasCalledBack = true - cb(new Error('Failed to unzip ' + url + ': ' + err.message)) - } - }) - - unzip.on('end', function onResEnd() { - if (hasCalledBack) { - return - } - hasCalledBack = true - cb(null, Buffer.concat(buffers, size)) - }) - - res.resume() - }) - /* eslint-enable no-console */ -} - -function saveDownload(target, data, cb) { - makePath(BUILD_PATH, function makePathCB(err) { - if (err) { - return cb(err) - } - - const filePath = path.join(BUILD_PATH, getBinFileName(target)) - fs.writeFile(filePath, data, cb) - }) -} - -function install(target, cb) { - const errors = [] - - const noBuild = opts['no-build'] || process.env.NR_NATIVE_METRICS_NO_BUILD - const noDownload = opts['no-download'] || process.env.NR_NATIVE_METRICS_NO_DOWNLOAD - - // If NR_NATIVE_METRICS_NO_BUILD env var is specified, jump straight to downloading - if (noBuild) { - return doDownload() - } - - // Otherwise, first attempt to build the package using the source. If that fails, try - // downloading the package. If that also fails, whoops! - build(target, true, function buildCB(buildErr) { - if (!buildErr) { - return moveBuild(target, function moveBuildCB(moveErr) { - if (moveErr) { - errors.push(moveErr) - doDownload() - } else { - doCallback() - } - }) - } - errors.push(buildErr) - - // Building failed, try downloading. - doDownload() - }) - - function doDownload() { - if (noDownload && !noBuild) { - return doCallback(new Error('Downloading is disabled.')) - } - - download(target, function downloadCB(err, data) { - if (err) { - return doCallback(err) - } - - saveDownload(target, data, doCallback) - }) - } - - function doCallback(err) { - if (err) { - errors.push(err) - cb(err) - } else { - cb() - } - } -} - -function executeCli(cmd, target) { - logStart(cmd) - if (cmd === 'build' || cmd === 'rebuild') { - build(target, cmd === 'rebuild', function buildCb(err) { - if (err) { - logFinish(cmd, target, err) - } else { - moveBuild(target, logFinish.bind(this, cmd, target)) - } - }) - } else if (cmd === 'install') { - install(target, logFinish.bind(this, cmd, target)) - } -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/package.json b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/package.json deleted file mode 100644 index 738b38d54..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "name": "@newrelic/native-metrics", - "version": "9.0.0", - "description": "A module for generating metrics from V8.", - "main": "index.js", - "scripts": { - "build": "node ./lib/pre-build build native_metrics", - "clean": "node-gyp clean", - "rebuild": "node ./lib/pre-build rebuild native_metrics", - "upload": "node ./lib/upload native_metrics", - "lint": "eslint .", - "lint:fix": "eslint . --fix", - "unit": "tap --expose-gc --jobs=1 --no-coverage tests/unit/*.tap.js", - "integration": "tap --timeout 360000 --jobs=1 --no-coverage tests/integration/*.tap.js", - "native": "node tests/native/*.js", - "test": "npm run lint && npm run unit && npm run integration", - "install": "node ./lib/pre-build.js install native_metrics", - "prepare": "husky install", - "third-party-updates": "oss third-party manifest && oss third-party notices && git add THIRD_PARTY_NOTICES.md third_party_manifest.json" - }, - "repository": { - "type": "git", - "url": "git@github.com:newrelic/node-native-metrics" - }, - "keywords": [ - "newrelic", - "gc", - "metrics", - "stats", - "gc-stats", - "gc stats", - "gc metrics", - "native-metrics", - "native metrics" - ], - "author": "New Relic Node.js agent team ", - "contributors": [ - { - "name": "Natalie Wolfe", - "email": "nwolfe@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Peter Svetlichny", - "email": "psvetlichny@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Alan Storm", - "email": "astorm@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Bryan Clement", - "email": "bclement@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Michael Goin", - "email": "mgoin@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Nick Tzaperas", - "email": "ntzaperas@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Carlo Pearson", - "email": "cpearson@newrelic.com", - "web": "https://newrelic.com" - } - ], - "license": "Apache-2.0", - "engines": { - "node": ">=14", - "npm": ">=6" - }, - "devDependencies": { - "@newrelic/eslint-config": "^0.0.4", - "@newrelic/newrelic-oss-cli": "^0.1.2", - "@newrelic/proxy": "^2.0.0", - "async": "^3.2.2", - "aws-sdk": "^2.266.1", - "eslint": "^7.32.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-header": "^3.1.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.4.0", - "husky": "^7.0.1", - "lint-staged": "^11.1.1", - "nock": "^13.1.1", - "prettier": "^2.3.2", - "segfault-handler": "^1.3.0", - "sinon": "^11.1.2", - "tap": "^16.0.1" - }, - "dependencies": { - "https-proxy-agent": "^5.0.0", - "nan": "^2.16.0", - "semver": "^5.5.1" - }, - "files": [ - "index.js", - "src/*cpp", - "src/*.hpp", - "lib/common.js", - "lib/pre-build.js", - "binding.gyp", - "*.md" - ] -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/GCBinder.cpp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/GCBinder.cpp deleted file mode 100644 index 1e7295629..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/GCBinder.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - - -#include "GCBinder.hpp" - -namespace nr { - -GCBinder* GCBinder::_instance = nullptr; - -NAN_METHOD(GCBinder::New) { - if (_instance != NULL) { - return Nan::ThrowError("GCBinder instance already created."); - } - - GCBinder* obj = new GCBinder(); - obj->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); -} - -NAN_METHOD(GCBinder::Read) { - Nan::HandleScope scope; - GCBinder* self = GCBinder::Unwrap(info.This()); - - v8::Local results = Nan::New(); - for (auto& metrics : self->_gcMetrics) { - // first == type, second == metrics - Nan::Set( - results, - Nan::New((double)metrics.first), - metrics.second.asJSObject() - ); - metrics.second.reset(); - } - - info.GetReturnValue().Set(results); -} - -void GCBinder::_gcEnd(const v8::GCType type) { - // HR times are in nanoseconds. A duration of 70 milliseconds in nanoseconds - // would overflow a `Metric`'s `sumOfSquares` field. It is entirely - // believable that a 70 ms GC event could occur, so we will convert everything - // to milliseconds and store them as doubles instead. - uint64_t durationHr = uv_hrtime() - _gcStartTimeHR; - _gcMetrics[type] += durationHr / 1000000.0; // 1 million ns per ms -} - -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/GCBinder.hpp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/GCBinder.hpp deleted file mode 100644 index 7bf47f2e2..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/GCBinder.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include - -#include "Metric.hpp" - -namespace nr { - -class GCBinder : public Nan::ObjectWrap { -public: - static NAN_MODULE_INIT(Init) { - v8::Local clas = Nan::New(New); - clas->SetClassName(Nan::New("GCBinder").ToLocalChecked()); - clas->InstanceTemplate()->SetInternalFieldCount(1); - - SetPrototypeMethod(clas, "bind", Bind); - SetPrototypeMethod(clas, "unbind", Unbind); - SetPrototypeMethod(clas, "read", Read); - - constructor().Reset(Nan::GetFunction(clas).ToLocalChecked()); - Nan::Set( - target, - Nan::New("GCBinder").ToLocalChecked(), - Nan::GetFunction(clas).ToLocalChecked() - ); - } - - static NAN_METHOD(New); - - /** - * Binds into the GC event hooks. - */ - static NAN_METHOD(Bind) { - _bind(); - } - - /** - * Removes hooks into the GC events. - */ - static NAN_METHOD(Unbind) { - _unbind(); - } - - static NAN_METHOD(Read); - - GCBinder(): - _gcStartTimeHR(uv_hrtime()) - { - _instance = this; - } - - ~GCBinder() { - _unbind(); - _instance = NULL; - } - -private: - static GCBinder* _instance; - - static NAN_GC_CALLBACK(_gcPrologue) { - if (GCBinder::_instance) { - GCBinder::_instance->_gcStart(); - } - } - - static NAN_GC_CALLBACK(_gcEpilogue) { - if (GCBinder::_instance) { - GCBinder::_instance->_gcEnd(type); - } - } - - static void _bind() { - Nan::AddGCPrologueCallback(_gcPrologue); - Nan::AddGCEpilogueCallback(_gcEpilogue); - } - - static void _unbind() { - Nan::RemoveGCPrologueCallback(_gcPrologue); - Nan::RemoveGCEpilogueCallback(_gcEpilogue); - } - - static inline Nan::Persistent & constructor() { - // ??? - static Nan::Persistent _constructor; - return _constructor; - } - - void _gcStart() { - _gcStartTimeHR = uv_hrtime(); - } - - void _gcEnd(const v8::GCType type); - - uint64_t _gcStartTimeHR; - std::map> _gcMetrics; -}; - -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/LoopChecker.cpp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/LoopChecker.cpp deleted file mode 100644 index ba7b2b763..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/LoopChecker.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - - -#include -#include - -#include "LoopChecker.hpp" - -const uint64_t SEC_TO_MICRO = static_cast(1e6); - -namespace nr { - -uint64_t getUsageSumInUS() { - uv_rusage_t usage; - uv_getrusage(&usage); - return ( - usage.ru_utime.tv_sec * SEC_TO_MICRO + - usage.ru_utime.tv_usec + - usage.ru_stime.tv_sec * SEC_TO_MICRO + - usage.ru_stime.tv_usec - ); -} - -NAN_METHOD(LoopChecker::Read) { - Nan::HandleScope scope; - LoopChecker* self = LoopChecker::Unwrap(info.This()); - - v8::Local results = Nan::New(); - Nan::Set(results, Nan::New("usage").ToLocalChecked(), self->_tickUsageMetric.asJSObject()); - - info.GetReturnValue().Set(results); - self->_tickUsageMetric.reset(); -} - -LoopChecker::LoopChecker(): - _checkUsage(getUsageSumInUS()) -{ - uv_check_init(uv_default_loop(), &_checkHandle); - uv_unref((uv_handle_t*)&_checkHandle); - _checkHandle.data = (void*)this; -} - -void LoopChecker::_checkCB(uv_check_t* handle) { - LoopChecker* self = (LoopChecker*)handle->data; - const uint64_t usage = getUsageSumInUS(); - - self->_tickUsageMetric += usage - self->_checkUsage; - self->_checkUsage = usage; -} - -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/LoopChecker.hpp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/LoopChecker.hpp deleted file mode 100644 index c35aa2835..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/LoopChecker.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include - -#include "Metric.hpp" - -namespace nr { - -class LoopChecker : public Nan::ObjectWrap { -public: - static NAN_MODULE_INIT(Init) { - v8::Local clas = Nan::New(New); - clas->SetClassName(Nan::New("LoopChecker").ToLocalChecked()); - clas->InstanceTemplate()->SetInternalFieldCount(1); - - SetPrototypeMethod(clas, "bind", Bind); - SetPrototypeMethod(clas, "unbind", Unbind); - SetPrototypeMethod(clas, "read", Read); - - constructor().Reset(Nan::GetFunction(clas).ToLocalChecked()); - Nan::Set( - target, - Nan::New("LoopChecker").ToLocalChecked(), - Nan::GetFunction(clas).ToLocalChecked() - ); - } - - static NAN_METHOD(New) { - LoopChecker* obj = new LoopChecker(); - obj->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - } - - static NAN_METHOD(Bind) { - LoopChecker* self = LoopChecker::Unwrap(info.This()); - uv_check_start(&self->_checkHandle, &LoopChecker::_checkCB); - } - - static NAN_METHOD(Unbind) { - LoopChecker* self = LoopChecker::Unwrap(info.This()); - uv_check_stop(&self->_checkHandle); - } - - static NAN_METHOD(Read); - -private: - LoopChecker(); - - static inline Nan::Persistent & constructor() { - static Nan::Persistent _constructor; - return _constructor; - } - - static void _checkCB(uv_check_t* handle); - - uv_check_t _checkHandle; - uint64_t _checkUsage; - Metric _tickUsageMetric; -}; - -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/Metric.hpp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/Metric.hpp deleted file mode 100644 index 7e132c8f0..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/Metric.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include - -namespace nr { - -template -class Metric { -public: - typedef T value_type; - - Metric(): - _total((value_type)0), - _min((value_type)0), - _max((value_type)0), - _sumOfSquares((value_type)0), - _count((value_type)0) - {} - - Metric& operator+=(const value_type& val) { - _total += val; - if (_count == 0) { - _min = _max = val; - } else { - _min = std::min(_min, val); - _max = std::max(_max, val); - } - _sumOfSquares += val * val; - ++_count; - - return *this; - } - - const value_type& total() const { - return _total; - } - - const value_type& min() const { - return _min; - } - - const value_type& max() const { - return _max; - } - - const value_type& sumOfSquares() const { - return _sumOfSquares; - } - - const value_type& count() const { - return _count; - } - - void reset() { - _total = (value_type)0; - _min = (value_type)0; - _max = (value_type)0; - _sumOfSquares = (value_type)0; - _count = (value_type)0; - } - - v8::Local asJSObject() const { - v8::Local results = Nan::New(); - #define SET(key, val) \ - Nan::Set( \ - results, \ - Nan::New(key).ToLocalChecked(), \ - Nan::New((double)(val)) \ - ) - - SET("total", total()); - SET("min", min()); - SET("max", max()); - SET("sumOfSquares", sumOfSquares()); - SET("count", count()); - #undef SET - - return results; - } - -private: - value_type _total; - value_type _min; - value_type _max; - value_type _sumOfSquares; - value_type _count; -}; - -} diff --git a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/native_metrics.cpp b/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/native_metrics.cpp deleted file mode 100644 index 9003e81ad..000000000 --- a/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/src/native_metrics.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - - -#include - -#include "GCBinder.hpp" -#include "LoopChecker.hpp" - -namespace nr { - -NAN_MODULE_INIT(Init) { - Nan::HandleScope scope; - GCBinder::Init(target); - LoopChecker::Init(target); -} - -NODE_MODULE(native_metrics, Init) - -} diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/.ready b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/LICENSE b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/LICENSE deleted file mode 100644 index 97f48aa82..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Kris Zyp - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/README.md b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/README.md deleted file mode 100644 index 002447120..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Summary -This module is designed to do fast and efficient native/C-level extraction of strings from CBOR binary data. This works by calling `extractStrings(buffer, start, end)`, and it will extract strings by doing partial CBOR parsing, and scanning to find the string data in the range specified in the buffer. It will return an array of strings that it finds. When it finds strings that can be represented with latin-1/one-byte strings (and important V8 optimization), it will attempt return a continuous string of CBOR data that contains multiple sub-strings, so the decoder can slice off strings by offset. When a string contains non-latin characters, and must be represented as a two-byte string, this will always be returned as the string alone without combination with any other strings. The extractor will return an array of a maximum of 256 strings. The decoder can call the extractStrings again, with a new offset to continue extracting more strings as necessary. - -## License -MIT \ No newline at end of file diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/bin/download-prebuilds.js b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/bin/download-prebuilds.js deleted file mode 100644 index 5e4bc29fa..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/bin/download-prebuilds.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node - -const { dirname } = require('path'); -const { fileURLToPath } = require('url'); -const { exec } = require('child_process'); - -process.chdir(dirname(__dirname)); -exec('prebuildify-ci download', (error, stdout, stderr) => { - console.error(stderr); - console.log(stdout); -}); diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/binding.gyp b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/binding.gyp deleted file mode 100644 index 3c5e719d6..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/binding.gyp +++ /dev/null @@ -1,60 +0,0 @@ -{ - "variables": { - "os_linux_compiler%": "gcc", - "enable_v8%": "true", - "enable_pointer_compression%": "false", - "build_v8_with_gn": "false" - }, - "conditions": [ - ['OS=="win"', { - "variables": { - "enable_v8%": "=7", { - "cflags": [ - "-Wimplicit-fallthrough=2", - ], - }], - ], - "ldflags": [ - "-fPIC", - "-fvisibility=hidden" - ], - "cflags": [ - "-fPIC", - "-fvisibility=hidden", - "-O3" - ], - }], - ["enable_v8!='false'", { - "defines": ["ENABLE_V8_API=1"] - }], - ], - } - ] -} diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/index.js b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/index.js deleted file mode 100644 index b5639332c..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('node-gyp-build-optional-packages')(__dirname) diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/package.json b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/package.json deleted file mode 100644 index 0a56b6151..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "cbor-extract", - "author": "Kris Zyp", - "version": "2.1.1", - "description": "Node addon for string extraction for cbor-x", - "license": "MIT", - "repository": { - "type": "git", - "url": "http://github.com/kriszyp/cbor-extract" - }, - "scripts": { - "install": "node-gyp-build-optional-packages", - "recompile": "node-gyp rebuild", - "before-publish": "prebuildify-ci download && node set-optional-deps.cjs", - "prebuild": "prebuildify-platform-packages --target 18.12.0", - "prebuild-win32": "prebuildify-platform-packages --target 18.12.0 && set ENABLE_V8_FUNCTIONS=false&& prebuildify-platform-packages --platform-packages --napi --target 18.12.0", - "prebuild-libc": "prebuildify-platform-packages --tag-libc --target 18.12.0 && prebuildify-platform-packages --platform-packages --napi --tag-libc --target 16.14.2 && ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --platform-packages --napi --tag-libc --target 18.12.0", - "prebuild-libc-alpine": "prebuildify-cross --image alpine --tag-libc --target 18.12.0", - "publish-all": "cd prebuilds/win32-x64 && npm publish --access public && cd ../darwin-x64 && npm publish --access public && cd ../darwin-arm64 && npm publish --access public && cd ../linux-x64 && npm publish --access public && cd ../linux-arm64 && npm publish --access public && cd ../linux-arm && npm publish --access public && cd ../.. && npm publish --access public", - "test": "node ./index.js" - }, - "main": "./index.js", - "gypfile": true, - "dependencies": { - "node-gyp-build-optional-packages": "5.0.3" - }, - "files": [ - "index.js", - "/src", - "/*.gyp", - "/bin" - ], - "bin": { - "download-cbor-prebuilds": "./bin/download-prebuilds.js" - }, - "devDependencies": { - "prebuildify-platform-packages": "5.0.2", - "prebuildify-ci": "^1.0.5" - }, - "optionalDependencies": { - "@cbor-extract/cbor-extract-darwin-arm64": "2.1.1", - "@cbor-extract/cbor-extract-darwin-x64": "2.1.1", - "@cbor-extract/cbor-extract-linux-arm": "2.1.1", - "@cbor-extract/cbor-extract-linux-arm64": "2.1.1", - "@cbor-extract/cbor-extract-linux-x64": "2.1.1", - "@cbor-extract/cbor-extract-win32-x64": "2.1.1" - } -} \ No newline at end of file diff --git a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/src/extract.cpp b/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/src/extract.cpp deleted file mode 100644 index a8c94ae42..000000000 --- a/.yarn/unplugged/cbor-extract-npm-2.1.1-bcad1459e1/node_modules/cbor-extract/src/extract.cpp +++ /dev/null @@ -1,198 +0,0 @@ -/* -This is responsible for extracting the strings, in bulk, from a CBOR buffer. Creating strings from buffers can -be one of the biggest performance bottlenecks of parsing, but creating an array of extracting strings all at once -provides much better performance. This will parse and produce up to 256 strings at once .The JS parser can call this multiple -times as necessary to get more strings. This must be partially capable of parsing CBOR so it can know where to -find the string tokens and determine their position and length. All strings are decoded as UTF-8. -*/ -#include -#if ENABLE_V8_API -#include -#endif - -#ifndef thread_local -#ifdef __GNUC__ -# define thread_local __thread -#elif __STDC_VERSION__ >= 201112L -# define thread_local _Thread_local -#elif defined(_MSC_VER) -# define thread_local __declspec(thread) -#else -# define thread_local -#endif -#endif - -const int MAX_TARGET_SIZE = 255; -napi_value unexpectedEnd(napi_env env) { - napi_value returnValue; - napi_get_undefined(env, &returnValue); - napi_throw_type_error(env, NULL, "Unexpected end of buffer reading string"); - return returnValue; -} -class Extractor { -public: - napi_value target[MAX_TARGET_SIZE + 1]; // leave one for the queued string - - uint8_t* source; - int position = 0; - int writePosition = 0; - int stringStart = 0; - int lastStringEnd = 0; - - void readString(napi_env env, int length, bool allowStringBlocks) { - int start = position; - int end = position + length; - if (allowStringBlocks) { // for larger strings, we don't bother to check every character for being latin, and just go right to creating a new string - while(position < end) { - if (source[position] < 0x80) // ensure we character is latin and can be decoded as one byte - position++; - else { - break; - } - } - } - if (position < end) { - // non-latin character - if (lastStringEnd) { - napi_value value; - napi_create_string_latin1(env, (const char*) source + stringStart, lastStringEnd - stringStart, &value); - target[writePosition++] = value; - lastStringEnd = 0; - } - // use standard utf-8 conversion - napi_value value; - napi_create_string_utf8(env, (const char*) source + start, (int) length, &value); - target[writePosition++] = value; - position = end; - return; - } - - if (lastStringEnd) { - if (start - lastStringEnd > 40 || end - stringStart > 6000) { - napi_value value; - napi_create_string_latin1(env, (const char*) source + stringStart, lastStringEnd - stringStart, &value); - target[writePosition++] = value; - stringStart = start; - } - } else { - stringStart = start; - } - lastStringEnd = end; - } - napi_value extractStrings(napi_env env, int startingPosition, int size, int firstStringSize, uint8_t* inputSource) { - writePosition = 0; - lastStringEnd = 0; - position = startingPosition; - source = inputSource; - readString(env, firstStringSize, firstStringSize < 0x100); - while (position < size) { - uint8_t token = source[position++]; - uint8_t majorType = token >> 5; - token = token & 0x1f; - if (majorType == 2 || majorType == 3) { - int length; - switch (token) { - case 0x18: - if (position + 1 > size) { - return unexpectedEnd(env); - } - length = source[position++]; - break; - case 0x19: - if (position + 2 > size) { - return unexpectedEnd(env); - } - length = source[position++] << 8; - length += source[position++]; - break; - case 0x1a: - if (position + 4 > size) { - return unexpectedEnd(env); - } - length = source[position++] << 24; - length += source[position++] << 16; - length += source[position++] << 8; - length += source[position++]; - break; - case 0x1b: - return unexpectedEnd(env); - default: - length = token; - } - if (majorType == 3) { - // string - if (length + position > size) { - return unexpectedEnd(env); - } - readString(env, length, length < 0x100); - if (writePosition >= MAX_TARGET_SIZE) - break; - } else { // binary data - position += length; - } - - } else { // all other tokens - switch (token) { - case 0x18: - position++; - break; - case 0x19: - position += 2; - break; - case 0x1a: - position += 4; - break; - case 0x1b: - position += 8; - break; - } - } - } - if (lastStringEnd) { - napi_value value; - napi_create_string_latin1(env, (const char*) source + stringStart, lastStringEnd - stringStart, &value); - if (writePosition == 0) { - return value; - } - target[writePosition++] = value; - } else if (writePosition == 1) { - return target[0]; - } - napi_value array; - #if ENABLE_V8_API - v8::Local v8Array = v8::Array::New(v8::Isolate::GetCurrent(), (v8::Local*) target, writePosition); - memcpy(&array, &v8Array, sizeof(array)); - #else - napi_create_array_with_length(env, writePosition, &array); - for (int i = 0; i < writePosition; i++) { - napi_set_element(env, array, i, target[i]); - } - #endif - return array; - } -}; - -static thread_local Extractor* extractor; - -napi_value extractStrings(napi_env env, napi_callback_info info) { - size_t argc = 4; - napi_value args[4]; - napi_get_cb_info(env, info, &argc, args, NULL, NULL); - uint32_t position; - uint32_t size; - uint32_t firstStringSize; - napi_get_value_uint32(env, args[0], &position); - napi_get_value_uint32(env, args[1], &size); - napi_get_value_uint32(env, args[2], &firstStringSize); - uint8_t* source; - size_t buffer_size; - napi_get_buffer_info(env, args[3], (void**) &source, &buffer_size); - return extractor->extractStrings(env, position, size, firstStringSize, source); -} -#define EXPORT_NAPI_FUNCTION(name, func) { napi_property_descriptor desc = { name, 0, func, 0, 0, 0, (napi_property_attributes) (napi_writable | napi_configurable), 0 }; napi_define_properties(env, exports, 1, &desc); } - -NAPI_MODULE_INIT() { - extractor = new Extractor(); // create our thread-local extractor - EXPORT_NAPI_FUNCTION("extractStrings", extractStrings); - return exports; -} \ No newline at end of file diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/.ready b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/LICENSE b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/LICENSE deleted file mode 100644 index 5d70441c3..000000000 --- a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License ------------ - -Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/README.md b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/README.md deleted file mode 100644 index 025c9a13e..000000000 --- a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# fsevents [![NPM](https://nodei.co/npm/fsevents.png)](https://nodei.co/npm/fsevents/) - -Native access to MacOS FSEvents in [Node.js](https://nodejs.org/) - -The FSEvents API in MacOS allows applications to register for notifications of -changes to a given directory tree. It is a very fast and lightweight alternative -to kqueue. - -This is a low-level library. For a cross-platform file watching module that -uses fsevents, check out [Chokidar](https://github.com/paulmillr/chokidar). - -## Installation - -Supports only **Node.js v8.16 and higher**. - -```sh -npm install fsevents -``` - -## Usage - -```js -const fsevents = require('fsevents'); -const stop = fsevents.watch(__dirname, (path, flags, id) => { - const info = fsevents.getInfo(path, flags, id); -}); // To start observation -stop(); // To end observation -``` - -The callback passed as the second parameter to `.watch` get's called whenever the operating system detects a -a change in the file system. It takes three arguments: - -###### `fsevents.watch(dirname: string, (path: string, flags: number, id: string) => void): () => Promise` - - * `path: string` - the item in the filesystem that have been changed - * `flags: number` - a numeric value describing what the change was - * `id: string` - an unique-id identifying this specific event - - Returns closer callback which when called returns a Promise resolving when the watcher process has been shut down. - -###### `fsevents.getInfo(path: string, flags: number, id: string): FsEventInfo` - -The `getInfo` function takes the `path`, `flags` and `id` arguments and converts those parameters into a structure -that is easier to digest to determine what the change was. - -The `FsEventsInfo` has the following shape: - -```js -/** - * @typedef {'created'|'modified'|'deleted'|'moved'|'root-changed'|'cloned'|'unknown'} FsEventsEvent - * @typedef {'file'|'directory'|'symlink'} FsEventsType - */ -{ - "event": "created", // {FsEventsEvent} - "path": "file.txt", - "type": "file", // {FsEventsType} - "changes": { - "inode": true, // Had iNode Meta-Information changed - "finder": false, // Had Finder Meta-Data changed - "access": false, // Had access permissions changed - "xattrs": false // Had xAttributes changed - }, - "flags": 0x100000000 -} -``` - -## Changelog - -- v2.3 supports Apple Silicon ARM CPUs -- v2 supports node 8.16+ and reduces package size massively -- v1.2.8 supports node 6+ -- v1.2.7 supports node 4+ - -## Troubleshooting - -- I'm getting `EBADPLATFORM` `Unsupported platform for fsevents` error. -- It's fine, nothing is broken. fsevents is macos-only. Other platforms are skipped. If you want to hide this warning, report a bug to NPM bugtracker asking them to hide ebadplatform warnings by default. - -## License - -The MIT License Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller — see LICENSE file. - -Visit our [GitHub page](https://github.com/fsevents/fsevents) and [NPM Page](https://npmjs.org/package/fsevents) diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.d.ts b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.d.ts deleted file mode 100644 index 2723c048a..000000000 --- a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -declare type Event = "created" | "cloned" | "modified" | "deleted" | "moved" | "root-changed" | "unknown"; -declare type Type = "file" | "directory" | "symlink"; -declare type FileChanges = { - inode: boolean; - finder: boolean; - access: boolean; - xattrs: boolean; -}; -declare type Info = { - event: Event; - path: string; - type: Type; - changes: FileChanges; - flags: number; -}; -declare type WatchHandler = (path: string, flags: number, id: string) => void; -export declare function watch(path: string, handler: WatchHandler): () => Promise; -export declare function watch(path: string, since: number, handler: WatchHandler): () => Promise; -export declare function getInfo(path: string, flags: number): Info; -export declare const constants: { - None: 0x00000000; - MustScanSubDirs: 0x00000001; - UserDropped: 0x00000002; - KernelDropped: 0x00000004; - EventIdsWrapped: 0x00000008; - HistoryDone: 0x00000010; - RootChanged: 0x00000020; - Mount: 0x00000040; - Unmount: 0x00000080; - ItemCreated: 0x00000100; - ItemRemoved: 0x00000200; - ItemInodeMetaMod: 0x00000400; - ItemRenamed: 0x00000800; - ItemModified: 0x00001000; - ItemFinderInfoMod: 0x00002000; - ItemChangeOwner: 0x00004000; - ItemXattrMod: 0x00008000; - ItemIsFile: 0x00010000; - ItemIsDir: 0x00020000; - ItemIsSymlink: 0x00040000; - ItemIsHardlink: 0x00100000; - ItemIsLastHardlink: 0x00200000; - OwnEvent: 0x00080000; - ItemCloned: 0x00400000; -}; -export {}; diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.js b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.js deleted file mode 100644 index 9f17e0994..000000000 --- a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - ** © 2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller - ** Licensed under MIT License. - */ - -/* jshint node:true */ -"use strict"; - -if (process.platform !== "darwin") { - throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`); -} - -const Native = require("./fsevents.node"); -const events = Native.constants; - -function watch(path, since, handler) { - if (typeof path !== "string") { - throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path}`); - } - if ("function" === typeof since && "undefined" === typeof handler) { - handler = since; - since = Native.flags.SinceNow; - } - if (typeof since !== "number") { - throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`); - } - if (typeof handler !== "function") { - throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`); - } - - let VFS = require('./vfs'); - let vfs = new VFS(path); - let instance = Native.start(Native.global, vfs.resolvedPath, since, vfs.wrap(handler)); - if (!instance) throw new Error(`could not watch: ${path}`); - return () => { - const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined); - instance = undefined; - return result; - }; -} - -function getInfo(path, flags) { - return { - path, - flags, - event: getEventType(flags), - type: getFileType(flags), - changes: getFileChanges(flags), - }; -} - -function getFileType(flags) { - if (events.ItemIsFile & flags) return "file"; - if (events.ItemIsDir & flags) return "directory"; - if (events.ItemIsSymlink & flags) return "symlink"; -} -function anyIsTrue(obj) { - for (let key in obj) { - if (obj[key]) return true; - } - return false; -} -function getEventType(flags) { - if (events.ItemRemoved & flags) return "deleted"; - if (events.ItemRenamed & flags) return "moved"; - if (events.ItemCreated & flags) return "created"; - if (events.ItemModified & flags) return "modified"; - if (events.RootChanged & flags) return "root-changed"; - if (events.ItemCloned & flags) return "cloned"; - if (anyIsTrue(flags)) return "modified"; - return "unknown"; -} -function getFileChanges(flags) { - return { - inode: !!(events.ItemInodeMetaMod & flags), - finder: !!(events.ItemFinderInfoMod & flags), - access: !!(events.ItemChangeOwner & flags), - xattrs: !!(events.ItemXattrMod & flags), - }; -} - -exports.watch = watch; -exports.getInfo = getInfo; -exports.constants = events; diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.node b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.node deleted file mode 100755 index 00fac7e88..000000000 Binary files a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/fsevents.node and /dev/null differ diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/package.json b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/package.json deleted file mode 100644 index af6da84ae..000000000 --- a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "fsevents", - "version": "2.3.2", - "description": "Native Access to MacOS FSEvents", - "main": "fsevents.js", - "types": "fsevents.d.ts", - "os": [ - "darwin" - ], - "files": [ - "fsevents.d.ts", - "fsevents.js", - "fsevents.node" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - }, - "scripts": { - "clean": "node-gyp clean && rm -f fsevents.node", - "build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean", - "test": "/bin/bash ./test.sh 2>/dev/null", - "prepublishOnly": "npm run build" - }, - "repository": { - "type": "git", - "url": "https://github.com/fsevents/fsevents.git" - }, - "keywords": [ - "fsevents", - "mac" - ], - "contributors": [ - { - "name": "Philipp Dunkel", - "email": "pip@pipobscure.com" - }, - { - "name": "Ben Noordhuis", - "email": "info@bnoordhuis.nl" - }, - { - "name": "Elan Shankar", - "email": "elan.shanker@gmail.com" - }, - { - "name": "Miroslav Bajtoš", - "email": "mbajtoss@gmail.com" - }, - { - "name": "Paul Miller", - "url": "https://paulmillr.com" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/fsevents/fsevents/issues" - }, - "homepage": "https://github.com/fsevents/fsevents", - "devDependencies": { - "node-gyp": "^6.1.0" - } -} diff --git a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/vfs.js b/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/vfs.js deleted file mode 100644 index 34199122d..000000000 --- a/.yarn/unplugged/fsevents-patch-19706e7e35/node_modules/fsevents/vfs.js +++ /dev/null @@ -1,76 +0,0 @@ -const path = require(`path`); - -let pnpApi = null; -try { - pnpApi = require(`pnpapi`); -} catch { -} - -function getVirtualLookupFn(pnpApi) { - const reverseMap = new Map(); - - for (const locator of pnpApi.getAllLocators()) { - const pkg = pnpApi.getPackageInformation(locator); - console.assert(pkg, `The package information should be available`); - - const resolvedLocation = pnpApi.resolveVirtual(pkg.packageLocation); - if (resolvedLocation === null) - continue; - - const aliases = reverseMap.get(resolvedLocation) || [resolvedLocation]; - reverseMap.set(resolvedLocation, aliases); - aliases.push(pkg.packageLocation); - } - - const keys = [...reverseMap.keys()].sort((a, b) => { - return b.length - a.length; - }); - - return p => { - const prefix = keys.find(candidate => p.startsWith(candidate)); - if (typeof prefix === `undefined`) - return [p]; - - const sub = p.substr(prefix.length); - return reverseMap.get(prefix).map(alias => { - return alias + sub; - }); - }; -} - -if (pnpApi != null) { - const resolveVirtualAliases = getVirtualLookupFn(pnpApi); - - module.exports = class FsePnp { - constructor(p) { - this.normalizedPath = path.resolve(p); - this.resolvedPath = pnpApi.resolveVirtual(this.normalizedPath) || this.normalizedPath; - } - - transpose(p) { - if (this.resolvedPath !== null) { - return this.normalizedPath + p.substr(this.resolvedPath.length); - } else { - return p; - } - } - - wrap(fn) { - return (path, ...args) => { - for (const entry of resolveVirtualAliases(path)) { - fn(this.transpose(entry), ...args); - } - }; - } - }; -} else { - module.exports = class FsePnp { - constructor(p) { - this.resolvedPath = p; - } - - wrap(fn) { - return fn; - } - }; -} diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.github/workflows/release.yml b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.github/workflows/release.yml deleted file mode 100644 index 36b73af24..000000000 --- a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.github/workflows/release.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Release -on: - push: - tags: ['*'] -jobs: - build: - permissions: - contents: read - strategy: - matrix: - include: - - os: ubuntu-latest - arch: x64 - build-group: linux-x64 - - os: ubuntu-latest - arch: x64 - build-group: linux-arm - - os: ubuntu-latest - arch: x64 - build-group: linux-arm64 - - os: macos-latest - arch: x64 - build-group: darwin-x64+arm64 - - os: windows-2019 - arch: x86 - build-group: win32-x86 - - os: windows-2019 - arch: x64 - build-group: win32-x64 - runs-on: ${{ matrix.os }} - name: Build ${{ matrix.build-group }} - env: - BUILD_GROUP: ${{ matrix.build-group }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Set up node - uses: actions/setup-node@v3 - with: - node-version: 14 - architecture: ${{ matrix.arch }} - - name: Install - run: npm install --ignore-scripts - - name: Prebuild - run: npm run prebuild-$BUILD_GROUP - shell: bash - - name: Prepare artifact - run: tar -zcvf $BUILD_GROUP.tar.gz -C prebuilds . - shell: bash - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ env.BUILD_GROUP }} - path: ${{ env.BUILD_GROUP }}.tar.gz - retention-days: 1 - release: - needs: build - permissions: - contents: write - runs-on: ubuntu-latest - name: Release - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - name: Create GitHub release - uses: docker://antonyurchenko/git-release:v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - args: artifacts/*/*.tar.gz diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.github/workflows/test.yml b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.github/workflows/test.yml deleted file mode 100644 index afae405a0..000000000 --- a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.github/workflows/test.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Test -on: [push, pull_request] -permissions: - contents: read -jobs: - lint: - runs-on: ubuntu-latest - name: Lint - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Use node latest - uses: actions/setup-node@v3 - with: - node-version: latest - - name: Install - run: npm install - - name: Lint Test - run: npm run lint-test - test: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - node: [12, 14, 16] - arch: [x86, x64] - exclude: - - { os: ubuntu-latest, arch: x86 } - - { os: macos-latest, arch: x86 } - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} / Node ${{ matrix.node }} ${{ matrix.arch }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Use node ${{ matrix.node }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - architecture: ${{ matrix.arch }} - - name: Install - run: npm install - - name: Test - run: npm test diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.ready b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/LICENSE b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/LICENSE deleted file mode 100644 index 4279cab1d..000000000 --- a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Wade Simmons - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/README.md b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/README.md deleted file mode 100644 index 59ca79a2f..000000000 --- a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# node-microtime - -[![npm](https://img.shields.io/npm/dm/microtime.svg)](https://www.npmjs.com/package/microtime) -[![npm](https://img.shields.io/npm/v/microtime.svg)](https://www.npmjs.com/package/microtime) - -Date.now() will only give you accuracy in milliseconds. This module calls -`gettimeofday(2)` to get the time in microseconds and provides it in a few -different formats. The same warning from that function applies: -_The resolution of the system clock is hardware dependent, and the time may -be updated continuously or in ``ticks.''_ - -## N-API Support - -As of version `3.0.0`, this library is built using the [N-API](https://nodejs.org/api/n-api.html) library. This should allow you to upgrade to newer versions of Node.js without having to reinstall / rebuild this library. - -Version `3.0.0` and later also bundle prebuilt binaries for common systems in -the npm package itself. These will be used if the version of Node you are using -supports N-API ([>= v6.14.2](https://nodejs.org/api/n-api.html#n_api_n_api_version_matrix)), otherwise the binary will be recompiled on install. - -# Installation - - npm install microtime - -# Usage - -### microtime.now() - -Get the current time in microseconds as an integer. - -### microtime.nowDouble() - -Get the current time in seconds as a floating point number with microsecond -accuracy (similar to `time.time()` in Python and `Time.now.to_f` in Ruby). - -### microtime.nowStruct() - -Get the current time and return as a list with seconds and microseconds (matching the return value of `gettimeofday(2)`). - -# Example - - > var microtime = require('microtime') - > microtime.now() - 1297448895297028 - > microtime.nowDouble() - 1297448897.600976 - > microtime.nowStruct() - [ 1297448902, 753875 ] - -## Estimating clock resolution - -Starting with version 0.1.3, there is a test script that tries to guess the clock resolution. You can run it with `npm test microtime`. Example output: - - microtime.now() = 1298960083489806 - microtime.nowDouble() = 1298960083.511521 - microtime.nowStruct() = [ 1298960083, 511587 ] - - Guessing clock resolution... - Clock resolution observed: 1us diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/binding.gyp b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/binding.gyp deleted file mode 100644 index fa9467602..000000000 --- a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/binding.gyp +++ /dev/null @@ -1,40 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'microtime', - 'sources': [ 'src/microtime.cc' ], - 'cflags!': [ '-fno-exceptions' ], - 'cflags_cc!': [ '-fno-exceptions' ], - 'include_dirs': [" (http://wades.im/mons)", - "homepage": "https://github.com/wadey/node-microtime", - "repository": "git://github.com/wadey/node-microtime.git", - "main": "./index", - "license": "MIT", - "keywords": [ - "microtime", - "microseconds", - "gettimeofday" - ], - "engines": { - "node": ">= 14.13.0" - }, - "scripts": { - "install": "node-gyp-build", - "rebuild": "node-gyp rebuild", - "prebuild": "prebuildify -t 14.13.0 -t electron@18.2.0 --napi --strip", - "prebuild-linux-x64": "prebuildify -t 14.13.0 -t electron@18.2.0 --napi --strip", - "prebuild-linux-arm": "prebuildify-cross -i linux-armv7 -t 14.13.0 --napi --strip", - "prebuild-linux-arm64": "prebuildify-cross -i linux-arm64 -t 14.13.0 --napi --strip", - "prebuild-darwin-x64+arm64": "prebuildify -t 14.13.0 -t electron@18.2.0 --arch x64+arm64 --napi --strip", - "prebuild-win32-x64": "prebuildify -t 14.13.0 -t electron@18.2.0 --napi --strip", - "prebuild-win32-x86": "prebuildify -t 14.13.0 -t electron@18.2.0 --napi --strip", - "download-prebuilds": "prebuildify-ci download", - "test": "node test.js", - "format": "clang-format -i src/microtime.cc", - "lint-test": "standard && clang-format -output-replacements-xml src/microtime.cc | (! grep -q ' - -#include - -#if defined(_MSC_VER) -#include -#include - -// Pick GetSystemTimePreciseAsFileTime or GetSystemTimeAsFileTime depending -// on which is available at runtime. -typedef VOID(WINAPI *WinGetSystemTime)(LPFILETIME); -static WinGetSystemTime getSystemTime = NULL; - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - -int gettimeofday(struct timeval *tv, struct timezone *tz) { - FILETIME ft; - (*getSystemTime)(&ft); - unsigned long long t = ft.dwHighDateTime; - t <<= 32; - t |= ft.dwLowDateTime; - t /= 10; - t -= 11644473600000000ULL; - tv->tv_sec = (long)(t / 1000000UL); - tv->tv_usec = (long)(t % 1000000UL); - - return 0; -} -#else -#include -#endif - -// A very basic version of Node::ErrnoException since Napi doesn't expose it -Napi::Error ErrnoException(Napi::Env env, int errorno) { - Napi::Error e = Napi::Error::New(env, strerror(errorno)); - e.Set("syscall", Napi::String::New(env, "gettimeofday")); - e.Set("errno", Napi::Number::New(env, errno)); - // NOTE: in Node::ErrnoException this would be the string of the code - // like "EFAULT", just simplify with the number here. - e.Set("code", Napi::Number::New(env, errno)); - return e; -} - -Napi::Value Now(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); - timeval t; - int r = gettimeofday(&t, NULL); - - if (r < 0) { - ErrnoException(env, errno).ThrowAsJavaScriptException(); - return env.Null(); - } - - return Napi::Number::New(env, ((t.tv_sec * 1000000.0) + t.tv_usec)); -} - -Napi::Value NowDouble(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); - timeval t; - int r = gettimeofday(&t, NULL); - if (r < 0) { - ErrnoException(env, errno).ThrowAsJavaScriptException(); - return env.Null(); - } - - return Napi::Number::New(env, t.tv_sec + (t.tv_usec * 0.000001)); -} - -Napi::Value NowStruct(const Napi::CallbackInfo &info) { - Napi::Env env = info.Env(); - timeval t; - int r = gettimeofday(&t, NULL); - - if (r < 0) { - ErrnoException(env, errno).ThrowAsJavaScriptException(); - return env.Null(); - } - - Napi::Array array = Napi::Array::New(env, 2); - array.Set((uint32_t)0, (double)t.tv_sec); - array.Set((uint32_t)1, (double)t.tv_usec); - - return array; -} - -Napi::Object Init(Napi::Env env, Napi::Object exports) { - exports.Set(Napi::String::New(env, "now"), Napi::Function::New(env, Now)); - exports.Set(Napi::String::New(env, "nowDouble"), - Napi::Function::New(env, NowDouble)); - exports.Set(Napi::String::New(env, "nowStruct"), - Napi::Function::New(env, NowStruct)); -#if defined(_MSC_VER) - getSystemTime = (WinGetSystemTime)GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), "GetSystemTimePreciseAsFileTime"); - if (getSystemTime == NULL) { - getSystemTime = &GetSystemTimeAsFileTime; - } -#endif - return exports; -} - -NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init); diff --git a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/test.js b/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/test.js deleted file mode 100644 index 54dabfce3..000000000 --- a/.yarn/unplugged/microtime-npm-3.1.1-ff5289e8ad/node_modules/microtime/test.js +++ /dev/null @@ -1,30 +0,0 @@ -var microtime = require('./index') - -console.log('microtime.now() =', microtime.now()) -console.log('microtime.nowDouble() =', microtime.nowDouble()) -console.log('microtime.nowStruct() =', microtime.nowStruct()) - -console.log('\nGuessing clock resolution...') - -var start = microtime.now() -var minDiff = Infinity -var minCycles = 10000 -var maxCycles = 100000 -var cycles = maxCycles - -for (var i = 0; i < cycles; ++i) { - var a = microtime.now() - var b = microtime.now() - var diff = (b - a) || (b - start) - - if (diff > 0 && diff < minDiff) { - minDiff = diff - cycles = minCycles - } -} - -if (minDiff === Infinity) { - console.log('Unable to guess clock resolution') -} else { - console.log('Clock resolution observed: ' + minDiff + 'us') -} diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/.ready b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/CHANGELOG.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/CHANGELOG.md deleted file mode 100644 index bcf53f02f..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/CHANGELOG.md +++ /dev/null @@ -1,549 +0,0 @@ -# NAN ChangeLog - -**Version 2.17.0: current Node 18.10.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1** - -### 2.17.0 Oct 10 2022 - - - Feature: overload deprecated AccessorSignatures (#943) 7f9ceb80fbc45c9ba1a10e6591ccbef9e8dee6b4 - -### 2.16.0 May 25 2022 - - - Feature: Add support for Node 18 (#937) 16fa32231e2ccd89d2804b3f765319128b20c4ac - -### 2.15.0 Aug 4 2021 - - - Feature: add ScriptOrigin (#918) d09debf9eeedcb7ca4073e84ffe5fbb455ecb709 - -### 2.14.2 Oct 13 2020 - - - Bugfix: fix gcc 8 function cast warning (#899) 35f0fab205574b2cbda04e6347c8b2db755e124f - -### 2.14.1 Apr 21 2020 - - - Bugfix: use GetBackingStore() instead of GetContents() (#888) 2c023bd447661a61071da318b0ff4003c3858d39 - -### 2.14.0 May 16 2019 - - - Feature: Add missing methods to Nan::Maybe (#852) 4e962489fb84a184035b9fa74f245f650249aca6 - -### 2.13.2 Mar 24 2019 - - - Bugfix: remove usage of deprecated `IsNearDeath` (#842) fbaf42252af279c3d867c6b193571f9711c39847 - -### 2.13.1 Mar 14 2019 - - - Bugfix: check V8 version directly instead of inferring from NMV (#840) 12f9df9f393285de8fb4a8cd01478dc4fe3b089d - -### 2.13.0 Mar 13 2019 - - - Feature: add support for node master (#831) 113c0282072e7ff4f9dfc98b432fd894b798c2c - -### 2.12.1 Dec 18 2018 - - - Bugfix: Fix build breakage with Node.js 10.0.0-10.9.0. (#833) 625e90e8fef8d39ffa7247250a76a100b2487474 - -### 2.12.0 Dec 16 2018 - - - Bugfix: Add scope.Escape() to Call() (#817) 2e5ed4fc3a8ac80a6ef1f2a55099ab3ac8800dc6 - - Bugfix: Fix Node.js v10.12.0 deprecation warnings. 509859cc23b1770376b56550a027840a2ce0f73d - - Feature: Allow SetWeak() for non-object persistent handles. (#824) e6ef6a48e7e671fe3e4b7dddaa8912a3f8262ecd - -### 2.11.1 Sep 29 2018 - - - Fix: adapt to V8 7.0 24a22c3b25eeeec2016c6ec239bdd6169e985447 - -### 2.11.0 Aug 25 2018 - - - Removal: remove `FunctionCallbackInfo::Callee` for nodejs `>= 10` 1a56c0a6efd4fac944cb46c30912a8e023bda7d4 - - Bugfix: Fix `AsyncProgressWorkerBase::WorkProgress` sends invalid data b0c764d1dab11e9f8b37ffb81e2560a4498aad5e - - Feature: Introduce `GetCurrentEventLoop` b4911b0bb1f6d47d860e10ec014d941c51efac5e - - Feature: Add `NAN_MODULE_WORKER_ENABLED` macro as a replacement for `NAN_MODULE` b058fb047d18a58250e66ae831444441c1f2ac7a - -### 2.10.0 Mar 16 2018 - - - Deprecation: Deprecate `MakeCallback` 5e92b19a59e194241d6a658bd6ff7bfbda372950 - - Feature: add `Nan::Call` overload 4482e1242fe124d166fc1a5b2be3c1cc849fe452 - - Feature: add more `Nan::Call` overloads 8584e63e6d04c7d2eb8c4a664e4ef57d70bf672b - - Feature: Fix deprecation warnings for Node 10 1caf258243b0602ed56922bde74f1c91b0cbcb6a - -### 2.9.2 Feb 22 2018 - - - Bugfix: Bandaid for async hooks 212bd2f849be14ef1b02fc85010b053daa24252b - -### 2.9.1 Feb 22 2018 - - - Bugfix: Avoid deprecation warnings in deprecated `Nan::Callback::operator()` 372b14d91289df4604b0f81780709708c45a9aa4 - - Bugfix: Avoid deprecation warnings in `Nan::JSON` 3bc294bce0b7d0a3ee4559926303e5ed4866fda2 - -### 2.9.0 Feb 22 2018 - - - Deprecation: Deprecate legacy `Callback::Call` 6dd5fa690af61ca3523004b433304c581b3ea309 - - Feature: introduce `AsyncResource` class 90c0a179c0d8cb5fd26f1a7d2b1d6231eb402d48o - - Feature: Add context aware `Nan::Callback::Call` functions 7169e09fb088418b6e388222e88b4c13f07ebaee - - Feature: Make `AsyncWorker` context aware 066ba21a6fb9e2b5230c9ed3a6fc51f1211736a4 - - Feature: add `Callback` overload to `Nan::Call` 5328daf66e202658c1dc0d916c3aaba99b3cc606 - - Bugfix: fix warning: suggest parentheses around `&&` within `||` b2bb63d68b8ae623a526b542764e1ac82319cb2c - - Bugfix: Fix compilation on io.js 3 d06114dba0a522fb436f0c5f47b994210968cd7b - -### 2.8.0 Nov 15 2017 - - - Deprecation: Deprecate `Nan::ForceSet` in favor of `Nan::DefineOwnProperty()` 95cbb976d6fbbba88ba0f86dd188223a8591b4e7 - - Feature: Add `Nan::AsyncProgressQueueWorker` a976636ecc2ef617d1b061ce4a6edf39923691cb - - Feature: Add `Nan::DefineOwnProperty()` 95cbb976d6fbbba88ba0f86dd188223a8591b4e7 - - Bugfix: Fix compiling on io.js 1 & 2 82705a64503ce60c62e98df5bd02972bba090900 - - Bugfix: Use DefineOwnProperty instead of ForceSet 95cbb976d6fbbba88ba0f86dd188223a8591b4e7 - -### 2.7.0 Aug 30 2017 - - - Feature: Add `Nan::To()` overload. b93280670c9f6da42ed4cf6cbf085ffdd87bd65b - - Bugfix: Fix ternary in `Nan::MaybeLocal::FromMaybe()`. 79a26f7d362e756a9524e672a82c3d603b542867 - -### 2.6.2 Apr 12 2017 - - - Bugfix: Fix v8::JSON::Parse() deprecation warning. 87f6a3c65815fa062296a994cc863e2fa124867d - -### 2.6.1 Apr 6 2017 - - - Bugfix: nan_json.h: fix build breakage in Node 6 ac8d47dc3c10bfbf3f15a6b951633120c0ee6d51 - -### 2.6.0 Apr 6 2017 - - - Feature: nan: add support for JSON::Parse & Stringify b533226c629cce70e1932a873bb6f849044a56c5 - -### 2.5.1 Jan 23 2017 - - - Bugfix: Fix disappearing handle for private value 6a80995694f162ef63dbc9948fbefd45d4485aa0 - - Bugfix: Add missing scopes a93b8bae6bc7d32a170db6e89228b7f60ee57112 - - Bugfix: Use string::data instead of string::front in NewOneByteString d5f920371e67e1f3b268295daee6e83af86b6e50 - -### 2.5.0 Dec 21 2016 - - - Feature: Support Private accessors a86255cb357e8ad8ccbf1f6a4a901c921e39a178 - - Bugfix: Abort in delete operators that shouldn't be called 0fe38215ff8581703967dfd26c12793feb960018 - -### 2.4.0 Jul 10 2016 - - - Feature: Rewrite Callback to add Callback::Reset c4cf44d61f8275cd5f7b0c911d7a806d4004f649 - - Feature: AsyncProgressWorker: add template types for .send 1242c9a11a7ed481c8f08ec06316385cacc513d0 - - Bugfix: Add constness to old Persistent comparison operators bd43cb9982c7639605d60fd073efe8cae165d9b2 - -### 2.3.5 May 31 2016 - - - Bugfix: Replace NAN_INLINE with 'inline' keyword. 71819d8725f822990f439479c9aba3b240804909 - -### 2.3.4 May 31 2016 - - - Bugfix: Remove V8 deprecation warnings 0592fb0a47f3a1c7763087ebea8e1138829f24f9 - - Bugfix: Fix new versions not to use WeakCallbackInfo::IsFirstPass 615c19d9e03d4be2049c10db0151edbc3b229246 - - Bugfix: Make ObjectWrap::handle() const d19af99595587fe7a26bd850af6595c2a7145afc - - Bugfix: Fix compilation errors related to 0592fb0a47f3a1c7763087ebea8e1138829f24f9 e9191c525b94f652718325e28610a1adcf90fed8 - -### 2.3.3 May 4 2016 - - - Bugfix: Refactor SetMethod() to deal with v8::Templates (#566) b9083cf6d5de6ebe6bcb49c7502fbb7c0d9ddda8 - -### 2.3.2 Apr 27 2016 - - - Bugfix: Fix compilation on outdated versions due to Handle removal f8b7c875d04d425a41dfd4f3f8345bc3a11e6c52 - -### 2.3.1 Apr 27 2016 - - - Bugfix: Don't use deprecated v8::Template::Set() in SetMethod a90951e9ea70fa1b3836af4b925322919159100e - -### 2.3.0 Apr 27 2016 - - - Feature: added Signal() for invoking async callbacks without sending data from AsyncProgressWorker d8adba45f20e077d00561b20199133620c990b38 - - Bugfix: Don't use deprecated v8::Template::Set() 00dacf0a4b86027415867fa7f1059acc499dcece - -### 2.2.1 Mar 29 2016 - - - Bugfix: Use NewFromUnsigned in ReturnValue::Set(uint32_t i) for pre_12 3a18f9bdce29826e0e4c217854bc476918241a58 - - Performance: Remove unneeeded nullptr checks b715ef44887931c94f0d1605b3b1a4156eebece9 - -### 2.2.0 Jan 9 2016 - - - Feature: Add Function::Call wrapper 4c157474dacf284d125c324177b45aa5dabc08c6 - - Feature: Rename GC*logueCallback to GCCallback for > 4.0 3603435109f981606d300eb88004ca101283acec - - Bugfix: Fix Global::Pass for old versions 367e82a60fbaa52716232cc89db1cc3f685d77d9 - - Bugfix: Remove weird MaybeLocal wrapping of what already is a MaybeLocal 23b4590db10c2ba66aee2338aebe9751c4cb190b - -### 2.1.0 Oct 8 2015 - - - Deprecation: Deprecate NanErrnoException in favor of ErrnoException 0af1ca4cf8b3f0f65ed31bc63a663ab3319da55c - - Feature: added helper class for accessing contents of typedarrays 17b51294c801e534479d5463697a73462d0ca555 - - Feature: [Maybe types] Add MakeMaybe(...) 48d7b53d9702b0c7a060e69ea10fea8fb48d814d - - Feature: new: allow utf16 string with length 66ac6e65c8ab9394ef588adfc59131b3b9d8347b - - Feature: Introduce SetCallHandler and SetCallAsFunctionHandler 7764a9a115d60ba10dc24d86feb0fbc9b4f75537 - - Bugfix: Enable creating Locals from Globals under Node 0.10. 9bf9b8b190821af889790fdc18ace57257e4f9ff - - Bugfix: Fix issue #462 where PropertyCallbackInfo data is not stored safely. 55f50adedd543098526c7b9f4fffd607d3f9861f - -### 2.0.9 Sep 8 2015 - - - Bugfix: EscapableHandleScope in Nan::NewBuffer for Node 0.8 and 0.10 b1654d7 - -### 2.0.8 Aug 28 2015 - - - Work around duplicate linking bug in clang 11902da - -### 2.0.7 Aug 26 2015 - - - Build: Repackage - -### 2.0.6 Aug 26 2015 - - - Bugfix: Properly handle null callback in FunctionTemplate factory 6e99cb1 - - Bugfix: Remove unused static std::map instances 525bddc - - Bugfix: Make better use of maybe versions of APIs bfba85b - - Bugfix: Fix shadowing issues with handle in ObjectWrap 0a9072d - -### 2.0.5 Aug 10 2015 - - - Bugfix: Reimplement weak callback in ObjectWrap 98d38c1 - - Bugfix: Make sure callback classes are not assignable, copyable or movable 81f9b1d - -### 2.0.4 Aug 6 2015 - - - Build: Repackage - -### 2.0.3 Aug 6 2015 - - - Bugfix: Don't use clang++ / g++ syntax extension. 231450e - -### 2.0.2 Aug 6 2015 - - - Build: Repackage - -### 2.0.1 Aug 6 2015 - - - Bugfix: Add workaround for missing REPLACE_INVALID_UTF8 60d6687 - - Bugfix: Reimplement ObjectWrap from scratch to prevent memory leaks 6484601 - - Bugfix: Fix Persistent leak in FunctionCallbackInfo and PropertyCallbackInfo 641ef5f - - Bugfix: Add missing overload for Nan::NewInstance that takes argc/argv 29450ed - -### 2.0.0 Jul 31 2015 - - - Change: Renamed identifiers with leading underscores b5932b4 - - Change: Replaced NanObjectWrapHandle with class NanObjectWrap 464f1e1 - - Change: Replace NanScope and NanEscpableScope macros with classes 47751c4 - - Change: Rename NanNewBufferHandle to NanNewBuffer 6745f99 - - Change: Rename NanBufferUse to NanNewBuffer 3e8b0a5 - - Change: Rename NanNewBuffer to NanCopyBuffer d6af78d - - Change: Remove Nan prefix from all names 72d1f67 - - Change: Update Buffer API for new upstream changes d5d3291 - - Change: Rename Scope and EscapableScope to HandleScope and EscapableHandleScope 21a7a6a - - Change: Get rid of Handles e6c0daf - - Feature: Support io.js 3 with V8 4.4 - - Feature: Introduce NanPersistent 7fed696 - - Feature: Introduce NanGlobal 4408da1 - - Feature: Added NanTryCatch 10f1ca4 - - Feature: Update for V8 v4.3 4b6404a - - Feature: Introduce NanNewOneByteString c543d32 - - Feature: Introduce namespace Nan 67ed1b1 - - Removal: Remove NanLocker and NanUnlocker dd6e401 - - Removal: Remove string converters, except NanUtf8String, which now follows the node implementation b5d00a9 - - Removal: Remove NanReturn* macros d90a25c - - Removal: Remove HasInstance e8f84fe - - -### 1.9.0 Jul 31 2015 - - - Feature: Added `NanFatalException` 81d4a2c - - Feature: Added more error types 4265f06 - - Feature: Added dereference and function call operators to NanCallback c4b2ed0 - - Feature: Added indexed GetFromPersistent and SaveToPersistent edd510c - - Feature: Added more overloads of SaveToPersistent and GetFromPersistent 8b1cef6 - - Feature: Added NanErrnoException dd87d9e - - Correctness: Prevent assign, copy, and move for classes that do not support it 1f55c59, 4b808cb, c96d9b2, fba4a29, 3357130 - - Deprecation: Deprecate `NanGetPointerSafe` and `NanSetPointerSafe` 81d4a2c - - Deprecation: Deprecate `NanBooleanOptionValue` and `NanUInt32OptionValue` 0ad254b - -### 1.8.4 Apr 26 2015 - - - Build: Repackage - -### 1.8.3 Apr 26 2015 - - - Bugfix: Include missing header 1af8648 - -### 1.8.2 Apr 23 2015 - - - Build: Repackage - -### 1.8.1 Apr 23 2015 - - - Bugfix: NanObjectWrapHandle should take a pointer 155f1d3 - -### 1.8.0 Apr 23 2015 - - - Feature: Allow primitives with NanReturnValue 2e4475e - - Feature: Added comparison operators to NanCallback 55b075e - - Feature: Backport thread local storage 15bb7fa - - Removal: Remove support for signatures with arguments 8a2069d - - Correcteness: Replaced NanObjectWrapHandle macro with function 0bc6d59 - -### 1.7.0 Feb 28 2015 - - - Feature: Made NanCallback::Call accept optional target 8d54da7 - - Feature: Support atom-shell 0.21 0b7f1bb - -### 1.6.2 Feb 6 2015 - - - Bugfix: NanEncode: fix argument type for node::Encode on io.js 2be8639 - -### 1.6.1 Jan 23 2015 - - - Build: version bump - -### 1.5.3 Jan 23 2015 - - - Build: repackage - -### 1.6.0 Jan 23 2015 - - - Deprecated `NanNewContextHandle` in favor of `NanNew` 49259af - - Support utility functions moved in newer v8 versions (Node 0.11.15, io.js 1.0) a0aa179 - - Added `NanEncode`, `NanDecodeBytes` and `NanDecodeWrite` 75e6fb9 - -### 1.5.2 Jan 23 2015 - - - Bugfix: Fix non-inline definition build error with clang++ 21d96a1, 60fadd4 - - Bugfix: Readded missing String constructors 18d828f - - Bugfix: Add overload handling NanNew(..) 5ef813b - - Bugfix: Fix uv_work_cb versioning 997e4ae - - Bugfix: Add function factory and test 4eca89c - - Bugfix: Add object template factory and test cdcb951 - - Correctness: Lifted an io.js related typedef c9490be - - Correctness: Make explicit downcasts of String lengths 00074e6 - - Windows: Limit the scope of disabled warning C4530 83d7deb - -### 1.5.1 Jan 15 2015 - - - Build: version bump - -### 1.4.3 Jan 15 2015 - - - Build: version bump - -### 1.4.2 Jan 15 2015 - - - Feature: Support io.js 0dbc5e8 - -### 1.5.0 Jan 14 2015 - - - Feature: Support io.js b003843 - - Correctness: Improved NanNew internals 9cd4f6a - - Feature: Implement progress to NanAsyncWorker 8d6a160 - -### 1.4.1 Nov 8 2014 - - - Bugfix: Handle DEBUG definition correctly - - Bugfix: Accept int as Boolean - -### 1.4.0 Nov 1 2014 - - - Feature: Added NAN_GC_CALLBACK 6a5c245 - - Performance: Removed unnecessary local handle creation 18a7243, 41fe2f8 - - Correctness: Added constness to references in NanHasInstance 02c61cd - - Warnings: Fixed spurious warnings from -Wundef and -Wshadow, 541b122, 99d8cb6 - - Windoze: Shut Visual Studio up when compiling 8d558c1 - - License: Switch to plain MIT from custom hacked MIT license 11de983 - - Build: Added test target to Makefile e232e46 - - Performance: Removed superfluous scope in NanAsyncWorker f4b7821 - - Sugar/Feature: Added NanReturnThis() and NanReturnHolder() shorthands 237a5ff, d697208 - - Feature: Added suitable overload of NanNew for v8::Integer::NewFromUnsigned b27b450 - -### 1.3.0 Aug 2 2014 - - - Added NanNew(std::string) - - Added NanNew(std::string&) - - Added NanAsciiString helper class - - Added NanUtf8String helper class - - Added NanUcs2String helper class - - Deprecated NanRawString() - - Deprecated NanCString() - - Added NanGetIsolateData(v8::Isolate *isolate) - - Added NanMakeCallback(v8::Handle target, v8::Handle func, int argc, v8::Handle* argv) - - Added NanMakeCallback(v8::Handle target, v8::Handle symbol, int argc, v8::Handle* argv) - - Added NanMakeCallback(v8::Handle target, const char* method, int argc, v8::Handle* argv) - - Added NanSetTemplate(v8::Handle templ, v8::Handle name , v8::Handle value, v8::PropertyAttribute attributes) - - Added NanSetPrototypeTemplate(v8::Local templ, v8::Handle name, v8::Handle value, v8::PropertyAttribute attributes) - - Added NanSetInstanceTemplate(v8::Local templ, const char *name, v8::Handle value) - - Added NanSetInstanceTemplate(v8::Local templ, v8::Handle name, v8::Handle value, v8::PropertyAttribute attributes) - -### 1.2.0 Jun 5 2014 - - - Add NanSetPrototypeTemplate - - Changed NAN_WEAK_CALLBACK internals, switched _NanWeakCallbackData to class, - introduced _NanWeakCallbackDispatcher - - Removed -Wno-unused-local-typedefs from test builds - - Made test builds Windows compatible ('Sleep()') - -### 1.1.2 May 28 2014 - - - Release to fix more stuff-ups in 1.1.1 - -### 1.1.1 May 28 2014 - - - Release to fix version mismatch in nan.h and lack of changelog entry for 1.1.0 - -### 1.1.0 May 25 2014 - - - Remove nan_isolate, use v8::Isolate::GetCurrent() internally instead - - Additional explicit overloads for NanNew(): (char*,int), (uint8_t*[,int]), - (uint16_t*[,int), double, int, unsigned int, bool, v8::String::ExternalStringResource*, - v8::String::ExternalAsciiStringResource* - - Deprecate NanSymbol() - - Added SetErrorMessage() and ErrorMessage() to NanAsyncWorker - -### 1.0.0 May 4 2014 - - - Heavy API changes for V8 3.25 / Node 0.11.13 - - Use cpplint.py - - Removed NanInitPersistent - - Removed NanPersistentToLocal - - Removed NanFromV8String - - Removed NanMakeWeak - - Removed NanNewLocal - - Removed NAN_WEAK_CALLBACK_OBJECT - - Removed NAN_WEAK_CALLBACK_DATA - - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions - - Introduce NanUndefined, NanNull, NanTrue and NanFalse - - Introduce NanEscapableScope and NanEscapeScope - - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node) - - Introduce NanMakeCallback for node::MakeCallback - - Introduce NanSetTemplate - - Introduce NanGetCurrentContext - - Introduce NanCompileScript and NanRunScript - - Introduce NanAdjustExternalMemory - - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback - - Introduce NanGetHeapStatistics - - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent() - -### 0.8.0 Jan 9 2014 - - - NanDispose -> NanDisposePersistent, deprecate NanDispose - - Extract _NAN_*_RETURN_TYPE, pull up NAN_*() - -### 0.7.1 Jan 9 2014 - - - Fixes to work against debug builds of Node - - Safer NanPersistentToLocal (avoid reinterpret_cast) - - Speed up common NanRawString case by only extracting flattened string when necessary - -### 0.7.0 Dec 17 2013 - - - New no-arg form of NanCallback() constructor. - - NanCallback#Call takes Handle rather than Local - - Removed deprecated NanCallback#Run method, use NanCallback#Call instead - - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS - - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call() - - Introduce NanRawString() for char* (or appropriate void*) from v8::String - (replacement for NanFromV8String) - - Introduce NanCString() for null-terminated char* from v8::String - -### 0.6.0 Nov 21 2013 - - - Introduce NanNewLocal(v8::Handle value) for use in place of - v8::Local::New(...) since v8 started requiring isolate in Node 0.11.9 - -### 0.5.2 Nov 16 2013 - - - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public - -### 0.5.1 Nov 12 2013 - - - Use node::MakeCallback() instead of direct v8::Function::Call() - -### 0.5.0 Nov 11 2013 - - - Added @TooTallNate as collaborator - - New, much simpler, "include_dirs" for binding.gyp - - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros - -### 0.4.4 Nov 2 2013 - - - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+ - -### 0.4.3 Nov 2 2013 - - - Include node_object_wrap.h, removed from node.h for Node 0.11.8. - -### 0.4.2 Nov 2 2013 - - - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for - Node 0.11.8 release. - -### 0.4.1 Sep 16 2013 - - - Added explicit `#include ` as it was removed from node.h for v0.11.8 - -### 0.4.0 Sep 2 2013 - - - Added NAN_INLINE and NAN_DEPRECATED and made use of them - - Added NanError, NanTypeError and NanRangeError - - Cleaned up code - -### 0.3.2 Aug 30 2013 - - - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent - in NanAsyncWorker - -### 0.3.1 Aug 20 2013 - - - fix "not all control paths return a value" compile warning on some platforms - -### 0.3.0 Aug 19 2013 - - - Made NAN work with NPM - - Lots of fixes to NanFromV8String, pulling in features from new Node core - - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API - - Added optional error number argument for NanThrowError() - - Added NanInitPersistent() - - Added NanReturnNull() and NanReturnEmptyString() - - Added NanLocker and NanUnlocker - - Added missing scopes - - Made sure to clear disposed Persistent handles - - Changed NanAsyncWorker to allocate error messages on the heap - - Changed NanThrowError(Local) to NanThrowError(Handle) - - Fixed leak in NanAsyncWorker when errmsg is used - -### 0.2.2 Aug 5 2013 - - - Fixed usage of undefined variable with node::BASE64 in NanFromV8String() - -### 0.2.1 Aug 5 2013 - - - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for - NanFromV8String() - -### 0.2.0 Aug 5 2013 - - - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR, - NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY - - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS, - _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS, - _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS, - _NAN_PROPERTY_QUERY_ARGS - - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer - - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT, - NAN_WEAK_CALLBACK_DATA, NanMakeWeak - - Renamed THROW_ERROR to _NAN_THROW_ERROR - - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*) - - Added NanBufferUse(char*, uint32_t) - - Added NanNewContextHandle(v8::ExtensionConfiguration*, - v8::Handle, v8::Handle) - - Fixed broken NanCallback#GetFunction() - - Added optional encoding and size arguments to NanFromV8String() - - Added NanGetPointerSafe() and NanSetPointerSafe() - - Added initial test suite (to be expanded) - - Allow NanUInt32OptionValue to convert any Number object - -### 0.1.0 Jul 21 2013 - - - Added `NAN_GETTER`, `NAN_SETTER` - - Added `NanThrowError` with single Local argument - - Added `NanNewBufferHandle` with single uint32_t argument - - Added `NanHasInstance(Persistent&, Handle)` - - Added `Local NanCallback#GetFunction()` - - Added `NanCallback#Call(int, Local[])` - - Deprecated `NanCallback#Run(int, Local[])` in favour of Call diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/LICENSE.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/LICENSE.md deleted file mode 100644 index 2d33043df..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 [NAN contributors]() - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/README.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/README.md deleted file mode 100644 index a90fd0b09..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/README.md +++ /dev/null @@ -1,456 +0,0 @@ -Native Abstractions for Node.js -=============================== - -**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 and 18.** - -***Current version: 2.17.0*** - -*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)* - -[![NPM](https://nodei.co/npm/nan.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6&height=3)](https://nodei.co/npm/nan/) - -[![Build Status](https://api.travis-ci.com/nodejs/nan.svg?branch=master)](https://travis-ci.com/nodejs/nan) -[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan) - -Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.12 to 4.0, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. - -This project also contains some helper utilities that make addon development a bit more pleasant. - - * **[News & Updates](#news)** - * **[Usage](#usage)** - * **[Example](#example)** - * **[API](#api)** - * **[Tests](#tests)** - * **[Known issues](#issues)** - * **[Governance & Contributing](#governance)** - - - -## News & Updates - - - -## Usage - -Simply add **NAN** as a dependency in the *package.json* of your Node addon: - -``` bash -$ npm install --save nan -``` - -Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: - -``` python -"include_dirs" : [ - "` when compiling your addon. - - - -## Example - -Just getting started with Nan? Take a look at the **[Node Add-on Examples](https://github.com/nodejs/node-addon-examples)**. - -Refer to a [quick-start **Nan** Boilerplate](https://github.com/fcanas/node-native-boilerplate) for a ready-to-go project that utilizes basic Nan functionality. - -For a simpler example, see the **[async pi estimation example](https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. - -Yet another example is **[nan-example-eol](https://github.com/CodeCharmLtd/nan-example-eol)**. It shows newline detection implemented as a native addon. - -Also take a look at our comprehensive **[C++ test suite](https://github.com/nodejs/nan/tree/master/test/cpp)** which has a plethora of code snippets for your pasting pleasure. - - - -## API - -Additional to the NAN documentation below, please consult: - -* [The V8 Getting Started * Guide](https://v8.dev/docs/embed) -* [V8 API Documentation](https://v8docs.nodesource.com/) -* [Node Add-on Documentation](https://nodejs.org/api/addons.html) - - - -### JavaScript-accessible methods - -A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://github.com/v8/v8/wiki/Embedder%27s-Guide#templates) for further information. - -In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type. - -* **Method argument types** - - Nan::FunctionCallbackInfo - - Nan::PropertyCallbackInfo - - Nan::ReturnValue -* **Method declarations** - - Method declaration - - Getter declaration - - Setter declaration - - Property getter declaration - - Property setter declaration - - Property enumerator declaration - - Property deleter declaration - - Property query declaration - - Index getter declaration - - Index setter declaration - - Index enumerator declaration - - Index deleter declaration - - Index query declaration -* Method and template helpers - - Nan::SetMethod() - - Nan::SetPrototypeMethod() - - Nan::SetAccessor() - - Nan::SetNamedPropertyHandler() - - Nan::SetIndexedPropertyHandler() - - Nan::SetTemplate() - - Nan::SetPrototypeTemplate() - - Nan::SetInstanceTemplate() - - Nan::SetCallHandler() - - Nan::SetCallAsFunctionHandler() - -### Scopes - -A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works. - -A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope. - -The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these. - - - Nan::HandleScope - - Nan::EscapableHandleScope - -Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection). - -### Persistent references - -An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed. - -Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported. - - - Nan::PersistentBase & v8::PersistentBase - - Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits - - Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits - - Nan::Persistent - - Nan::Global - - Nan::WeakCallbackInfo - - Nan::WeakCallbackType - -Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles). - -### New - -NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8. - - - Nan::New() - - Nan::Undefined() - - Nan::Null() - - Nan::True() - - Nan::False() - - Nan::EmptyString() - - -### Converters - -NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN. - - - Nan::To() - -### Maybe Types - -The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_. - -* **Maybe Types** - - Nan::MaybeLocal - - Nan::Maybe - - Nan::Nothing - - Nan::Just -* **Maybe Helpers** - - Nan::Call() - - Nan::ToDetailString() - - Nan::ToArrayIndex() - - Nan::Equals() - - Nan::NewInstance() - - Nan::GetFunction() - - Nan::Set() - - Nan::DefineOwnProperty() - - Nan::ForceSet() - - Nan::Get() - - Nan::GetPropertyAttributes() - - Nan::Has() - - Nan::Delete() - - Nan::GetPropertyNames() - - Nan::GetOwnPropertyNames() - - Nan::SetPrototype() - - Nan::ObjectProtoToString() - - Nan::HasOwnProperty() - - Nan::HasRealNamedProperty() - - Nan::HasRealIndexedProperty() - - Nan::HasRealNamedCallbackProperty() - - Nan::GetRealNamedPropertyInPrototypeChain() - - Nan::GetRealNamedProperty() - - Nan::CallAsFunction() - - Nan::CallAsConstructor() - - Nan::GetSourceLine() - - Nan::GetLineNumber() - - Nan::GetStartColumn() - - Nan::GetEndColumn() - - Nan::CloneElementAt() - - Nan::HasPrivate() - - Nan::GetPrivate() - - Nan::SetPrivate() - - Nan::DeletePrivate() - - Nan::MakeMaybe() - -### Script - -NAN provides `v8::Script` helpers as the API has changed over the supported versions of V8. - - - Nan::CompileScript() - - Nan::RunScript() - - Nan::ScriptOrigin - - -### JSON - -The _JSON_ object provides the C++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object. - - - Nan::JSON.Parse - - Nan::JSON.Stringify - -Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. - -### Errors - -NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted. - -Note that an Error object is simply a specialized form of `v8::Value`. - -Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information. - - - Nan::Error() - - Nan::RangeError() - - Nan::ReferenceError() - - Nan::SyntaxError() - - Nan::TypeError() - - Nan::ThrowError() - - Nan::ThrowRangeError() - - Nan::ThrowReferenceError() - - Nan::ThrowSyntaxError() - - Nan::ThrowTypeError() - - Nan::FatalException() - - Nan::ErrnoException() - - Nan::TryCatch - - -### Buffers - -NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility. - - - Nan::NewBuffer() - - Nan::CopyBuffer() - - Nan::FreeCallback() - -### Nan::Callback - -`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution. - - - Nan::Callback - -### Asynchronous work helpers - -`Nan::AsyncWorker`, `Nan::AsyncProgressWorker` and `Nan::AsyncProgressQueueWorker` are helper classes that make working with asynchronous code easier. - - - Nan::AsyncWorker - - Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker - - Nan::AsyncProgressQueueWorker - - Nan::AsyncQueueWorker - -### Strings & Bytes - -Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing. - - - Nan::Encoding - - Nan::Encode() - - Nan::DecodeBytes() - - Nan::DecodeWrite() - - -### Object Wrappers - -The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects. - - - Nan::ObjectWrap - - -### V8 internals - -The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods. - - - NAN_GC_CALLBACK() - - Nan::AddGCEpilogueCallback() - - Nan::RemoveGCEpilogueCallback() - - Nan::AddGCPrologueCallback() - - Nan::RemoveGCPrologueCallback() - - Nan::GetHeapStatistics() - - Nan::SetCounterFunction() - - Nan::SetCreateHistogramFunction() - - Nan::SetAddHistogramSampleFunction() - - Nan::IdleNotification() - - Nan::LowMemoryNotification() - - Nan::ContextDisposedNotification() - - Nan::GetInternalFieldPointer() - - Nan::SetInternalFieldPointer() - - Nan::AdjustExternalMemory() - - -### Miscellaneous V8 Helpers - - - Nan::Utf8String - - Nan::GetCurrentContext() - - Nan::SetIsolateData() - - Nan::GetIsolateData() - - Nan::TypedArrayContents - - -### Miscellaneous Node Helpers - - - Nan::AsyncResource - - Nan::MakeCallback() - - NAN_MODULE_INIT() - - Nan::Export() - - - - - - -### Tests - -To run the NAN tests do: - -``` sh -npm install -npm run-script rebuild-tests -npm test -``` - -Or just: - -``` sh -npm install -make test -``` - - - -## Known issues - -### Compiling against Node.js 0.12 on OSX - -With new enough compilers available on OSX, the versions of V8 headers corresponding to Node.js 0.12 -do not compile anymore. The error looks something like: - -``` -❯ CXX(target) Release/obj.target/accessors/cpp/accessors.o -In file included from ../cpp/accessors.cpp:9: -In file included from ../../nan.h:51: -In file included from /Users/ofrobots/.node-gyp/0.12.18/include/node/node.h:61: -/Users/ofrobots/.node-gyp/0.12.18/include/node/v8.h:5800:54: error: 'CreateHandle' is a protected member of 'v8::HandleScope' - return Handle(reinterpret_cast(HandleScope::CreateHandle( - ~~~~~~~~~~~~~^~~~~~~~~~~~ -``` - -This can be worked around by patching your local versions of v8.h corresponding to Node 0.12 to make -`v8::Handle` a friend of `v8::HandleScope`. Since neither Node.js not V8 support this release line anymore -this patch cannot be released by either project in an official release. - -For this reason, we do not test against Node.js 0.12 on OSX in this project's CI. If you need to support -that configuration, you will need to either get an older compiler, or apply a source patch to the version -of V8 headers as a workaround. - - - -## Governance & Contributing - -NAN is governed by the [Node.js Addon API Working Group](https://github.com/nodejs/CTC/blob/master/WORKING_GROUPS.md#addon-api) - -### Addon API Working Group (WG) - -The NAN project is jointly governed by a Working Group which is responsible for high-level guidance of the project. - -Members of the WG are also known as Collaborators, there is no distinction between the two, unlike other Node.js projects. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project [README.md](./README.md#collaborators). - -Individuals making significant and valuable contributions are made members of the WG and given commit-access to the project. These individuals are identified by the WG and their addition to the WG is discussed via GitHub and requires unanimous consensus amongst those WG members participating in the discussion with a quorum of 50% of WG members required for acceptance of the vote. - -_Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly. - -For the current list of WG members / Collaborators, see the project [README.md](./README.md#collaborators). - -### Consensus Seeking Process - -The WG follows a [Consensus Seeking](https://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision making model. - -Modifications of the contents of the NAN repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the WG. All pull requests must be reviewed and accepted by a WG member with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing WG member, an additional WG member is required for sign-off. Consensus should be sought if additional WG members participate and there is disagreement around a particular modification. - -If a change proposal cannot reach a consensus, a WG member can call for a vote amongst the members of the WG. Simple majority wins. - - - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - - - -### WG Members / Collaborators - - - - - - - - - - -
Rod VaggGitHub/rvaggTwitter/@rvagg
Benjamin ByholmGitHub/kkoopa-
Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
Brett LawsonGitHub/brett19Twitter/@brett19x
Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
David SiegelGitHub/agnatTwitter/@agnat
Michael Ira KrufkyGitHub/mkrufkyTwitter/@mkrufky
- -## Licence & copyright - -Copyright (c) 2018 NAN WG Members / Collaborators (listed above). - -Native Abstractions for Node.js is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/asyncworker.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/asyncworker.md deleted file mode 100644 index 04231f83c..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/asyncworker.md +++ /dev/null @@ -1,146 +0,0 @@ -## Asynchronous work helpers - -`Nan::AsyncWorker`, `Nan::AsyncProgressWorker` and `Nan::AsyncProgressQueueWorker` are helper classes that make working with asynchronous code easier. - - - Nan::AsyncWorker - - Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker - - Nan::AsyncProgressQueueWorker - - Nan::AsyncQueueWorker - - -### Nan::AsyncWorker - -`Nan::AsyncWorker` is an _abstract_ class that you can subclass to have much of the annoying asynchronous queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the asynchronous work is in progress. - -This class internally handles the details of creating an [`AsyncResource`][AsyncResource], and running the callback in the -correct async context. To be able to identify the async resources created by this class in async-hooks, provide a -`resource_name` to the constructor. It is recommended that the module name be used as a prefix to the `resource_name` to avoid -collisions in the names. For more details see [`AsyncResource`][AsyncResource] documentation. The `resource_name` needs to stay valid for the lifetime of the worker instance. - -Definition: - -```c++ -class AsyncWorker { - public: - explicit AsyncWorker(Callback *callback_, const char* resource_name = "nan:AsyncWorker"); - - virtual ~AsyncWorker(); - - virtual void WorkComplete(); - - void SaveToPersistent(const char *key, const v8::Local &value); - - void SaveToPersistent(const v8::Local &key, - const v8::Local &value); - - void SaveToPersistent(uint32_t index, - const v8::Local &value); - - v8::Local GetFromPersistent(const char *key) const; - - v8::Local GetFromPersistent(const v8::Local &key) const; - - v8::Local GetFromPersistent(uint32_t index) const; - - virtual void Execute() = 0; - - uv_work_t request; - - virtual void Destroy(); - - protected: - Persistent persistentHandle; - - Callback *callback; - - virtual void HandleOKCallback(); - - virtual void HandleErrorCallback(); - - void SetErrorMessage(const char *msg); - - const char* ErrorMessage(); -}; -``` - - -### Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker - -`Nan::AsyncProgressWorkerBase` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript. - -Previously the definition of `Nan::AsyncProgressWorker` only allowed sending `const char` data. Now extending `Nan::AsyncProgressWorker` will yield an instance of the implicit `Nan::AsyncProgressWorkerBase` template with type `` for compatibility. - -`Nan::AsyncProgressWorkerBase` & `Nan::AsyncProgressWorker` is intended for best-effort delivery of nonessential progress messages, e.g. a progress bar. The last event sent before the main thread is woken will be delivered. - -Definition: - -```c++ -template -class AsyncProgressWorkerBase : public AsyncWorker { - public: - explicit AsyncProgressWorkerBase(Callback *callback_, const char* resource_name = ...); - - virtual ~AsyncProgressWorkerBase(); - - void WorkProgress(); - - class ExecutionProgress { - public: - void Signal() const; - void Send(const T* data, size_t count) const; - }; - - virtual void Execute(const ExecutionProgress& progress) = 0; - - virtual void HandleProgressCallback(const T *data, size_t count) = 0; - - virtual void Destroy(); -}; - -typedef AsyncProgressWorkerBase AsyncProgressWorker; -``` - - -### Nan::AsyncProgressQueueWorker - -`Nan::AsyncProgressQueueWorker` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript. - -`Nan::AsyncProgressQueueWorker` behaves exactly the same as `Nan::AsyncProgressWorker`, except all events are queued and delivered to the main thread. - -Definition: - -```c++ -template -class AsyncProgressQueueWorker : public AsyncWorker { - public: - explicit AsyncProgressQueueWorker(Callback *callback_, const char* resource_name = "nan:AsyncProgressQueueWorker"); - - virtual ~AsyncProgressQueueWorker(); - - void WorkProgress(); - - class ExecutionProgress { - public: - void Send(const T* data, size_t count) const; - }; - - virtual void Execute(const ExecutionProgress& progress) = 0; - - virtual void HandleProgressCallback(const T *data, size_t count) = 0; - - virtual void Destroy(); -}; -``` - - -### Nan::AsyncQueueWorker - -`Nan::AsyncQueueWorker` will run a `Nan::AsyncWorker` asynchronously via libuv. Both the `execute` and `after_work` steps are taken care of for you. Most of the logic for this is embedded in `Nan::AsyncWorker`. - -Definition: - -```c++ -void AsyncQueueWorker(AsyncWorker *); -``` - -[AsyncResource]: node_misc.md#api_nan_asyncresource diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/buffers.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/buffers.md deleted file mode 100644 index 8d8d25cf7..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/buffers.md +++ /dev/null @@ -1,54 +0,0 @@ -## Buffers - -NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility. - - - Nan::NewBuffer() - - Nan::CopyBuffer() - - Nan::FreeCallback() - - -### Nan::NewBuffer() - -Allocate a new `node::Buffer` object with the specified size and optional data. Calls `node::Buffer::New()`. - -Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management. -When a `node::Buffer` instance is garbage collected and a `FreeCallback` has not been specified, `data` will be disposed of via a call to `free()`. -You _must not_ free the memory space manually once you have created a `Buffer` in this way. - -Signature: - -```c++ -Nan::MaybeLocal Nan::NewBuffer(uint32_t size) -Nan::MaybeLocal Nan::NewBuffer(char* data, uint32_t size) -Nan::MaybeLocal Nan::NewBuffer(char *data, - size_t length, - Nan::FreeCallback callback, - void *hint) -``` - - - -### Nan::CopyBuffer() - -Similar to [`Nan::NewBuffer()`](#api_nan_new_buffer) except that an implicit memcpy will occur within Node. Calls `node::Buffer::Copy()`. - -Management of the `char*` is left to the user, you should manually free the memory space if necessary as the new `Buffer` will have its own copy. - -Signature: - -```c++ -Nan::MaybeLocal Nan::CopyBuffer(const char *data, uint32_t size) -``` - - - -### Nan::FreeCallback() - -A free callback that can be provided to [`Nan::NewBuffer()`](#api_nan_new_buffer). -The supplied callback will be invoked when the `Buffer` undergoes garbage collection. - -Signature: - -```c++ -typedef void (*FreeCallback)(char *data, void *hint); -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/callback.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/callback.md deleted file mode 100644 index f7af0bfd9..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/callback.md +++ /dev/null @@ -1,76 +0,0 @@ -## Nan::Callback - -`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution. - - - Nan::Callback - - -### Nan::Callback - -```c++ -class Callback { - public: - Callback(); - - explicit Callback(const v8::Local &fn); - - ~Callback(); - - bool operator==(const Callback &other) const; - - bool operator!=(const Callback &other) const; - - v8::Local operator*() const; - - MaybeLocal operator()(AsyncResource* async_resource, - v8::Local target, - int argc = 0, - v8::Local argv[] = 0) const; - - MaybeLocal operator()(AsyncResource* async_resource, - int argc = 0, - v8::Local argv[] = 0) const; - - void SetFunction(const v8::Local &fn); - - v8::Local GetFunction() const; - - bool IsEmpty() const; - - void Reset(const v8::Local &fn); - - void Reset(); - - MaybeLocal Call(v8::Local target, - int argc, - v8::Local argv[], - AsyncResource* async_resource) const; - MaybeLocal Call(int argc, - v8::Local argv[], - AsyncResource* async_resource) const; - - // Deprecated versions. Use the versions that accept an async_resource instead - // as they run the callback in the correct async context as specified by the - // resource. If you want to call a synchronous JS function (i.e. on a - // non-empty JS stack), you can use Nan::Call instead. - v8::Local operator()(v8::Local target, - int argc = 0, - v8::Local argv[] = 0) const; - - v8::Local operator()(int argc = 0, - v8::Local argv[] = 0) const; - v8::Local Call(v8::Local target, - int argc, - v8::Local argv[]) const; - - v8::Local Call(int argc, v8::Local argv[]) const; -}; -``` - -Example usage: - -```c++ -v8::Local function; -Nan::Callback callback(function); -callback.Call(0, 0); -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/converters.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/converters.md deleted file mode 100644 index d20861b59..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/converters.md +++ /dev/null @@ -1,41 +0,0 @@ -## Converters - -NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN. - - - Nan::To() - - -### Nan::To() - -Converts a `v8::Local` to a different subtype of `v8::Value` or to a native data type. Returns a `Nan::MaybeLocal<>` or a `Nan::Maybe<>` accordingly. - -See [maybe_types.md](./maybe_types.md) for more information on `Nan::Maybe` types. - -Signatures: - -```c++ -// V8 types -Nan::MaybeLocal Nan::To(v8::Local val); -Nan::MaybeLocal Nan::To(v8::Local val); -Nan::MaybeLocal Nan::To(v8::Local val); -Nan::MaybeLocal Nan::To(v8::Local val); -Nan::MaybeLocal Nan::To(v8::Local val); -Nan::MaybeLocal Nan::To(v8::Local val); -Nan::MaybeLocal Nan::To(v8::Local val); - -// Native types -Nan::Maybe Nan::To(v8::Local val); -Nan::Maybe Nan::To(v8::Local val); -Nan::Maybe Nan::To(v8::Local val); -Nan::Maybe Nan::To(v8::Local val); -Nan::Maybe Nan::To(v8::Local val); -``` - -### Example - -```c++ -v8::Local val; -Nan::MaybeLocal str = Nan::To(val); -Nan::Maybe d = Nan::To(val); -``` - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/errors.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/errors.md deleted file mode 100644 index 843435b2b..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/errors.md +++ /dev/null @@ -1,226 +0,0 @@ -## Errors - -NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted. - -Note that an Error object is simply a specialized form of `v8::Value`. - -Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information. - - - Nan::Error() - - Nan::RangeError() - - Nan::ReferenceError() - - Nan::SyntaxError() - - Nan::TypeError() - - Nan::ThrowError() - - Nan::ThrowRangeError() - - Nan::ThrowReferenceError() - - Nan::ThrowSyntaxError() - - Nan::ThrowTypeError() - - Nan::FatalException() - - Nan::ErrnoException() - - Nan::TryCatch - - - -### Nan::Error() - -Create a new Error object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. - -Note that an Error object is simply a specialized form of `v8::Value`. - -Signature: - -```c++ -v8::Local Nan::Error(const char *msg); -v8::Local Nan::Error(v8::Local msg); -``` - - - -### Nan::RangeError() - -Create a new RangeError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. - -Note that an RangeError object is simply a specialized form of `v8::Value`. - -Signature: - -```c++ -v8::Local Nan::RangeError(const char *msg); -v8::Local Nan::RangeError(v8::Local msg); -``` - - - -### Nan::ReferenceError() - -Create a new ReferenceError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. - -Note that an ReferenceError object is simply a specialized form of `v8::Value`. - -Signature: - -```c++ -v8::Local Nan::ReferenceError(const char *msg); -v8::Local Nan::ReferenceError(v8::Local msg); -``` - - - -### Nan::SyntaxError() - -Create a new SyntaxError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. - -Note that an SyntaxError object is simply a specialized form of `v8::Value`. - -Signature: - -```c++ -v8::Local Nan::SyntaxError(const char *msg); -v8::Local Nan::SyntaxError(v8::Local msg); -``` - - - -### Nan::TypeError() - -Create a new TypeError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. - -Note that an TypeError object is simply a specialized form of `v8::Value`. - -Signature: - -```c++ -v8::Local Nan::TypeError(const char *msg); -v8::Local Nan::TypeError(v8::Local msg); -``` - - - -### Nan::ThrowError() - -Throw an Error object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new Error object will be created. - -Signature: - -```c++ -void Nan::ThrowError(const char *msg); -void Nan::ThrowError(v8::Local msg); -void Nan::ThrowError(v8::Local error); -``` - - - -### Nan::ThrowRangeError() - -Throw an RangeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new RangeError object will be created. - -Signature: - -```c++ -void Nan::ThrowRangeError(const char *msg); -void Nan::ThrowRangeError(v8::Local msg); -void Nan::ThrowRangeError(v8::Local error); -``` - - - -### Nan::ThrowReferenceError() - -Throw an ReferenceError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new ReferenceError object will be created. - -Signature: - -```c++ -void Nan::ThrowReferenceError(const char *msg); -void Nan::ThrowReferenceError(v8::Local msg); -void Nan::ThrowReferenceError(v8::Local error); -``` - - - -### Nan::ThrowSyntaxError() - -Throw an SyntaxError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new SyntaxError object will be created. - -Signature: - -```c++ -void Nan::ThrowSyntaxError(const char *msg); -void Nan::ThrowSyntaxError(v8::Local msg); -void Nan::ThrowSyntaxError(v8::Local error); -``` - - - -### Nan::ThrowTypeError() - -Throw an TypeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new TypeError object will be created. - -Signature: - -```c++ -void Nan::ThrowTypeError(const char *msg); -void Nan::ThrowTypeError(v8::Local msg); -void Nan::ThrowTypeError(v8::Local error); -``` - - -### Nan::FatalException() - -Replaces `node::FatalException()` which has a different API across supported versions of Node. For use with [`Nan::TryCatch`](#api_nan_try_catch). - -Signature: - -```c++ -void Nan::FatalException(const Nan::TryCatch& try_catch); -``` - - -### Nan::ErrnoException() - -Replaces `node::ErrnoException()` which has a different API across supported versions of Node. - -Signature: - -```c++ -v8::Local Nan::ErrnoException(int errorno, - const char* syscall = NULL, - const char* message = NULL, - const char* path = NULL); -``` - - - -### Nan::TryCatch - -A simple wrapper around [`v8::TryCatch`](https://v8docs.nodesource.com/node-8.16/d4/dc6/classv8_1_1_try_catch.html) compatible with all supported versions of V8. Can be used as a direct replacement in most cases. See also [`Nan::FatalException()`](#api_nan_fatal_exception) for an internal use compatible with `node::FatalException`. - -Signature: - -```c++ -class Nan::TryCatch { - public: - Nan::TryCatch(); - - bool HasCaught() const; - - bool CanContinue() const; - - v8::Local ReThrow(); - - v8::Local Exception() const; - - // Nan::MaybeLocal for older versions of V8 - v8::MaybeLocal StackTrace() const; - - v8::Local Message() const; - - void Reset(); - - void SetVerbose(bool value); - - void SetCaptureMessage(bool value); -}; -``` - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/json.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/json.md deleted file mode 100644 index 55beb2629..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/json.md +++ /dev/null @@ -1,62 +0,0 @@ -## JSON - -The _JSON_ object provides the C++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object. - - - Nan::JSON.Parse - - Nan::JSON.Stringify - -Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. - - - -### Nan::JSON.Parse - -A simple wrapper around [`v8::JSON::Parse`](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html#a936310d2540fb630ed37d3ee3ffe4504). - -Definition: - -```c++ -Nan::MaybeLocal Nan::JSON::Parse(v8::Local json_string); -``` - -Use `JSON.Parse(json_string)` to parse a string into a `v8::Value`. - -Example: - -```c++ -v8::Local json_string = Nan::New("{ \"JSON\": \"object\" }").ToLocalChecked(); - -Nan::JSON NanJSON; -Nan::MaybeLocal result = NanJSON.Parse(json_string); -if (!result.IsEmpty()) { - v8::Local val = result.ToLocalChecked(); -} -``` - - - -### Nan::JSON.Stringify - -A simple wrapper around [`v8::JSON::Stringify`](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html#a44b255c3531489ce43f6110209138860). - -Definition: - -```c++ -Nan::MaybeLocal Nan::JSON::Stringify(v8::Local json_object, v8::Local gap = v8::Local()); -``` - -Use `JSON.Stringify(value)` to stringify a `v8::Object`. - -Example: - -```c++ -// using `v8::Local val` from the `JSON::Parse` example -v8::Local obj = Nan::To(val).ToLocalChecked(); - -Nan::JSON NanJSON; -Nan::MaybeLocal result = NanJSON.Stringify(obj); -if (!result.IsEmpty()) { - v8::Local stringified = result.ToLocalChecked(); -} -``` - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/maybe_types.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/maybe_types.md deleted file mode 100644 index 142851a19..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/maybe_types.md +++ /dev/null @@ -1,583 +0,0 @@ -## Maybe Types - -The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_. - -* **Maybe Types** - - Nan::MaybeLocal - - Nan::Maybe - - Nan::Nothing - - Nan::Just -* **Maybe Helpers** - - Nan::Call() - - Nan::ToDetailString() - - Nan::ToArrayIndex() - - Nan::Equals() - - Nan::NewInstance() - - Nan::GetFunction() - - Nan::Set() - - Nan::DefineOwnProperty() - - Nan::ForceSet() - - Nan::Get() - - Nan::GetPropertyAttributes() - - Nan::Has() - - Nan::Delete() - - Nan::GetPropertyNames() - - Nan::GetOwnPropertyNames() - - Nan::SetPrototype() - - Nan::ObjectProtoToString() - - Nan::HasOwnProperty() - - Nan::HasRealNamedProperty() - - Nan::HasRealIndexedProperty() - - Nan::HasRealNamedCallbackProperty() - - Nan::GetRealNamedPropertyInPrototypeChain() - - Nan::GetRealNamedProperty() - - Nan::CallAsFunction() - - Nan::CallAsConstructor() - - Nan::GetSourceLine() - - Nan::GetLineNumber() - - Nan::GetStartColumn() - - Nan::GetEndColumn() - - Nan::CloneElementAt() - - Nan::HasPrivate() - - Nan::GetPrivate() - - Nan::SetPrivate() - - Nan::DeletePrivate() - - Nan::MakeMaybe() - - -### Nan::MaybeLocal - -A `Nan::MaybeLocal` is a wrapper around [`v8::Local`](https://v8docs.nodesource.com/node-8.16/de/deb/classv8_1_1_local.html) that enforces a check that determines whether the `v8::Local` is empty before it can be used. - -If an API method returns a `Nan::MaybeLocal`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, an empty `Nan::MaybeLocal` is returned. - -Definition: - -```c++ -template class Nan::MaybeLocal { - public: - MaybeLocal(); - - template MaybeLocal(v8::Local that); - - bool IsEmpty() const; - - template bool ToLocal(v8::Local *out); - - // Will crash if the MaybeLocal<> is empty. - v8::Local ToLocalChecked(); - - template v8::Local FromMaybe(v8::Local default_value) const; -}; -``` - -See the documentation for [`v8::MaybeLocal`](https://v8docs.nodesource.com/node-8.16/d8/d7d/classv8_1_1_maybe_local.html) for further details. - - -### Nan::Maybe - -A simple `Nan::Maybe` type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html. - -If an API method returns a `Nan::Maybe<>`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, a "Nothing" value is returned. - -Definition: - -```c++ -template class Nan::Maybe { - public: - bool IsNothing() const; - bool IsJust() const; - - // Will crash if the Maybe<> is nothing. - T FromJust(); - - T FromMaybe(const T& default_value); - - bool operator==(const Maybe &other); - - bool operator!=(const Maybe &other); -}; -``` - -See the documentation for [`v8::Maybe`](https://v8docs.nodesource.com/node-8.16/d9/d4b/classv8_1_1_maybe.html) for further details. - - -### Nan::Nothing - -Construct an empty `Nan::Maybe` type representing _nothing_. - -```c++ -template Nan::Maybe Nan::Nothing(); -``` - - -### Nan::Just - -Construct a `Nan::Maybe` type representing _just_ a value. - -```c++ -template Nan::Maybe Nan::Just(const T &t); -``` - - -### Nan::Call() - -A helper method for calling a synchronous [`v8::Function#Call()`](https://v8docs.nodesource.com/node-8.16/d5/d54/classv8_1_1_function.html#a9c3d0e4e13ddd7721fce238aa5b94a11) in a way compatible across supported versions of V8. - -For asynchronous callbacks, use Nan::Callback::Call along with an AsyncResource. - -Signature: - -```c++ -Nan::MaybeLocal Nan::Call(v8::Local fun, v8::Local recv, int argc, v8::Local argv[]); -Nan::MaybeLocal Nan::Call(const Nan::Callback& callback, v8::Local recv, - int argc, v8::Local argv[]); -Nan::MaybeLocal Nan::Call(const Nan::Callback& callback, int argc, v8::Local argv[]); -``` - - - -### Nan::ToDetailString() - -A helper method for calling [`v8::Value#ToDetailString()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#a2f9770296dc2c8d274bc8cc0dca243e5) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::ToDetailString(v8::Local val); -``` - - - -### Nan::ToArrayIndex() - -A helper method for calling [`v8::Value#ToArrayIndex()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#acc5bbef3c805ec458470c0fcd6f13493) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::ToArrayIndex(v8::Local val); -``` - - - -### Nan::Equals() - -A helper method for calling [`v8::Value#Equals()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#a08fba1d776a59bbf6864b25f9152c64b) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::Equals(v8::Local a, v8::Local(b)); -``` - - - -### Nan::NewInstance() - -A helper method for calling [`v8::Function#NewInstance()`](https://v8docs.nodesource.com/node-8.16/d5/d54/classv8_1_1_function.html#ae477558b10c14b76ed00e8dbab44ce5b) and [`v8::ObjectTemplate#NewInstance()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#ad605a7543cfbc5dab54cdb0883d14ae4) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::NewInstance(v8::Local h); -Nan::MaybeLocal Nan::NewInstance(v8::Local h, int argc, v8::Local argv[]); -Nan::MaybeLocal Nan::NewInstance(v8::Local h); -``` - - - -### Nan::GetFunction() - -A helper method for calling [`v8::FunctionTemplate#GetFunction()`](https://v8docs.nodesource.com/node-8.16/d8/d83/classv8_1_1_function_template.html#a56d904662a86eca78da37d9bb0ed3705) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetFunction(v8::Local t); -``` - - - -### Nan::Set() - -A helper method for calling [`v8::Object#Set()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a67604ea3734f170c66026064ea808f20) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::Set(v8::Local obj, - v8::Local key, - v8::Local value) -Nan::Maybe Nan::Set(v8::Local obj, - uint32_t index, - v8::Local value); -``` - - - -### Nan::DefineOwnProperty() - -A helper method for calling [`v8::Object#DefineOwnProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a6f76b2ed605cb8f9185b92de0033a820) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::DefineOwnProperty(v8::Local obj, - v8::Local key, - v8::Local value, - v8::PropertyAttribute attribs = v8::None); -``` - - - -### Nan::ForceSet() - -Deprecated, use Nan::DefineOwnProperty(). - -A helper method for calling [`v8::Object#ForceSet()`](https://v8docs.nodesource.com/node-0.12/db/d85/classv8_1_1_object.html#acfbdfd7427b516ebdb5c47c4df5ed96c) in a way compatible across supported versions of V8. - -Signature: - -```c++ -NAN_DEPRECATED Nan::Maybe Nan::ForceSet(v8::Local obj, - v8::Local key, - v8::Local value, - v8::PropertyAttribute attribs = v8::None); -``` - - - -### Nan::Get() - -A helper method for calling [`v8::Object#Get()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a2565f03e736694f6b1e1cf22a0b4eac2) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::Get(v8::Local obj, - v8::Local key); -Nan::MaybeLocal Nan::Get(v8::Local obj, uint32_t index); -``` - - - -### Nan::GetPropertyAttributes() - -A helper method for calling [`v8::Object#GetPropertyAttributes()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a9b898894da3d1db2714fd9325a54fe57) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::GetPropertyAttributes( - v8::Local obj, - v8::Local key); -``` - - - -### Nan::Has() - -A helper method for calling [`v8::Object#Has()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab3c3d89ea7c2f9afd08965bd7299a41d) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::Has(v8::Local obj, v8::Local key); -Nan::Maybe Nan::Has(v8::Local obj, uint32_t index); -``` - - - -### Nan::Delete() - -A helper method for calling [`v8::Object#Delete()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a48e4a19b2cedff867eecc73ddb7d377f) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::Delete(v8::Local obj, - v8::Local key); -Nan::Maybe Nan::Delete(v8::Local obj, uint32_t index); -``` - - - -### Nan::GetPropertyNames() - -A helper method for calling [`v8::Object#GetPropertyNames()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#aced885270cfd2c956367b5eedc7fbfe8) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetPropertyNames(v8::Local obj); -``` - - - -### Nan::GetOwnPropertyNames() - -A helper method for calling [`v8::Object#GetOwnPropertyNames()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a79a6e4d66049b9aa648ed4dfdb23e6eb) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetOwnPropertyNames(v8::Local obj); -``` - - - -### Nan::SetPrototype() - -A helper method for calling [`v8::Object#SetPrototype()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a442706b22fceda6e6d1f632122a9a9f4) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::SetPrototype(v8::Local obj, - v8::Local prototype); -``` - - - -### Nan::ObjectProtoToString() - -A helper method for calling [`v8::Object#ObjectProtoToString()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab7a92b4dcf822bef72f6c0ac6fea1f0b) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::ObjectProtoToString(v8::Local obj); -``` - - - -### Nan::HasOwnProperty() - -A helper method for calling [`v8::Object#HasOwnProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab7b7245442ca6de1e1c145ea3fd653ff) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::HasOwnProperty(v8::Local obj, - v8::Local key); -``` - - - -### Nan::HasRealNamedProperty() - -A helper method for calling [`v8::Object#HasRealNamedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ad8b80a59c9eb3c1e6c3cd6c84571f767) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::HasRealNamedProperty(v8::Local obj, - v8::Local key); -``` - - - -### Nan::HasRealIndexedProperty() - -A helper method for calling [`v8::Object#HasRealIndexedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af94fc1135a5e74a2193fb72c3a1b9855) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::HasRealIndexedProperty(v8::Local obj, - uint32_t index); -``` - - - -### Nan::HasRealNamedCallbackProperty() - -A helper method for calling [`v8::Object#HasRealNamedCallbackProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af743b7ea132b89f84d34d164d0668811) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::HasRealNamedCallbackProperty( - v8::Local obj, - v8::Local key); -``` - - - -### Nan::GetRealNamedPropertyInPrototypeChain() - -A helper method for calling [`v8::Object#GetRealNamedPropertyInPrototypeChain()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a8700b1862e6b4783716964ba4d5e6172) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetRealNamedPropertyInPrototypeChain( - v8::Local obj, - v8::Local key); -``` - - - -### Nan::GetRealNamedProperty() - -A helper method for calling [`v8::Object#GetRealNamedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a84471a824576a5994fdd0ffcbf99ccc0) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetRealNamedProperty(v8::Local obj, - v8::Local key); -``` - - - -### Nan::CallAsFunction() - -A helper method for calling [`v8::Object#CallAsFunction()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ad3ffc36f3dfc3592ce2a96bc047ee2cd) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::CallAsFunction(v8::Local obj, - v8::Local recv, - int argc, - v8::Local argv[]); -``` - - - -### Nan::CallAsConstructor() - -A helper method for calling [`v8::Object#CallAsConstructor()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a50d571de50d0b0dfb28795619d07a01b) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::CallAsConstructor(v8::Local obj, - int argc, - v8::Local argv[]); -``` - - - -### Nan::GetSourceLine() - -A helper method for calling [`v8::Message#GetSourceLine()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#a849f7a6c41549d83d8159825efccd23a) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetSourceLine(v8::Local msg); -``` - - - -### Nan::GetLineNumber() - -A helper method for calling [`v8::Message#GetLineNumber()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#adbe46c10a88a6565f2732a2d2adf99b9) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::GetLineNumber(v8::Local msg); -``` - - - -### Nan::GetStartColumn() - -A helper method for calling [`v8::Message#GetStartColumn()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#a60ede616ba3822d712e44c7a74487ba6) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::GetStartColumn(v8::Local msg); -``` - - - -### Nan::GetEndColumn() - -A helper method for calling [`v8::Message#GetEndColumn()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#aaa004cf19e529da980bc19fcb76d93be) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::GetEndColumn(v8::Local msg); -``` - - - -### Nan::CloneElementAt() - -A helper method for calling [`v8::Array#CloneElementAt()`](https://v8docs.nodesource.com/node-4.8/d3/d32/classv8_1_1_array.html#a1d3a878d4c1c7cae974dd50a1639245e) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::CloneElementAt(v8::Local array, uint32_t index); -``` - - -### Nan::HasPrivate() - -A helper method for calling [`v8::Object#HasPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af68a0b98066cfdeb8f943e98a40ba08d) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::HasPrivate(v8::Local object, v8::Local key); -``` - - -### Nan::GetPrivate() - -A helper method for calling [`v8::Object#GetPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a169f2da506acbec34deadd9149a1925a) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::GetPrivate(v8::Local object, v8::Local key); -``` - - -### Nan::SetPrivate() - -A helper method for calling [`v8::Object#SetPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ace1769b0f3b86bfe9fda1010916360ee) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::SetPrivate(v8::Local object, v8::Local key, v8::Local value); -``` - - -### Nan::DeletePrivate() - -A helper method for calling [`v8::Object#DeletePrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a138bb32a304f3982be02ad499693b8fd) in a way compatible across supported versions of V8. - -Signature: - -```c++ -Nan::Maybe Nan::DeletePrivate(v8::Local object, v8::Local key); -``` - - -### Nan::MakeMaybe() - -Wraps a `v8::Local<>` in a `Nan::MaybeLocal<>`. When called with a `Nan::MaybeLocal<>` it just returns its argument. This is useful in generic template code that builds on NAN. - -Synopsis: - -```c++ - MaybeLocal someNumber = MakeMaybe(New(3.141592654)); - MaybeLocal someString = MakeMaybe(New("probably")); -``` - -Signature: - -```c++ -template class MaybeMaybe> -Nan::MaybeLocal Nan::MakeMaybe(MaybeMaybe v); -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/methods.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/methods.md deleted file mode 100644 index 9642d027c..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/methods.md +++ /dev/null @@ -1,664 +0,0 @@ -## JavaScript-accessible methods - -A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://github.com/v8/v8/wiki/Embedder%27s-Guide#templates) for further information. - -In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type. - -* **Method argument types** - - Nan::FunctionCallbackInfo - - Nan::PropertyCallbackInfo - - Nan::ReturnValue -* **Method declarations** - - Method declaration - - Getter declaration - - Setter declaration - - Property getter declaration - - Property setter declaration - - Property enumerator declaration - - Property deleter declaration - - Property query declaration - - Index getter declaration - - Index setter declaration - - Index enumerator declaration - - Index deleter declaration - - Index query declaration -* Method and template helpers - - Nan::SetMethod() - - Nan::SetPrototypeMethod() - - Nan::SetAccessor() - - Nan::SetNamedPropertyHandler() - - Nan::SetIndexedPropertyHandler() - - Nan::SetTemplate() - - Nan::SetPrototypeTemplate() - - Nan::SetInstanceTemplate() - - Nan::SetCallHandler() - - Nan::SetCallAsFunctionHandler() - - -### Nan::FunctionCallbackInfo - -`Nan::FunctionCallbackInfo` should be used in place of [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.16/dd/d0d/classv8_1_1_function_callback_info.html), even with older versions of Node where `v8::FunctionCallbackInfo` does not exist. - -Definition: - -```c++ -template class FunctionCallbackInfo { - public: - ReturnValue GetReturnValue() const; - v8::Local Callee(); // NOTE: Not available in NodeJS >= 10.0.0 - v8::Local Data(); - v8::Local Holder(); - bool IsConstructCall(); - int Length() const; - v8::Local operator[](int i) const; - v8::Local This() const; - v8::Isolate *GetIsolate() const; -}; -``` - -See the [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.16/dd/d0d/classv8_1_1_function_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from methods. - -**Note:** `FunctionCallbackInfo::Callee` is removed in Node.js after `10.0.0` because it is was deprecated in V8. Consider using `info.Data()` to pass any information you need. - - -### Nan::PropertyCallbackInfo - -`Nan::PropertyCallbackInfo` should be used in place of [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/node-8.16/d7/dc5/classv8_1_1_property_callback_info.html), even with older versions of Node where `v8::PropertyCallbackInfo` does not exist. - -Definition: - -```c++ -template class PropertyCallbackInfo : public PropertyCallbackInfoBase { - public: - ReturnValue GetReturnValue() const; - v8::Isolate* GetIsolate() const; - v8::Local Data() const; - v8::Local This() const; - v8::Local Holder() const; -}; -``` - -See the [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/node-8.16/d7/dc5/classv8_1_1_property_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from property accessor methods. - - -### Nan::ReturnValue - -`Nan::ReturnValue` is used in place of [`v8::ReturnValue`](https://v8docs.nodesource.com/node-8.16/da/da7/classv8_1_1_return_value.html) on both [`Nan::FunctionCallbackInfo`](#api_nan_function_callback_info) and [`Nan::PropertyCallbackInfo`](#api_nan_property_callback_info) as the return type of `GetReturnValue()`. - -Example usage: - -```c++ -void EmptyArray(const Nan::FunctionCallbackInfo& info) { - info.GetReturnValue().Set(Nan::New()); -} -``` - -Definition: - -```c++ -template class ReturnValue { - public: - // Handle setters - template void Set(const v8::Local &handle); - template void Set(const Nan::Global &handle); - - // Fast primitive setters - void Set(bool value); - void Set(double i); - void Set(int32_t i); - void Set(uint32_t i); - - // Fast JS primitive setters - void SetNull(); - void SetUndefined(); - void SetEmptyString(); - - // Convenience getter for isolate - v8::Isolate *GetIsolate() const; -}; -``` - -See the documentation on [`v8::ReturnValue`](https://v8docs.nodesource.com/node-8.16/da/da7/classv8_1_1_return_value.html) for further information on this. - - -### Method declaration - -JavaScript-accessible methods should be declared with the following signature to form a `Nan::FunctionCallback`: - -```c++ -typedef void(*FunctionCallback)(const FunctionCallbackInfo&); -``` - -Example: - -```c++ -void MethodName(const Nan::FunctionCallbackInfo& info) { - ... -} -``` - -You do not need to declare a new `HandleScope` within a method as one is implicitly created for you. - -**Example usage** - -```c++ -// .h: -class Foo : public Nan::ObjectWrap { - ... - - static void Bar(const Nan::FunctionCallbackInfo& info); - static void Baz(const Nan::FunctionCallbackInfo& info); -} - - -// .cc: -void Foo::Bar(const Nan::FunctionCallbackInfo& info) { - ... -} - -void Foo::Baz(const Nan::FunctionCallbackInfo& info) { - ... -} -``` - -A helper macro `NAN_METHOD(methodname)` exists, compatible with NAN v1 method declarations. - -**Example usage with `NAN_METHOD(methodname)`** - -```c++ -// .h: -class Foo : public Nan::ObjectWrap { - ... - - static NAN_METHOD(Bar); - static NAN_METHOD(Baz); -} - - -// .cc: -NAN_METHOD(Foo::Bar) { - ... -} - -NAN_METHOD(Foo::Baz) { - ... -} -``` - -Use [`Nan::SetPrototypeMethod`](#api_nan_set_prototype_method) to attach a method to a JavaScript function prototype or [`Nan::SetMethod`](#api_nan_set_method) to attach a method directly on a JavaScript object. - - -### Getter declaration - -JavaScript-accessible getters should be declared with the following signature to form a `Nan::GetterCallback`: - -```c++ -typedef void(*GetterCallback)(v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void GetterName(v8::Local property, - const Nan::PropertyCallbackInfo& info) { - ... -} -``` - -You do not need to declare a new `HandleScope` within a getter as one is implicitly created for you. - -A helper macro `NAN_GETTER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors). - - -### Setter declaration - -JavaScript-accessible setters should be declared with the following signature to form a Nan::SetterCallback: - -```c++ -typedef void(*SetterCallback)(v8::Local, - v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void SetterName(v8::Local property, - v8::Local value, - const Nan::PropertyCallbackInfo& info) { - ... -} -``` - -You do not need to declare a new `HandleScope` within a setter as one is implicitly created for you. - -A helper macro `NAN_SETTER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors). - - -### Property getter declaration - -JavaScript-accessible property getters should be declared with the following signature to form a Nan::PropertyGetterCallback: - -```c++ -typedef void(*PropertyGetterCallback)(v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void PropertyGetterName(v8::Local property, - const Nan::PropertyCallbackInfo& info) { - ... -} -``` - -You do not need to declare a new `HandleScope` within a property getter as one is implicitly created for you. - -A helper macro `NAN_PROPERTY_GETTER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Property setter declaration - -JavaScript-accessible property setters should be declared with the following signature to form a Nan::PropertySetterCallback: - -```c++ -typedef void(*PropertySetterCallback)(v8::Local, - v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void PropertySetterName(v8::Local property, - v8::Local value, - const Nan::PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a property setter as one is implicitly created for you. - -A helper macro `NAN_PROPERTY_SETTER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Property enumerator declaration - -JavaScript-accessible property enumerators should be declared with the following signature to form a Nan::PropertyEnumeratorCallback: - -```c++ -typedef void(*PropertyEnumeratorCallback)(const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void PropertyEnumeratorName(const Nan::PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a property enumerator as one is implicitly created for you. - -A helper macro `NAN_PROPERTY_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Property deleter declaration - -JavaScript-accessible property deleters should be declared with the following signature to form a Nan::PropertyDeleterCallback: - -```c++ -typedef void(*PropertyDeleterCallback)(v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void PropertyDeleterName(v8::Local property, - const Nan::PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a property deleter as one is implicitly created for you. - -A helper macro `NAN_PROPERTY_DELETER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Property query declaration - -JavaScript-accessible property query methods should be declared with the following signature to form a Nan::PropertyQueryCallback: - -```c++ -typedef void(*PropertyQueryCallback)(v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void PropertyQueryName(v8::Local property, - const Nan::PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a property query method as one is implicitly created for you. - -A helper macro `NAN_PROPERTY_QUERY(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Index getter declaration - -JavaScript-accessible index getter methods should be declared with the following signature to form a Nan::IndexGetterCallback: - -```c++ -typedef void(*IndexGetterCallback)(uint32_t, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void IndexGetterName(uint32_t index, const PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a index getter as one is implicitly created for you. - -A helper macro `NAN_INDEX_GETTER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Index setter declaration - -JavaScript-accessible index setter methods should be declared with the following signature to form a Nan::IndexSetterCallback: - -```c++ -typedef void(*IndexSetterCallback)(uint32_t, - v8::Local, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void IndexSetterName(uint32_t index, - v8::Local value, - const PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a index setter as one is implicitly created for you. - -A helper macro `NAN_INDEX_SETTER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Index enumerator declaration - -JavaScript-accessible index enumerator methods should be declared with the following signature to form a Nan::IndexEnumeratorCallback: - -```c++ -typedef void(*IndexEnumeratorCallback)(const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void IndexEnumeratorName(const PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a index enumerator as one is implicitly created for you. - -A helper macro `NAN_INDEX_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Index deleter declaration - -JavaScript-accessible index deleter methods should be declared with the following signature to form a Nan::IndexDeleterCallback: - -```c++ -typedef void(*IndexDeleterCallback)(uint32_t, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void IndexDeleterName(uint32_t index, const PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a index deleter as one is implicitly created for you. - -A helper macro `NAN_INDEX_DELETER(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Index query declaration - -JavaScript-accessible index query methods should be declared with the following signature to form a Nan::IndexQueryCallback: - -```c++ -typedef void(*IndexQueryCallback)(uint32_t, - const PropertyCallbackInfo&); -``` - -Example: - -```c++ -void IndexQueryName(uint32_t index, const PropertyCallbackInfo& info); -``` - -You do not need to declare a new `HandleScope` within a index query method as one is implicitly created for you. - -A helper macro `NAN_INDEX_QUERY(methodname)` exists, compatible with NAN v1 method declarations. - -Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). - - -### Nan::SetMethod() - -Sets a method with a given name directly on a JavaScript object where the method has the `Nan::FunctionCallback` signature (see Method declaration). - -Signature: - -```c++ -void Nan::SetMethod(v8::Local recv, - const char *name, - Nan::FunctionCallback callback, - v8::Local data = v8::Local()) -void Nan::SetMethod(v8::Local templ, - const char *name, - Nan::FunctionCallback callback, - v8::Local data = v8::Local()) -``` - - -### Nan::SetPrototypeMethod() - -Sets a method with a given name on a `FunctionTemplate`'s prototype where the method has the `Nan::FunctionCallback` signature (see Method declaration). - -Signature: - -```c++ -void Nan::SetPrototypeMethod(v8::Local recv, - const char* name, - Nan::FunctionCallback callback, - v8::Local data = v8::Local()) -``` - - -### Nan::SetAccessor() - -Sets getters and setters for a property with a given name on an `ObjectTemplate` or a plain `Object`. Accepts getters with the `Nan::GetterCallback` signature (see Getter declaration) and setters with the `Nan::SetterCallback` signature (see Setter declaration). - -Signature: - -```c++ -void SetAccessor(v8::Local tpl, - v8::Local name, - Nan::GetterCallback getter, - Nan::SetterCallback setter = 0, - v8::Local data = v8::Local(), - v8::AccessControl settings = v8::DEFAULT, - v8::PropertyAttribute attribute = v8::None, - imp::Sig signature = imp::Sig()); -bool SetAccessor(v8::Local obj, - v8::Local name, - Nan::GetterCallback getter, - Nan::SetterCallback setter = 0, - v8::Local data = v8::Local(), - v8::AccessControl settings = v8::DEFAULT, - v8::PropertyAttribute attribute = v8::None) -``` - -See the V8 [`ObjectTemplate#SetAccessor()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#aca0ed196f8a9adb1f68b1aadb6c9cd77) and [`Object#SetAccessor()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ae91b3b56b357f285288c89fbddc46d1b) for further information about how to use `Nan::SetAccessor()`. - - -### Nan::SetNamedPropertyHandler() - -Sets named property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts: - -* Property getters with the `Nan::PropertyGetterCallback` signature (see Property getter declaration) -* Property setters with the `Nan::PropertySetterCallback` signature (see Property setter declaration) -* Property query methods with the `Nan::PropertyQueryCallback` signature (see Property query declaration) -* Property deleters with the `Nan::PropertyDeleterCallback` signature (see Property deleter declaration) -* Property enumerators with the `Nan::PropertyEnumeratorCallback` signature (see Property enumerator declaration) - -Signature: - -```c++ -void SetNamedPropertyHandler(v8::Local tpl, - Nan::PropertyGetterCallback getter, - Nan::PropertySetterCallback setter = 0, - Nan::PropertyQueryCallback query = 0, - Nan::PropertyDeleterCallback deleter = 0, - Nan::PropertyEnumeratorCallback enumerator = 0, - v8::Local data = v8::Local()) -``` - -See the V8 [`ObjectTemplate#SetNamedPropertyHandler()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#a33b3ebd7de641f6cc6414b7de01fc1c7) for further information about how to use `Nan::SetNamedPropertyHandler()`. - - -### Nan::SetIndexedPropertyHandler() - -Sets indexed property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts: - -* Indexed property getters with the `Nan::IndexGetterCallback` signature (see Index getter declaration) -* Indexed property setters with the `Nan::IndexSetterCallback` signature (see Index setter declaration) -* Indexed property query methods with the `Nan::IndexQueryCallback` signature (see Index query declaration) -* Indexed property deleters with the `Nan::IndexDeleterCallback` signature (see Index deleter declaration) -* Indexed property enumerators with the `Nan::IndexEnumeratorCallback` signature (see Index enumerator declaration) - -Signature: - -```c++ -void SetIndexedPropertyHandler(v8::Local tpl, - Nan::IndexGetterCallback getter, - Nan::IndexSetterCallback setter = 0, - Nan::IndexQueryCallback query = 0, - Nan::IndexDeleterCallback deleter = 0, - Nan::IndexEnumeratorCallback enumerator = 0, - v8::Local data = v8::Local()) -``` - -See the V8 [`ObjectTemplate#SetIndexedPropertyHandler()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#ac89f06d634add0e890452033f7d17ff1) for further information about how to use `Nan::SetIndexedPropertyHandler()`. - - -### Nan::SetTemplate() - -Adds properties on an `Object`'s or `Function`'s template. - -Signature: - -```c++ -void Nan::SetTemplate(v8::Local templ, - const char *name, - v8::Local value); -void Nan::SetTemplate(v8::Local templ, - v8::Local name, - v8::Local value, - v8::PropertyAttribute attributes) -``` - -Calls the `Template`'s [`Set()`](https://v8docs.nodesource.com/node-8.16/db/df7/classv8_1_1_template.html#ae3fbaff137557aa6a0233bc7e52214ac). - - -### Nan::SetPrototypeTemplate() - -Adds properties on an `Object`'s or `Function`'s prototype template. - -Signature: - -```c++ -void Nan::SetPrototypeTemplate(v8::Local templ, - const char *name, - v8::Local value); -void Nan::SetPrototypeTemplate(v8::Local templ, - v8::Local name, - v8::Local value, - v8::PropertyAttribute attributes) -``` - -Calls the `FunctionTemplate`'s _PrototypeTemplate's_ [`Set()`](https://v8docs.nodesource.com/node-8.16/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). - - -### Nan::SetInstanceTemplate() - -Use to add instance properties on `FunctionTemplate`'s. - -Signature: - -```c++ -void Nan::SetInstanceTemplate(v8::Local templ, - const char *name, - v8::Local value); -void Nan::SetInstanceTemplate(v8::Local templ, - v8::Local name, - v8::Local value, - v8::PropertyAttribute attributes) -``` - -Calls the `FunctionTemplate`'s _InstanceTemplate's_ [`Set()`](https://v8docs.nodesource.com/node-8.16/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). - - -### Nan::SetCallHandler() - -Set the call-handler callback for a `v8::FunctionTemplate`. -This callback is called whenever the function created from this FunctionTemplate is called. - -Signature: - -```c++ -void Nan::SetCallHandler(v8::Local templ, Nan::FunctionCallback callback, v8::Local data = v8::Local()) -``` - -Calls the `FunctionTemplate`'s [`SetCallHandler()`](https://v8docs.nodesource.com/node-8.16/d8/d83/classv8_1_1_function_template.html#ab7574b298db3c27fbc2ed465c08ea2f8). - - -### Nan::SetCallAsFunctionHandler() - -Sets the callback to be used when calling instances created from the `v8::ObjectTemplate` as a function. -If no callback is set, instances behave like normal JavaScript objects that cannot be called as a function. - -Signature: - -```c++ -void Nan::SetCallAsFunctionHandler(v8::Local templ, Nan::FunctionCallback callback, v8::Local data = v8::Local()) -``` - -Calls the `ObjectTemplate`'s [`SetCallAsFunctionHandler()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#a5e9612fc80bf6db8f2da199b9b0bd04e). - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/new.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/new.md deleted file mode 100644 index 0f28a0e92..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/new.md +++ /dev/null @@ -1,147 +0,0 @@ -## New - -NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8. - - - Nan::New() - - Nan::Undefined() - - Nan::Null() - - Nan::True() - - Nan::False() - - Nan::EmptyString() - - - -### Nan::New() - -`Nan::New()` should be used to instantiate new JavaScript objects. - -Refer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation. - -Signatures: - -Return types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local`. The following types will be contained within a `Nan::MaybeLocal`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`. - -Empty objects: - -```c++ -Nan::New(); -``` - -Generic single and multiple-argument: - -```c++ -Nan::New(A0 arg0); -Nan::New(A0 arg0, A1 arg1); -Nan::New(A0 arg0, A1 arg1, A2 arg2); -Nan::New(A0 arg0, A1 arg1, A2 arg2, A3 arg3); -``` - -For creating `v8::FunctionTemplate` and `v8::Function` objects: - -_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._ - -```c++ -Nan::New(Nan::FunctionCallback callback, - v8::Local data = v8::Local()); -Nan::New(Nan::FunctionCallback callback, - v8::Local data = v8::Local(), - A2 a2 = A2()); -``` - -Native number types: - -```c++ -v8::Local Nan::New(bool value); -v8::Local Nan::New(int32_t value); -v8::Local Nan::New(uint32_t value); -v8::Local Nan::New(double value); -``` - -String types: - -```c++ -Nan::MaybeLocal Nan::New(std::string const& value); -Nan::MaybeLocal Nan::New(const char * value, int length); -Nan::MaybeLocal Nan::New(const char * value); -Nan::MaybeLocal Nan::New(const uint16_t * value); -Nan::MaybeLocal Nan::New(const uint16_t * value, int length); -``` - -Specialized types: - -```c++ -v8::Local Nan::New(v8::String::ExternalStringResource * value); -v8::Local Nan::New(Nan::ExternalOneByteStringResource * value); -v8::Local Nan::New(v8::Local pattern, v8::RegExp::Flags flags); -``` - -Note that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/node-8.16/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8. - - - -### Nan::Undefined() - -A helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8. - -Signature: - -```c++ -v8::Local Nan::Undefined() -``` - - -### Nan::Null() - -A helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8. - -Signature: - -```c++ -v8::Local Nan::Null() -``` - - -### Nan::True() - -A helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8. - -Signature: - -```c++ -v8::Local Nan::True() -``` - - -### Nan::False() - -A helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8. - -Signature: - -```c++ -v8::Local Nan::False() -``` - - -### Nan::EmptyString() - -Call [`v8::String::Empty`](https://v8docs.nodesource.com/node-8.16/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8. - -Signature: - -```c++ -v8::Local Nan::EmptyString() -``` - - - -### Nan::NewOneByteString() - -An implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/node-8.16/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data. - -Signature: - -```c++ -Nan::MaybeLocal Nan::NewOneByteString(const uint8_t * value, - int length = -1) -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/node_misc.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/node_misc.md deleted file mode 100644 index 17578e349..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/node_misc.md +++ /dev/null @@ -1,123 +0,0 @@ -## Miscellaneous Node Helpers - - - Nan::AsyncResource - - Nan::MakeCallback() - - NAN_MODULE_INIT() - - Nan::Export() - - -### Nan::AsyncResource - -This class is analogous to the `AsyncResource` JavaScript class exposed by Node's [async_hooks][] API. - -When calling back into JavaScript asynchronously, special care must be taken to ensure that the runtime can properly track -async hops. `Nan::AsyncResource` is a class that provides an RAII wrapper around `node::EmitAsyncInit`, `node::EmitAsyncDestroy`, -and `node::MakeCallback`. Using this mechanism to call back into JavaScript, as opposed to `Nan::MakeCallback` or -`v8::Function::Call` ensures that the callback is executed in the correct async context. This ensures that async mechanisms -such as domains and [async_hooks][] function correctly. - -Definition: - -```c++ -class AsyncResource { - public: - AsyncResource(v8::Local name, - v8::Local resource = New()); - AsyncResource(const char* name, - v8::Local resource = New()); - ~AsyncResource(); - - v8::MaybeLocal runInAsyncScope(v8::Local target, - v8::Local func, - int argc, - v8::Local* argv); - v8::MaybeLocal runInAsyncScope(v8::Local target, - v8::Local symbol, - int argc, - v8::Local* argv); - v8::MaybeLocal runInAsyncScope(v8::Local target, - const char* method, - int argc, - v8::Local* argv); -}; -``` - -* `name`: Identifier for the kind of resource that is being provided for diagnostics information exposed by the [async_hooks][] - API. This will be passed to the possible `init` hook as the `type`. To avoid name collisions with other modules we recommend - that the name include the name of the owning module as a prefix. For example `mysql` module could use something like - `mysql:batch-db-query-resource`. -* `resource`: An optional object associated with the async work that will be passed to the possible [async_hooks][] - `init` hook. If this parameter is omitted, or an empty handle is provided, this object will be created automatically. -* When calling JS on behalf of this resource, one can use `runInAsyncScope`. This will ensure that the callback runs in the - correct async execution context. -* `AsyncDestroy` is automatically called when an AsyncResource object is destroyed. - -For more details, see the Node [async_hooks][] documentation. You might also want to take a look at the documentation for the -[N-API counterpart][napi]. For example usage, see the `asyncresource.cpp` example in the `test/cpp` directory. - - -### Nan::MakeCallback() - -Deprecated wrappers around the legacy `node::MakeCallback()` APIs. Node.js 10+ -has deprecated these legacy APIs as they do not provide a mechanism to preserve -async context. - -We recommend that you use the `AsyncResource` class and `AsyncResource::runInAsyncScope` instead of using `Nan::MakeCallback` or -`v8::Function#Call()` directly. `AsyncResource` properly takes care of running the callback in the correct async execution -context – something that is essential for functionality like domains, async_hooks and async debugging. - -Signatures: - -```c++ -NAN_DEPRECATED -v8::Local Nan::MakeCallback(v8::Local target, - v8::Local func, - int argc, - v8::Local* argv); -NAN_DEPRECATED -v8::Local Nan::MakeCallback(v8::Local target, - v8::Local symbol, - int argc, - v8::Local* argv); -NAN_DEPRECATED -v8::Local Nan::MakeCallback(v8::Local target, - const char* method, - int argc, - v8::Local* argv); -``` - - - -### NAN_MODULE_INIT() - -Used to define the entry point function to a Node add-on. Creates a function with a given `name` that receives a `target` object representing the equivalent of the JavaScript `exports` object. - -See example below. - - -### Nan::Export() - -A simple helper to register a `v8::FunctionTemplate` from a JavaScript-accessible method (see [Methods](./methods.md)) as a property on an object. Can be used in a way similar to assigning properties to `module.exports` in JavaScript. - -Signature: - -```c++ -void Export(v8::Local target, const char *name, Nan::FunctionCallback f) -``` - -Also available as the shortcut `NAN_EXPORT` macro. - -Example: - -```c++ -NAN_METHOD(Foo) { - ... -} - -NAN_MODULE_INIT(Init) { - NAN_EXPORT(target, Foo); -} -``` - -[async_hooks]: https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.html -[napi]: https://nodejs.org/dist/latest-v9.x/docs/api/n-api.html#n_api_custom_asynchronous_operations diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/object_wrappers.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/object_wrappers.md deleted file mode 100644 index 07d8c058a..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/object_wrappers.md +++ /dev/null @@ -1,263 +0,0 @@ -## Object Wrappers - -The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects. - - - Nan::ObjectWrap - - - -### Nan::ObjectWrap() - -A reimplementation of `node::ObjectWrap` that adds some API not present in older versions of Node. Should be preferred over `node::ObjectWrap` in all cases for consistency. - -Definition: - -```c++ -class ObjectWrap { - public: - ObjectWrap(); - - virtual ~ObjectWrap(); - - template - static inline T* Unwrap(v8::Local handle); - - inline v8::Local handle(); - - inline Nan::Persistent& persistent(); - - protected: - inline void Wrap(v8::Local handle); - - inline void MakeWeak(); - - /* Ref() marks the object as being attached to an event loop. - * Refed objects will not be garbage collected, even if - * all references are lost. - */ - virtual void Ref(); - - /* Unref() marks an object as detached from the event loop. This is its - * default state. When an object with a "weak" reference changes from - * attached to detached state it will be freed. Be careful not to access - * the object after making this call as it might be gone! - * (A "weak reference" means an object that only has a - * persistent handle.) - * - * DO NOT CALL THIS FROM DESTRUCTOR - */ - virtual void Unref(); - - int refs_; // ro -}; -``` - -See the Node documentation on [Wrapping C++ Objects](https://nodejs.org/api/addons.html#addons_wrapping_c_objects) for more details. - -### This vs. Holder - -When calling `Unwrap`, it is important that the argument is indeed some JavaScript object which got wrapped by a `Wrap` call for this class or any derived class. -The `Signature` installed by [`Nan::SetPrototypeMethod()`](methods.md#api_nan_set_prototype_method) does ensure that `info.Holder()` is just such an instance. -In Node 0.12 and later, `info.This()` will also be of such a type, since otherwise the invocation will get rejected. -However, in Node 0.10 and before it was possible to invoke a method on a JavaScript object which just had the extension type in its prototype chain. -In such a situation, calling `Unwrap` on `info.This()` will likely lead to a failed assertion causing a crash, but could lead to even more serious corruption. - -On the other hand, calling `Unwrap` in an [accessor](methods.md#api_nan_set_accessor) should not use `Holder()` if the accessor is defined on the prototype. -So either define your accessors on the instance template, -or use `This()` after verifying that it is indeed a valid object. - -### Examples - -#### Basic - -```c++ -class MyObject : public Nan::ObjectWrap { - public: - static NAN_MODULE_INIT(Init) { - v8::Local tpl = Nan::New(New); - tpl->SetClassName(Nan::New("MyObject").ToLocalChecked()); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - - Nan::SetPrototypeMethod(tpl, "getHandle", GetHandle); - Nan::SetPrototypeMethod(tpl, "getValue", GetValue); - - constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); - Nan::Set(target, Nan::New("MyObject").ToLocalChecked(), - Nan::GetFunction(tpl).ToLocalChecked()); - } - - private: - explicit MyObject(double value = 0) : value_(value) {} - ~MyObject() {} - - static NAN_METHOD(New) { - if (info.IsConstructCall()) { - double value = info[0]->IsUndefined() ? 0 : Nan::To(info[0]).FromJust(); - MyObject *obj = new MyObject(value); - obj->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - } else { - const int argc = 1; - v8::Local argv[argc] = {info[0]}; - v8::Local cons = Nan::New(constructor()); - info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); - } - } - - static NAN_METHOD(GetHandle) { - MyObject* obj = Nan::ObjectWrap::Unwrap(info.Holder()); - info.GetReturnValue().Set(obj->handle()); - } - - static NAN_METHOD(GetValue) { - MyObject* obj = Nan::ObjectWrap::Unwrap(info.Holder()); - info.GetReturnValue().Set(obj->value_); - } - - static inline Nan::Persistent & constructor() { - static Nan::Persistent my_constructor; - return my_constructor; - } - - double value_; -}; - -NODE_MODULE(objectwrapper, MyObject::Init) -``` - -To use in Javascript: - -```Javascript -var objectwrapper = require('bindings')('objectwrapper'); - -var obj = new objectwrapper.MyObject(5); -console.log('Should be 5: ' + obj.getValue()); -``` - -#### Factory of wrapped objects - -```c++ -class MyFactoryObject : public Nan::ObjectWrap { - public: - static NAN_MODULE_INIT(Init) { - v8::Local tpl = Nan::New(New); - tpl->InstanceTemplate()->SetInternalFieldCount(1); - - Nan::SetPrototypeMethod(tpl, "getValue", GetValue); - - constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); - } - - static NAN_METHOD(NewInstance) { - v8::Local cons = Nan::New(constructor()); - double value = info[0]->IsNumber() ? Nan::To(info[0]).FromJust() : 0; - const int argc = 1; - v8::Local argv[1] = {Nan::New(value)}; - info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); - } - - // Needed for the next example: - inline double value() const { - return value_; - } - - private: - explicit MyFactoryObject(double value = 0) : value_(value) {} - ~MyFactoryObject() {} - - static NAN_METHOD(New) { - if (info.IsConstructCall()) { - double value = info[0]->IsNumber() ? Nan::To(info[0]).FromJust() : 0; - MyFactoryObject * obj = new MyFactoryObject(value); - obj->Wrap(info.This()); - info.GetReturnValue().Set(info.This()); - } else { - const int argc = 1; - v8::Local argv[argc] = {info[0]}; - v8::Local cons = Nan::New(constructor()); - info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); - } - } - - static NAN_METHOD(GetValue) { - MyFactoryObject* obj = ObjectWrap::Unwrap(info.Holder()); - info.GetReturnValue().Set(obj->value_); - } - - static inline Nan::Persistent & constructor() { - static Nan::Persistent my_constructor; - return my_constructor; - } - - double value_; -}; - -NAN_MODULE_INIT(Init) { - MyFactoryObject::Init(target); - Nan::Set(target, - Nan::New("newFactoryObjectInstance").ToLocalChecked(), - Nan::GetFunction( - Nan::New(MyFactoryObject::NewInstance)).ToLocalChecked() - ); -} - -NODE_MODULE(wrappedobjectfactory, Init) -``` - -To use in Javascript: - -```Javascript -var wrappedobjectfactory = require('bindings')('wrappedobjectfactory'); - -var obj = wrappedobjectfactory.newFactoryObjectInstance(10); -console.log('Should be 10: ' + obj.getValue()); -``` - -#### Passing wrapped objects around - -Use the `MyFactoryObject` class above along with the following: - -```c++ -static NAN_METHOD(Sum) { - Nan::MaybeLocal maybe1 = Nan::To(info[0]); - Nan::MaybeLocal maybe2 = Nan::To(info[1]); - - // Quick check: - if (maybe1.IsEmpty() || maybe2.IsEmpty()) { - // return value is undefined by default - return; - } - - MyFactoryObject* obj1 = - Nan::ObjectWrap::Unwrap(maybe1.ToLocalChecked()); - MyFactoryObject* obj2 = - Nan::ObjectWrap::Unwrap(maybe2.ToLocalChecked()); - - info.GetReturnValue().Set(Nan::New(obj1->value() + obj2->value())); -} - -NAN_MODULE_INIT(Init) { - MyFactoryObject::Init(target); - Nan::Set(target, - Nan::New("newFactoryObjectInstance").ToLocalChecked(), - Nan::GetFunction( - Nan::New(MyFactoryObject::NewInstance)).ToLocalChecked() - ); - Nan::Set(target, - Nan::New("sum").ToLocalChecked(), - Nan::GetFunction(Nan::New(Sum)).ToLocalChecked() - ); -} - -NODE_MODULE(myaddon, Init) -``` - -To use in Javascript: - -```Javascript -var myaddon = require('bindings')('myaddon'); - -var obj1 = myaddon.newFactoryObjectInstance(5); -var obj2 = myaddon.newFactoryObjectInstance(10); -console.log('sum of object values: ' + myaddon.sum(obj1, obj2)); -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/persistent.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/persistent.md deleted file mode 100644 index 2e13f6bb0..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/persistent.md +++ /dev/null @@ -1,296 +0,0 @@ -## Persistent references - -An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed. - -Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported. - - - Nan::PersistentBase & v8::PersistentBase - - Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits - - Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits - - Nan::Persistent - - Nan::Global - - Nan::WeakCallbackInfo - - Nan::WeakCallbackType - -Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles). - - -### Nan::PersistentBase & v8::PersistentBase - -A persistent handle contains a reference to a storage cell in V8 which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or `Nan::PersistentBase::Reset()`. Existing handles can be disposed using an argument-less `Nan::PersistentBase::Reset()`. - -Definition: - -_(note: this is implemented as `Nan::PersistentBase` for older versions of V8 and the native `v8::PersistentBase` is used for newer versions of V8)_ - -```c++ -template class PersistentBase { - public: - /** - * If non-empty, destroy the underlying storage cell - */ - void Reset(); - - /** - * If non-empty, destroy the underlying storage cell and create a new one with - * the contents of another if it is also non-empty - */ - template void Reset(const v8::Local &other); - - /** - * If non-empty, destroy the underlying storage cell and create a new one with - * the contents of another if it is also non-empty - */ - template void Reset(const PersistentBase &other); - - /** Returns true if the handle is empty. */ - bool IsEmpty() const; - - /** - * If non-empty, destroy the underlying storage cell - * IsEmpty() will return true after this call. - */ - void Empty(); - - template bool operator==(const PersistentBase &that); - - template bool operator==(const v8::Local &that); - - template bool operator!=(const PersistentBase &that); - - template bool operator!=(const v8::Local &that); - - /** - * Install a finalization callback on this object. - * NOTE: There is no guarantee as to *when* or even *if* the callback is - * invoked. The invocation is performed solely on a best effort basis. - * As always, GC-based finalization should *not* be relied upon for any - * critical form of resource management! At the moment you can either - * specify a parameter for the callback or the location of two internal - * fields in the dying object. - */ - template - void SetWeak(P *parameter, - typename WeakCallbackInfo

::Callback callback, - WeakCallbackType type); - - void ClearWeak(); - - /** - * Marks the reference to this object independent. Garbage collector is free - * to ignore any object groups containing this object. Weak callback for an - * independent handle should not assume that it will be preceded by a global - * GC prologue callback or followed by a global GC epilogue callback. - */ - void MarkIndependent() const; - - bool IsIndependent() const; - - /** Checks if the handle holds the only reference to an object. */ - bool IsNearDeath() const; - - /** Returns true if the handle's reference is weak. */ - bool IsWeak() const -}; -``` - -See the V8 documentation for [`PersistentBase`](https://v8docs.nodesource.com/node-8.16/d4/dca/classv8_1_1_persistent_base.html) for further information. - -**Tip:** To get a `v8::Local` reference to the original object back from a `PersistentBase` or `Persistent` object: - -```c++ -v8::Local object = Nan::New(persistent); -``` - - -### Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits - -Default traits for `Nan::Persistent`. This class does not allow use of the a copy constructor or assignment operator. At present `kResetInDestructor` is not set, but that will change in a future version. - -Definition: - -_(note: this is implemented as `Nan::NonCopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_ - -```c++ -template class NonCopyablePersistentTraits { - public: - typedef Persistent > NonCopyablePersistent; - - static const bool kResetInDestructor = false; - - template - static void Copy(const Persistent &source, - NonCopyablePersistent *dest); - - template static void Uncompilable(); -}; -``` - -See the V8 documentation for [`NonCopyablePersistentTraits`](https://v8docs.nodesource.com/node-8.16/de/d73/classv8_1_1_non_copyable_persistent_traits.html) for further information. - - -### Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits - -A helper class of traits to allow copying and assignment of `Persistent`. This will clone the contents of storage cell, but not any of the flags, etc.. - -Definition: - -_(note: this is implemented as `Nan::CopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_ - -```c++ -template -class CopyablePersistentTraits { - public: - typedef Persistent > CopyablePersistent; - - static const bool kResetInDestructor = true; - - template - static void Copy(const Persistent &source, - CopyablePersistent *dest); -}; -``` - -See the V8 documentation for [`CopyablePersistentTraits`](https://v8docs.nodesource.com/node-8.16/da/d5c/structv8_1_1_copyable_persistent_traits.html) for further information. - - -### Nan::Persistent - -A type of `PersistentBase` which allows copy and assignment. Copy, assignment and destructor behavior is controlled by the traits class `M`. - -Definition: - -```c++ -template > -class Persistent; - -template class Persistent : public PersistentBase { - public: - /** - * A Persistent with no storage cell. - */ - Persistent(); - - /** - * Construct a Persistent from a v8::Local. When the v8::Local is non-empty, a - * new storage cell is created pointing to the same object, and no flags are - * set. - */ - template Persistent(v8::Local that); - - /** - * Construct a Persistent from a Persistent. When the Persistent is non-empty, - * a new storage cell is created pointing to the same object, and no flags are - * set. - */ - Persistent(const Persistent &that); - - /** - * The copy constructors and assignment operator create a Persistent exactly - * as the Persistent constructor, but the Copy function from the traits class - * is called, allowing the setting of flags based on the copied Persistent. - */ - Persistent &operator=(const Persistent &that); - - template - Persistent &operator=(const Persistent &that); - - /** - * The destructor will dispose the Persistent based on the kResetInDestructor - * flags in the traits class. Since not calling dispose can result in a - * memory leak, it is recommended to always set this flag. - */ - ~Persistent(); -}; -``` - -See the V8 documentation for [`Persistent`](https://v8docs.nodesource.com/node-8.16/d2/d78/classv8_1_1_persistent.html) for further information. - - -### Nan::Global - -A type of `PersistentBase` which has move semantics. - -```c++ -template class Global : public PersistentBase { - public: - /** - * A Global with no storage cell. - */ - Global(); - - /** - * Construct a Global from a v8::Local. When the v8::Local is non-empty, a new - * storage cell is created pointing to the same object, and no flags are set. - */ - template Global(v8::Local that); - /** - * Construct a Global from a PersistentBase. When the Persistent is non-empty, - * a new storage cell is created pointing to the same object, and no flags are - * set. - */ - template Global(const PersistentBase &that); - - /** - * Pass allows returning globals from functions, etc. - */ - Global Pass(); -}; -``` - -See the V8 documentation for [`Global`](https://v8docs.nodesource.com/node-8.16/d5/d40/classv8_1_1_global.html) for further information. - - -### Nan::WeakCallbackInfo - -`Nan::WeakCallbackInfo` is used as an argument when setting a persistent reference as weak. You may need to free any external resources attached to the object. It is a mirror of `v8:WeakCallbackInfo` as found in newer versions of V8. - -Definition: - -```c++ -template class WeakCallbackInfo { - public: - typedef void (*Callback)(const WeakCallbackInfo& data); - - v8::Isolate *GetIsolate() const; - - /** - * Get the parameter that was associated with the weak handle. - */ - T *GetParameter() const; - - /** - * Get pointer from internal field, index can be 0 or 1. - */ - void *GetInternalField(int index) const; -}; -``` - -Example usage: - -```c++ -void weakCallback(const WeakCallbackInfo &data) { - int *parameter = data.GetParameter(); - delete parameter; -} - -Persistent obj; -int *data = new int(0); -obj.SetWeak(data, callback, WeakCallbackType::kParameter); -``` - -See the V8 documentation for [`WeakCallbackInfo`](https://v8docs.nodesource.com/node-8.16/d8/d06/classv8_1_1_weak_callback_info.html) for further information. - - -### Nan::WeakCallbackType - -Represents the type of a weak callback. -A weak callback of type `kParameter` makes the supplied parameter to `Nan::PersistentBase::SetWeak` available through `WeakCallbackInfo::GetParameter`. -A weak callback of type `kInternalFields` uses up to two internal fields at indices 0 and 1 on the `Nan::PersistentBase` being made weak. -Note that only `v8::Object`s and derivatives can have internal fields. - -Definition: - -```c++ -enum class WeakCallbackType { kParameter, kInternalFields }; -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/scopes.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/scopes.md deleted file mode 100644 index 84000eebf..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/scopes.md +++ /dev/null @@ -1,73 +0,0 @@ -## Scopes - -A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works. - -A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope. - -The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these. - - - Nan::HandleScope - - Nan::EscapableHandleScope - -Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection). - - -### Nan::HandleScope - -A simple wrapper around [`v8::HandleScope`](https://v8docs.nodesource.com/node-8.16/d3/d95/classv8_1_1_handle_scope.html). - -Definition: - -```c++ -class Nan::HandleScope { - public: - Nan::HandleScope(); - static int NumberOfHandles(); -}; -``` - -Allocate a new `Nan::HandleScope` whenever you are creating new V8 JavaScript objects. Note that an implicit `HandleScope` is created for you on JavaScript-accessible methods so you do not need to insert one yourself. - -Example: - -```c++ -// new object is created, it needs a new scope: -void Pointless() { - Nan::HandleScope scope; - v8::Local obj = Nan::New(); -} - -// JavaScript-accessible method already has a HandleScope -NAN_METHOD(Pointless2) { - v8::Local obj = Nan::New(); -} -``` - - -### Nan::EscapableHandleScope - -Similar to [`Nan::HandleScope`](#api_nan_handle_scope) but should be used in cases where a function needs to return a V8 JavaScript type that has been created within it. - -Definition: - -```c++ -class Nan::EscapableHandleScope { - public: - Nan::EscapableHandleScope(); - static int NumberOfHandles(); - template v8::Local Escape(v8::Local value); -} -``` - -Use `Escape(value)` to return the object. - -Example: - -```c++ -v8::Local EmptyObj() { - Nan::EscapableHandleScope scope; - v8::Local obj = Nan::New(); - return scope.Escape(obj); -} -``` - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/script.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/script.md deleted file mode 100644 index 301c1b3df..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/script.md +++ /dev/null @@ -1,58 +0,0 @@ -## Script - -NAN provides `v8::Script` helpers as the API has changed over the supported versions of V8. - - - Nan::CompileScript() - - Nan::RunScript() - - Nan::ScriptOrigin - - - -### Nan::CompileScript() - -A wrapper around [`v8::ScriptCompiler::Compile()`](https://v8docs.nodesource.com/node-8.16/da/da5/classv8_1_1_script_compiler.html#a93f5072a0db55d881b969e9fc98e564b). - -Note that `Nan::BoundScript` is an alias for `v8::Script`. - -Signature: - -```c++ -Nan::MaybeLocal Nan::CompileScript( - v8::Local s, - const v8::ScriptOrigin& origin); -Nan::MaybeLocal Nan::CompileScript(v8::Local s); -``` - - - -### Nan::RunScript() - -Calls `script->Run()` or `script->BindToCurrentContext()->Run(Nan::GetCurrentContext())`. - -Note that `Nan::BoundScript` is an alias for `v8::Script` and `Nan::UnboundScript` is an alias for `v8::UnboundScript` where available and `v8::Script` on older versions of V8. - -Signature: - -```c++ -Nan::MaybeLocal Nan::RunScript(v8::Local script) -Nan::MaybeLocal Nan::RunScript(v8::Local script) -``` - - -### Nan::ScriptOrigin - -A class transparently extending [`v8::ScriptOrigin`](https://v8docs.nodesource.com/node-16.0/db/d84/classv8_1_1_script_origin.html#pub-methods) -to provide backwards compatibility. Only the listed methods are guaranteed to -be available on all versions of Node. - -Declaration: - -```c++ -class Nan::ScriptOrigin : public v8::ScriptOrigin { - public: - ScriptOrigin(v8::Local name, v8::Local line = v8::Local(), v8::Local column = v8::Local()) - v8::Local ResourceName() const; - v8::Local ResourceLineOffset() const; - v8::Local ResourceColumnOffset() const; -} -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/string_bytes.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/string_bytes.md deleted file mode 100644 index 7c1bd3250..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/string_bytes.md +++ /dev/null @@ -1,62 +0,0 @@ -## Strings & Bytes - -Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing. - - - Nan::Encoding - - Nan::Encode() - - Nan::DecodeBytes() - - Nan::DecodeWrite() - - - -### Nan::Encoding - -An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node. - -Definition: - -```c++ -enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER } -``` - - - -### Nan::Encode() - -A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node. - -Signature: - -```c++ -v8::Local Nan::Encode(const void *buf, - size_t len, - enum Nan::Encoding encoding = BINARY); -``` - - - -### Nan::DecodeBytes() - -A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node. - -Signature: - -```c++ -ssize_t Nan::DecodeBytes(v8::Local val, - enum Nan::Encoding encoding = BINARY); -``` - - - -### Nan::DecodeWrite() - -A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node. - -Signature: - -```c++ -ssize_t Nan::DecodeWrite(char *buf, - size_t len, - v8::Local val, - enum Nan::Encoding encoding = BINARY); -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/v8_internals.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/v8_internals.md deleted file mode 100644 index 08dd6d044..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/v8_internals.md +++ /dev/null @@ -1,199 +0,0 @@ -## V8 internals - -The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods. - - - NAN_GC_CALLBACK() - - Nan::AddGCEpilogueCallback() - - Nan::RemoveGCEpilogueCallback() - - Nan::AddGCPrologueCallback() - - Nan::RemoveGCPrologueCallback() - - Nan::GetHeapStatistics() - - Nan::SetCounterFunction() - - Nan::SetCreateHistogramFunction() - - Nan::SetAddHistogramSampleFunction() - - Nan::IdleNotification() - - Nan::LowMemoryNotification() - - Nan::ContextDisposedNotification() - - Nan::GetInternalFieldPointer() - - Nan::SetInternalFieldPointer() - - Nan::AdjustExternalMemory() - - - -### NAN_GC_CALLBACK(callbackname) - -Use `NAN_GC_CALLBACK` to declare your callbacks for `Nan::AddGCPrologueCallback()` and `Nan::AddGCEpilogueCallback()`. Your new method receives the arguments `v8::GCType type` and `v8::GCCallbackFlags flags`. - -```c++ -static Nan::Persistent callback; - -NAN_GC_CALLBACK(gcPrologueCallback) { - v8::Local argv[] = { Nan::New("prologue").ToLocalChecked() }; - Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(callback), 1, argv); -} - -NAN_METHOD(Hook) { - callback.Reset(To(args[0]).ToLocalChecked()); - Nan::AddGCPrologueCallback(gcPrologueCallback); - info.GetReturnValue().Set(info.Holder()); -} -``` - - -### Nan::AddGCEpilogueCallback() - -Signature: - -```c++ -void Nan::AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback, v8::GCType gc_type_filter = v8::kGCTypeAll) -``` - -Calls V8's [`AddGCEpilogueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a580f976e4290cead62c2fc4dd396be3e). - - -### Nan::RemoveGCEpilogueCallback() - -Signature: - -```c++ -void Nan::RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback) -``` - -Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#adca9294555a3908e9f23c7bb0f0f284c). - - -### Nan::AddGCPrologueCallback() - -Signature: - -```c++ -void Nan::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback, v8::GCType gc_type_filter callback) -``` - -Calls V8's [`AddGCPrologueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a6dbef303603ebdb03da6998794ea05b8). - - -### Nan::RemoveGCPrologueCallback() - -Signature: - -```c++ -void Nan::RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback) -``` - -Calls V8's [`RemoveGCPrologueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a5f72c7cda21415ce062bbe5c58abe09e). - - -### Nan::GetHeapStatistics() - -Signature: - -```c++ -void Nan::GetHeapStatistics(v8::HeapStatistics *heap_statistics) -``` - -Calls V8's [`GetHeapStatistics()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a5593ac74687b713095c38987e5950b34). - - -### Nan::SetCounterFunction() - -Signature: - -```c++ -void Nan::SetCounterFunction(v8::CounterLookupCallback cb) -``` - -Calls V8's [`SetCounterFunction()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a045d7754e62fa0ec72ae6c259b29af94). - - -### Nan::SetCreateHistogramFunction() - -Signature: - -```c++ -void Nan::SetCreateHistogramFunction(v8::CreateHistogramCallback cb) -``` - -Calls V8's [`SetCreateHistogramFunction()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a542d67e85089cb3f92aadf032f99e732). - - -### Nan::SetAddHistogramSampleFunction() - -Signature: - -```c++ -void Nan::SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) -``` - -Calls V8's [`SetAddHistogramSampleFunction()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#aeb420b690bc2c216882d6fdd00ddd3ea). - - -### Nan::IdleNotification() - -Signature: - -```c++ -bool Nan::IdleNotification(int idle_time_in_ms) -``` - -Calls V8's [`IdleNotification()` or `IdleNotificationDeadline()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#ad6a2a02657f5425ad460060652a5a118) depending on V8 version. - - -### Nan::LowMemoryNotification() - -Signature: - -```c++ -void Nan::LowMemoryNotification() -``` - -Calls V8's [`LowMemoryNotification()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a24647f61d6b41f69668094bdcd6ea91f). - - -### Nan::ContextDisposedNotification() - -Signature: - -```c++ -void Nan::ContextDisposedNotification() -``` - -Calls V8's [`ContextDisposedNotification()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b). - - -### Nan::GetInternalFieldPointer() - -Gets a pointer to the internal field with at `index` from a V8 `Object` handle. - -Signature: - -```c++ -void* Nan::GetInternalFieldPointer(v8::Local object, int index) -``` - -Calls the Object's [`GetAlignedPointerFromInternalField()` or `GetPointerFromInternalField()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a580ea84afb26c005d6762eeb9e3c308f) depending on the version of V8. - - -### Nan::SetInternalFieldPointer() - -Sets the value of the internal field at `index` on a V8 `Object` handle. - -Signature: - -```c++ -void Nan::SetInternalFieldPointer(v8::Local object, int index, void* value) -``` - -Calls the Object's [`SetAlignedPointerInInternalField()` or `SetPointerInInternalField()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab3c57184263cf29963ef0017bec82281) depending on the version of V8. - - -### Nan::AdjustExternalMemory() - -Signature: - -```c++ -int Nan::AdjustExternalMemory(int bytesChange) -``` - -Calls V8's [`AdjustAmountOfExternalAllocatedMemory()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#ae1a59cac60409d3922582c4af675473e). - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/v8_misc.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/v8_misc.md deleted file mode 100644 index 1bd46d358..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/doc/v8_misc.md +++ /dev/null @@ -1,85 +0,0 @@ -## Miscellaneous V8 Helpers - - - Nan::Utf8String - - Nan::GetCurrentContext() - - Nan::SetIsolateData() - - Nan::GetIsolateData() - - Nan::TypedArrayContents - - - -### Nan::Utf8String - -Converts an object to a UTF-8-encoded character array. If conversion to a string fails (e.g. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL. The underlying memory used for this object is managed by the object. - -An implementation of [`v8::String::Utf8Value`](https://v8docs.nodesource.com/node-8.16/d4/d1b/classv8_1_1_string_1_1_utf8_value.html) that is consistent across all supported versions of V8. - -Definition: - -```c++ -class Nan::Utf8String { - public: - Nan::Utf8String(v8::Local from); - - int length() const; - - char* operator*(); - const char* operator*() const; -}; -``` - - -### Nan::GetCurrentContext() - -A call to [`v8::Isolate::GetCurrent()->GetCurrentContext()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a81c7a1ed7001ae2a65e89107f75fd053) that works across all supported versions of V8. - -Signature: - -```c++ -v8::Local Nan::GetCurrentContext() -``` - - -### Nan::SetIsolateData() - -A helper to provide a consistent API to [`v8::Isolate#SetData()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a7acadfe7965997e9c386a05f098fbe36). - -Signature: - -```c++ -void Nan::SetIsolateData(v8::Isolate *isolate, T *data) -``` - - - -### Nan::GetIsolateData() - -A helper to provide a consistent API to [`v8::Isolate#GetData()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#aabd223436bc1100a787dadaa024c6257). - -Signature: - -```c++ -T *Nan::GetIsolateData(v8::Isolate *isolate) -``` - - -### Nan::TypedArrayContents - -A helper class for accessing the contents of an ArrayBufferView (aka a typedarray) from C++. If the input array is not a valid typedarray, then the data pointer of TypedArrayContents will default to `NULL` and the length will be 0. If the data pointer is not compatible with the alignment requirements of type, an assertion error will fail. - -Note that you must store a reference to the `array` object while you are accessing its contents. - -Definition: - -```c++ -template -class Nan::TypedArrayContents { - public: - TypedArrayContents(v8::Local array); - - size_t length() const; - - T* const operator*(); - const T* const operator*() const; -}; -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/include_dirs.js b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/include_dirs.js deleted file mode 100644 index 4f1dfb416..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/include_dirs.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('path').relative('.', __dirname)); diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h deleted file mode 100644 index d0fcd6747..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h +++ /dev/null @@ -1,2952 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors: - * - Rod Vagg - * - Benjamin Byholm - * - Trevor Norris - * - Nathan Rajlich - * - Brett Lawson - * - Ben Noordhuis - * - David Siegel - * - Michael Ira Krufky - * - * MIT License - * - * Version 2.17.0: current Node 18.10.0, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1 - * - * See https://github.com/nodejs/nan for the latest update to this file - **********************************************************************************/ - -#ifndef NAN_H_ -#define NAN_H_ - -#include - -#define NODE_0_10_MODULE_VERSION 11 -#define NODE_0_12_MODULE_VERSION 14 -#define ATOM_0_21_MODULE_VERSION 41 -#define IOJS_1_0_MODULE_VERSION 42 -#define IOJS_1_1_MODULE_VERSION 43 -#define IOJS_2_0_MODULE_VERSION 44 -#define IOJS_3_0_MODULE_VERSION 45 -#define NODE_4_0_MODULE_VERSION 46 -#define NODE_5_0_MODULE_VERSION 47 -#define NODE_6_0_MODULE_VERSION 48 -#define NODE_7_0_MODULE_VERSION 51 -#define NODE_8_0_MODULE_VERSION 57 -#define NODE_9_0_MODULE_VERSION 59 -#define NODE_10_0_MODULE_VERSION 64 -#define NODE_11_0_MODULE_VERSION 67 -#define NODE_12_0_MODULE_VERSION 72 -#define NODE_13_0_MODULE_VERSION 79 -#define NODE_14_0_MODULE_VERSION 83 -#define NODE_15_0_MODULE_VERSION 88 -#define NODE_16_0_MODULE_VERSION 93 -#define NODE_17_0_MODULE_VERSION 102 -#define NODE_18_0_MODULE_VERSION 108 - -#ifdef _MSC_VER -# define NAN_HAS_CPLUSPLUS_11 (_MSC_VER >= 1800) -#else -# define NAN_HAS_CPLUSPLUS_11 (__cplusplus >= 201103L) -#endif - -#if NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION && !NAN_HAS_CPLUSPLUS_11 -# error This version of node/NAN/v8 requires a C++11 compiler -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(_MSC_VER) -# pragma warning( push ) -# pragma warning( disable : 4530 ) -# include -# include -# include -# pragma warning( pop ) -#else -# include -# include -# include -#endif - -// uv helpers -#ifdef UV_VERSION_MAJOR -# ifndef UV_VERSION_PATCH -# define UV_VERSION_PATCH 0 -# endif -# define NAUV_UVVERSION ((UV_VERSION_MAJOR << 16) | \ - (UV_VERSION_MINOR << 8) | \ - (UV_VERSION_PATCH)) -#else -# define NAUV_UVVERSION 0x000b00 -#endif - -#if NAUV_UVVERSION < 0x000b0b -# ifdef WIN32 -# include -# else -# include -# endif -#endif - -namespace Nan { - -#define NAN_CONCAT(a, b) NAN_CONCAT_HELPER(a, b) -#define NAN_CONCAT_HELPER(a, b) a##b - -#define NAN_INLINE inline // TODO(bnoordhuis) Remove in v3.0.0. - -#if defined(__GNUC__) && \ - !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS) -# define NAN_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) && \ - !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS) -# define NAN_DEPRECATED __declspec(deprecated) -#else -# define NAN_DEPRECATED -#endif - -#if NAN_HAS_CPLUSPLUS_11 -# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; -# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; -# define NAN_DISALLOW_MOVE(CLASS) \ - CLASS(CLASS&&) = delete; /* NOLINT(build/c++11) */ \ - void operator=(CLASS&&) = delete; -#else -# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&); -# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&); -# define NAN_DISALLOW_MOVE(CLASS) -#endif - -#define NAN_DISALLOW_ASSIGN_COPY(CLASS) \ - NAN_DISALLOW_ASSIGN(CLASS) \ - NAN_DISALLOW_COPY(CLASS) - -#define NAN_DISALLOW_ASSIGN_MOVE(CLASS) \ - NAN_DISALLOW_ASSIGN(CLASS) \ - NAN_DISALLOW_MOVE(CLASS) - -#define NAN_DISALLOW_COPY_MOVE(CLASS) \ - NAN_DISALLOW_COPY(CLASS) \ - NAN_DISALLOW_MOVE(CLASS) - -#define NAN_DISALLOW_ASSIGN_COPY_MOVE(CLASS) \ - NAN_DISALLOW_ASSIGN(CLASS) \ - NAN_DISALLOW_COPY(CLASS) \ - NAN_DISALLOW_MOVE(CLASS) - -#define TYPE_CHECK(T, S) \ - while (false) { \ - *(static_cast(0)) = static_cast(0); \ - } - -//=== RegistrationFunction ===================================================== - -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - typedef v8::Handle ADDON_REGISTER_FUNCTION_ARGS_TYPE; -#else - typedef v8::Local ADDON_REGISTER_FUNCTION_ARGS_TYPE; -#endif - -#define NAN_MODULE_INIT(name) \ - void name(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target) - -#if NODE_MAJOR_VERSION >= 10 || \ - NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 -#define NAN_MODULE_WORKER_ENABLED(module_name, registration) \ - extern "C" NODE_MODULE_EXPORT void \ - NAN_CONCAT(node_register_module_v, NODE_MODULE_VERSION)( \ - v8::Local exports, v8::Local module, \ - v8::Local context) \ - { \ - registration(exports); \ - } -#else -#define NAN_MODULE_WORKER_ENABLED(module_name, registration) \ - NODE_MODULE(module_name, registration) -#endif - -//=== CallbackInfo ============================================================= - -#include "nan_callbacks.h" // NOLINT(build/include) - -//============================================================================== - -#if (NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION) -typedef v8::Script UnboundScript; -typedef v8::Script BoundScript; -#else -typedef v8::UnboundScript UnboundScript; -typedef v8::Script BoundScript; -#endif - -#if (NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION) -typedef v8::String::ExternalAsciiStringResource - ExternalOneByteStringResource; -#else -typedef v8::String::ExternalOneByteStringResource - ExternalOneByteStringResource; -#endif - -#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) -template -class NonCopyablePersistentTraits : - public v8::NonCopyablePersistentTraits {}; -template -class CopyablePersistentTraits : - public v8::CopyablePersistentTraits {}; - -template -class PersistentBase : - public v8::PersistentBase {}; - -template > -class Persistent; -#else -template class NonCopyablePersistentTraits; -template class PersistentBase; -template class WeakCallbackData; -template > -class Persistent; -#endif // NODE_MODULE_VERSION - -template -class Maybe { - public: - inline bool IsNothing() const { return !has_value_; } - inline bool IsJust() const { return has_value_; } - - inline T ToChecked() const { return FromJust(); } - inline void Check() const { FromJust(); } - - inline bool To(T* out) const { - if (IsJust()) *out = value_; - return IsJust(); - } - - inline T FromJust() const { -#if defined(V8_ENABLE_CHECKS) - assert(IsJust() && "FromJust is Nothing"); -#endif // V8_ENABLE_CHECKS - return value_; - } - - inline T FromMaybe(const T& default_value) const { - return has_value_ ? value_ : default_value; - } - - inline bool operator==(const Maybe &other) const { - return (IsJust() == other.IsJust()) && - (!IsJust() || FromJust() == other.FromJust()); - } - - inline bool operator!=(const Maybe &other) const { - return !operator==(other); - } - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - // Allow implicit conversions from v8::Maybe to Nan::Maybe. - Maybe(const v8::Maybe& that) // NOLINT(runtime/explicit) - : has_value_(that.IsJust()) - , value_(that.FromMaybe(T())) {} -#endif - - private: - Maybe() : has_value_(false) {} - explicit Maybe(const T& t) : has_value_(true), value_(t) {} - bool has_value_; - T value_; - - template - friend Maybe Nothing(); - template - friend Maybe Just(const U& u); -}; - -template -inline Maybe Nothing() { - return Maybe(); -} - -template -inline Maybe Just(const T& t) { - return Maybe(t); -} - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -# include "nan_maybe_43_inl.h" // NOLINT(build/include) -#else -# include "nan_maybe_pre_43_inl.h" // NOLINT(build/include) -#endif - -#include "nan_converters.h" // NOLINT(build/include) -#include "nan_new.h" // NOLINT(build/include) - -#if NAUV_UVVERSION < 0x000b17 -#define NAUV_WORK_CB(func) \ - void func(uv_async_t *async, int) -#else -#define NAUV_WORK_CB(func) \ - void func(uv_async_t *async) -#endif - -#if NAUV_UVVERSION >= 0x000b0b - -typedef uv_key_t nauv_key_t; - -inline int nauv_key_create(nauv_key_t *key) { - return uv_key_create(key); -} - -inline void nauv_key_delete(nauv_key_t *key) { - uv_key_delete(key); -} - -inline void* nauv_key_get(nauv_key_t *key) { - return uv_key_get(key); -} - -inline void nauv_key_set(nauv_key_t *key, void *value) { - uv_key_set(key, value); -} - -#else - -/* Implement thread local storage for older versions of libuv. - * This is essentially a backport of libuv commit 5d2434bf - * written by Ben Noordhuis, adjusted for names and inline. - */ - -#ifndef WIN32 - -typedef pthread_key_t nauv_key_t; - -inline int nauv_key_create(nauv_key_t* key) { - return -pthread_key_create(key, NULL); -} - -inline void nauv_key_delete(nauv_key_t* key) { - if (pthread_key_delete(*key)) - abort(); -} - -inline void* nauv_key_get(nauv_key_t* key) { - return pthread_getspecific(*key); -} - -inline void nauv_key_set(nauv_key_t* key, void* value) { - if (pthread_setspecific(*key, value)) - abort(); -} - -#else - -typedef struct { - DWORD tls_index; -} nauv_key_t; - -inline int nauv_key_create(nauv_key_t* key) { - key->tls_index = TlsAlloc(); - if (key->tls_index == TLS_OUT_OF_INDEXES) - return UV_ENOMEM; - return 0; -} - -inline void nauv_key_delete(nauv_key_t* key) { - if (TlsFree(key->tls_index) == FALSE) - abort(); - key->tls_index = TLS_OUT_OF_INDEXES; -} - -inline void* nauv_key_get(nauv_key_t* key) { - void* value = TlsGetValue(key->tls_index); - if (value == NULL) - if (GetLastError() != ERROR_SUCCESS) - abort(); - return value; -} - -inline void nauv_key_set(nauv_key_t* key, void* value) { - if (TlsSetValue(key->tls_index, value) == FALSE) - abort(); -} - -#endif -#endif - -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION -template -v8::Local New(v8::Handle); -#endif - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - typedef v8::WeakCallbackType WeakCallbackType; -#else -struct WeakCallbackType { - enum E {kParameter, kInternalFields}; - E type; - WeakCallbackType(E other) : type(other) {} // NOLINT(runtime/explicit) - inline bool operator==(E other) { return other == this->type; } - inline bool operator!=(E other) { return !operator==(other); } -}; -#endif - -template class WeakCallbackInfo; - -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION -# include "nan_persistent_12_inl.h" // NOLINT(build/include) -#else -# include "nan_persistent_pre_12_inl.h" // NOLINT(build/include) -#endif - -namespace imp { - static const size_t kMaxLength = 0x3fffffff; - // v8::String::REPLACE_INVALID_UTF8 was introduced - // in node.js v0.10.29 and v0.8.27. -#if NODE_MAJOR_VERSION > 0 || \ - NODE_MINOR_VERSION > 10 || \ - NODE_MINOR_VERSION == 10 && NODE_PATCH_VERSION >= 29 || \ - NODE_MINOR_VERSION == 8 && NODE_PATCH_VERSION >= 27 - static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; -#else - static const unsigned kReplaceInvalidUtf8 = 0; -#endif -} // end of namespace imp - -//=== HandleScope ============================================================== - -class HandleScope { - v8::HandleScope scope; - - public: -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - inline HandleScope() : scope(v8::Isolate::GetCurrent()) {} - inline static int NumberOfHandles() { - return v8::HandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); - } -#else - inline HandleScope() : scope() {} - inline static int NumberOfHandles() { - return v8::HandleScope::NumberOfHandles(); - } -#endif - - private: - // Make it hard to create heap-allocated or illegal handle scopes by - // disallowing certain operations. - HandleScope(const HandleScope &); - void operator=(const HandleScope &); - void *operator new(size_t size); - void operator delete(void *, size_t) { - abort(); - } -}; - -class EscapableHandleScope { - public: -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - inline EscapableHandleScope() : scope(v8::Isolate::GetCurrent()) {} - - inline static int NumberOfHandles() { - return v8::EscapableHandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); - } - - template - inline v8::Local Escape(v8::Local value) { - return scope.Escape(value); - } - - private: - v8::EscapableHandleScope scope; -#else - inline EscapableHandleScope() : scope() {} - - inline static int NumberOfHandles() { - return v8::HandleScope::NumberOfHandles(); - } - - template - inline v8::Local Escape(v8::Local value) { - return scope.Close(value); - } - - private: - v8::HandleScope scope; -#endif - - private: - // Make it hard to create heap-allocated or illegal handle scopes by - // disallowing certain operations. - EscapableHandleScope(const EscapableHandleScope &); - void operator=(const EscapableHandleScope &); - void *operator new(size_t size); - void operator delete(void *, size_t) { - abort(); - } -}; - -//=== TryCatch ================================================================= - -class TryCatch { - v8::TryCatch try_catch_; - friend void FatalException(const TryCatch&); - - public: -#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION - TryCatch() : try_catch_(v8::Isolate::GetCurrent()) {} -#endif - - inline bool HasCaught() const { return try_catch_.HasCaught(); } - - inline bool CanContinue() const { return try_catch_.CanContinue(); } - - inline v8::Local ReThrow() { -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - return New(try_catch_.ReThrow()); -#else - return try_catch_.ReThrow(); -#endif - } - - inline v8::Local Exception() const { - return try_catch_.Exception(); - } - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - inline v8::MaybeLocal StackTrace() const { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(try_catch_.StackTrace(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); - } -#else - inline MaybeLocal StackTrace() const { - return try_catch_.StackTrace(); - } -#endif - - inline v8::Local Message() const { - return try_catch_.Message(); - } - - inline void Reset() { try_catch_.Reset(); } - - inline void SetVerbose(bool value) { try_catch_.SetVerbose(value); } - - inline void SetCaptureMessage(bool value) { - try_catch_.SetCaptureMessage(value); - } -}; - -v8::Local MakeCallback(v8::Local target, - v8::Local func, - int argc, - v8::Local* argv); -v8::Local MakeCallback(v8::Local target, - v8::Local symbol, - int argc, - v8::Local* argv); -v8::Local MakeCallback(v8::Local target, - const char* method, - int argc, - v8::Local* argv); - -// === AsyncResource =========================================================== - -class AsyncResource { - public: - AsyncResource( - v8::Local name - , v8::Local resource = New()) { -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - - if (resource.IsEmpty()) { - resource = New(); - } - - context = node::EmitAsyncInit(isolate, resource, name); -#endif - } - - AsyncResource( - const char* name - , v8::Local resource = New()) { -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - - if (resource.IsEmpty()) { - resource = New(); - } - - v8::Local name_string = - New(name).ToLocalChecked(); - context = node::EmitAsyncInit(isolate, resource, name_string); -#endif - } - - ~AsyncResource() { -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - node::EmitAsyncDestroy(isolate, context); -#endif - } - - inline MaybeLocal runInAsyncScope( - v8::Local target - , v8::Local func - , int argc - , v8::Local* argv) { -#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION - return MakeCallback(target, func, argc, argv); -#else - return node::MakeCallback( - v8::Isolate::GetCurrent(), target, func, argc, argv, context); -#endif - } - - inline MaybeLocal runInAsyncScope( - v8::Local target - , v8::Local symbol - , int argc - , v8::Local* argv) { -#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION - return MakeCallback(target, symbol, argc, argv); -#else - return node::MakeCallback( - v8::Isolate::GetCurrent(), target, symbol, argc, argv, context); -#endif - } - - inline MaybeLocal runInAsyncScope( - v8::Local target - , const char* method - , int argc - , v8::Local* argv) { -#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION - return MakeCallback(target, method, argc, argv); -#else - return node::MakeCallback( - v8::Isolate::GetCurrent(), target, method, argc, argv, context); -#endif - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncResource) -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - node::async_context context; -#endif -}; - -inline uv_loop_t* GetCurrentEventLoop() { -#if NODE_MAJOR_VERSION >= 10 || \ - NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 || \ - NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION >= 10 - return node::GetCurrentEventLoop(v8::Isolate::GetCurrent()); -#else - return uv_default_loop(); -#endif -} - -//============ ================================================================= - -/* node 0.12 */ -#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION - inline - void SetCounterFunction(v8::CounterLookupCallback cb) { - v8::Isolate::GetCurrent()->SetCounterFunction(cb); - } - - inline - void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) { - v8::Isolate::GetCurrent()->SetCreateHistogramFunction(cb); - } - - inline - void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) { - v8::Isolate::GetCurrent()->SetAddHistogramSampleFunction(cb); - } - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - inline bool IdleNotification(int idle_time_in_ms) { - return v8::Isolate::GetCurrent()->IdleNotificationDeadline( - idle_time_in_ms * 0.001); - } -# else - inline bool IdleNotification(int idle_time_in_ms) { - return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms); - } -#endif - - inline void LowMemoryNotification() { - v8::Isolate::GetCurrent()->LowMemoryNotification(); - } - - inline void ContextDisposedNotification() { - v8::Isolate::GetCurrent()->ContextDisposedNotification(); - } -#else - inline - void SetCounterFunction(v8::CounterLookupCallback cb) { - v8::V8::SetCounterFunction(cb); - } - - inline - void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) { - v8::V8::SetCreateHistogramFunction(cb); - } - - inline - void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) { - v8::V8::SetAddHistogramSampleFunction(cb); - } - - inline bool IdleNotification(int idle_time_in_ms) { - return v8::V8::IdleNotification(idle_time_in_ms); - } - - inline void LowMemoryNotification() { - v8::V8::LowMemoryNotification(); - } - - inline void ContextDisposedNotification() { - v8::V8::ContextDisposedNotification(); - } -#endif - -#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) // Node 0.12 - inline v8::Local Undefined() { -# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(v8::Undefined(v8::Isolate::GetCurrent()))); -# else - return v8::Undefined(v8::Isolate::GetCurrent()); -# endif - } - - inline v8::Local Null() { -# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(v8::Null(v8::Isolate::GetCurrent()))); -# else - return v8::Null(v8::Isolate::GetCurrent()); -# endif - } - - inline v8::Local True() { -# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(v8::True(v8::Isolate::GetCurrent()))); -# else - return v8::True(v8::Isolate::GetCurrent()); -# endif - } - - inline v8::Local False() { -# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(v8::False(v8::Isolate::GetCurrent()))); -# else - return v8::False(v8::Isolate::GetCurrent()); -# endif - } - - inline v8::Local EmptyString() { - return v8::String::Empty(v8::Isolate::GetCurrent()); - } - - inline int AdjustExternalMemory(int bc) { - return static_cast( - v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(bc)); - } - - inline void SetTemplate( - v8::Local templ - , const char *name - , v8::Local value) { - templ->Set(v8::Isolate::GetCurrent(), name, value); - } - - inline void SetTemplate( - v8::Local templ - , v8::Local name - , v8::Local value - , v8::PropertyAttribute attributes) { - templ->Set(name, value, attributes); - } - - inline v8::Local GetCurrentContext() { - return v8::Isolate::GetCurrent()->GetCurrentContext(); - } - - inline void* GetInternalFieldPointer( - v8::Local object - , int index) { - return object->GetAlignedPointerFromInternalField(index); - } - - inline void SetInternalFieldPointer( - v8::Local object - , int index - , void* value) { - object->SetAlignedPointerInInternalField(index, value); - } - -# define NAN_GC_CALLBACK(name) \ - void name(v8::Isolate *isolate, v8::GCType type, v8::GCCallbackFlags flags) - -#if NODE_MODULE_VERSION <= NODE_4_0_MODULE_VERSION - typedef v8::Isolate::GCEpilogueCallback GCEpilogueCallback; - typedef v8::Isolate::GCPrologueCallback GCPrologueCallback; -#else - typedef v8::Isolate::GCCallback GCEpilogueCallback; - typedef v8::Isolate::GCCallback GCPrologueCallback; -#endif - - inline void AddGCEpilogueCallback( - GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::Isolate::GetCurrent()->AddGCEpilogueCallback(callback, gc_type_filter); - } - - inline void RemoveGCEpilogueCallback( - GCEpilogueCallback callback) { - v8::Isolate::GetCurrent()->RemoveGCEpilogueCallback(callback); - } - - inline void AddGCPrologueCallback( - GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::Isolate::GetCurrent()->AddGCPrologueCallback(callback, gc_type_filter); - } - - inline void RemoveGCPrologueCallback( - GCPrologueCallback callback) { - v8::Isolate::GetCurrent()->RemoveGCPrologueCallback(callback); - } - - inline void GetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - v8::Isolate::GetCurrent()->GetHeapStatistics(heap_statistics); - } - -# define X(NAME) \ - inline v8::Local NAME(const char *msg) { \ - EscapableHandleScope scope; \ - return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked())); \ - } \ - \ - inline \ - v8::Local NAME(v8::Local msg) { \ - return v8::Exception::NAME(msg); \ - } \ - \ - inline void Throw ## NAME(const char *msg) { \ - HandleScope scope; \ - v8::Isolate::GetCurrent()->ThrowException( \ - v8::Exception::NAME(New(msg).ToLocalChecked())); \ - } \ - \ - inline void Throw ## NAME(v8::Local msg) { \ - HandleScope scope; \ - v8::Isolate::GetCurrent()->ThrowException( \ - v8::Exception::NAME(msg)); \ - } - - X(Error) - X(RangeError) - X(ReferenceError) - X(SyntaxError) - X(TypeError) - -# undef X - - inline void ThrowError(v8::Local error) { - v8::Isolate::GetCurrent()->ThrowException(error); - } - - inline MaybeLocal NewBuffer( - char *data - , size_t length -#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION - , node::Buffer::FreeCallback callback -#else - , node::smalloc::FreeCallback callback -#endif - , void *hint - ) { - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(length <= imp::kMaxLength && "too large buffer"); -#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION - return node::Buffer::New( - v8::Isolate::GetCurrent(), data, length, callback, hint); -#else - return node::Buffer::New(v8::Isolate::GetCurrent(), data, length, callback, - hint); -#endif - } - - inline MaybeLocal CopyBuffer( - const char *data - , uint32_t size - ) { - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(size <= imp::kMaxLength && "too large buffer"); -#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION - return node::Buffer::Copy( - v8::Isolate::GetCurrent(), data, size); -#else - return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); -#endif - } - - inline MaybeLocal NewBuffer(uint32_t size) { - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(size <= imp::kMaxLength && "too large buffer"); -#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION - return node::Buffer::New( - v8::Isolate::GetCurrent(), size); -#else - return node::Buffer::New(v8::Isolate::GetCurrent(), size); -#endif - } - - inline MaybeLocal NewBuffer( - char* data - , uint32_t size - ) { - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(size <= imp::kMaxLength && "too large buffer"); -#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION - return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); -#else - return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); -#endif - } - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - inline MaybeLocal - NewOneByteString(const uint8_t * value, int length = -1) { - return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, - v8::NewStringType::kNormal, length); - } - - inline MaybeLocal CompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::ScriptCompiler::Source source(s, origin); - return scope.Escape( - v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source) - .FromMaybe(v8::Local())); - } - - inline MaybeLocal CompileScript( - v8::Local s - ) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::ScriptCompiler::Source source(s); - return scope.Escape( - v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source) - .FromMaybe(v8::Local())); - } - - inline MaybeLocal RunScript( - v8::Local script - ) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(script->BindToCurrentContext() - ->Run(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); - } - - inline MaybeLocal RunScript( - v8::Local script - ) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(script->Run(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); - } -#else - inline MaybeLocal - NewOneByteString(const uint8_t * value, int length = -1) { - return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, - v8::String::kNormalString, length); - } - - inline MaybeLocal CompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); - } - - inline MaybeLocal CompileScript( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); - } - - inline MaybeLocal RunScript( - v8::Local script - ) { - EscapableHandleScope scope; - return scope.Escape(script->BindToCurrentContext()->Run()); - } - - inline MaybeLocal RunScript( - v8::Local script - ) { - return script->Run(); - } -#endif - - NAN_DEPRECATED inline v8::Local MakeCallback( - v8::Local target - , v8::Local func - , int argc - , v8::Local* argv) { -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(node::MakeCallback( - v8::Isolate::GetCurrent(), target, func, argc, argv))); -#else -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource res("nan:makeCallback"); - return res.runInAsyncScope(target, func, argc, argv) - .FromMaybe(v8::Local()); -# else - return node::MakeCallback( - v8::Isolate::GetCurrent(), target, func, argc, argv); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#endif // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - } - - NAN_DEPRECATED inline v8::Local MakeCallback( - v8::Local target - , v8::Local symbol - , int argc - , v8::Local* argv) { -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(node::MakeCallback( - v8::Isolate::GetCurrent(), target, symbol, argc, argv))); -#else -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource res("nan:makeCallback"); - return res.runInAsyncScope(target, symbol, argc, argv) - .FromMaybe(v8::Local()); -# else - return node::MakeCallback( - v8::Isolate::GetCurrent(), target, symbol, argc, argv); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#endif // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - } - - NAN_DEPRECATED inline v8::Local MakeCallback( - v8::Local target - , const char* method - , int argc - , v8::Local* argv) { -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - return scope.Escape(New(node::MakeCallback( - v8::Isolate::GetCurrent(), target, method, argc, argv))); -#else -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource res("nan:makeCallback"); - return res.runInAsyncScope(target, method, argc, argv) - .FromMaybe(v8::Local()); -# else - return node::MakeCallback( - v8::Isolate::GetCurrent(), target, method, argc, argv); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#endif // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - } - - inline void FatalException(const TryCatch& try_catch) { - node::FatalException(v8::Isolate::GetCurrent(), try_catch.try_catch_); - } - - inline v8::Local ErrnoException( - int errorno - , const char* syscall = NULL - , const char* message = NULL - , const char* path = NULL) { - return node::ErrnoException(v8::Isolate::GetCurrent(), errorno, syscall, - message, path); - } - - NAN_DEPRECATED inline v8::Local NanErrnoException( - int errorno - , const char* syscall = NULL - , const char* message = NULL - , const char* path = NULL) { - return ErrnoException(errorno, syscall, message, path); - } - - template - inline void SetIsolateData( - v8::Isolate *isolate - , T *data - ) { - isolate->SetData(0, data); - } - - template - inline T *GetIsolateData( - v8::Isolate *isolate - ) { - return static_cast(isolate->GetData(0)); - } - -class Utf8String { - public: - inline explicit Utf8String(v8::Local from) : - length_(0), str_(str_st_) { - HandleScope scope; - if (!from.IsEmpty()) { -#if NODE_MAJOR_VERSION >= 10 - v8::Local context = GetCurrentContext(); - v8::Local string = - from->ToString(context).FromMaybe(v8::Local()); -#else - v8::Local string = from->ToString(); -#endif - if (!string.IsEmpty()) { - size_t len = 3 * string->Length() + 1; - assert(len <= INT_MAX); - if (len > sizeof (str_st_)) { - str_ = static_cast(malloc(len)); - assert(str_ != 0); - } - const int flags = - v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8; -#if NODE_MAJOR_VERSION >= 11 - length_ = string->WriteUtf8(v8::Isolate::GetCurrent(), str_, - static_cast(len), 0, flags); -#else - // See https://github.com/nodejs/nan/issues/832. - // Disable the warning as there is no way around it. -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - length_ = string->WriteUtf8(str_, static_cast(len), 0, flags); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif -#endif // NODE_MAJOR_VERSION < 11 - str_[length_] = '\0'; - } - } - } - - inline int length() const { - return length_; - } - - inline char* operator*() { return str_; } - inline const char* operator*() const { return str_; } - - inline ~Utf8String() { - if (str_ != str_st_) { - free(str_); - } - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String) - - int length_; - char *str_; - char str_st_[1024]; -}; - -#else // Node 0.8 and 0.10 - inline v8::Local Undefined() { - EscapableHandleScope scope; - return scope.Escape(New(v8::Undefined())); - } - - inline v8::Local Null() { - EscapableHandleScope scope; - return scope.Escape(New(v8::Null())); - } - - inline v8::Local True() { - EscapableHandleScope scope; - return scope.Escape(New(v8::True())); - } - - inline v8::Local False() { - EscapableHandleScope scope; - return scope.Escape(New(v8::False())); - } - - inline v8::Local EmptyString() { - return v8::String::Empty(); - } - - inline int AdjustExternalMemory(int bc) { - return static_cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(bc)); - } - - inline void SetTemplate( - v8::Local templ - , const char *name - , v8::Local value) { - templ->Set(name, value); - } - - inline void SetTemplate( - v8::Local templ - , v8::Local name - , v8::Local value - , v8::PropertyAttribute attributes) { - templ->Set(name, value, attributes); - } - - inline v8::Local GetCurrentContext() { - return v8::Context::GetCurrent(); - } - - inline void* GetInternalFieldPointer( - v8::Local object - , int index) { - return object->GetPointerFromInternalField(index); - } - - inline void SetInternalFieldPointer( - v8::Local object - , int index - , void* value) { - object->SetPointerInInternalField(index, value); - } - -# define NAN_GC_CALLBACK(name) \ - void name(v8::GCType type, v8::GCCallbackFlags flags) - - inline void AddGCEpilogueCallback( - v8::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); - } - inline void RemoveGCEpilogueCallback( - v8::GCEpilogueCallback callback) { - v8::V8::RemoveGCEpilogueCallback(callback); - } - inline void AddGCPrologueCallback( - v8::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCPrologueCallback(callback, gc_type_filter); - } - inline void RemoveGCPrologueCallback( - v8::GCPrologueCallback callback) { - v8::V8::RemoveGCPrologueCallback(callback); - } - inline void GetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - v8::V8::GetHeapStatistics(heap_statistics); - } - -# define X(NAME) \ - inline v8::Local NAME(const char *msg) { \ - EscapableHandleScope scope; \ - return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked())); \ - } \ - \ - inline \ - v8::Local NAME(v8::Local msg) { \ - return v8::Exception::NAME(msg); \ - } \ - \ - inline void Throw ## NAME(const char *msg) { \ - HandleScope scope; \ - v8::ThrowException(v8::Exception::NAME(New(msg).ToLocalChecked())); \ - } \ - \ - inline \ - void Throw ## NAME(v8::Local errmsg) { \ - HandleScope scope; \ - v8::ThrowException(v8::Exception::NAME(errmsg)); \ - } - - X(Error) - X(RangeError) - X(ReferenceError) - X(SyntaxError) - X(TypeError) - -# undef X - - inline void ThrowError(v8::Local error) { - v8::ThrowException(error); - } - - inline MaybeLocal NewBuffer( - char *data - , size_t length - , node::Buffer::free_callback callback - , void *hint - ) { - EscapableHandleScope scope; - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(length <= imp::kMaxLength && "too large buffer"); - return scope.Escape( - New(node::Buffer::New(data, length, callback, hint)->handle_)); - } - - inline MaybeLocal CopyBuffer( - const char *data - , uint32_t size - ) { - EscapableHandleScope scope; - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(size <= imp::kMaxLength && "too large buffer"); -#if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION - return scope.Escape(New(node::Buffer::New(data, size)->handle_)); -#else - return scope.Escape( - New(node::Buffer::New(const_cast(data), size)->handle_)); -#endif - } - - inline MaybeLocal NewBuffer(uint32_t size) { - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - EscapableHandleScope scope; - assert(size <= imp::kMaxLength && "too large buffer"); - return scope.Escape(New(node::Buffer::New(size)->handle_)); - } - - inline void FreeData(char *data, void *hint) { - (void) hint; // unused - delete[] data; - } - - inline MaybeLocal NewBuffer( - char* data - , uint32_t size - ) { - EscapableHandleScope scope; - // arbitrary buffer lengths requires - // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION - assert(size <= imp::kMaxLength && "too large buffer"); - return scope.Escape( - New(node::Buffer::New(data, size, FreeData, NULL)->handle_)); - } - -namespace imp { -inline void -widenString(std::vector *ws, const uint8_t *s, int l) { - size_t len = static_cast(l); - if (l < 0) { - len = strlen(reinterpret_cast(s)); - } - assert(len <= INT_MAX && "string too long"); - ws->resize(len); - std::copy(s, s + len, ws->begin()); // NOLINT(build/include_what_you_use) -} -} // end of namespace imp - - inline MaybeLocal - NewOneByteString(const uint8_t * value, int length = -1) { - std::vector wideString; // NOLINT(build/include_what_you_use) - imp::widenString(&wideString, value, length); - return v8::String::New(wideString.data(), - static_cast(wideString.size())); - } - - inline MaybeLocal CompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::Compile(s, const_cast(&origin)); - } - - inline MaybeLocal CompileScript( - v8::Local s - ) { - return v8::Script::Compile(s); - } - - inline - MaybeLocal RunScript(v8::Local script) { - return script->Run(); - } - - inline v8::Local MakeCallback( - v8::Local target - , v8::Local func - , int argc - , v8::Local* argv) { - v8::HandleScope scope; - return scope.Close(New(node::MakeCallback(target, func, argc, argv))); - } - - inline v8::Local MakeCallback( - v8::Local target - , v8::Local symbol - , int argc - , v8::Local* argv) { - v8::HandleScope scope; - return scope.Close(New(node::MakeCallback(target, symbol, argc, argv))); - } - - inline v8::Local MakeCallback( - v8::Local target - , const char* method - , int argc - , v8::Local* argv) { - v8::HandleScope scope; - return scope.Close(New(node::MakeCallback(target, method, argc, argv))); - } - - inline void FatalException(const TryCatch& try_catch) { - node::FatalException(const_cast(try_catch.try_catch_)); - } - - inline v8::Local ErrnoException( - int errorno - , const char* syscall = NULL - , const char* message = NULL - , const char* path = NULL) { - return node::ErrnoException(errorno, syscall, message, path); - } - - NAN_DEPRECATED inline v8::Local NanErrnoException( - int errorno - , const char* syscall = NULL - , const char* message = NULL - , const char* path = NULL) { - return ErrnoException(errorno, syscall, message, path); - } - - - template - inline void SetIsolateData( - v8::Isolate *isolate - , T *data - ) { - isolate->SetData(data); - } - - template - inline T *GetIsolateData( - v8::Isolate *isolate - ) { - return static_cast(isolate->GetData()); - } - -class Utf8String { - public: - inline explicit Utf8String(v8::Local from) : - length_(0), str_(str_st_) { - v8::HandleScope scope; - if (!from.IsEmpty()) { - v8::Local string = from->ToString(); - if (!string.IsEmpty()) { - size_t len = 3 * string->Length() + 1; - assert(len <= INT_MAX); - if (len > sizeof (str_st_)) { - str_ = static_cast(malloc(len)); - assert(str_ != 0); - } - const int flags = - v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8; - length_ = string->WriteUtf8(str_, static_cast(len), 0, flags); - str_[length_] = '\0'; - } - } - } - - inline int length() const { - return length_; - } - - inline char* operator*() { return str_; } - inline const char* operator*() const { return str_; } - - inline ~Utf8String() { - if (str_ != str_st_) { - free(str_); - } - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String) - - int length_; - char *str_; - char str_st_[1024]; -}; - -#endif // NODE_MODULE_VERSION - -typedef void (*FreeCallback)(char *data, void *hint); - -typedef const FunctionCallbackInfo& NAN_METHOD_ARGS_TYPE; -typedef void NAN_METHOD_RETURN_TYPE; - -typedef const PropertyCallbackInfo& NAN_GETTER_ARGS_TYPE; -typedef void NAN_GETTER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& NAN_SETTER_ARGS_TYPE; -typedef void NAN_SETTER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_PROPERTY_GETTER_ARGS_TYPE; -typedef void NAN_PROPERTY_GETTER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_PROPERTY_SETTER_ARGS_TYPE; -typedef void NAN_PROPERTY_SETTER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_PROPERTY_ENUMERATOR_ARGS_TYPE; -typedef void NAN_PROPERTY_ENUMERATOR_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_PROPERTY_DELETER_ARGS_TYPE; -typedef void NAN_PROPERTY_DELETER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_PROPERTY_QUERY_ARGS_TYPE; -typedef void NAN_PROPERTY_QUERY_RETURN_TYPE; - -typedef const PropertyCallbackInfo& NAN_INDEX_GETTER_ARGS_TYPE; -typedef void NAN_INDEX_GETTER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& NAN_INDEX_SETTER_ARGS_TYPE; -typedef void NAN_INDEX_SETTER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_INDEX_ENUMERATOR_ARGS_TYPE; -typedef void NAN_INDEX_ENUMERATOR_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_INDEX_DELETER_ARGS_TYPE; -typedef void NAN_INDEX_DELETER_RETURN_TYPE; - -typedef const PropertyCallbackInfo& - NAN_INDEX_QUERY_ARGS_TYPE; -typedef void NAN_INDEX_QUERY_RETURN_TYPE; - -#define NAN_METHOD(name) \ - Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info) -#define NAN_GETTER(name) \ - Nan::NAN_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , Nan::NAN_GETTER_ARGS_TYPE info) -#define NAN_SETTER(name) \ - Nan::NAN_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , Nan::NAN_SETTER_ARGS_TYPE info) -#define NAN_PROPERTY_GETTER(name) \ - Nan::NAN_PROPERTY_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , Nan::NAN_PROPERTY_GETTER_ARGS_TYPE info) -#define NAN_PROPERTY_SETTER(name) \ - Nan::NAN_PROPERTY_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , Nan::NAN_PROPERTY_SETTER_ARGS_TYPE info) -#define NAN_PROPERTY_ENUMERATOR(name) \ - Nan::NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name( \ - Nan::NAN_PROPERTY_ENUMERATOR_ARGS_TYPE info) -#define NAN_PROPERTY_DELETER(name) \ - Nan::NAN_PROPERTY_DELETER_RETURN_TYPE name( \ - v8::Local property \ - , Nan::NAN_PROPERTY_DELETER_ARGS_TYPE info) -#define NAN_PROPERTY_QUERY(name) \ - Nan::NAN_PROPERTY_QUERY_RETURN_TYPE name( \ - v8::Local property \ - , Nan::NAN_PROPERTY_QUERY_ARGS_TYPE info) -# define NAN_INDEX_GETTER(name) \ - Nan::NAN_INDEX_GETTER_RETURN_TYPE name( \ - uint32_t index \ - , Nan::NAN_INDEX_GETTER_ARGS_TYPE info) -#define NAN_INDEX_SETTER(name) \ - Nan::NAN_INDEX_SETTER_RETURN_TYPE name( \ - uint32_t index \ - , v8::Local value \ - , Nan::NAN_INDEX_SETTER_ARGS_TYPE info) -#define NAN_INDEX_ENUMERATOR(name) \ - Nan::NAN_INDEX_ENUMERATOR_RETURN_TYPE \ - name(Nan::NAN_INDEX_ENUMERATOR_ARGS_TYPE info) -#define NAN_INDEX_DELETER(name) \ - Nan::NAN_INDEX_DELETER_RETURN_TYPE name( \ - uint32_t index \ - , Nan::NAN_INDEX_DELETER_ARGS_TYPE info) -#define NAN_INDEX_QUERY(name) \ - Nan::NAN_INDEX_QUERY_RETURN_TYPE name( \ - uint32_t index \ - , Nan::NAN_INDEX_QUERY_ARGS_TYPE info) - -class Callback { - public: - Callback() {} - - explicit Callback(const v8::Local &fn) : handle_(fn) {} - - ~Callback() { - handle_.Reset(); - } - - bool operator==(const Callback &other) const { - return handle_ == other.handle_; - } - - bool operator!=(const Callback &other) const { - return !operator==(other); - } - - inline - v8::Local operator*() const { return GetFunction(); } - - NAN_DEPRECATED inline v8::Local operator()( - v8::Local target - , int argc = 0 - , v8::Local argv[] = 0) const { -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource async("nan:Callback:operator()"); - return Call_(isolate, target, argc, argv, &async) - .FromMaybe(v8::Local()); -# else - return Call_(isolate, target, argc, argv); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#else - return Call_(target, argc, argv); -#endif // NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - } - - NAN_DEPRECATED inline v8::Local operator()( - int argc = 0 - , v8::Local argv[] = 0) const { -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource async("nan:Callback:operator()"); - return scope.Escape(Call_(isolate, isolate->GetCurrentContext()->Global(), - argc, argv, &async) - .FromMaybe(v8::Local())); -# else - return scope.Escape( - Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#else - v8::HandleScope scope; - return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); -#endif // NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - } - - inline MaybeLocal operator()( - AsyncResource* resource - , int argc = 0 - , v8::Local argv[] = 0) const { - return this->Call(argc, argv, resource); - } - - inline MaybeLocal operator()( - AsyncResource* resource - , v8::Local target - , int argc = 0 - , v8::Local argv[] = 0) const { - return this->Call(target, argc, argv, resource); - } - - // TODO(kkoopa): remove - inline void SetFunction(const v8::Local &fn) { - Reset(fn); - } - - inline void Reset(const v8::Local &fn) { - handle_.Reset(fn); - } - - inline void Reset() { - handle_.Reset(); - } - - inline v8::Local GetFunction() const { - return New(handle_); - } - - inline bool IsEmpty() const { - return handle_.IsEmpty(); - } - - // Deprecated: For async callbacks Use the versions that accept an - // AsyncResource. If this callback does not correspond to an async resource, - // that is, it is a synchronous function call on a non-empty JS stack, you - // should Nan::Call instead. - NAN_DEPRECATED inline v8::Local - Call(v8::Local target - , int argc - , v8::Local argv[]) const { -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource async("nan:Callback:Call"); - return Call_(isolate, target, argc, argv, &async) - .FromMaybe(v8::Local()); -# else - return Call_(isolate, target, argc, argv); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#else - return Call_(target, argc, argv); -#endif - } - - // Deprecated: For async callbacks Use the versions that accept an - // AsyncResource. If this callback does not correspond to an async resource, - // that is, it is a synchronous function call on a non-empty JS stack, you - // should Nan::Call instead. - NAN_DEPRECATED inline v8::Local - Call(int argc, v8::Local argv[]) const { -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); -# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - AsyncResource async("nan:Callback:Call"); - return scope.Escape(Call_(isolate, isolate->GetCurrentContext()->Global(), - argc, argv, &async) - .FromMaybe(v8::Local())); -# else - return scope.Escape( - Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); -# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION -#else - v8::HandleScope scope; - return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); -#endif - } - - inline MaybeLocal - Call(v8::Local target - , int argc - , v8::Local argv[] - , AsyncResource* resource) const { -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - return Call_(isolate, target, argc, argv, resource); -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - return Call_(isolate, target, argc, argv); -#else - return Call_(target, argc, argv); -#endif - } - - inline MaybeLocal - Call(int argc, v8::Local argv[], AsyncResource* resource) const { -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - return Call(isolate->GetCurrentContext()->Global(), argc, argv, resource); -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape( - Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); -#else - v8::HandleScope scope; - return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); -#endif - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(Callback) - Persistent handle_; - -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - MaybeLocal Call_(v8::Isolate *isolate - , v8::Local target - , int argc - , v8::Local argv[] - , AsyncResource* resource) const { - EscapableHandleScope scope; - v8::Local func = New(handle_); - auto maybe = resource->runInAsyncScope(target, func, argc, argv); - v8::Local local; - if (!maybe.ToLocal(&local)) return MaybeLocal(); - return scope.Escape(local); - } -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Local Call_(v8::Isolate *isolate - , v8::Local target - , int argc - , v8::Local argv[]) const { - EscapableHandleScope scope; - - v8::Local callback = New(handle_); -# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION - return scope.Escape(New(node::MakeCallback( - isolate - , target - , callback - , argc - , argv - ))); -# else - return scope.Escape(node::MakeCallback( - isolate - , target - , callback - , argc - , argv - )); -# endif - } -#else - v8::Local Call_(v8::Local target - , int argc - , v8::Local argv[]) const { - EscapableHandleScope scope; - - v8::Local callback = New(handle_); - return scope.Escape(New(node::MakeCallback( - target - , callback - , argc - , argv - ))); - } -#endif -}; - -inline MaybeLocal Call( - const Nan::Callback& callback - , v8::Local recv - , int argc - , v8::Local argv[]) { - return Call(*callback, recv, argc, argv); -} - -inline MaybeLocal Call( - const Nan::Callback& callback - , int argc - , v8::Local argv[]) { -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape( - Call(*callback, isolate->GetCurrentContext()->Global(), argc, argv) - .FromMaybe(v8::Local())); -#else - EscapableHandleScope scope; - return scope.Escape( - Call(*callback, v8::Context::GetCurrent()->Global(), argc, argv) - .FromMaybe(v8::Local())); -#endif -} - -inline MaybeLocal Call( - v8::Local symbol - , v8::Local recv - , int argc - , v8::Local argv[]) { - EscapableHandleScope scope; - v8::Local fn_v = - Get(recv, symbol).FromMaybe(v8::Local()); - if (fn_v.IsEmpty() || !fn_v->IsFunction()) return v8::Local(); - v8::Local fn = fn_v.As(); - return scope.Escape( - Call(fn, recv, argc, argv).FromMaybe(v8::Local())); -} - -inline MaybeLocal Call( - const char* method - , v8::Local recv - , int argc - , v8::Local argv[]) { - EscapableHandleScope scope; - v8::Local method_string = - New(method).ToLocalChecked(); - return scope.Escape( - Call(method_string, recv, argc, argv).FromMaybe(v8::Local())); -} - -/* abstract */ class AsyncWorker { - public: - explicit AsyncWorker(Callback *callback_, - const char* resource_name = "nan:AsyncWorker") - : callback(callback_), errmsg_(NULL) { - request.data = this; - - HandleScope scope; - v8::Local obj = New(); - persistentHandle.Reset(obj); - async_resource = new AsyncResource(resource_name, obj); - } - - virtual ~AsyncWorker() { - HandleScope scope; - - if (!persistentHandle.IsEmpty()) - persistentHandle.Reset(); - delete callback; - delete[] errmsg_; - delete async_resource; - } - - virtual void WorkComplete() { - HandleScope scope; - - if (errmsg_ == NULL) - HandleOKCallback(); - else - HandleErrorCallback(); - delete callback; - callback = NULL; - } - - inline void SaveToPersistent( - const char *key, const v8::Local &value) { - HandleScope scope; - Set(New(persistentHandle), New(key).ToLocalChecked(), value).FromJust(); - } - - inline void SaveToPersistent( - const v8::Local &key, const v8::Local &value) { - HandleScope scope; - Set(New(persistentHandle), key, value).FromJust(); - } - - inline void SaveToPersistent( - uint32_t index, const v8::Local &value) { - HandleScope scope; - Set(New(persistentHandle), index, value).FromJust(); - } - - inline v8::Local GetFromPersistent(const char *key) const { - EscapableHandleScope scope; - return scope.Escape( - Get(New(persistentHandle), New(key).ToLocalChecked()) - .FromMaybe(v8::Local())); - } - - inline v8::Local - GetFromPersistent(const v8::Local &key) const { - EscapableHandleScope scope; - return scope.Escape( - Get(New(persistentHandle), key) - .FromMaybe(v8::Local())); - } - - inline v8::Local GetFromPersistent(uint32_t index) const { - EscapableHandleScope scope; - return scope.Escape( - Get(New(persistentHandle), index) - .FromMaybe(v8::Local())); - } - - virtual void Execute() = 0; - - uv_work_t request; - - virtual void Destroy() { - delete this; - } - - protected: - Persistent persistentHandle; - Callback *callback; - AsyncResource *async_resource; - - virtual void HandleOKCallback() { - HandleScope scope; - - callback->Call(0, NULL, async_resource); - } - - virtual void HandleErrorCallback() { - HandleScope scope; - - v8::Local argv[] = { - v8::Exception::Error(New(ErrorMessage()).ToLocalChecked()) - }; - callback->Call(1, argv, async_resource); - } - - void SetErrorMessage(const char *msg) { - delete[] errmsg_; - - size_t size = strlen(msg) + 1; - errmsg_ = new char[size]; - memcpy(errmsg_, msg, size); - } - - const char* ErrorMessage() const { - return errmsg_; - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncWorker) - char *errmsg_; -}; - -/* abstract */ class AsyncBareProgressWorkerBase : public AsyncWorker { - public: - explicit AsyncBareProgressWorkerBase( - Callback *callback_, - const char* resource_name = "nan:AsyncBareProgressWorkerBase") - : AsyncWorker(callback_, resource_name) { - uv_async_init( - GetCurrentEventLoop() - , &async - , AsyncProgress_ - ); - async.data = this; - } - - virtual ~AsyncBareProgressWorkerBase() { - } - - virtual void WorkProgress() = 0; - - virtual void Destroy() { - uv_close(reinterpret_cast(&async), AsyncClose_); - } - - private: - inline static NAUV_WORK_CB(AsyncProgress_) { - AsyncBareProgressWorkerBase *worker = - static_cast(async->data); - worker->WorkProgress(); - } - - inline static void AsyncClose_(uv_handle_t* handle) { - AsyncBareProgressWorkerBase *worker = - static_cast(handle->data); - delete worker; - } - - protected: - uv_async_t async; -}; - -template -/* abstract */ -class AsyncBareProgressWorker : public AsyncBareProgressWorkerBase { - public: - explicit AsyncBareProgressWorker( - Callback *callback_, - const char* resource_name = "nan:AsyncBareProgressWorker") - : AsyncBareProgressWorkerBase(callback_, resource_name) { - uv_mutex_init(&async_lock); - } - - virtual ~AsyncBareProgressWorker() { - uv_mutex_destroy(&async_lock); - } - - class ExecutionProgress { - friend class AsyncBareProgressWorker; - public: - void Signal() const { - uv_mutex_lock(&that_->async_lock); - uv_async_send(&that_->async); - uv_mutex_unlock(&that_->async_lock); - } - - void Send(const T* data, size_t count) const { - that_->SendProgress_(data, count); - } - - private: - explicit ExecutionProgress(AsyncBareProgressWorker *that) : that_(that) {} - NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress) - AsyncBareProgressWorker* const that_; - }; - - virtual void Execute(const ExecutionProgress& progress) = 0; - virtual void HandleProgressCallback(const T *data, size_t size) = 0; - - protected: - uv_mutex_t async_lock; - - private: - void Execute() /*final override*/ { - ExecutionProgress progress(this); - Execute(progress); - } - - virtual void SendProgress_(const T *data, size_t count) = 0; -}; - -template -/* abstract */ -class AsyncProgressWorkerBase : public AsyncBareProgressWorker { - public: - explicit AsyncProgressWorkerBase( - Callback *callback_, - const char* resource_name = "nan:AsyncProgressWorkerBase") - : AsyncBareProgressWorker(callback_, resource_name), asyncdata_(NULL), - asyncsize_(0) { - } - - virtual ~AsyncProgressWorkerBase() { - delete[] asyncdata_; - } - - void WorkProgress() { - uv_mutex_lock(&this->async_lock); - T *data = asyncdata_; - size_t size = asyncsize_; - asyncdata_ = NULL; - asyncsize_ = 0; - uv_mutex_unlock(&this->async_lock); - - // Don't send progress events after we've already completed. - if (this->callback) { - this->HandleProgressCallback(data, size); - } - delete[] data; - } - - private: - void SendProgress_(const T *data, size_t count) { - T *new_data = new T[count]; - std::copy(data, data + count, new_data); - - uv_mutex_lock(&this->async_lock); - T *old_data = asyncdata_; - asyncdata_ = new_data; - asyncsize_ = count; - uv_async_send(&this->async); - uv_mutex_unlock(&this->async_lock); - - delete[] old_data; - } - - T *asyncdata_; - size_t asyncsize_; -}; - -// This ensures compatibility to the previous un-templated AsyncProgressWorker -// class definition. -typedef AsyncProgressWorkerBase AsyncProgressWorker; - -template -/* abstract */ -class AsyncBareProgressQueueWorker : public AsyncBareProgressWorkerBase { - public: - explicit AsyncBareProgressQueueWorker( - Callback *callback_, - const char* resource_name = "nan:AsyncBareProgressQueueWorker") - : AsyncBareProgressWorkerBase(callback_, resource_name) { - } - - virtual ~AsyncBareProgressQueueWorker() { - } - - class ExecutionProgress { - friend class AsyncBareProgressQueueWorker; - public: - void Send(const T* data, size_t count) const { - that_->SendProgress_(data, count); - } - - private: - explicit ExecutionProgress(AsyncBareProgressQueueWorker *that) - : that_(that) {} - NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress) - AsyncBareProgressQueueWorker* const that_; - }; - - virtual void Execute(const ExecutionProgress& progress) = 0; - virtual void HandleProgressCallback(const T *data, size_t size) = 0; - - private: - void Execute() /*final override*/ { - ExecutionProgress progress(this); - Execute(progress); - } - - virtual void SendProgress_(const T *data, size_t count) = 0; -}; - -template -/* abstract */ -class AsyncProgressQueueWorker : public AsyncBareProgressQueueWorker { - public: - explicit AsyncProgressQueueWorker( - Callback *callback_, - const char* resource_name = "nan:AsyncProgressQueueWorker") - : AsyncBareProgressQueueWorker(callback_) { - uv_mutex_init(&async_lock); - } - - virtual ~AsyncProgressQueueWorker() { - uv_mutex_lock(&async_lock); - - while (!asyncdata_.empty()) { - std::pair &datapair = asyncdata_.front(); - T *data = datapair.first; - - asyncdata_.pop(); - - delete[] data; - } - - uv_mutex_unlock(&async_lock); - uv_mutex_destroy(&async_lock); - } - - void WorkComplete() { - WorkProgress(); - AsyncWorker::WorkComplete(); - } - - void WorkProgress() { - uv_mutex_lock(&async_lock); - - while (!asyncdata_.empty()) { - std::pair &datapair = asyncdata_.front(); - - T *data = datapair.first; - size_t size = datapair.second; - - asyncdata_.pop(); - uv_mutex_unlock(&async_lock); - - // Don't send progress events after we've already completed. - if (this->callback) { - this->HandleProgressCallback(data, size); - } - - delete[] data; - - uv_mutex_lock(&async_lock); - } - - uv_mutex_unlock(&async_lock); - } - - private: - void SendProgress_(const T *data, size_t count) { - T *new_data = new T[count]; - std::copy(data, data + count, new_data); - - uv_mutex_lock(&async_lock); - asyncdata_.push(std::pair(new_data, count)); - uv_mutex_unlock(&async_lock); - - uv_async_send(&this->async); - } - - uv_mutex_t async_lock; - std::queue > asyncdata_; -}; - -inline void AsyncExecute (uv_work_t* req) { - AsyncWorker *worker = static_cast(req->data); - worker->Execute(); -} - -/* uv_after_work_cb has 1 argument before node-v0.9.4 and - * 2 arguments since node-v0.9.4 - * https://github.com/libuv/libuv/commit/92fb84b751e18f032c02609467f44bfe927b80c5 - */ -inline void AsyncExecuteComplete(uv_work_t *req) { - AsyncWorker* worker = static_cast(req->data); - worker->WorkComplete(); - worker->Destroy(); -} -inline void AsyncExecuteComplete (uv_work_t* req, int status) { - AsyncExecuteComplete(req); -} - -inline void AsyncQueueWorker (AsyncWorker* worker) { - uv_queue_work( - GetCurrentEventLoop() - , &worker->request - , AsyncExecute - , AsyncExecuteComplete - ); -} - -namespace imp { - -inline -ExternalOneByteStringResource const* -GetExternalResource(v8::Local str) { -#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION - return str->GetExternalAsciiStringResource(); -#else - return str->GetExternalOneByteStringResource(); -#endif -} - -inline -bool -IsExternal(v8::Local str) { -#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION - return str->IsExternalAscii(); -#else - return str->IsExternalOneByte(); -#endif -} - -} // end of namespace imp - -enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; - -#if NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION -# include "nan_string_bytes.h" // NOLINT(build/include) -#endif - -inline v8::Local Encode( - const void *buf, size_t len, enum Encoding encoding = BINARY) { -#if (NODE_MODULE_VERSION >= ATOM_0_21_MODULE_VERSION) - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - node::encoding node_enc = static_cast(encoding); - - if (encoding == UCS2) { - return node::Encode( - isolate - , reinterpret_cast(buf) - , len / 2); - } else { - return node::Encode( - isolate - , reinterpret_cast(buf) - , len - , node_enc); - } -#elif (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) - return node::Encode( - v8::Isolate::GetCurrent() - , buf, len - , static_cast(encoding)); -#else -# if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION - return node::Encode(buf, len, static_cast(encoding)); -# else - return imp::Encode(reinterpret_cast(buf), len, encoding); -# endif -#endif -} - -inline ssize_t DecodeBytes( - v8::Local val, enum Encoding encoding = BINARY) { -#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) - return node::DecodeBytes( - v8::Isolate::GetCurrent() - , val - , static_cast(encoding)); -#else -# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION) - if (encoding == BUFFER) { - return node::DecodeBytes(val, node::BINARY); - } -# endif - return node::DecodeBytes(val, static_cast(encoding)); -#endif -} - -inline ssize_t DecodeWrite( - char *buf - , size_t len - , v8::Local val - , enum Encoding encoding = BINARY) { -#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) - return node::DecodeWrite( - v8::Isolate::GetCurrent() - , buf - , len - , val - , static_cast(encoding)); -#else -# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION) - if (encoding == BUFFER) { - return node::DecodeWrite(buf, len, val, node::BINARY); - } -# endif - return node::DecodeWrite( - buf - , len - , val - , static_cast(encoding)); -#endif -} - -inline void SetPrototypeTemplate( - v8::Local templ - , const char *name - , v8::Local value -) { - HandleScope scope; - SetTemplate(templ->PrototypeTemplate(), name, value); -} - -inline void SetPrototypeTemplate( - v8::Local templ - , v8::Local name - , v8::Local value - , v8::PropertyAttribute attributes -) { - HandleScope scope; - SetTemplate(templ->PrototypeTemplate(), name, value, attributes); -} - -inline void SetInstanceTemplate( - v8::Local templ - , const char *name - , v8::Local value -) { - HandleScope scope; - SetTemplate(templ->InstanceTemplate(), name, value); -} - -inline void SetInstanceTemplate( - v8::Local templ - , v8::Local name - , v8::Local value - , v8::PropertyAttribute attributes -) { - HandleScope scope; - SetTemplate(templ->InstanceTemplate(), name, value, attributes); -} - -namespace imp { - -// Note(@agnat): Helper to distinguish different receiver types. The first -// version deals with receivers derived from v8::Template. The second version -// handles everything else. The final argument only serves as discriminator and -// is unused. -template -inline -void -SetMethodAux(T recv, - v8::Local name, - v8::Local tpl, - v8::Template *) { - recv->Set(name, tpl); -} - -template -inline -void -SetMethodAux(T recv, - v8::Local name, - v8::Local tpl, - ...) { - Set(recv, name, GetFunction(tpl).ToLocalChecked()); -} - -} // end of namespace imp - -template class HandleType> -inline void SetMethod( - HandleType recv - , const char *name - , FunctionCallback callback - , v8::Local data = v8::Local()) { - HandleScope scope; - v8::Local t = New(callback, data); - v8::Local fn_name = New(name).ToLocalChecked(); - t->SetClassName(fn_name); - // Note(@agnat): Pass an empty T* as discriminator. See note on - // SetMethodAux(...) above - imp::SetMethodAux(recv, fn_name, t, static_cast(0)); -} - -inline void SetPrototypeMethod( - v8::Local recv - , const char* name - , FunctionCallback callback - , v8::Local data = v8::Local()) { - HandleScope scope; - v8::Local t = New( - callback - , data - , New(recv)); - v8::Local fn_name = New(name).ToLocalChecked(); - recv->PrototypeTemplate()->Set(fn_name, t); - t->SetClassName(fn_name); -} - -//=== Accessors and Such ======================================================= - -NAN_DEPRECATED inline void SetAccessor( - v8::Local tpl - , v8::Local name - , GetterCallback getter - , SetterCallback setter - , v8::Local data - , v8::AccessControl settings - , v8::PropertyAttribute attribute - , imp::Sig signature) { - HandleScope scope; - - imp::NativeGetter getter_ = - imp::GetterCallbackWrapper; - imp::NativeSetter setter_ = - setter ? imp::SetterCallbackWrapper : 0; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kAccessorFieldCount); - v8::Local obj = NewInstance(otpl).ToLocalChecked(); - - obj->SetInternalField( - imp::kGetterIndex - , New(reinterpret_cast(getter))); - - if (setter != 0) { - obj->SetInternalField( - imp::kSetterIndex - , New(reinterpret_cast(setter))); - } - - if (!data.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, data); - } - - tpl->SetAccessor( - name - , getter_ - , setter_ - , obj - , settings - , attribute -#if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION) - , signature -#endif - ); -} - -inline void SetAccessor( - v8::Local tpl - , v8::Local name - , GetterCallback getter - , SetterCallback setter = 0 - , v8::Local data = v8::Local() - , v8::AccessControl settings = v8::DEFAULT - , v8::PropertyAttribute attribute = v8::None) { - HandleScope scope; - - imp::NativeGetter getter_ = - imp::GetterCallbackWrapper; - imp::NativeSetter setter_ = - setter ? imp::SetterCallbackWrapper : 0; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kAccessorFieldCount); - v8::Local obj = NewInstance(otpl).ToLocalChecked(); - - obj->SetInternalField( - imp::kGetterIndex - , New(reinterpret_cast(getter))); - - if (setter != 0) { - obj->SetInternalField( - imp::kSetterIndex - , New(reinterpret_cast(setter))); - } - - if (!data.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, data); - } - - tpl->SetAccessor( - name - , getter_ - , setter_ - , obj - , settings - , attribute - ); -} - -inline bool SetAccessor( - v8::Local obj - , v8::Local name - , GetterCallback getter - , SetterCallback setter = 0 - , v8::Local data = v8::Local() - , v8::AccessControl settings = v8::DEFAULT - , v8::PropertyAttribute attribute = v8::None) { - HandleScope scope; - - imp::NativeGetter getter_ = - imp::GetterCallbackWrapper; - imp::NativeSetter setter_ = - setter ? imp::SetterCallbackWrapper : 0; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kAccessorFieldCount); - v8::Local dataobj = NewInstance(otpl).ToLocalChecked(); - - dataobj->SetInternalField( - imp::kGetterIndex - , New(reinterpret_cast(getter))); - - if (!data.IsEmpty()) { - dataobj->SetInternalField(imp::kDataIndex, data); - } - - if (setter) { - dataobj->SetInternalField( - imp::kSetterIndex - , New(reinterpret_cast(setter))); - } - -#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) - return obj->SetAccessor( - GetCurrentContext() - , name - , getter_ - , setter_ - , dataobj - , settings - , attribute).FromMaybe(false); -#else - return obj->SetAccessor( - name - , getter_ - , setter_ - , dataobj - , settings - , attribute); -#endif -} - -inline void SetNamedPropertyHandler( - v8::Local tpl - , PropertyGetterCallback getter - , PropertySetterCallback setter = 0 - , PropertyQueryCallback query = 0 - , PropertyDeleterCallback deleter = 0 - , PropertyEnumeratorCallback enumerator = 0 - , v8::Local data = v8::Local()) { - HandleScope scope; - - imp::NativePropertyGetter getter_ = - imp::PropertyGetterCallbackWrapper; - imp::NativePropertySetter setter_ = - setter ? imp::PropertySetterCallbackWrapper : 0; - imp::NativePropertyQuery query_ = - query ? imp::PropertyQueryCallbackWrapper : 0; - imp::NativePropertyDeleter *deleter_ = - deleter ? imp::PropertyDeleterCallbackWrapper : 0; - imp::NativePropertyEnumerator enumerator_ = - enumerator ? imp::PropertyEnumeratorCallbackWrapper : 0; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kPropertyFieldCount); - v8::Local obj = NewInstance(otpl).ToLocalChecked(); - obj->SetInternalField( - imp::kPropertyGetterIndex - , New(reinterpret_cast(getter))); - - if (setter) { - obj->SetInternalField( - imp::kPropertySetterIndex - , New(reinterpret_cast(setter))); - } - - if (query) { - obj->SetInternalField( - imp::kPropertyQueryIndex - , New(reinterpret_cast(query))); - } - - if (deleter) { - obj->SetInternalField( - imp::kPropertyDeleterIndex - , New(reinterpret_cast(deleter))); - } - - if (enumerator) { - obj->SetInternalField( - imp::kPropertyEnumeratorIndex - , New(reinterpret_cast(enumerator))); - } - - if (!data.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, data); - } - -#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION - tpl->SetHandler(v8::NamedPropertyHandlerConfiguration( - getter_, setter_, query_, deleter_, enumerator_, obj)); -#else - tpl->SetNamedPropertyHandler( - getter_ - , setter_ - , query_ - , deleter_ - , enumerator_ - , obj); -#endif -} - -inline void SetIndexedPropertyHandler( - v8::Local tpl - , IndexGetterCallback getter - , IndexSetterCallback setter = 0 - , IndexQueryCallback query = 0 - , IndexDeleterCallback deleter = 0 - , IndexEnumeratorCallback enumerator = 0 - , v8::Local data = v8::Local()) { - HandleScope scope; - - imp::NativeIndexGetter getter_ = - imp::IndexGetterCallbackWrapper; - imp::NativeIndexSetter setter_ = - setter ? imp::IndexSetterCallbackWrapper : 0; - imp::NativeIndexQuery query_ = - query ? imp::IndexQueryCallbackWrapper : 0; - imp::NativeIndexDeleter deleter_ = - deleter ? imp::IndexDeleterCallbackWrapper : 0; - imp::NativeIndexEnumerator enumerator_ = - enumerator ? imp::IndexEnumeratorCallbackWrapper : 0; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kIndexPropertyFieldCount); - v8::Local obj = NewInstance(otpl).ToLocalChecked(); - obj->SetInternalField( - imp::kIndexPropertyGetterIndex - , New(reinterpret_cast(getter))); - - if (setter) { - obj->SetInternalField( - imp::kIndexPropertySetterIndex - , New(reinterpret_cast(setter))); - } - - if (query) { - obj->SetInternalField( - imp::kIndexPropertyQueryIndex - , New(reinterpret_cast(query))); - } - - if (deleter) { - obj->SetInternalField( - imp::kIndexPropertyDeleterIndex - , New(reinterpret_cast(deleter))); - } - - if (enumerator) { - obj->SetInternalField( - imp::kIndexPropertyEnumeratorIndex - , New(reinterpret_cast(enumerator))); - } - - if (!data.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, data); - } - -#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION - tpl->SetHandler(v8::IndexedPropertyHandlerConfiguration( - getter_, setter_, query_, deleter_, enumerator_, obj)); -#else - tpl->SetIndexedPropertyHandler( - getter_ - , setter_ - , query_ - , deleter_ - , enumerator_ - , obj); -#endif -} - -inline void SetCallHandler( - v8::Local tpl - , FunctionCallback callback - , v8::Local data = v8::Local()) { - HandleScope scope; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kFunctionFieldCount); - v8::Local obj = NewInstance(otpl).ToLocalChecked(); - - obj->SetInternalField( - imp::kFunctionIndex - , New(reinterpret_cast(callback))); - - if (!data.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, data); - } - - tpl->SetCallHandler(imp::FunctionCallbackWrapper, obj); -} - - -inline void SetCallAsFunctionHandler( - v8::Local tpl, - FunctionCallback callback, - v8::Local data = v8::Local()) { - HandleScope scope; - - v8::Local otpl = New(); - otpl->SetInternalFieldCount(imp::kFunctionFieldCount); - v8::Local obj = NewInstance(otpl).ToLocalChecked(); - - obj->SetInternalField( - imp::kFunctionIndex - , New(reinterpret_cast(callback))); - - if (!data.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, data); - } - - tpl->SetCallAsFunctionHandler(imp::FunctionCallbackWrapper, obj); -} - -//=== Weak Persistent Handling ================================================= - -#include "nan_weak.h" // NOLINT(build/include) - -//=== ObjectWrap =============================================================== - -#include "nan_object_wrap.h" // NOLINT(build/include) - -//=== HiddenValue/Private ====================================================== - -#include "nan_private.h" // NOLINT(build/include) - -//=== Export ================================================================== - -inline -void -Export(ADDON_REGISTER_FUNCTION_ARGS_TYPE target, const char *name, - FunctionCallback f) { - HandleScope scope; - - Set(target, New(name).ToLocalChecked(), - GetFunction(New(f)).ToLocalChecked()); -} - -//=== Tap Reverse Binding ===================================================== - -struct Tap { - explicit Tap(v8::Local t) : t_() { - HandleScope scope; - - t_.Reset(To(t).ToLocalChecked()); - } - - ~Tap() { t_.Reset(); } // not sure if necessary - - inline void plan(int i) { - HandleScope scope; - v8::Local arg = New(i); - Call("plan", New(t_), 1, &arg); - } - - inline void ok(bool isOk, const char *msg = NULL) { - HandleScope scope; - v8::Local args[2]; - args[0] = New(isOk); - if (msg) args[1] = New(msg).ToLocalChecked(); - Call("ok", New(t_), msg ? 2 : 1, args); - } - - inline void pass(const char * msg = NULL) { - HandleScope scope; - v8::Local hmsg; - if (msg) hmsg = New(msg).ToLocalChecked(); - Call("pass", New(t_), msg ? 1 : 0, &hmsg); - } - - inline void end() { - HandleScope scope; - Call("end", New(t_), 0, NULL); - } - - private: - Persistent t_; -}; - -#define NAN_STRINGIZE2(x) #x -#define NAN_STRINGIZE(x) NAN_STRINGIZE2(x) -#define NAN_TEST_EXPRESSION(expression) \ - ( expression ), __FILE__ ":" NAN_STRINGIZE(__LINE__) ": " #expression - -#define NAN_EXPORT(target, function) Export(target, #function, function) - -#undef TYPE_CHECK - -//=== Generic Maybefication =================================================== - -namespace imp { - -template struct Maybefier; - -template struct Maybefier > { - inline static MaybeLocal convert(v8::Local v) { - return v; - } -}; - -template struct Maybefier > { - inline static MaybeLocal convert(MaybeLocal v) { - return v; - } -}; - -} // end of namespace imp - -template class MaybeMaybe> -inline MaybeLocal -MakeMaybe(MaybeMaybe v) { - return imp::Maybefier >::convert(v); -} - -//=== TypedArrayContents ======================================================= - -#include "nan_typedarray_contents.h" // NOLINT(build/include) - -//=== JSON ===================================================================== - -#include "nan_json.h" // NOLINT(build/include) - -//=== ScriptOrigin ============================================================= - -#include "nan_scriptorigin.h" // NOLINT(build/include) - -} // end of namespace Nan - -#endif // NAN_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h deleted file mode 100644 index 93eb2ab4d..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h +++ /dev/null @@ -1,92 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_CALLBACKS_H_ -#define NAN_CALLBACKS_H_ - -template class FunctionCallbackInfo; -template class PropertyCallbackInfo; -template class Global; - -typedef void(*FunctionCallback)(const FunctionCallbackInfo&); -typedef void(*GetterCallback) - (v8::Local, const PropertyCallbackInfo&); -typedef void(*SetterCallback)( - v8::Local, - v8::Local, - const PropertyCallbackInfo&); -typedef void(*PropertyGetterCallback)( - v8::Local, - const PropertyCallbackInfo&); -typedef void(*PropertySetterCallback)( - v8::Local, - v8::Local, - const PropertyCallbackInfo&); -typedef void(*PropertyEnumeratorCallback) - (const PropertyCallbackInfo&); -typedef void(*PropertyDeleterCallback)( - v8::Local, - const PropertyCallbackInfo&); -typedef void(*PropertyQueryCallback)( - v8::Local, - const PropertyCallbackInfo&); -typedef void(*IndexGetterCallback)( - uint32_t, - const PropertyCallbackInfo&); -typedef void(*IndexSetterCallback)( - uint32_t, - v8::Local, - const PropertyCallbackInfo&); -typedef void(*IndexEnumeratorCallback) - (const PropertyCallbackInfo&); -typedef void(*IndexDeleterCallback)( - uint32_t, - const PropertyCallbackInfo&); -typedef void(*IndexQueryCallback)( - uint32_t, - const PropertyCallbackInfo&); - -namespace imp { -#if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION) -typedef v8::Local Sig; -#else -typedef v8::Local Sig; -#endif - -static const int kDataIndex = 0; - -static const int kFunctionIndex = 1; -static const int kFunctionFieldCount = 2; - -static const int kGetterIndex = 1; -static const int kSetterIndex = 2; -static const int kAccessorFieldCount = 3; - -static const int kPropertyGetterIndex = 1; -static const int kPropertySetterIndex = 2; -static const int kPropertyEnumeratorIndex = 3; -static const int kPropertyDeleterIndex = 4; -static const int kPropertyQueryIndex = 5; -static const int kPropertyFieldCount = 6; - -static const int kIndexPropertyGetterIndex = 1; -static const int kIndexPropertySetterIndex = 2; -static const int kIndexPropertyEnumeratorIndex = 3; -static const int kIndexPropertyDeleterIndex = 4; -static const int kIndexPropertyQueryIndex = 5; -static const int kIndexPropertyFieldCount = 6; - -} // end of namespace imp - -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION -# include "nan_callbacks_12_inl.h" // NOLINT(build/include) -#else -# include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include) -#endif - -#endif // NAN_CALLBACKS_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h deleted file mode 100644 index c27b18d80..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h +++ /dev/null @@ -1,514 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_CALLBACKS_12_INL_H_ -#define NAN_CALLBACKS_12_INL_H_ - -template -class ReturnValue { - v8::ReturnValue value_; - - public: - template - explicit inline ReturnValue(const v8::ReturnValue &value) : - value_(value) {} - template - explicit inline ReturnValue(const ReturnValue& that) - : value_(that.value_) { - TYPE_CHECK(T, S); - } - - // Handle setters - template inline void Set(const v8::Local &handle) { - TYPE_CHECK(T, S); - value_.Set(handle); - } - - template inline void Set(const Global &handle) { - TYPE_CHECK(T, S); -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && \ - (V8_MINOR_VERSION > 5 || (V8_MINOR_VERSION == 5 && \ - defined(V8_BUILD_NUMBER) && V8_BUILD_NUMBER >= 8)))) - value_.Set(handle); -#else - value_.Set(*reinterpret_cast*>(&handle)); - const_cast &>(handle).Reset(); -#endif - } - - // Fast primitive setters - inline void Set(bool value) { - TYPE_CHECK(T, v8::Boolean); - value_.Set(value); - } - - inline void Set(double i) { - TYPE_CHECK(T, v8::Number); - value_.Set(i); - } - - inline void Set(int32_t i) { - TYPE_CHECK(T, v8::Integer); - value_.Set(i); - } - - inline void Set(uint32_t i) { - TYPE_CHECK(T, v8::Integer); - value_.Set(i); - } - - // Fast JS primitive setters - inline void SetNull() { - TYPE_CHECK(T, v8::Primitive); - value_.SetNull(); - } - - inline void SetUndefined() { - TYPE_CHECK(T, v8::Primitive); - value_.SetUndefined(); - } - - inline void SetEmptyString() { - TYPE_CHECK(T, v8::String); - value_.SetEmptyString(); - } - - // Convenience getter for isolate - inline v8::Isolate *GetIsolate() const { - return value_.GetIsolate(); - } - - // Pointer setter: Uncompilable to prevent inadvertent misuse. - template - inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); } -}; - -template -class FunctionCallbackInfo { - const v8::FunctionCallbackInfo &info_; - const v8::Local data_; - - public: - explicit inline FunctionCallbackInfo( - const v8::FunctionCallbackInfo &info - , v8::Local data) : - info_(info) - , data_(data) {} - - inline ReturnValue GetReturnValue() const { - return ReturnValue(info_.GetReturnValue()); - } - -#if NODE_MAJOR_VERSION < 10 - inline v8::Local Callee() const { return info_.Callee(); } -#endif - inline v8::Local Data() const { return data_; } - inline v8::Local Holder() const { return info_.Holder(); } - inline bool IsConstructCall() const { return info_.IsConstructCall(); } - inline int Length() const { return info_.Length(); } - inline v8::Local operator[](int i) const { return info_[i]; } - inline v8::Local This() const { return info_.This(); } - inline v8::Isolate *GetIsolate() const { return info_.GetIsolate(); } - - - protected: - static const int kHolderIndex = 0; - static const int kIsolateIndex = 1; - static const int kReturnValueDefaultValueIndex = 2; - static const int kReturnValueIndex = 3; - static const int kDataIndex = 4; - static const int kCalleeIndex = 5; - static const int kContextSaveIndex = 6; - static const int kArgsLength = 7; - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo) -}; - -template -class PropertyCallbackInfo { - const v8::PropertyCallbackInfo &info_; - const v8::Local data_; - - public: - explicit inline PropertyCallbackInfo( - const v8::PropertyCallbackInfo &info - , const v8::Local data) : - info_(info) - , data_(data) {} - - inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); } - inline v8::Local Data() const { return data_; } - inline v8::Local This() const { return info_.This(); } - inline v8::Local Holder() const { return info_.Holder(); } - inline ReturnValue GetReturnValue() const { - return ReturnValue(info_.GetReturnValue()); - } - - protected: - static const int kHolderIndex = 0; - static const int kIsolateIndex = 1; - static const int kReturnValueDefaultValueIndex = 2; - static const int kReturnValueIndex = 3; - static const int kDataIndex = 4; - static const int kThisIndex = 5; - static const int kArgsLength = 6; - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfo) -}; - -namespace imp { -static -void FunctionCallbackWrapper(const v8::FunctionCallbackInfo &info) { - v8::Local obj = info.Data().As(); - FunctionCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kFunctionIndex).As()->Value())); - FunctionCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - callback(cbinfo); -} - -typedef void (*NativeFunction)(const v8::FunctionCallbackInfo &); - -#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION -static -void GetterCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - GetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kGetterIndex).As()->Value())); - callback(property.As(), cbinfo); -} - -typedef void (*NativeGetter) - (v8::Local, const v8::PropertyCallbackInfo &); - -static -void SetterCallbackWrapper( - v8::Local property - , v8::Local value - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - SetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kSetterIndex).As()->Value())); - callback(property.As(), value, cbinfo); -} - -typedef void (*NativeSetter)( - v8::Local - , v8::Local - , const v8::PropertyCallbackInfo &); -#else -static -void GetterCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - GetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kGetterIndex).As()->Value())); - callback(property, cbinfo); -} - -typedef void (*NativeGetter) - (v8::Local, const v8::PropertyCallbackInfo &); - -static -void SetterCallbackWrapper( - v8::Local property - , v8::Local value - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - SetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kSetterIndex).As()->Value())); - callback(property, value, cbinfo); -} - -typedef void (*NativeSetter)( - v8::Local - , v8::Local - , const v8::PropertyCallbackInfo &); -#endif - -#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION -static -void PropertyGetterCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyGetterIndex) - .As()->Value())); - callback(property.As(), cbinfo); -} - -typedef void (*NativePropertyGetter) - (v8::Local, const v8::PropertyCallbackInfo &); - -static -void PropertySetterCallbackWrapper( - v8::Local property - , v8::Local value - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertySetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertySetterIndex) - .As()->Value())); - callback(property.As(), value, cbinfo); -} - -typedef void (*NativePropertySetter)( - v8::Local - , v8::Local - , const v8::PropertyCallbackInfo &); - -static -void PropertyEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyEnumeratorCallback callback = - reinterpret_cast(reinterpret_cast( - obj->GetInternalField(kPropertyEnumeratorIndex) - .As()->Value())); - callback(cbinfo); -} - -typedef void (*NativePropertyEnumerator) - (const v8::PropertyCallbackInfo &); - -static -void PropertyDeleterCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyDeleterIndex) - .As()->Value())); - callback(property.As(), cbinfo); -} - -typedef void (NativePropertyDeleter) - (v8::Local, const v8::PropertyCallbackInfo &); - -static -void PropertyQueryCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyQueryIndex) - .As()->Value())); - callback(property.As(), cbinfo); -} - -typedef void (*NativePropertyQuery) - (v8::Local, const v8::PropertyCallbackInfo &); -#else -static -void PropertyGetterCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyGetterIndex) - .As()->Value())); - callback(property, cbinfo); -} - -typedef void (*NativePropertyGetter) - (v8::Local, const v8::PropertyCallbackInfo &); - -static -void PropertySetterCallbackWrapper( - v8::Local property - , v8::Local value - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertySetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertySetterIndex) - .As()->Value())); - callback(property, value, cbinfo); -} - -typedef void (*NativePropertySetter)( - v8::Local - , v8::Local - , const v8::PropertyCallbackInfo &); - -static -void PropertyEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyEnumeratorCallback callback = - reinterpret_cast(reinterpret_cast( - obj->GetInternalField(kPropertyEnumeratorIndex) - .As()->Value())); - callback(cbinfo); -} - -typedef void (*NativePropertyEnumerator) - (const v8::PropertyCallbackInfo &); - -static -void PropertyDeleterCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyDeleterIndex) - .As()->Value())); - callback(property, cbinfo); -} - -typedef void (NativePropertyDeleter) - (v8::Local, const v8::PropertyCallbackInfo &); - -static -void PropertyQueryCallbackWrapper( - v8::Local property - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyQueryIndex) - .As()->Value())); - callback(property, cbinfo); -} - -typedef void (*NativePropertyQuery) - (v8::Local, const v8::PropertyCallbackInfo &); -#endif - -static -void IndexGetterCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyGetterIndex) - .As()->Value())); - callback(index, cbinfo); -} - -typedef void (*NativeIndexGetter) - (uint32_t, const v8::PropertyCallbackInfo &); - -static -void IndexSetterCallbackWrapper( - uint32_t index - , v8::Local value - , const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexSetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertySetterIndex) - .As()->Value())); - callback(index, value, cbinfo); -} - -typedef void (*NativeIndexSetter)( - uint32_t - , v8::Local - , const v8::PropertyCallbackInfo &); - -static -void IndexEnumeratorCallbackWrapper( - const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexEnumeratorCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField( - kIndexPropertyEnumeratorIndex).As()->Value())); - callback(cbinfo); -} - -typedef void (*NativeIndexEnumerator) - (const v8::PropertyCallbackInfo &); - -static -void IndexDeleterCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyDeleterIndex) - .As()->Value())); - callback(index, cbinfo); -} - -typedef void (*NativeIndexDeleter) - (uint32_t, const v8::PropertyCallbackInfo &); - -static -void IndexQueryCallbackWrapper( - uint32_t index, const v8::PropertyCallbackInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyQueryIndex) - .As()->Value())); - callback(index, cbinfo); -} - -typedef void (*NativeIndexQuery) - (uint32_t, const v8::PropertyCallbackInfo &); -} // end of namespace imp - -#endif // NAN_CALLBACKS_12_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_pre_12_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_pre_12_inl.h deleted file mode 100644 index c9ba49932..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_pre_12_inl.h +++ /dev/null @@ -1,520 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_CALLBACKS_PRE_12_INL_H_ -#define NAN_CALLBACKS_PRE_12_INL_H_ - -namespace imp { -template class ReturnValueImp; -} // end of namespace imp - -template -class ReturnValue { - v8::Isolate *isolate_; - v8::Persistent *value_; - friend class imp::ReturnValueImp; - - public: - template - explicit inline ReturnValue(v8::Isolate *isolate, v8::Persistent *p) : - isolate_(isolate), value_(p) {} - template - explicit inline ReturnValue(const ReturnValue& that) - : isolate_(that.isolate_), value_(that.value_) { - TYPE_CHECK(T, S); - } - - // Handle setters - template inline void Set(const v8::Local &handle) { - TYPE_CHECK(T, S); - value_->Dispose(); - *value_ = v8::Persistent::New(handle); - } - - template inline void Set(const Global &handle) { - TYPE_CHECK(T, S); - value_->Dispose(); - *value_ = v8::Persistent::New(handle.persistent); - const_cast &>(handle).Reset(); - } - - // Fast primitive setters - inline void Set(bool value) { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::Boolean); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::Boolean::New(value)); - } - - inline void Set(double i) { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::Number); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::Number::New(i)); - } - - inline void Set(int32_t i) { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::Integer); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::Int32::New(i)); - } - - inline void Set(uint32_t i) { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::Integer); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::Uint32::NewFromUnsigned(i)); - } - - // Fast JS primitive setters - inline void SetNull() { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::Primitive); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::Null()); - } - - inline void SetUndefined() { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::Primitive); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::Undefined()); - } - - inline void SetEmptyString() { - v8::HandleScope scope; - - TYPE_CHECK(T, v8::String); - value_->Dispose(); - *value_ = v8::Persistent::New(v8::String::Empty()); - } - - // Convenience getter for isolate - inline v8::Isolate *GetIsolate() const { - return isolate_; - } - - // Pointer setter: Uncompilable to prevent inadvertent misuse. - template - inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); } -}; - -template -class FunctionCallbackInfo { - const v8::Arguments &args_; - v8::Local data_; - ReturnValue return_value_; - v8::Persistent retval_; - - public: - explicit inline FunctionCallbackInfo( - const v8::Arguments &args - , v8::Local data) : - args_(args) - , data_(data) - , return_value_(args.GetIsolate(), &retval_) - , retval_(v8::Persistent::New(v8::Undefined())) {} - - inline ~FunctionCallbackInfo() { - retval_.Dispose(); - retval_.Clear(); - } - - inline ReturnValue GetReturnValue() const { - return ReturnValue(return_value_); - } - - inline v8::Local Callee() const { return args_.Callee(); } - inline v8::Local Data() const { return data_; } - inline v8::Local Holder() const { return args_.Holder(); } - inline bool IsConstructCall() const { return args_.IsConstructCall(); } - inline int Length() const { return args_.Length(); } - inline v8::Local operator[](int i) const { return args_[i]; } - inline v8::Local This() const { return args_.This(); } - inline v8::Isolate *GetIsolate() const { return args_.GetIsolate(); } - - - protected: - static const int kHolderIndex = 0; - static const int kIsolateIndex = 1; - static const int kReturnValueDefaultValueIndex = 2; - static const int kReturnValueIndex = 3; - static const int kDataIndex = 4; - static const int kCalleeIndex = 5; - static const int kContextSaveIndex = 6; - static const int kArgsLength = 7; - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo) -}; - -template -class PropertyCallbackInfoBase { - const v8::AccessorInfo &info_; - const v8::Local data_; - - public: - explicit inline PropertyCallbackInfoBase( - const v8::AccessorInfo &info - , const v8::Local data) : - info_(info) - , data_(data) {} - - inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); } - inline v8::Local Data() const { return data_; } - inline v8::Local This() const { return info_.This(); } - inline v8::Local Holder() const { return info_.Holder(); } - - protected: - static const int kHolderIndex = 0; - static const int kIsolateIndex = 1; - static const int kReturnValueDefaultValueIndex = 2; - static const int kReturnValueIndex = 3; - static const int kDataIndex = 4; - static const int kThisIndex = 5; - static const int kArgsLength = 6; - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfoBase) -}; - -template -class PropertyCallbackInfo : public PropertyCallbackInfoBase { - ReturnValue return_value_; - v8::Persistent retval_; - - public: - explicit inline PropertyCallbackInfo( - const v8::AccessorInfo &info - , const v8::Local data) : - PropertyCallbackInfoBase(info, data) - , return_value_(info.GetIsolate(), &retval_) - , retval_(v8::Persistent::New(v8::Undefined())) {} - - inline ~PropertyCallbackInfo() { - retval_.Dispose(); - retval_.Clear(); - } - - inline ReturnValue GetReturnValue() const { return return_value_; } -}; - -template<> -class PropertyCallbackInfo : - public PropertyCallbackInfoBase { - ReturnValue return_value_; - v8::Persistent retval_; - - public: - explicit inline PropertyCallbackInfo( - const v8::AccessorInfo &info - , const v8::Local data) : - PropertyCallbackInfoBase(info, data) - , return_value_(info.GetIsolate(), &retval_) - , retval_(v8::Persistent::New(v8::Local())) {} - - inline ~PropertyCallbackInfo() { - retval_.Dispose(); - retval_.Clear(); - } - - inline ReturnValue GetReturnValue() const { - return return_value_; - } -}; - -template<> -class PropertyCallbackInfo : - public PropertyCallbackInfoBase { - ReturnValue return_value_; - v8::Persistent retval_; - - public: - explicit inline PropertyCallbackInfo( - const v8::AccessorInfo &info - , const v8::Local data) : - PropertyCallbackInfoBase(info, data) - , return_value_(info.GetIsolate(), &retval_) - , retval_(v8::Persistent::New(v8::Local())) {} - - inline ~PropertyCallbackInfo() { - retval_.Dispose(); - retval_.Clear(); - } - - inline ReturnValue GetReturnValue() const { - return return_value_; - } -}; - -template<> -class PropertyCallbackInfo : - public PropertyCallbackInfoBase { - ReturnValue return_value_; - v8::Persistent retval_; - - public: - explicit inline PropertyCallbackInfo( - const v8::AccessorInfo &info - , const v8::Local data) : - PropertyCallbackInfoBase(info, data) - , return_value_(info.GetIsolate(), &retval_) - , retval_(v8::Persistent::New(v8::Local())) {} - - inline ~PropertyCallbackInfo() { - retval_.Dispose(); - retval_.Clear(); - } - - inline ReturnValue GetReturnValue() const { - return return_value_; - } -}; - -namespace imp { -template -class ReturnValueImp : public ReturnValue { - public: - explicit ReturnValueImp(ReturnValue that) : - ReturnValue(that) {} - inline v8::Handle Value() { - return *ReturnValue::value_; - } -}; - -static -v8::Handle FunctionCallbackWrapper(const v8::Arguments &args) { - v8::Local obj = args.Data().As(); - FunctionCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kFunctionIndex).As()->Value())); - FunctionCallbackInfo - cbinfo(args, obj->GetInternalField(kDataIndex)); - callback(cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeFunction)(const v8::Arguments &); - -static -v8::Handle GetterCallbackWrapper( - v8::Local property, const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - GetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kGetterIndex).As()->Value())); - callback(property, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeGetter) - (v8::Local, const v8::AccessorInfo &); - -static -void SetterCallbackWrapper( - v8::Local property - , v8::Local value - , const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - SetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kSetterIndex).As()->Value())); - callback(property, value, cbinfo); -} - -typedef void (*NativeSetter) - (v8::Local, v8::Local, const v8::AccessorInfo &); - -static -v8::Handle PropertyGetterCallbackWrapper( - v8::Local property, const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyGetterIndex) - .As()->Value())); - callback(property, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativePropertyGetter) - (v8::Local, const v8::AccessorInfo &); - -static -v8::Handle PropertySetterCallbackWrapper( - v8::Local property - , v8::Local value - , const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertySetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertySetterIndex) - .As()->Value())); - callback(property, value, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativePropertySetter) - (v8::Local, v8::Local, const v8::AccessorInfo &); - -static -v8::Handle PropertyEnumeratorCallbackWrapper( - const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyEnumeratorCallback callback = - reinterpret_cast(reinterpret_cast( - obj->GetInternalField(kPropertyEnumeratorIndex) - .As()->Value())); - callback(cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativePropertyEnumerator) - (const v8::AccessorInfo &); - -static -v8::Handle PropertyDeleterCallbackWrapper( - v8::Local property - , const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyDeleterIndex) - .As()->Value())); - callback(property, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (NativePropertyDeleter) - (v8::Local, const v8::AccessorInfo &); - -static -v8::Handle PropertyQueryCallbackWrapper( - v8::Local property, const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - PropertyQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kPropertyQueryIndex) - .As()->Value())); - callback(property, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativePropertyQuery) - (v8::Local, const v8::AccessorInfo &); - -static -v8::Handle IndexGetterCallbackWrapper( - uint32_t index, const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexGetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyGetterIndex) - .As()->Value())); - callback(index, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeIndexGetter) - (uint32_t, const v8::AccessorInfo &); - -static -v8::Handle IndexSetterCallbackWrapper( - uint32_t index - , v8::Local value - , const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexSetterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertySetterIndex) - .As()->Value())); - callback(index, value, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeIndexSetter) - (uint32_t, v8::Local, const v8::AccessorInfo &); - -static -v8::Handle IndexEnumeratorCallbackWrapper( - const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexEnumeratorCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyEnumeratorIndex) - .As()->Value())); - callback(cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeIndexEnumerator) - (const v8::AccessorInfo &); - -static -v8::Handle IndexDeleterCallbackWrapper( - uint32_t index, const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexDeleterCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyDeleterIndex) - .As()->Value())); - callback(index, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeIndexDeleter) - (uint32_t, const v8::AccessorInfo &); - -static -v8::Handle IndexQueryCallbackWrapper( - uint32_t index, const v8::AccessorInfo &info) { - v8::Local obj = info.Data().As(); - PropertyCallbackInfo - cbinfo(info, obj->GetInternalField(kDataIndex)); - IndexQueryCallback callback = reinterpret_cast( - reinterpret_cast( - obj->GetInternalField(kIndexPropertyQueryIndex) - .As()->Value())); - callback(index, cbinfo); - return ReturnValueImp(cbinfo.GetReturnValue()).Value(); -} - -typedef v8::Handle (*NativeIndexQuery) - (uint32_t, const v8::AccessorInfo &); -} // end of namespace imp - -#endif // NAN_CALLBACKS_PRE_12_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h deleted file mode 100644 index c0b327294..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters.h +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_CONVERTERS_H_ -#define NAN_CONVERTERS_H_ - -namespace imp { -template struct ToFactoryBase { - typedef MaybeLocal return_t; -}; -template struct ValueFactoryBase { typedef Maybe return_t; }; - -template struct ToFactory; - -template<> -struct ToFactory : ToFactoryBase { - static inline return_t convert(v8::Local val) { - if (val.IsEmpty() || !val->IsFunction()) return MaybeLocal(); - return MaybeLocal(val.As()); - } -}; - -#define X(TYPE) \ - template<> \ - struct ToFactory : ToFactoryBase { \ - static inline return_t convert(v8::Local val); \ - }; - -X(Boolean) -X(Number) -X(String) -X(Object) -X(Integer) -X(Uint32) -X(Int32) - -#undef X - -#define X(TYPE) \ - template<> \ - struct ToFactory : ValueFactoryBase { \ - static inline return_t convert(v8::Local val); \ - }; - -X(bool) -X(double) -X(int64_t) -X(uint32_t) -X(int32_t) - -#undef X -} // end of namespace imp - -template -inline -typename imp::ToFactory::return_t To(v8::Local val) { - return imp::ToFactory::convert(val); -} - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -# include "nan_converters_43_inl.h" -#else -# include "nan_converters_pre_43_inl.h" -#endif - -#endif // NAN_CONVERTERS_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h deleted file mode 100644 index 41b72deb3..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_43_inl.h +++ /dev/null @@ -1,68 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_CONVERTERS_43_INL_H_ -#define NAN_CONVERTERS_43_INL_H_ - -#define X(TYPE) \ -imp::ToFactory::return_t \ -imp::ToFactory::convert(v8::Local val) { \ - v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ - v8::EscapableHandleScope scope(isolate); \ - return scope.Escape( \ - val->To ## TYPE(isolate->GetCurrentContext()) \ - .FromMaybe(v8::Local())); \ -} - -X(Number) -X(String) -X(Object) -X(Integer) -X(Uint32) -X(Int32) -// V8 <= 7.0 -#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0) -X(Boolean) -#else -imp::ToFactory::return_t \ -imp::ToFactory::convert(v8::Local val) { \ - v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ - v8::EscapableHandleScope scope(isolate); \ - return scope.Escape(val->ToBoolean(isolate)); \ -} -#endif - -#undef X - -#define X(TYPE, NAME) \ -imp::ToFactory::return_t \ -imp::ToFactory::convert(v8::Local val) { \ - v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ - v8::HandleScope scope(isolate); \ - return val->NAME ## Value(isolate->GetCurrentContext()); \ -} - -X(double, Number) -X(int64_t, Integer) -X(uint32_t, Uint32) -X(int32_t, Int32) -// V8 <= 7.0 -#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0) -X(bool, Boolean) -#else -imp::ToFactory::return_t \ -imp::ToFactory::convert(v8::Local val) { \ - v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ - v8::HandleScope scope(isolate); \ - return Just(val->BooleanValue(isolate)); \ -} -#endif - -#undef X - -#endif // NAN_CONVERTERS_43_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_pre_43_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_pre_43_inl.h deleted file mode 100644 index ae0518aa3..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_converters_pre_43_inl.h +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_CONVERTERS_PRE_43_INL_H_ -#define NAN_CONVERTERS_PRE_43_INL_H_ - -#define X(TYPE) \ -imp::ToFactory::return_t \ -imp::ToFactory::convert(v8::Local val) { \ - return val->To ## TYPE(); \ -} - -X(Boolean) -X(Number) -X(String) -X(Object) -X(Integer) -X(Uint32) -X(Int32) - -#undef X - -#define X(TYPE, NAME) \ -imp::ToFactory::return_t \ -imp::ToFactory::convert(v8::Local val) { \ - return Just(val->NAME ## Value()); \ -} - -X(bool, Boolean) -X(double, Number) -X(int64_t, Integer) -X(uint32_t, Uint32) -X(int32_t, Int32) - -#undef X - -#endif // NAN_CONVERTERS_PRE_43_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_define_own_property_helper.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_define_own_property_helper.h deleted file mode 100644 index d710ef229..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_define_own_property_helper.h +++ /dev/null @@ -1,29 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_DEFINE_OWN_PROPERTY_HELPER_H_ -#define NAN_DEFINE_OWN_PROPERTY_HELPER_H_ - -namespace imp { - -inline Maybe DefineOwnPropertyHelper( - v8::PropertyAttribute current - , v8::Handle obj - , v8::Handle key - , v8::Handle value - , v8::PropertyAttribute attribs = v8::None) { - return !(current & v8::DontDelete) || // configurable OR - (!(current & v8::ReadOnly) && // writable AND - !((attribs ^ current) & ~v8::ReadOnly)) // same excluding RO - ? Just(obj->ForceSet(key, value, attribs)) - : Nothing(); -} - -} // end of namespace imp - -#endif // NAN_DEFINE_OWN_PROPERTY_HELPER_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h deleted file mode 100644 index 255293ac2..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_12_inl.h +++ /dev/null @@ -1,430 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_IMPLEMENTATION_12_INL_H_ -#define NAN_IMPLEMENTATION_12_INL_H_ -//============================================================================== -// node v0.11 implementation -//============================================================================== - -namespace imp { - -//=== Array ==================================================================== - -Factory::return_t -Factory::New() { - return v8::Array::New(v8::Isolate::GetCurrent()); -} - -Factory::return_t -Factory::New(int length) { - return v8::Array::New(v8::Isolate::GetCurrent(), length); -} - -//=== Boolean ================================================================== - -Factory::return_t -Factory::New(bool value) { - return v8::Boolean::New(v8::Isolate::GetCurrent(), value); -} - -//=== Boolean Object =========================================================== - -Factory::return_t -Factory::New(bool value) { -#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) - return v8::BooleanObject::New( - v8::Isolate::GetCurrent(), value).As(); -#else - return v8::BooleanObject::New(value).As(); -#endif -} - -//=== Context ================================================================== - -Factory::return_t -Factory::New( v8::ExtensionConfiguration* extensions - , v8::Local tmpl - , v8::Local obj) { - return v8::Context::New(v8::Isolate::GetCurrent(), extensions, tmpl, obj); -} - -//=== Date ===================================================================== - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -Factory::return_t -Factory::New(double value) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(v8::Date::New(isolate->GetCurrentContext(), value) - .FromMaybe(v8::Local()).As()); -} -#else -Factory::return_t -Factory::New(double value) { - return v8::Date::New(v8::Isolate::GetCurrent(), value).As(); -} -#endif - -//=== External ================================================================= - -Factory::return_t -Factory::New(void * value) { - return v8::External::New(v8::Isolate::GetCurrent(), value); -} - -//=== Function ================================================================= - -Factory::return_t -Factory::New( FunctionCallback callback - , v8::Local data) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::Local tpl = v8::ObjectTemplate::New(isolate); - tpl->SetInternalFieldCount(imp::kFunctionFieldCount); - v8::Local obj = NewInstance(tpl).ToLocalChecked(); - - obj->SetInternalField( - imp::kFunctionIndex - , v8::External::New(isolate, reinterpret_cast(callback))); - - v8::Local val = v8::Local::New(isolate, data); - - if (!val.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, val); - } - -#if NODE_MAJOR_VERSION >= 10 - v8::Local context = isolate->GetCurrentContext(); - v8::Local function = - v8::Function::New(context, imp::FunctionCallbackWrapper, obj) - .ToLocalChecked(); -#else - v8::Local function = - v8::Function::New(isolate, imp::FunctionCallbackWrapper, obj); -#endif - - return scope.Escape(function); -} - -//=== Function Template ======================================================== - -Factory::return_t -Factory::New( FunctionCallback callback - , v8::Local data - , v8::Local signature) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - if (callback) { - v8::EscapableHandleScope scope(isolate); - v8::Local tpl = v8::ObjectTemplate::New(isolate); - tpl->SetInternalFieldCount(imp::kFunctionFieldCount); - v8::Local obj = NewInstance(tpl).ToLocalChecked(); - - obj->SetInternalField( - imp::kFunctionIndex - , v8::External::New(isolate, reinterpret_cast(callback))); - v8::Local val = v8::Local::New(isolate, data); - - if (!val.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, val); - } - - return scope.Escape(v8::FunctionTemplate::New( isolate - , imp::FunctionCallbackWrapper - , obj - , signature)); - } else { - return v8::FunctionTemplate::New(isolate, 0, data, signature); - } -} - -//=== Number =================================================================== - -Factory::return_t -Factory::New(double value) { - return v8::Number::New(v8::Isolate::GetCurrent(), value); -} - -//=== Number Object ============================================================ - -Factory::return_t -Factory::New(double value) { - return v8::NumberObject::New( v8::Isolate::GetCurrent() - , value).As(); -} - -//=== Integer, Int32 and Uint32 ================================================ - -template -typename IntegerFactory::return_t -IntegerFactory::New(int32_t value) { - return To(T::New(v8::Isolate::GetCurrent(), value)); -} - -template -typename IntegerFactory::return_t -IntegerFactory::New(uint32_t value) { - return To(T::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); -} - -Factory::return_t -Factory::New(int32_t value) { - return To( - v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); -} - -Factory::return_t -Factory::New(uint32_t value) { - return To( - v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); -} - -//=== Object =================================================================== - -Factory::return_t -Factory::New() { - return v8::Object::New(v8::Isolate::GetCurrent()); -} - -//=== Object Template ========================================================== - -Factory::return_t -Factory::New() { - return v8::ObjectTemplate::New(v8::Isolate::GetCurrent()); -} - -//=== RegExp =================================================================== - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -Factory::return_t -Factory::New( - v8::Local pattern - , v8::RegExp::Flags flags) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape( - v8::RegExp::New(isolate->GetCurrentContext(), pattern, flags) - .FromMaybe(v8::Local())); -} -#else -Factory::return_t -Factory::New( - v8::Local pattern - , v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); -} -#endif - -//=== Script =================================================================== - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -Factory::return_t -Factory::New( v8::Local source) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::ScriptCompiler::Source src(source); - return scope.Escape( - v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src) - .FromMaybe(v8::Local())); -} - -Factory::return_t -Factory::New( v8::Local source - , v8::ScriptOrigin const& origin) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::ScriptCompiler::Source src(source, origin); - return scope.Escape( - v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src) - .FromMaybe(v8::Local())); -} -#else -Factory::return_t -Factory::New( v8::Local source) { - v8::ScriptCompiler::Source src(source); - return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); -} - -Factory::return_t -Factory::New( v8::Local source - , v8::ScriptOrigin const& origin) { - v8::ScriptCompiler::Source src(source, origin); - return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); -} -#endif - -//=== Signature ================================================================ - -Factory::return_t -Factory::New(Factory::FTH receiver) { - return v8::Signature::New(v8::Isolate::GetCurrent(), receiver); -} - -//=== String =================================================================== - -Factory::return_t -Factory::New() { - return v8::String::Empty(v8::Isolate::GetCurrent()); -} - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -Factory::return_t -Factory::New(const char * value, int length) { - return v8::String::NewFromUtf8( - v8::Isolate::GetCurrent(), value, v8::NewStringType::kNormal, length); -} - -Factory::return_t -Factory::New(std::string const& value) { - assert(value.size() <= INT_MAX && "string too long"); - return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), - value.data(), v8::NewStringType::kNormal, static_cast(value.size())); -} - -Factory::return_t -Factory::New(const uint16_t * value, int length) { - return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, - v8::NewStringType::kNormal, length); -} - -Factory::return_t -Factory::New(v8::String::ExternalStringResource * value) { - return v8::String::NewExternalTwoByte(v8::Isolate::GetCurrent(), value); -} - -Factory::return_t -Factory::New(ExternalOneByteStringResource * value) { - return v8::String::NewExternalOneByte(v8::Isolate::GetCurrent(), value); -} -#else -Factory::return_t -Factory::New(const char * value, int length) { - return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value, - v8::String::kNormalString, length); -} - -Factory::return_t -Factory::New( - std::string const& value) /* NOLINT(build/include_what_you_use) */ { - assert(value.size() <= INT_MAX && "string too long"); - return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value.data(), - v8::String::kNormalString, - static_cast(value.size())); -} - -Factory::return_t -Factory::New(const uint16_t * value, int length) { - return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, - v8::String::kNormalString, length); -} - -Factory::return_t -Factory::New(v8::String::ExternalStringResource * value) { - return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); -} - -Factory::return_t -Factory::New(ExternalOneByteStringResource * value) { - return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); -} -#endif - -//=== String Object ============================================================ - -// See https://github.com/nodejs/nan/pull/811#discussion_r224594980. -// Disable the warning as there is no way around it. -// TODO(bnoordhuis) Use isolate-based version in Node.js v12. -Factory::return_t -Factory::New(v8::Local value) { -// V8 > 7.0 -#if V8_MAJOR_VERSION > 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION > 0) - return v8::StringObject::New(v8::Isolate::GetCurrent(), value) - .As(); -#else -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - return v8::StringObject::New(value).As(); -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif -#ifdef _MSC_VER -#pragma warning(pop) -#endif -#endif -} - -//=== Unbound Script =========================================================== - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -Factory::return_t -Factory::New(v8::Local source) { - v8::ScriptCompiler::Source src(source); - return v8::ScriptCompiler::CompileUnboundScript( - v8::Isolate::GetCurrent(), &src); -} - -Factory::return_t -Factory::New( v8::Local source - , v8::ScriptOrigin const& origin) { - v8::ScriptCompiler::Source src(source, origin); - return v8::ScriptCompiler::CompileUnboundScript( - v8::Isolate::GetCurrent(), &src); -} -#else -Factory::return_t -Factory::New(v8::Local source) { - v8::ScriptCompiler::Source src(source); - return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src); -} - -Factory::return_t -Factory::New( v8::Local source - , v8::ScriptOrigin const& origin) { - v8::ScriptCompiler::Source src(source, origin); - return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src); -} -#endif - -} // end of namespace imp - -//=== Presistents and Handles ================================================== - -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION -template -inline v8::Local New(v8::Handle h) { - return v8::Local::New(v8::Isolate::GetCurrent(), h); -} -#endif - -template -inline v8::Local New(v8::Persistent const& p) { - return v8::Local::New(v8::Isolate::GetCurrent(), p); -} - -template -inline v8::Local New(Persistent const& p) { - return v8::Local::New(v8::Isolate::GetCurrent(), p); -} - -template -inline v8::Local New(Global const& p) { - return v8::Local::New(v8::Isolate::GetCurrent(), p); -} - -#endif // NAN_IMPLEMENTATION_12_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_pre_12_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_pre_12_inl.h deleted file mode 100644 index 1472421af..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_implementation_pre_12_inl.h +++ /dev/null @@ -1,263 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_IMPLEMENTATION_PRE_12_INL_H_ -#define NAN_IMPLEMENTATION_PRE_12_INL_H_ - -//============================================================================== -// node v0.10 implementation -//============================================================================== - -namespace imp { - -//=== Array ==================================================================== - -Factory::return_t -Factory::New() { - return v8::Array::New(); -} - -Factory::return_t -Factory::New(int length) { - return v8::Array::New(length); -} - -//=== Boolean ================================================================== - -Factory::return_t -Factory::New(bool value) { - return v8::Boolean::New(value)->ToBoolean(); -} - -//=== Boolean Object =========================================================== - -Factory::return_t -Factory::New(bool value) { - return v8::BooleanObject::New(value).As(); -} - -//=== Context ================================================================== - -Factory::return_t -Factory::New( v8::ExtensionConfiguration* extensions - , v8::Local tmpl - , v8::Local obj) { - v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); - v8::Local lctx = v8::Local::New(ctx); - ctx.Dispose(); - return lctx; -} - -//=== Date ===================================================================== - -Factory::return_t -Factory::New(double value) { - return v8::Date::New(value).As(); -} - -//=== External ================================================================= - -Factory::return_t -Factory::New(void * value) { - return v8::External::New(value); -} - -//=== Function ================================================================= - -Factory::return_t -Factory::New( FunctionCallback callback - , v8::Local data) { - v8::HandleScope scope; - - return scope.Close(Factory::New( - callback, data, v8::Local()) - ->GetFunction()); -} - - -//=== FunctionTemplate ========================================================= - -Factory::return_t -Factory::New( FunctionCallback callback - , v8::Local data - , v8::Local signature) { - if (callback) { - v8::HandleScope scope; - - v8::Local tpl = v8::ObjectTemplate::New(); - tpl->SetInternalFieldCount(imp::kFunctionFieldCount); - v8::Local obj = tpl->NewInstance(); - - obj->SetInternalField( - imp::kFunctionIndex - , v8::External::New(reinterpret_cast(callback))); - - v8::Local val = v8::Local::New(data); - - if (!val.IsEmpty()) { - obj->SetInternalField(imp::kDataIndex, val); - } - - // Note(agnat): Emulate length argument here. Unfortunately, I couldn't find - // a way. Have at it though... - return scope.Close( - v8::FunctionTemplate::New(imp::FunctionCallbackWrapper - , obj - , signature)); - } else { - return v8::FunctionTemplate::New(0, data, signature); - } -} - -//=== Number =================================================================== - -Factory::return_t -Factory::New(double value) { - return v8::Number::New(value); -} - -//=== Number Object ============================================================ - -Factory::return_t -Factory::New(double value) { - return v8::NumberObject::New(value).As(); -} - -//=== Integer, Int32 and Uint32 ================================================ - -template -typename IntegerFactory::return_t -IntegerFactory::New(int32_t value) { - return To(T::New(value)); -} - -template -typename IntegerFactory::return_t -IntegerFactory::New(uint32_t value) { - return To(T::NewFromUnsigned(value)); -} - -Factory::return_t -Factory::New(int32_t value) { - return To(v8::Uint32::NewFromUnsigned(value)); -} - -Factory::return_t -Factory::New(uint32_t value) { - return To(v8::Uint32::NewFromUnsigned(value)); -} - - -//=== Object =================================================================== - -Factory::return_t -Factory::New() { - return v8::Object::New(); -} - -//=== Object Template ========================================================== - -Factory::return_t -Factory::New() { - return v8::ObjectTemplate::New(); -} - -//=== RegExp =================================================================== - -Factory::return_t -Factory::New( - v8::Local pattern - , v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); -} - -//=== Script =================================================================== - -Factory::return_t -Factory::New( v8::Local source) { - return v8::Script::New(source); -} -Factory::return_t -Factory::New( v8::Local source - , v8::ScriptOrigin const& origin) { - return v8::Script::New(source, const_cast(&origin)); -} - -//=== Signature ================================================================ - -Factory::return_t -Factory::New(Factory::FTH receiver) { - return v8::Signature::New(receiver); -} - -//=== String =================================================================== - -Factory::return_t -Factory::New() { - return v8::String::Empty(); -} - -Factory::return_t -Factory::New(const char * value, int length) { - return v8::String::New(value, length); -} - -Factory::return_t -Factory::New( - std::string const& value) /* NOLINT(build/include_what_you_use) */ { - assert(value.size() <= INT_MAX && "string too long"); - return v8::String::New(value.data(), static_cast(value.size())); -} - -Factory::return_t -Factory::New(const uint16_t * value, int length) { - return v8::String::New(value, length); -} - -Factory::return_t -Factory::New(v8::String::ExternalStringResource * value) { - return v8::String::NewExternal(value); -} - -Factory::return_t -Factory::New(v8::String::ExternalAsciiStringResource * value) { - return v8::String::NewExternal(value); -} - -//=== String Object ============================================================ - -Factory::return_t -Factory::New(v8::Local value) { - return v8::StringObject::New(value).As(); -} - -} // end of namespace imp - -//=== Presistents and Handles ================================================== - -template -inline v8::Local New(v8::Handle h) { - return v8::Local::New(h); -} - -template -inline v8::Local New(v8::Persistent const& p) { - return v8::Local::New(p); -} - -template -inline v8::Local New(Persistent const& p) { - return v8::Local::New(p.persistent); -} - -template -inline v8::Local New(Global const& p) { - return v8::Local::New(p.persistent); -} - -#endif // NAN_IMPLEMENTATION_PRE_12_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h deleted file mode 100644 index 33ac8ba69..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_json.h +++ /dev/null @@ -1,166 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_JSON_H_ -#define NAN_JSON_H_ - -#if NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION -#define NAN_JSON_H_NEED_PARSE 1 -#else -#define NAN_JSON_H_NEED_PARSE 0 -#endif // NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION - -#if NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION -#define NAN_JSON_H_NEED_STRINGIFY 0 -#else -#define NAN_JSON_H_NEED_STRINGIFY 1 -#endif // NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION - -class JSON { - public: - JSON() { -#if NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY - Nan::HandleScope scope; - - Nan::MaybeLocal maybe_global_json = Nan::Get( - Nan::GetCurrentContext()->Global(), - Nan::New("JSON").ToLocalChecked() - ); - - assert(!maybe_global_json.IsEmpty() && "global JSON is empty"); - v8::Local val_global_json = maybe_global_json.ToLocalChecked(); - - assert(val_global_json->IsObject() && "global JSON is not an object"); - Nan::MaybeLocal maybe_obj_global_json = - Nan::To(val_global_json); - - assert(!maybe_obj_global_json.IsEmpty() && "global JSON object is empty"); - v8::Local global_json = maybe_obj_global_json.ToLocalChecked(); - -#if NAN_JSON_H_NEED_PARSE - Nan::MaybeLocal maybe_parse_method = Nan::Get( - global_json, Nan::New("parse").ToLocalChecked() - ); - - assert(!maybe_parse_method.IsEmpty() && "JSON.parse is empty"); - v8::Local parse_method = maybe_parse_method.ToLocalChecked(); - - assert(parse_method->IsFunction() && "JSON.parse is not a function"); - parse_cb_.Reset(parse_method.As()); -#endif // NAN_JSON_H_NEED_PARSE - -#if NAN_JSON_H_NEED_STRINGIFY - Nan::MaybeLocal maybe_stringify_method = Nan::Get( - global_json, Nan::New("stringify").ToLocalChecked() - ); - - assert(!maybe_stringify_method.IsEmpty() && "JSON.stringify is empty"); - v8::Local stringify_method = - maybe_stringify_method.ToLocalChecked(); - - assert( - stringify_method->IsFunction() && "JSON.stringify is not a function" - ); - stringify_cb_.Reset(stringify_method.As()); -#endif // NAN_JSON_H_NEED_STRINGIFY -#endif // NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY - } - - inline - Nan::MaybeLocal Parse(v8::Local json_string) { - Nan::EscapableHandleScope scope; -#if NAN_JSON_H_NEED_PARSE - return scope.Escape(parse(json_string)); -#else - Nan::MaybeLocal result; -#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION && \ - NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION - result = v8::JSON::Parse(json_string); -#else -#if NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION - v8::Local context_or_isolate = Nan::GetCurrentContext(); -#else - v8::Isolate* context_or_isolate = v8::Isolate::GetCurrent(); -#endif // NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION - result = v8::JSON::Parse(context_or_isolate, json_string); -#endif // NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION && - // NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION - if (result.IsEmpty()) return v8::Local(); - return scope.Escape(result.ToLocalChecked()); -#endif // NAN_JSON_H_NEED_PARSE - } - - inline - Nan::MaybeLocal Stringify(v8::Local json_object) { - Nan::EscapableHandleScope scope; - Nan::MaybeLocal result = -#if NAN_JSON_H_NEED_STRINGIFY - Nan::To(stringify(json_object)); -#else - v8::JSON::Stringify(Nan::GetCurrentContext(), json_object); -#endif // NAN_JSON_H_NEED_STRINGIFY - if (result.IsEmpty()) return v8::Local(); - return scope.Escape(result.ToLocalChecked()); - } - - inline - Nan::MaybeLocal Stringify(v8::Local json_object, - v8::Local gap) { - Nan::EscapableHandleScope scope; - Nan::MaybeLocal result = -#if NAN_JSON_H_NEED_STRINGIFY - Nan::To(stringify(json_object, gap)); -#else - v8::JSON::Stringify(Nan::GetCurrentContext(), json_object, gap); -#endif // NAN_JSON_H_NEED_STRINGIFY - if (result.IsEmpty()) return v8::Local(); - return scope.Escape(result.ToLocalChecked()); - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(JSON) -#if NAN_JSON_H_NEED_PARSE - Nan::Callback parse_cb_; -#endif // NAN_JSON_H_NEED_PARSE -#if NAN_JSON_H_NEED_STRINGIFY - Nan::Callback stringify_cb_; -#endif // NAN_JSON_H_NEED_STRINGIFY - -#if NAN_JSON_H_NEED_PARSE - inline v8::Local parse(v8::Local arg) { - assert(!parse_cb_.IsEmpty() && "parse_cb_ is empty"); - AsyncResource resource("nan:JSON.parse"); - return parse_cb_.Call(1, &arg, &resource).FromMaybe(v8::Local()); - } -#endif // NAN_JSON_H_NEED_PARSE - -#if NAN_JSON_H_NEED_STRINGIFY - inline v8::Local stringify(v8::Local arg) { - assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty"); - AsyncResource resource("nan:JSON.stringify"); - return stringify_cb_.Call(1, &arg, &resource) - .FromMaybe(v8::Local()); - } - - inline v8::Local stringify(v8::Local arg, - v8::Local gap) { - assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty"); - - v8::Local argv[] = { - arg, - Nan::Null(), - gap - }; - AsyncResource resource("nan:JSON.stringify"); - return stringify_cb_.Call(3, argv, &resource) - .FromMaybe(v8::Local()); - } -#endif // NAN_JSON_H_NEED_STRINGIFY -}; - -#endif // NAN_JSON_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h deleted file mode 100644 index c04ce30d2..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h +++ /dev/null @@ -1,356 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_MAYBE_43_INL_H_ -#define NAN_MAYBE_43_INL_H_ - -template -using MaybeLocal = v8::MaybeLocal; - -inline -MaybeLocal ToDetailString(v8::Local val) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(val->ToDetailString(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline -MaybeLocal ToArrayIndex(v8::Local val) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(val->ToArrayIndex(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline -Maybe Equals(v8::Local a, v8::Local(b)) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return a->Equals(isolate->GetCurrentContext(), b); -} - -inline -MaybeLocal NewInstance(v8::Local h) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(h->NewInstance(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline -MaybeLocal NewInstance( - v8::Local h - , int argc - , v8::Local argv[]) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv) - .FromMaybe(v8::Local())); -} - -inline -MaybeLocal NewInstance(v8::Local h) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(h->NewInstance(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - - -inline MaybeLocal GetFunction( - v8::Local t) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(t->GetFunction(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline Maybe Set( - v8::Local obj - , v8::Local key - , v8::Local value) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->Set(isolate->GetCurrentContext(), key, value); -} - -inline Maybe Set( - v8::Local obj - , uint32_t index - , v8::Local value) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->Set(isolate->GetCurrentContext(), index, value); -} - -#if NODE_MODULE_VERSION < NODE_4_0_MODULE_VERSION -#include "nan_define_own_property_helper.h" // NOLINT(build/include) -#endif - -inline Maybe DefineOwnProperty( - v8::Local obj - , v8::Local key - , v8::Local value - , v8::PropertyAttribute attribs = v8::None) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); -#if NODE_MODULE_VERSION >= NODE_4_0_MODULE_VERSION - return obj->DefineOwnProperty(isolate->GetCurrentContext(), key, value, - attribs); -#else - Maybe maybeCurrent = - obj->GetPropertyAttributes(isolate->GetCurrentContext(), key); - if (maybeCurrent.IsNothing()) { - return Nothing(); - } - v8::PropertyAttribute current = maybeCurrent.FromJust(); - return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs); -#endif -} - -NAN_DEPRECATED inline Maybe ForceSet( - v8::Local obj - , v8::Local key - , v8::Local value - , v8::PropertyAttribute attribs = v8::None) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); -#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION - return key->IsName() - ? obj->DefineOwnProperty(isolate->GetCurrentContext(), - key.As(), value, attribs) - : Nothing(); -#else - return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); -#endif -} - -inline MaybeLocal Get( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(obj->Get(isolate->GetCurrentContext(), key) - .FromMaybe(v8::Local())); -} - -inline -MaybeLocal Get(v8::Local obj, uint32_t index) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(obj->Get(isolate->GetCurrentContext(), index) - .FromMaybe(v8::Local())); -} - -inline v8::PropertyAttribute GetPropertyAttributes( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->GetPropertyAttributes(isolate->GetCurrentContext(), key) - .FromJust(); -} - -inline Maybe Has( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->Has(isolate->GetCurrentContext(), key); -} - -inline Maybe Has(v8::Local obj, uint32_t index) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->Has(isolate->GetCurrentContext(), index); -} - -inline Maybe Delete( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->Delete(isolate->GetCurrentContext(), key); -} - -inline -Maybe Delete(v8::Local obj, uint32_t index) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->Delete(isolate->GetCurrentContext(), index); -} - -inline -MaybeLocal GetPropertyNames(v8::Local obj) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(obj->GetPropertyNames(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline -MaybeLocal GetOwnPropertyNames(v8::Local obj) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(obj->GetOwnPropertyNames(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline Maybe SetPrototype( - v8::Local obj - , v8::Local prototype) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->SetPrototype(isolate->GetCurrentContext(), prototype); -} - -inline MaybeLocal ObjectProtoToString( - v8::Local obj) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(obj->ObjectProtoToString(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline Maybe HasOwnProperty( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->HasOwnProperty(isolate->GetCurrentContext(), key); -} - -inline Maybe HasRealNamedProperty( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->HasRealNamedProperty(isolate->GetCurrentContext(), key); -} - -inline Maybe HasRealIndexedProperty( - v8::Local obj - , uint32_t index) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->HasRealIndexedProperty(isolate->GetCurrentContext(), index); -} - -inline Maybe HasRealNamedCallbackProperty( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return obj->HasRealNamedCallbackProperty(isolate->GetCurrentContext(), key); -} - -inline MaybeLocal GetRealNamedPropertyInPrototypeChain( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(obj->GetRealNamedPropertyInPrototypeChain( - isolate->GetCurrentContext(), key) - .FromMaybe(v8::Local())); -} - -inline MaybeLocal GetRealNamedProperty( - v8::Local obj - , v8::Local key) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape( - obj->GetRealNamedProperty(isolate->GetCurrentContext(), key) - .FromMaybe(v8::Local())); -} - -inline MaybeLocal CallAsFunction( - v8::Local obj - , v8::Local recv - , int argc - , v8::Local argv[]) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape( - obj->CallAsFunction(isolate->GetCurrentContext(), recv, argc, argv) - .FromMaybe(v8::Local())); -} - -inline MaybeLocal CallAsConstructor( - v8::Local obj - , int argc, v8::Local argv[]) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape( - obj->CallAsConstructor(isolate->GetCurrentContext(), argc, argv) - .FromMaybe(v8::Local())); -} - -inline -MaybeLocal GetSourceLine(v8::Local msg) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(msg->GetSourceLine(isolate->GetCurrentContext()) - .FromMaybe(v8::Local())); -} - -inline Maybe GetLineNumber(v8::Local msg) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return msg->GetLineNumber(isolate->GetCurrentContext()); -} - -inline Maybe GetStartColumn(v8::Local msg) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return msg->GetStartColumn(isolate->GetCurrentContext()); -} - -inline Maybe GetEndColumn(v8::Local msg) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); - return msg->GetEndColumn(isolate->GetCurrentContext()); -} - -inline MaybeLocal CloneElementAt( - v8::Local array - , uint32_t index) { -#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::Local context = isolate->GetCurrentContext(); - v8::Local elem; - v8::Local obj; - if (!array->Get(context, index).ToLocal(&elem)) { - return scope.Escape(obj); - } - if (!elem->ToObject(context).ToLocal(&obj)) { - return scope.Escape(v8::Local()); - } - return scope.Escape(obj->Clone()); -#else - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(array->CloneElementAt(isolate->GetCurrentContext(), index) - .FromMaybe(v8::Local())); -#endif -} - -inline MaybeLocal Call( - v8::Local fun - , v8::Local recv - , int argc - , v8::Local argv[]) { - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - return scope.Escape(fun->Call(isolate->GetCurrentContext(), recv, argc, argv) - .FromMaybe(v8::Local())); -} - -#endif // NAN_MAYBE_43_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_pre_43_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_pre_43_inl.h deleted file mode 100644 index 83325ae08..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_pre_43_inl.h +++ /dev/null @@ -1,268 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_MAYBE_PRE_43_INL_H_ -#define NAN_MAYBE_PRE_43_INL_H_ - -template -class MaybeLocal { - public: - inline MaybeLocal() : val_(v8::Local()) {} - - template -# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION - inline - MaybeLocal(v8::Local that) : val_(that) {} // NOLINT(runtime/explicit) -# else - inline - MaybeLocal(v8::Local that) : // NOLINT(runtime/explicit) - val_(*reinterpret_cast*>(&that)) {} -# endif - - inline bool IsEmpty() const { return val_.IsEmpty(); } - - template - inline bool ToLocal(v8::Local *out) const { - *out = val_; - return !IsEmpty(); - } - - inline v8::Local ToLocalChecked() const { -#if defined(V8_ENABLE_CHECKS) - assert(!IsEmpty() && "ToLocalChecked is Empty"); -#endif // V8_ENABLE_CHECKS - return val_; - } - - template - inline v8::Local FromMaybe(v8::Local default_value) const { - return IsEmpty() ? default_value : v8::Local(val_); - } - - private: - v8::Local val_; -}; - -inline -MaybeLocal ToDetailString(v8::Handle val) { - return MaybeLocal(val->ToDetailString()); -} - -inline -MaybeLocal ToArrayIndex(v8::Handle val) { - return MaybeLocal(val->ToArrayIndex()); -} - -inline -Maybe Equals(v8::Handle a, v8::Handle(b)) { - return Just(a->Equals(b)); -} - -inline -MaybeLocal NewInstance(v8::Handle h) { - return MaybeLocal(h->NewInstance()); -} - -inline -MaybeLocal NewInstance( - v8::Local h - , int argc - , v8::Local argv[]) { - return MaybeLocal(h->NewInstance(argc, argv)); -} - -inline -MaybeLocal NewInstance(v8::Handle h) { - return MaybeLocal(h->NewInstance()); -} - -inline -MaybeLocal GetFunction(v8::Handle t) { - return MaybeLocal(t->GetFunction()); -} - -inline Maybe Set( - v8::Handle obj - , v8::Handle key - , v8::Handle value) { - return Just(obj->Set(key, value)); -} - -inline Maybe Set( - v8::Handle obj - , uint32_t index - , v8::Handle value) { - return Just(obj->Set(index, value)); -} - -#include "nan_define_own_property_helper.h" // NOLINT(build/include) - -inline Maybe DefineOwnProperty( - v8::Handle obj - , v8::Handle key - , v8::Handle value - , v8::PropertyAttribute attribs = v8::None) { - v8::PropertyAttribute current = obj->GetPropertyAttributes(key); - return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs); -} - -NAN_DEPRECATED inline Maybe ForceSet( - v8::Handle obj - , v8::Handle key - , v8::Handle value - , v8::PropertyAttribute attribs = v8::None) { - return Just(obj->ForceSet(key, value, attribs)); -} - -inline MaybeLocal Get( - v8::Handle obj - , v8::Handle key) { - return MaybeLocal(obj->Get(key)); -} - -inline MaybeLocal Get( - v8::Handle obj - , uint32_t index) { - return MaybeLocal(obj->Get(index)); -} - -inline Maybe GetPropertyAttributes( - v8::Handle obj - , v8::Handle key) { - return Just(obj->GetPropertyAttributes(key)); -} - -inline Maybe Has( - v8::Handle obj - , v8::Handle key) { - return Just(obj->Has(key)); -} - -inline Maybe Has( - v8::Handle obj - , uint32_t index) { - return Just(obj->Has(index)); -} - -inline Maybe Delete( - v8::Handle obj - , v8::Handle key) { - return Just(obj->Delete(key)); -} - -inline Maybe Delete( - v8::Handle obj - , uint32_t index) { - return Just(obj->Delete(index)); -} - -inline -MaybeLocal GetPropertyNames(v8::Handle obj) { - return MaybeLocal(obj->GetPropertyNames()); -} - -inline -MaybeLocal GetOwnPropertyNames(v8::Handle obj) { - return MaybeLocal(obj->GetOwnPropertyNames()); -} - -inline Maybe SetPrototype( - v8::Handle obj - , v8::Handle prototype) { - return Just(obj->SetPrototype(prototype)); -} - -inline MaybeLocal ObjectProtoToString( - v8::Handle obj) { - return MaybeLocal(obj->ObjectProtoToString()); -} - -inline Maybe HasOwnProperty( - v8::Handle obj - , v8::Handle key) { - return Just(obj->HasOwnProperty(key)); -} - -inline Maybe HasRealNamedProperty( - v8::Handle obj - , v8::Handle key) { - return Just(obj->HasRealNamedProperty(key)); -} - -inline Maybe HasRealIndexedProperty( - v8::Handle obj - , uint32_t index) { - return Just(obj->HasRealIndexedProperty(index)); -} - -inline Maybe HasRealNamedCallbackProperty( - v8::Handle obj - , v8::Handle key) { - return Just(obj->HasRealNamedCallbackProperty(key)); -} - -inline MaybeLocal GetRealNamedPropertyInPrototypeChain( - v8::Handle obj - , v8::Handle key) { - return MaybeLocal( - obj->GetRealNamedPropertyInPrototypeChain(key)); -} - -inline MaybeLocal GetRealNamedProperty( - v8::Handle obj - , v8::Handle key) { - return MaybeLocal(obj->GetRealNamedProperty(key)); -} - -inline MaybeLocal CallAsFunction( - v8::Handle obj - , v8::Handle recv - , int argc - , v8::Handle argv[]) { - return MaybeLocal(obj->CallAsFunction(recv, argc, argv)); -} - -inline MaybeLocal CallAsConstructor( - v8::Handle obj - , int argc - , v8::Local argv[]) { - return MaybeLocal(obj->CallAsConstructor(argc, argv)); -} - -inline -MaybeLocal GetSourceLine(v8::Handle msg) { - return MaybeLocal(msg->GetSourceLine()); -} - -inline Maybe GetLineNumber(v8::Handle msg) { - return Just(msg->GetLineNumber()); -} - -inline Maybe GetStartColumn(v8::Handle msg) { - return Just(msg->GetStartColumn()); -} - -inline Maybe GetEndColumn(v8::Handle msg) { - return Just(msg->GetEndColumn()); -} - -inline MaybeLocal CloneElementAt( - v8::Handle array - , uint32_t index) { - return MaybeLocal(array->CloneElementAt(index)); -} - -inline MaybeLocal Call( - v8::Local fun - , v8::Local recv - , int argc - , v8::Local argv[]) { - return MaybeLocal(fun->Call(recv, argc, argv)); -} - -#endif // NAN_MAYBE_PRE_43_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h deleted file mode 100644 index cdf8bbe40..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_new.h +++ /dev/null @@ -1,340 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_NEW_H_ -#define NAN_NEW_H_ - -namespace imp { // scnr - -// TODO(agnat): Generalize -template v8::Local To(v8::Local i); - -template <> -inline -v8::Local -To(v8::Local i) { - return Nan::To(i).ToLocalChecked(); -} - -template <> -inline -v8::Local -To(v8::Local i) { - return Nan::To(i).ToLocalChecked(); -} - -template <> -inline -v8::Local -To(v8::Local i) { - return Nan::To(i).ToLocalChecked(); -} - -template struct FactoryBase { - typedef v8::Local return_t; -}; - -template struct MaybeFactoryBase { - typedef MaybeLocal return_t; -}; - -template struct Factory; - -template <> -struct Factory : FactoryBase { - static inline return_t New(); - static inline return_t New(int length); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(bool value); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(bool value); -}; - -template <> -struct Factory : FactoryBase { - static inline - return_t - New( v8::ExtensionConfiguration* extensions = NULL - , v8::Local tmpl = v8::Local() - , v8::Local obj = v8::Local()); -}; - -template <> -struct Factory : MaybeFactoryBase { - static inline return_t New(double value); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(void *value); -}; - -template <> -struct Factory : FactoryBase { - static inline - return_t - New( FunctionCallback callback - , v8::Local data = v8::Local()); -}; - -template <> -struct Factory : FactoryBase { - static inline - return_t - New( FunctionCallback callback = NULL - , v8::Local data = v8::Local() - , v8::Local signature = v8::Local()); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(double value); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(double value); -}; - -template -struct IntegerFactory : FactoryBase { - typedef typename FactoryBase::return_t return_t; - static inline return_t New(int32_t value); - static inline return_t New(uint32_t value); -}; - -template <> -struct Factory : IntegerFactory {}; - -template <> -struct Factory : IntegerFactory {}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(int32_t value); - static inline return_t New(uint32_t value); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(); -}; - -template <> -struct Factory : MaybeFactoryBase { - static inline return_t New( - v8::Local pattern, v8::RegExp::Flags flags); -}; - -template <> -struct Factory : MaybeFactoryBase { - static inline return_t New( v8::Local source); - static inline return_t New( v8::Local source - , v8::ScriptOrigin const& origin); -}; - -template <> -struct Factory : FactoryBase { - typedef v8::Local FTH; - static inline return_t New(FTH receiver = FTH()); -}; - -template <> -struct Factory : MaybeFactoryBase { - static inline return_t New(); - static inline return_t New(const char *value, int length = -1); - static inline return_t New(const uint16_t *value, int length = -1); - static inline return_t New(std::string const& value); - - static inline return_t New(v8::String::ExternalStringResource * value); - static inline return_t New(ExternalOneByteStringResource * value); -}; - -template <> -struct Factory : FactoryBase { - static inline return_t New(v8::Local value); -}; - -} // end of namespace imp - -#if (NODE_MODULE_VERSION >= 12) - -namespace imp { - -template <> -struct Factory : MaybeFactoryBase { - static inline return_t New( v8::Local source); - static inline return_t New( v8::Local source - , v8::ScriptOrigin const& origin); -}; - -} // end of namespace imp - -# include "nan_implementation_12_inl.h" - -#else // NODE_MODULE_VERSION >= 12 - -# include "nan_implementation_pre_12_inl.h" - -#endif - -//=== API ====================================================================== - -template -typename imp::Factory::return_t -New() { - return imp::Factory::New(); -} - -template -typename imp::Factory::return_t -New(A0 arg0) { - return imp::Factory::New(arg0); -} - -template -typename imp::Factory::return_t -New(A0 arg0, A1 arg1) { - return imp::Factory::New(arg0, arg1); -} - -template -typename imp::Factory::return_t -New(A0 arg0, A1 arg1, A2 arg2) { - return imp::Factory::New(arg0, arg1, arg2); -} - -template -typename imp::Factory::return_t -New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) { - return imp::Factory::New(arg0, arg1, arg2, arg3); -} - -// Note(agnat): When passing overloaded function pointers to template functions -// as generic arguments the compiler needs help in picking the right overload. -// These two functions handle New and New with -// all argument variations. - -// v8::Function and v8::FunctionTemplate with one or two arguments -template -typename imp::Factory::return_t -New( FunctionCallback callback - , v8::Local data = v8::Local()) { - return imp::Factory::New(callback, data); -} - -// v8::Function and v8::FunctionTemplate with three arguments -template -typename imp::Factory::return_t -New( FunctionCallback callback - , v8::Local data = v8::Local() - , A2 a2 = A2()) { - return imp::Factory::New(callback, data, a2); -} - -// Convenience - -#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION -template inline v8::Local New(v8::Handle h); -#endif - -#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION -template - inline v8::Local New(v8::Persistent const& p); -#else -template inline v8::Local New(v8::Persistent const& p); -#endif -template -inline v8::Local New(Persistent const& p); -template -inline v8::Local New(Global const& p); - -inline -imp::Factory::return_t -New(bool value) { - return New(value); -} - -inline -imp::Factory::return_t -New(int32_t value) { - return New(value); -} - -inline -imp::Factory::return_t -New(uint32_t value) { - return New(value); -} - -inline -imp::Factory::return_t -New(double value) { - return New(value); -} - -inline -imp::Factory::return_t -New(std::string const& value) { // NOLINT(build/include_what_you_use) - return New(value); -} - -inline -imp::Factory::return_t -New(const char * value, int length) { - return New(value, length); -} - -inline -imp::Factory::return_t -New(const uint16_t * value, int length) { - return New(value, length); -} - -inline -imp::Factory::return_t -New(const char * value) { - return New(value); -} - -inline -imp::Factory::return_t -New(const uint16_t * value) { - return New(value); -} - -inline -imp::Factory::return_t -New(v8::String::ExternalStringResource * value) { - return New(value); -} - -inline -imp::Factory::return_t -New(ExternalOneByteStringResource * value) { - return New(value); -} - -inline -imp::Factory::return_t -New(v8::Local pattern, v8::RegExp::Flags flags) { - return New(pattern, flags); -} - -#endif // NAN_NEW_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h deleted file mode 100644 index 78712f9c6..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_object_wrap.h +++ /dev/null @@ -1,156 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_OBJECT_WRAP_H_ -#define NAN_OBJECT_WRAP_H_ - -class ObjectWrap { - public: - ObjectWrap() { - refs_ = 0; - } - - - virtual ~ObjectWrap() { - if (persistent().IsEmpty()) { - return; - } - - persistent().ClearWeak(); - persistent().Reset(); - } - - - template - static inline T* Unwrap(v8::Local object) { - assert(!object.IsEmpty()); - assert(object->InternalFieldCount() > 0); - // Cast to ObjectWrap before casting to T. A direct cast from void - // to T won't work right when T has more than one base class. - void* ptr = GetInternalFieldPointer(object, 0); - ObjectWrap* wrap = static_cast(ptr); - return static_cast(wrap); - } - - - inline v8::Local handle() const { - return New(handle_); - } - - - inline Persistent& persistent() { - return handle_; - } - - - protected: - inline void Wrap(v8::Local object) { - assert(persistent().IsEmpty()); - assert(object->InternalFieldCount() > 0); - SetInternalFieldPointer(object, 0, this); - persistent().Reset(object); - MakeWeak(); - } - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - - inline void MakeWeak() { - persistent().v8::PersistentBase::SetWeak( - this, WeakCallback, v8::WeakCallbackType::kParameter); -#if NODE_MAJOR_VERSION < 10 - // FIXME(bnoordhuis) Probably superfluous in older Node.js versions too. - persistent().MarkIndependent(); -#endif - } - -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - - inline void MakeWeak() { - persistent().v8::PersistentBase::SetWeak(this, WeakCallback); - persistent().MarkIndependent(); - } - -#else - - inline void MakeWeak() { - persistent().persistent.MakeWeak(this, WeakCallback); - persistent().MarkIndependent(); - } - -#endif - - /* Ref() marks the object as being attached to an event loop. - * Refed objects will not be garbage collected, even if - * all references are lost. - */ - virtual void Ref() { - assert(!persistent().IsEmpty()); - persistent().ClearWeak(); - refs_++; - } - - /* Unref() marks an object as detached from the event loop. This is its - * default state. When an object with a "weak" reference changes from - * attached to detached state it will be freed. Be careful not to access - * the object after making this call as it might be gone! - * (A "weak reference" means an object that only has a - * persistent handle.) - * - * DO NOT CALL THIS FROM DESTRUCTOR - */ - virtual void Unref() { - assert(!persistent().IsEmpty()); - assert(!persistent().IsWeak()); - assert(refs_ > 0); - if (--refs_ == 0) - MakeWeak(); - } - - int refs_; // ro - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap) -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - - static void - WeakCallback(v8::WeakCallbackInfo const& info) { - ObjectWrap* wrap = info.GetParameter(); - assert(wrap->refs_ == 0); - wrap->handle_.Reset(); - delete wrap; - } - -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - - static void - WeakCallback(v8::WeakCallbackData const& data) { - ObjectWrap* wrap = data.GetParameter(); - assert(wrap->refs_ == 0); - assert(wrap->handle_.IsNearDeath()); - wrap->handle_.Reset(); - delete wrap; - } - -#else - - static void WeakCallback(v8::Persistent value, void *data) { - ObjectWrap *wrap = static_cast(data); - assert(wrap->refs_ == 0); - assert(wrap->handle_.IsNearDeath()); - wrap->handle_.Reset(); - delete wrap; - } - -#endif - Persistent handle_; -}; - - -#endif // NAN_OBJECT_WRAP_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h deleted file mode 100644 index d9649e867..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_12_inl.h +++ /dev/null @@ -1,132 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_PERSISTENT_12_INL_H_ -#define NAN_PERSISTENT_12_INL_H_ - -template class Persistent : - public v8::Persistent { - public: - inline Persistent() : v8::Persistent() {} - - template inline Persistent(v8::Local that) : - v8::Persistent(v8::Isolate::GetCurrent(), that) {} - - template - inline - Persistent(const v8::Persistent &that) : // NOLINT(runtime/explicit) - v8::Persistent(v8::Isolate::GetCurrent(), that) {} - - inline void Reset() { v8::PersistentBase::Reset(); } - - template - inline void Reset(const v8::Local &other) { - v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); - } - - template - inline void Reset(const v8::PersistentBase &other) { - v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); - } - - template - inline void SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type); - - private: - inline T *operator*() const { return *PersistentBase::persistent; } - - template - inline void Copy(const Persistent &that) { - TYPE_CHECK(T, S); - - this->Reset(); - - if (!that.IsEmpty()) { - this->Reset(that); - M::Copy(that, this); - } - } -}; - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -template -class Global : public v8::Global { - public: - inline Global() : v8::Global() {} - - template inline Global(v8::Local that) : - v8::Global(v8::Isolate::GetCurrent(), that) {} - - template - inline - Global(const v8::PersistentBase &that) : // NOLINT(runtime/explicit) - v8::Global(v8::Isolate::GetCurrent(), that) {} - - inline void Reset() { v8::PersistentBase::Reset(); } - - template - inline void Reset(const v8::Local &other) { - v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); - } - - template - inline void Reset(const v8::PersistentBase &other) { - v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); - } - - template - inline void SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - reinterpret_cast*>(this)->SetWeak( - parameter, callback, type); - } -}; -#else -template -class Global : public v8::UniquePersistent { - public: - inline Global() : v8::UniquePersistent() {} - - template inline Global(v8::Local that) : - v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} - - template - inline - Global(const v8::PersistentBase &that) : // NOLINT(runtime/explicit) - v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} - - inline void Reset() { v8::PersistentBase::Reset(); } - - template - inline void Reset(const v8::Local &other) { - v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); - } - - template - inline void Reset(const v8::PersistentBase &other) { - v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); - } - - template - inline void SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - reinterpret_cast*>(this)->SetWeak( - parameter, callback, type); - } -}; -#endif - -#endif // NAN_PERSISTENT_12_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_pre_12_inl.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_pre_12_inl.h deleted file mode 100644 index 4c9c59da7..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_persistent_pre_12_inl.h +++ /dev/null @@ -1,242 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_PERSISTENT_PRE_12_INL_H_ -#define NAN_PERSISTENT_PRE_12_INL_H_ - -template -class PersistentBase { - v8::Persistent persistent; - template - friend v8::Local New(const PersistentBase &p); - template - friend v8::Local New(const Persistent &p); - template - friend v8::Local New(const Global &p); - template friend class ReturnValue; - - public: - inline PersistentBase() : - persistent() {} - - inline void Reset() { - persistent.Dispose(); - persistent.Clear(); - } - - template - inline void Reset(const v8::Local &other) { - TYPE_CHECK(T, S); - - if (!persistent.IsEmpty()) { - persistent.Dispose(); - } - - if (other.IsEmpty()) { - persistent.Clear(); - } else { - persistent = v8::Persistent::New(other); - } - } - - template - inline void Reset(const PersistentBase &other) { - TYPE_CHECK(T, S); - - if (!persistent.IsEmpty()) { - persistent.Dispose(); - } - - if (other.IsEmpty()) { - persistent.Clear(); - } else { - persistent = v8::Persistent::New(other.persistent); - } - } - - inline bool IsEmpty() const { return persistent.IsEmpty(); } - - inline void Empty() { persistent.Clear(); } - - template - inline bool operator==(const PersistentBase &that) const { - return this->persistent == that.persistent; - } - - template - inline bool operator==(const v8::Local &that) const { - return this->persistent == that; - } - - template - inline bool operator!=(const PersistentBase &that) const { - return !operator==(that); - } - - template - inline bool operator!=(const v8::Local &that) const { - return !operator==(that); - } - - template - inline void SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type); - - inline void ClearWeak() { persistent.ClearWeak(); } - - inline void MarkIndependent() { persistent.MarkIndependent(); } - - inline bool IsIndependent() const { return persistent.IsIndependent(); } - - inline bool IsNearDeath() const { return persistent.IsNearDeath(); } - - inline bool IsWeak() const { return persistent.IsWeak(); } - - private: - inline explicit PersistentBase(v8::Persistent that) : - persistent(that) { } - inline explicit PersistentBase(T *val) : persistent(val) {} - template friend class Persistent; - template friend class Global; - friend class ObjectWrap; -}; - -template -class NonCopyablePersistentTraits { - public: - typedef Persistent > - NonCopyablePersistent; - static const bool kResetInDestructor = false; - template - inline static void Copy(const Persistent &source, - NonCopyablePersistent *dest) { - Uncompilable(); - } - - template inline static void Uncompilable() { - TYPE_CHECK(O, v8::Primitive); - } -}; - -template -struct CopyablePersistentTraits { - typedef Persistent > CopyablePersistent; - static const bool kResetInDestructor = true; - template - static inline void Copy(const Persistent &source, - CopyablePersistent *dest) {} -}; - -template class Persistent : - public PersistentBase { - public: - inline Persistent() {} - - template inline Persistent(v8::Handle that) - : PersistentBase(v8::Persistent::New(that)) { - TYPE_CHECK(T, S); - } - - inline Persistent(const Persistent &that) : PersistentBase() { - Copy(that); - } - - template - inline Persistent(const Persistent &that) : - PersistentBase() { - Copy(that); - } - - inline Persistent &operator=(const Persistent &that) { - Copy(that); - return *this; - } - - template - inline Persistent &operator=(const Persistent &that) { - Copy(that); - return *this; - } - - inline ~Persistent() { - if (M::kResetInDestructor) this->Reset(); - } - - private: - inline T *operator*() const { return *PersistentBase::persistent; } - - template - inline void Copy(const Persistent &that) { - TYPE_CHECK(T, S); - - this->Reset(); - - if (!that.IsEmpty()) { - this->persistent = v8::Persistent::New(that.persistent); - M::Copy(that, this); - } - } -}; - -template -class Global : public PersistentBase { - struct RValue { - inline explicit RValue(Global* obj) : object(obj) {} - Global* object; - }; - - public: - inline Global() : PersistentBase(0) { } - - template - inline Global(v8::Local that) // NOLINT(runtime/explicit) - : PersistentBase(v8::Persistent::New(that)) { - TYPE_CHECK(T, S); - } - - template - inline Global(const PersistentBase &that) // NOLINT(runtime/explicit) - : PersistentBase(that) { - TYPE_CHECK(T, S); - } - /** - * Move constructor. - */ - inline Global(RValue rvalue) // NOLINT(runtime/explicit) - : PersistentBase(rvalue.object->persistent) { - rvalue.object->Reset(); - } - inline ~Global() { this->Reset(); } - /** - * Move via assignment. - */ - template - inline Global &operator=(Global rhs) { - TYPE_CHECK(T, S); - this->Reset(rhs.persistent); - rhs.Reset(); - return *this; - } - /** - * Cast operator for moves. - */ - inline operator RValue() { return RValue(this); } - /** - * Pass allows returning uniques from functions, etc. - */ - Global Pass() { return Global(RValue(this)); } - - private: - Global(Global &); - void operator=(Global &); - template friend class ReturnValue; -}; - -#endif // NAN_PERSISTENT_PRE_12_INL_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h deleted file mode 100644 index 15f44cc8c..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_private.h +++ /dev/null @@ -1,73 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_PRIVATE_H_ -#define NAN_PRIVATE_H_ - -inline Maybe -HasPrivate(v8::Local object, v8::Local key) { - HandleScope scope; -#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); - v8::Local private_key = v8::Private::ForApi(isolate, key); - return object->HasPrivate(context, private_key); -#else - return Just(!object->GetHiddenValue(key).IsEmpty()); -#endif -} - -inline MaybeLocal -GetPrivate(v8::Local object, v8::Local key) { -#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::EscapableHandleScope scope(isolate); - v8::Local context = isolate->GetCurrentContext(); - v8::Local private_key = v8::Private::ForApi(isolate, key); - v8::MaybeLocal v = object->GetPrivate(context, private_key); - return scope.Escape(v.ToLocalChecked()); -#else - EscapableHandleScope scope; - v8::Local v = object->GetHiddenValue(key); - if (v.IsEmpty()) { - v = Undefined(); - } - return scope.Escape(v); -#endif -} - -inline Maybe SetPrivate( - v8::Local object, - v8::Local key, - v8::Local value) { -#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION - HandleScope scope; - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); - v8::Local private_key = v8::Private::ForApi(isolate, key); - return object->SetPrivate(context, private_key, value); -#else - return Just(object->SetHiddenValue(key, value)); -#endif -} - -inline Maybe DeletePrivate( - v8::Local object, - v8::Local key) { -#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION - HandleScope scope; - v8::Isolate *isolate = v8::Isolate::GetCurrent(); - v8::Local private_key = v8::Private::ForApi(isolate, key); - return object->DeletePrivate(isolate->GetCurrentContext(), private_key); -#else - return Just(object->DeleteHiddenValue(key)); -#endif -} - -#endif // NAN_PRIVATE_H_ - diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h deleted file mode 100644 index ce79cdf8d..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2021 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_SCRIPTORIGIN_H_ -#define NAN_SCRIPTORIGIN_H_ - -class ScriptOrigin : public v8::ScriptOrigin { - public: -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 9 || \ - (V8_MAJOR_VERSION == 9 && (defined(V8_MINOR_VERSION) && (V8_MINOR_VERSION > 0\ - || (V8_MINOR_VERSION == 0 && defined(V8_BUILD_NUMBER) \ - && V8_BUILD_NUMBER >= 1))))) - explicit ScriptOrigin(v8::Local name) : - v8::ScriptOrigin(v8::Isolate::GetCurrent(), name) {} - - ScriptOrigin(v8::Local name - , v8::Local line) : - v8::ScriptOrigin(v8::Isolate::GetCurrent() - , name - , To(line).FromMaybe(0)) {} - - ScriptOrigin(v8::Local name - , v8::Local line - , v8::Local column) : - v8::ScriptOrigin(v8::Isolate::GetCurrent() - , name - , To(line).FromMaybe(0) - , To(column).FromMaybe(0)) {} -#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 8 || \ - (V8_MAJOR_VERSION == 8 && (defined(V8_MINOR_VERSION) && (V8_MINOR_VERSION > 9\ - || (V8_MINOR_VERSION == 9 && defined(V8_BUILD_NUMBER) \ - && V8_BUILD_NUMBER >= 45))))) - explicit ScriptOrigin(v8::Local name) : v8::ScriptOrigin(name) {} - - ScriptOrigin(v8::Local name - , v8::Local line) : - v8::ScriptOrigin(name, To(line).FromMaybe(0)) {} - - ScriptOrigin(v8::Local name - , v8::Local line - , v8::Local column) : - v8::ScriptOrigin(name - , To(line).FromMaybe(0) - , To(column).FromMaybe(0)) {} -#else - explicit ScriptOrigin(v8::Local name) : v8::ScriptOrigin(name) {} - - ScriptOrigin(v8::Local name - , v8::Local line) : v8::ScriptOrigin(name, line) {} - - ScriptOrigin(v8::Local name - , v8::Local line - , v8::Local column) : - v8::ScriptOrigin(name, line, column) {} -#endif - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 8 || \ - (V8_MAJOR_VERSION == 8 && (defined(V8_MINOR_VERSION) && (V8_MINOR_VERSION > 9\ - || (V8_MINOR_VERSION == 9 && defined(V8_BUILD_NUMBER) \ - && V8_BUILD_NUMBER >= 45))))) - v8::Local ResourceLineOffset() const { - return New(LineOffset()); - } - - v8::Local ResourceColumnOffset() const { - return New(ColumnOffset()); - } -#endif -}; - -#endif // NAN_SCRIPTORIGIN_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_string_bytes.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_string_bytes.h deleted file mode 100644 index a2e6437d1..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_string_bytes.h +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -#ifndef NAN_STRING_BYTES_H_ -#define NAN_STRING_BYTES_H_ - -// Decodes a v8::Local or Buffer to a raw char* - -namespace imp { - -using v8::Local; -using v8::Object; -using v8::String; -using v8::Value; - - -//// Base 64 //// - -#define base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) - - - -//// HEX //// - -static bool contains_non_ascii_slow(const char* buf, size_t len) { - for (size_t i = 0; i < len; ++i) { - if (buf[i] & 0x80) return true; - } - return false; -} - - -static bool contains_non_ascii(const char* src, size_t len) { - if (len < 16) { - return contains_non_ascii_slow(src, len); - } - - const unsigned bytes_per_word = sizeof(void*); - const unsigned align_mask = bytes_per_word - 1; - const unsigned unaligned = reinterpret_cast(src) & align_mask; - - if (unaligned > 0) { - const unsigned n = bytes_per_word - unaligned; - if (contains_non_ascii_slow(src, n)) return true; - src += n; - len -= n; - } - - -#if defined(__x86_64__) || defined(_WIN64) - const uintptr_t mask = 0x8080808080808080ll; -#else - const uintptr_t mask = 0x80808080l; -#endif - - const uintptr_t* srcw = reinterpret_cast(src); - - for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { - if (srcw[i] & mask) return true; - } - - const unsigned remainder = len & align_mask; - if (remainder > 0) { - const size_t offset = len - remainder; - if (contains_non_ascii_slow(src + offset, remainder)) return true; - } - - return false; -} - - -static void force_ascii_slow(const char* src, char* dst, size_t len) { - for (size_t i = 0; i < len; ++i) { - dst[i] = src[i] & 0x7f; - } -} - - -static void force_ascii(const char* src, char* dst, size_t len) { - if (len < 16) { - force_ascii_slow(src, dst, len); - return; - } - - const unsigned bytes_per_word = sizeof(void*); - const unsigned align_mask = bytes_per_word - 1; - const unsigned src_unalign = reinterpret_cast(src) & align_mask; - const unsigned dst_unalign = reinterpret_cast(dst) & align_mask; - - if (src_unalign > 0) { - if (src_unalign == dst_unalign) { - const unsigned unalign = bytes_per_word - src_unalign; - force_ascii_slow(src, dst, unalign); - src += unalign; - dst += unalign; - len -= src_unalign; - } else { - force_ascii_slow(src, dst, len); - return; - } - } - -#if defined(__x86_64__) || defined(_WIN64) - const uintptr_t mask = ~0x8080808080808080ll; -#else - const uintptr_t mask = ~0x80808080l; -#endif - - const uintptr_t* srcw = reinterpret_cast(src); - uintptr_t* dstw = reinterpret_cast(dst); - - for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { - dstw[i] = srcw[i] & mask; - } - - const unsigned remainder = len & align_mask; - if (remainder > 0) { - const size_t offset = len - remainder; - force_ascii_slow(src + offset, dst + offset, remainder); - } -} - - -static size_t base64_encode(const char* src, - size_t slen, - char* dst, - size_t dlen) { - // We know how much we'll write, just make sure that there's space. - assert(dlen >= base64_encoded_size(slen) && - "not enough space provided for base64 encode"); - - dlen = base64_encoded_size(slen); - - unsigned a; - unsigned b; - unsigned c; - unsigned i; - unsigned k; - unsigned n; - - static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - - i = 0; - k = 0; - n = slen / 3 * 3; - - while (i < n) { - a = src[i + 0] & 0xff; - b = src[i + 1] & 0xff; - c = src[i + 2] & 0xff; - - dst[k + 0] = table[a >> 2]; - dst[k + 1] = table[((a & 3) << 4) | (b >> 4)]; - dst[k + 2] = table[((b & 0x0f) << 2) | (c >> 6)]; - dst[k + 3] = table[c & 0x3f]; - - i += 3; - k += 4; - } - - if (n != slen) { - switch (slen - n) { - case 1: - a = src[i + 0] & 0xff; - dst[k + 0] = table[a >> 2]; - dst[k + 1] = table[(a & 3) << 4]; - dst[k + 2] = '='; - dst[k + 3] = '='; - break; - - case 2: - a = src[i + 0] & 0xff; - b = src[i + 1] & 0xff; - dst[k + 0] = table[a >> 2]; - dst[k + 1] = table[((a & 3) << 4) | (b >> 4)]; - dst[k + 2] = table[(b & 0x0f) << 2]; - dst[k + 3] = '='; - break; - } - } - - return dlen; -} - - -static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) { - // We know how much we'll write, just make sure that there's space. - assert(dlen >= slen * 2 && - "not enough space provided for hex encode"); - - dlen = slen * 2; - for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) { - static const char hex[] = "0123456789abcdef"; - uint8_t val = static_cast(src[i]); - dst[k + 0] = hex[val >> 4]; - dst[k + 1] = hex[val & 15]; - } - - return dlen; -} - - - -static Local Encode(const char* buf, - size_t buflen, - enum Encoding encoding) { - assert(buflen <= node::Buffer::kMaxLength); - if (!buflen && encoding != BUFFER) - return New("").ToLocalChecked(); - - Local val; - switch (encoding) { - case BUFFER: - return CopyBuffer(buf, buflen).ToLocalChecked(); - - case ASCII: - if (contains_non_ascii(buf, buflen)) { - char* out = new char[buflen]; - force_ascii(buf, out, buflen); - val = New(out, buflen).ToLocalChecked(); - delete[] out; - } else { - val = New(buf, buflen).ToLocalChecked(); - } - break; - - case UTF8: - val = New(buf, buflen).ToLocalChecked(); - break; - - case BINARY: { - // TODO(isaacs) use ExternalTwoByteString? - const unsigned char *cbuf = reinterpret_cast(buf); - uint16_t * twobytebuf = new uint16_t[buflen]; - for (size_t i = 0; i < buflen; i++) { - // XXX is the following line platform independent? - twobytebuf[i] = cbuf[i]; - } - val = New(twobytebuf, buflen).ToLocalChecked(); - delete[] twobytebuf; - break; - } - - case BASE64: { - size_t dlen = base64_encoded_size(buflen); - char* dst = new char[dlen]; - - size_t written = base64_encode(buf, buflen, dst, dlen); - assert(written == dlen); - - val = New(dst, dlen).ToLocalChecked(); - delete[] dst; - break; - } - - case UCS2: { - const uint16_t* data = reinterpret_cast(buf); - val = New(data, buflen / 2).ToLocalChecked(); - break; - } - - case HEX: { - size_t dlen = buflen * 2; - char* dst = new char[dlen]; - size_t written = hex_encode(buf, buflen, dst, dlen); - assert(written == dlen); - - val = New(dst, dlen).ToLocalChecked(); - delete[] dst; - break; - } - - default: - assert(0 && "unknown encoding"); - break; - } - - return val; -} - -#undef base64_encoded_size - -} // end of namespace imp - -#endif // NAN_STRING_BYTES_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h deleted file mode 100644 index c6ac8a418..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_typedarray_contents.h +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_TYPEDARRAY_CONTENTS_H_ -#define NAN_TYPEDARRAY_CONTENTS_H_ - -template -class TypedArrayContents { - public: - inline explicit TypedArrayContents(v8::Local from) : - length_(0), data_(NULL) { - HandleScope scope; - - size_t length = 0; - void* data = NULL; - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - - if (from->IsArrayBufferView()) { - v8::Local array = - v8::Local::Cast(from); - - const size_t byte_length = array->ByteLength(); - const ptrdiff_t byte_offset = array->ByteOffset(); - v8::Local buffer = array->Buffer(); - - length = byte_length / sizeof(T); -// Actually it's 7.9 here but this would lead to ABI issues with Node.js 13 -// using 7.8 till 13.2.0. -#if (V8_MAJOR_VERSION >= 8) - data = static_cast(buffer->GetBackingStore()->Data()) + byte_offset; -#else - data = static_cast(buffer->GetContents().Data()) + byte_offset; -#endif - } - -#else - - if (from->IsObject() && !from->IsNull()) { - v8::Local array = v8::Local::Cast(from); - - MaybeLocal buffer = Get(array, - New("buffer").ToLocalChecked()); - MaybeLocal byte_length = Get(array, - New("byteLength").ToLocalChecked()); - MaybeLocal byte_offset = Get(array, - New("byteOffset").ToLocalChecked()); - - if (!buffer.IsEmpty() && - !byte_length.IsEmpty() && byte_length.ToLocalChecked()->IsUint32() && - !byte_offset.IsEmpty() && byte_offset.ToLocalChecked()->IsUint32()) { - data = array->GetIndexedPropertiesExternalArrayData(); - if(data) { - length = byte_length.ToLocalChecked()->Uint32Value() / sizeof(T); - } - } - } - -#endif - -#if defined(_MSC_VER) && _MSC_VER >= 1900 || __cplusplus >= 201103L - assert(reinterpret_cast(data) % alignof (T) == 0); -#elif defined(_MSC_VER) && _MSC_VER >= 1600 || defined(__GNUC__) - assert(reinterpret_cast(data) % __alignof(T) == 0); -#else - assert(reinterpret_cast(data) % sizeof (T) == 0); -#endif - - length_ = length; - data_ = static_cast(data); - } - - inline size_t length() const { return length_; } - inline T* operator*() { return data_; } - inline const T* operator*() const { return data_; } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(TypedArrayContents) - - //Disable heap allocation - void *operator new(size_t size); - void operator delete(void *, size_t) { - abort(); - } - - size_t length_; - T* data_; -}; - -#endif // NAN_TYPEDARRAY_CONTENTS_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h deleted file mode 100644 index 7e7ab07b8..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_weak.h +++ /dev/null @@ -1,437 +0,0 @@ -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -#ifndef NAN_WEAK_H_ -#define NAN_WEAK_H_ - -static const int kInternalFieldsInWeakCallback = 2; -static const int kNoInternalFieldIndex = -1; - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ - v8::WeakCallbackInfo > const& -# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ - NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ -#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION -# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ - v8::PhantomCallbackData > const& -# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ - NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ -#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION -# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ - v8::PhantomCallbackData > const& -# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ - v8::InternalFieldsCallbackData, void> const& -# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION -# define NAN_WEAK_CALLBACK_DATA_TYPE_ \ - v8::WeakCallbackData > const& -# define NAN_WEAK_CALLBACK_SIG_ NAN_WEAK_CALLBACK_DATA_TYPE_ -#else -# define NAN_WEAK_CALLBACK_DATA_TYPE_ void * -# define NAN_WEAK_CALLBACK_SIG_ \ - v8::Persistent, NAN_WEAK_CALLBACK_DATA_TYPE_ -#endif - -template -class WeakCallbackInfo { - public: - typedef void (*Callback)(const WeakCallbackInfo& data); - WeakCallbackInfo( - Persistent *persistent - , Callback callback - , void *parameter - , void *field1 = 0 - , void *field2 = 0) : - callback_(callback), isolate_(0), parameter_(parameter) { - std::memcpy(&persistent_, persistent, sizeof (v8::Persistent)); - internal_fields_[0] = field1; - internal_fields_[1] = field2; - } - inline v8::Isolate *GetIsolate() const { return isolate_; } - inline T *GetParameter() const { return static_cast(parameter_); } - inline void *GetInternalField(int index) const { - assert((index == 0 || index == 1) && "internal field index out of bounds"); - if (index == 0) { - return internal_fields_[0]; - } else { - return internal_fields_[1]; - } - } - - private: - NAN_DISALLOW_ASSIGN_COPY_MOVE(WeakCallbackInfo) - Callback callback_; - v8::Isolate *isolate_; - void *parameter_; - void *internal_fields_[kInternalFieldsInWeakCallback]; - v8::Persistent persistent_; - template friend class Persistent; - template friend class PersistentBase; -#if NODE_MODULE_VERSION <= NODE_0_12_MODULE_VERSION -# if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - template - static void invoke(NAN_WEAK_CALLBACK_SIG_ data); - template - static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data); -# else - static void invoke(NAN_WEAK_CALLBACK_SIG_ data); - static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data); -# endif -#else -# if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - template - static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data); - template - static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data); -# else - static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data); - static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data); -# endif - static WeakCallbackInfo *unwrapparameter( - NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data); - static WeakCallbackInfo *unwraptwofield( - NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data); -#endif -}; - - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) - -template -template -void -WeakCallbackInfo::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) { - WeakCallbackInfo *cbinfo = unwrapparameter(data); - if (isFirstPass) { - cbinfo->persistent_.Reset(); - data.SetSecondPassCallback(invokeparameter); - } else { - cbinfo->callback_(*cbinfo); - delete cbinfo; - } -} - -template -template -void -WeakCallbackInfo::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) { - WeakCallbackInfo *cbinfo = unwraptwofield(data); - if (isFirstPass) { - cbinfo->persistent_.Reset(); - data.SetSecondPassCallback(invoketwofield); - } else { - cbinfo->callback_(*cbinfo); - delete cbinfo; - } -} - -template -WeakCallbackInfo *WeakCallbackInfo::unwrapparameter( - NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) { - WeakCallbackInfo *cbinfo = - static_cast*>(data.GetParameter()); - cbinfo->isolate_ = data.GetIsolate(); - return cbinfo; -} - -template -WeakCallbackInfo *WeakCallbackInfo::unwraptwofield( - NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) { - WeakCallbackInfo *cbinfo = - static_cast*>(data.GetInternalField(0)); - cbinfo->isolate_ = data.GetIsolate(); - return cbinfo; -} - -#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_ -#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_ -#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ -# elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION - -template -void -WeakCallbackInfo::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) { - WeakCallbackInfo *cbinfo = unwrapparameter(data); - cbinfo->persistent_.Reset(); - cbinfo->callback_(*cbinfo); - delete cbinfo; -} - -template -void -WeakCallbackInfo::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) { - WeakCallbackInfo *cbinfo = unwraptwofield(data); - cbinfo->persistent_.Reset(); - cbinfo->callback_(*cbinfo); - delete cbinfo; -} - -template -WeakCallbackInfo *WeakCallbackInfo::unwrapparameter( - NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) { - WeakCallbackInfo *cbinfo = - static_cast*>(data.GetParameter()); - cbinfo->isolate_ = data.GetIsolate(); - return cbinfo; -} - -template -WeakCallbackInfo *WeakCallbackInfo::unwraptwofield( - NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) { - WeakCallbackInfo *cbinfo = - static_cast*>(data.GetInternalField1()); - cbinfo->isolate_ = data.GetIsolate(); - return cbinfo; -} - -#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_ -#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_ -#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ -#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION - -template -template -void WeakCallbackInfo::invoke(NAN_WEAK_CALLBACK_SIG_ data) { - WeakCallbackInfo *cbinfo = unwrap(data); - cbinfo->persistent_.Reset(); - cbinfo->callback_(*cbinfo); - delete cbinfo; -} - -template -template -WeakCallbackInfo *WeakCallbackInfo::unwrap( - NAN_WEAK_CALLBACK_DATA_TYPE_ data) { - void *parameter = data.GetParameter(); - WeakCallbackInfo *cbinfo = - static_cast*>(parameter); - cbinfo->isolate_ = data.GetIsolate(); - return cbinfo; -} - -#undef NAN_WEAK_CALLBACK_SIG_ -#undef NAN_WEAK_CALLBACK_DATA_TYPE_ -#else - -template -void WeakCallbackInfo::invoke(NAN_WEAK_CALLBACK_SIG_ data) { - WeakCallbackInfo *cbinfo = unwrap(data); - cbinfo->persistent_.Dispose(); - cbinfo->persistent_.Clear(); - cbinfo->callback_(*cbinfo); - delete cbinfo; -} - -template -WeakCallbackInfo *WeakCallbackInfo::unwrap( - NAN_WEAK_CALLBACK_DATA_TYPE_ data) { - WeakCallbackInfo *cbinfo = - static_cast*>(data); - cbinfo->isolate_ = v8::Isolate::GetCurrent(); - return cbinfo; -} - -#undef NAN_WEAK_CALLBACK_SIG_ -#undef NAN_WEAK_CALLBACK_DATA_TYPE_ -#endif - -#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ - (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) -template -template -inline void Persistent::SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - WeakCallbackInfo

*wcbd; - if (type == WeakCallbackType::kParameter) { - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , parameter); - v8::PersistentBase::SetWeak( - wcbd - , WeakCallbackInfo

::template invokeparameter - , type); - } else { - v8::Local* self_v(reinterpret_cast*>(this)); - assert((*self_v)->IsObject()); - v8::Local self((*self_v).As()); - int count = self->InternalFieldCount(); - void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; - for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { - internal_fields[i] = self->GetAlignedPointerFromInternalField(i); - } - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , 0 - , internal_fields[0] - , internal_fields[1]); - self->SetAlignedPointerInInternalField(0, wcbd); - v8::PersistentBase::SetWeak( - static_cast*>(0) - , WeakCallbackInfo

::template invoketwofield - , type); - } -} -#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION -template -template -inline void Persistent::SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - WeakCallbackInfo

*wcbd; - if (type == WeakCallbackType::kParameter) { - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , parameter); - v8::PersistentBase::SetPhantom( - wcbd - , WeakCallbackInfo

::invokeparameter); - } else { - v8::Local* self_v(reinterpret_cast*>(this)); - assert((*self_v)->IsObject()); - v8::Local self((*self_v).As()); - int count = self->InternalFieldCount(); - void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; - for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { - internal_fields[i] = self->GetAlignedPointerFromInternalField(i); - } - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , 0 - , internal_fields[0] - , internal_fields[1]); - self->SetAlignedPointerInInternalField(0, wcbd); - v8::PersistentBase::SetPhantom( - static_cast*>(0) - , WeakCallbackInfo

::invoketwofield - , 0 - , count > 1 ? 1 : kNoInternalFieldIndex); - } -} -#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION -template -template -inline void Persistent::SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - WeakCallbackInfo

*wcbd; - if (type == WeakCallbackType::kParameter) { - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , parameter); - v8::PersistentBase::SetPhantom( - wcbd - , WeakCallbackInfo

::invokeparameter); - } else { - v8::Local* self_v(reinterpret_cast*>(this)); - assert((*self_v)->IsObject()); - v8::Local self((*self_v).As()); - int count = self->InternalFieldCount(); - void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; - for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { - internal_fields[i] = self->GetAlignedPointerFromInternalField(i); - } - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , 0 - , internal_fields[0] - , internal_fields[1]); - self->SetAlignedPointerInInternalField(0, wcbd); - v8::PersistentBase::SetPhantom( - WeakCallbackInfo

::invoketwofield - , 0 - , count > 1 ? 1 : kNoInternalFieldIndex); - } -} -#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION -template -template -inline void Persistent::SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - WeakCallbackInfo

*wcbd; - if (type == WeakCallbackType::kParameter) { - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , parameter); - v8::PersistentBase::SetWeak(wcbd, WeakCallbackInfo

::invoke); - } else { - v8::Local* self_v(reinterpret_cast*>(this)); - assert((*self_v)->IsObject()); - v8::Local self((*self_v).As()); - int count = self->InternalFieldCount(); - void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; - for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { - internal_fields[i] = self->GetAlignedPointerFromInternalField(i); - } - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , 0 - , internal_fields[0] - , internal_fields[1]); - v8::PersistentBase::SetWeak(wcbd, WeakCallbackInfo

::invoke); - } -} -#else -template -template -inline void PersistentBase::SetWeak( - P *parameter - , typename WeakCallbackInfo

::Callback callback - , WeakCallbackType type) { - WeakCallbackInfo

*wcbd; - if (type == WeakCallbackType::kParameter) { - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , parameter); - persistent.MakeWeak(wcbd, WeakCallbackInfo

::invoke); - } else { - v8::Local* self_v(reinterpret_cast*>(this)); - assert((*self_v)->IsObject()); - v8::Local self((*self_v).As()); - int count = self->InternalFieldCount(); - void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; - for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { - internal_fields[i] = self->GetPointerFromInternalField(i); - } - wcbd = new WeakCallbackInfo

( - reinterpret_cast*>(this) - , callback - , 0 - , internal_fields[0] - , internal_fields[1]); - persistent.MakeWeak(wcbd, WeakCallbackInfo

::invoke); - } -} -#endif - -#endif // NAN_WEAK_H_ diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/package.json b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/package.json deleted file mode 100644 index 5ac37aac1..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "nan", - "version": "2.17.0", - "description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 18 compatibility", - "main": "include_dirs.js", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/nan.git" - }, - "scripts": { - "test": "tap --gc --stderr test/js/*-test.js", - "test:worker": "node --experimental-worker test/tap-as-worker.js --gc --stderr test/js/*-test.js", - "rebuild-tests": "node-gyp rebuild --msvs_version=2015 --directory test", - "docs": "doc/.build.sh" - }, - "contributors": [ - "Rod Vagg (https://github.com/rvagg)", - "Benjamin Byholm (https://github.com/kkoopa/)", - "Trevor Norris (https://github.com/trevnorris)", - "Nathan Rajlich (https://github.com/TooTallNate)", - "Brett Lawson (https://github.com/brett19)", - "Ben Noordhuis (https://github.com/bnoordhuis)", - "David Siegel (https://github.com/agnat)", - "Michael Ira Krufky (https://github.com/mkrufky)" - ], - "devDependencies": { - "bindings": "~1.2.1", - "commander": "^2.8.1", - "glob": "^5.0.14", - "request": "=2.81.0", - "node-gyp": "~8.4.1", - "readable-stream": "^2.1.4", - "tap": "~0.7.1", - "xtend": "~4.0.0" - }, - "license": "MIT" -} diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/1to2.js b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/1to2.js deleted file mode 100755 index 6af25058a..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/1to2.js +++ /dev/null @@ -1,412 +0,0 @@ -#!/usr/bin/env node -/********************************************************************* - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2018 NAN contributors - * - * MIT License - ********************************************************************/ - -var commander = require('commander'), - fs = require('fs'), - glob = require('glob'), - groups = [], - total = 0, - warning1 = '/* ERROR: Rewrite using Buffer */\n', - warning2 = '\\/\\* ERROR\\: Rewrite using Buffer \\*\\/\\n', - length, - i; - -fs.readFile(__dirname + '/package.json', 'utf8', function (err, data) { - if (err) { - throw err; - } - - commander - .version(JSON.parse(data).version) - .usage('[options] ') - .parse(process.argv); - - if (!process.argv.slice(2).length) { - commander.outputHelp(); - } -}); - -/* construct strings representing regular expressions - each expression contains a unique group allowing for identification of the match - the index of this key group, relative to the regular expression in question, - is indicated by the first array member */ - -/* simple substistutions, key group is the entire match, 0 */ -groups.push([0, [ - '_NAN_', - 'NODE_SET_METHOD', - 'NODE_SET_PROTOTYPE_METHOD', - 'NanAsciiString', - 'NanEscapeScope', - 'NanReturnValue', - 'NanUcs2String'].join('|')]); - -/* substitutions of parameterless macros, key group is 1 */ -groups.push([1, ['(', [ - 'NanEscapableScope', - 'NanReturnNull', - 'NanReturnUndefined', - 'NanScope'].join('|'), ')\\(\\)'].join('')]); - -/* replace TryCatch with NanTryCatch once, gobbling possible namespace, key group 2 */ -groups.push([2, '(?:(?:v8\\:\\:)?|(Nan)?)(TryCatch)']); - -/* NanNew("string") will likely not fail a ToLocalChecked(), key group 1 */ -groups.push([1, ['(NanNew)', '(\\("[^\\"]*"[^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]); - -/* Removed v8 APIs, warn that the code needs rewriting using node::Buffer, key group 2 */ -groups.push([2, ['(', warning2, ')?', '^.*?(', [ - 'GetIndexedPropertiesExternalArrayDataLength', - 'GetIndexedPropertiesExternalArrayData', - 'GetIndexedPropertiesExternalArrayDataType', - 'GetIndexedPropertiesPixelData', - 'GetIndexedPropertiesPixelDataLength', - 'HasIndexedPropertiesInExternalArrayData', - 'HasIndexedPropertiesInPixelData', - 'SetIndexedPropertiesToExternalArrayData', - 'SetIndexedPropertiesToPixelData'].join('|'), ')'].join('')]); - -/* No need for NanScope in V8-exposed methods, key group 2 */ -groups.push([2, ['((', [ - 'NAN_METHOD', - 'NAN_GETTER', - 'NAN_SETTER', - 'NAN_PROPERTY_GETTER', - 'NAN_PROPERTY_SETTER', - 'NAN_PROPERTY_ENUMERATOR', - 'NAN_PROPERTY_DELETER', - 'NAN_PROPERTY_QUERY', - 'NAN_INDEX_GETTER', - 'NAN_INDEX_SETTER', - 'NAN_INDEX_ENUMERATOR', - 'NAN_INDEX_DELETER', - 'NAN_INDEX_QUERY'].join('|'), ')\\([^\\)]*\\)\\s*\\{)\\s*NanScope\\(\\)\\s*;'].join('')]); - -/* v8::Value::ToXXXXXXX returns v8::MaybeLocal, key group 3 */ -groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->(', [ - 'Boolean', - 'Number', - 'String', - 'Object', - 'Integer', - 'Uint32', - 'Int32'].join('|'), ')\\('].join('')]); - -/* v8::Value::XXXXXXXValue returns v8::Maybe, key group 3 */ -groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->((?:', [ - 'Boolean', - 'Number', - 'Integer', - 'Uint32', - 'Int32'].join('|'), ')Value)\\('].join('')]); - -/* NAN_WEAK_CALLBACK macro was removed, write out callback definition, key group 1 */ -groups.push([1, '(NAN_WEAK_CALLBACK)\\(([^\\s\\)]+)\\)']); - -/* node::ObjectWrap and v8::Persistent have been replaced with Nan implementations, key group 1 */ -groups.push([1, ['(', [ - 'NanDisposePersistent', - 'NanObjectWrapHandle'].join('|'), ')\\s*\\(\\s*([^\\s\\)]+)'].join('')]); - -/* Since NanPersistent there is no need for NanMakeWeakPersistent, key group 1 */ -groups.push([1, '(NanMakeWeakPersistent)\\s*\\(\\s*([^\\s,]+)\\s*,\\s*']); - -/* Many methods of v8::Object and others now return v8::MaybeLocal, key group 3 */ -groups.push([3, ['([\\s])([^\\s]+)->(', [ - 'GetEndColumn', - 'GetFunction', - 'GetLineNumber', - 'NewInstance', - 'GetPropertyNames', - 'GetOwnPropertyNames', - 'GetSourceLine', - 'GetStartColumn', - 'ObjectProtoToString', - 'ToArrayIndex', - 'ToDetailString', - 'CallAsConstructor', - 'CallAsFunction', - 'CloneElementAt', - 'Delete', - 'ForceSet', - 'Get', - 'GetPropertyAttributes', - 'GetRealNamedProperty', - 'GetRealNamedPropertyInPrototypeChain', - 'Has', - 'HasOwnProperty', - 'HasRealIndexedProperty', - 'HasRealNamedCallbackProperty', - 'HasRealNamedProperty', - 'Set', - 'SetAccessor', - 'SetIndexedPropertyHandler', - 'SetNamedPropertyHandler', - 'SetPrototype'].join('|'), ')\\('].join('')]); - -/* You should get an error if any of these fail anyways, - or handle the error better, it is indicated either way, key group 2 */ -groups.push([2, ['NanNew(<(?:v8\\:\\:)?(', ['Date', 'String', 'RegExp'].join('|'), ')>)(\\([^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]); - -/* v8::Value::Equals now returns a v8::Maybe, key group 3 */ -groups.push([3, '([\\s\\(\\)])([^\\s\\(\\)]+)->(Equals)\\(([^\\s\\)]+)']); - -/* NanPersistent makes this unnecessary, key group 1 */ -groups.push([1, '(NanAssignPersistent)(?:]+>)?\\(([^,]+),\\s*']); - -/* args has been renamed to info, key group 2 */ -groups.push([2, '(\\W)(args)(\\W)']) - -/* node::ObjectWrap was replaced with NanObjectWrap, key group 2 */ -groups.push([2, '(\\W)(?:node\\:\\:)?(ObjectWrap)(\\W)']); - -/* v8::Persistent was replaced with NanPersistent, key group 2 */ -groups.push([2, '(\\W)(?:v8\\:\\:)?(Persistent)(\\W)']); - -/* counts the number of capturing groups in a well-formed regular expression, - ignoring non-capturing groups and escaped parentheses */ -function groupcount(s) { - var positive = s.match(/\((?!\?)/g), - negative = s.match(/\\\(/g); - return (positive ? positive.length : 0) - (negative ? negative.length : 0); -} - -/* compute the absolute position of each key group in the joined master RegExp */ -for (i = 1, length = groups.length; i < length; i++) { - total += groupcount(groups[i - 1][1]); - groups[i][0] += total; -} - -/* create the master RegExp, whis is the union of all the groups' expressions */ -master = new RegExp(groups.map(function (a) { return a[1]; }).join('|'), 'gm'); - -/* replacement function for String.replace, receives 21 arguments */ -function replace() { - /* simple expressions */ - switch (arguments[groups[0][0]]) { - case '_NAN_': - return 'NAN_'; - case 'NODE_SET_METHOD': - return 'NanSetMethod'; - case 'NODE_SET_PROTOTYPE_METHOD': - return 'NanSetPrototypeMethod'; - case 'NanAsciiString': - return 'NanUtf8String'; - case 'NanEscapeScope': - return 'scope.Escape'; - case 'NanReturnNull': - return 'info.GetReturnValue().SetNull'; - case 'NanReturnValue': - return 'info.GetReturnValue().Set'; - case 'NanUcs2String': - return 'v8::String::Value'; - default: - } - - /* macros without arguments */ - switch (arguments[groups[1][0]]) { - case 'NanEscapableScope': - return 'NanEscapableScope scope' - case 'NanReturnUndefined': - return 'return'; - case 'NanScope': - return 'NanScope scope'; - default: - } - - /* TryCatch, emulate negative backref */ - if (arguments[groups[2][0]] === 'TryCatch') { - return arguments[groups[2][0] - 1] ? arguments[0] : 'NanTryCatch'; - } - - /* NanNew("foo") --> NanNew("foo").ToLocalChecked() */ - if (arguments[groups[3][0]] === 'NanNew') { - return [arguments[0], '.ToLocalChecked()'].join(''); - } - - /* insert warning for removed functions as comment on new line above */ - switch (arguments[groups[4][0]]) { - case 'GetIndexedPropertiesExternalArrayData': - case 'GetIndexedPropertiesExternalArrayDataLength': - case 'GetIndexedPropertiesExternalArrayDataType': - case 'GetIndexedPropertiesPixelData': - case 'GetIndexedPropertiesPixelDataLength': - case 'HasIndexedPropertiesInExternalArrayData': - case 'HasIndexedPropertiesInPixelData': - case 'SetIndexedPropertiesToExternalArrayData': - case 'SetIndexedPropertiesToPixelData': - return arguments[groups[4][0] - 1] ? arguments[0] : [warning1, arguments[0]].join(''); - default: - } - - /* remove unnecessary NanScope() */ - switch (arguments[groups[5][0]]) { - case 'NAN_GETTER': - case 'NAN_METHOD': - case 'NAN_SETTER': - case 'NAN_INDEX_DELETER': - case 'NAN_INDEX_ENUMERATOR': - case 'NAN_INDEX_GETTER': - case 'NAN_INDEX_QUERY': - case 'NAN_INDEX_SETTER': - case 'NAN_PROPERTY_DELETER': - case 'NAN_PROPERTY_ENUMERATOR': - case 'NAN_PROPERTY_GETTER': - case 'NAN_PROPERTY_QUERY': - case 'NAN_PROPERTY_SETTER': - return arguments[groups[5][0] - 1]; - default: - } - - /* Value conversion */ - switch (arguments[groups[6][0]]) { - case 'Boolean': - case 'Int32': - case 'Integer': - case 'Number': - case 'Object': - case 'String': - case 'Uint32': - return [arguments[groups[6][0] - 2], 'NanTo(', arguments[groups[6][0] - 1]].join(''); - default: - } - - /* other value conversion */ - switch (arguments[groups[7][0]]) { - case 'BooleanValue': - return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); - case 'Int32Value': - return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); - case 'IntegerValue': - return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); - case 'Uint32Value': - return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); - default: - } - - /* NAN_WEAK_CALLBACK */ - if (arguments[groups[8][0]] === 'NAN_WEAK_CALLBACK') { - return ['template\nvoid ', - arguments[groups[8][0] + 1], '(const NanWeakCallbackInfo &data)'].join(''); - } - - /* use methods on NAN classes instead */ - switch (arguments[groups[9][0]]) { - case 'NanDisposePersistent': - return [arguments[groups[9][0] + 1], '.Reset('].join(''); - case 'NanObjectWrapHandle': - return [arguments[groups[9][0] + 1], '->handle('].join(''); - default: - } - - /* use method on NanPersistent instead */ - if (arguments[groups[10][0]] === 'NanMakeWeakPersistent') { - return arguments[groups[10][0] + 1] + '.SetWeak('; - } - - /* These return Maybes, the upper ones take no arguments */ - switch (arguments[groups[11][0]]) { - case 'GetEndColumn': - case 'GetFunction': - case 'GetLineNumber': - case 'GetOwnPropertyNames': - case 'GetPropertyNames': - case 'GetSourceLine': - case 'GetStartColumn': - case 'NewInstance': - case 'ObjectProtoToString': - case 'ToArrayIndex': - case 'ToDetailString': - return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1]].join(''); - case 'CallAsConstructor': - case 'CallAsFunction': - case 'CloneElementAt': - case 'Delete': - case 'ForceSet': - case 'Get': - case 'GetPropertyAttributes': - case 'GetRealNamedProperty': - case 'GetRealNamedPropertyInPrototypeChain': - case 'Has': - case 'HasOwnProperty': - case 'HasRealIndexedProperty': - case 'HasRealNamedCallbackProperty': - case 'HasRealNamedProperty': - case 'Set': - case 'SetAccessor': - case 'SetIndexedPropertyHandler': - case 'SetNamedPropertyHandler': - case 'SetPrototype': - return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1], ', '].join(''); - default: - } - - /* Automatic ToLocalChecked(), take it or leave it */ - switch (arguments[groups[12][0]]) { - case 'Date': - case 'String': - case 'RegExp': - return ['NanNew', arguments[groups[12][0] - 1], arguments[groups[12][0] + 1], '.ToLocalChecked()'].join(''); - default: - } - - /* NanEquals is now required for uniformity */ - if (arguments[groups[13][0]] === 'Equals') { - return [arguments[groups[13][0] - 1], 'NanEquals(', arguments[groups[13][0] - 1], ', ', arguments[groups[13][0] + 1]].join(''); - } - - /* use method on replacement class instead */ - if (arguments[groups[14][0]] === 'NanAssignPersistent') { - return [arguments[groups[14][0] + 1], '.Reset('].join(''); - } - - /* args --> info */ - if (arguments[groups[15][0]] === 'args') { - return [arguments[groups[15][0] - 1], 'info', arguments[groups[15][0] + 1]].join(''); - } - - /* ObjectWrap --> NanObjectWrap */ - if (arguments[groups[16][0]] === 'ObjectWrap') { - return [arguments[groups[16][0] - 1], 'NanObjectWrap', arguments[groups[16][0] + 1]].join(''); - } - - /* Persistent --> NanPersistent */ - if (arguments[groups[17][0]] === 'Persistent') { - return [arguments[groups[17][0] - 1], 'NanPersistent', arguments[groups[17][0] + 1]].join(''); - } - - /* This should not happen. A switch is probably missing a case if it does. */ - throw 'Unhandled match: ' + arguments[0]; -} - -/* reads a file, runs replacement and writes it back */ -function processFile(file) { - fs.readFile(file, {encoding: 'utf8'}, function (err, data) { - if (err) { - throw err; - } - - /* run replacement twice, might need more runs */ - fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) { - if (err) { - throw err; - } - }); - }); -} - -/* process file names from command line and process the identified files */ -for (i = 2, length = process.argv.length; i < length; i++) { - glob(process.argv[i], function (err, matches) { - if (err) { - throw err; - } - matches.forEach(processFile); - }); -} diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/README.md b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/README.md deleted file mode 100644 index 7f07e4b82..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/README.md +++ /dev/null @@ -1,14 +0,0 @@ -1to2 naively converts source code files from NAN 1 to NAN 2. There will be erroneous conversions, -false positives and missed opportunities. The input files are rewritten in place. Make sure that -you have backups. You will have to manually review the changes afterwards and do some touchups. - -```sh -$ tools/1to2.js - - Usage: 1to2 [options] - - Options: - - -h, --help output usage information - -V, --version output the version number -``` diff --git a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/package.json b/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/package.json deleted file mode 100644 index 2dcdd7893..000000000 --- a/.yarn/unplugged/nan-npm-2.17.0-bf36a21d6f/node_modules/nan/tools/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "1to2", - "version": "1.0.0", - "description": "NAN 1 -> 2 Migration Script", - "main": "1to2.js", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/nan.git" - }, - "contributors": [ - "Benjamin Byholm (https://github.com/kkoopa/)", - "Mathias Küsel (https://github.com/mathiask88/)" - ], - "dependencies": { - "glob": "~5.0.10", - "commander": "~2.8.1" - }, - "license": "MIT" -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/.ready b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/LICENSE b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/LICENSE deleted file mode 100644 index f49a4e16e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/NEWS.md b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/NEWS.md deleted file mode 100644 index 416ab91c3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/NEWS.md +++ /dev/null @@ -1,5753 +0,0 @@ -### v10.1.0 (2023-05-04) - -* Added batching and compression to infinite tracing. - * These options are on by default. - * To restore uncompressed spans set `config.infinite_tracing.compression` to `false`. - * To send single spans vs batches set `config.infinite_tracing.batching` to `false`. - * The environment variables for these new configurations are: `NEW_RELIC_INFINITE_TRACING_BATCHING` and `NEW_RELIC_INFINITE_TRACING_COMPRESSION`. - -* Added support to record Nest.js error stack traces. - * Nest.js is officially supported via underlying instrumentation of express or fastify. - -* Added job to create a release notes PR in the post-release workflow. - -* Removed request library and updated helper to use http/https to make requests in tests. - -* Reduced cognitive complexity in lib/serverless/aws-lambda.js - -### v10.0.0 (2023-04-19) - -* **BREAKING** - Updated the default of `config.transaction_tracer.record_sql` from `off` to `obfuscated`. This means that sql statements will be captured but obfuscated. - -* **BREAKING** - Route (URL) parameters are now stored as `request.parameters.route.*` attributes on Transactions, root Segments and Spans. - - After this change, the following becomes true: - - - Query parameters will be available as attributes prefixed with request.parameters.* on Transactions and Spans. - - - Route parameters will be available as attributes prefixed with request.parameters.route.* on Transactions and Spans. - - - Route parameters (aka url parameters) are a common feature of various web frameworks, where you can create a placeholder as part of an API route definition. - - For example, given the following Express route definition and request url: - - ```js - app.get('/api/users/:id', myMiddleware, myController) - ``` - - ```sh - curl http://localhost:3000/api/users/abc123?id=true - ``` - - The route parameter is `id`, and has a value of `abc123`. This would become `request.parameters.route.id: abc123` on the Transaction, root Segment, and Span attributes. This example also has a query parameter of `id`, which has a value of true. This would become `request.parameters.id: true` on the Transaction, root Segment, and Span attributes. - -* **BREAKING** - Removed `captureUrlParams` from `WebFrameworkShim` class. - -* **DEPRECATION NOTICE**: `shim.unwrap` and `shim.unwrapOnce` will no longer function if you attempt to unwrap an item that has been wrapped multiple times. - * This is because since we now allow instrumenting the same module more than once, you cannot safely unwrap without breaking all registered instrumentation. We plan to remove `shim.unwrap` and `shim.unwrapOnce` in the next major release. - -* Added the ability to register instrumentation multiple hooks (onRequire, onResolved) for the same resolved moduleName. - * This has been a limitation of the agent from the beginning. - * If you used the api to instrument `api.instrument`, `api.instrumentDatastore`, `api.instrumentWebframework`, `api.instrumentMessages`, or `api.instrumentConglomerate`, it would override existing instrumentation hooks. The effect was that the Node.js agent would not function as designed. - -* Refactored lib/transaction/tracecontext.js to reduce cognitive complexity. - -* Refactored lib/transaction/trace/index.js to reduce cognitive complexity. - -* Upgraded devDependencies jsdoc, and lean-jsdoc-theme. - -### v9.15.0 (2023-04-04) - -* Added a new configuration option `heroku.use_dyno_names` to specify whether or not to use `process.env.DYNO` for naming the host name and display host. This option defaults to true. If you are on heroku and do not want this functionality set `heroku.use_dyno_names` to `false`. You can also control this configuration options with the environment variable of `NEW_RELIC_HEROKU_USE_DYNO_NAMES`. Thanks @benney-au-le for your contribution 🚀 - -### v9.14.1 (2023-03-23) - -* Restored assigning loaded version of agent to require.cache as `__NR_cache` instead of a symbol to properly detect attempts at loading agent twice. - -### v9.14.0 (2023-03-23) - -* Added new API function called `setErrorGroupCallback`, which provides a way for you to customize the `error.group.name` attribute of errors that are captured by the agent. This attribute controls how the Errors Inbox functionality groups similar errors together. To learn more about this function, please refer to our [example app](https://github.com/newrelic/newrelic-node-examples). - -### v9.13.0 (2023-03-20) - -* Updated http instrumentation to no longer remove the `x-new-relic-disable-dt` header when using AWS SDK v3. This was done to prevent the "The request signature we calculated does not match the signature you provided. Check your key and signing method." error from AWS SDK. - -* Added an API method `setUserID` to provide an ability to associate a unique identifier with a transaction event, transaction trace and errors within transaction. The attribute will be `enduser.id`. - -* Added default configuration for security agent. - -### v9.12.1 (2023-03-15) - -* Added ability to mark errors as expected when using `newrelic.noticeError`, by adding an optional boolean: - * `newrelic.noticeError(error, {customAttributes}, true|false)` when there are custom error attributes. - * `newrelic.noticeError(error, true|false)` if there are no custom error attributes. - * `expected` errors do not affect error metrics or Apdex. - -* Added ability to disable distributed tracing for aws-sdk >= 3.290.0. - -* Updated README header image to latest OSS office required images - -* updated @grpc/grpc-js from 1.8.8 to 1.8.9 - -### v9.12.0 (2023-03-13) -* Release pipeline did not complete. - -### v9.11.0 (2023-03-08) - * Added instrumentation for Prisma(`@prisma/client`). - * Miniumum supported version of `@prisma/client` is 4.0.0. - * Captures spans for queries. - * It names them based on the model and action.(i.e. Datastore/statement/Prisma/user/create) - * For statements and queries using the `$queryRaw`, `$executeRaw`, `$queryRawUnsafe`, and `$executeRawUnsafe` the names will be aligned with the raw SQL.(i.e. Datastore/statement/Prisma/User/select) - * Captures database metrics for all statements and queries. - * Captures SQL Traces. - * Provides connection between application and database server via service maps. - -Huge shoutout to @osmanmrtacar for the original contribution 🙏🏻 - - * Updated `@grpc/protoloader` from 0.7.4 to 0.7.5. - * Updated `@grpc/grpc-js` from 1.8.7 to 1.8.8. - -### v9.10.2 (2023-02-21) - -* Replaced `request.aborted` with `response.close` in HTTP instrumentation. -* Fixed issue where setting `NEW_RELIC_GRPC_IGNORE_STATUS_CODES` was not properly parsing the codes as integers, thus not ignoring reporting errors of certain status codes. -* Upgraded `@grpc/grpc-js` from 1.8.4 to 1.8.7. - -### v9.10.1 (2023-02-13) - -* Fixed error with Lambda/ALB serverless instrumentation when no response headers were included - -### v9.10.0 (2023-02-09) - -* Exposed a method on [API](https://newrelic.github.io/node-newrelic/API.html#obfuscateSql) to obfuscate sql: `newrelic.obfuscateSql`. - -* Add support for [Multi Value Parameters](https://aws.amazon.com/blogs/compute/support-for-multi-value-parameters-in-amazon-api-gateway) from API Gateway and ALB events for Lambdas (Thank you @Engerim for your contribution 🙏🏻) - -### v9.9.0 (2023-02-06) -* Added support for url obfuscation using regex (Thanks for your contribution @matewilk) - * For Distributed Tracing, this means that: - * Incoming and outgoing requests' `path` will be obfuscated - * Transaction's `request.url` attribute will be obfuscated - * Span's `http.uri` path will be obfuscated - * For transactions, this means that: - * Transaction trace details `url` will be obfuscated - * With the following example configuration, url obfuscation will turn `/api/v1/users/12345456/edit` to `/api/v1/users/**/edit`. - ```js - url_obfuscation: { - enabled: true, - regex: { - pattern: /(\/api\/v1\/users\/)([\d]+)(\/.*$)/, - flags: "i", - replacement: '$1**$3' - } - } - ``` - * You can also use environment variables to configure url obfuscation: - ```yml - NEW_RELIC_URL_OBFUSCATION_ENABLED: "true", - NEW_RELIC_URL_OBFUSCATION_REGEX_PATTERN: '/(\/api\/v1\/users\/)([\d]+)(\/.*$)/', - NEW_RELIC_URL_OBFUSCATION_REGEX_FLAGS: 'i', - NEW_RELIC_URL_OBFUSCATION_REGEX_REPLACEMENT: '$1**$3' - ``` - -* Add a new tracking type of instrumentation. This will be responsible for logging `Supportability/Features/Instrumentation/OnResolved/` and `Supportability/Features/Instrumentation/OnResolved//Version/` metrics when packages are required. - -### v9.8.1 (2023-01-25) - -* Changed GCP metadata parsing to use `json-bigint` to avoid loss of precision from numerical instance ID. - -* Instrumented `winston.loggers.add` so it works like `winston.createLogger`. - -### v9.8.0 (2023-01-17) - -* Updated `getBrowserTimingHeader` to allow Browser Agent to be generated even when not in a Transaction by adding `allowTransactionlessInjection` to function options. `allowTransactionlessInjection` is a boolean option, and when set to `true`, will allow injection of the Browser Agent when not in a transaction. This is intended to be used in frameworks that build Static Site Generation(SSG). Note that if you are using this option, you may need to wait until the Node agent has established a connection before calling `getBrowserTimingHeader`. To wait until the agent is connected, you can add the following check to your code: -```js -if (!newrelic.agent.collector.isConnected()) { - await new Promise((resolve) => { - newrelic.agent.on('connected', resolve) - }) -} -``` - -### v9.7.5 (2023-01-03) - -* Added a check to the code level metrics utility to ensure filePath was set before adding the `code.*` attributes. - -* Updated to latest version of `@newrelic/test-utilities` - -* Fixed issue where listing of dependencies and packages from symlinked nested directories created an infinite loop which caused the agent to never connect. - -### v9.7.4 (2022-12-15) - -* Fixed system info gathering to prevent unhandled promise rejection when an error occurs reading `/proc` information. - -### v9.7.3 (2022-12-12) - -* Added support for Code Level Metrics on API methods: `startSegment`, `startBackgroundTransaction`, and `startWebTransaction`. - -### v9.7.2 (2022-12-07) - -* Updated `@grpc/grpc-js` instrumentation to work with 1.8.0. - -### v9.7.1 (2022-12-06) - -* Reintroduced throttling during reading of instrumented application's dependency tree during startup, to prevent EMFILE issues. - -* Improved Restify support - * Added a new test stanza to run restify >=10 on Node 18. - * Update our versioned tests to support Restify 9.0.0. - -* Laid foundation for supporting Code Level Metrics via [Codestream](https://docs.newrelic.com/docs/codestream/how-use-codestream/performance-monitoring/). Note that this integration is not fully finished and should not be used. - -* Improved the readability and maintainability of agent by reducing the [Cognitive Complexity](https://www.sonarsource.com/resources/cognitive-complexity/) of various aspects of the agent. - -* Added `newrelic.noticeError()` example to our API docs. - -* Upgraded @grpc/grpc-js from 1.6.9 to 1.7.3. - -* Upgraded @grpc/proto-loader from 0.6.13 to 0.7.3. - -* Removed async from benchmark tests, fixed failing benchmark suites, and removed deprecated suite. - -### v9.7.0 (2022-11-14) - -* Added new configuration option, `grpc.ignore_status_codes`, which can be used to select nonzero gRPC status codes to ignore and not report as errors. - -### v9.6.0 (2022-11-09) - -* Dropped support for `vision`, and instead only instrument `@hapi/vision`. - -* Updated configuration system to automatically create an environment variable mapping for a new config value. - * It will follow a convention of `NEW_RELIC_PATH_TO_CONFIG_KEY`. - * For example if there is a new configuration option of `config.nested.object_path.enabled` the env var would be `NEW_RELIC_NESTED_OBJECT_PATH.ENABLED`. - -* Removed `transaction_tracer.hide_internals` configuration. All of the internal configuration is now handled by Javascript symbols instead of non-enumerable properties, so there is no longer a performance penalty, as symbols are already hidden by default. - -### v9.5.0 (2022-10-26) - -* Increased the default limit of custom events from 1,000 events per minute to 3,000 events per minute. In the scenario that custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable maximum limit of 100,000 events per minute. To change the limits, see the documentation for [custom_insights_events](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#custom_events_max_samples_stored). To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub [post](https://discuss.newrelic.com/t/send-more-custom-events-with-the-latest-apm-agents/190497). - -* Updated CI process to include collection of code coverage statistics. - -* Added a [document](./documentation/feature-flags.md) for our current feature flags. - -### v9.4.0 (2022-10-24) - -* Removed legacy agent async context propagation. The default behavior is now what was behind the `feature_flag.new_promise_tracking`. You can read more about the difference [here](https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-7-3-0#new-features). - -* Fixed an issue with the ES Module loader that properly registers instrumentation when the file path included url encoded characters. - -* Added an API for enqueuing application logs for forwarding - -```js -newrelic.recordLogEvent({ message: 'hello world', level: 'info' })` -``` - - -**Note**: If you are including a serialized error make sure it is on the `error` key of the log event: - -```js -const error = new Error('testing errors'); -newrelic.recordLogEvent({ message: 'error example', level: 'error', error }) -``` - -* Fixed `cassandra-driver` instrumentation to properly set instance details on query segments/spans. - -* Added a new context manager that leverages AsyncLocalStorage for async context propagation. - * This will be available via a feature flag `config.feature_flag.async_local_context` - * Alternatively you can set the environment variable of `NEW_RELIC_FEATURE_FLAG_ASYNC_LOCAL_CONTEXT=1` - * By enabling this feature flag it should make the agent use less memory and CPU. - -### v9.3.0 (2022-10-17) - -* Added instrumentation to bunyan to support application logging use cases: forwarding, local decorating, and metrics. - - Big thanks to @brianphillips for his contribution 🚀 - -* Added c8 to track code coverage. - -* Added documentation about custom instrumentation in ES module applications - -### v9.2.0 (2022-10-06) - -* Added ability to instrument ES Modules with the New Relic ESM Loader. - * [Example ESM application](https://github.com/newrelic/newrelic-node-examples/tree/main/esm-app) - -* Added support for custom ESM instrumentation. - * There is structure to registering custom ESM instrumentation. Set the relative path to the instrumentation entry point via `api.esm.custom_instrumentation_entrypoint` - * [Sample custom ESM instrumentation entrypoint](https://github.com/newrelic/newrelic-node-examples/blob/main/esm-app/custom-instrumentation/index.js) - * All the `newrelic.instrument*` methods will still work except `newrelic.instrumentLoadedModule`. This is because it is geared toward CommonJS modules. - -* Added test for asserting ESM loader functionality on ESM-only package - -* Added supportability metric of `Supportability/Nodejs/Collector/MaxPayloadSizeLimit/` when `max_payload_size_in_bytes` configuration value is exceeded. - -* Removed `application_logging.forwarding.enabled` stanza from sample config as the feature is now enabled by default. - -### v9.1.0 (2022-09-22) - -* Added [experimental loader](https://nodejs.org/api/esm.html#loaders) to support instrumentation of CommonJS packages in ECMAScript Module(ESM) applications. - * It only supports versions of Node.js >= `16.12.0`. - * It is subject to change due to its experimental stability. - -* Enhanced supportability metrics for ESM support. - * Added new metrics to track usage of ESM loader(`Supportability/Features/ESM/Loader` and `Supportability/Features/ESM/UnsupportedLoader`). - * Updated instrumentation map to include an optional "friendly name" for tracking metrics. - -* Enabled re-throwing ESM import errors of `newrelic.js` so that the user is informed to rename it to `newrelic.cjs` - -* Fixed an issue with mongodb instrumentation where IPv6 address([::1]) was not getting mapped to localhost when setting the host attribute on the segment. - -* Added a test ESM loader to properly mock out agent in versioned tests. - -* Added ESM versioned tests for: `express`, `pg`, `mongodb`, and `@grpc/grpc-js`. - -### v9.0.3 (2022-09-06) - -* Updated gRPC client instrumentation to respect `grpc.record_errors` when deciding to log errors on gRPC client requests. - -* Fixed transaction name finalization to properly copy the appropriate transaction name to root segment. - -### v9.0.2 (2022-08-23) - -* Added unit test suite for `lib/logger.js`. - -* Added destructive integration test for Configuration instantiation. - -* Added a special case to serialize BigInts when sending them to New Relic. BigInts can appear in log data that our customers may be trying to forward. - -* Exposed `compressed_content_encoding` configuration and defaulted it to "gzip". - -* Fixed public jsdoc generation. - -* Added`minami` back as a dev dependency for use with `jsdoc-conf.js`. - -### v9.0.1 (2022-08-18) - -* Fixed properly setting logging metrics when using custom levels with winston. - -* Handled setting the logging metric name to `UNKNOWN` when using custom log levels in pino and/or winston. - Thanks for your contribution @billouboq 🎉 - -* Removed unnecessary unit test and fixture for OSS license generation. - -* Updated versioned tests to remove the use of the `async` module. - -* Removed 3rd party `async` library from agent code. - -### v9.0.0 (2022-08-03) - -* Added official parity support for Node 18. - -* **BREAKING**: Dropped Node 12.x support. For further information on our support policy, - see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent - - * Upgraded `@newrelic/superagent` `@newrelic/aws-sdk` `@newrelic/koa` `@newrelic/native-metrics` and `@newrelic/test-utilities` to the latest major versions - * Removed Node 12 from CI workflows. - * Updated engines stanza to be `>=14`. - * Updated all versioned tests stanza to be `>=14` - * Converted `fs.rmdirSync` to `fs.rmSync` in `test/unit/config/config-location.test.js`. - * Converted uses of `/dev/null` to `os.devNull` in tests. - -* **BREAKING**: Removed certificate bundle from agent. The configuration value `config.feature_flag.certificate_bundle` will no longer work. - - The agent no-longer includes the New Relic certificate bundle when using the 'certificates' configuration (commonly with proxies). If you find this breaking your current environment, we recommend getting a CA bundle such as the one from Mozilla. - -* **BREAKING**: The agent now excludes port when making external HTTPS requests to port 443 to be in compliance with the spec and other agents. - - Previous external segments would be named `External/example.com:443` when using default HTTPS port. - The external segment will now be named `External/example.com`. - -* **BREAKING**: Removed ability to disable async hooks based promise context tracking via the `await_support` feature flag. This also removes the legacy Promise instrumentation. - - Released the `await_support` feature flag. The agent now relies on async_hooks to track async promise propagation. The net result is the if you had `feature_flag.await_support` set to false, the legacy instrumentation tracked every function in a promise chain as a separate segment. - -* **BREAKING**: Removed instrumentation for the obsolete [oracle](https://www.npmjs.com/package/oracle) npm package. - -* **BREAKING**: Updated the minimum version of `pg` to be 8.2.x. This is the earliest support version that runs on Node 14+. - -* **BREAKING**: Updated the minimum supported version of hapi to be >= v20.0.0. All versions < v20.0.0 are deprecated by hapi for security reasons, see their [support policy](https://hapi.dev/policies/support/). - * Dropped tests for hapi < v20.0.0. - -* Bumped `@newrelic/test-utilities` to ^7.0.0. - - This new version of test utilities defaults the number of concurrent jobs to currently available CPUs. For local development on modern machines, this can speed up full versioned test runs by 30-40%. - -* Introduced JOBS ENV var for agent versioned test runs to control number of attempted concurrent test folder runs. Set to 4 for CI runs in GHA. - -* Removed the async library from distributed tracing and pricing integration tests - -### v8.17.1 (2022-08-02) - * Fixed issue where instrumented code invoked within a @grpc/grpc-js client callback would not get tracked by the agent. - - Bound the external client segment to the onReceiveStatus listener to propagate transaction context to the grpc client callbacks. - - * Fixed issue with truncate in `lib/util/application-logging.js`. It now checks that the argument is a string before checking its length. - -### v8.17.0 (2022-07-27) - -* Added instrumentation for `grpc-js` server unary, client-streaming, server-streaming and bidirectional streaming handlers. - -### v8.16.0 (2022-07-21) - -* Automatic application log forwarding is now enabled by default. This version of the agent will automatically send enriched application logs to New Relic. To learn more about about this feature, see the [APM logs in context documentation](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context/). For additional configuration options, see the [Node.js logs in context documentation](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-nodejs). To learn about how to toggle log ingestion on or off by account, see our documentation to [disable automatic logging](https://docs.newrelic.com/docs/logs/logs-context/disable-automatic-logging) via the UI or API. - -* Added a support statement to our release notes - -* Added node 18 to CI workflows. - -### v8.15.0 (2022-07-07) - -* Added instrumentation for grpc-js unary, streaming, and bidirectional client calls. - -* Added ability to disable server-side configuration via local configuration setting: `ignore_server_configuration` or environmental variable of `NEW_RELIC_IGNORE_SERVER_SIDE_CONFIG`. - -* Added tests for client, server and bidirectional streaming of gRPC client. - -* Updated [got](https://github.com/sindresorhus/got) from 8.3.2 to 11.8.5. - -* Updated [moment](https://github.com/moment/moment) from 2.29.2 to 2.29.4 - -### v8.14.1 (2022-06-09) - -* Added defensive code in redis v4 instrumentation to check for `opts.socket` first before evaluating `opts.socket.path`. - Thanks @RAshidAZ for your contribution! - -* Updated `@grpc/proto-loader` to v0.6.13 to pickup security fixes in protobufjs. - -### v8.14.0 (2022-06-06) - -* Fixed issue with `api.getBrowserTimingHeader` optional script unwrapping issue with util.format. - Thanks for your contribution @github-dd-nicolas 🎉 - -* Fixed winston instrumentation to not exit early when `winston.createLogger` is created without options. - -* Updated pino instrumentation to not override user log configurations. - -### v8.13.2 (2022-05-31) - -* Upgraded `protobufjs` to resolve CVE-2022-25878 - -### v8.13.1 (2022-05-27) - -* Fixed passing undefined as a formatter options to `winston.format.combine` - - Thanks to Rana Mohammad (@rjmohammad) for the contribution. 🎉 - -### v8.13.0 (2022-05-26) - -* Moved log forwarding logic to a transport so customer transports are not polluted with NR linking metadata and timestamp and error manipulations. - -* Prevented transmitting logs when application level logging has been disabled. - -### v8.12.0 (2022-05-24) - -* Added instrumentation to pino to support application logging use cases: forwarding, local decorating, and metrics. - -* Added supportability metrics about the data usage bytes of harvested data to the collector endpoints. - -* Added an optional way to avoid wrapping browser agent script with ` -const RUM_STUB_SHELL_WITH_NONCE_PARAM = `` - -// these messages are used in the _gracefail() method below in getBrowserTimingHeader -const RUM_ISSUES = [ - 'NREUM: no browser monitoring headers generated; disabled', - 'NREUM: transaction ignored while generating browser monitoring headers', - 'NREUM: config.browser_monitoring missing, something is probably wrong', - 'NREUM: browser_monitoring headers need a transaction name', - 'NREUM: browser_monitoring requires valid application_id', - 'NREUM: browser_monitoring requires valid browser_key', - 'NREUM: browser_monitoring requires js_agent_loader script', - 'NREUM: browser_monitoring disabled by browser_monitoring.loader config' -] - -// Can't overwrite internal parameters or all heck will break loose. -const CUSTOM_DENYLIST = new Set(['nr_flatten_leading']) - -const CUSTOM_EVENT_TYPE_REGEX = /^[a-zA-Z0-9:_ ]+$/ - -/** - * The exported New Relic API. This contains all of the functions meant to be - * used by New Relic customers. For now, that means transaction naming. - * - * You do not need to directly instantiate this class, as an instance of this is - * the return from `require('newrelic')`. - * - * @param {object} agent Instantiation of lib/agent.js - * @class - */ -function API(agent) { - this.agent = agent - this.shim = new TransactionShim(agent, 'NewRelicAPI') - this.awsLambda = new AwsLambda(agent) -} - -/** - * Give the current transaction a custom name. Overrides any New Relic naming - * rules set in configuration or from New Relic's servers. - * - * IMPORTANT: this function must be called when a transaction is active. New - * Relic transactions are tied to web requests, so this method may be called - * from within HTTP or HTTPS listener functions, Express routes, or other - * contexts where a web request or response object are in scope. - * - * @param {string} name The name you want to give the web request in the New - * Relic UI. Will be prefixed with 'Custom/' when sent. - * @returns {void} - */ -API.prototype.setTransactionName = function setTransactionName(name) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/setTransactionName' - ) - metric.incrementCallCount() - - const transaction = this.agent.tracer.getTransaction() - if (!transaction) { - return logger.warn("No transaction found when setting name to '%s'.", name) - } - - if (!name) { - if (transaction && transaction.url) { - logger.error('Must include name in setTransactionName call for URL %s.', transaction.url) - } else { - logger.error('Must include name in setTransactionName call.') - } - - return - } - - logger.trace('Setting transaction %s name to %s', transaction.id, name) - transaction.forceName = NAMES.CUSTOM + '/' + name -} - -/** - * This method returns an object with the following methods: - * - end: end the transaction that was active when `API#getTransaction` - * was called. - * - * - ignore: set the transaction that was active when - * `API#getTransaction` was called to be ignored. - * - * @returns {TransactionHandle} The transaction object with the `end` and - * `ignore` methods on it. - */ -API.prototype.getTransaction = function getTransaction() { - const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/getTransaction') - metric.incrementCallCount() - - const transaction = this.agent.tracer.getTransaction() - if (!transaction) { - logger.debug('No transaction found when calling API#getTransaction') - return new TransactionHandle.Stub() - } - - transaction.handledExternally = true - - return new TransactionHandle(transaction, this.agent.metrics) -} - -/** - * This method returns an object with the following keys/data: - * - `trace.id`: The current trace ID - * - `span.id`: The current span ID - * - `entity.name`: The application name specified in the connect request as - * app_name. If multiple application names are specified this will only be - * the first name - * - `entity.type`: The string "SERVICE" - * - `entity.guid`: The entity ID returned in the connect reply as entity_guid - * - `hostname`: The hostname as specified in the connect request as - * utilization.full_hostname. If utilization.full_hostname is null or empty, - * this will be the hostname specified in the connect request as host. - * - * @param {boolean} omitSupportability Whether or not to log the supportability metric, true means skip - * @returns {object} The LinkingMetadata object with the data above - */ -API.prototype.getLinkingMetadata = function getLinkingMetadata(omitSupportability) { - if (omitSupportability !== true) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/getLinkingMetadata' - ) - metric.incrementCallCount() - } - - return this.agent.getLinkingMetadata() -} - -/** - * Specify the `Dispatcher` and `Dispatcher Version` environment values. - * A dispatcher is typically the service responsible for brokering - * the request with the process responsible for responding to the - * request. For example Node's `http` module would be the dispatcher - * for incoming HTTP requests. - * - * @param {string} name The string you would like to report to New Relic - * as the dispatcher. - * @param {string} [version] The dispatcher version you would like to - * report to New Relic - */ -API.prototype.setDispatcher = function setDispatcher(name, version) { - const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/setDispatcher') - metric.incrementCallCount() - - if (!name || typeof name !== 'string') { - logger.error('setDispatcher must be called with a name, and name must be a string.') - return - } - - // No objects allowed. - if (version && typeof version !== 'object') { - version = String(version) - } else { - logger.info('setDispatcher was called with an object as the version parameter') - version = null - } - - this.agent.environment.setDispatcher(name, version, true) -} - -/** - * Give the current transaction a name based on your own idea of what - * constitutes a controller in your Node application. Also allows you to - * optionally specify the action being invoked on the controller. If the action - * is omitted, then the API will default to using the HTTP method used in the - * request (e.g. GET, POST, DELETE). Overrides any New Relic naming rules set - * in configuration or from New Relic's servers. - * - * IMPORTANT: this function must be called when a transaction is active. New - * Relic transactions are tied to web requests, so this method may be called - * from within HTTP or HTTPS listener functions, Express routes, or other - * contexts where a web request or response object are in scope. - * - * @param {string} name The name you want to give the controller in the New - * Relic UI. Will be prefixed with 'Controller/' when - * sent. - * @param {string} action The action being invoked on the controller. Defaults - * to the HTTP method used for the request. - * @returns {void} - */ -API.prototype.setControllerName = function setControllerName(name, action) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/setControllerName' - ) - metric.incrementCallCount() - - const transaction = this.agent.tracer.getTransaction() - if (!transaction) { - return logger.warn('No transaction found when setting controller to %s.', name) - } - - if (!name) { - if (transaction && transaction.url) { - logger.error('Must include name in setControllerName call for URL %s.', transaction.url) - } else { - logger.error('Must include name in setControllerName call.') - } - - return - } - - action = action || transaction.verb || 'GET' - transaction.forceName = NAMES.CONTROLLER + '/' + name + '/' + action -} - -/** - * Add a custom attribute to the current transaction. Some attributes are - * reserved (see CUSTOM_DENYLIST for the current, very short list), and - * as with most API methods, this must be called in the context of an - * active transaction. Most recently set value wins. - * - * @param {string} key The key you want displayed in the RPM UI. - * @param {string} value The value you want displayed. Must be serializable. - * @returns {false|undefined} Retruns false when disabled/errored, otherwise undefined - */ -API.prototype.addCustomAttribute = function addCustomAttribute(key, value) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/addCustomAttribute' - ) - metric.incrementCallCount() - - // If high security mode is on, custom attributes are disabled. - if (this.agent.config.high_security) { - logger.warnOnce('Custom attributes', 'Custom attributes are disabled by high security mode.') - return false - } else if (!this.agent.config.api.custom_attributes_enabled) { - logger.debug('Config.api.custom_attributes_enabled set to false, not collecting value') - return false - } - - const transaction = this.agent.tracer.getTransaction() - if (!transaction) { - logger.warn('No transaction found for custom attributes.') - return false - } - - const trace = transaction.trace - if (!trace.custom) { - logger.warn('Could not add attribute %s to nonexistent custom attributes.', key) - return false - } - - if (CUSTOM_DENYLIST.has(key)) { - logger.warn('Not overwriting value of NR-only attribute %s.', key) - return false - } - - trace.addCustomAttribute(key, value) - - const spanContext = this.agent.tracer.getSpanContext() - if (!spanContext) { - logger.debug('No span found for custom attributes.') - // success/failure is ambiguous here. since at least 1 attempt tried, not returning false - return - } - - spanContext.addCustomAttribute(key, value, spanContext.ATTRIBUTE_PRIORITY.LOW) -} - -/** - * Adds all custom attributes in an object to the current transaction. - * - * See documentation for newrelic.addCustomAttribute for more information on - * setting custom attributes. - * - * An example of setting a custom attribute object: - * - * newrelic.addCustomAttributes({test: 'value', test2: 'value2'}); - * - * @param {object} [atts] Attribute object - * @param {string} [atts.KEY] The name you want displayed in the RPM UI. - * @param {string} [atts.KEY.VALUE] The value you want displayed. Must be serializable. - */ -API.prototype.addCustomAttributes = function addCustomAttributes(atts) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/addCustomAttributes' - ) - metric.incrementCallCount() - - for (const key in atts) { - if (!properties.hasOwn(atts, key)) { - continue - } - - this.addCustomAttribute(key, atts[key]) - } -} - -/** - * Add custom span attributes in an object to the current segment/span. - * - * See documentation for newrelic.addCustomSpanAttribute for more information. - * - * An example of setting a custom span attribute: - * - * newrelic.addCustomSpanAttribute({test: 'value', test2: 'value2'}) - * - * @param {object} [atts] Attribute object - * @param {string} [atts.KEY] The name you want displayed in the RPM UI.API. - * @param {string} [atts.KEY.VALUE] The value you want displayed. Must be serializable. - */ -API.prototype.addCustomSpanAttributes = function addCustomSpanAttributes(atts) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/addCustomSpanAttributes' - ) - metric.incrementCallCount() - - for (const key in atts) { - if (properties.hasOwn(atts, key)) { - this.addCustomSpanAttribute(key, atts[key]) - } - } -} - -/** - * Add a custom span attribute to the current transaction. Some attributes - * are reserved (see CUSTOM_DENYLIST for the current, very short list), and - * as with most API methods, this must be called in the context of an - * active segment/span. Most recently set value wins. - * - * @param {string} key The key you want displayed in the RPM UI. - * @param {string} value The value you want displayed. Must be serializable. - * @returns {false|undefined} Retruns false when disabled/errored, otherwise undefined - */ -API.prototype.addCustomSpanAttribute = function addCustomSpanAttribute(key, value) { - const metric = this.agent.metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.API + '/addCustomSpanAttribute' - ) - metric.incrementCallCount() - - // If high security mode is on, custom attributes are disabled. - if (this.agent.config.high_security) { - logger.warnOnce( - 'Custom span attributes', - 'Custom span attributes are disabled by high security mode.' - ) - return false - } else if (!this.agent.config.api.custom_attributes_enabled) { - logger.debug('Config.api.custom_attributes_enabled set to false, not collecting value') - return false - } - - const spanContext = this.agent.tracer.getSpanContext() - - if (!spanContext) { - logger.debug('Could not add attribute %s. No available span.', key) - return false - } - - if (CUSTOM_DENYLIST.has(key)) { - logger.warn('Not overwriting value of NR-only attribute %s.', key) - return false - } - - spanContext.addCustomAttribute(key, value) -} - -/** - * Send errors to New Relic that you've already handled yourself. Should be an - * `Error` or one of its subtypes, but the API will handle strings and objects - * that have an attached `.message` or `.stack` property. - * - * An example of using this function is - * - * try { - * performSomeTask(); - * } catch (err) { - * newrelic.noticeError( - * err, - * {extraInformation: "error already handled in the application"}, - * true - * ); - * } - * - * NOTE: Errors that are recorded using this method do _not_ obey the - * `ignore_status_codes` configuration. - * - * @param {Error} error - * The error to be traced. - * @param {object} [customAttributes] - * Optional. Any custom attributes to be displayed in the New Relic UI. - * @param {boolean} expected - * Optional. False by default. True if the error is expected, meaning it should be collected - * for error events and traces, but should not impact error rate. - * @returns {false|undefined} Returns false when disabled/errored, otherwise undefined - */ -API.prototype.noticeError = function noticeError(error, customAttributes, expected = false) { - const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/noticeError') - metric.incrementCallCount() - - // let users skip the custom attributes if they want - if (customAttributes && typeof customAttributes === 'boolean') { - expected = customAttributes - customAttributes = null - } - - if (!this.agent.config.api.notice_error_enabled) { - logger.debug('Config.api.notice_error_enabled set to false, not collecting error') - return false - } - - // If high security mode is on or custom attributes are disabled, - // noticeError does not collect custom attributes. - if (this.agent.config.high_security) { - logger.debug('Passing custom attributes to notice error API is disabled in high security mode.') - } else if (!this.agent.config.api.custom_attributes_enabled) { - logger.debug( - 'Config.api.custom_attributes_enabled set to false, ' + 'ignoring custom error attributes.' - ) - } - - if (typeof error === 'string') { - error = new Error(error) - } - - // Filter all object type valued attributes out - let filteredAttributes = customAttributes - if (customAttributes) { - filteredAttributes = _filterAttributes(customAttributes, 'noticeError') - } - - const transaction = this.agent.tracer.getTransaction() - this.agent.errors.addUserError(transaction, error, filteredAttributes, expected) -} - -/** - * Sends an application log message to New Relic. The agent already - * automatically does this for some instrumented logging libraries, - * but in case you are using another logging method that is not - * already instrumented by the agent, you can use this function - * instead. - * - * If application log forwarding is disabled in the agent - * configuration, this function does nothing. - * - * An example of using this function is - * - * newrelic.recordLogEvent({ - * message: 'cannot find file', - * level: 'ERROR', - * error: new SystemError('missing.txt') - * }) - * - * @param {object} logEvent The log event object to send. Any - * attributes besides `message`, `level`, `timestamp`, and `error` are - * recorded unchanged. The `logEvent` object itself will be mutated by - * this function. - * @param {string} logEvent.message The log message. - * @param {string} logEvent.level The log level severity. If this key is - * missing, it will default to UNKNOWN - * @param {number} logEvent.timestamp ECMAScript epoch number denoting the - * time that this log message was produced. If this key is missing, - * it will default to the output of `Date.now()`. - * @param {Error} logEvent.error Error associated to this log event. Ignored if missing. - */ -API.prototype.recordLogEvent = function recordLogEvent(logEvent = {}) { - const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/recordLogEvent') - metric.incrementCallCount() - - if (!applicationLogging.isLogForwardingEnabled(this.agent.config, this.agent)) { - logger.warnOnce( - 'Record logs', - 'Application log forwarding disabled, method API#recordLogEvent will not record messages' - ) - return - } - - // If they don't pass a logEvent object, or it doesn't have the - // required `message` key, bail out. - if (typeof logEvent !== 'object' || logEvent.message === undefined) { - logger.warn( - 'recordLogEvent requires an object with a `message` attribute for its single argument, got %s (%s)', - stringify(logEvent), - typeof logEvent - ) - return - } - logEvent.message = applicationLogging.truncate(logEvent.message) - - if (!logEvent.level) { - logger.debug('no log level set, setting it to UNKNOWN') - logEvent.level = 'UNKNOWN' - } - - if (typeof logEvent.timestamp !== 'number') { - logger.debug('no timestamp set, setting it to `Date.now()`') - logEvent.timestamp = Date.now() - } - - if (logEvent.error) { - logEvent['error.message'] = applicationLogging.truncate(logEvent.error.message) - logEvent['error.stack'] = applicationLogging.truncate(logEvent.error.stack) - logEvent['error.class'] = - logEvent.error.name === 'Error' ? logEvent.error.constructor.name : logEvent.error.name - delete logEvent.error - } - - if (applicationLogging.isMetricsEnabled(this.agent.config)) { - applicationLogging.incrementLoggingLinesMetrics(logEvent.level, this.agent.metrics) - } - - const metadata = this.agent.getLinkingMetadata() - this.agent.logs.add(Object.assign({}, logEvent, metadata)) -} - -/** - * If the URL for a transaction matches the provided pattern, name the - * transaction with the provided name. If there are capture groups in the - * pattern (which is a standard JavaScript regular expression, and can be - * passed as either a RegExp or a string), then the substring matches ($1, $2, - * etc.) are replaced in the name string. BE CAREFUL WHEN USING SUBSTITUTION. - * If the replacement substrings are highly variable (i.e. are identifiers, - * GUIDs, or timestamps), the rule will generate too many metrics and - * potentially get your application blocked by New Relic. - * - * An example of a good rule with replacements: - * - * newrelic.addNamingRule('^/storefront/(v[1-5])/(item|category|tag)', - * 'CommerceAPI/$1/$2') - * - * An example of a bad rule with replacements: - * - * newrelic.addNamingRule('^/item/([0-9a-f]+)', 'Item/$1') - * - * Keep in mind that the original URL and any query parameters will be sent - * along with the request, so slow transactions will still be identifiable. - * - * Naming rules can not be removed once added. They can also be added via the - * agent's configuration. See configuration documentation for details. - * - * @param {RegExp} pattern The pattern to rename (with capture groups). - * @param {string} name The name to use for the transaction. - * @returns {void} - */ -API.prototype.addNamingRule = function addNamingRule(pattern, name) { - const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/addNamingRule') - metric.incrementCallCount() - - if (!name) { - return logger.error('Simple naming rules require a replacement name.') - } - - this.agent.userNormalizer.addSimple(pattern, '/' + name) -} - -/** - * If the URL for a transaction matches the provided pattern, ignore the - * transaction attached to that URL. Useful for filtering socket.io connections - * and other long-polling requests out of your agents to keep them from - * distorting an app's apdex or mean response time. Pattern may be a (standard - * JavaScript) RegExp or a string. - * - * Example: - * - * newrelic.addIgnoringRule('^/socket\\.io/') - * - * @param {RegExp} pattern The pattern to ignore. - * @returns {void} - */ -API.prototype.addIgnoringRule = function addIgnoringRule(pattern) { - const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/addIgnoringRule') - metric.incrementCallCount() - - if (!pattern) { - return logger.error('Must include a URL pattern to ignore.') - } - - this.agent.userNormalizer.addSimple(pattern, null) -} - -/** - * Gracefully fail. - * - * Output an HTML comment and log a warning the comment is meant to be - * innocuous to the end user. - * - * @see RUM_ISSUES - * @param {number} errorCode Error code from `RUM_ISSUES`. - * @param {boolean} [quiet=false] Be quiet about this failure. - * @returns {string} HTML comment for debugging purposes with specific error code - */ -function _gracefail(errorCode, quiet) { - if (quiet) { - logger.debug(RUM_ISSUES[errorCode]) - } else { - logger.warn(RUM_ISSUES[errorCode]) - } - return '' -} - -/** - * Function for generating a fully formed RUM header based on configuration options - * - * @param {object} options Configuration options for RUM - * @param {string} [options.nonce] Nonce to inject into ` header necessary for Browser Monitoring - * This script must be manually injected into your templates, as high as possible - * in the header, but _after_ any X-UA-COMPATIBLE HTTP-EQUIV meta tags. - * Otherwise you may hurt IE! - * - * This method must be called _during_ a transaction, and must be called every - * time you want to generate the headers. - * - * Do *not* reuse the headers between users, or even between requests. - */ - enable: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_BROWSER_MONITOR_ENABLE' - }, - /** - * Request un-minified sources from the server. - */ - debug: { - formatter: boolean, - default: false, - env: 'NEW_RELIC_BROWSER_MONITOR_DEBUG' - } - }, - /** - * API Configuration - * - * Some API end points can be turned off via configuration settings to - * allow for more flexible security options. All API configuration - * options are disabled when high-security mode is enabled. - */ - api: { - /** - * Controls for the `API.addCustomAttribute` method. - */ - custom_attributes_enabled: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_API_CUSTOM_ATTRIBUTES' - }, - /** - * Controls for the `API.recordCustomEvent` method. - */ - custom_events_enabled: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_API_CUSTOM_EVENTS' - }, - /** - * Controls for the `API.noticeError` method. - */ - notice_error_enabled: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_API_NOTICE_ERROR' - }, - /** - * Sets the path to custom ESM instrumentation - */ - esm: { - custom_instrumentation_entrypoint: { - default: null - } - } - }, - /** - * Transaction Events - * - * Transaction events are sent to New Relic Insights. This event data - * includes transaction timing, transaction name, and any custom parameters. - * - * Read more here: http://newrelic.com/insights - */ - transaction_events: { - attributes: { - /** - * If `true`, the agent captures attributes from transaction events. - */ - enabled: { - formatter: boolean, - default: true - }, - /** - * Prefix of attributes to exclude in transaction events. - * Allows * as wildcard at end. - * - * env NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDE - */ - exclude: { - formatter: array, - default: [] - }, - /** - * Prefix of attributes to include in transaction events. - * Allows * as wildcard at end. - * - * env NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDE - */ - include: { - formatter: array, - default: [] - } - }, - /** - * If this is disabled, the agent does not collect, nor try to send, - * analytic data. - */ - enabled: { - formatter: boolean, - default: true - }, - /** - * The agent will collect all events up to this number per minute. If - * there are more than that, a statistical sampling will be collected. - */ - max_samples_stored: { - formatter: int, - default: 10000 - } - }, - /** - * Custom Insights Events - * - * Custom insights events are JSON object that are sent to New Relic - * Insights. You can tell the agent to send your custom events via the - * `newrelic.recordCustomEvent()` API. These events are sampled once the max - * queue size is reached. You can tune this setting below. - * - * Read more here: http://newrelic.com/insights - */ - custom_insights_events: { - /** - * If this is disabled, the agent does not collect, nor try to send, custom - * event data. - */ - enabled: { - formatter: boolean, - default: true - }, - /** - * The agent will collect all events up to this number per minute. If there - * are more than that, a statistical sampling will be collected. Currently - * this uses a priority sampling algorithm. - * - * By increasing this setting you are both increasing the memory - * requirements of the agent as well as increasing the payload to the New - * Relic servers. The memory concerns are something you should consider for - * your own server's sake. The payload of events is compressed, but if it - * grows too large the New Relic servers may reject it. - */ - max_samples_stored: { - formatter: int, - default: 3000 - } - }, - /** - * This is used to configure properties about the user's host name. - */ - process_host: { - /** - * Configurable display name for hosts - */ - display_name: '', - /** - * ip address preference when creating hostnames - */ - ipv_preference: { - formatter: allowList.bind(null, ['4', '6']), - default: '4', - env: 'NEW_RELIC_IPV_PREFERENCE' - } - }, - /** - * High Security - * - * High security mode (v2) is a setting which prevents any sensitive data from - * being sent to New Relic. The local setting must match the server setting. - * If there is a mismatch the agent will log a message and act as if it is - * disabled. - * - * Attributes of high security mode (when enabled): - * requires SSL - * does not allow capturing of http params - * does not allow custom params - * - * To read more see: https://docs.newrelic.com/docs/subscriptions/high-security - */ - high_security: { - formatter: boolean, - default: false - }, - - /** - * Labels - * - * An object of label names and values that will be applied to the data sent - * from this agent. Both label names and label values have a maximum length of - * 255 characters. This object should contain at most 64 labels. - */ - labels: { - default: {} - }, - /** - * These options control behavior for slow queries, but do not affect sql - * nodes in transaction traces. - */ - slow_sql: { - /** - * Enables and disables `slow_sql` recording. - */ - enabled: { - formatter: boolean, - default: false - }, - - /** - * Sets the maximum number of slow query samples that will be collected in a - * single harvest cycle. - * - * env NEW_RELIC_MAX_SQL_SAMPLES - */ - max_samples: { - formatter: int, - default: 10, - env: 'NEW_RELIC_MAX_SQL_SAMPLES' - } - }, - /** - * Controls behavior of datastore instance metrics. - * - * @property {object} instance_reporting container around enabling flag - * @property {boolean} [instance_reporting.enabled=true] - * Enables reporting the host and port/path/id of database servers. Default - * is `true`. - * @property {object} database_name_reporting container around enabling flag - * @property {boolean} [database_name_reporting.enabled=true] - * Enables reporting of database/schema names. Default is `true`. - */ - datastore_tracer: { - instance_reporting: { - enabled: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_DATASTORE_INSTANCE_REPORTING_ENABLED' - } - }, - database_name_reporting: { - enabled: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_DATASTORE_DATABASE_NAME_REPORTING_ENABLED' - } - } - }, - /** - * Controls behavior of gRPC server instrumentation. - */ - grpc: { - /** - * Enables recording of non-zero gRPC status codes. Default is `true`. - */ - record_errors: { - formatter: boolean, - default: true - }, - /** - * List of gRPC error status codes the error tracer should disregard. - * Ignoring a status code means that the transaction is not renamed to - * match the code, and the request is not treated as an error by the error - * collector. - * - * NOTE: This configuration value has no effect on errors recorded using - * `noticeError()`. - * - * Defaults to no codes ignored. - */ - ignore_status_codes: { - formatter: array, - default: [] - } - }, - /** - * Controls the behavior of span events produced by the agent. - */ - span_events: { - /** - * Enables/disables span event generation - */ - enabled: { - formatter: boolean, - default: true - }, - - attributes: { - /** - * If `true`, the agent captures attributes from span events. - */ - enabled: { - formatter: boolean, - default: true - }, - /** - * Prefix of attributes to exclude in span events. - * Allows * as wildcard at end. - */ - exclude: { - formatter: array, - default: [] - }, - /** - * Prefix of attributes to include in span events. - * Allows * as wildcard at end. - */ - include: { - formatter: array, - default: [] - } - }, - /** - * The agent will collect all events up to this number per minute. If - * there are more than that, a statistical sampling will be collected. - */ - max_samples_stored: { - formatter: int, - default: 2000 - } - }, - /** - * Controls the behavior of transaction segments produced by the agent. - */ - transaction_segments: { - attributes: { - /** - * If `true`, the agent captures attributes from transaction segments. - */ - enabled: { - formatter: boolean, - default: true - }, - /** - * Prefix of attributes to exclude in transaction segments. - * Allows * as wildcard at end. - */ - exclude: { - formatter: array, - default: [] - }, - /** - * Prefix of attributes to include in transaction segments. - * Allows * as wildcard at end. - */ - include: { - formatter: array, - default: [] - } - } - }, - /** - * Controls the method of cross agent tracing in the agent. - * Distributed tracing lets you see the path that a request takes through your - * distributed system. Enabling distributed tracing changes the behavior of some - * New Relic features, so carefully consult the transition guide before you enable - * this feature: https://docs.newrelic.com/docs/transition-guide-distributed-tracing - * Default is true. - */ - distributed_tracing: { - /** - * Enables/disables distributed tracing. - */ - enabled: { - formatter: boolean, - default: true - }, - - /** - * Excludes New Relic format distributed tracing header (`newrelic`) on - * outbound requests when set to `true`. By default (when false) - * both W3C TraceContext (`traceparent`, `tracecontext`) and - * New Relic formats will be sent. - */ - exclude_newrelic_header: { - formatter: boolean, - default: false - } - }, - /** - * Controls the use of cross-application tracing. - * - * @property {boolean} [enabled=false] - * Enables tracing transactions across multiple applications. Default is `false`. - * This feature has been deprecated in favor of Distributed Tracing (DT). - * To fully enable this feature, you must also disable DT in your configuration. - */ - cross_application_tracer: { - enabled: { - formatter: boolean, - default: false - } - }, - /** - * Controls behavior of message broker tracing. - * - * @property {object} segment_parameters property around enabling flag - * @property {boolean} [segment_parameters.enabled=true] - * Enables reporting parameters on message broker segments. - */ - message_tracer: { - segment_parameters: { - enabled: { - formatter: boolean, - default: true - } - } - }, - /** - * Controls the use of infinite tracing. - */ - infinite_tracing: { - trace_observer: { - /** - * The URI HOST of the observer. Setting this enables infinite tracing. - */ - host: '', - /** - * The URI PORT of the observer. - */ - port: { - formatter: int, - default: 443 - } - }, - span_events: { - /** - * The amount of spans to hold onto before dropping them - */ - queue_size: { - formatter: int, - default: 10000 - } - }, - batching: { - formatter: boolean, - default: true - }, - compression: { - formatter: boolean, - default: true - } - }, - /** - * Specifies whether the agent will be used to monitor serverless functions. - * For example: AWS Lambda - */ - serverless_mode: { - enabled: { - formatter: boolean, - default: process.env.AWS_LAMBDA_FUNCTION_NAME != null - } - }, - plugins: { - /** - * Controls usage of the native metrics module which samples VM and event - * loop data. - */ - native_metrics: { - enabled: { - formatter: boolean, - default: true, - env: 'NEW_RELIC_NATIVE_METRICS_ENABLED' - } - } - }, - /** - * - * Controls the behavior of Logs in Context within agent - */ - application_logging: { - /** - * Toggles the ability for all application logging features to be enabled. - */ - enabled: { - formatter: boolean, - default: true - }, - forwarding: { - /** - * Toggles whether the agent gathers log records for sending to New Relic. - */ - enabled: { - formatter: boolean, - default: true - }, - /** - * Number of log records to send per minute to New Relic. - */ - max_samples_stored: { - formatter: int, - default: 10000 - } - }, - metrics: { - /** - * Toggles whether the agent gathers logging metrics. - */ - enabled: { - formatter: boolean, - default: true - } - }, - local_decorating: { - /** - * Toggles whether the agent performs log decoration on standard log output. - */ - enabled: { - formatter: boolean, - default: false - } - } - }, - /** - * You may want more control over how your agent is configured and want to - * disallow the use of New Relic's server-side configuration for agents. - * To do so, set this to true. - * - * env NEW_RELIC_IGNORE_SERVER_SIDE_CONFIG - */ - ignore_server_configuration: { - formatter: boolean, - default: false, - env: 'NEW_RELIC_IGNORE_SERVER_SIDE_CONFIG' - }, - - /** - * Toggles whether to capture code.* attributes on spans - */ - code_level_metrics: { - enabled: { - formatter: boolean, - default: false - } - }, - - /** - * Obfuscates URL parameters - * for outgoing and incoming requests - * for distrubuted tracing attributes - both transaction and span attributes - * for transaction trace transaction details - */ - url_obfuscation: { - /** - * Toggles whether to obfuscate URL parameters - */ - enabled: { - formatter: boolean, - default: false - }, - - regex: { - /** - * A regular expression to match URL parameters to obfuscate - */ - pattern: { - formatter: regex, - default: null - }, - - /** - * A string containing RegEx flags to use when matching URL parameters - */ - flags: { - default: '' - }, - - /** - * A string containing a replacement value for URL parameters - * can contain refferences to capture groups in the pattern - */ - replacement: { - default: '' - } - } - }, - /** - * Security agent configurations - */ - security: { - /** - * Toggles the generation of security events by the security agent. - */ - enabled: { - formatter: boolean, - default: false - }, - - /** - * Flag to tell the Node.js agent to load the security agent. - * This property is read only once at application start. - */ - agent: { - enabled: { - formatter: boolean, - default: false - } - }, - - /** - * Security agent provides two modes: IAST and RASP. Default is IAST. - */ - mode: { - formatter: allowList.bind(null, ['IAST', 'RASP']), - default: 'IAST' - }, - - /** - * Security agent validator URL. Must be prefixed with wss://. - */ - validator_service_url: { - default: 'wss://csec.nr-data.net' - }, - - /** - * Provide ability to toggle sending security events for the following rules. - */ - detection: { - rci: { - enabled: { - formatter: boolean, - default: true - } - }, - rxss: { - enabled: { - formatter: boolean, - default: true - } - }, - deserialization: { - enabled: { - formatter: boolean, - default: true - } - } - } - }, - - heroku: { - use_dyno_names: { - default: true, - formatter: boolean - } - } -}) - -/** - * Creates a new default config - * - * @returns {object} default configuration object - */ -defaultConfig.config = () => { - const config = Object.create(null) - const definition = defaultConfig.definition() - buildConfig(definition, config) - return config -} - -/** - * Iterates over the configuration definition and sets all default - * values. - * - * @param {object} definition configuration definition for a given leaf node - * @param {object} config object that is used to construct the agent config - * @param {Array} [paths=[]] an array to capture the leaf node keys to properly assign defaults for nested objects - * @param {int} [objectKeys=1] amount of keys in a given leaf node - */ -function buildConfig(definition, config, paths = [], objectKeys = 1) { - let keysSeen = 0 - Object.entries(definition).reduce((conf, [key, value]) => { - const type = typeof value - keysSeen++ - if (type === 'string') { - assignConfigValue({ config: conf, key, value, paths }) - } else if (type === 'object') { - if (value.hasOwnProperty('default')) { - assignConfigValue({ config: conf, key, value: value.default, paths }) - } else { - // add the current leaf node key to the paths and recurse through function again - const { length } = Object.keys(value) - paths.push(key) - buildConfig(definition[key], conf, paths, length) - } - } - - return conf - }, config) - - // we have traversed every key in current object leaf node, remove wrapping key - // to properly derive env vars of future leaf nodes - if (keysSeen === objectKeys) { - paths.pop() - } -} - -/** - * Assigns a value to a configuration option. In the case of a nested key - * it will properly build the structure leading to the value - * - * @param {object} params args to fn - * @param {object} params.config object that is used to construct the agent config - * @param {string} params.key name of the configuration option - * @param {string} params.value value the configuration option - * @param {Array} [params.paths=[]] an array to capture the leaf node keys to properly assign defaults for nested objects - */ -function assignConfigValue({ config, key, value, paths }) { - if (paths.length) { - setNestedKey(config, [...paths, key], value) - } else { - config[key] = value - } -} - -/** - * Properly sets the value of a nested key by creating the shells of empty parents - * - * @param {object} obj object to assign value to - * @param {Array} keys list of parent keys - * @param {value} value to assign the nested key - */ -function setNestedKey(obj, keys, value) { - const len = keys.length - for (let i = 0; i < len - 1; i++) { - const elem = keys[i] - if (!obj[elem]) { - obj[elem] = {} - } - - obj = obj[elem] - } - - obj[keys[len - 1]] = value -} -defaultConfig.setNestedKey = setNestedKey diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/formatters.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/formatters.js deleted file mode 100644 index 9148aeb70..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/formatters.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const formatters = module.exports - -/** - * Splits a string by a ',' and trims whitespace - * - * @param {string} val config setting - * @param {Array} - */ -formatters.array = function array(val) { - return val.split(',').map((k) => k.trim()) -} - -/** - * Parses a config setting as an int - * - * @param {string} val config setting - * @returns {int} - */ -formatters.int = function int(val) { - return parseInt(val, 10) -} - -/** - * Parses a config setting as a float - * - * @param {string} val config setting - * @returns {float} - */ -formatters.float = function float(val) { - return parseFloat(val, 10) -} - -/** - * Parses a config setting as a boolean - * - * @param {string} val config setting - * @param setting - * @returns {boolean} - */ -formatters.boolean = function boolean(setting) { - if (setting == null) { - return false - } - - const normalized = setting.toString().toLowerCase() - switch (normalized) { - case 'false': - case 'f': - case 'no': - case 'n': - case 'disabled': - case '0': - return false - - default: - return true - } -} - -/** - * Parses a config setting as an object - * - * @param {string} val config setting - * @param {logger} logger agent logger instance - * @returns {object} - */ -formatters.object = function object(val, logger) { - try { - return JSON.parse(val) - } catch (error) { - logger.error('New Relic configurator could not deserialize object:') - logger.error(error.stack) - } -} - -/** - * Parse a config setting as a collection with 1 object - * - * @param {string} val config setting - * @param {logger} logger agent logger instance - * @returns {Array} - */ -formatters.objectList = function objectList(val, logger) { - try { - return JSON.parse('[' + val + ']') - } catch (error) { - logger.error('New Relic configurator could not deserialize object list:') - logger.error(error.stack) - } -} - -/** - * Checks if a value is within an allow list. If not it assigns - * the first element in allow list as default - * - * @param {Array} list allowable values - * @param {string} val config setting - * @returns {string} - */ -formatters.allowList = function allowList(list, val) { - return list.includes(val) ? val : list[0] -} - -/** - * Parse a config setting as a regex - * - * @param {string} val valid regex - * @param {logger} logger agent logger instance - * @returns {RegExp} regex - */ -formatters.regex = function regex(val, logger) { - try { - return new RegExp(val) - } catch (error) { - logger.error(`New Relic configurator could not validate regex: ${val}`) - logger.error(error.stack) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/harvest-config-validator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/harvest-config-validator.js deleted file mode 100644 index 324e8608c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/harvest-config-validator.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -function isValidHarvestConfig(harvestConfig) { - if (harvestConfig == null) { - return false - } - - const harvestLimits = harvestConfig.harvest_limits - - return ( - isValidHarvestValue(harvestConfig.report_period_ms) && - harvestLimits != null && - Object.keys(harvestLimits).length > 0 - ) -} - -function isValidHarvestValue(value) { - return !!(value != null && value >= 0) -} - -module.exports = { - isValidHarvestConfig: isValidHarvestConfig, - isValidHarvestValue: isValidHarvestValue -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/hsm.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/hsm.js deleted file mode 100644 index 048be54a2..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/hsm.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const flatten = require('../util/flatten') - -// Config keys that can't be set by the server if high_security is enabled -const HIGH_SECURITY_SETTINGS = { - ssl: true, - strip_exception_messages: { - enabled: true - }, - allow_all_headers: false, - attributes: { - include: [] - }, - transaction_tracer: { - record_sql: 'obfuscated', - attributes: { - include: [] - } - }, - error_collector: { - attributes: { - include: [] - } - }, - browser_monitoring: { - attributes: { - include: [] - } - }, - transaction_events: { - attributes: { - include: [] - } - }, - span_events: { - attributes: { - include: [] - } - }, - transaction_segments: { - attributes: { - include: [] - } - }, - slow_sql: { - enabled: false - }, - application_logging: { - forwarding: { - enabled: false - } - } -} - -const HIGH_SECURITY_KEYS = flatten.keys(HIGH_SECURITY_SETTINGS) - -// blank out these config values before sending to the collector -const REDACT_BEFORE_SEND = new Set([ - 'proxy_pass', - 'proxy_user', - 'proxy', - 'certificates' // should be public but in case user mistake and also these are huge -]) - -// process.domain needs to be stripped befeore sending -const REMOVE_BEFORE_SEND = new Set(['domain']) - -exports.HIGH_SECURITY_SETTINGS = HIGH_SECURITY_SETTINGS -exports.HIGH_SECURITY_KEYS = HIGH_SECURITY_KEYS -exports.REDACT_BEFORE_SEND = REDACT_BEFORE_SEND -exports.REMOVE_BEFORE_SEND = REMOVE_BEFORE_SEND diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/index.js deleted file mode 100644 index d78b6038e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/index.js +++ /dev/null @@ -1,1807 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const AttributeFilter = require('./attribute-filter') -const CollectorResponse = require('../collector/response') -const copy = require('../util/copy') -const { config: defaultConfig, definition, setNestedKey } = require('./default') -const EventEmitter = require('events').EventEmitter -const featureFlag = require('../feature_flags') -const flatten = require('../util/flatten') -const fs = require('../util/unwrapped-core').fs -const hashes = require('../util/hashes') -const os = require('os') -const parseKey = require('../collector/key-parser').parseKey -const path = require('path') -const stringify = require('json-stringify-safe') -const util = require('util') -const MergeServerConfig = require('./merge-server-config') -const harvestConfigValidator = require('./harvest-config-validator') -const mergeServerConfig = new MergeServerConfig() -const { boolean: isTruthular } = require('./formatters') -const configDefinition = definition() - -/** - * CONSTANTS -- we gotta lotta 'em - */ -const AZURE_APP_NAME = 'APP_POOL_ID' -const DEFAULT_MAX_PAYLOAD_SIZE_IN_BYTES = 1000000 -const DEFAULT_CONFIG_PATH = require.resolve('./default') -const BASE_CONFIG_PATH = require.resolve('../../newrelic') -const HAS_ARBITRARY_KEYS = new Set(['ignore_messages', 'expected_messages', 'labels']) - -const LASP_MAP = require('./lasp').LASP_MAP -const HSM = require('./hsm') -const REMOVE_BEFORE_SEND = new Set(['attributeFilter']) -const SSL_WARNING = 'SSL config key can no longer be disabled, not updating.' -const SERVERLESS_DT_KEYS = ['account_id', 'primary_application_id', 'trusted_account_key'] - -const exists = fs.existsSync -let logger = null // Lazy-loaded in `initialize`. -let _configInstance = null - -const getConfigFileNames = () => - [process.env.NEW_RELIC_CONFIG_FILENAME, 'newrelic.js', 'newrelic.cjs'].filter(Boolean) - -const getConfigFileLocations = () => - [ - process.env.NEW_RELIC_HOME, - process.cwd(), - process.env.HOME, - path.join(__dirname, '../../../..'), // above node_modules - // the REPL has no main module - process.mainModule && process.mainModule.filename - ? path.dirname(process.mainModule.filename) - : undefined - ].filter(Boolean) - -function _findConfigFile() { - const configFileCandidates = getConfigFileLocations().reduce((files, configPath) => { - const configFiles = getConfigFileNames().map((filename) => - path.join(path.resolve(configPath), filename) - ) - - return files.concat(configFiles) - }, []) - - return configFileCandidates.find(exists) -} - -function Config(config) { - EventEmitter.call(this) - - // 1. start by cloning the defaults - try { - Object.assign(this, defaultConfig()) - } catch (err) { - logger.warn('Unable to clone the default config, %s: %s', DEFAULT_CONFIG_PATH, err) - } - - // 2. initialize undocumented, internal-only default values - - // feature flags are mostly private settings for gating unreleased features - // flags are set in the feature_flags.js file - this.feature_flag = copy.shallow(featureFlag.prerelease) - - // set by environment - this.newrelic_home = null - // set by configuration file loader - this.config_file_path = null - - // set by collector on handshake - this.run_id = null - this.account_id = null - this.application_id = null - this.web_transactions_apdex = Object.create(null) - this.cross_process_id = null - this.encoding_key = null - this.obfuscatedId = null - this.primary_application_id = null - this.trusted_account_ids = null - this.trusted_account_key = null - this.sampling_target = 10 - this.sampling_target_period_in_seconds = 60 - this.max_payload_size_in_bytes = DEFAULT_MAX_PAYLOAD_SIZE_IN_BYTES - - // this value is arbitrary - this.max_trace_segments = 900 - - this.entity_guid = null - - // feature level of this account - this.product_level = 0 - // product-level related - this.collect_traces = true - this.collect_errors = true - this.collect_span_events = true - - this.browser_monitoring.loader = 'rum' - this.browser_monitoring.loader_version = '' - - // Settings to play nice with DLPs (see NODE-1044). - this.simple_compression = false // Disables subcomponent compression - this.put_for_data_send = false // Changes http verb for harvest - - // 3. override defaults with values from the loaded / passed configuration - this._fromPassed(config) - - // 3.5. special values (only Azure environment APP_POOL_ID for now) - this._fromSpecial() - - // 4. override config with environment variables - this._featureFlagsFromEnv() - this._fromEnvironment() - - // 5. clean up anything that requires postprocessing - this._canonicalize() - - // 6. put the version in the config - this.version = require('../../package.json').version - - // TODO: this may belong in canonicalize. - if (!this.event_harvest_config) { - this.event_harvest_config = { - report_period_ms: 60000, - harvest_limits: { - analytic_event_data: this.transaction_events.max_samples_stored, - custom_event_data: this.custom_insights_events.max_samples_stored, - error_event_data: this.error_collector.max_event_samples_stored, - span_event_data: this.span_events.max_samples_stored, - log_event_data: this.application_logging.forwarding.max_samples_stored - } - } - } - - // 7. serverless_mode specific settings - this._enforceServerless(config) - - // 8. apply high security overrides - if (this.high_security) { - if (this.security_policies_token) { - throw new Error( - 'Security Policies and High Security Mode cannot both be present ' + - 'in the agent configuration. If Security Policies have been set ' + - 'for your account, please ensure the security_policies_token is ' + - 'set but high_security is disabled (default).' - ) - } - this._applyHighSecurity() - } - - // 9. Set instance attribute filter using updated context - this.attributeFilter = new AttributeFilter(this) -} -util.inherits(Config, EventEmitter) - -/** - * Because this module and logger depend on each other, the logger needs - * a way to inject the actual logger instance once it's constructed. - * It's kind of a Rube Goldberg device, but it works. - * - * @param {Logger} bootstrapped The actual, configured logger. - */ -Config.prototype.setLogger = function setLogger(bootstrapped) { - logger = bootstrapped -} - -/** - * helper object for merging server side values - */ -Config.prototype.mergeServerConfig = mergeServerConfig - -/** - * Accept any configuration passed back from the server. Will log all - * recognized, unsupported, and unknown parameters. - * - * @param {object} json The config blob sent by New Relic. - * @param {boolean} recursion flag indicating coming from server side config - */ -Config.prototype.onConnect = function onConnect(json, recursion) { - json = json || Object.create(null) - if (this.high_security && recursion !== true && !json.high_security) { - this.agent_enabled = false - this.emit('agent_enabled', false) - return - } - if (Object.keys(json).length === 0) { - return - } - - Object.keys(json).forEach(function updateProp(key) { - this._fromServer(json, key) - }, this) - - this._warnDeprecations() - - this.emit('change', this) -} - -Config.prototype._getMostSecure = function getMostSecure(key, currentVal, newVal) { - const filter = LASP_MAP[key] && LASP_MAP[key].filter - if (!this.security_policies_token || !filter) { - // If we aren't applying something vetted by security policies we - // just return the new value. - return newVal - } - // Return the most secure if we have a filter to apply - return filter(currentVal, newVal) -} - -/** - * Helper that checks if value from server is false - * then updates the corresponding configuration enabled flag. - * We never allow server-side config to enable a feature but you can disable - * - * @param {*} serverValue value from server - * @param {string} key within configuration to disable its enabled flag - */ -Config.prototype._disableOption = function _disableOption(serverValue, key) { - if (serverValue === false) { - this[key].enabled = false - } -} - -/** - * Updates harvest_limits for event_harvest_config if they are valid values - * - * @param {object} serverConfig harvest config from server - * @param {string} key value from server side config that stores the event harvest config - */ -Config.prototype._updateHarvestConfig = function _updateHarvestConfig(serverConfig, key) { - const val = serverConfig[key] - const isValidConfig = harvestConfigValidator.isValidHarvestConfig(val) - if (!isValidConfig) { - this.emit(key, null) - return - } - - logger.info('Valid event_harvest_config received. Updating harvest cycles.', val) - const limits = Object.keys(val.harvest_limits).reduce((acc, k) => { - const v = val.harvest_limits[k] - if (harvestConfigValidator.isValidHarvestValue(v)) { - acc[k] = v - } else { - logger.info(`Omitting limit for ${k} due to invalid value ${v}`) - } - return acc - }, {}) - val.harvest_limits = limits - this[key] = val - this.emit(key, val) -} - -/** - * The guts of the logic about how to deal with server-side configuration. - * - * @param {object} params A configuration dictionary. - * @param {string} key The particular configuration parameter to set. - */ -Config.prototype._fromServer = function _fromServer(params, key) { - /* eslint-disable-next-line sonarjs/max-switch-cases */ - switch (key) { - // handled by the connection - case 'messages': - break - - // per the spec this is the key where all server side configuration values will come from. - case 'agent_config': - if (this.ignore_server_configuration) { - this.logDisabled(params, key) - } else { - this.onConnect(params[key], true) - } - - break - - // if it's undefined or null, so be it - case 'agent_run_id': - this.run_id = params.agent_run_id - break - - // if it's undefined or null, so be it - case 'request_headers_map': - this.request_headers_map = params.request_headers_map - break - - // handled by config.onConnect - case 'high_security': - break - - // always accept these settings - case 'cross_process_id': - case 'encoding_key': - this._alwaysUpdateIfChanged(params, key) - if (this.cross_process_id && this.encoding_key) { - this.obfuscatedId = hashes.obfuscateNameUsingKey(this.cross_process_id, this.encoding_key) - } - break - - // always accept these settings - case 'account_id': - case 'application_id': - case 'collect_errors': - case 'collect_traces': - case 'primary_application_id': - case 'product_level': - case 'max_payload_size_in_bytes': - case 'sampling_target': - case 'sampling_target_period_in_seconds': - case 'trusted_account_ids': - case 'trusted_account_key': - this._alwaysUpdateIfChanged(params, key) - break - - case 'collect_error_events': - if (params.collect_error_events === false) { - this._updateNestedIfChanged(params, this.error_collector, key, 'capture_events') - } - break - - // also accept these settings - case 'url_rules': - case 'metric_name_rules': - case 'transaction_name_rules': - case 'transaction_segment_terms': - this._emitIfSet(params, key) - break - - case 'ssl': - if (!isTruthular(params.ssl)) { - logger.warn(SSL_WARNING) - } - break - - case 'apdex_t': - case 'web_transactions_apdex': - this._updateIfChanged(params, key) - break - case 'event_harvest_config': - this._updateHarvestConfig(params, key) - break - - case 'collect_analytics_events': - this._disableOption(params.collect_analytics_events, 'transaction_events') - break - - case 'collect_custom_events': - this._disableOption(params.collect_custom_events, 'custom_insights_events') - break - - case 'collect_span_events': - this._disableOption(params.collect_span_events, 'span_events') - break - - case 'allow_all_headers': - this._updateIfChanged(params, key) - this._canonicalize() - break - - // - // Browser Monitoring - // - case 'browser_monitoring.loader': - this._updateNestedIfChangedRaw(params, this.browser_monitoring, key, 'loader') - break - - // these are used by browser_monitoring - // and the api.getRUMHeader() method - case 'js_agent_file': - case 'js_agent_loader_file': - case 'beacon': - case 'error_beacon': - case 'browser_key': - case 'js_agent_loader': - this._updateNestedIfChangedRaw(params, this.browser_monitoring, key, key) - break - - // - // Cross Application Tracer - // - case 'cross_application_tracer.enabled': - this._updateNestedIfChanged(params, this.cross_application_tracer, key, 'enabled') - break - // - // Error Collector - // - case 'error_collector.enabled': - this._updateNestedIfChanged( - params, - this.error_collector, - 'error_collector.enabled', - 'enabled' - ) - break - case 'error_collector.ignore_status_codes': - this._validateThenUpdateStatusCodes( - params, - this.error_collector, - 'error_collector.ignore_status_codes', - 'ignore_status_codes' - ) - this._canonicalize() - break - case 'error_collector.expected_status_codes': - this._validateThenUpdateStatusCodes( - params, - this.error_collector, - 'error_collector.expected_status_codes', - 'expected_status_codes' - ) - this._canonicalize() - break - case 'error_collector.ignore_classes': - this._validateThenUpdateErrorClasses( - params, - this.error_collector, - 'error_collector.ignore_classes', - 'ignore_classes' - ) - break - case 'error_collector.expected_classes': - this._validateThenUpdateErrorClasses( - params, - this.error_collector, - 'error_collector.expected_classes', - 'expected_classes' - ) - break - case 'error_collector.ignore_messages': - this._validateThenUpdateErrorMessages( - params, - this.error_collector, - 'error_collector.ignore_messages', - 'ignore_messages' - ) - break - case 'error_collector.expected_messages': - this._validateThenUpdateErrorMessages( - params, - this.error_collector, - 'error_collector.expected_messages', - 'expected_messages' - ) - break - case 'error_collector.capture_events': - this._updateNestedIfChanged( - params, - this.error_collector, - 'error_collector.capture_events', - 'capture_events' - ) - break - case 'error_collector.max_event_samples_stored': - this._updateNestedIfChanged( - params, - this.error_collector, - 'error_collector.max_event_samples_stored', - 'max_event_samples_stored' - ) - break - - // - // Slow SQL - // - case 'slow_sql.enabled': - this._updateNestedIfChanged(params, this.slow_sql, key, 'enabled') - break - - // - // Transaction Events - // - case 'transaction_events.enabled': - this._updateNestedIfChanged(params, this.transaction_events, key, 'enabled') - break - - // - // Transaction Tracer - // - case 'transaction_tracer.enabled': - this._updateNestedIfChanged( - params, - this.transaction_tracer, - 'transaction_tracer.enabled', - 'enabled' - ) - break - case 'transaction_tracer.transaction_threshold': - this._updateNestedIfChanged( - params, - this.transaction_tracer, - 'transaction_tracer.transaction_threshold', - 'transaction_threshold' - ) - break - - // Entity GUID - case 'entity_guid': - this.entity_guid = params[key] - break - - // These settings aren't supported by the agent (yet). - case 'sampling_rate': - case 'episodes_file': - case 'episodes_url': - case 'rum.load_episodes_file': - // Ensure the most secure setting is applied to the settings below - // when enabling them. - case 'attributes.include_enabled': - case 'strip_exception_messages.enabled': - case 'transaction_tracer.record_sql': - this.logUnsupported(params, key) - break - - // DT span event harvest config limits - case 'span_event_harvest_config': - this.span_event_harvest_config = { - ...params[key] - } - break - - // These settings are not allowed from the server. - case 'attributes.enabled': - case 'attributes.exclude': - case 'attributes.include': - case 'browser_monitoring.attributes.enabled': - case 'browser_monitoring.attributes.exclude': - case 'browser_monitoring.attributes.include': - case 'error_collector.attributes.enabled': - case 'error_collector.attributes.exclude': - case 'error_collector.attributes.include': - case 'transaction_events.attributes.enabled': - case 'transaction_events.attributes.exclude': - case 'transaction_events.attributes.include': - case 'transaction_events.max_samples_stored': - case 'transaction_tracer.attributes.enabled': - case 'transaction_tracer.attributes.exclude': - case 'transaction_tracer.attributes.include': - case 'serverless_mode.enabled': - break - - default: - this.logUnknown(params, key) - } -} - -/** - * Change a value sent by the collector if and only if it's different from the - * value we already have. Emit an event with the key name and the new value, - * and log that the value has changed. - * - * @param {object} json Config blob sent by collector. - * @param {string} key Value we're looking to set. - */ -Config.prototype._alwaysUpdateIfChanged = function _alwaysUpdateIfChanged(json, key) { - const value = json[key] - if (value != null && this[key] !== value) { - if (Array.isArray(value) && Array.isArray(this[key])) { - value.forEach(function pushIfNew(element) { - if (this[key].indexOf(element) === -1) { - this[key].push(element) - } - }, this) - } else { - this[key] = value - } - this.emit(key, value) - logger.debug('Configuration of %s was changed to %s by New Relic.', key, value) - } -} - -/** - * Change a value sent by the collector if and only if it's different from the - * value we already have. Emit an event with the key name and the new value, - * and log that the value has changed. - * - * @param {object} json Config blob sent by collector. - * @param {string} key Value we're looking to set. - */ -Config.prototype._updateIfChanged = function _updateIfChanged(json, key) { - this._updateNestedIfChanged(json, this, key, key) -} - -/** - * Expected and Ignored status code configuration values should look like this - * - * [500,'501','503-507'] - * - * If the server side config is not in this format, it might put the agent - * in a world of hurt. So, before we pass everything on to - * _updateNestedIfChanged, we'll do some validation. - * - * @param {object} remote JSON sent from New Relic. - * @param {object} local A portion of this configuration object. - * @param {string} remoteKey The name sent by New Relic. - * @param {string} localKey The local name. - */ -Config.prototype._validateThenUpdateStatusCodes = _validateThenUpdateStatusCodes -function _validateThenUpdateStatusCodes(remote, local, remoteKey, localKey) { - const valueToTest = remote[remoteKey] - if (!Array.isArray(valueToTest)) { - logger.warn( - 'Saw SSC (ignore|expect)_status_codes that is not an array, will not merge: %s', - valueToTest - ) - return - } - - let valid = true - valueToTest.forEach(function validateArray(thingToTest) { - if (!('string' === typeof thingToTest || 'number' === typeof thingToTest)) { - logger.warn( - 'Saw SSC (ignore|expect)_status_code that is not a number or string,' + - 'will not merge: %s', - thingToTest - ) - valid = false - } - }) - if (!valid) { - return - } - - return this._updateNestedIfChanged(remote, local, remoteKey, localKey) -} - -/** - * Expected and Ignored classes configuration values should look like this - * - * ['Error','Again'] - * - * If the server side config is not in this format, it might put the agent - * in a world of hurt. So, before we pass everything on to - * _updateNestedIfChanged, we'll do some validation. - * - * @param {object} remote JSON sent from New Relic. - * @param {object} local A portion of this configuration object. - * @param {string} remoteKey The name sent by New Relic. - * @param {string} localKey The local name. - */ -Config.prototype._validateThenUpdateErrorClasses = _validateThenUpdateErrorClasses - -function _validateThenUpdateErrorClasses(remote, local, remoteKey, localKey) { - const valueToTest = remote[remoteKey] - if (!Array.isArray(valueToTest)) { - logger.warn( - 'Saw SSC (ignore|expect)_classes that is not an array, will not merge: %s', - valueToTest - ) - return - } - - let valid = true - Object.keys(valueToTest).forEach(function validateArray(key) { - const thingToTest = valueToTest[key] - if ('string' !== typeof thingToTest) { - logger.warn( - 'Saw SSC (ignore|expect)_class that is not a string, will not merge: %s', - thingToTest - ) - valid = false - } - }) - if (!valid) { - return - } - - return this._updateNestedIfChanged(remote, local, remoteKey, localKey) -} - -/** - * Expected and Ignore messages configuration values should look like this - * - * {'ErrorType':['Error Message']} - * - * If the server side config is not in this format, it might put the agent - * in a world of hurt. So, before we pass everything on to - * _updateNestedIfChanged, we'll do some validation. - * - * @param {object} remote JSON sent from New Relic. - * @param {object} local A portion of this configuration object. - * @param {string} remoteKey The name sent by New Relic. - * @param {string} localKey The local name. - */ -Config.prototype._validateThenUpdateErrorMessages = _validateThenUpdateErrorMessages - -function _validateThenUpdateErrorMessages(remote, local, remoteKey, localKey) { - const valueToTest = remote[remoteKey] - if (Array.isArray(valueToTest)) { - logger.warn('Saw SSC (ignore|expect)_message that is an Array, will not merge: %s', valueToTest) - return - } - - if (!valueToTest) { - logger.warn('SSC ignore|expect_message is null or undefined, will not merge') - return - } - - if ('object' !== typeof valueToTest) { - logger.warn( - 'Saw SSC (ignore|expect)_message that is primitive/scaler, will not merge: %s', - valueToTest - ) - return - } - - if (!valueToTest) { - logger.warn('SSC ignore|expect_message is null or undefined, will not merge') - return - } - - let valid = true - Object.keys(valueToTest).forEach(function validateArray(key) { - const arrayToTest = valueToTest[key] - if (!Array.isArray(arrayToTest)) { - logger.warn('Saw SSC message array that is not an array, will not merge: %s', arrayToTest) - valid = false - } - }) - if (!valid) { - return - } - - return this._updateNestedIfChanged(remote, local, remoteKey, localKey) -} -/** - * Some parameter values are nested, need a simple way to change them as well. - * Will merge local and remote if and only if both are arrays. - * - * @param {object} remote JSON sent from New Relic. - * @param {object} local A portion of this configuration object. - * @param {string} remoteKey The name sent by New Relic. - * @param {string} localKey The local name. - */ -Config.prototype._updateNestedIfChanged = _updateNestedIfChanged - -function _updateNestedIfChanged(remote, local, remoteKey, localKey) { - // if high-sec mode is enabled, we do not accept server changes to high-sec - if (this.high_security && HSM.HIGH_SECURITY_KEYS.indexOf(remoteKey) !== -1) { - return this.logDisabled(remote, remoteKey) - } - return this._updateNestedIfChangedRaw(remote, local, remoteKey, localKey) -} - -Config.prototype._updateNestedIfChangedRaw = _updateNestedIfChangedRaw - -function _updateNestedIfChangedRaw(remote, local, remoteKey, localKey) { - return this.mergeServerConfig.updateNestedIfChanged( - this, - remote, - local, - remoteKey, - localKey, - logger - ) -} - -/** - * Some parameter values are just to be passed on. - * - * @param {object} json Config blob sent by collector. - * @param {string} key Value we're looking to set. - */ -Config.prototype._emitIfSet = function _emitIfSet(json, key) { - const value = json[key] - if (value != null) { - this.emit(key, value) - } -} - -/** - * The agent would normally do something with this parameter, but server-side - * configuration is disabled via local settings or HSM. - * - * @param {object} json Config blob sent by collector. - * @param {string} key Value the agent won't set. - */ -Config.prototype.logDisabled = function logDisabled(json, key) { - const value = json[key] - if (value != null) { - logger.debug( - 'Server-side configuration of %s is currently disabled by local configuration. ' + - '(Server sent value of %s.)', - key, - value - ) - } -} - -/** - * Help support out by putting in the logs the fact that we don't currently - * support the provided configuration key, and including the sent value. - * - * @param {object} json Config blob sent by collector. - * @param {string} key Value the agent doesn't set. - */ -Config.prototype.logUnsupported = function logUnsupported(json, key) { - const value = json[key] - if (value !== null && value !== undefined) { - logger.debug( - 'Server-side configuration of %s is currently not supported by the ' + - 'Node.js agent. (Server sent value of %s.)', - key, - value - ) - this.emit(key, value) - } -} - -/** - * The agent knows nothing about this parameter. - * - * @param {object} json Config blob sent by collector. - * @param {string} key Value the agent knows nothing about. - */ -Config.prototype.logUnknown = function logUnknown(json, key) { - const value = json[key] - logger.debug('New Relic sent unknown configuration parameter %s with value %s.', key, value) -} - -/** - * Gets the user set host display name. If not provided, it returns the default value. - * - * This function is written is this strange way becauase of the use of caching variables. - * I wanted to cache the DisplayHost, but if I attached the variable to the config object, - * it sends the extra variable to New Relic, which is not desired. - * - * @returns {string} display host name - */ -Config.prototype.getDisplayHost = getDisplayHost - -Config.prototype.clearDisplayHostCache = function clearDisplayHostCache() { - this.getDisplayHost = getDisplayHost -} - -function getDisplayHost() { - let _displayHost - this.getDisplayHost = function getCachedDisplayHost() { - return _displayHost - } - if (this.process_host.display_name === '') { - _displayHost = this.getHostnameSafe() - return _displayHost - } - const stringBuffer = Buffer.from(this.process_host.display_name, 'utf8') - const numBytes = stringBuffer.length - - if (numBytes > 255) { - logger.warn('Custom host display name must be less than 255 bytes') - _displayHost = this.getHostnameSafe() - return _displayHost - } - - _displayHost = this.process_host.display_name - return _displayHost -} - -/** - * Gets the system's host name. If that fails, it just returns ipv4/6 based on the user's - * process_host.ipv_preferenece setting. - * - * This function is written is this strange way becauase of the use of caching variables. - * I wanted to cache the Hostname, but if I attached the variable to the config object, - * it sends the extra variable to New Relic, which is not desired. - * - * @returns {string} host name - */ -Config.prototype.getHostnameSafe = getHostnameSafe - -Config.prototype.clearHostnameCache = function clearHostnameCache() { - this.getHostnameSafe = getHostnameSafe -} - -Config.prototype.getIPAddresses = function getIPAddresses() { - const addresses = Object.create(null) - const interfaces = os.networkInterfaces() - - for (const interfaceKey in interfaces) { - if (interfaceKey.match(/^lo/)) { - continue - } - - const interfaceDescriptions = interfaces[interfaceKey] - for (let i = 0; i < interfaceDescriptions.length; i++) { - const description = interfaceDescriptions[i] - const family = description.family.toLowerCase() - addresses[family] = description.address - } - } - return addresses -} - -function getHostnameSafe() { - let _hostname - const config = this - this.getHostnameSafe = function getCachedHostname() { - return _hostname - } - try { - if (config.heroku.use_dyno_names) { - const dynoName = process.env.DYNO - _hostname = dynoName || os.hostname() - } else { - _hostname = os.hostname() - } - return _hostname - } catch (e) { - const addresses = this.getIPAddresses() - - if (this.process_host.ipv_preference === '6' && addresses.ipv6) { - _hostname = addresses.ipv6 - } else if (addresses.ipv4) { - logger.info('Defaulting to ipv4 address for host name') - _hostname = addresses.ipv4 - } else if (addresses.ipv6) { - logger.info('Defaulting to ipv6 address for host name') - _hostname = addresses.ipv6 - } else { - logger.info('No hostname, ipv4, or ipv6 address found for machine') - _hostname = 'UNKNOWN_BOX' - } - - return _hostname - } -} - -/** - * Ensure that the apps names are always returned as a list. - * - * @returns {Array} list of applications - */ -Config.prototype.applications = function applications() { - const apps = this.app_name - - if (Array.isArray(apps) && apps.length > 0) { - return apps - } - - if (apps && typeof apps === 'string') { - return [apps] - } - - return [] -} - -/** - * Safely overwrite defaults with values passed to constructor. - * - * @param {object} external The configuration being loaded. - * @param {object} internal Whichever chunk of the config being overridden. - * @param {boolean} arbitrary flag indicating if it is in the HAS_ARBITRARY_KEYS set - */ -Config.prototype._fromPassed = function _fromPassed(external, internal, arbitrary) { - if (!external) { - return - } - if (!internal) { - internal = this - } - - Object.keys(external).forEach(function overwrite(key) { - // if it's not in the defaults, it doesn't exist - if (!arbitrary && internal[key] === undefined) { - return - } - - if (key === 'ssl' && !isTruthular(external.ssl)) { - logger.warn(SSL_WARNING) - return - } - - let node = null - try { - node = external[key] - } catch (err) { - logger.warn('Error thrown on access of user config for key: %s', key) - return - } - - if (typeof node === 'object' && !Array.isArray(node) && !(node instanceof RegExp)) { - // is top level and can have arbitrary keys - const allowArbitrary = internal === this || HAS_ARBITRARY_KEYS.has(key) - this._fromPassed(node, internal[key], allowArbitrary) - } else { - internal[key] = node - } - }, this) -} - -/** - * Some values should be picked up only if they're not otherwise set, like - * the Windows / Azure application name. Don't set it if there's already - * a non-empty value set via the configuration file, and allow these - * values to be overwritten by environment variables. Just saves a step for - * PaaS users who don't want to have multiple settings for a single piece - * of configuration. - */ -Config.prototype._fromSpecial = function _fromSpecial() { - const name = this.app_name - if ( - name === null || - name === undefined || - name === '' || - (Array.isArray(name) && name.length === 0) - ) { - const azureName = process.env[AZURE_APP_NAME] - if (azureName) { - this.app_name = azureName.split(',') - } - } -} - -/** - * Iterate over all feature flags and check for the corresponding environment variable - * (of the form NEW_RELIC_FEATURE_FLAG_). - */ -Config.prototype._featureFlagsFromEnv = function _featureFlagsFromEnv() { - const flags = Object.keys(featureFlag.prerelease).concat(featureFlag.released) - const config = this - flags.forEach(function checkFlag(flag) { - const envVal = process.env['NEW_RELIC_FEATURE_FLAG_' + flag.toUpperCase()] - if (envVal) { - config.feature_flag[flag] = isTruthular(envVal) - } - }) -} - -/** - * Creates an env var mapper from the configuration path value - * - * @param {string} key of configuration value - * @param {Array} paths list of leaf nodes leading to configuration value - * @returns {string} formatted env var name - */ -function deriveEnvVar(key, paths) { - let configPath = paths.join('_') - configPath = configPath ? `${configPath}_` : configPath - return `NEW_RELIC_${configPath.toUpperCase()}${key.toUpperCase()}` -} - -/** - * Assigns the value of an env var to its corresponding configuration path - * - * @param {object} params object passed to fn - * @param {object} params.config agent config - * @param {string} params.key key to assign value - * @param {string} params.envVar name of env var - * @param {Function} params.formatter function to coerce env var as they are all strings - * @param {Array} params.paths list of leaf nodes leading to the configuration value - */ -function setFromEnv({ config, key, envVar, formatter, paths }) { - const setting = process.env[envVar] - if (setting) { - const formattedSetting = formatter ? formatter(setting, logger) : setting - setNestedKey(config, [...paths, key], formattedSetting) - } -} - -/** - * Recursively visit the nodes of the config definition and look for environment variable names, overriding any configuration values that are found. - * - * @param {object} [config=this] The current level of the configuration object. - * @param {object} [data=configDefinition] The current level of the config definition object. - * @param {Array} [paths=[]] keeps track of the nested path to properly derive the env var - * @param {number} [objectKeys=1] indicator of how many keys exist in current node to know when to remove current node after all keys are processed - */ -Config.prototype._fromEnvironment = function _fromEnvironment( - config = this, - data = configDefinition, - paths = [], - objectKeys = 1 -) { - let keysSeen = 0 - Object.entries(data).forEach(([key, value]) => { - const type = typeof value - keysSeen++ - if (type === 'string') { - const envVar = deriveEnvVar(key, paths) - setFromEnv({ config, key, envVar, paths }) - } else if (type === 'object') { - if (value.hasOwnProperty('env')) { - setFromEnv({ - config, - key, - envVar: value.env, - paths, - formatter: value.formatter - }) - } else if (value.hasOwnProperty('default')) { - const envVar = deriveEnvVar(key, paths) - setFromEnv({ config, key, envVar, formatter: value.formatter, paths }) - } else { - paths.push(key) - const { length } = Object.keys(value) - this._fromEnvironment(config, value, paths, length) - } - } - }) - - // we have traversed every key in current object leaf node, remove wrapping key - // to properly derive env vars of future leaf nodes - if (keysSeen === objectKeys) { - paths.pop() - } -} - -/** - * Disables `logging.enabled` if not set in configuration file or environment variable. - * - * @param {*} inputConfig configuration passed to the Config constructor - * @returns {void} - */ -Config.prototype._serverlessLogging = function _serverlessLogging(inputConfig) { - const inputEnabled = inputConfig?.logging?.enabled - const envEnabled = process.env.NEW_RELIC_LOG_ENABLED - - if (inputEnabled === undefined && envEnabled === undefined) { - this.logging.enabled = false - - logger.info( - 'Logging is disabled by default when serverless_mode is enabled. ' + - 'If desired, enable logging via config file or environment variable and ' + - 'set filepath to a valid path for current environment, stdout or stderr.' - ) - } -} - -/** - * Returns true if native-metrics has been manually enabled via configuration - * file or environment variable - * - * @param {*} inputConfig configuration pass to the Config constructor - * @returns {void} - */ -Config.prototype._serverlessNativeMetrics = function _serverlessNativeMetrics(inputConfig) { - const inputEnabled = inputConfig?.plugins?.native_metrics?.enabled - const envEnabled = process.env.NEW_RELIC_NATIVE_METRICS_ENABLED - - if ( - (inputEnabled !== undefined || envEnabled !== undefined) && - this.plugins.native_metrics.enabled - ) { - logger.info( - 'Enabling the native-metrics module when in serverless mode may greatly ' + - 'increase cold-start times. Given the limited benefit of the VM metrics' + - 'and general lack of control in a serverless environment, we do not ' + - 'recommend this trade-off.' - ) - } else { - this.plugins.native_metrics.enabled = false - - logger.info( - 'The native-metrics module is disabled by default when serverless_mode ' + - 'is enabled. If desired, enable the native-metrics module via config file ' + - 'or environment variable.' - ) - } -} - -/** - * Application name is not currently leveraged by our Lambda product (March 2021). - * Defaulting the name removes burden on customers to set while avoiding - * breaking should it be used in the future. - * - * @returns {void} - */ -Config.prototype._serverlessAppName = function _serverlessAppName() { - if (!this.app_name || this.app_name.length === 0) { - const namingSource = process.env.AWS_LAMBDA_FUNCTION_NAME - ? 'process.env.AWS_LAMBDA_FUNCTION_NAME' - : 'DEFAULT' - - const name = process.env.AWS_LAMBDA_FUNCTION_NAME || 'Serverless Application' - this.app_name = [name] - - logger.info("Auto-naming serverless application to ['%s'] from: %s", name, namingSource) - } -} - -/** - * Disables CAT in serverless mode - */ -Config.prototype._serverlessCAT = function _serverlessCAT() { - if (this.cross_application_tracer.enabled) { - this.cross_application_tracer.enabled = false - logger.info('Cross application tracing is explicitly disabled in serverless_mode.') - } -} - -Config.prototype._serverlessInfiniteTracing = function _serverlessInfiniteTracing() { - if (this.infinite_tracing.trace_observer.host) { - this.infinite_tracing.trace_observer.host = '' - this.infinite_tracing.trace_observer.port = '' - logger.info('Infinite tracing is explicitly disabled in serverless_mode.') - } -} - -/** - * Disables DT if account_id is not set. - * Otherwise it will set trusted_account_key and primary_application_id accordingly. - * - * @returns {void} - */ -Config.prototype._serverlessDT = function _serverlessDT() { - if (!this.account_id) { - if (this.distributed_tracing.enabled) { - logger.warn( - 'Using distributed tracing in serverless mode requires account_id be ' + - 'defined, either in your newrelic.js file or via environment variables. ' + - 'Disabling distributed tracing.' - ) - this.distributed_tracing.enabled = false - } - } else { - // default trusted_account_key to account_id - this.trusted_account_key = this.trusted_account_key || this.account_id - - // Not required in serverless mode but must default to Unknown to function. - this.primary_application_id = this.primary_application_id || 'Unknown' - } -} - -/** - * In serverless mode we allow defer auth to the downstream serverless entities. - * This means we set account_id, primary_application_id, and trusted_account_key in configuration. - * This function sets all those to null because this.serverles_mode.enabled is falsey. - * - * @returns {void} - */ -Config.prototype._preventServerlessDT = function _preventServerlessDT() { - // Don't allow DT config settings to be set if serverless_mode is disabled - SERVERLESS_DT_KEYS.forEach((key) => { - if (this[key]) { - logger.warn( - key + - ' was configured locally without enabling serverless_mode. ' + - 'This local value will be ignored and set by the New Relic servers.' - ) - this[key] = null - } - }) -} - -/** - * Enforces config rules specific to running in serverless_mode: - * - disables cross_application_tracer.enabled if set - * - defaults logging to disabled - * - verifies data specific to running DT is defined either in config file of env vars - * - * @param {*} inputConfig configuration passed to the Config constructor - */ -Config.prototype._enforceServerless = function _enforceServerless(inputConfig) { - if (this.serverless_mode.enabled) { - this._serverlessAppName() - this._serverlessCAT() - this._serverlessInfiniteTracing() - this._serverlessLogging(inputConfig) - this._serverlessNativeMetrics(inputConfig) - this._serverlessDT(inputConfig) - } else { - this._preventServerlessDT() - } -} - -/** - * Depending on how the status codes are set, they could be strings, which - * makes strict equality testing / indexOf fail. To keep things cheap, parse - * them once, after configuration has finished loading. Other one-off shims - * based on special properties of configuration values should go here as well. - */ -Config.prototype._canonicalize = function _canonicalize() { - const statusCodes = this?.error_collector?.ignore_status_codes - if (statusCodes) { - this.error_collector.ignore_status_codes = _parseCodes(statusCodes) - } - - const expectedCodes = this?.error_collector?.expected_status_codes - if (expectedCodes) { - this.error_collector.expected_status_codes = _parseCodes(expectedCodes) - } - - const grpcStatusCodes = this?.grpc?.ignore_status_codes - if (grpcStatusCodes) { - this.grpc.ignore_status_codes = _parseCodes(grpcStatusCodes) - } - - const logAliases = { - verbose: 'trace', - debugging: 'debug', - warning: 'warn', - err: 'error' - } - const level = this.logging.level - this.logging.level = logAliases[level] || level - - const region = parseKey(this.license_key) - if (this.host === '') { - if (region) { - this.host = `collector.${region}.nr-data.net` - } else { - this.host = 'collector.newrelic.com' - } - } - if (this.otlp_endpoint === '') { - if (region) { - this.otlp_endpoint = `otlp.${region}.nr-data.net` - } else { - this.otlp_endpoint = 'otlp.nr-data.net' - } - } - - if (this.license_key) { - this.license_key = this.license_key.trim() - } -} - -/** - * Splits a range of status codes. It will not - * allow negative values, non-numbers, or numbers above 1000. - * - * @param {string} range range of status codes 400-421 - * @param {Array} parsed list of parsed codes - * @returns {Array} adds to the cleansed list of status codes - * by removing any ranges and adds as elements - */ -function _parseRange(range, parsed) { - const split = range.split('-') - if (split.length !== 2) { - logger.warn('Failed to parse range %s', range) - return parsed - } - if (split[0] === '') { - // catch negative code. ex. -7 - return parsed.push(parseInt(range, 10)) - } - const lower = parseInt(split[0], 10) - const upper = parseInt(split[1], 10) - if (Number.isNaN(lower) || Number.isNaN(upper)) { - logger.warn('Range must contain two numbers %s', range) - return parsed - } - if (lower > upper) { - logger.warn('Range must start with lower bound %s', range) - } else if (lower < 0 || upper > 1000) { - logger.warn('Range must be between 0 and 1000 %s', range) - } else { - // success - for (let i = lower; i <= upper; i++) { - parsed.push(i) - } - } - return parsed -} - -/** - * Parses a list of status codes. It can also - * parse a range of status codes - * - * @param {Array} codes list of status codes - * @returns {Array} cleansed list of status codes - */ -function _parseCodes(codes) { - const parsedCodes = [] - for (let i = 0; i < codes.length; i++) { - const code = codes[i] - if (typeof code === 'string' && code.indexOf('-') !== -1) { - _parseRange(code, parsedCodes) - } else { - const parsedCode = parseInt(code, 10) - if (!Number.isNaN(parsedCode)) { - parsedCodes.push(parsedCode) - } else { - logger.warn('Failed to parse status code %s', code) - } - } - } - return parsedCodes -} - -/** - * This goes through the settings that high security mode needs and coerces - * them to be correct. - */ -Config.prototype._applyHighSecurity = function _applyHighSecurity() { - const config = this - checkNode('', this, HSM.HIGH_SECURITY_SETTINGS) - // as a one off, we add a global exclude rule to the list to keep from - // clobbering user defined rules - - this.attributes.exclude.push('request.parameters.*') - - function checkNode(base, target, settings) { - Object.keys(settings).forEach(checkKey.bind(null, base, target, settings)) - } - - function checkKey(base, target, settings, key) { - const hsValue = settings[key] - - if (hsValue && typeof hsValue === 'object' && !(hsValue instanceof Array)) { - if (typeof target[key] !== 'object') { - logger.warn('High Security Mode: %s should be an object, found %s', key, target[key]) - target[key] = Object.create(null) - } - - return checkNode(base + key + '.', target[key], hsValue) - } - - if (target[key] !== hsValue) { - logger.warn('High Security Mode: %s was set to %s, coercing to %s', key, target[key], hsValue) - target[key] = hsValue - config.emit(base + key, hsValue) - } - } -} - -/** - * Sends a response to collector for LASP application - * - * @param {Array} keys keys from a LASP policy - * @returns {CollectorResponse} creates CollectorResponse with either preserve or shutdown - */ -function _laspReponse(keys) { - if (keys.length) { - logger.error('The agent received one or more unexpected security policies and will shut down.') - return CollectorResponse.fatal(null) - } - return CollectorResponse.success(null) -} - -/** - * Applies the server side LASP policies to a local configuration object - * - * @param agent - * @param {object} policies server side LASP policy - * @returns {object} { missingRequired, finalPolicies } list of missing required fields and finalized LASP policy - */ -Config.prototype._buildLaspPolicy = function _buildLaspPolicy(agent, policies) { - const config = this - const keys = Object.keys(policies) - const missingRequired = [] - - const finalPolicies = keys.reduce(function applyPolicy(obj, name) { - const policy = policies[name] - const localMapping = LASP_MAP[name] - - if (!localMapping) { - if (!policy.required) { - // policy is not implemented in agent -- don't send to connect - return obj - } - // policy is required but does not exist in agent -- fail - missingRequired.push(name) - } else { - const splitConfigName = localMapping.path.split('.') - let settingBlock = config[splitConfigName[0]] - // pull out the configuration subsection that the option lives in - for (let i = 1; i < splitConfigName.length - 1; ++i) { - settingBlock = settingBlock[splitConfigName[i]] - } - const valueName = splitConfigName[splitConfigName.length - 1] - const localVal = settingBlock[valueName] - - // Indexes into "allowed values" based on "enabled" setting - // to retrieve proper mapping. - const policyValues = localMapping.allowedValues - const policyValue = policyValues[policy.enabled ? 1 : 0] - - // get the most secure setting between local config and the policy - const finalValue = (settingBlock[valueName] = config._getMostSecure( - name, - localVal, - policyValue - )) - policy.enabled = policyValues.indexOf(finalValue) === 1 - obj[name] = policy - - if (!policy.enabled && localMapping.applyAdditionalSettings) { - localMapping.applyAdditionalSettings(config) - } - - if (finalValue !== localVal) { - // finalValue is more secure than original local val, - // so drop corresponding data - localMapping.clearData(agent) - } - } - - return obj - }, Object.create(null)) - - return { missingRequired, finalPolicies } -} - -/** - * Checks policies received from preconnect against those expected - * by the agent, if LASP-enabled. Responds with an error to shut down - * the agent if necessary. - * - * @param agent - * @param {object} policies lasp policy - * @returns {CollectorResponse} The result of the processing, with the known - * policies as the response payload. - */ -Config.prototype.applyLasp = function applyLasp(agent, policies) { - const keys = Object.keys(policies) - - if (!this.security_policies_token) { - return _laspReponse(keys) - } - - const { finalPolicies, missingRequired } = this._buildLaspPolicy(agent, policies) - - const missingLASP = [] - Object.keys(LASP_MAP).forEach(function checkPolicy(name) { - if (!policies[name]) { - // agent is expecting a policy that was not sent from server -- fail - missingLASP.push(name) - } - }) - - let fatalMessage = null - if (missingLASP.length) { - fatalMessage = - 'The agent did not receive one or more security policies that it ' + - 'expected and will shut down: ' + - missingLASP.join(', ') + - '.' - } else if (missingRequired.length) { - fatalMessage = - 'The agent received one or more required security policies that it ' + - 'does not recognize and will shut down: ' + - missingRequired.join(', ') + - '. Please check if a newer agent version supports these policies ' + - 'or contact support.' - } - - if (fatalMessage) { - logger.error(fatalMessage) - return CollectorResponse.fatal(null) - } - - return CollectorResponse.success(finalPolicies) -} - -Config.prototype.validateFlags = function validateFlags() { - Object.keys(this.feature_flag).forEach(function forEachFlag(key) { - if (featureFlag.released.indexOf(key) > -1) { - logger.warn('Feature flag %s has been released', key) - } - if (featureFlag.unreleased.indexOf(key) > -1) { - logger.warn('Feature flag %s has been deprecated', key) - } - }) -} - -function redactValue(value) { - const REDACT_VALUE = '****' - - let result = null - if (Array.isArray(value)) { - // Redact each value so we know if was configured and how many values - result = value.map(() => REDACT_VALUE) - } else { - result = REDACT_VALUE - } - - return result -} - -/** - * Get a JSONifiable object containing all settings we want to report to the - * collector and store in the environment_values table. - * - * @returns {object} containing simple key-value pairs of settings - */ -Config.prototype.publicSettings = function publicSettings() { - let settings = Object.create(null) - - for (const key in this) { - if (this.hasOwnProperty(key) && !REMOVE_BEFORE_SEND.has(key)) { - if (HSM.REDACT_BEFORE_SEND.has(key)) { - const value = this[key] - settings[key] = redactValue(value) - } else if (!HSM.REMOVE_BEFORE_SEND.has(key)) { - settings[key] = this[key] - } - } - } - - // Agent-side setting is 'enable', but collector-side setting is - // 'auto_instrument'. Send both values up. - settings.browser_monitoring.auto_instrument = settings.browser_monitoring.enable - - try { - settings = stringify(settings) - // Remove simple circular references - return flatten(Object.create(null), '', JSON.parse(settings)) - } catch (err) { - logger.error(err, 'Unable to stringify settings object') - } -} - -Config.prototype.getAggregatorConfig = function getAggregatorConfig(method) { - const harvestConfig = this.event_harvest_config - const isValidConfig = harvestConfigValidator.isValidHarvestConfig(harvestConfig) - const limit = harvestConfig.harvest_limits[method] - if (!isValidConfig || !harvestConfigValidator.isValidHarvestValue(limit)) { - return null - } - - return { - limit, - periodMs: harvestConfig.report_period_ms - } -} - -Config.prototype._warnDeprecations = function _warnDeprecations() { - // DT overrides CAT so only warn when CAT is actually used. - if (this.cross_application_tracer.enabled && !this.distributed_tracing.enabled) { - const deprecationWarning = [ - '[Deprecation Warning]: Cross Application Tracing (CAT) has been deprecated and will be ', - 'removed in a future major release. CAT has been replaced by Distributed Tracing (DT). ', - 'Enable DT by setting distributed_tracing: { enabled: true }.' - ].join('') - - logger.infoOnce('Deprecation:CAT', deprecationWarning) - } -} - -/** - * Create a configuration, either from a configuration file or the node - * process's environment. - * - * For configuration via file, check these directories, in order, for a - * file named 'newrelic.js': - * - * 1. The process's current working directory at startup. - * 2. The same directory as the process's main module (i.e. the filename - * passed to node on the command line). - * 3. The directory pointed to by the environment variable NEW_RELIC_HOME. - * 4. The current process's HOME directory. - * 5. If this module is installed as a dependency, the directory above the - * node_modules folder in which newrelic is installed. - * - * When node process environment varaibles and a config file are used, - * the environment variables will override their corresponding - * configuration file settings. - * - * @param {object} config Optional configuration to be used in place of a config file. - * @returns {object} instantiated configuration object - */ -function initialize(config) { - /** - * When the logger is required here, it bootstraps itself and then - * injects itself into this module's closure via setLogger on the - * instance of the logger it creates. Logs are queued until config - * has been loaded to apply logging settings to bootstrapping logs - */ - logger = require('../logger') - - if (config) { - return new Config(config) - } - - if (isTruthular(process.env.NEW_RELIC_NO_CONFIG_FILE)) { - logger.info('NEW_RELIC_NO_CONFIG_FILE set, deferring to environment variables.') - - return createNewConfigObject(config) - } - - const filepath = _findConfigFile() - if (!filepath) { - logger.info( - [ - 'Unable to find configuration file.', - 'If a configuration file is desired (common for non-containerized environments),', - `a base configuration file can be copied from ${BASE_CONFIG_PATH}`, - 'and renamed to "newrelic.js" in the directory from which you will start', - 'your application.', - 'Attempting to start agent using environment variables.' - ].join(' ') - ) - - return createNewConfigObject(config) - } - - let userConf - try { - userConf = require(filepath).config - } catch (error) { - if (error.code === 'ERR_REQUIRE_ESM') { - // Attempted to import newrelic.js or similar from an ESM module, error out early. - throw error - } - logger.error(error) - - logger.warn( - [ - `Unable to read existing configuration file "${filepath}".`, - 'To allow reading of the file (if desired),', - 'please ensure the application has read access and the file is exporting valid JSON.', - 'Attempting to start agent using enviornment variables.' - ].join(' ') - ) - } - - if (!userConf) { - return createNewConfigObject(config) - } - - config = new Config(userConf) - config.config_file_path = filepath - logger.debug('Using configuration file %s.', filepath) - - config.validateFlags() - - return config -} - -/** - * This helper function creates an empty configuration object - * - * @param {object} config current configuration object to overwrite - * @returns {object} config new config object - */ -function createNewConfigObject(config) { - config = new Config(Object.create(null)) - if (config.newrelic_home) { - delete config.newrelic_home - } - return config -} - -/** - * This function honors the singleton nature of this module while allowing - * consumers to just request an instance without having to worry if one was - * already created. - * - * @returns {object} initialized configuration object - */ -function getOrCreateInstance() { - if (_configInstance === null) { - try { - _configInstance = initialize() - } catch (err) { - /* eslint-disable no-console */ - console.error('New Relic for Node.js is disabled due to an error:') - console.error(err.stack) - /* eslint-enable no-console */ - - // Config construction has potential to throw due to invalid settings. - // This allows the agent to return a stub api without crashing the process. - _configInstance = Object.assign(defaultConfig(), { - agent_enabled: false, - logging: { - enabled: true, - filepath: 'stdout' - } - }) - - _configInstance.setLogger = Config.prototype.setLogger - } - } - return _configInstance -} - -function getInstance() { - return _configInstance -} - -function createInstance(config) { - _configInstance = initialize(config) - return _configInstance -} - -/** - * Preserve the legacy initializer, but also allow consumers to manage their - * own configuration if they choose. - */ -Config.initialize = initialize -Config.getOrCreateInstance = getOrCreateInstance -Config.getInstance = getInstance -Config.createInstance = createInstance - -module.exports = Config diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/lasp.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/lasp.js deleted file mode 100644 index 4f7a977f7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/lasp.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// TODO: would likely be easier to understand if the allowedValues mapping -// just took the raw enabled/disabled and translated. This is not a hot path. - -/** - * path: Full nested path for the local configuration item. - * allowedValues: - * Array of valid config values to map for incoming enabled/disabled. - * policy.enabled: false uses index 0, policy.enabled: true uses index 1. - * filter: Allows for calculating most secure setting to use - * applyAdditionalSettings: Applies additional settings that are required - * when the policy is disabled. - * clearData: Clears the relevant agent collection. - */ -const LASP_MAP = { - // LASP key - record_sql: { - // full path to corresponding config key - path: 'transaction_tracer.record_sql', - // Mapping from policy enabled status to usable config value - // policy.enabled: false === off, policy.enabled: true === 'obfuscated' - allowedValues: ['off', 'obfuscated'], - // Tracks the precedent of settings controlled by LASP. - filter: function mostSecureRecordSQL(first, second) { - // Ordered from least to most secure - const recordSQLSettings = ['obfuscated', 'off'] - const firstIdx = recordSQLSettings.indexOf(first) - const secondIdx = recordSQLSettings.indexOf(second) - if (firstIdx < 0 && secondIdx < 0) { - // Return the most secure possible - return recordSQLSettings[recordSQLSettings.length - 1] - } - return firstIdx < secondIdx ? second : first - }, - // Invokes agent method to drop any corresponding data - clearData: function resetCollectedData(agent) { - agent._resetQueries() - } - }, - - attributes_include: { - path: 'attributes.include_enabled', - allowedValues: [false, true], - filter: function mostSecureAttributesInclude(first, second) { - return first && second - }, - applyAdditionalSettings: function applyAdditionalSettings(config) { - config.attributes.exclude.push('request.parameters.*') - }, - clearData: function clearCollectedData(agent) { - if (agent.config.attributes.enabled && agent.config.attributes.include.length) { - agent.traces.clear() - } - } - }, - - // TODO: rename config key, because the names contradict each other's behavior - allow_raw_exception_messages: { - path: 'strip_exception_messages.enabled', - // if raw messages are allowed, then we should not strip them - // policy.enabled: false === true, policy.enabled: true === false - allowedValues: [true, false], - filter: function mostSecureStripException(first, second) { - return first || second - }, - clearData: function resetErrors(agent) { - agent._resetErrors() - } - }, - - custom_events: { - path: 'api.custom_events_enabled', - allowedValues: [false, true], - filter: function mostSecureCustomEvents(first, second) { - return first && second - }, - clearData: function resetCustomEvents(agent) { - agent._resetCustomEvents() - } - }, - - custom_parameters: { - path: 'api.custom_attributes_enabled', - allowedValues: [false, true], - filter: function mostSecureCustomAttributes(first, second) { - return first && second - }, - clearData: function resetCustomAttributes(agent) { - if (agent.config.attributes.enabled) { - agent.traces.clear() - } - } - }, - // Unimplemented - custom_instrumentation_editor: null, - message_parameters: null, - job_arguments: null -} - -exports.LASP_MAP = LASP_MAP diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/merge-server-config.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/merge-server-config.js deleted file mode 100644 index d1eb2f19d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/config/merge-server-config.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -class MergeServerConfig { - // eslint-disable-next-line max-params - updateNestedIfChanged(config, remote, local, remoteKey, localKey, logger) { - const value = remote[remoteKey] - - // if the value hasn't changed, skip this work. - // currently, this will always treat objects as - // new as it does not do a deep-check. - if (value === null || local[localKey] === value) { - return - } - - // we need different update/merge logic if the server - // value is an array, a simple object, or anything else - if (Array.isArray(value) && Array.isArray(local[localKey])) { - this.updateArray(value, local, localKey) - } else if (this.isSimpleObject(value) && this.isSimpleObject(local[localKey])) { - this.updateObject(value, local, localKey) - } else { - local[localKey] = value - } - config.emit(remoteKey, value) - logger.debug('Configuration of %s was changed to %s by New Relic.', remoteKey, value) - } - - updateArray(value, local, localKey) { - value.forEach((element) => { - if (local[localKey].indexOf(element) === -1) { - local[localKey].push(element) - } - }) - } - - updateObject(value, local, localKey) { - // go through each key of the object and update it - Object.keys(value).forEach((element) => { - if (Array.isArray(local[localKey][element]) && Array.isArray(value[element])) { - // if both key-values are arrays, push the remote value onto the local array - value[element].forEach((elementValue) => { - if (-1 === local[localKey][element].indexOf(elementValue)) { - local[localKey][element].push(elementValue) - } - }) - } else { - // otherwise, replace the local value with the server value - local[localKey][element] = value[element] - } - }) - } - - isSimpleObject(thing) { - return 'object' === typeof thing && thing !== null - } -} - -module.exports = MergeServerConfig diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/async-local-context-manager.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/async-local-context-manager.js deleted file mode 100644 index 9ad596b55..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/async-local-context-manager.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { AsyncLocalStorage } = require('async_hooks') - -/** - * Class for managing state in the agent. - * Uses AsyncLocalStorage for context propagation of state across async boundaries. - * - * Given current usage with every instrumented function, the functions in this - * class should do as little work as possible to avoid unnecessary overhead. - * - * @class - */ -class AsyncLocalContextManager { - /** - * @param {object} config New Relic config instance - */ - constructor(config) { - this._config = config - - this._asyncLocalStorage = new AsyncLocalStorage() - } - - /** - * Get the currently active context. - * - * @returns {object} The current active context. - */ - getContext() { - return this._asyncLocalStorage.getStore() || null - } - - /** - * Set a new active context. Not bound to function execution. - * The AsyncLocalStorage method is considered experimental - * - * @param {object} newContext The context to set as active. - */ - setContext(newContext) { - this._asyncLocalStorage.enterWith(newContext) - } - - /** - * Run a function with the passed in context as the active context. - * Restores the previously active context upon completion. - * - * @param {object} context The context to set as active during callback execution. - * @param {Function} callback The function to execute in context. - * @param {Function} [cbThis] Optional `this` to apply to the callback. - * @param {Array<*>} [args] Optional arguments object or args array to invoke the callback with. - * @returns {*} Returns the value returned by the callback function. - */ - runInContext(context, callback, cbThis, args) { - const toInvoke = cbThis ? callback.bind(cbThis) : callback - - if (args) { - return this._asyncLocalStorage.run(context, toInvoke, ...args) - } - - return this._asyncLocalStorage.run(context, toInvoke) - } -} - -module.exports = AsyncLocalContextManager diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/create-context-manager.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/create-context-manager.js deleted file mode 100644 index 420c16426..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/create-context-manager.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const semver = require('semver') - -const logger = require('../logger') - -/** - * Factory function to create context manager implementations used by the - * ContextManager class. - * - * @param {object} config New Relic config instance. - * @returns {*} The appropriate underlying context manager implementation based on - * the current configuration. - */ -function createContextManager(config) { - if (config.feature_flag.async_local_context) { - // TODO: Remove >=16 check when only support 16+. AsyncLocal became stable in 16.4.0 - if (semver.satisfies(process.version, '>=16.4.0')) { - return createAsyncLocalContextManager(config) - } - - logger.warn('The AsyncLocalContextManager is only supported on Node version 16.4.0 and later.') - } - - return createLegacyContextManager(config) -} - -function createAsyncLocalContextManager(config) { - logger.info('Using AsyncLocalContextManager') - - const AsyncLocalContextManager = require('./async-local-context-manager') - return new AsyncLocalContextManager(config) -} - -function createLegacyContextManager(config) { - if (config.logging.diagnostics) { - logger.info('Using LegacyDiagnosticContextManager') - - const LegacyDiagnosticContextManager = require('./diagnostics/legacy-diagnostic-context-manager') - return new LegacyDiagnosticContextManager(config) - } - - logger.info('Using LegacyContextManager') - - const LegacyContextManager = require('./legacy-context-manager') - return new LegacyContextManager(config) -} - -module.exports = createContextManager diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/diagnostics/legacy-diagnostic-context-manager.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/diagnostics/legacy-diagnostic-context-manager.js deleted file mode 100644 index 220787b17..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/diagnostics/legacy-diagnostic-context-manager.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const LegacyContextManager = require('../legacy-context-manager') - -/** - * Overrides setContext to add diagnostic logging around setting and removing - * from context. Currently just supports the segment.probe(). - * - * Exists in own class to keep default context management as minimal/efficient as possible - * given we wrap pretty much every functions execution. - */ -class LegacyDiagnosticContextManager extends LegacyContextManager { - setContext(newContext) { - this._logDiagnostic(this._context, 'Removed from context') - - this._context = newContext - - this._logDiagnostic(newContext, 'Set in context') - } - - _logDiagnostic(context, message) { - // This is to currently support diagnostic logging of segments which gets attached to - // transactions with a stack trace. All of this is output at once at the end of a transaction - // when enabled for clear tracing. - if (context && context.probe) { - context.probe(message) - } - } -} - -module.exports = LegacyDiagnosticContextManager diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/legacy-context-manager.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/legacy-context-manager.js deleted file mode 100644 index 7a4256103..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/context-manager/legacy-context-manager.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Class for managing state in the agent. - * Keeps track of a single context instance. - * - * Given current usage with every instrumented function, the functions in this - * class should do as little work as possible to avoid unnecessary overhead. - * - * @class - */ -class LegacyContextManager { - /** - * @param {object} config New Relic config instance - */ - constructor(config) { - this._config = config - this._context = null - } - - /** - * Get the currently active context. - * - * @returns {object} The current active context. - */ - getContext() { - return this._context - } - - /** - * Set a new active context. Not bound to function execution. - * - * @param {object} newContext The context to set as active. - */ - setContext(newContext) { - this._context = newContext - } - - /** - * Run a function with the passed in context as the active context. - * Restores the previously active context upon completion. - * - * @param {object} context The context to set as active during callback execution. - * @param {Function} callback The function to execute in context. - * @param {Function} [cbThis] Optional `this` to apply to the callback. - * @param {Array<*>} [args] Optional arguments object or args array to invoke the callback with. - * @returns {*} Returns the value returned by the callback function. - */ - runInContext(context, callback, cbThis, args) { - const oldContext = this.getContext() - this.setContext(context) - - try { - return callback.apply(cbThis, args) - } finally { - this.setContext(oldContext) - } - } -} - -module.exports = LegacyContextManager diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/custom-events/custom-event-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/custom-events/custom-event-aggregator.js deleted file mode 100644 index 0f876d966..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/custom-events/custom-event-aggregator.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'custom-event-aggregator' }) -const EventAggregator = require('../aggregators/event-aggregator') - -const NAMES = require('../metrics/names') - -class CustomEventAggregator extends EventAggregator { - constructor(opts, collector, metrics) { - opts = opts || {} - opts.method = opts.method || 'custom_event_data' - opts.metricNames = NAMES.CUSTOM_EVENTS - - super(opts, collector, metrics) - } - - _toPayloadSync() { - const events = this.events - - if (events.length === 0) { - logger.debug('No custom events to send.') - return - } - - const eventData = events.toArray() - - return [this.runId, eventData] - } -} - -module.exports = CustomEventAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/parsed-statement.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/parsed-statement.js deleted file mode 100644 index c509e22ab..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/parsed-statement.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { DB, ALL } = require('../metrics/names') -const { DESTINATIONS } = require('../config/attribute-filter') - -function ParsedStatement(type, operation, collection, raw) { - this.type = type - this.operation = operation - this.collection = collection - this.trace = null - this.raw = '' - - if (typeof raw === 'string') { - this.trace = new Error().stack - this.raw = raw - } -} - -ParsedStatement.prototype.recordMetrics = function recordMetrics(segment, scope) { - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - const type = transaction.isWeb() ? DB.WEB : DB.OTHER - const thisTypeSlash = this.type + '/' - const operation = DB.OPERATION + '/' + thisTypeSlash + this.operation - - // Note, an operation metric should _always_ be created even if the action was - // a statement. This is part of the spec. - - // Rollups - transaction.measure(operation, null, duration, exclusive) - transaction.measure(DB.PREFIX + type, null, duration, exclusive) - transaction.measure(DB.PREFIX + thisTypeSlash + type, null, duration, exclusive) - transaction.measure(DB.PREFIX + thisTypeSlash + ALL, null, duration, exclusive) - transaction.measure(DB.ALL, null, duration, exclusive) - - // If we can parse the SQL statement, create a 'statement' metric, and use it - // as the scoped metric for transaction breakdowns. Otherwise, skip the - // 'statement' metric and use the 'operation' metric as the scoped metric for - // transaction breakdowns. - let collection - if (this.collection) { - collection = DB.STATEMENT + '/' + thisTypeSlash + this.collection + '/' + this.operation - transaction.measure(collection, null, duration, exclusive) - if (scope) { - transaction.measure(collection, scope, duration, exclusive) - } - } else if (scope) { - transaction.measure(operation, scope, duration, exclusive) - } - - // This recorder is side-effectful Because we are depending on the recorder - // setting the transaction name, recorders must always be run before generating - // the final transaction trace - segment.name = collection || operation - - // Datastore instance metrics. - const attributes = segment.attributes.get(DESTINATIONS.TRANS_SEGMENT) - if (attributes.host && attributes.port_path_or_id) { - const instanceName = - DB.INSTANCE + '/' + thisTypeSlash + attributes.host + '/' + attributes.port_path_or_id - transaction.measure(instanceName, null, duration, exclusive) - } - - if (this.raw) { - transaction.agent.queries.add(segment, this.type.toLowerCase(), this.raw, this.trace) - } -} - -module.exports = ParsedStatement diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-parsers/sql.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-parsers/sql.js deleted file mode 100644 index c728704db..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-parsers/sql.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../../logger').child({ component: 'sql_query_parser' }) -const StatementMatcher = require('../statement-matcher') -const stringify = require('json-stringify-safe') - -const OPERATIONS = [ - new StatementMatcher( - 'select', - /^[^\S]*?select\b[\s\S]+?\bfrom[\s\n\r\[\(]+([^\]\s\n\r,)(;]*)/gim - ), - new StatementMatcher('update', /^[^\S]*?update[^\S]+?([^\s\n\r,;]+)/gim), - new StatementMatcher( - 'insert', - /^[^\S]*?insert(?:[^\S]+ignore)?[^\S]+into[^\S]+([^\s\n\r(,;]+)/gim - ), - new StatementMatcher('delete', /^[^\S]*?delete[^\S]+?from[^\S]+([^\s\n\r,(;]+)/gim) -] -const COMMENT_PATTERN = /\/\\*.*?\\*\//g - -// This must be called synchronously after the initial db call for backtraces to -// work correctly - -module.exports = function parseSql(sql) { - // Sometimes we get an object here from MySQL. We have been unable to - // reproduce it, so we'll just log what that object is and return a statement - // type of `other`. - if (typeof sql === 'object' && sql.sql !== undefined) { - sql = sql.sql - } - if (typeof sql !== 'string') { - if (logger.traceEnabled()) { - try { - logger.trace('parseSQL got an a non-string sql that looks like: %s', stringify(sql)) - } catch (err) { - logger.debug(err, 'Unabler to stringify SQL') - } - } - return { - operation: 'other', - collection: null, - query: '' - } - } - - sql = sql.replace(COMMENT_PATTERN, '').trim() - - let parsedStatement - - for (let i = 0, l = OPERATIONS.length; i < l; i++) { - parsedStatement = OPERATIONS[i].getParsedStatement(sql) - if (parsedStatement) { - break - } - } - - if (parsedStatement) { - return parsedStatement - } - - return { - operation: 'other', - collection: null, - query: sql - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-sample.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-sample.js deleted file mode 100644 index 46051d38e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-sample.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const codec = require('../util/codec') -const Stats = require('../stats') -const util = require('util') - -function QuerySample(tracer, slowQuery) { - Stats.call(this) - this.tracer = tracer - this.trace = slowQuery - this.aggregate(slowQuery) -} - -util.inherits(QuerySample, Stats) - -QuerySample.prototype.aggregate = function aggregate(slowQuery) { - this.recordValue(slowQuery.duration) - if (this.trace && this.trace.duration >= slowQuery.duration) { - return - } - this.trace = slowQuery -} - -QuerySample.prototype.merge = function merge(sample) { - Stats.prototype.merge.call(this, sample) - if (this.trace.duration < sample.trace.duration) { - this.trace = sample.trace - } -} - -QuerySample.prototype.prepareJSON = function prepareJSON(done) { - const transaction = this.trace.segment.transaction - const sample = this - const trace = sample.trace - - const params = sample.getParams() - - if (!this.tracer.config.simple_compression) { - codec.encode(params, respond) - } else { - process.nextTick(respond.bind(null, null, params)) - } - - function respond(err, data) { - if (err) { - return done(err) - } - - done(null, _getJSON(sample, trace, transaction, data)) - } -} - -QuerySample.prototype.prepareJSONSync = function prepareJSONSync() { - const transaction = this.trace.segment.transaction - const sample = this - const trace = sample.trace - - const params = sample.getParams() - const data = this.tracer.config.simple_compression ? params : codec.encodeSync(params) - return _getJSON(sample, trace, transaction, data) -} - -function _getJSON(sample, trace, transaction, data) { - return [ - transaction.getFullName(), - transaction.url || '', - trace.id, - getQuery(sample.tracer.config, trace), - trace.metric, - sample.callCount, - sample.total, - sample.min, - sample.max, - data - ] -} - -QuerySample.prototype.getParams = function getParams() { - const segmentAttrs = this.trace.segment.getAttributes() - const params = { - backtrace: this.trace.trace - } - - if (segmentAttrs.host) { - params.host = segmentAttrs.host - } - - if (segmentAttrs.port_path_or_id) { - params.port_path_or_id = segmentAttrs.port_path_or_id - } - - if (segmentAttrs.database_name) { - params.database_name = segmentAttrs.database_name - } - - if (this.tracer.config.distributed_tracing.enabled) { - this.trace.segment.transaction.addDistributedTraceIntrinsics(params) - } - - return params -} - -function getQuery(config, trace) { - switch (config.transaction_tracer.record_sql) { - case 'raw': - return trace.query - case 'obfuscated': - return trace.obfuscated - default: - return '?' - } -} - -module.exports = QuerySample diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-trace-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-trace-aggregator.js deleted file mode 100644 index 53cf07ca7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/query-trace-aggregator.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'query_tracer' }) -const Aggregator = require('../aggregators/base-aggregator') -const SlowQuery = require('./slow-query') -const QuerySample = require('./query-sample') - -class QueryTraceAggregator extends Aggregator { - constructor(opts, collector) { - opts = opts || {} - opts.method = opts.method || 'sql_trace_data' - if (!opts.config) { - throw new Error('config required by query trace aggregator') - } - super(opts, collector) - - const config = opts.config - this.samples = new Map() - - this.config = config - } - - removeShortest() { - let shortest = null - for (const sample of this.samples.values()) { - const trace = sample.trace - if (!shortest || shortest.duration > trace.duration) { - shortest = trace - } - } - - this.samples.delete(shortest.normalized) - } - - _merge(samples) { - for (const sample of samples.values()) { - const ownSample = this.samples.get(sample.trace.normalized) - if (ownSample) { - ownSample.merge(sample) - } else { - this.samples.set(sample.trace.normalized, sample) - } - } - } - - add(segment, type, query, trace) { - const ttConfig = this.config.transaction_tracer - - // If DT is enabled and the segment is part of a sampled transaction - // (i.e. we are creating a span event for this segment), then we need - // to collect the sql trace. - let slowQuery - switch (ttConfig.record_sql) { - case 'raw': - slowQuery = new SlowQuery(segment, type, query, trace) - logger.trace('recording raw sql') - segment.addAttribute('sql', slowQuery.query, true) - break - case 'obfuscated': - slowQuery = new SlowQuery(segment, type, query, trace) - logger.trace('recording obfuscated sql') - segment.addAttribute('sql_obfuscated', slowQuery.obfuscated, true) - break - default: - logger.trace( - 'not recording sql statement, transaction_tracer.record_sql was set to %s', - ttConfig.record_sql - ) - return - } - - if (segment.getDurationInMillis() < ttConfig.explain_threshold) { - return - } - - slowQuery = slowQuery || new SlowQuery(segment, type, query, trace) - - segment.addAttribute('backtrace', slowQuery.trace) - - if (!this.config.slow_sql.enabled) { - return - } - - const ownSample = this.samples.get(slowQuery.normalized) - if (ownSample) { - return ownSample.aggregate(slowQuery) - } - - this.samples.set(slowQuery.normalized, new QuerySample(this, slowQuery)) - - // Do not remove the shortest sample when in serverless mode, since - // sampling is disabled. - if (this.config.serverless_mode.enabled) { - return - } - - if (this.samples.size > this.config.slow_sql.max_samples) { - this.removeShortest() - } - } - - _toPayload(cb) { - if (this.samples.size === 0) { - logger.debug('No query traces to send.') - return cb(null, null) - } - - const runId = this.runId - - return this.prepareJSON((err, data) => cb(err, [runId, data])) - } - - _toPayloadSync() { - if (this.samples.size > 0) { - return [this.runId, this.prepareJSONSync()] - } - - logger.debug('No query traces to send.') - } - - _getMergeData() { - return this.samples - } - - clear() { - this.samples = new Map() - } - - async prepareJSON(done) { - const samplePromises = [] - for (const sample of this.samples.values()) { - const samplePromise = new Promise((resolve, reject) => { - sample.prepareJSON((err, data) => { - if (err) { - reject(err) - } - resolve(data) - }) - }) - samplePromises.push(samplePromise) - } - - try { - const data = await Promise.all(samplePromises) - done(null, data) - } catch (err) { - done(err) - } - } - - prepareJSONSync() { - return Array.from(this.samples.values()).map((sample) => sample.prepareJSONSync()) - } -} - -module.exports = QueryTraceAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/slow-query.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/slow-query.js deleted file mode 100644 index c80bcf881..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/slow-query.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const obfuscate = require('../util/sql/obfuscate') -const crypto = require('crypto') -const path = require('path') -const NR_ROOT = path.resolve(__dirname, '..') - -function SlowQuery(segment, type, query, trace) { - this.obfuscated = obfuscate(query, type) - this.normalized = this.obfuscated.replace(/\?\s*,\s*|\s*/g, '') - this.id = normalizedHash(this.normalized) - this.segment = segment - this.query = query - this.metric = segment.name - this.trace = formatTrace(trace) - this.duration = segment.getDurationInMillis() -} - -function normalizedHash(value) { - // We leverage the last 15 hex digits which will fit in a signed long - return parseInt(crypto.createHash('sha1').update(value).digest('hex').slice(-15), 16) -} - -function formatTrace(trace) { - // remove error message and instrumentation frames from stack trace - return trace ? trace.split('\n').slice(1).filter(notNR).join('\n') : '' -} - -function notNR(frame) { - return frame.indexOf(NR_ROOT) === -1 -} - -module.exports = SlowQuery diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/statement-matcher.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/statement-matcher.js deleted file mode 100644 index 1e79a38ef..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/statement-matcher.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// ( ` database` . ` table ` ) -const CLEANER = /^\(?(?:([`'"]?)(.*?)\1\.)?([`'"]?)(.*?)\3\)?$/ - -function StatementMatcher(operation, operationPattern) { - this.operation = operation - this.matcher = new RegExp('^\\s*' + operation, 'ig') - this.operationPattern = operationPattern -} - -StatementMatcher.prototype.getParsedStatement = function getParsedStatement(sql) { - this.operationPattern.lastIndex = 0 - this.matcher.lastIndex = 0 - CLEANER.lastIndex = 0 - - if (this.matcher.test(sql)) { - const queryMatch = this.operationPattern.exec(sql) - let collection = queryMatch ? queryMatch[1] : 'unknown' - let database = null - - // If the cleaner can match this collection, pull out the cleaned up names - // from there. The spec doesn't want the database names in the collection - // name, but for legacy reasons we keep it. - // TODO: Either update the spec (and CATs) to accept database name in the - // collection name or remove it here. - const cleanerMatch = CLEANER.exec(collection) - if (cleanerMatch && cleanerMatch[4]) { - collection = cleanerMatch[4] - if (cleanerMatch[2]) { - database = cleanerMatch[2] - collection = database + '.' + collection - } - } - - // TODO: Pass through the database here to the parsed statement. It could - // be used for datastore attributes. - return { - operation: this.operation, - database: database, - collection: collection, - query: sql - } - } - - return null -} - -module.exports = StatementMatcher diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/utils.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/utils.js deleted file mode 100644 index 64871ec7d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/db/utils.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports.extractDatabaseChangeFromUse = extractDatabaseChangeFromUse - -function extractDatabaseChangeFromUse(sql) { - // The character ranges for this were pulled from - // http://dev.mysql.com/doc/refman/5.7/en/identifiers.html - const match = /^\s*use[^\w`]+([\w$_\u0080-\uFFFF]+|`[^`]+`)[\s;]*$/i.exec(sql) - return (match && match[1]) || null -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/environment.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/environment.js deleted file mode 100644 index da9c3901c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/environment.js +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const path = require('path') -const { fsPromises } = require('./util/unwrapped-core') -const os = require('os') -const logger = require('./logger').child({ component: 'environment' }) -const stringify = require('json-stringify-safe') -const asyncEachLimit = require('./util/async-each-limit') -const DISPATCHER_VERSION = 'Dispatcher Version' - -// As of 1.7.0 you can no longer dynamically link v8 -// https://github.com/nodejs/io.js/commit/d726a177ed -const remapping = { - node_install_npm: 'npm installed?', - node_install_waf: 'WAF build system installed?', - node_use_openssl: 'OpenSSL support?', - node_shared_openssl: 'Dynamically linked to OpenSSL?', - node_shared_v8: 'Dynamically linked to V8?', - node_shared_zlib: 'Dynamically linked to Zlib?', - node_use_dtrace: 'DTrace support?', - node_use_etw: 'Event Tracing for Windows (ETW) support?' -} - -let settings = Object.create(null) - -/** - * Fetches the setting of the given name, defaulting to an empty array. - * - * @param {string} name - The name of the setting to look for. - * @returns {Array.} An array of values matching that name. - */ -function getSetting(name) { - return settings[name] || [] -} - -/** - * Add a setting to the module's shared settings object. - * - * @param {string} name - The name of the setting value being added. - * @param {string} value - The value to add or the setting. - */ -function addSetting(name, value) { - if (!settings[name]) { - settings[name] = [value] - } else if (settings[name].indexOf(value) === -1) { - settings[name].push(value) - } -} - -/** - * Remove settings with the given name. - * - * @param {string} name - The name of the setting to remove. - */ -function clearSetting(name) { - delete settings[name] -} - -/** - * Build up a list of top-level packages available to an application relative to - * the provided root. - * - * @param {string} root - Path to start listing packages from. - * @param {Array} [packages=[]] - Array to append found packages to. - */ -async function listPackages(root, packages = []) { - _log('Listing packages in %s', root) - - try { - const dirs = await fsPromises.readdir(root) - await asyncEachLimit(dirs, forEachDir, 2) - _log('Done listing packages in %s', root) - } catch (err) { - logger.trace(err, 'Could not list packages in %s (probably not an error)', root) - } - - async function forEachDir(dir) { - _log('Checking package %s in %s', dir, root) - - // Skip npm's binary directory where it stores executables. - if (dir === '.bin') { - _log('Skipping .bin directory') - return - } - - // Recurse into module scopes. - if (dir[0] === '@') { - logger.trace('Recursing into scoped module directory %s', dir) - return listPackages(path.resolve(root, dir), packages) - } - - // Read the package and pull out the name and version of it. - const pkg = path.resolve(root, dir, 'package.json') - let name = null - let version = null - try { - const pkgFile = await fsPromises.readFile(pkg) - _log('Read package at %s', pkg) - ;({ name, version } = JSON.parse(pkgFile)) - } catch (err) { - logger.debug(err, 'Could not read %s.', pkg) - } - - packages.push([name || dir, version || '']) - _log('Package from %s added (%s@%s)', pkg, name, version) - } -} - -/** - * Build up a list of dependencies from a given node_module root. - * - * @param {string} root - Path to start listing dependencies from. - * @param {Array} [children] - Array to append found dependencies to. - * @param {object} [visited] - Map of visited directories. - */ -async function listDependencies(root, children = [], visited = Object.create(null)) { - _log('Listing dependencies in %s', root) - - try { - const dirs = await fsPromises.readdir(root) - await asyncEachLimit(dirs, forEachEntry, 2) - _log('Done listing dependencies in %s', root) - } catch (err) { - logger.trace(err, 'Could not read directories in %s (probably not an error)', root) - } - - async function forEachEntry(entry) { - _log('Checking dependencies in %s (%s)', entry, root) - - const candidate = path.resolve(root, entry, 'node_modules') - try { - const realCandidate = await fsPromises.realpath(candidate) - _log('Resolved %s to real path %s', candidate, realCandidate) - // Make sure we haven't been to this directory before. - if (visited[realCandidate]) { - logger.trace('Not revisiting %s (from %s)', realCandidate, candidate) - return - } - - visited[realCandidate] = true - - // Load the packages and dependencies for this directory. - await listPackages(realCandidate, children) - await listDependencies(realCandidate, children, visited) - _log('Done with dependencies in %s', realCandidate) - } catch (err) { - // Don't care to log about files that don't exist. - if (err.code !== 'ENOENT') { - logger.debug(err, 'Failed to resolve candidate real path %s', candidate) - } - _log(err, 'Real path for %s failed', candidate) - } - } -} - -/** - * Build up a list of packages, starting from the current directory. - * - * @returns {object} Two lists, of packages and dependencies, with the - * appropriate names. - */ -async function getLocalPackages() { - const packages = [] - const dependencies = [] - let candidate = process.cwd() - const visited = Object.create(null) - _log('Getting local packages') - - while (candidate) { - _log('Checking for local packages in %s', candidate) - const root = path.resolve(candidate, 'node_modules') - await listPackages(root, packages) - await listDependencies(root, dependencies, visited) - _log('Done checking for local packages in %s', candidate) - const last = candidate - candidate = path.dirname(candidate) - if (last === candidate) { - candidate = null - } - } - - _log('Done getting local packages') - return { packages, dependencies } -} - -/** - * Generic method for getting packages and dependencies relative to a - * provided root directory. - * - * @param {string} root - Where to start looking -- doesn't add node_modules. - * @returns {object} Two lists, of packages and dependencies, with the - * appropriate names. - */ -async function getPackages(root) { - const packages = [] - const dependencies = [] - _log('Getting packages from %s', root) - - await listPackages(root, packages) - await listDependencies(root, dependencies) - _log('Done getting packages from %s', root) - return { packages, dependencies } -} - -/** - * Generate a list of globally-installed packages, if available / accessible - * via the environment. - * - * @returns {object} Two lists, of packages and dependencies, with the - * appropriate names. - */ -function getGlobalPackages() { - _log('Getting global packages') - if (process.config && process.config.variables) { - const prefix = process.config.variables.node_prefix - if (prefix) { - const root = path.resolve(prefix, 'lib', 'node_modules') - _log('Getting global packages from %s', root) - return getPackages(root) - } - } - - _log('No global packages to get') - return { packages: [], dependencies: [] } -} - -/** - * Take a list of packages and reduce it to a list of pairs serialized - * to JSON (to simplify things on the collector end) where each - * package appears at most once, with all the versions joined into a - * comma-delimited list. - * - * @param {Array} packages list of packages to process - * @returns {Array.} Sorted list of [name, version] pairs. - */ -function flattenVersions(packages) { - const info = Object.create(null) - packages.forEach((pair) => { - const p = pair[0] - const v = pair[1] - - if (info[p]) { - if (info[p].indexOf(v) < 0) { - info[p].push(v) - } - } else { - info[p] = [v] - } - }) - - return Object.keys(info) - .map((key) => [key, info[key].join(', ')]) - .sort() - .map((pair) => { - try { - return stringify(pair) - } catch (err) { - logger.debug(err, 'Unabled to stringify package version') - return '' - } - }) -} - -/** - * There are a bunch of settings generated at build time that are useful to - * know for troubleshooting purposes. These settings are only available in 0.7 - * and up. - * - * This function works entirely via side effects using the - * addSetting function. - */ -function remapConfigSettings() { - if (process.config && process.config.variables) { - const variables = process.config.variables - Object.keys(variables).forEach((key) => { - if (remapping[key]) { - let value = variables[key] - - if (value === true || value === 1) { - value = 'yes' - } - if (value === false || value === 0) { - value = 'no' - } - - addSetting(remapping[key], value) - } - }) - } -} - -async function getOtherPackages() { - _log('Getting other packages') - const other = { packages: [], dependencies: [] } - - if (!process.env.NODE_PATH) { - return other - } - - let paths - if (process.platform === 'win32') { - // why. WHY. - paths = process.env.NODE_PATH.split(';') - } else { - paths = process.env.NODE_PATH.split(':') - } - _log('Looking for other packages in %j', paths) - - const otherPackages = await asyncEachLimit( - paths, - (nodePath) => { - if (nodePath[0] !== '/') { - nodePath = path.resolve(process.cwd(), nodePath) - } - _log('Getting other packages from %s', nodePath) - return getPackages(nodePath) - }, - 2 - ) - - otherPackages.forEach((pkg) => { - other.packages.push.apply(other.packages, pkg.packages) - other.dependencies.push.apply(other.dependencies, pkg.dependencies) - }) - - _log('Done getting other packages') - return other -} - -async function getHomePackages() { - let homeDir = null - if (process.platform === 'win32') { - if (process.env.USERDIR) { - homeDir = process.env.USERDIR - } - } else if (process.env.HOME) { - homeDir = process.env.HOME - } - - _log('Getting home packages from %s', homeDir) - if (!homeDir) { - return - } - - const homePath = path.resolve(homeDir, '.node_modules') - const homeOldPath = path.resolve(homeDir, '.node_libraries') - const home = await getPackages(homePath) - const homeOld = await getPackages(homeOldPath) - return { home, homeOld } -} - -/** - * Scrape the list of packages, following the algorithm as described in the - * node module page: - * - * http://nodejs.org/docs/latest/api/modules.html - * - * This function works entirely via side effects using the addSetting - * function. - */ -async function findPackages() { - _log('Finding all packages') - const pkgPromises = [ - time(getLocalPackages), - time(getGlobalPackages), - time(getOtherPackages), - time(getHomePackages) - ] - const [local, global, other, home] = await Promise.all(pkgPromises) - _log('Done finding all packages') - const packages = local.packages - packages.push.apply(packages, global.packages) - packages.push.apply(packages, other.packages) - - const dependencies = local.dependencies - dependencies.push.apply(dependencies, global.dependencies) - dependencies.push.apply(dependencies, other.dependencies) - - if (home) { - if (home.home) { - packages.unshift.apply(packages, home.home.packages) - dependencies.unshift.apply(dependencies, home.home.dependencies) - } - if (home.homeOld) { - packages.unshift.apply(packages, home.homeOld.packages) - dependencies.unshift.apply(dependencies, home.homeOld.dependencies) - } - } - - addSetting('Packages', flattenVersions(packages)) - addSetting('Dependencies', flattenVersions(dependencies)) -} - -async function time(fn) { - const name = fn.name - const start = Date.now() - logger.trace('Starting %s', name) - const data = await fn() - const end = Date.now() - logger.trace('Finished %s in %dms', name, end - start) - return data -} - -/** - * Settings actually get scraped below. - */ -function gatherEnv() { - addSetting('Processors', os.cpus().length) - addSetting('OS', os.type()) - addSetting('OS version', os.release()) - addSetting('Node.js version', process.version) - addSetting('Architecture', process.arch) - - if ('NODE_ENV' in process.env) { - addSetting('NODE_ENV', process.env.NODE_ENV) - } -} - -function refreshSyncOnly() { - // gather persisted settings - const framework = getSetting('Framework') - const dispatcher = getSetting('Dispatcher') - const dispatcherVersion = getSetting(DISPATCHER_VERSION) - - // clearing and rebuilding a global variable - settings = Object.create(null) - // add persisted settings - if (framework.length) { - framework.forEach(function addFrameworks(fw) { - addSetting('Framework', fw) - }) - } - - if (dispatcher.length) { - dispatcher.forEach(function addDispatchers(d) { - addSetting('Dispatcher', d) - }) - } - - if (dispatcherVersion.length) { - dispatcher.forEach(function addDispatchers(d) { - addSetting(DISPATCHER_VERSION, d) - }) - } - - gatherEnv() - remapConfigSettings() -} - -/** - * Reset settings and gather them, built to minimally refactor this file. - */ -async function refresh() { - _log('Refreshing environment settings') - refreshSyncOnly() - - const packages = getSetting('Packages') - const dependencies = getSetting('Dependencies') - - if (packages.length && dependencies.length) { - settings.Packages = packages - settings.Dependencies = dependencies - _log('Using cached values') - return - } - _log('Fetching new package information') - await findPackages() -} - -/** - * Refreshes settings and returns the settings object. - * - * @private - * @returns {Promise} the updated/refreshed settings - */ -async function getJSON() { - _log('Getting environment JSON') - try { - await refresh() - } catch (err) { - // swallow error - } - - const items = [] - Object.keys(settings).forEach(function settingKeysForEach(key) { - settings[key].forEach(function settingsValuesForEach(setting) { - items.push([key, setting]) - }) - }) - _log('JSON got') - return items -} - -// At startup, do the synchronous environment scanning stuff. -refreshSyncOnly() - -let userSetDispatcher = false -module.exports = { - setFramework: function setFramework(framework) { - addSetting('Framework', framework) - }, - setDispatcher: function setDispatcher(dispatcher, version, userSet) { - if (userSetDispatcher) { - return - } - - userSetDispatcher = !!userSet - clearSetting(DISPATCHER_VERSION) - clearSetting('Dispatcher') - - // TODO: Decide if this should only happen once for internals as well. - if (version) { - addSetting(DISPATCHER_VERSION, version) - } - - addSetting('Dispatcher', dispatcher) - }, - clearFramework: function clearFramework() { - clearSetting('Framework') - }, - clearDispatcher: function clearDispatcher() { - // This method is only used for tests. - userSetDispatcher = false - clearSetting('Dispatcher') - clearSetting(DISPATCHER_VERSION) - }, - listPackages, - getJSON, - get: getSetting, - refresh -} - -/** - * For super verbose logging that we can disable completely, separate from the - * rest of logging. - */ -function _log() { - // logger.trace.apply(logger, arguments) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-collector.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-collector.js deleted file mode 100644 index b3cf14ecc..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-collector.js +++ /dev/null @@ -1,459 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const errorsModule = require('./index') - -const logger = require('../logger').child({ component: 'error_tracer' }) -const urltils = require('../util/urltils') -const Exception = require('../errors').Exception -const Transaction = require('../transaction') -const errorHelper = require('./helper') -const createError = errorsModule.createError -const createEvent = errorsModule.createEvent - -const NAMES = require('../metrics/names') - -/** - * ErrorCollector is responsible for collecting JS errors and errored-out HTTP - * transactions, and for converting them to error traces and error events expected - * by the collector. - * - * @private - * @class - */ -class ErrorCollector { - constructor(config, traceAggregator, eventAggregator, metrics) { - this.config = config - this.traceAggregator = traceAggregator - this.eventAggregator = eventAggregator - this.metrics = metrics - - this.seenObjectsByTransaction = Object.create(null) - this.seenStringsByTransaction = Object.create(null) - - this.traceAggregator.on('starting error_data data send.', this._onSendErrorTrace.bind(this)) - - this.errorGroupCallback = null - } - - _onSendErrorTrace() { - // Clear dupe checking each time error traces attempt to send. - this._clearSeenErrors() - } - - start() { - // TODO: Log? Return true/false? - - const errorCollectorEnabled = this.config.error_collector && this.config.error_collector.enabled - - if (!errorCollectorEnabled) { - return - } - - if (errorCollectorEnabled && this.config.collect_errors) { - this.traceAggregator.start() - } - - if (this.config.error_collector.capture_events) { - this.eventAggregator.start() - } - } - - stop() { - this.traceAggregator.stop() - this.eventAggregator.stop() - } - - /** - * - * This function takes an exception and determines whether the exception - * has been seen before by this aggregator. This function mutates the - * book keeping structures to reflect the exception has been seen. - * - * @param {?Transaction} transaction - - * @param {Error} exception - The error to be checked. - * @returns {boolean} whether or not the exception has already been tracked - */ - _haveSeen(transaction, exception) { - const txId = transaction ? transaction.id : 'Unknown' - - if (typeof exception === 'object') { - if (!this.seenObjectsByTransaction[txId]) { - this.seenObjectsByTransaction[txId] = new WeakSet() - } - - const seenObjects = this.seenObjectsByTransaction[txId] - if (seenObjects.has(exception)) { - return true - } - - // TODO: Refactor usage of `_haveSeen` so that we don't have the side effect - // of marking the exception as seen when we're just testing for if we've - // seen it! - seenObjects.add(exception) - } else { - // typeof exception !== 'object' - if (!this.seenStringsByTransaction[txId]) { - this.seenStringsByTransaction[txId] = Object.create(null) - } - - const seenStrings = this.seenStringsByTransaction[txId] - if (seenStrings[exception]) { - return true - } - - seenStrings[exception] = true - } - return false - } - - /** - * Helper method for processing errors that are created with .noticeError() - * - * @param {Transaction} transaction the collected exception's transaction - * @param {number} collectedErrors the number of errors we've successfully .collect()-ed - * @param {number} expectedErrors the number of errors marked as expected in noticeError - * @returns {Array.} the updated [collectedErrors, expectedErrors] numbers post-processing - */ - _processUserErrors(transaction, collectedErrors, expectedErrors) { - if (transaction.userErrors.length) { - for (let i = 0; i < transaction.userErrors.length; i++) { - const exception = transaction.userErrors[i] - if (this.collect(transaction, exception)) { - ++collectedErrors - // if we could collect it, then check if expected - if ( - urltils.isExpectedError(this.config, transaction.statusCode) || - errorHelper.isExpectedException(transaction, exception, this.config, urltils) - ) { - ++expectedErrors - } - } - } - } - - return [collectedErrors, expectedErrors] - } - - /** - * Helper method for processing exceptions on the transaction (transaction.exceptions array) - * - * @param {Transaction} transaction the transaction being processed - * @param {number} collectedErrors the number of errors successfully .collect()-ed - * @param {number} expectedErrors the number of collected errors that were expected - * @returns {Array.} the updated [collectedErrors, expectedErrors] numbers post-processing - */ - _processTransactionExceptions(transaction, collectedErrors, expectedErrors) { - for (let i = 0; i < transaction.exceptions.length; i++) { - const exception = transaction.exceptions[i] - if (this.collect(transaction, exception)) { - ++collectedErrors - // if we could collect it, then check if expected - if ( - urltils.isExpectedError(this.config, transaction.statusCode) || - errorHelper.isExpectedException(transaction, exception, this.config, urltils) - ) { - ++expectedErrors - } - } - } - - return [collectedErrors, expectedErrors] - } - - /** - * Helper method for processing an inferred error based on Transaction metadata - * - * @param {Transaction} transaction the transaction being processed - * @param {number} collectedErrors the number of errors successfully .collect()-ed - * @param {number} expectedErrors the number of collected errors that were expected - * @returns {Array.} the updated [collectedErrors, expectedErrors] numbers post-processing - */ - _processTransactionErrors(transaction, collectedErrors, expectedErrors) { - if (this.collect(transaction)) { - ++collectedErrors - if (urltils.isExpectedError(this.config, transaction.statusCode)) { - ++expectedErrors - } - } - - return [collectedErrors, expectedErrors] - } - - /** - * Every finished transaction goes through this handler, so do as little as - * possible. - * - * TODO: Prob shouldn't do any work if errors fully disabled. - * - * @param {Transaction} transaction the completed transaction - */ - onTransactionFinished(transaction) { - if (!transaction) { - throw new Error('Error collector got a blank transaction.') - } - if (transaction.ignore) { - return - } - - // collect user errors even if status code is ignored - let collectedErrors = 0 - let expectedErrors = 0 - - // errors from noticeError are currently exempt from - // ignore and exclude rules - ;[collectedErrors, expectedErrors] = this._processUserErrors( - transaction, - collectedErrors, - expectedErrors - ) - - const isErroredTransaction = urltils.isError(this.config, transaction.statusCode) - const isIgnoredErrorStatusCode = urltils.isIgnoredError(this.config, transaction.statusCode) - - // collect other exceptions only if status code is not ignored - if (transaction.exceptions.length && !isIgnoredErrorStatusCode) { - ;[collectedErrors, expectedErrors] = this._processTransactionExceptions( - transaction, - collectedErrors, - expectedErrors - ) - } else if (isErroredTransaction) { - ;[collectedErrors, expectedErrors] = this._processTransactionErrors( - transaction, - collectedErrors, - expectedErrors - ) - } - - const unexpectedErrors = collectedErrors - expectedErrors - - // the metric should be incremented only if the error was not expected - if (unexpectedErrors > 0) { - this.metrics - .getOrCreateMetric(NAMES.ERRORS.PREFIX + transaction.getFullName()) - .incrementCallCount(unexpectedErrors) - } - } - - /** - * This function collects the error right away when transaction is not supplied. Otherwise it - * delays collecting the error until the transaction ends. - * - * NOTE: this interface is unofficial and may change in future. - * - * @param {?Transaction} transaction Transaction associated with the error. - * @param {Error} error The error to be traced. - * @param {?object} customAttributes Custom attributes associated with the request (optional). - */ - add(transaction, error, customAttributes) { - if (!error) { - return - } - - const shouldCollectErrors = this._shouldCollectErrors() - if (!shouldCollectErrors) { - logger.trace('error_collector.enabled is false, dropping application error.') - return - } - - if (errorHelper.shouldIgnoreError(transaction, error, this.config)) { - logger.trace('Ignoring error') - return - } - - const timestamp = Date.now() - const exception = new Exception({ error, timestamp, customAttributes }) - - if (transaction) { - transaction.addException(exception) - } else { - this.collect(transaction, exception) - } - } - - /** - * This function is used to collect errors specifically added using the - * `API#noticeError()` method. - * - * Similarly to add(), it collects the error right away when transaction is - * not supplied. Otherwise it delays collecting the error until the transaction - * ends. The reason for separating the API errors from other exceptions is that - * different ignore rules apply to them. - * - * NOTE: this interface is unofficial and may change in future. - * - * @param {?Transaction} transaction Transaction associated with the error. - * @param {*} error The error passed into `API#noticeError()` - * @param {object} customAttributes custom attributes to add to the error - * @param {boolean} expected Is the error expected? - */ - addUserError(transaction, error, customAttributes, expected) { - if (!error) { - return - } - - const shouldCollectErrors = this._shouldCollectErrors() - if (!shouldCollectErrors) { - logger.trace('error_collector.enabled is false, dropping user reported error.') - return - } - - const timestamp = Date.now() - const exception = new Exception({ error, timestamp, customAttributes, expected }) - - if (transaction) { - transaction.addUserError(exception) - } else { - this.collect(transaction, exception) - } - } - - /** - * Collects the error and also creates the error event. - * - * This function uses an array of seen exceptions to ensure errors don't get double-counted. It - * can also be used as an unofficial means of marking that user errors shouldn't be traced. - * - * For an error to be traced, at least one of the transaction or the error must be present. - * - * NOTE: this interface is unofficial and may change in future. - * - * @param {?Transaction} transaction Transaction associated with the error. - * @param {?Exception} exception The Exception object to be traced. - * @returns {boolean} True if the error was collected. - */ - collect(transaction, exception = new Exception({})) { - if (!this._isValidException(exception, transaction)) { - return false - } - - if (this.errorGroupCallback) { - exception.errorGroupCallback = this.errorGroupCallback - } - - const errorTrace = createError(transaction, exception, this.config) - this._maybeRecordErrorMetrics(errorTrace, transaction) - - // defaults true in config/index. can be modified server-side - if (this.config.collect_errors) { - this.traceAggregator.add(errorTrace) - } - - if (this.config.error_collector.capture_events === true) { - const priority = (transaction && transaction.priority) || Math.random() - const event = createEvent(transaction, errorTrace, exception.timestamp, this.config) - this.eventAggregator.add(event, priority) - } - - return true - } - - /** - * Helper method for ensuring that a collected exception/transaction combination can be collected - * - * @param {object} exception the exception to validate - * @param {Transaction} transaction the Transaction to validate, if exception is malformed we'll try to fallback to transaction data - * @returns {boolean} whether or not the exception/transaction combo has everything needed for processing - */ - _isValidException(exception, transaction) { - if (exception.error) { - if (this._haveSeen(transaction, exception.error)) { - return false - } - - const error = exception.error - if (typeof error !== 'string' && !error.message && !error.stack) { - logger.trace(error, 'Got error that is not an instance of Error or string.') - exception.error = null - } - } - - if (!exception.error && (!transaction || !transaction.statusCode || transaction.error)) { - return false - } - - if (exception.error) { - logger.trace(exception.error, 'Got exception to trace:') - } else { - logger.trace(transaction, 'Got transaction error to trace:') - } - - return true - } - - /** - * Helper method for recording metrics about errors depending on the type of error that happened - * - * @param {Array} errorTrace list of error information - * @param {Transaction} transaction the transaction associated with the trace - */ - _maybeRecordErrorMetrics(errorTrace, transaction) { - const isExpectedError = true === errorTrace[4].intrinsics['error.expected'] - - if (isExpectedError) { - this.metrics.getOrCreateMetric(NAMES.ERRORS.EXPECTED).incrementCallCount() - } else { - this.metrics.getOrCreateMetric(NAMES.ERRORS.ALL).incrementCallCount() - - if (transaction) { - if (transaction.isWeb()) { - this.metrics.getOrCreateMetric(NAMES.ERRORS.WEB).incrementCallCount() - } else { - this.metrics.getOrCreateMetric(NAMES.ERRORS.OTHER).incrementCallCount() - } - } - } - } - - // TODO: ideally, this becomes unnecessary - clearAll() { - this.traceAggregator.clear() - this.eventAggregator.clear() - - this._clearSeenErrors() - } - - _clearSeenErrors() { - this.seenStringsByTransaction = Object.create(null) - this.seenObjectsByTransaction = Object.create(null) - } - - _shouldCollectErrors() { - const errorCollectorEnabled = this.config.error_collector && this.config.error_collector.enabled - - const shouldCaptureTraceOrEvent = - this.config.collect_errors || // are traces enabled - (this.config.error_collector && this.config.error_collector.capture_events) - - return errorCollectorEnabled && shouldCaptureTraceOrEvent - } - - reconfigure(config) { - this.config = config - - this.traceAggregator.reconfigure(config) - this.eventAggregator.reconfigure(config) - - const errorCollectorEnabled = this.config.error_collector && this.config.error_collector.enabled - - if (!errorCollectorEnabled) { - this.stop() - return - } - - if (this.config.collect_errors === false) { - this.traceAggregator.stop() - } - - if (this.config.error_collector.capture_events === false) { - this.eventAggregator.stop() - } - } -} - -module.exports = ErrorCollector diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-event-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-event-aggregator.js deleted file mode 100644 index 844c55397..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-event-aggregator.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'error_tracer' }) -const EventAggregator = require('../aggregators/event-aggregator') - -const NAMES = require('../metrics/names') - -class ErrorEventAggregator extends EventAggregator { - constructor(opts, collector, metrics) { - opts = opts || {} - opts.method = opts.method || 'error_event_data' - opts.metricNames = NAMES.TRANSACTION_ERROR - - super(opts, collector, metrics) - } - - _toPayloadSync() { - const events = this.events - - if (events.length === 0) { - logger.debug('No error events to send.') - return - } - - const metrics = { - reservoir_size: events.limit, - events_seen: events.seen - } - - const eventData = events.toArray() - - return [this.runId, metrics, eventData] - } -} - -module.exports = ErrorEventAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-trace-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-trace-aggregator.js deleted file mode 100644 index 993cb62a7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/error-trace-aggregator.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'error_tracer' }) -const TraceAggregator = require('../aggregators/trace-aggregator') - -// TODO: do traces ever have differing algorithms or -// always first-come? If same, can standardize in TraceAggregator -// Otherwise, TraceAggregator may not be a thing -class ErrorTraceAggregator extends TraceAggregator { - constructor(opts, collector) { - opts = opts || {} - opts.method = opts.method || 'error_data' - - super(opts, collector) - - this.errors = [] - } - - add(error) { - if (this.errors.length < this.limit) { - logger.debug(error, 'Error to be sent to collector.') - this.errors.push(error) - } else { - logger.debug('Already have %d errors to send to collector, not keeping.', this.limit) - } - } - - _toPayloadSync() { - if (this.errors.length > 0) { - return [this.runId, this.errors] - } - - logger.debug('No error traces to send.') - } - - _getMergeData() { - return this.errors - } - - _merge(errors) { - if (!errors) { - return - } - - const len = Math.min(errors.length, this.limit - this.errors.length) - logger.warn('Merging %s (of %s) errors for next delivery.', len, errors.length) - - for (let i = 0; i < len; i++) { - this.errors.push(errors[i]) - } - } - - clear() { - this.errors = [] - } -} - -module.exports = ErrorTraceAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/helper.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/helper.js deleted file mode 100644 index 8a3ff7cf3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/helper.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = { - isExpected: function isExpected(type, message, transaction, config, urltils) { - let isExpectedTransactionCode = false - if (transaction && urltils.isExpectedError(config, transaction.statusCode)) { - isExpectedTransactionCode = true - } - return ( - this.isExpectedErrorMessage(config, type, message) || - this.isExpectedErrorClass(config, type) || - isExpectedTransactionCode - ) - }, - isExpectedErrorMessage: function isExpectedErrorMessage(config, type, message) { - if (!config.error_collector.expected_messages[type]) { - return false - } - - return ( - config.error_collector.expected_messages[type].length > 0 && - config.error_collector.expected_messages[type].indexOf(message) !== -1 - ) - }, - isExpectedErrorClass: function isExpectedErrorClass(config, className) { - return ( - config.error_collector.expected_classes.length > 0 && - config.error_collector.expected_classes.indexOf(className) !== -1 - ) - }, - isExpectedException: function isExpectedException(transaction, exception, config, urltils) { - // this is getting JUST the exception.error - const { type, message } = this.extractErrorInformation( - transaction, - exception.error, - config, - urltils - ) - - return ( - exception._expected || - this.isExpectedErrorClass(config, type) || - this.isExpectedErrorMessage(config, type, message) - ) - }, - - extractErrorInformation: function extractErrorInformation(transaction, error, config, urltils) { - let name = 'Unknown' - let message = '' - let type = 'Error' - - // String errors do not provide us with as much information to provide to the - // user, but it is a common pattern. - if (typeof error === 'string') { - message = error - } else if ( - error !== null && - typeof error === 'object' && - error.message && - !config.high_security && - !config.strip_exception_messages.enabled - ) { - message = error.message - - if (error.name) { - type = error.name - } else if (error.constructor && error.constructor.name) { - type = error.constructor.name - } - } else if ( - transaction && - transaction.statusCode && - urltils.isError(config, transaction.statusCode) - ) { - message = 'HttpError ' + transaction.statusCode - } - - if (transaction) { - // transaction.getName is expensive due to running normalizers and ignore - // rules if a name hasn't been assigned yet. - const txName = transaction.getFullName() - if (txName) { - name = txName - } - } - - return { - name: name, - message: message, - type: type - } - }, - - shouldIgnoreError: function shouldIgnoreError(transaction, error, config) { - // extract _just_ the error information, not transaction stuff - const errorInfo = this.extractErrorInformation(null, error, config, null) - - return ( - this.shouldIgnoreErrorClass(errorInfo, config) || - this.shouldIgnoreErrorMessage(errorInfo, config) || - this.shouldIgnoreStatusCode(transaction, config) - ) - }, - - shouldIgnoreStatusCode: function shouldIgnoreStatusCode(transaction, config) { - if (!transaction) { - return false - } - return config.error_collector.ignore_status_codes.indexOf(transaction.statusCode) !== -1 - }, - - shouldIgnoreErrorClass: function shouldIgnoreErrorClass(errorInfo, config) { - if (config.error_collector.ignore_classes.length < 1) { - return false - } - - return -1 !== config.error_collector.ignore_classes.indexOf(errorInfo.type) - }, - - shouldIgnoreErrorMessage: function shouldIgnoreErrorMessage(errorInfo, config) { - const configIgnoreMessages = config.error_collector.ignore_messages[errorInfo.type] - if (!configIgnoreMessages) { - return false - } - - return configIgnoreMessages.length > 0 && configIgnoreMessages.indexOf(errorInfo.message) !== -1 - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/index.js deleted file mode 100644 index 3cc38327d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/errors/index.js +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'errors_lib' }) -const DESTINATIONS = require('../config/attribute-filter').DESTINATIONS -const props = require('../util/properties') -const urltils = require('../util/urltils') -const errorHelper = require('../errors/helper') -const { - maybeAddQueueAttributes, - maybeAddExternalAttributes, - maybeAddDatabaseAttributes, - maybeAddSyntheticAttributes -} = require('../util/attributes') -const Transaction = require('../transaction') -const ERROR_EXPECTED_PATH = 'error.expected' - -class Exception { - constructor({ error, timestamp, customAttributes, agentAttributes, expected }) { - this.error = error - this.timestamp = timestamp || 0 - this.customAttributes = customAttributes || {} - this.agentAttributes = agentAttributes || {} - this._expected = expected - this.errorGroupCallback = null - } - - getErrorDetails(config) { - const errorDetails = errorHelper.extractErrorInformation(null, this.error, config) - errorDetails.expected = this.isExpected(config, errorDetails) - - return errorDetails - } - - isExpected(config, { type, message }) { - if (typeof this._expected === 'undefined') { - this._expected = - errorHelper.isExpectedErrorClass(config, type) || - errorHelper.isExpectedErrorMessage(config, type, message) - } - - return this._expected - } -} - -/** - * Given either or both of a transaction and an exception, generate an error - * trace in the JSON format expected by the collector. Since this will be - * used by both the HTTP instrumentation, which uses HTTP status codes to - * determine whether a transaction is in error, and the domain-based error - * handler, which traps actual instances of Error, try to set sensible - * defaults for everything. - * - * NOTE: this function returns an array, but also conditionally mutates the array - * to add a "transaction" property with the transaction id to the array, which works - * because everything's an object in JS. I'm not entirely sure why we do this, but - * weird enough to make note of - * - * @param {Transaction} transaction The agent transaction, coming from the instrumentatation - * @param {Exception} exception An custom Exception object with the error and other information - * @param {object} config The configuration to use when creating the object - * @returns {Array} an Array of Error information, [0] -> placeholder, - * [1] -> name extracted from error info, - * [2] -> extracted error message, - * [3] -> extracted error type, - * [4] -> attributes - */ -function createError(transaction, exception, config) { - const error = exception.error - const { name, message, type } = errorHelper.extractErrorInformation( - transaction, - error, - config, - urltils - ) - - const params = { - userAttributes: Object.create(null), - agentAttributes: Object.create(null), - intrinsics: Object.create(null) - } - - if (transaction) { - // Copy all of the parameters off of the transaction. - params.intrinsics = transaction.getIntrinsicAttributes() - const transactionAgentAttributes = - transaction.trace.attributes.get(DESTINATIONS.ERROR_EVENT) || {} - - // Merge the agent attributes specific to this error event with the transaction attributes - params.agentAttributes = Object.assign(exception.agentAttributes, transactionAgentAttributes) - - // There should be no attributes to copy in HSM, but check status anyway - if (!config.high_security) { - urltils.overwriteParameters( - transaction.trace.custom.get(DESTINATIONS.ERROR_EVENT), - params.userAttributes - ) - } - } - - maybeAddUserAttributes(params.userAttributes, exception, config) - - params.stack_trace = maybeAddStackTrace(exception, config) - - params.intrinsics[ERROR_EXPECTED_PATH] = - exception._expected || errorHelper.isExpected(type, message, transaction, config, urltils) - - maybeAddAgentAttributes(params, exception) - - return [0, name, message, type, params] -} - -function isValidErrorGroupOutput(output) { - return (typeof output === 'string' || output instanceof String) && output !== '' -} - -function maybeAddAgentAttributes(attributes, exception) { - if (exception.errorGroupCallback) { - const callbackInput = { - 'error': exception.error, - 'customAttributes': Object.assign({}, attributes.userAttributes), - 'request.uri': attributes.agentAttributes['request.uri'], - 'http.statusCode': attributes.agentAttributes['http.statusCode'], - 'http.method': attributes.agentAttributes['request.method'], - 'error.expected': attributes.intrinsics[ERROR_EXPECTED_PATH] - } - - try { - const callbackOutput = exception.errorGroupCallback(callbackInput) - - if (!isValidErrorGroupOutput(callbackOutput)) { - logger.warn('Function provided via setErrorGroupCallback return value malformed') - return - } - - attributes.agentAttributes['error.group.name'] = callbackOutput - } catch (err) { - logger.warn( - err, - 'Function provided via setErrorGroupCallback failed, not generating `error.group.name`' - ) - } - } -} - -function maybeAddUserAttributes(userAttributes, exception, config) { - const customAttributes = exception.customAttributes - if (!config.high_security && config.api.custom_attributes_enabled && customAttributes) { - for (const key in customAttributes) { - if (props.hasOwn(customAttributes, key)) { - const dest = config.attributeFilter.filterTransaction(DESTINATIONS.ERROR_EVENT, key) - if (dest & DESTINATIONS.ERROR_EVENT) { - userAttributes[key] = customAttributes[key] - } - } - } - } -} - -function maybeAddStackTrace(exception, config) { - const stack = exception.error?.stack - let parsedStack - - if (stack) { - parsedStack = ('' + stack).split(/[\n\r]/g) - - if (config.high_security || config.strip_exception_messages.enabled) { - parsedStack[0] = exception.error.name + ': ' - } - } - - return parsedStack -} - -/** - * Creates a structure for error event that is sent to the collector. - * The error parameter is an output of the createError() function for a given exception. - * - * @param {Transaction} transaction the current transaction - * @param {Array} error createError() output - * @param {string} timestamp the timestamp of the error event - * @param {object} config agent configuration object - * @returns {Array} an Array of different types of attributes [0] -> intrinsic, [1] -> user/custom, [2] -> agent - */ -function createEvent(transaction, error, timestamp, config) { - const message = error[2] - const errorClass = error[3] - const errorParams = error[4] - - const intrinsicAttributes = _getErrorEventIntrinsicAttrs( - transaction, - errorClass, - message, - errorParams.intrinsics[ERROR_EXPECTED_PATH], - timestamp, - config - ) - - // the error structure created by createError() already performs filtering of custom - // and agent attributes, so it is ok to just copy them - const userAttributes = Object.assign(Object.create(null), errorParams.userAttributes) - const agentAttributes = Object.assign(Object.create(null), errorParams.agentAttributes) - - return [intrinsicAttributes, userAttributes, agentAttributes] -} - -// eslint-disable-next-line max-params -function _getErrorEventIntrinsicAttrs(transaction, errorClass, message, expected, timestamp, conf) { - // the server expects seconds instead of milliseconds - if (timestamp) { - timestamp = timestamp / 1000 - } - - const attributes = { - 'type': 'TransactionError', - 'error.class': errorClass, - 'error.message': conf.high_security ? '' : message, - 'timestamp': timestamp, - 'error.expected': expected - } - - if (transaction) { - attributes.transactionName = transaction.getFullName() - attributes.duration = transaction.timer.getDurationInMillis() / 1000 - - maybeAddQueueAttributes(transaction, attributes) - maybeAddExternalAttributes(transaction, attributes) - maybeAddDatabaseAttributes(transaction, attributes) - maybeAddSyntheticAttributes(transaction, attributes) - - if (transaction.agent.config.distributed_tracing.enabled) { - transaction.addDistributedTraceIntrinsics(attributes) - } else { - attributes['nr.referringTransactionGuid'] = transaction.referringTransactionGuid - } - - attributes['nr.transactionGuid'] = transaction.id - - if (transaction.port) { - attributes.port = transaction.port - } - } else { - attributes.transactionName = 'Unknown' - } - - return attributes -} - -module.exports.createError = createError -module.exports.createEvent = createEvent -module.exports.Exception = Exception diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/esm-shim.mjs b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/esm-shim.mjs deleted file mode 100644 index b3cdbb269..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/esm-shim.mjs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -import shimmer from './shimmer.js' -import newrelic from '../index.js' -const { agent } = newrelic - -export default function wrapModule(module, moduleName, resolvedPath) { - const proxiedProps = Object.assign(Object.create(null), module) - const proxiedModule = new Proxy(module, { - get: (target, key) => { - return proxiedProps[key] || target[key] - }, - set: (target, key, val) => { - return (proxiedProps[key] = val) - }, - /** - * This is normally not allowed. - * We have some things that define property, unsure if at the module level. - * Ideally, we can get away from doing this sort of thing at all in the future - * in a post AsyncLocalStorage world, etc. - * If we never do at the module level, perhaps we can not define this or defer upstream - * - * @param target - * @param key - * @param descriptor - */ - defineProperty: (target, key, descriptor) => { - return Object.defineProperty(proxiedProps, key, descriptor) - } - }) - - return shimmer.instrumentPostLoad(agent, proxiedModule, moduleName, resolvedPath, true) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/feature_flags.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/feature_flags.js deleted file mode 100644 index e62f80bc8..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/feature_flags.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// unreleased flags gating an active feature -exports.prerelease = { - express5: false, - promise_segments: false, - reverse_naming_rules: false, - undici_instrumentation: false, - undici_async_tracking: true, - unresolved_promise_cleanup: true, - async_local_context: false -} - -// flags that are no longer used for released features -exports.released = [ - 'released', - 'cat', - 'custom_instrumentation', - 'custom_metrics', - 'express_segments', - 'native_metrics', - 'new_promise_tracking', - 'protocol_17', - 'serverless_mode', - 'send_request_uri_attribute', - 'synthetics', - 'dt_format_w3c', - 'fastify_instrumentation', - 'await_support', - 'certificate_bundle' -] - -// flags that are no longer used for unreleased features -exports.unreleased = ['unreleased'] diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/connection.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/connection.js deleted file mode 100644 index 29579a78d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/connection.js +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const protoLoader = require('@grpc/proto-loader') -const grpc = require('../proxy/grpc') -const logger = require('../logger').child({ component: 'grpc_connection' }) -const EventEmitter = require('events') -const NAMES = require('../metrics/names') -const util = require('util') -const GRPC_TEST_META = { - flaky: 'NEWRELIC_GRPCCONNECTION_METADATA_FLAKY', - delay: 'NEWRELIC_GRPCCONNECTION_METADATA_DELAY', - flaky_code: 'NEWRELIC_GRPCCONNECTION_METADATA_FLAKY_CODE', - success_delay_ms: 'NEWRELIC_GRPCCONNECTION_METADATA_SUCCESS_DELAY_MS' -} - -const connectionStates = require('./connection/states') - -const PROTO_OPTIONS = { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true } - -const PROTO_DEFINITION_PATH = __dirname + '../../../lib/grpc/endpoints/infinite-tracing/v1.proto' - -const DEFAULT_RECONNECT_DELAY_MS = 15 * 1000 - -/** - * Class for managing the GRPC connection - * - * Both @grpc/grpc-js and grpc will manage the http2 connections - * for us -- this class manages the _stream_ connection logic. - * - * Will emit events based on the connectionStates (see above - */ -class GrpcConnection extends EventEmitter { - /** - * GrpcConnection constructor - * - * Standard property setting/initialization, and sets an initial - * connection state of disconnected - * - * @param {object} infiniteTracingConfig config item config.infinite_tracing - * @param {MetricAggregator} metrics metric aggregator, for supportability metrics - * @param {number} [reconnectDelayMs=15000] number of milliseconds to wait before reconnecting - * for error states that require a reconnect delay. - */ - constructor(infiniteTracingConfig, metrics, reconnectDelayMs = DEFAULT_RECONNECT_DELAY_MS) { - super() - this._compression = infiniteTracingConfig.compression - this._method = infiniteTracingConfig.batching ? 'recordSpanBatch' : 'recordSpan' - - this._reconnectDelayMs = reconnectDelayMs - - this._metrics = metrics - this._setState(connectionStates.disconnected) - - this._licensekey = null - this._runId = null - this._requestHeadersMap = null - - const traceObserverConfig = infiniteTracingConfig.trace_observer - this._endpoint = this.getTraceObserverEndpoint(traceObserverConfig) - - this._client = null - this.stream = null - } - - /** - * Sets connection details - * - * Allows setting of connection details _after_ object constructions - * but before the actual connection. - * - * @param {string} licenseKey the agent license key - * @param {string} runId the current agent run id (also called agent run token) - * @param {object} requestHeadersMap request headers map received from server connect. - * @param {string} [rootCerts] string of root (ca) certificates to attach to the connection. - * @returns {GrpcConnection} the instance of grpc connection - */ - setConnectionDetails(licenseKey, runId, requestHeadersMap, rootCerts) { - this._licenseKey = licenseKey - this._runId = runId - this._requestHeadersMap = requestHeadersMap - this._rootCerts = rootCerts - return this - } - - getTraceObserverEndpoint(traceObserverConfig) { - return `${traceObserverConfig.host}:${traceObserverConfig.port}` - } - - /** - * Sets the connection state - * - * Used to indicate a transition from one connection state to - * the next. Also responsible for emitting the connect state event - * - * @param {number} state The connection state (See connectionStates above) - * @param {object} stream duplex stream - */ - _setState(state, stream = null) { - this._state = state - this.emit(connectionStates[state], stream) - } - - /** - * Start the Connection - * - * Public Entry point -- initiates a connection - */ - connectSpans() { - if (this._state !== connectionStates.disconnected) { - return - } - - this._setState(connectionStates.connecting) - logger.trace('Connecting to gRPC endpoint.') - - try { - this.stream = this._connectSpans() - - // May not actually be "connected" at this point but we can write to the stream - // immediately. - this._setState(connectionStates.connected, this.stream) - } catch (err) { - logger.warn(err, 'Unexpected error establishing gRPC stream, will not attempt reconnect.') - this._disconnect() - } - } - - /** - * End the current stream and set state to disconnected. - * - * No more data can be sent until connected again. - */ - disconnect() { - if (this._state === connectionStates.disconnected) { - return - } - - this._disconnect() - } - - /** - * Method returns GRPC metadata for initial connection - * - * @param {string} licenseKey agent key - * @param {string} runId agent run id - * @param {object} requestHeadersMap map of request headers to include - * @param {object} env process.env - * @returns {object} grpc metadata - */ - _getMetadata(licenseKey, runId, requestHeadersMap, env) { - const metadata = new grpc.Metadata() - metadata.add('license_key', licenseKey) - metadata.add('agent_run_token', runId) - - // p17 spec: If request_headers_map is empty or absent, - // the agent SHOULD NOT apply anything to its requests. - if (requestHeadersMap) { - for (const [key, value] of Object.entries(requestHeadersMap)) { - metadata.add(key.toLowerCase(), value) // keys MUST be lowercase for Infinite Tracing - } - } - - this._setTestMetadata(metadata, env) - - return metadata - } - - /** - * Adds test metadata used to simulate connectivity issues - * when appropriate env vars are set - * - * @param {object} metadata metadata to set - * @param {object} env process.env - */ - _setTestMetadata(metadata, env) { - for (const [key, envVar] of Object.entries(GRPC_TEST_META)) { - const value = parseInt(env[envVar], 10) - if (value) { - logger.trace('Adding %s metadata: %s', key, value) - metadata.add(key, value) - } - } - } - - /** - * Disconnects from gRPC endpoint and schedules establishing a new connection. - * - * @param {number} reconnectDelayMs number of milliseconds to wait before reconnecting. - */ - _reconnect(reconnectDelayMs = 0) { - this._disconnect() - - logger.trace('Reconnecting to gRPC endpoint in [%s] seconds', reconnectDelayMs) - - setTimeout(this.connectSpans.bind(this), reconnectDelayMs) - } - - _disconnect() { - logger.trace('Disconnecting from gRPC endpoint.') - - if (this.stream) { - this.stream.removeAllListeners() - - const oldStream = this.stream - this.stream.on('status', function endStreamStatusHandler(grpcStatus) { - logger.trace('End stream status received [%s]: %s', grpcStatus.code, grpcStatus.details) - - // Cleanup the final end stream listeners. - oldStream.removeAllListeners() - }) - - // Listen to any final errors to prevent throwing. - // This is unlikely but if the server closes post - // removing listeners and prior to response it could - // happen. We noticed this via tests on Node 14. - this.stream.on('error', function endStreamErrorHandler(err) { - logger.trace('End stream error received. Code: [%s]: %s', err.code, err.details) - }) - - // Indicates to server we are done. - // Server officially closes the stream. - this.stream.end() - - this.stream = null - } - - this._setState(connectionStates.disconnected) - } - - /** - * Central location to setup stream observers - * - * Events from the GRPC stream (a ClientDuplexStreamImpl) are the main way - * we communicate with the GRPC server. - * - * @param {object} stream duplex stream - */ - _setupSpanStreamObservers(stream) { - // Node streams require all data sent by the server to be read before the end - // (or status in this case) event gets fired. As such, we have to subscribe even - // if we are not going to use the data. - stream.on('data', function data(response) { - if (logger.traceEnabled()) { - logger.trace('gRPC span response stream: %s', JSON.stringify(response)) - } - }) - - // listen for status that indicate stream has ended, - // and we need to disconnect - stream.on('status', (grpcStatus) => { - logger.trace('gRPC Status Received [%s]: %s', grpcStatus.code, grpcStatus.details) - const grpcStatusName = grpc.status[grpcStatus.code] ? grpc.status[grpcStatus.code] : 'UNKNOWN' - - if (grpc.status[grpc.status.UNIMPLEMENTED] === grpcStatusName) { - this._metrics - .getOrCreateMetric(NAMES.INFINITE_TRACING.SPAN_RESPONSE_GRPC_UNIMPLEMENTED) - .incrementCallCount() - - // per the spec, An UNIMPLEMENTED status code from gRPC indicates - // that the versioned Trace Observer is no longer available. Agents - // MUST NOT attempt to reconnect in this case - logger.info( - '[UNIMPLEMENTED]: Trace Observer is no longer available. Shutting down connection.' - ) - this._disconnect() - } else if (grpc.status[grpc.status.OK] === grpcStatusName) { - this._reconnect() - } else { - this._metrics - .getOrCreateMetric( - util.format(NAMES.INFINITE_TRACING.SPAN_RESPONSE_GRPC_STATUS, grpcStatusName) - ) - .incrementCallCount() - - this._reconnect(this._reconnectDelayMs) - } - }) - - // if we don't listen for the errors they'll bubble - // up and crash the application - stream.on('error', (err) => { - this._metrics - .getOrCreateMetric(NAMES.INFINITE_TRACING.SPAN_RESPONSE_ERROR) - .incrementCallCount() - - // For errors, the status will either result in a disconnect or a reconnect - // delay that should prevent too frequent spamming. Unless the app is idle - // and regularly getting Status 13 reconnects from the server, in which case - // this will be almost the only logging. - logger.warn('Span stream error. Code: [%s]: %s', err.code, err.details) - }) - } - - /** - * Creates the GRPC credentials needed - * - * @param {object} grpcApi grpc lib - * @returns {object} ssl credentials - */ - _generateCredentials(grpcApi) { - let certBuffer = null - - // Current settable value for testing. If allowed to be overridden via - // configuration, this should be removed in place of setting - // this._rootCerts from config via normal configuration precedence. - const envTestCerts = process.env.NEWRELIC_GRPCCONNECTION_CA - const rootCerts = this._rootCerts || envTestCerts - if (rootCerts) { - logger.debug('Infinite tracing root certificates found to attach to requests.') - try { - certBuffer = Buffer.from(rootCerts, 'utf-8') - } catch (err) { - logger.warn('Failed to create buffer from rootCerts, proceeding without.', err) - } - } - - // null/undefined ca treated same as calling createSsl() - return grpcApi.credentials.createSsl(certBuffer) - } - - /** - * Internal/private method for connection - * - * Contains the actual logic that connects to the GRPC service. - * "Connection" can be a somewhat misleading term here. This method - * invokes the either `recordSpan` or `recordSpanBatch` remote procedure call. Behind the scenes - * this makes an http2 request with the metadata, and then returns - * a stream for further writing. - * - * @returns {object} stream duplex stream - */ - _connectSpans() { - if (!this._client) { - // Only create once to avoid potential memory leak. - // We create here (currently) for consistent error handling. - this._client = this._createClient() - } - - const metadata = this._getMetadata( - this._licenseKey, - this._runId, - this._requestHeadersMap, - process.env - ) - - const stream = this._client[this._method](metadata) - this._setupSpanStreamObservers(stream) - - return stream - } - - /** - * Creates gRPC service client to use for establishing gRPC streams. - * - * WARNING: creating a client more than once can result in a memory leak. - * ChannelImplementation and related objects will stay in memory even after - * the stream is closed and we do not have a handle to the client. Currently - * impacting grpc-js@1.2.11 and several earlier versions. - * - * @returns {object} protobuf API for IngestService - */ - _createClient() { - const endpoint = this._endpoint - logger.trace('Creating gRPC client for: ', endpoint) - - const packageDefinition = protoLoader.loadSync(PROTO_DEFINITION_PATH, PROTO_OPTIONS) - - const protoDescriptor = grpc.loadPackageDefinition(packageDefinition) - - const traceApi = protoDescriptor.com.newrelic.trace.v1 - - const credentials = this._generateCredentials(grpc) - - // If you want to use mock server use insecure creds - // const credentials = grpc.credentials.createInsecure() - - const opts = {} - if (this._compression) { - // 2 = gzip compression - // see: https://github.com/grpc/grpc-node/blob/master/packages/grpc-js/src/compression-algorithms.ts#L21 - opts['grpc.default_compression_algorithm'] = 2 - this._metrics - .getOrCreateMetric(`${NAMES.INFINITE_TRACING.COMPRESSION}/enabled`) - .incrementCallCount() - } else { - this._metrics - .getOrCreateMetric(`${NAMES.INFINITE_TRACING.COMPRESSION}/disabled`) - .incrementCallCount() - } - - return new traceApi.IngestService(endpoint, credentials, opts) - } -} - -module.exports = GrpcConnection diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/connection/states.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/connection/states.js deleted file mode 100644 index ddd33cce6..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/connection/states.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -module.exports = { - disconnected: 0, - connecting: 1, - connected: 2, - 0: 'disconnected', - 1: 'connecting', - 2: 'connected' -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/endpoints/infinite-tracing/v1.proto b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/endpoints/infinite-tracing/v1.proto deleted file mode 100644 index 45513449d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/grpc/endpoints/infinite-tracing/v1.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; - -package com.newrelic.trace.v1; - -service IngestService { - // Accepts a stream of Span messages, and returns an irregular stream of - // RecordStatus messages. - rpc RecordSpan(stream Span) returns (stream RecordStatus) {} - - // Accepts a stream of SpanBatch messages, and returns an irregular - // stream of RecordStatus messages. This endpoint can be used to improve - // throughput when Span messages are small - rpc RecordSpanBatch(stream SpanBatch) returns (stream RecordStatus) {} -} - -message SpanBatch { - repeated Span spans = 1; -} - -message Span { - string trace_id = 1; - map intrinsics = 2; - map user_attributes = 3; - map agent_attributes = 4; -} - -message AttributeValue { - oneof value { - string string_value = 1; - bool bool_value = 2; - int64 int_value = 3; - double double_value = 4; - } -} - -message RecordStatus { - uint64 messages_seen = 1; -} - diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/header-attributes.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/header-attributes.js deleted file mode 100644 index ad5a51717..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/header-attributes.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const DESTS = require('./config/attribute-filter').DESTINATIONS - -const COLLECTED_REQUEST_HEADERS = [ - 'accept', - 'content-length', - 'content-type', - 'referer', - 'user-agent', - 'host' -] - -const HEADER_ATTR_NAMES = { - 'accept': 'accept', - 'accept-charset': 'acceptCharset', - 'accept-encoding': 'acceptEncoding', - 'access-control-allow-headers': 'accessControlAllowHeaders', - 'access-control-allow-methods': 'accessControlAllowMethods', - 'access-control-allow-origin': 'accessControlAllowOrigin', - 'age': 'age', - 'allow': 'allow', - 'authorization': 'authorization', - 'cache-control': 'cacheControl', - 'connection': 'connection', - 'cookie': 'cookie', - 'content-encoding': 'contentEncoding', - 'content-length': 'contentLength', - 'content-type': 'contentType', - 'date': 'date', - 'etag': 'eTag', - 'expect': 'expect', - 'expires': 'expires', - 'forwarded': 'forwarded', - 'host': 'host', - 'if-match': 'ifMatch', - 'if-modified-since': 'ifModifiedSince', - 'last-modified': 'lastModified', - 'location': 'location', - 'newrelic': 'newrelic', - 'origin': 'origin', - 'proxy-authorization': 'proxyAuthorization', - 'referer': 'referer', - 'refresh': 'refresh', - 'server': 'server', - 'set-cookie': 'setCookie', - 'transfer-encoding': 'transferEncoding', - 'user-agent': 'userAgent', - 'upgrade': 'upgrade', - 'vary': 'vary', - 'x-correlation-id': 'xCorrelationId', - 'x-csrf-token': 'xCsrfToken', - 'x-forwarded-for': 'xForwardedFor', - 'x-http-method-override': 'xHttpMethodOverride', - 'x-newrelic-app-data': 'xNewrelicAppData', - 'x-newrelic-id': 'xNewrelicId', - 'x-newrelic-synthetics': 'xNewrelicSynthetics', - 'x-newrelic-transaction': 'xNewrelicTransaction', - 'x-powered-by': 'xPoweredBy', - 'x-queue-start': 'xQueueStart', - 'x-request-id': 'xRequestId', - 'x-request-start': 'xRequestStart', - 'x-requested-with': 'xRequestedWith' -} - -const REQUEST_HEADER_PREFIX = 'request.headers.' -const RESPONSE_HEADER_PREFIX = 'response.headers.' -const REQUEST_HEADER_NAMES = Object.create(null) -const RESPONSE_HEADER_NAMES = Object.create(null) - -_setHeaderAttrNames(REQUEST_HEADER_NAMES, REQUEST_HEADER_PREFIX) -_setHeaderAttrNames(RESPONSE_HEADER_NAMES, RESPONSE_HEADER_PREFIX) - -function _setHeaderAttrNames(dest, prefix) { - Object.keys(HEADER_ATTR_NAMES).forEach(function forEachHeader(h) { - dest[h] = prefix + HEADER_ATTR_NAMES[h] - }) -} - -function _headerToCamelCase(header) { - if (header.length === 0) { - return '' - } - - if (header.length === 1) { - return header.toLowerCase() - } - - const newHeader = header.charAt(0).toLowerCase() + header.slice(1) - - // Converts headers in the form 'header-name' to be in the form 'headerName' - return newHeader.replace(/[\W_]+(\w)/g, function capitalize(m, $1) { - return $1.toUpperCase() - }) -} - -function _collectHeaders(headers, nameMap, prefix, transaction) { - if (!headers) { - return - } - - if (!transaction.agent.config.allow_all_headers) { - headers = Object.keys(headers).reduce((collection, key) => { - collection[key.toLowerCase()] = headers[key] - return collection - }, {}) - } - - const headerKeys = !transaction.agent.config.allow_all_headers - ? COLLECTED_REQUEST_HEADERS - : Object.keys(headers) - - const segment = transaction.agent.tracer.getSegment() - - for (let i = 0; i < headerKeys.length; i++) { - const headerKey = headerKeys[i] - let header = headers[headerKey] - if (header !== undefined) { - // If any more processing of the headers is required consider refactoring this. - if (headerKey === 'referer' && typeof header === 'string') { - const queryParamIndex = header.indexOf('?') - if (queryParamIndex !== -1) { - header = header.substring(0, queryParamIndex) - } - } - - const attributeName = nameMap[headerKey] || prefix + _headerToCamelCase(headerKey) - transaction.trace.attributes.addAttribute(DESTS.TRANS_COMMON, attributeName, header) - - segment.addSpanAttribute(attributeName, header) - } - } -} - -/** - * Adds request headers as request.headers.* attributes to the given transaction. - * - * @param {Object} headers - Request headers to add attributes for. - * @param {Transaction} transaction - Transaction to add header attributes to. - */ -function collectRequestHeaders(headers, transaction) { - _collectHeaders(headers, REQUEST_HEADER_NAMES, REQUEST_HEADER_PREFIX, transaction) -} - -/** - * Adds response headers as response.headers.* attributes to the given transaction. - * - * @param {Object} headers - Response headers to add attributes for. - * @param {Transaction} transaction - Transaction to add header attributes to. - */ -function collectResponseHeaders(headers, transaction) { - _collectHeaders(headers, RESPONSE_HEADER_NAMES, RESPONSE_HEADER_PREFIX, transaction) -} - -module.exports = { - collectRequestHeaders, - collectResponseHeaders -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/header-processing.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/header-processing.js deleted file mode 100644 index fe46528f0..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/header-processing.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const REQUEST_START_HEADER = 'x-request-start' -const QUEUE_HEADER = 'x-queue-start' -const CONTENT_LENGTH_REGEX = /^Content-Length$/i - -/** - * Extracts queue time from the incoming request headers. - * - * Queue time is provided by certain providers by stamping the request - * header with the time the request arrived at the router. - * - * @param {*} logger - * @param {*} requestHeaders - */ -function getQueueTime(logger, requestHeaders) { - const headerValue = requestHeaders[REQUEST_START_HEADER] || requestHeaders[QUEUE_HEADER] - if (!headerValue) { - return null - } - - const split = headerValue.split('=') - const rawQueueTime = split.length > 1 ? split[1] : headerValue - - const parsedQueueTime = parseFloat(rawQueueTime) - if (isNaN(parsedQueueTime)) { - logger.warn('Queue time header parsed as NaN. See trace level log for value.') - - // This header can hold up to 4096 bytes which could quickly fill up logs. - // Do not log a level higher than debug. - logger.trace('Queue time: %s', rawQueueTime) - - return null - } - - return convertUnit(parsedQueueTime) -} - -function convertUnit(time) { - let convertedTime = time - if (convertedTime > 1e18) { - // nano seconds - convertedTime = convertedTime / 1e6 - } else if (convertedTime > 1e15) { - // micro seconds - convertedTime = convertedTime / 1e3 - } else if (convertedTime < 1e12) { - // seconds - convertedTime = convertedTime * 1e3 - } - - return convertedTime -} - -/** - * Returns the value of the Content-Length header - * - * If no header is found, returns -1 - * - * @param {*} headers - */ -function getContentLengthFromHeaders(headers) { - const contentLength = -1 - for (const [headerName, headerValue] of Object.entries(headers)) { - if (CONTENT_LENGTH_REGEX.test(headerName)) { - return headerValue - } - } - return contentLength -} - -module.exports = { - getQueueTime, - getContentLengthFromHeaders -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@hapi/hapi.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@hapi/hapi.js deleted file mode 100644 index 87066772d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@hapi/hapi.js +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const record = require('../../metrics/recorders/generic') -// This object defines all the events that we want to wrap extensions -// for, as they are the only ones associated with requests. -const ROUTE_EVENTS = { - onRequest: true, - onPreAuth: true, - onCredentials: true, - onPostAuth: true, - onPreHandler: true, - onPostHandler: true, - onPreResponse: true, - - // Server events - onPreStart: false, - onPostStart: false, - onPreStop: false, - onPostStop: false -} - -module.exports = function initialize(agent, hapi, moduleName, shim) { - if (!agent || !hapi || !shim) { - shim && - shim.logger.debug( - 'Hapi instrumentation function called with incorrect arguments, not instrumenting.' - ) - return false - } - - shim.setFramework(shim.HAPI) - - shim.setErrorPredicate(function hapiErrorPredicate(err) { - return err instanceof Error - }) - - // At this point, framework and error predicate have both already been set via ./hapi, - // so we only need to set the response predicate and wrap the server object - shim.setResponsePredicate(function hapiResponsePredicate(args, result) { - return !(result instanceof Error) && result !== args[1].continue - }) - - // 'Server' and 'server' both point to the same export, - // but we can't make any assumption about which will be used. - // Since we wrap the prototype, the second wrap should exit early. - shim.wrapReturn(hapi, 'server', serverFactoryWrapper) - shim.wrapReturn(hapi, 'Server', serverFactoryWrapper) -} - -function serverFactoryWrapper(shim, fn, fnName, server) { - serverPostConstructor.call(server, shim) -} - -function serverPostConstructor(shim) { - const proto = Object.getPrototypeOf(this) - - if (shim.isWrapped(proto.decorate)) { - shim.logger.trace('Already wrapped Server proto, not wrapping again') - return - } - - wrapProtoDecorate(shim, proto) - wrapProtoRoute(shim, proto) - wrapProtoExt(shim, proto) -} - -function wrapProtoDecorate(shim, proto) { - shim.wrap(proto, 'decorate', function wrapDecorate(shim, original) { - return function wrappedDecorate(type) { - // server.decorate also accepts 'request', 'toolkit', 'server' types, - // but we're only concerned with 'handler' - if (type !== 'handler') { - return original.apply(this, arguments) - } - - // Convert arguments to usable array - const args = shim.argsToArray.apply(shim, arguments) - - // Wrap the third server.decorate arg, the user-defined handler - shim.wrap(args, shim.THIRD, function wrapHandler(shim, fn) { - if (typeof fn !== 'function') { - return - } - - if (fn.defaults) { - wrappedHandler.defaults = fn.defaults - } - - return wrappedHandler - - function wrappedHandler(route) { - const ret = fn.apply(this, arguments) - - return typeof ret === 'function' ? wrapRouteHandler(shim, ret, route && route.path) : ret - } - }) - - return original.apply(this, args) - } - }) -} - -function wrapProtoRoute(shim, proto) { - shim.wrap(proto, 'route', function wrapRoute(shim, original) { - return function wrappedRoute() { - const args = shim.argsToArray.apply(shim, arguments) - - if (!shim.isObject(args[0])) { - return original.apply(this, args) - } - - // If route is created via a plugin, pull prefix if it exists - const prefix = - (this.realm && - this.realm.modifiers && - this.realm.modifiers.route && - this.realm.modifiers.route.prefix) || - '' - - _wrapRoute(shim, args[0], prefix) - - return original.apply(this, args) - } - }) -} - -function _wrapRoute(shim, route, prefix) { - const routePath = prefix + route.path - if (shim.isArray(route)) { - for (let i = 0; i < route.length; ++i) { - _wrapRoute(shim, route[i], prefix) - } - return - } else if (route.options) { - // v17 now prefers `options` property... - if (route.options.pre) { - // config objects can also contain multiple OTHER handlers in a `pre` array - route.options.pre = wrapPreHandlers(shim, route.options.pre, routePath) - } - if (route.options.handler) { - _wrapRouteHandler(shim, route.options, routePath) - return - } - } else if (route.config) { - // ... but `config` still works - if (route.config.pre) { - route.config.pre = wrapPreHandlers(shim, route.config.pre, routePath) - } - if (route.config.handler) { - _wrapRouteHandler(shim, route.config, routePath) - return - } - } - _wrapRouteHandler(shim, route, routePath) -} - -function _wrapRouteHandler(shim, container, path) { - if (typeof container.handler !== 'function') { - return - } - shim.wrap(container, 'handler', function wrapHandler(shim, handler) { - return wrapRouteHandler(shim, handler, path) - }) -} - -function wrapProtoExt(shim, proto) { - shim.wrap(proto, 'ext', function wrapExt(shim, original) { - return function wrappedExt(event, method) { - const args = shim.argsToArray.apply(shim, arguments) - - if (shim.isArray(event)) { - for (let i = 0; i < event.length; i++) { - event[i].method = wrapMiddleware(shim, event[i].method, event[i].type) - } - } else if (shim.isObject(event)) { - event.method = wrapMiddleware(shim, event.method, event.type) - } else if (shim.isString(event)) { - args[1] = wrapMiddleware(shim, method, event) - } else { - shim.logger.debug('Unsupported event type %j', event) - return - } - - return original.apply(this, args) - } - }) -} - -function wrapPreHandlers(shim, container, path) { - if (shim.isArray(container)) { - for (let i = 0; i < container.length; ++i) { - container[i] = wrapPreHandlers(shim, container[i], path) - } - return container - } else if (shim.isFunction(container)) { - return wrapPreHandler(shim, container, path) - } else if (container.method && shim.isFunction(container.method)) { - return shim.wrap(container, 'method', function wrapHandler(shim, handler) { - return wrapPreHandler(shim, handler, path) - }) - } -} - -function wrapPreHandler(shim, container, path) { - return shim.record(container, (shim) => { - return { name: [shim.HAPI, ' pre handler: ', '(', path, ')'].join(''), recorder: record } - }) -} - -function wrapRouteHandler(shim, handler, path) { - return shim.recordMiddleware(handler, { - route: path, - req: function getReq(shim, fn, fnName, args) { - const [request] = args - return request?.raw?.req - }, - promise: true, - params: function getParams(shim, fn, fnName, args) { - const [req] = args - return req?.params - } - }) -} - -function wrapMiddleware(shim, middleware, event) { - if (!ROUTE_EVENTS[event]) { - return middleware - } - - return shim.recordMiddleware(middleware, { - route: event, - type: event === 'onPreResponse' ? shim.ERRORWARE : shim.MIDDLEWARE, - promise: true, - req: function getReq(_shim, _fn, _fnName, args) { - const [req] = args - return req?.raw?.req - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@hapi/vision.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@hapi/vision.js deleted file mode 100644 index 187390974..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@hapi/vision.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const semver = require('semver') - -module.exports = function initialize(agent, vision, moduleName, shim) { - const plugin = vision.plugin - - if (!plugin || !plugin.pkg || semver.lt(plugin.pkg.version, '5.0.0')) { - shim.logger.debug('Vision instrumentation requires v5 or greater, not instrumenting') - return false - } - - // Vision is only meant to be used with hapi - shim.setFramework(shim.HAPI) - - shim.wrap(plugin, 'register', function wrapRegister(shim, register) { - return function wrappedRegister(server) { - if (!shim.isWrapped(server, 'decorate')) { - shim.wrap(server, 'decorate', wrapDecorate) - } - - return register.apply(this, arguments) - } - }) -} - -function wrapDecorate(shim, decorate) { - return function wrappedDecorate(type, name, handler) { - if (type !== 'toolkit' || name !== 'view') { - return decorate.apply(this, arguments) - } - - const args = shim.argsToArray.apply(shim, arguments) - args[2] = shim.recordRender(handler, { promise: true }) - - return decorate.apply(this, args) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@nestjs/core.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@nestjs/core.js deleted file mode 100644 index 5c922f8a7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@nestjs/core.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2023 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const logger = require('../../logger').child({ component: 'nestjs' }) -const semver = require('semver') - -module.exports = function initialize(agent, core, moduleName, shim) { - const nestJsVersion = shim.require('./package.json').version - shim.setFramework(shim.NEST) - // Earliest version that runs in the tests - if (semver.lt(nestJsVersion, '8.0.0')) { - logger.debug( - `Not instrumenting Nest.js version ${nestJsVersion}; minimum instrumentable version is 8.0.0` - ) - return - } - - shim.wrap(core.BaseExceptionFilter.prototype, 'handleUnknownError', (shim, original) => { - return function wrappedHandleUnknownError(exception) { - const segment = shim.getActiveSegment() - const transaction = segment?.transaction - if (transaction) { - shim.agent.errors.add(transaction, exception) - logger.trace(exception, 'Captured error handled by Nest.js exception filter.') - } else { - logger.trace( - exception, - 'Ignoring error handled by Nest.js exception filter: not in a transaction' - ) - } - - return original.apply(this, arguments) - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@node-redis/client.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@node-redis/client.js deleted file mode 100644 index 5f1b767a7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@node-redis/client.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const CLIENT_COMMANDS = ['select', 'quit', 'SELECT', 'QUIT'] -const opts = Symbol('clientOptions') - -module.exports = function initialize(_agent, redis, _moduleName, shim) { - shim.setDatastore(shim.REDIS) - const COMMANDS = Object.keys(shim.require('dist/lib/client/commands.js').default) - const CMDS_TO_INSTRUMENT = [...COMMANDS, ...CLIENT_COMMANDS] - shim.wrap(redis, 'createClient', function wrapCreateClient(shim, original) { - return function wrappedCreateClient() { - const client = original.apply(this, arguments) - client[opts] = getRedisParams(client.options) - CMDS_TO_INSTRUMENT.forEach(instrumentClientCommand.bind(null, shim, client)) - return client - } - }) -} - -/** - * Instruments a given command on the client by calling `shim.recordOperation` - * - * @param {Shim} shim shim instance - * @param {object} client redis client instance - * @param {string} cmd command to instrument - */ -function instrumentClientCommand(shim, client, cmd) { - const { agent } = shim - - shim.recordOperation(client, cmd, function wrapCommand(_shim, _fn, _fnName, args) { - const [key, value] = args - const parameters = Object.assign({}, client[opts]) - // If selecting a database, subsequent commands - // will be using said database, update the clientOptions - // but not the current parameters(feature parity with v3) - if (cmd.toLowerCase() === 'select') { - client[opts].database_name = key - } - if (agent.config.attributes.enabled) { - if (key) { - parameters.key = JSON.stringify(key) - } - if (value) { - parameters.value = JSON.stringify(value) - } - } - - return { - name: (cmd && cmd.toLowerCase()) || 'other', - parameters, - promise: true - } - }) -} - -/** - * Extracts the datastore parameters from the client options - * - * @param {object} clientOpts client.options - * @returns {object} params - */ -function getRedisParams(clientOpts) { - return { - host: clientOpts?.socket?.host || 'localhost', - port_path_or_id: clientOpts?.socket?.path || clientOpts?.socket?.port || '6379', - database_name: clientOpts.database || 0 - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@prisma/client.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@prisma/client.js deleted file mode 100644 index 27857b763..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@prisma/client.js +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2023 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { prismaConnection, prismaModelCall } = require('../../symbols') -const { URL } = require('url') -const logger = require('../../logger').child({ component: 'prisma' }) -const parseSql = require('../../db/query-parsers/sql') -// Note: runCommandRaw is another raw command but it is mongo which we cannot parse as sql -const RAW_COMMANDS = ['executeRaw', 'queryRaw'] - -const semver = require('semver') - -/** - * Extracts the connection url from env var or the .value prop - * Very similar to this helper: https://github.com/prisma/prisma/blob/main/packages/internals/src/utils/parseEnvValue.ts - * - * @param {string} datasource object from prisma config { url, fromEnvVar } - * @returns {string} connection string - */ -function extractConnectionString(datasource = {}) { - return process.env[datasource.fromEnvVar] || datasource.value -} -/** - * Parses a connection string. Most database engines in prisma are SQL and all - * have similar engine strings. - * - * **Note**: This will not parse ms sql server, instead will log a warning - * - * @param {string} provider prisma provider(i.e. mysql, postgres, mongodb) - * @param {string} datasource object from prisma config { url, fromEnvVar } - * @returns {object} { host, port, dbName } - */ -function parseConnectionString(provider, datasource) { - const connectionUrl = extractConnectionString(datasource) - - let parameters = {} - try { - const parsedUrl = new URL(connectionUrl) - parameters = { - host: parsedUrl.hostname, - port: parsedUrl.port, - dbName: parsedUrl.pathname && decodeURIComponent(parsedUrl.pathname.split('/')[1]) - } - } catch (err) { - logger.warn('Failed to parse connection string for %s: %s', provider, err.message) - } - return parameters -} - -/** - * Extracts the raw query string from the appropriate location within the function args. - * In 4.11.0 prisma refactored code and args are an array on .args, whereas before they - * were an object on .args. - * - * @param {Array} args args passed to the prisma function - * @param {string} pkgVersion prisma version - * @returns {string} raw query string - */ -function extractQueryArgs(args, pkgVersion) { - let query = '' - try { - if (semver.gte(pkgVersion, '4.11.0')) { - query = args[0].args[0] - if (Array.isArray(query)) { - // RawUnsafe pass in a string, but plain Raw methods pass in an - // array containing a prepared SQL statement and the SQL parameters - query = query[0] - } - } else { - query = args[0].args.query - } - } catch (err) { - logger.error('Failed to extract query from raw query: %s', err.message) - } - - return query -} - -/** - * Extracts either the raw query or the client method. - * - * @param {Array} args arguments to a prisma operation - * @param {string} pkgVersion prisma version - * @returns {string} query raw query string or model call . - */ -function retrieveQuery(args, pkgVersion) { - if (Array.isArray(args)) { - const action = args[0].action - if (RAW_COMMANDS.includes(action)) { - return extractQueryArgs(args, pkgVersion) - } - - // cast to string obj to attach symbol - // this is done to tell query parser that we need to split string - // to extract contents - const clientMethod = new String(args[0].clientMethod) - clientMethod[prismaModelCall] = true - return clientMethod - } -} - -/** - * Parses formatted string to extract the collection and operation. - * In case of executeRaw the string is created above in `retrieveQuery` - * - * @param {string} query raw query string or model call . - * @returns {object} { collection, operation, query } - */ -function queryParser(query) { - if (query[prismaModelCall]) { - const [collection, operation] = query.split('.') - return { - collection, - operation, - // this is a String object, need to parse to string literal - query: query.toString() - } - } - return parseSql(query) -} - -/** - * Extracts the prisma connection information from the engine. In pre 4.11.0 this existed - * on a different object and was also a promise. - * - * @param {object} client prisma client instance - * @param {string} pkgVersion prisma version - * @returns {Promise} returns prisma connection configuration - */ -function extractPrismaConfig(client, pkgVersion) { - if (semver.gte(pkgVersion, '4.11.0')) { - // wait for the library promise to resolve before getting the config - return client._engine.libraryInstantiationPromise.then(() => { - return client._engine.library.getConfig({ - datamodel: client._engine.datamodel, - ignoreEnvVarErrors: true - }) - }) - } - return client._engine.getConfig() -} - -/** - * Instruments the `@prisma/client` module, function that is - * passed to `onRequire` when instantiating instrumentation. - * - * @param {object} _agent New Relic agent - * @param {object} prisma resolved module - * @param {string} _moduleName string representation of require/import path - * @param {object} shim New Relic shim - */ -module.exports = async function initialize(_agent, prisma, _moduleName, shim) { - const pkgVersion = shim.require('./package.json').version - if (semver.lt(pkgVersion, '4.0.0')) { - logger.warn( - 'Skipping instrumentation of @prisma/client. Minimum supported version of library is 4.0.0, actual version %s', - pkgVersion - ) - return - } - - shim.setDatastore(shim.PRISMA) - shim.setParser(queryParser) - - shim.recordQuery( - prisma.PrismaClient.prototype, - '_executeRequest', - function wrapExecuteRequest(shim, _executeRequest, _fnName, args) { - const client = this - - return { - promise: true, - query: retrieveQuery(args, pkgVersion), - /** - * Adds the relevant host, port, database_name parameters - * to the active segment - */ - inContext: async function inContext() { - if (!client[prismaConnection]) { - try { - const prismaConfig = await extractPrismaConfig(client, pkgVersion) - const activeDatasource = prismaConfig?.datasources[0] - const dbParams = parseConnectionString( - activeDatasource?.provider, - activeDatasource?.url - ) - shim.captureInstanceAttributes(dbParams.host, dbParams.port, dbParams.dbName) - client[prismaConnection] = dbParams - } catch (err) { - logger.error('Failed to retrieve prisma config in %s: %s', pkgVersion, err.message) - client[prismaConnection] = {} - } - } else { - shim.captureInstanceAttributes( - client[prismaConnection].host, - client[prismaConnection].port, - client[prismaConnection].dbName - ) - } - } - } - } - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@redis/client.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@redis/client.js deleted file mode 100644 index 26371944b..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/@redis/client.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -module.exports = require('../@node-redis/client') diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/amqplib.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/amqplib.js deleted file mode 100644 index 708752106..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/amqplib.js +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const url = require('url') - -module.exports.selfRegister = function selfRegister(shimmer) { - shimmer.registerInstrumentation({ - moduleName: 'amqplib', - type: 'message', - onRequire: instrumentChannelAPI - }) - shimmer.registerInstrumentation({ - moduleName: 'amqplib/channel_api', - type: 'message', - onRequire: instrumentChannelAPI - }) - shimmer.registerInstrumentation({ - moduleName: 'amqplib/channel_api.js', - type: 'message', - onRequire: instrumentChannelAPI - }) - shimmer.registerInstrumentation({ - moduleName: 'amqplib/callback_api', - type: 'message', - onRequire: instrumentCallbackAPI - }) - shimmer.registerInstrumentation({ - moduleName: 'amqplib/callback_api.js', - type: 'message', - onRequire: instrumentCallbackAPI - }) -} - -module.exports.instrumentPromiseAPI = instrumentChannelAPI -module.exports.instrumentCallbackAPI = instrumentCallbackAPI - -const CHANNEL_METHODS = [ - 'close', - 'open', - 'assertQueue', - 'checkQueue', - 'deleteQueue', - 'bindQueue', - 'unbindQueue', - 'assertExchange', - 'checkExchange', - 'deleteExchange', - 'bindExchange', - 'unbindExchange', - 'cancel', - 'prefetch', - 'recover' -] - -const TEMP_RE = /^amq\./ - -/** - * Register all the necessary instrumentation when using - * promise based methods - * - * @param {Shim} shim instance of shim - * @param {object} amqp amqplib object - */ -function instrumentChannelAPI(shim, amqp) { - instrumentAMQP(shim, amqp, true) - // 👀 take note the model is channel not callback 👀 - const model = shim.require('./lib/channel_model') - wrapModel(shim, model, true) -} - -/** - * Register all the necessary instrumentation when using - * callback based methods - * - * @param {Shim} shim instance of shim - * @param {object} amqp amqplib object - */ -function instrumentCallbackAPI(shim, amqp) { - instrumentAMQP(shim, amqp, false) - // 👀 take note the model is callback not channel 👀 - const model = shim.require('./lib/callback_model') - wrapModel(shim, model, false) -} - -/** - * - * Instruments the connect method and channel prototype of amqplib - * - * @param {Shim} shim instance of shim - * @param {object} amqp amqplib object - * @param {boolean} promiseMode is this promise based? - * @returns {void} - */ -function instrumentAMQP(shim, amqp, promiseMode) { - if (!amqp || !amqp.connect) { - shim.logger.debug("This module is not the amqplib we're looking for.") - return - } - - if (shim.isWrapped(amqp.connect)) { - shim.logger.trace('This module has already been instrumented, skipping.') - return - } - shim.setLibrary(shim.RABBITMQ) - - wrapConnect(shim, amqp, promiseMode) - wrapChannel(shim) -} - -/** - * Helper to set the appropriate value of the callback property - * in the spec. If it's a promise set to null otherwise set it to `shim.LAST` - * - * @param {Shim} shim instance of shim - * @param {boolean} promiseMode is this promise based? - * @returns {string|null} appropriate value - */ -function setCallback(shim, promiseMode) { - return promiseMode ? null : shim.LAST -} - -/** - * - * Instruments the connect method - * - * @param {Shim} shim instance of shim - * @param {object} amqp amqplib object - * @param {boolean} promiseMode is this promise based? - */ -function wrapConnect(shim, amqp, promiseMode) { - shim.record(amqp, 'connect', function recordConnect(shim, connect, name, args) { - let [connArgs] = args - let params = null - - if (shim.isString(connArgs)) { - connArgs = url.parse(connArgs) - params = { host: connArgs.hostname } - if (connArgs.port) { - params.port = connArgs.port - } - } - - return { - name: 'amqplib.connect', - callback: setCallback(shim, promiseMode), - promise: promiseMode, - parameters: params, - stream: null, - recorder: null - } - }) -} - -/** - * - * Instruments the sendOrEnqueue and sendMessage methods of the ampqlib channel. - * - * @param {Shim} shim instance of shim - */ -function wrapChannel(shim) { - const libChannel = shim.require('./lib/channel') - if (!libChannel?.Channel?.prototype) { - shim.logger.debug('Could not get Channel class to instrument.') - return - } - - const proto = libChannel.Channel.prototype - if (shim.isWrapped(proto.sendMessage)) { - shim.logger.trace('Channel already instrumented.') - return - } - shim.logger.trace('Instrumenting basic Channel class.') - - shim.wrap(proto, 'sendOrEnqueue', function wrapSendOrEnqueue(shim, fn) { - if (!shim.isFunction(fn)) { - return fn - } - - return function wrappedSendOrEnqueue() { - const segment = shim.getSegment() - const cb = arguments[arguments.length - 1] - if (!shim.isFunction(cb) || !segment) { - shim.logger.debug({ cb: !!cb, segment: !!segment }, 'Not binding sendOrEnqueue callback') - return fn.apply(this, arguments) - } - - shim.logger.trace('Binding sendOrEnqueue callback to %s', segment.name) - const args = shim.argsToArray.apply(shim, arguments) - args[args.length - 1] = shim.bindSegment(cb, segment) - return fn.apply(this, args) - } - }) - - shim.recordProduce(proto, 'sendMessage', function recordSendMessage(shim, fn, n, args) { - const fields = args[0] - if (!fields) { - return null - } - const isDefault = fields.exchange === '' - let exchange = 'Default' - if (!isDefault) { - exchange = TEMP_RE.test(fields.exchange) ? null : fields.exchange - } - - return { - destinationName: exchange, - destinationType: shim.EXCHANGE, - routingKey: fields.routingKey, - headers: fields.headers, - parameters: getParameters(Object.create(null), fields) - } - }) -} - -/** - * Sets the relevant message parameters - * - * @param {object} parameters object used to store the message parameters - * @param {object} fields fields from the sendMessage method - * @returns {object} parameters updated parameters - */ -function getParameters(parameters, fields) { - if (fields.routingKey) { - parameters.routing_key = fields.routingKey - } - if (fields.correlationId) { - parameters.correlation_id = fields.correlationId - } - if (fields.replyTo) { - parameters.reply_to = fields.replyTo - } - - return parameters -} - -/** - * - * Instruments the relevant channel callback_model or channel_model. - * - * @param {Shim} shim instance of shim - * @param {object} Model either channel or callback model - * @param {boolean} promiseMode is this promise based? - */ -function wrapModel(shim, Model, promiseMode) { - if (!Model.Channel?.prototype) { - shim.logger.debug( - `Could not get ${promiseMode ? 'promise' : 'callback'} model Channel to instrument.` - ) - } - - const proto = Model.Channel.prototype - if (shim.isWrapped(proto.consume)) { - shim.logger.trace(`${promiseMode ? 'promise' : 'callback'} model already instrumented.`) - return - } - - shim.record(proto, CHANNEL_METHODS, function recordChannelMethod(shim, fn, name) { - return { - name: 'Channel#' + name, - callback: setCallback(shim, promiseMode), - promise: promiseMode - } - }) - - shim.recordConsume(proto, 'get', { - destinationName: shim.FIRST, - callback: setCallback(shim, promiseMode), - promise: promiseMode, - messageHandler: function handleConsumedMessage(shim, fn, name, message) { - // the message is the param when using the promised based model - message = promiseMode ? message : message[1] - if (!message) { - shim.logger.trace('No results from consume.') - return null - } - const parameters = Object.create(null) - getParameters(parameters, message.fields) - getParameters(parameters, message.properties) - - const headers = message?.properties?.headers - - return { parameters, headers } - } - }) - - shim.recordPurgeQueue(proto, 'purgeQueue', function recordPurge(shim, fn, name, args) { - let queue = args[0] - if (TEMP_RE.test(queue)) { - queue = null - } - return { queue, promise: promiseMode, callback: setCallback(shim, promiseMode) } - }) - - shim.recordSubscribedConsume(proto, 'consume', { - name: 'amqplib.Channel#consume', - queue: shim.FIRST, - consumer: shim.SECOND, - promise: promiseMode, - callback: promiseMode ? null : shim.FOURTH, - messageHandler: describeMessage - }) -} - -/** - * Extracts the appropriate messageHandler parameters for the consume method. - * - * @param {Shim} shim instance of shim - * @param {object} _consumer not used - * @param {string} _name not used - * @param {Array} args arguments passed to the consume method - * @returns {object} message params - */ -function describeMessage(shim, _consumer, _name, args) { - const [message] = args - - if (!message?.properties) { - shim.logger.debug({ message: message }, 'Failed to find message in consume arguments.') - return null - } - - const parameters = getParameters(Object.create(null), message.fields) - getParameters(parameters, message.properties) - let exchangeName = message?.fields?.exchange || 'Default' - - if (TEMP_RE.test(exchangeName)) { - exchangeName = null - } - - return { - destinationName: exchangeName, - destinationType: shim.EXCHANGE, - routingKey: message?.fields?.routingKey, - headers: message.properties.headers, - parameters - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/bluebird.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/bluebird.js deleted file mode 100644 index 36e86009c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/bluebird.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// XXX We are not instrumenting bluebird's cancellation feature because it seems -// rather like an edge case feature. It is not enabled by default and has strange -// effects on the interface. If our lack of support for cancellation becomes an -// issue we can revisit this decision. -// -// http://bluebirdjs.com/docs/api/cancellation.html - -module.exports = function initialize(agent, bluebird, moduleName, shim) { - const Promise = bluebird.Promise - const proto = Promise && Promise.prototype - if (!proto) { - shim.logger.debug('Could not find promise prototype, not instrumenting.') - return false - } - - shim.setClass(Promise) - - // _resolveFromResolver is in bluebird 2.x - // _execute is in bluebird 3.x - shim.wrapExecutorCaller(proto, ['_execute', '_resolveFromResolver']) - shim.wrapThen(proto, [ - 'asCallback', - 'done', - 'each', - 'filter', - 'finally', - 'lastly', - 'map', - 'mapSeries', - 'nodeify', - 'reduce', - 'spread', - 'tap', - 'tapCatch', - 'then' - ]) - shim.wrapCatch(proto, ['catch', 'caught', 'error']) - shim.wrapCast(proto, [ - 'all', - 'any', - 'bind', - 'call', - 'catchReturn', - 'catchThrow', - 'delay', - 'get', - 'props', - 'race', - 'reflect', - 'return', - 'some', - 'thenReturn', - 'thenThrow', - 'throw', - 'timeout' - ]) - - shim.wrapCast(Promise, [ - 'all', - 'allSettled', - 'any', - 'attempt', - 'bind', - 'cast', - 'delay', - 'each', - 'filter', - 'fromCallback', - 'fromNode', - 'fulfilled', - 'join', - 'map', - 'mapSeries', - 'props', - 'race', - 'reduce', - 'reject', - 'rejected', - 'resolve', - 'some', - 'try' - ]) - shim.wrapPromisify(Promise, ['coroutine', 'method', 'promisify']) - - // Using `getNewLibraryCopy` needs to trigger re-instrumenting. - shim.wrap(bluebird.Promise, 'getNewLibraryCopy', function wrapNewCopy(shim, original) { - return function wrappedNewCopy() { - shim.logger.trace('Instrumenting new library copy...') - const copy = original.apply(this, arguments) - module.exports(agent, copy, moduleName, shim) - return copy - } - }) - - // Need to copy over `coroutine.addYieldHandler` - const coroutine = Promise && Promise.coroutine - if (shim.isWrapped(coroutine)) { - const original = shim.getOriginal(coroutine) - coroutine.addYieldHandler = original && original.addYieldHandler - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/bunyan.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/bunyan.js deleted file mode 100644 index 80fab5a77..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/bunyan.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { - isApplicationLoggingEnabled, - isLogForwardingEnabled, - isLocalDecoratingEnabled, - isMetricsEnabled, - createModuleUsageMetric, - incrementLoggingLinesMetrics, - truncate -} = require('../util/application-logging') - -const logger = require('../logger').child({ component: 'bunyan' }) - -function augmentLogData(originalLog, agent, nameFromLevel) { - // shallow copy, since we're modifying things - const newLog = Object.assign({}, originalLog) - newLog.timestamp = Date.now() - newLog.level = nameFromLevel[originalLog.level] - - // put log message into a consistent spot and ensure it's not too long - newLog.message = truncate(newLog.msg) - - // tidy up the error output to help with max length restrictions - if (newLog.err) { - newLog['error.message'] = truncate(newLog.err.message) - newLog['error.stack'] = truncate(newLog.err.stack) - newLog['error.class'] = - newLog.err.name === 'Error' ? newLog.err.constructor.name : newLog.err.name - // clear out the old error message - delete newLog.err - } - - // Add the metadata to the object being logged - const metadata = agent.getLinkingMetadata(true) - Object.keys(metadata).forEach((m) => { - newLog[m] = metadata[m] - }) - - return newLog -} - -function createLoggerWrapper(shim, fn, fnName, bunyanLogger, nameFromLevel) { - const agent = shim.agent - - createModuleUsageMetric('bunyan', agent.metrics) - - // forward logs via the agent logs aggregator - bunyanLogger.addStream({ - name: 'NRLogForwarder', - type: 'raw', - level: bunyanLogger.level(), - stream: { - write: function nrLogWrite(logLine) { - agent.logs.add(augmentLogData(logLine, agent, nameFromLevel)) - } - } - }) - // no return here means the original return value is preserved -} - -module.exports = function instrument(agent, bunyan, _, shim) { - const config = agent.config - - if (!isApplicationLoggingEnabled(config)) { - logger.debug('Application logging not enabled. Not instrumenting bunyan.') - return - } - - const logForwardingEnabled = isLogForwardingEnabled(config, agent) - const localDecoratingEnabled = isLocalDecoratingEnabled(config) - const metricsEnabled = isMetricsEnabled(config) - - if (logForwardingEnabled) { - shim.wrapReturn(bunyan, 'createLogger', createLoggerWrapper, [bunyan.nameFromLevel]) - } - - if (metricsEnabled || localDecoratingEnabled) { - shim.wrap(bunyan.prototype, '_emit', function wrapEmit(_shim, emit) { - return function wrappedEmit() { - const args = shim.argsToArray.apply(shim, arguments) - const rec = args[0] - - if (metricsEnabled) { - incrementLoggingLinesMetrics(bunyan.nameFromLevel[rec.level], agent.metrics) - } - - if (localDecoratingEnabled) { - rec.message = truncate(rec.msg) + agent.getNRLinkingMetadata() - } - args[0] = rec - return emit.apply(this, args) - } - }) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/cassandra-driver.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/cassandra-driver.js deleted file mode 100644 index d093cf46b..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/cassandra-driver.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const semver = require('semver') - -/** - * Instruments the `cassandra-driver` module, function that is - * passed to `onRequire` when instantiating instrumentation. - * - * @param {object} _agent - NewRelic agent - * @param {object} cassandra - The cassandra-driver library definition - * @param {string} _moduleName - String representation of require/import path - * @param {object} shim - shim for instrumentation - */ -module.exports = function initialize(_agent, cassandra, _moduleName, shim) { - const cassandraVersion = shim.require('./package.json').version - - shim.setDatastore(shim.CASSANDRA) - - const ClientProto = cassandra.Client.prototype - const RequestExecutionProto = shim.require('./lib/request-execution.js').prototype - - shim.recordOperation(ClientProto, ['connect', 'shutdown'], { callback: shim.LAST }) - - if (semver.satisfies(cassandraVersion, '>=4.4.0')) { - shim.recordQuery(ClientProto, '_execute', { - query: shim.FIRST, - callback: shim.LAST - }) - - shim.wrap( - RequestExecutionProto, - '_sendOnConnection', - function wrapSendOnConnection(shim, _sendOnConnection) { - return function wrappedSendOnConnection() { - shim.captureInstanceAttributes( - this._connection.address, - this._connection.port, - this._connection.keyspace - ) - - return _sendOnConnection.apply(this, arguments) - } - } - ) - } else { - shim.recordQuery(ClientProto, '_innerExecute', { - query: shim.FIRST, - callback: shim.LAST - }) - - shim.wrap(RequestExecutionProto, 'start', function wrapStart(shim, start) { - return function wrappedStart() { - const parent = shim.getSegment() - const self = this - - const args = shim.argsToArray.apply(shim, arguments) - - /** - * In older versions of cassandra-driver, we can't rely on RequestExecution._sendOnConnection, - * so instead we use the callback passed to RequestExecution.start as a sort of hook point, - * because we know for sure that the connection was set and in scope right before the callback - * is executed. - * - * We also have to set the active segment to the RequestExecution.start's segment to ensure that - * we're adding the connection attributes to the correct segment. - * - * See: https://github.com/datastax/nodejs-driver/blob/v3.4.0/lib/request-execution.js#L51 - */ - args[0] = shim.wrap(args[0], function wrapGetHostCallback(shim, getHostCallback) { - return function wrappedGetHostCallback() { - shim.setActiveSegment(parent) - - shim.captureInstanceAttributes( - self._connection.address, - self._connection.port, - self._connection.keyspace - ) - return getHostCallback.apply(this, arguments) - } - }) - - return start.apply(this, args) - } - }) - } - - shim.recordBatchQuery(ClientProto, 'batch', { - query: findBatchQueryArg, - callback: shim.LAST - }) -} - -/** - * Given the arguments for Cassandra's `batch` method, this finds the first - * query in the batch. - * - * @param {object} _shim - shim for instrumentation - * @param {Function} _batch - original batch function - * @param {string} _fnName - the function name (batch) - * @param {Array} args - original arguments passed to the batch function - * @returns {string} The query for this batch request. - */ -function findBatchQueryArg(_shim, _batch, _fnName, args) { - const sql = (args[0] && args[0][0]) || '' - return sql.query || sql -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/connect.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/connect.js deleted file mode 100644 index 756310c1e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/connect.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = function initialize(agent, connect, moduleName, shim) { - if (!connect) { - shim.logger.debug('Connect not supplied, not instrumenting.') - return false - } - - shim.setFramework(shim.CONNECT) - - shim.setRouteParser(function parseRoute(shim, fn, fnName, route) { - return route - }) - - const proto = - (connect && connect.HTTPServer && connect.HTTPServer.prototype) || // v1 - (connect && connect.proto) // v2 - - shim.wrapMiddlewareMounter(proto, 'use', { - route: shim.FIRST, - endpoint: shim.LAST, - wrapper: wrapMiddleware - }) - - wrapConnectExport(shim, connect, !proto) -} - -function wrapMiddleware(shim, middleware, name, route) { - const spec = { - matchArity: true, - route: route, - type: shim.MIDDLEWARE, - next: shim.LAST, - req: shim.FIRST - } - - if (middleware.length === 4) { - spec.type = shim.ERRORWARE - spec.req = shim.SECOND - } - - if (shim.isWrapped(middleware)) { - // In some cases the middleware will be instrumented by a framework - // that uses connect (e.g. express v3) and we omit the connect - // instrumentation. - return middleware - } - - return shim.recordMiddleware(middleware, spec) -} - -function wrapConnectExport(shim, connect, v3) { - shim.wrapExport(connect, function wrapExport(shim, fn) { - const wrapper = shim.wrap(fn, function wrapConnect(shim, _fn) { - return function wrappedConnect() { - const res = _fn.apply(this, arguments) - if (v3) { - shim.wrapMiddlewareMounter(res, 'use', { - route: shim.FIRST, - wrapper: wrapMiddleware - }) - } - return res - } - }) - shim.proxy(fn, Object.keys(fn), wrapper) - return wrapper - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/async-hooks.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/async-hooks.js deleted file mode 100644 index a0a497c86..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/async-hooks.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../../logger').child({ component: 'async_hooks' }) -const asyncHooks = require('async_hooks') - -module.exports = initialize - -function initialize(agent, shim) { - if (agent.config.feature_flag.async_local_context) { - logger.debug( - 'New AsyncLocalStorage context enabled. Not enabling manual async_hooks or promise instrumentation' - ) - - return - } - - // this map is reused to track the segment that was active when - // the before callback is called to be replaced in the after callback - const segmentMap = new Map() - module.exports.segmentMap = segmentMap - - const hookHandlers = getHookHandlers(segmentMap, agent, shim) - maybeRegisterDestroyHook(segmentMap, agent, hookHandlers) - - const hook = asyncHooks.createHook(hookHandlers) - hook.enable() - - agent.on('unload', function disableHook() { - hook.disable() - }) - - return true -} - -/** - * Registers the async hooks events - * - * Note: The init only fires when the type is PROMISE. - * - * @param {Map} segmentMap map of async ids and segments - * @param {Agent} agent New Relic APM agent - * @param {Shim} shim instance of shim - * @returns {object} event handlers for async hooks - */ -function getHookHandlers(segmentMap, agent, shim) { - return { - init: function initHook(id, type, triggerId) { - if (type !== 'PROMISE') { - return - } - - const parentSegment = segmentMap.get(triggerId) - - if (parentSegment && !parentSegment.transaction.isActive()) { - // Stop propagating if the transaction was ended. - return - } - - if (!parentSegment && !agent.getTransaction()) { - return - } - - const activeSegment = shim.getActiveSegment() || parentSegment - - segmentMap.set(id, activeSegment) - }, - - before: function beforeHook(id) { - const hookSegment = segmentMap.get(id) - - if (!hookSegment) { - return - } - - segmentMap.set(id, shim.getActiveSegment()) - shim.setActiveSegment(hookSegment) - }, - after: function afterHook(id) { - const hookSegment = segmentMap.get(id) - - // hookSegment is the segment that was active before the promise - // executed. If the promise is executing before a segment has been - // restored, hookSegment will be null and should be restored. Thus - // undefined is the only invalid value here. - if (hookSegment === undefined) { - return - } - - segmentMap.set(id, shim.getActiveSegment()) - shim.setActiveSegment(hookSegment) - }, - promiseResolve: function promiseResolveHandler(id) { - const hookSegment = segmentMap.get(id) - segmentMap.delete(id) - - if (hookSegment === undefined) { - return - } - - // Because the ID will no-longer be in memory until dispose to propagate the null - // we need to set it active here or else we may continue to propagate the wrong tree. - // May be some risk of setting this at the wrong time - if (hookSegment === null) { - shim.setActiveSegment(hookSegment) - } - } - } -} - -/** - * Adds the destroy async hook event that will lean up any unresolved promises that have been destroyed. - * This defaults to true but does have a significant performance impact - * when customers have a lot of promises. - * See: https://github.com/newrelic/node-newrelic/issues/760 - * - * @param {Map} segmentMap map of async ids and segments - * @param {Agent} agent New Relic APM agent - * @param {object} hooks async-hook events - */ -function maybeRegisterDestroyHook(segmentMap, agent, hooks) { - if (agent.config.feature_flag.unresolved_promise_cleanup) { - logger.info('Adding destroy hook to clean up unresolved promises.') - hooks.destroy = function destroyHandler(id) { - segmentMap.delete(id) - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/child_process.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/child_process.js deleted file mode 100644 index b594c4648..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/child_process.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = initialize - -function initialize(agent, childProcess, moduleName, shim) { - if (!childProcess) { - shim.logger.debug('Could not find child_process, not instrumenting') - return false - } - - const methods = ['exec', 'execFile'] - - shim.record(childProcess, methods, function recordExec(shim, fn, name) { - return { name: 'child_process.' + name, callback: shim.LAST } - }) - - if (childProcess.ChildProcess) { - wrapChildProcessClass(shim, childProcess.ChildProcess) - } else { - shim.logger.warn('childProcess.ChildProcess should be available in v2.2.0 or higher') - } - - function wrapChildProcessClass(shim, childProcessClass) { - shim.wrap(childProcessClass.prototype, 'on', function wrapChildProcessClassOn(shim, fn) { - return function wrappedChildProcessOn() { - const args = shim.argsToArray.apply(shim, arguments) - const cbIndex = args.length - 1 - - const originalListener = args[cbIndex] - if (!shim.isFunction(originalListener)) { - return fn.apply(this, arguments) - } - - shim.bindSegment(args, cbIndex) - - // Leverage events.removeListener() mechanism that checks listener - // property to allow our wrapped listeners to match and remove appropriately. - // Avoids having to instrument removeListener() and potentially doubling - // lookup. Since our wrapping will only be referenced by the events - // collection, we should not need to unwrap. - args[cbIndex].listener = originalListener - - return fn.apply(this, args) - } - }) - } - - makePromisifyCompatible(shim, childProcess) -} - -function makePromisifyCompatible(shim, childProcess) { - const originalExec = shim.getOriginal(childProcess.exec) - Object.getOwnPropertySymbols(originalExec).forEach((symbol) => { - childProcess.exec[symbol] = originalExec[symbol] - }) - - const originalExecFile = shim.getOriginal(childProcess.execFile) - Object.getOwnPropertySymbols(originalExecFile).forEach((symbol) => { - childProcess.execFile[symbol] = originalExecFile[symbol] - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/crypto.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/crypto.js deleted file mode 100644 index 4fa4f3e82..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/crypto.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = initialize - -function initialize(agent, crypto, moduleName, shim) { - shim.record( - crypto, - ['pbkdf2', 'randomBytes', 'pseudoRandomBytes', 'randomFill', 'scrypt'], - function recordCryptoMethod(shim, fn, name) { - return { - name: 'crypto.' + name, - callback: shim.LAST, - callbackRequired: true // sync version used too heavily - too much overhead - } - } - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/dns.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/dns.js deleted file mode 100644 index 0fd7fedb3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/dns.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = initialize - -function initialize(agent, dns, moduleName, shim) { - const methods = [ - 'lookup', - 'resolve', - 'resolve4', - 'resolve6', - 'resolveCname', - 'resolveMx', - 'resolveNaptr', - 'resolveNs', - 'resolvePtr', - 'resolveSrv', - 'resolveTxt', - 'reverse' - ] - - shim.record(dns, methods, function recordDnsMethod(shim, fn, name) { - return { name: 'dns.' + name, callback: shim.LAST } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/domain.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/domain.js deleted file mode 100644 index 674ced3a4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/domain.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = initialize - -function initialize(agent, domain, name, shim) { - const proto = domain.Domain.prototype - shim.wrap(proto, 'emit', wrapEmit) - - function wrapEmit(shim, original) { - return function wrappedEmit(ev) { - const shouldRestoreContext = - ev === 'error' && shim.getActiveSegment() === null && shim.getSegment(this) - - if (!shouldRestoreContext) { - return original.apply(this, arguments) - } - - shim.setActiveSegment(shim.getSegment(this)) - try { - return original.apply(this, arguments) - } finally { - shim.setActiveSegment(null) - } - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/fs.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/fs.js deleted file mode 100644 index faf8c805a..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/fs.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const record = require('../../metrics/recorders/generic') -const NAMES = require('../../metrics/names') - -module.exports = initialize - -function initialize(agent, fs, moduleName, shim) { - const methods = [ - 'rename', - 'truncate', - 'chown', - 'lchown', - 'fchown', - 'chmod', - 'lchmod', - 'fchmod', - 'stat', - 'lstat', - 'fstat', - 'link', - 'symlink', - 'readlink', - 'realpath', - 'unlink', - 'rmdir', - 'mkdir', - 'mkdtemp', - 'readdir', - 'close', - 'open', - 'utimes', - 'futimes', - 'fsync', - 'readFile', - 'writeFile', - 'appendFile', - 'exists', - 'ftruncate' - ] - - const nonRecordedMethods = ['write', 'read'] - - shim.record(fs, methods, recordFs) - - const originalExists = shim.getOriginal(fs.exists) - Object.getOwnPropertySymbols(originalExists).forEach((symbol) => { - fs.exists[symbol] = originalExists[symbol] - }) - - fs.realpath.native = shim.getOriginal(fs.realpath).native - - shim.record(fs.realpath, 'native', function recordRealpathNative(shim, fn) { - return recordFs(shim, fn, 'realpath.native') - }) - - shim.wrap(fs, nonRecordedMethods, function wrapNonRecordedFs(shim, fn) { - return function wrappedNonRecordedFs() { - // these are called in tight loops so opting out early - if (!shim.getActiveSegment()) { - return fn.apply(this, arguments) - } - - const args = shim.argsToArray.apply(shim, arguments) - const cbIndex = args.length - 1 - - shim.bindSegment(args, cbIndex) - - return fn.apply(this, args) - } - }) - - shim.wrap(fs, ['watch', 'watchFile'], function wrapFsWatch(shim, fn) { - return function wrappedFsWatch() { - const result = fn.apply(this, arguments) - shim.bindSegment(result, 'emit') - - return result - } - }) - - function recordFs(shim, fn, name) { - return { name: NAMES.FS.PREFIX + name, callback: shim.LAST, recorder: record } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/globals.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/globals.js deleted file mode 100644 index da9174ca1..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/globals.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const asyncHooks = require('./async-hooks') -const symbols = require('../../symbols') - -module.exports = initialize - -function initialize(agent, nodule, name, shim) { - let exceptionCallbackRegistered = false - - // `_fatalException` is an undocumented feature of domains, introduced in - // Node.js v0.8. We use `_fatalException` because wrapping it will not - // potentially change the behavior of the server unlike listening for - // `uncaughtException`. - shim.wrap(process, '_fatalException', function wrapper(shim, original) { - return function wrappedFatalException(error) { - // Only record the error if we are not currently within an instrumented - // domain. - // In serverless mode this will be handled by its own _fatalException wrapper - if ( - !shim.agent.config.serverless_mode.enabled && - !process.domain && - !exceptionCallbackRegistered - ) { - agent.errors.add(null, error) - shim.setActiveSegment(null) - } - return original.apply(this, arguments) - } - }) - - shim.wrap(process, 'emit', function wrapEmit(shim, original) { - return function wrappedEmit(ev, error, promise) { - // Check for unhandledRejections here so we don't change the behavior of - // the event. - if ( - ev === 'unhandledRejection' && - error && - !process.domain && - process.listenerCount('unhandledRejection') === 0 - ) { - // If there are no unhandledRejection handlers report the error. - const segment = promise[symbols.context] && promise[symbols.context].getSegment() - const tx = segment && segment.transaction - shim.logger.trace('Captured unhandled rejection for transaction %s', tx && tx.id) - agent.errors.add(tx, error) - } - - return original.apply(this, arguments) - } - }) - - shim.wrap(process, 'setUncaughtExceptionCaptureCallback', wrapUncaughtExceptionCallback) - - function wrapUncaughtExceptionCallback(shim, original) { - return function wrapped(fn) { - exceptionCallbackRegistered = fn !== null - return original.apply(this, arguments) - } - } - - // This will initialize the most optimal native-promise instrumentation that - // we have available. - asyncHooks(agent, shim) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/http-outbound.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/http-outbound.js deleted file mode 100644 index 770eb2577..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/http-outbound.js +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const recordExternal = require('../../metrics/recorders/http_external') -const cat = require('../../util/cat') -const urltils = require('../../util/urltils') -const logger = require('../../logger').child({ component: 'outbound' }) -const shimmer = require('../../shimmer') -const url = require('url') -const copy = require('../../util/copy') -const symbols = require('../../symbols') -const http = require('http') - -const NAMES = require('../../metrics/names') - -const DEFAULT_HOST = 'localhost' -const DEFAULT_HTTP_PORT = 80 -const DEFAULT_SSL_PORT = 443 - -const NEWRELIC_SYNTHETICS_HEADER = 'x-newrelic-synthetics' - -/** - * Determines the default port to 80 if protocol is undefined or http: - * Otherwise it assigns it as 443 - * - * @param {object} opts HTTP request options - * @returns {number} default port - */ -function getDefaultPort(opts) { - return !opts.protocol || opts.protocol === 'http:' ? DEFAULT_HTTP_PORT : DEFAULT_SSL_PORT -} - -/** - * Determines the port based on http opts - * - * @param {object} opts HTTP request options - * @param {number} defaultPort the default port - * @returns {number} port - */ -function getPort(opts, defaultPort) { - let port = opts.port || opts.defaultPort - if (!port) { - port = defaultPort - } - - return port -} - -/** - * Determines the default hostname based on http opts - * - * @param {object} opts HTTP request options - * @returns {string} default host - */ -function getDefaultHostName(opts) { - return opts.hostname || opts.host || DEFAULT_HOST -} - -/** - * Parses http opts to an object - * If string will call url.parse, otherwise it will - * do a shallow copy - * - * @param {string|object} opts a url string or HTTP request options - * @returns {object} parsed http opts - */ -function parseOpts(opts) { - if (typeof opts === 'string') { - opts = url.parse(opts) - } else { - opts = copy.shallow(opts) - } - - return opts -} - -/** - * Instruments an outbound HTTP request. - * - * @param {Agent} agent instantiation of lib/agent.js - * @param {object} opts HTTP request options - * @param {Function} makeRequest function for issuing actual HTTP request - * @returns {object} The instrumented outbound HTTP request. - */ -module.exports = function instrumentOutbound(agent, opts, makeRequest) { - opts = parseOpts(opts) - const defaultPort = getDefaultPort(opts) - let hostname = getDefaultHostName(opts) - const port = getPort(opts, defaultPort) - - if (!hostname || port < 1) { - logger.warn('Invalid host name (%s) or port (%s) for outbound request.', hostname, port) - return makeRequest(opts) - } - - if (port && port !== defaultPort) { - hostname += ':' + port - } - - const name = NAMES.EXTERNAL.PREFIX + hostname - - const parent = agent.tracer.getSegment() - if (parent && parent.opaque) { - logger.trace( - 'Not capturing data for outbound request (%s) because parent segment opaque (%s)', - name, - parent.name - ) - - return makeRequest(opts) - } - - return agent.tracer.addSegment( - name, - recordExternal(hostname, 'http'), - parent, - false, - instrumentRequest.bind(null, agent, opts, makeRequest, hostname) - ) -} - -/** - * Injects DT/CAT headers, creates segment for outbound http request. - * Instruments the request.emit to properly handle the response of the - * outbound http request - * - * @param {Agent} agent New Relic agent - * @param {string|object} opts a url string or HTTP request options - * @param {Function} makeRequest function to make request - * @param {string} hostname host of outbound request - * @param {TraceSegment} segment outbound http segment - * @returns {http.IncomingMessage} request actual http outbound request - */ -function instrumentRequest(agent, opts, makeRequest, hostname, segment) { - const transaction = segment.transaction - const outboundHeaders = Object.create(null) - - if (agent.config.encoding_key && transaction.syntheticsHeader) { - outboundHeaders[NEWRELIC_SYNTHETICS_HEADER] = transaction.syntheticsHeader - } - - maybeAddDtCatHeaders(agent, transaction, outboundHeaders, opts?.headers) - opts.headers = assignOutgoingHeaders(opts.headers, outboundHeaders) - - const request = applySegment(opts, makeRequest, hostname, segment) - - instrumentRequestEmit(agent, hostname, segment, request) - - return request -} - -/** - * Depending on configuration it will either add DT or CAT headers to the - * outgoing headers - * - * @param {Agent} agent Node.js agent - * @param {Transaction} transaction active transaction - * @param {object} outboundHeaders headers that are getting attached to external http call - * @param {object} headers headers for http request - */ -// TODO: abstract header logic shared with TransactionShim#insertCATRequestHeaders -function maybeAddDtCatHeaders(agent, transaction, outboundHeaders, headers = {}) { - if (agent.config.distributed_tracing.enabled) { - if (!!(headers[symbols.disableDT] || headers['x-new-relic-disable-dt'])) { - logger.trace('Distributed tracing disabled by instrumentation.') - // do not try to delete this header because AWS will fail with signature fail - // See: https://github.com/newrelic/node-newrelic/issues/1549 - } else { - transaction.insertDistributedTraceHeaders(outboundHeaders) - } - } else if (agent.config.cross_application_tracer.enabled) { - cat.addCatHeaders(agent.config, transaction, outboundHeaders) - } else { - logger.trace('Both DT and CAT are disabled, not adding headers!') - } -} - -/** - * Assigns new headers for outgoing request - * - * @param {object|Array} currentHeaders current headers from request options headers - * @param {object} outboundHeaders headers to assign to outgoing request - * @returns {object|Array} properly formatted headers - */ -function assignOutgoingHeaders(currentHeaders, outboundHeaders) { - let headers - - if (Array.isArray(currentHeaders)) { - headers = currentHeaders.slice() - Array.prototype.push.apply( - headers, - Object.keys(outboundHeaders).map(function getHeaderTuples(key) { - return [key, outboundHeaders[key]] - }) - ) - } else { - headers = Object.assign(Object.create(null), currentHeaders, outboundHeaders) - } - - return headers -} - -/** - * Starts the http outbound segment and attaches relevant attributes to the segment/span. - * - * @param {string|object} opts a url string or HTTP request options - * @param {Function} makeRequest function to make request - * @param {string} hostname host of outbound request - * @param {TraceSegment} segment outbound http segment - * @returns {http.IncomingMessage} request actual http outbound request - */ -function applySegment(opts, makeRequest, hostname, segment) { - segment.start() - const request = makeRequest(opts) - const parsed = urltils.scrubAndParseParameters(request.path) - parsed.path = urltils.obfuscatePath(segment.transaction.agent.config, parsed.path) - const proto = parsed.protocol || opts.protocol || 'http:' - segment.name += parsed.path - request[symbols.segment] = segment - - if (parsed.parameters) { - // Scrub and parse returns on object with a null prototype. - // eslint-disable-next-line guard-for-in - for (const key in parsed.parameters) { - segment.addSpanAttribute(`request.parameters.${key}`, parsed.parameters[key]) - } - } - segment.addAttribute('url', `${proto}//${hostname}${parsed.path}`) - segment.addAttribute('procedure', opts.method || 'GET') - return request -} - -/** - * Wrap the emit method. We're doing a special wrapper instead of using - * `tracer.bindEmitter` because we want to do some logic based on certain - * events. - * - * @param {Agent} agent New Relic agent - * @param {string} hostname host of outbound request - * @param {TraceSegment} segment outbound http segment - * @param {http.IncomingMessage} request actual http outbound request - */ -function instrumentRequestEmit(agent, hostname, segment, request) { - shimmer.wrapMethod(request, 'request.emit', 'emit', function wrapEmit(emit) { - const boundEmit = agent.tracer.bindFunction(emit, segment) - return function wrappedRequestEmit(evnt, arg) { - if (evnt === 'error') { - segment.end() - handleError(segment, request, arg) - } else if (evnt === 'response') { - handleResponse(segment, hostname, arg) - } - - return boundEmit.apply(this, arguments) - } - }) - - _makeNonEnumerable(request, 'emit') -} - -/** - * Notices the given error if there is no listener for the `error` event on the - * request object. - * - * @param {object} segment TraceSegment instance - * @param {object} req http.ClientRequest - * @param {Error} error If provided, unhandled error that occurred during request - * @returns {boolean} True if the error will be collected by New Relic. - */ -function handleError(segment, req, error) { - if (req.listenerCount('error') > 0) { - logger.trace(error, 'Not capturing outbound error because user has already handled it.') - return false - } - - logger.trace(error, 'Captured outbound error on behalf of the user.') - const tx = segment.transaction - tx.agent.errors.add(tx, error) - return true -} - -/** - * Ties the response object to the request segment. - * - * @param {object} segment TraceSegment instance - * @param {string} hostname host of the HTTP request - * @param {object} res http.ServerResponse - */ -function handleResponse(segment, hostname, res) { - // Add response attributes for spans - segment.addSpanAttribute('http.statusCode', res.statusCode) - segment.addSpanAttribute('http.statusText', res.statusMessage) - - // If CAT is enabled, grab those headers! - const agent = segment.transaction.agent - if (agent.config.cross_application_tracer.enabled && !agent.config.distributed_tracing.enabled) { - const { appData } = cat.extractCatHeaders(res.headers) - const decodedAppData = cat.parseAppData(agent.config, appData) - cat.assignCatToSegment(decodedAppData, segment, hostname) - } - - // Again a custom emit wrapper because we want to watch for the `end` event. - shimmer.wrapMethod(res, 'response', 'emit', function wrapEmit(emit) { - const boundEmit = agent.tracer.bindFunction(emit, segment) - return function wrappedResponseEmit(evnt) { - if (evnt === 'end') { - segment.end() - } - return boundEmit.apply(this, arguments) - } - }) - _makeNonEnumerable(res, 'emit') -} - -/** - * Makes a property non-enumerable - * - * @param {object} obj object that contains property that needs to be non-enumerable - * @param {string} prop property to make non-enumerable - */ -function _makeNonEnumerable(obj, prop) { - try { - const desc = Object.getOwnPropertyDescriptor(obj, prop) - desc.enumerable = false - Object.defineProperty(obj, prop, desc) - } catch (e) { - logger.debug(e, 'Failed to make %s non enumerable.', prop) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/http.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/http.js deleted file mode 100644 index eff53ffde..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/http.js +++ /dev/null @@ -1,590 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* eslint sonarjs/cognitive-complexity: ["error", 42] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252 */ - -const shimmer = require('../../shimmer') -const logger = require('../../logger').child({ component: 'http' }) -const recordWeb = require('../../metrics/recorders/http') -const hashes = require('../../util/hashes') -const cat = require('../../util/cat') -const instrumentOutbound = require('./http-outbound') -const url = require('url') -const urltils = require('../../util/urltils') -const headerAttributes = require('../../header-attributes') -const headerProcessing = require('../../header-processing') - -const NAMES = require('../../metrics/names') -const DESTS = require('../../config/attribute-filter').DESTINATIONS - -const symbols = require('../../symbols') - -/* - * - * CONSTANTS - * - */ -const NEWRELIC_SYNTHETICS_HEADER = 'x-newrelic-synthetics' - -// For incoming requests this instrumentation functions by wrapping -// `http.createServer` and `http.Server#addListener`. The former merely sets the -// agent dispatcher to 'http' and the latter wraps any event handlers bound to -// `request`. -// -// The `request` event listener wrapper creates a transaction proxy which will -// start a new transaction whenever a new request comes in. It also scans the -// headers of the incoming request looking for CAT and synthetics headers. - -function wrapEmitWithTransaction(agent, emit, isHTTPS) { - const tracer = agent.tracer - const transport = isHTTPS ? 'HTTPS' : 'HTTP' - let serverPort = null - - return tracer.transactionProxy(function wrappedHandler(evnt, request, response) { - const transaction = tracer.getTransaction() - if (!transaction) { - return emit.apply(this, arguments) - } - - transaction.nameState.setPrefix(NAMES.NODEJS.PREFIX) - transaction.nameState.setDelimiter(NAMES.ACTION_DELIMITER) - - // Store the transaction information on the request and response. - const txInfo = storeTxInfo(transaction, request, response) - - if (request) { - initializeRequest(transaction, request) - } - - // Create the transaction segment using the request URL for now. Once a - // better name can be determined this segment will be renamed to that. - const segment = tracer.createSegment(request.url, recordWeb) - segment.start() - - if (request.method != null) { - segment.addSpanAttribute('request.method', request.method) - } - - if (txInfo) { - // Seed segment stack to enable parenting logic leveraged by - // web framework instrumentations. - txInfo.segmentStack.push(segment) - } - - transaction.type = 'web' - transaction.baseSegment = segment - - /* Needed for Connect and Express middleware that monkeypatch request - * and response via listeners. - */ - tracer.bindEmitter(request, segment) - tracer.bindEmitter(response, segment) - - // the error tracer needs a URL for tracing, even though naming overwrites - transaction.parsedUrl = url.parse(request.url, true) - transaction.url = urltils.obfuscatePath(agent.config, transaction.parsedUrl.path) - transaction.verb = request.method - - // URL is sent as an agent attribute with transaction events - transaction.trace.attributes.addAttribute( - DESTS.TRANS_EVENT | DESTS.ERROR_EVENT, - 'request.uri', - transaction.url - ) - - segment.addSpanAttribute('request.uri', transaction.url) - - // store the port on which this transaction runs - if (this.address instanceof Function) { - const address = this.address() - if (address) { - serverPort = address.port - } - } - transaction.port = serverPort - - // need to set any config-driven names early for RUM - logger.trace( - { url: request.url, transaction: transaction.id }, - 'Applying user naming rules for RUM.' - ) - transaction.applyUserNamingRules(request.url) - - const queueTimeStamp = headerProcessing.getQueueTime(logger, request.headers) - if (queueTimeStamp) { - transaction.queueTime = Date.now() - queueTimeStamp - } - - const synthHeader = request.headers[NEWRELIC_SYNTHETICS_HEADER] - - if (synthHeader && agent.config.trusted_account_ids && agent.config.encoding_key) { - handleSyntheticsHeader( - synthHeader, - agent.config.encoding_key, - agent.config.trusted_account_ids, - transaction - ) - } - - if (agent.config.distributed_tracing.enabled) { - // Node http headers are automatically lowercase - transaction.acceptDistributedTraceHeaders(transport, request.headers) - } else if (agent.config.cross_application_tracer.enabled) { - const { id, transactionId } = cat.extractCatHeaders(request.headers) - const { externalId, externalTransaction } = cat.parseCatData( - id, - transactionId, - agent.config.encoding_key - ) - cat.assignCatToTransaction(externalId, externalTransaction, transaction) - } - - function instrumentedFinish() { - // Remove listeners so this doesn't get called twice. - response.removeListener('finish', instrumentedFinish) - response.removeListener('close', instrumentedFinish) - - // Naming must happen before the segment and transaction are ended, - // because metrics recording depends on naming's side effects. - transaction.finalizeNameFromUri(transaction.parsedUrl, response.statusCode) - - if (response) { - if (response.statusCode != null) { - const responseCode = String(response.statusCode) - - if (/^\d+$/.test(responseCode)) { - transaction.trace.attributes.addAttribute( - DESTS.TRANS_COMMON, - 'http.statusCode', - responseCode - ) - - segment.addSpanAttribute('http.statusCode', responseCode) - } - } - - if (response.statusMessage !== undefined) { - transaction.trace.attributes.addAttribute( - DESTS.TRANS_COMMON, - 'http.statusText', - response.statusMessage - ) - - segment.addSpanAttribute('http.statusText', response.statusMessage) - } - - const headers = response.getHeaders() - if (headers) { - headerAttributes.collectResponseHeaders(headers, transaction) - } - } - - // And we are done! End the segment and transaction. - segment.end() - transaction.end() - } - response.once('finish', instrumentedFinish) - response.once('close', instrumentedFinish) - - return tracer.bindFunction(emit, segment).apply(this, arguments) - }) -} - -function storeTxInfo(transaction, request, response) { - if (!request || !response) { - logger.debug('Missing request or response object! Not storing transaction info.') - return - } - - const txInfo = { - transaction: transaction, - segmentStack: [], - errorHandled: false, - error: null - } - request[symbols.transactionInfo] = response[symbols.transactionInfo] = txInfo - - logger.trace('Stored transaction %s information on request and response', transaction.id) - - return txInfo -} - -function initializeRequest(transaction, request) { - headerAttributes.collectRequestHeaders(request.headers, transaction) - - if (request.method != null) { - transaction.trace.attributes.addAttribute(DESTS.TRANS_COMMON, 'request.method', request.method) - transaction.nameState.setVerb(request.method) - } -} - -function wrapResponseEnd(agent, proto) { - const tracer = agent.tracer - - // On end, we must freeze the current name state to maintain the route that - // responded and also end the current segment (otherwise it may become truncated). - shimmer.wrapMethod(proto, 'Response.prototype', 'end', function wrapResEnd(end) { - if (typeof end !== 'function') { - logger.debug('Response#end is not a function?') - return end - } - - return function wrappedResEnd() { - const txInfo = this && this[symbols.transactionInfo] - if (!txInfo) { - return end.apply(this, arguments) - } - - if (!txInfo.transaction.isActive()) { - logger.trace('wrappedResEnd invoked for ended transaction implying multiple invocations.') - return end.apply(this, arguments) - } - - // If an error happened, add it to the aggregator. - if ( - txInfo.error && - (!txInfo.errorHandled || urltils.isError(agent.config, this.statusCode)) - ) { - agent.errors.add(txInfo.transaction, txInfo.error) - } - - // End all the segments leading up to and including this one. - for (let i = txInfo.segmentStack.length - 1; i >= 0; --i) { - txInfo.segmentStack[i].end() - } - const segment = tracer.getSegment() - if (segment) { - segment.end() - } - - // Freeze the name state to prevent further changes. - txInfo.transaction.nameState.freeze() - - return end.apply(this, arguments) - } - }) -} - -// CAT this won't be used unless CAT is enabled, see below where we actually do -// the shimmer stuff if you'd like to verify. -function wrapWriteHead(agent, writeHead) { - return function wrappedWriteHead() { - const transaction = agent.tracer.getTransaction() - if (!transaction) { - logger.trace('No transaction - not adding response CAT headers') - return writeHead.apply(this, arguments) - } - if (transaction.syntheticsHeader) { - this.setHeader(NEWRELIC_SYNTHETICS_HEADER, transaction.syntheticsHeader) - } - - if (!transaction.incomingCatId) { - logger.trace('No incoming CAT ID - not adding response CAT headers') - return writeHead.apply(this, arguments) - } - - if (!agent.config.trusted_account_ids) { - logger.trace('No account IDs in config.trusted_account_ids - not adding response CAT headers') - return writeHead.apply(this, arguments) - } - - if (!cat.isTrustedAccountId(transaction.incomingCatId, agent.config.trusted_account_ids)) { - return writeHead.apply(this, arguments) - } - - // Not sure this could ever happen, but should guard against it anyway - // otherwise exception we blow up the user's app. - if (!agent.config.cross_process_id || !agent.config.encoding_key) { - logger.trace( - 'Managed to have %s but not cross_process_id (%s) or encoding_key (%s) - %s', - 'agent.config.trusted_account_ids', - agent.config.cross_process_id, - agent.config.encoding_key, - 'not adding response CAT headers' - ) - return writeHead.apply(this, arguments) - } - - // -1 means no content length header was sent. We should only send this - // value in the appData if the header is set. - let contentLength = -1 - const newHeaders = arguments[arguments.length - 1] - - if (typeof newHeaders === 'object') { - contentLength = headerProcessing.getContentLengthFromHeaders(newHeaders) - } - - const currentHeaders = this.getHeaders() - if (contentLength === -1 && currentHeaders) { - contentLength = headerProcessing.getContentLengthFromHeaders(currentHeaders) - } - // Stored on the tx so we can push a metric with this time instead of - // actual duration. - transaction.catResponseTime = transaction.timer.getDurationInMillis() - - const { key, data } = cat.encodeAppData(agent.config, transaction, contentLength) - if (key && data) { - this.setHeader(key, data) - logger.trace('Added outbound response CAT headers in transaction %s', transaction.id) - } - return writeHead.apply(this, arguments) - } -} - -// Taken from the Node code base, internal/url.js -function urlToOptions(_url) { - const options = { - protocol: _url.protocol, - hostname: - typeof _url.hostname === 'string' && _url.hostname.startsWith('[') - ? _url.hostname.slice(1, -1) - : _url.hostname, - hash: _url.hash, - search: _url.search, - pathname: _url.pathname, - path: `${_url.pathname || ''}${_url.search || ''}`, - href: _url.href - } - if (_url.port !== '') { - options.port = Number(_url.port) - } - if (_url.username || _url.password) { - options.auth = `${_url.username}:${_url.password}` - } - return options -} - -function wrapRequest(agent, request) { - return function wrappedRequest(input, options, cb) { - // If the first argument is a URL, merge it into the options object. - // This code is copied from Node internals. - if (typeof input === 'string') { - const urlStr = input - input = urlToOptions(new URL(urlStr)) - } else if (input.constructor && input.constructor.name === 'URL') { - input = urlToOptions(input) - } else { - cb = options - options = input - input = null - } - - if (typeof options === 'function') { - cb = options - options = input || {} - } else { - options = Object.assign(input || {}, options) - } - - const reqArgs = [options, cb] - - // Don't pollute metrics and calls with NR connections - const internalOnly = options && options[symbols.offTheRecord] - if (internalOnly) { - delete options[symbols.offTheRecord] - } - - // If this is not a request we're recording, exit early. - const transaction = agent.tracer.getTransaction() - if (!transaction || internalOnly) { - if (!internalOnly && logger.traceEnabled()) { - const logOpts = typeof options === 'string' ? url.parse(options) : options - logger.trace( - 'No transaction, not recording external to %s:%s', - logOpts.hostname || logOpts.host, - logOpts.port - ) - } - return request.apply(this, reqArgs) - } - - const args = agent.tracer.slice(reqArgs) - const context = this - - return instrumentOutbound(agent, options, function makeRequest(opts) { - args[0] = opts - return request.apply(context, args) - }) - } -} - -module.exports = function initialize(agent, http, moduleName) { - if (!http) { - logger.debug('Did not get http module, not instrumenting!') - return false - } - - const IS_HTTPS = moduleName === 'https' - - // FIXME: will this ever not be called? - shimmer.wrapMethod(http, 'http', 'createServer', function wrapMethod(createServer) { - // eslint-disable-next-line no-unused-vars - return function setDispatcher(requestListener) { - agent.environment.setDispatcher('http') - return createServer.apply(this, arguments) - } - }) - - // It's not a great idea to monkeypatch EventEmitter methods given how hot - // they are, but this method is simple and works with all versions of node - // supported by the module. - shimmer.wrapMethod( - http.Server && http.Server.prototype, - 'http.Server.prototype', - 'emit', - function wrapEmit(emit) { - const txStarter = wrapEmitWithTransaction(agent, emit, IS_HTTPS) - return function wrappedEmit(evnt) { - if (evnt === 'request') { - return txStarter.apply(this, arguments) - } - return emit.apply(this, arguments) - } - } - ) - - wrapResponseEnd(agent, http.ServerResponse && http.ServerResponse.prototype) - - // If CAT is enabled we'll wrap `writeHead` to inject our headers. - if (agent.config.cross_application_tracer.enabled) { - shimmer.wrapMethod( - http.ServerResponse && http.ServerResponse.prototype, - 'http.ServerResponse.prototype', - 'writeHead', - wrapWriteHead.bind(null, agent) - ) - } - - const agentProto = http && http.Agent && http.Agent.prototype - - shimmer.wrapMethod(http, 'http', 'request', wrapRequest.bind(null, agent)) - - shimmer.wrapMethod(http, 'http', 'get', wrapRequest.bind(null, agent)) - - shimmer.wrapMethod( - agentProto, - 'http.Agent.prototype', - 'createConnection', - function wrapCreateConnection(original) { - return function wrappedCreateConnection() { - if (!agent.getTransaction()) { - return original.apply(this, arguments) - } - - const segment = agent.tracer.createSegment('http.Agent#createConnection') - - const args = agent.tracer.slice(arguments) - if (typeof args[1] === 'function') { - args[1] = agent.tracer.bindFunction(args[1], segment, true) - } - - return agent.tracer.bindFunction(original, segment, true).apply(this, args) - } - } - ) -} - -/** - * Take the X-NewRelic-Synthetics header and apply any appropriate data to the - * transaction for later use. This is the gate keeper for attributes being - * added onto the transaction object for synthetics. - * - * @param {string} header - The raw X-NewRelic-Synthetics header - * @param {string} encKey - Encoding key handed down from the server - * @param {Array.} trustedIds - Array of accounts to trust the header from. - * @param {object} transaction - Where the synthetics data is attached to. - */ -function handleSyntheticsHeader(header, encKey, trustedIds, transaction) { - const synthData = parseSyntheticsHeader(header, encKey, trustedIds) - if (!synthData) { - return - } - - transaction.syntheticsData = synthData - transaction.syntheticsHeader = header -} - -/** - * Parse out and verify the the pieces of the X-NewRelic-Synthetics header. - * - * @param {string} header - The raw X-NewRelic-Synthetics header - * @param {string} encKey - Encoding key handed down from the server - * @param {Array.} trustedIds - Array of accounts to trust the header from. - * @returns {object | null} - On successful parse and verification an object of - * synthetics data is returned, otherwise null is - * returned. - */ -function parseSyntheticsHeader(header, encKey, trustedIds) { - // Eagerly declare this object because we know what it should look like and - // can use that for header verification. - const parsedData = { - version: null, - accountId: null, - resourceId: null, - jobId: null, - monitorId: null - } - let synthData = null - try { - synthData = JSON.parse(hashes.deobfuscateNameUsingKey(header, encKey)) - } catch (e) { - logger.trace(e, 'Got unparsable synthetics header: %s', header) - return - } - - if (!Array.isArray(synthData)) { - logger.trace('Synthetics data is not an array: %s (%s)', synthData, typeof synthData) - return - } - - if (synthData.length < Object.keys(parsedData).length) { - logger.trace( - 'Synthetics header length is %s, expected at least %s', - synthData.length, - Object.keys(parsedData).length - ) - } - - parsedData.version = synthData[0] - if (parsedData.version !== 1) { - logger.trace('Synthetics header version is not 1, got: %s (%s)', parsedData.version, synthData) - return - } - - parsedData.accountId = synthData[1] - if (parsedData.accountId) { - if (trustedIds.indexOf(parsedData.accountId) === -1) { - logger.trace( - 'Synthetics header account ID is not in trusted account IDs: %s (%s)', - parsedData.accountId, - trustedIds - ) - return - } - } else { - logger.trace('Synthetics header account ID missing.') - return - } - - parsedData.resourceId = synthData[2] - if (!parsedData.resourceId) { - logger.trace('Synthetics resource ID is missing.') - return - } - - parsedData.jobId = synthData[3] - if (!parsedData.jobId) { - logger.trace('Synthetics job ID is missing.') - } - - parsedData.monitorId = synthData[4] - if (!parsedData.monitorId) { - logger.trace('Synthetics monitor ID is missing.') - } - - return parsedData -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/inspector.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/inspector.js deleted file mode 100644 index 9cb82871c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/inspector.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = initialize - -function initialize(agent, inspector, name, shim) { - const sessionProto = inspector && inspector.Session && inspector.Session.prototype - if (!sessionProto) { - return false - } - - shim.wrap(sessionProto, 'post', function wrapPost(shim, fn) { - return function wrappedPost() { - const args = shim.argsToArray.apply(shim, arguments) - shim.bindCallbackSegment(args, shim.LAST) - return fn.apply(this, args) - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/net.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/net.js deleted file mode 100644 index c7df7090c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/net.js +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = function initialize(agent, net, moduleName, shim) { - shim.wrap(net, ['connect', 'createConnection'], wrapCreate) - function wrapCreate(shim, fn, name) { - return function wrappedCreateConnection() { - const segment = shim.getActiveSegment() - if (!segment) { - return fn.apply(this, arguments) - } - - const child = shim.createSegment('net.' + name, null, segment) - const sock = shim.applySegment(fn, child, true, this, arguments) - wrapSocket(sock, child) - return sock - } - } - - const serverProto = net.Server.prototype - - shim.wrap(serverProto, ['listen', 'close'], function wrapNoRecord(shim, fn) { - return function wrappedNoRecord() { - if (!shim.getActiveSegment()) { - return fn.apply(this, arguments) - } - - const args = shim.argsToArray.apply(shim, arguments) - const cbIndex = args.length - 1 - - shim.bindSegment(args, cbIndex) - - return fn.apply(this, args) - } - }) - - shim.wrap(serverProto, '_listen2', wrapListen2) - shim.wrap(net.Socket.prototype, 'connect', wrapConnect) - - function wrapListen2(shim, fn) { - return function wrappedListen2() { - const segment = shim.getActiveSegment() - const emit = this.emit - - if (!segment || !emit) { - return fn.apply(this, arguments) - } - - this.emit = wrappedEmit - - return fn.apply(this, arguments) - - function wrappedEmit(ev, socket) { - if (ev !== 'connection' || !socket || !socket._handle) { - return emit.apply(this, arguments) - } - - const child = shim.createSegment('net.Server.onconnection', segment) - - if (socket._handle.onread) { - shim.bindSegment(socket._handle, 'onread', child) - } - - return shim.applySegment(emit, child, true, this, arguments) - } - } - } - - function wrapConnect(shim, fn) { - return function connectWrapper() { - if (!agent.getTransaction()) { - return fn.apply(this, arguments) - } - - const socket = this - const args = normalizeConnectArgs(arguments) - - const segment = shim.createSegment('net.Socket.connect') - - if (args[1]) { - args[1] = shim.bindSegment(args[1], segment) - } - - const result = shim.applySegment(fn, segment, true, this, args) - - if (socket._handle) { - shim.bindSegment(socket._handle, 'onread', segment) - } - shim.bindSegment(socket, 'emit', segment) - - return result - } - } - - function wrapSocket(sock, segment) { - shim.wrap(sock, 'emit', function emitWrapper(shim, fn) { - return shim.bindSegment(fn, segment) - }) - } -} - -// taken from node master on 2013/10/30 -function normalizeConnectArgs(args) { - let options = Object.create(null) - - function toNumber(x) { - return (x = Number(x)) >= 0 ? x : false - } - if (typeof args[0] === 'object' && args[0] !== null) { - // connect(options, [cb]) - options = args[0] - } else if (typeof args[0] === 'string' && toNumber(args[0]) === false) { - // connect(path, [cb]); - options.path = args[0] - } else { - // connect(port, [host], [cb]) - options.port = args[0] - if (typeof args[1] === 'string') { - options.host = args[1] - } - } - - const cb = args[args.length - 1] - return typeof cb === 'function' ? [options, cb] : [options] -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/timers.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/timers.js deleted file mode 100644 index b5fbf8f10..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/timers.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const symbols = require('../../symbols') -const Timers = require('timers') - -module.exports = initialize - -function initialize(agent, timers, _moduleName, shim) { - const isAsyncLocalContext = agent.config.feature_flag.async_local_context - - if (!isAsyncLocalContext) { - instrumentProcessMethods(shim, process) - instrumentSetImmediate(shim, [timers, global]) - } - - instrumentTimerMethods(shim, [timers, global]) -} - -/** - * Sets up instrumentation for setImmediate on both timers and global. - * - * We do not want to create segments for setImmediate calls, - * as the object allocation may incur too much overhead in some situations - * - * @param {Shim} shim instance of shim - * @param {Array} pkgs array with references to timers and global - */ -function instrumentSetImmediate(shim, pkgs) { - pkgs.forEach((nodule) => { - if (shim.isWrapped(nodule.setImmediate)) { - return - } - - shim.wrap(nodule, 'setImmediate', function wrapSetImmediate(shim, fn) { - return function wrappedSetImmediate() { - const segment = shim.getActiveSegment() - if (!segment) { - return fn.apply(this, arguments) - } - - const args = shim.argsToArray.apply(shim, arguments, segment) - shim.bindSegment(args, shim.FIRST) - - return fn.apply(this, args) - } - }) - - copySymbols(shim, nodule, 'setImmediate') - }) -} - -/** - * Sets up instrumentation for setTimeout, setInterval and clearTimeout - * on timers and global. - * - * @param {Shim} shim instance of shim - * @param {Array} pkgs array with references to timers and global - */ -function instrumentTimerMethods(shim, pkgs) { - pkgs.forEach((nodule) => { - if (shim.isWrapped(nodule.setTimeout)) { - return - } - - const asynchronizers = ['setTimeout', 'setInterval'] - shim.record(nodule, asynchronizers, recordAsynchronizers) - shim.wrap(nodule, 'clearTimeout', wrapClearTimeout) - makeWrappedPromisifyCompatible(shim, nodule) - }) -} - -/** - * Ignores the segment when clearTimeout is called - * - * @param {Shim} _shim instance of shim - * @param {Function} fn clearTimeout - * @returns {Function} wrapped clearTimeout - */ -function wrapClearTimeout(_shim, fn) { - return function wrappedClearTimeout(timer) { - if (timer && timer._onTimeout) { - const segment = timer._onTimeout[symbols.segment] - if (segment && !segment.opaque) { - segment.ignore = true - } - } - - return fn.apply(this, arguments) - } -} - -/** - * Defines the spec for setTimeout and setInterval - * - * @param {Shim} shim instance of shim - * @param {Function} _fn original function - * @param {string} name name of function - * @returns {object} spec defining how to instrument - */ -function recordAsynchronizers(shim, _fn, name) { - return { name: 'timers.' + name, callback: shim.FIRST } -} - -/** - * Instruments core process methods: nextTick, _nextDomainTick, _tickDomainCallback - * Note: This does not get registered when the context manager is async local - * - * @param {Shim} shim instance of shim - * @param {process} process global process object - */ -function instrumentProcessMethods(shim, process) { - const processMethods = ['nextTick', '_nextDomainTick', '_tickDomainCallback'] - - shim.wrap(process, processMethods, function wrapProcess(shim, fn) { - return function wrappedProcess() { - const segment = shim.getActiveSegment() - if (!segment) { - return fn.apply(this, arguments) - } - - // Manual copy because helper methods add significant overhead in some usages - const len = arguments.length - const args = new Array(len) - for (let i = 0; i < len; ++i) { - args[i] = arguments[i] - } - - shim.bindSegment(args, shim.FIRST, segment) - - return fn.apply(this, args) - } - }) -} - -/** - * Copies the symbols from original setTimeout and setInterval onto the wrapped functions - * - * @param {Shim} shim instance of shim - * @param {Timers} nodule Timers class - */ -function makeWrappedPromisifyCompatible(shim, nodule) { - copySymbols(shim, nodule, 'setTimeout') - copySymbols(shim, nodule, 'setInterval') -} - -/** - * Helper to copy symbols from original function to wrapped one - * - * @param {Shim} shim instance of shim - * @param {Timers} nodule Timers class - * @param {string} name name of function - */ -function copySymbols(shim, nodule, name) { - const originalFunction = shim.getOriginal(nodule[name]) - Object.getOwnPropertySymbols(originalFunction).forEach((symbol) => { - nodule[name][symbol] = originalFunction[symbol] - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/zlib.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/zlib.js deleted file mode 100644 index 7391993e4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/core/zlib.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const recorder = require('../../metrics/recorders/generic') - -module.exports = initialize - -const methods = ['deflate', 'deflateRaw', 'gzip', 'gunzip', 'inflate', 'inflateRaw', 'unzip'] - -function initialize(agent, zlib, moduleName, shim) { - shim.record(zlib, methods, recordZLib) - - if (zlib.Deflate && zlib.Deflate.prototype) { - const proto = Object.getPrototypeOf(zlib.Deflate.prototype) - if (proto._transform) { - // streams2 - shim.wrap(proto, '_transform', wrapNoSegment) - } else if (proto.write && proto.flush && proto.end) { - // plain ol' streams - shim.wrap(proto, ['write', 'flush', 'end'], wrapNoSegment) - } - } - - function recordZLib(shim, fn, name) { - return { name: `zlib.${name}`, callback: shim.LAST, recorder } - } -} - -function wrapNoSegment(shim, fn) { - return function wrappedZLibNoSegment() { - if (!shim.getActiveSegment()) { - return fn.apply(this, arguments) - } - - const args = shim.argsToArray.apply(shim, arguments) - const cbIndex = args.length - 1 - - shim.bindSegment(args, cbIndex) - - return fn.apply(this, args) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/director.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/director.js deleted file mode 100644 index 4f444ded5..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/director.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = function initialize(agent, director, moduleName, shim) { - shim.setFramework(shim.DIRECTOR) - - shim.setRouteParser(function routeParser(shim, fn, fnName, route) { - return route instanceof Array ? route.join('/') : route - }) - - const methods = ['on', 'route'] - const proto = director.Router.prototype - shim.wrapMiddlewareMounter(proto, methods, { - route: shim.SECOND, - wrapper: function wrapMiddleware(shim, middleware, name, path) { - return shim.recordMiddleware(middleware, { - route: path, - req: function getReq() { - return this.req - }, - params: function getParams() { - return this.params - }, - next: shim.LAST - }) - } - }) - - shim.wrap(proto, 'mount', function wrapMount(shim, mount) { - return function wrappedMount(routes, path) { - const isAsync = this.async - shim.wrap(routes, director.http.methods, function wrapRoute(shim, route) { - return shim.recordMiddleware(route, { - route: path.join('/'), - req: function getReq() { - return this.req - }, - params: function getParams() { - return this.params - }, - next: isAsync ? shim.LAST : null - }) - }) - const args = [routes, path] - return mount.apply(this, args) - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/express.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/express.js deleted file mode 100644 index 889315396..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/express.js +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Express middleware generates traces where middleware are considered siblings - * (ended on 'next' invocation) and not nested. Middlware are nested below the - * routers they are mounted to. - */ - -module.exports = function initialize(agent, express, moduleName, shim) { - if (!express || !express.Router) { - shim.logger.debug('Could not find Express Router, not instrumenting.') - return false - } - shim.setFramework(shim.EXPRESS) - - shim.setErrorPredicate(function expressErrorPredicate(err) { - return err !== 'route' && err !== 'router' - }) - - if (express.Router.use) { - wrapExpress4(shim, express) - } else { - wrapExpress3(shim, express) - } -} - -function wrapExpress4(shim, express) { - // Wrap `use` and `route` which are hung off `Router` directly, not on a - // prototype. - shim.wrapMiddlewareMounter(express.Router, 'use', { - route: shim.FIRST, - wrapper: wrapMiddleware - }) - - shim.wrapMiddlewareMounter(express.application, 'use', { - route: shim.FIRST, - wrapper: wrapMiddleware - }) - - shim.wrap(express.Router, 'route', function wrapRoute(shim, fn) { - if (!shim.isFunction(fn)) { - return fn - } - - return function wrappedRoute() { - const route = fn.apply(this, arguments) - - // Express should create a new route and layer every time Router#route is - // called, but just to be on the safe side, make sure we haven't wrapped - // this already. - if (!shim.isWrapped(route, 'get')) { - wrapRouteMethods(shim, route, '') - - const layer = this.stack[this.stack.length - 1] - - // This wraps a 'done' function but not a traditional 'next' function. This allows - // the route to stay on the stack for middleware nesting after the router. - // The segment will be automatically ended by the http/https instrumentation. - shim.recordMiddleware(layer, 'handle', { - type: shim.ROUTE, - req: shim.FIRST, - next: shim.LAST, - matchArity: true, - route: route.path - }) - } - return route - } - }) - - shim.wrapMiddlewareMounter(express.Router, 'param', { - route: shim.FIRST, - wrapper: function wrapParamware(shim, middleware, fnName, route) { - return shim.recordParamware(middleware, { - name: route, - req: shim.FIRST, - next: shim.THIRD - }) - } - }) - - wrapResponse(shim, express.response) -} - -function wrapExpress3(shim, express) { - // In Express 3 the app returned from `express()` is actually a `connect` app - // which we have no access to before creation. We can not easily wrap the app - // because there are a lot of methods dangling on it that act on the app itself. - // Really we just care about apps being used as `request` event listeners on - // `http.Server` instances so we'll wrap that instead. - - shim.wrapMiddlewareMounter(express.Router.prototype, 'param', { - route: shim.FIRST, - wrapper: function wrapParamware(shim, middleware, fnName, route) { - return shim.recordParamware(middleware, { - name: route, - req: shim.FIRST, - next: shim.THIRD - }) - } - }) - shim.wrapMiddlewareMounter(express.Router.prototype, 'use', { - route: shim.FIRST, - wrapper: wrapMiddleware - }) - shim.wrapMiddlewareMounter(express.application, 'use', { - route: shim.FIRST, - wrapper: wrapMiddleware - }) - - // NOTE: Do not wrap application route methods in Express 3, they all just - // forward their arguments to the router. - wrapRouteMethods(shim, express.Router.prototype, shim.FIRST) - wrapResponse(shim, express.response) -} - -function wrapRouteMethods(shim, route, path) { - const methods = ['all', 'delete', 'get', 'head', 'opts', 'post', 'put', 'patch'] - shim.wrapMiddlewareMounter(route, methods, { route: path, wrapper: wrapMiddleware }) -} - -function wrapResponse(shim, response) { - shim.recordRender(response, 'render', { - view: shim.FIRST, - callback: function bindCallback(shim, render, name, segment, args) { - let cbIdx = shim.normalizeIndex(args.length, shim.LAST) - if (cbIdx === null) { - return - } - - const res = this - let cb = args[cbIdx] - if (!shim.isFunction(cb)) { - ++cbIdx - cb = function defaultRenderCB(err, str) { - // https://github.com/expressjs/express/blob/4.x/lib/response.js#L961-L962 - if (err) { - return res.req.next(err) - } - res.send(str) - } - args.push(cb) - } - args[cbIdx] = shim.bindSegment(cb, segment, true) - } - }) -} - -function wrapMiddleware(shim, middleware, name, route) { - let method = null - const spec = { - route: route, - type: shim.MIDDLEWARE, - matchArity: true, - req: shim.FIRST - } - - if (middleware.lazyrouter) { - method = 'handle' - spec.type = shim.APPLICATION - } else if (middleware.stack) { - method = 'handle' - spec.type = shim.ROUTER - } else if (middleware.length === 4) { - spec.type = shim.ERRORWARE - spec.req = shim.SECOND - } - - // Express apps just pass their middleware through to their router. We do not - // want to count the same middleware twice, so we check if it has already been - // wrapped. Express also wraps apps mounted on apps, so we need to check if - // this middleware is that app wrapper. - // - // NOTE: Express did not name its app wrapper until 4.6.0. - if (shim.isWrapped(middleware, method) || name === 'mounted_app') { - // Don't double-wrap middleware - return middleware - } - - return shim.recordMiddleware(middleware, method, spec) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/fastify.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/fastify.js deleted file mode 100644 index 893904976..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/fastify.js +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const semver = require('semver') -const { - buildMiddlewareSpecForRouteHandler, - buildMiddlewareSpecForMiddlewareFunction -} = require('./fastify/spec-builders') - -/** - * These are the events that occur during a fastify - * request - * see: https://www.fastify.io/docs/latest/Lifecycle/ - * - * Note: preSerialization and onSend happen after the route handler - * executes. `onResponse` does not execute until after the client - * sends the response so it'll never be in scope of the transaction - */ -const REQUEST_HOOKS = [ - 'onRequest', - 'preParsing', - 'preValidation', - 'preHandler', - 'preSerialization', - 'onSend', - 'onResponse', - 'onError' -] - -/** - * Sets up fastify route handler - * - * Fastify's onRoute hook will fire whenever - * a route is registered. This is the most straight - * forward way to get at a fastify route definition. - * Not only are we _not_ relying on private implementations - * that could change, fastify is pretty good about protecting - * those private implementations from access, and getting - * at them would require a lot of gymnastics and hard to - * maintain code - * - * @param shim - * @param fastify - */ -const setupRouteHandler = (shim, fastify) => { - fastify.addHook('onRoute', (routeOptions) => { - if (!routeOptions.handler) { - return - } - /** - * recordMiddleware handler call - * - * The WebFramework shim treats the main route handler like any other - * i.e. dont be confused by the call to recordMiddleware -- we don't - * have a recordRouteHandler, everything goes through recordMiddleware - */ - const newRouteHandler = shim.recordMiddleware( - routeOptions.handler, - buildMiddlewareSpecForRouteHandler(shim, routeOptions.path) - ) - - routeOptions.handler = newRouteHandler - }) - - shim.wrap(fastify, 'addHook', function addWrapHook(shim, fn) { - return function wrappedAddHook() { - const args = shim.argsToArray.apply(shim, arguments) - const hookName = args[0] - if (REQUEST_HOOKS.includes(hookName)) { - const middlewareFunction = args[1] - const name = `${hookName}/${shim.getName(middlewareFunction)}` - const middlewareSpec = buildMiddlewareSpecForMiddlewareFunction(shim, name) - const newMiddlewareFunction = shim.recordMiddleware(middlewareFunction, middlewareSpec) - - args[1] = newMiddlewareFunction - } - return fn.apply(this, args) - } - }) -} - -module.exports = function initialize(agent, fastify, moduleName, shim) { - shim.setFramework(shim.FASTIFY) - - const fastifyVersion = shim.require('./package.json').version - const isv3Plus = semver.satisfies(fastifyVersion, '>=3.0.0') - - /** - * Fastify exports a function, so we need to use wrapExport - */ - const wrappedExport = shim.wrapExport(fastify, function wrapFastifyModule(shim, fn) { - return function wrappedFastifyModule() { - // call original function get get fastify object (which is singleton-ish) - const fastifyForWrapping = fn.apply(this, arguments) - - setupRouteHandler(shim, fastifyForWrapping) - - setupMiddlewareHandlers(shim, fastifyForWrapping, isv3Plus) - - return fastifyForWrapping - } - }) - - if (isv3Plus) { - setupExports(fastify, wrappedExport) - } -} - -function setupMiddlewareHandlers(shim, fastify, isv3Plus) { - const mounterSpec = { - route: shim.FIRST, - wrapper: wrapMiddleware - } - - if (isv3Plus) { - // Fastify v3+ does not ship with traditional Node.js middleware mounting. - // This style is accomplished leveraging decorators. Both middie (which was built-in in v2) - // and fastify-express mount a 'use' function for mounting middleware. - shim.wrap(fastify, 'decorate', function wrapDecorate(shim, fn) { - return function wrappedDecorate() { - const name = arguments[0] - if (name !== 'use') { - return fn.apply(this, arguments) - } - - const args = shim.argsToArray.apply(shim, arguments) - args[1] = shim.wrapMiddlewareMounter(args[1], mounterSpec) - - return fn.apply(this, args) - } - }) - } else { - shim.wrapMiddlewareMounter(fastify, 'use', mounterSpec) - } -} - -function wrapMiddleware(shim, middleware, name, route) { - if (shim.isWrapped(middleware)) { - return middleware - } - - // prefixing the segment name for middleware execution - // with the Fastify lifecycle hook - const segmentName = `onRequest/${name}` - const spec = buildMiddlewareSpecForMiddlewareFunction(shim, segmentName, route) - - return shim.recordMiddleware(middleware, spec) -} - -/** - * module.exports = fastify - * module.exports.fastify = fastify - * module.exports.default = fastify - * - * @param original - * @param wrappedExport - */ -function setupExports(original, wrappedExport) { - wrappedExport.fastify = original.fastify - - if (original.fastify) { - wrappedExport.fastify = wrappedExport - } - - if (original.default) { - wrappedExport.default = wrappedExport - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/fastify/spec-builders.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/fastify/spec-builders.js deleted file mode 100644 index 7c729326b..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/fastify/spec-builders.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Retrieves the IncomingMessage from a Fastify request. Depending on the - * context of this function it either exists on `request.raw` or just `request` - * - * @param {WebFrameworkShim} shim - * @param {Function} fn middleware function executing - * @param {string} fnName name of middleware executing - * @param {args} args that are passed to middleware - * @returns {IncomingMessage} - */ -const getRequestFromFastify = (shim, fn, fnName, args) => { - const [request] = args - - // request is Fastify request - // object, get IncomingMessage from .raw - if (request && request.raw) { - return request.raw - } - - return request -} - -/** - * Retrieves the params from the Fastify request. - * - * @param {WebFrameworkShim} shim - * @param {Function} fn middleware function executing - * @param {string} fnName name of middleware executing - * @param {args} args that are passed to middleware - * @returns {object} URL params on a Fastify request - */ -const getParamsFromFastifyRequest = (shim, fn, fnName, args) => { - const [req] = args - return req && req.params -} - -/** - * Builds the recordMiddleware Spec for the route handler - * - * A spec is basically a specification -- or a list - * of instructions to the recordMiddleware function - * that provide it with the information it needs to - * do its job. You could also think of it as a - * mini-DSL - * - * @param {WebFrameworkShim} shim - * @param {string} path URL route being executed - * @returns {object} spec for Fastify route handler - */ -function buildMiddlewareSpecForRouteHandler(shim, path) { - return { - /** - * A function where we can wrap next, reply send, etc. methods - * - * This one is tricky. The `next` function will, same as - * the `req` function above, receives the fn, fnName, - * and args from the handler function. It _also_ receives - * a `wrap` function. This wrap function will allow us to - * to bind a segment for any next function/method, or any - * method that would finish the request handling (i.e. - * `reply`, `respond`, etc.) - * - * This is far more useful when instrumenting actual middleware vs. - * instrumenting a simple route handler. However, if the route - * handling API uses a method call for responding (vs. returning a value) - * then this method is required/useful again. - * - * The isFinal param determines whether or not a path is appended for - * this particular piece of middleware. (i.e. if this is the final handler - * that is actually handling the request, the path is actually left on) - * - * @param shim - * @param fn - * @param fnName - * @param args - * @param bindSegment - */ - next: function wrapNext(shim, fn, fnName, args, bindSegment) { - const reply = args[1] - if (!shim.isFunction(reply)) { - return - } - const isFinal = true - bindSegment(reply, 'send', isFinal) - }, - params: getParamsFromFastifyRequest, - req: getRequestFromFastify, - route: path - } -} - -/** - * Spec for all Fastify middleware(excluding route handlers) - * - * @param {WebFrameworkShim} shim - * @param {string} name metric name for middleware being executed - * @param route - * @returns {object} spec for Fastify middleware - */ -function buildMiddlewareSpecForMiddlewareFunction(shim, name, route) { - return { - name, - route, - next: shim.LAST, - params: getParamsFromFastifyRequest, - req: getRequestFromFastify, - type: shim.MIDDLEWARE - } -} - -module.exports = { - buildMiddlewareSpecForRouteHandler, - buildMiddlewareSpecForMiddlewareFunction -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/generic-pool.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/generic-pool.js deleted file mode 100644 index 24826c3de..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/generic-pool.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = function initialize(agent, generic, moduleName, shim) { - if (!generic || !generic.Pool || !generic.Pool.prototype) { - return false - } - - const proto = generic.Pool.prototype - shim.wrap(proto, 'acquire', function wrapAcquire(shim, acquire) { - if (!shim.isFunction(acquire)) { - return acquire - } - - return function wrappedAcquire(callback, priority) { - return acquire.call(this, shim.bindSegment(callback), priority) - } - }) - - shim.wrap(proto, ['drain', 'destroyAllNow'], function wrap(shim, original) { - if (!shim.isFunction(original)) { - return original - } - - return function wrappedMethod(cb) { - return original.call(this, shim.bindSegment(cb)) - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/grpc-js/grpc.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/grpc-js/grpc.js deleted file mode 100644 index 34ed8a1ce..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/grpc-js/grpc.js +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const recordExternal = require('../../metrics/recorders/http_external') -const recordHttp = require('../../metrics/recorders/http') -const { DESTINATIONS } = require('../../config/attribute-filter') -const DESTINATION = DESTINATIONS.TRANS_EVENT | DESTINATIONS.ERROR_EVENT -const semver = require('semver') - -module.exports = function instrument(shim) { - const grpcVersion = shim.require('./package.json').version - const genericShim = shim.makeSpecializedShim(shim.GENERIC, 'grpc-client-interceptor') - - if (semver.gte(grpcVersion, '1.8.0')) { - const resolvingCall = genericShim.require('./build/src/resolving-call') - genericShim.wrap(resolvingCall.ResolvingCall.prototype, 'start', wrapStart) - } else { - const callStream = genericShim.require('./build/src/call-stream') - genericShim.wrap(callStream.Http2CallStream.prototype, 'start', wrapStart) - } - - const webFrameworkShim = shim.makeSpecializedShim(shim.WEB_FRAMEWORK, 'server') - if (semver.lt(grpcVersion, '1.4.0')) { - shim.logger.debug('gRPC server-side instrumentation only supported on grpc-js >=1.4.0') - return - } - - const server = webFrameworkShim.require('./build/src/server') - webFrameworkShim.setFramework('gRPC') - webFrameworkShim.wrap(server.Server.prototype, 'register', wrapRegister) -} - -/** - * Instruments grpc-js client by intercepting the function that - * initiates client requests. This handles all four types of client - * invocations: unary, client-streaming, server-streaming, and - * bidirectional streaming. - * - * @param {object} shim the generic shim to instrument with - * @param {Function} original the original function - * @returns {Function} the instrumented function - */ -function wrapStart(shim, original) { - return function wrappedStart() { - const activeSegment = shim.getActiveSegment() - if (!activeSegment) { - return original.apply(this, arguments) - } - - const channel = this.channel - const authorityName = (channel.target && channel.target.path) || channel.getDefaultAuthority - // in 1.8.0 this changed from methodName to method - const method = this.methodName || this.method - - const segment = shim.createSegment({ - name: `External/${authorityName}${method}`, - opaque: true, - recorder: recordExternal(authorityName, 'gRPC') - }) - - return shim.applySegment(callStart, segment, true, this, arguments) - - function callStart() { - const args = shim.argsToArray.apply(shim, arguments) - - const transaction = segment.transaction - - const originalMetadata = args[0] - const nrMetadata = originalMetadata.clone() - - const outboundAgentHeaders = Object.create(null) - if (shim.agent.config.distributed_tracing.enabled) { - transaction.insertDistributedTraceHeaders(outboundAgentHeaders) - Object.keys(outboundAgentHeaders).forEach((key) => { - nrMetadata.add(key, outboundAgentHeaders[key]) - }) - } else { - shim.logger.debug('Distributed tracing disabled by instrumentation.') - } - - args[0] = nrMetadata - - const originalListener = args[1] - const nrListener = Object.assign({}, originalListener) - nrListener.onReceiveStatus = (status) => { - const { code, details } = status - - segment.addAttribute('grpc.statusCode', code) - segment.addAttribute('grpc.statusText', details) - - const agent = shim.agent - const config = agent.config - - if (shouldTrackError(code, config)) { - shim.agent.errors.add(segment.transaction, details) - } - - segment.addAttribute('component', 'gRPC') - - const protocol = 'grpc' - - const url = `${protocol}://${authorityName}${method}` - - segment.addAttribute('http.url', url) - segment.addAttribute('http.method', method) - - if (originalListener && originalListener.onReceiveStatus) { - const onReceiveStatuts = shim.bindSegment(originalListener.onReceiveStatus, segment) - onReceiveStatuts(status) - } - segment.end() - } - - args[1] = nrListener - - return original.apply(this, args) - } - } -} - -/** - * Instruments the grpc-js server by intercepting the moment when - * server methods are registered from the method implementations - * provided to grpc-js. This handles all four types of server - * invocations: unary, client-streaming, server-streaming, and - * bidirectional streaming. - * - * @param {object} shim the web shim to instrument with - * @param {Function} original the original function - * @returns {Function} the instrumented function - */ -function wrapRegister(shim, original) { - const constants = shim.require('./build/src/constants') - - return function wrappedRegister() { - const args = shim.argsToArray.apply(shim, arguments) - - const name = args[0] - const handler = args[1] - const type = args[args.length - 1] - - if (this.handlers.has(name)) { - shim.logger.debug( - `Not re-instrumenting gRPC method handler for ${name}: it is already registered in the server.` - ) - return original.apply(this, arguments) - } - - args[1] = shim.bindCreateTransaction(instrumentedHandler, { type: shim.WEB }) - - return original.apply(this, args) - - function instrumentedHandler(stream) { - const { transaction, segment } = createTransaction() - acceptDTHeaders(stream, transaction) - instrumentEventListeners(stream, transaction) - return shim.applySegment(handler, segment, true, this, arguments) - } - - function createTransaction() { - const parent = shim.getActiveSegment() - const transaction = parent.transaction - - // Create the transaction segment using the request URL for now. Once a - // better name can be determined this segment will be renamed to that. - const segment = shim.createSegment(name, recordHttp) - segment.start() - - transaction.type = 'web' - transaction.baseSegment = segment - transaction.url = name - - transaction.trace.attributes.addAttribute(DESTINATION, 'request.method', transaction.url) - - transaction.trace.attributes.addAttribute(DESTINATION, 'request.uri', transaction.url) - - shim.setTransactionUri(transaction.url) - - // This attribute isn't required by the spec, but it seems useful to have - transaction.trace.attributes.addAttribute(DESTINATION, 'grpc.type', type) - return { transaction, segment } - } - - function acceptDTHeaders(stream, transaction) { - const metadata = stream.metadata - Object.entries(metadata.getMap()).forEach(([key, value]) => { - transaction.trace.attributes.addAttribute(DESTINATION, `request.headers.${key}`, value) - }) - - const headers = Object.create(null) - headers.tracestate = metadata.get('tracestate').join(',') - headers.traceparent = metadata.get('traceparent').join(',') - headers.newrelic = metadata.get('newrelic').join(',') - transaction.acceptDistributedTraceHeaders('HTTP', headers) - } - - function instrumentEventListeners(stream, transaction) { - const agent = shim.agent - const config = agent.config - stream.call.once('callEnd', (statusCode) => { - transaction.trace.attributes.addAttribute(DESTINATION, 'response.status', statusCode) - if (shouldTrackError(statusCode, config)) { - const status = constants.Status[statusCode] - const error = new Error(`gRPC status code ${statusCode}: ${status}`) - agent.errors.add(transaction, error) - } - }) - stream.call.once('streamEnd', () => { - transaction.end() - }) - // TODO should also instrument the 'data' event on the stream - // object, as that can ensue in lots of processing when the - // client is streaming. https://issues.newrelic.com/browse/NEWRELIC-1460 - } - } -} - -function shouldTrackError(statusCode, config) { - return ( - statusCode > 0 && - config.grpc.record_errors && - !config.grpc.ignore_status_codes.includes(statusCode) - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/grpc-js/nr-hooks.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/grpc-js/nr-hooks.js deleted file mode 100644 index e307b2946..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/grpc-js/nr-hooks.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const grpc = require('./grpc') - -/** - * Need to use nr-hooks style for grpc because we're using the onResolved hook - * to register instrumentation. - */ -module.exports = [ - { - type: 'conglomerate', // generic shim for client, web framework shim for server - moduleName: '@grpc/grpc-js', - onResolved: grpc - } -] diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/ioredis.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/ioredis.js deleted file mode 100644 index 1023b1672..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/ioredis.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const stringify = require('json-stringify-safe') -const urltils = require('../util/urltils.js') - -module.exports = function initialize(agent, redis, moduleName, shim) { - const proto = redis && redis.prototype - if (!proto) { - return false - } - - shim.setDatastore(shim.REDIS) - shim.recordOperation(proto, 'sendCommand', wrapSendCommand) - - function wrapSendCommand(shim, original, name, args) { - const command = args[0] - - // TODO: Instance attributes for ioredis - const parameters = { - host: this.connector.options.host, - port_path_or_id: this.connector.options.port - } - - const keys = command.args - if (keys && typeof keys !== 'function') { - const src = Object.create(null) - try { - src.key = stringify(keys[0]) - } catch (err) { - shim.logger.debug(err, 'Failed to stringify ioredis key') - src.key = '' - } - urltils.copyParameters(src, parameters) - } - - return { - name: command.name || 'unknown', - parameters: parameters, - promise: true - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/memcached.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/memcached.js deleted file mode 100644 index f453b1ae6..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/memcached.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const stringify = require('json-stringify-safe') - -function wrapKeys(metacall) { - if (metacall.key) { - return [metacall.key] - } else if (metacall.multi) { - return metacall.command.split(' ').slice(1) - } - - return [] -} - -/** - * Thanks to Hernan Silberman! - * - * instrument the memcached driver to intercept calls and keep stats on them. - * - * @param agent - * @param memcached - * @param moduleName - * @param shim - */ -module.exports = function initialize(agent, memcached, moduleName, shim) { - const proto = memcached && memcached.prototype - if (!proto) { - return false - } - - shim.setDatastore(shim.MEMCACHED) - shim.recordOperation(proto, 'command', function commandWrapper(shim, original, name, args) { - // The `command` method takes two arguments: a query generator and a server - // address. The query generator returns a simple object describing the - // memcached call. The server parameter is only provided for multi-calls. - // When not provided, it can be derived from the key being interacted with. - const metacall = args[0]() - const server = args[1] - const keys = wrapKeys(metacall) - const parameters = Object.create(null) - try { - parameters.key = stringify(keys[0]) - } catch (err) { - shim.logger.debug(err, 'Unable to stringify memcache key') - parameters.key = '' - } - - // Capture connection info for datastore instance metric. - let location = null - if (typeof server === 'string') { - location = server - } else if (this.HashRing && this.HashRing.get && metacall.key) { - location = this.HashRing.get(metacall.key) - } - if (location) { - location = location.split(':') - parameters.host = location[0] - parameters.port_path_or_id = location[1] - } - - // rewrap the metacall for the command object - args[0] = function rewrapped() { - return metacall - } - - // finally, execute the original command - return { - name: metacall.type || 'Unknown', - callback: function wrapCallback(shim, fn, fnName, opSegment) { - shim.bindCallbackSegment(metacall, 'callback', opSegment) - }, - parameters: parameters - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb.js deleted file mode 100644 index df66297c4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const semver = require('semver') -const instrument = require('./mongodb/v2-mongo') -const instrumentV3 = require('./mongodb/v3-mongo') -const instrumentV4 = require('./mongodb/v4-mongo') - -// XXX: When this instrumentation is modularized, update this thread -// with a cautionary note: -// https://discuss.newrelic.com/t/feature-idea-using-mongoose-cursors-memory-leaking-very-quickly/49270/14 -// -// This instrumentation is deep linked against in the mongoose instrumentation -// snippet. The snippet will break once this file is moved from this -// location. - -module.exports = initialize - -/** - * Registers the query parser, and relevant instrumentation - * based on version of mongodb - * - * @param {Agent} agent - * @param {object} mongodb resolved package - * @param {string} moduleName name of module - * @param {Shim} shim - */ -function initialize(agent, mongodb, moduleName, shim) { - if (!mongodb) { - return - } - - shim.setDatastore(shim.MONGODB) - - const mongoVersion = shim.require('./package.json').version - if (semver.satisfies(mongoVersion, '>=4.0.0')) { - instrumentV4(shim, mongodb) - } else if (semver.satisfies(mongoVersion, '>=3.0.6')) { - instrumentV3(shim, mongodb) - } else { - instrument(shim, mongodb) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/common.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/common.js deleted file mode 100644 index af51713ff..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/common.js +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { CURSOR_OPS, COLLECTION_OPS, DB_OPS } = require('./constants') -const common = module.exports -common.NR_ATTRS = Symbol('NR_ATTRS') - -/** - * Instruments all methods from constants.CURSOR_OPS on a given - * cursor class - * - * @param {Shim} shim instance of shim - * @param {Cursor} Cursor mongodb Cursor prototype - */ -common.instrumentCursor = function instrumentCursor(shim, Cursor) { - if (Cursor && Cursor.prototype) { - const proto = Cursor.prototype - for (let i = 0; i < CURSOR_OPS.length; i++) { - shim.recordQuery(proto, CURSOR_OPS[i], common.makeQueryDescFunc(shim, CURSOR_OPS[i])) - } - - shim.recordQuery(proto, 'each', common.makeQueryDescFunc(shim, 'each')) - shim.recordOperation(proto, 'pipe', { opaque: true }) - } -} - -/** - * Instruments all methods from constants.COLLECTION_OPS on - * the Collection class - * - * @param {Shim} shim instance of shim - * @param {Collection} Collection mongodb Collection prototype - */ -common.instrumentCollection = function instrumentCollection(shim, Collection) { - if (Collection && Collection.prototype) { - const proto = Collection.prototype - for (let i = 0; i < COLLECTION_OPS.length; i++) { - shim.recordQuery(proto, COLLECTION_OPS[i], common.makeQueryDescFunc(shim, COLLECTION_OPS[i])) - } - } -} - -/** - * Instruments the execute method on - * the BulkOperationBase class - * - * @param {Shim} shim instance of shim - * @param {BulkOperationModule} BulkOperationModule operation module, typically from mongodb/lib/bulk/common - */ -common.instrumentBulkOperation = function instrumentBulkOperation(shim, BulkOperationModule) { - if (BulkOperationModule?.BulkOperationBase?.prototype) { - const proto = BulkOperationModule.BulkOperationBase.prototype - shim.recordBatchQuery(proto, 'execute', common.makeBulkDescFunc(shim, 'execute')) - } -} - -/** - * Instruments all methods from constants.DB_OPS on - * the Db class. - * - * @param {Shim} shim instance of shim - * @param {Db} Db mongodb Db prototype - */ -common.instrumentDb = function instrumentDb(shim, Db) { - if (Db && Db.prototype) { - const proto = Db.prototype - shim.recordOperation(proto, DB_OPS, { callback: shim.LAST, opaque: true }) - // link to client.connect(removed in v4.0) - shim.recordOperation(Db, 'connect', { callback: shim.LAST }) - } -} - -/** - * Sets up the desc for all instrumented query methods - * - * @param {Shim} shim instance of shim - * @param {string} methodName name of method getting executed - * @returns {object} query spec - */ -common.makeQueryDescFunc = function makeQueryDescFunc(shim, methodName) { - if (methodName === 'each') { - return function eachDescFunc() { - const parameters = getInstanceAttributeParameters(shim, this) - return { query: methodName, parameters, rowCallback: shim.LAST, opaque: true } - } - } - - return function queryDescFunc() { - // segment name does not actually use query string - // method name is set as query so the query parser has access to the op name - const parameters = getInstanceAttributeParameters(shim, this) - return { query: methodName, parameters, promise: true, callback: shim.LAST, opaque: true } - } -} - -/** - * Sets up the desc for all instrumented bulk operations - * - * @param {Shim} shim instance of shim - * @returns {object} query spec - */ -common.makeBulkDescFunc = function makeBulkDescFunc(shim) { - return function bulkDescFunc() { - const parameters = getInstanceAttributeParameters(shim, this) - return { - query: this.isOrdered ? 'orderedBulk' : 'unorderedBulk', - parameters, - promise: true, - callback: shim.LAST, - opaque: true - } - } -} - -/** - * Sets up a listener for `started` on instrumenter(mongo APM). This applies to - * mongo <4. The listener adds the following attributes to the active segment: - * host, port_path_or_id, and database_name - * - * @param {Shim} shim instance of shim - * @param {object} instrumenter instance of mongo APM class - * @param {object} [options={}] provide command names to skip updating host/port as they are unrelated to the active query. This is only in v3 because after every command is runs `endSessions` which runs on the admin database - */ -common.captureAttributesOnStarted = function captureAttributesOnStarted( - shim, - instrumenter, - options = { skipCommands: [] } -) { - instrumenter.on('started', function onMongoEventStarted(evnt) { - if (options.skipCommands.includes(evnt.commandName)) { - return - } - // This assumes that this `started` event is fired _after_ our wrapper - // starts and creates the segment. We perform a check of the segment name - // out of an excess of caution. - const connId = evnt.connectionId - - if (connId) { - // used in v3 when connection is a cluster pool - if (typeof connId === 'number') { - setHostPort(shim, evnt.address, evnt.databaseName, this.$MongoClient) - // used in v3 when connection is to 1 host - } else if (typeof connId === 'string') { - setHostPort(shim, connId, evnt.databaseName) - // v2 contains `domainSocket`, get socket connection from `host` - } else if (connId.domainSocket) { - shim.captureInstanceAttributes('localhost', connId.host, evnt.databaseName) - // v2 remote connection get `host` `port` from respective properties - } else { - shim.captureInstanceAttributes(connId.host, connId.port, evnt.databaseName) - } - } - }) -} - -/** - * Extracts the host and port from a connection string - * This also handles if connection string is a domain socket - * Mongo sticks the path to the domain socket in the "host" slot, but we - * want it in the "port", so if we have a domain socket we need to change - * the order of our parameters. - * - * @param {Shim} shim instance of shim - * @param {string} connStr mongo connection string - * @param {string} db database name - * @param {object} client mongo client instance - */ -function setHostPort(shim, connStr, db, client) { - const parts = common.parseAddress(connStr) - // in v3 when running with a cluster of socket connections - // the address is `undefined:undefined`. we will instead attempt - // to get connection details from the client symbol NR_ATTRS - // added in `lib/instrumentation/mongodb/v3-mongo` when a client connects - // with a URL string - if (parts.includes('undefined')) { - try { - const attrs = client[common.NR_ATTRS] - const socket = decodeURIComponent(attrs.split(',')[0].split('mongodb://')[1]) - shim.captureInstanceAttributes('localhost', socket, db) - } catch (err) { - shim.logger.debug(err, 'Could not extract host/port from mongo command') - } - // connected using domain socket but the "host"(e.g: /path/to/mongo-socket-port.sock) - } else if (parts.length && parts[0][0] === '/') { - shim.captureInstanceAttributes('localhost', parts[0], db) - } else { - shim.captureInstanceAttributes(parts[0], parts[1], db) - } -} - -/** - * Get the database_name, host, port_path_or_id - * for the query segment. v4 refactored where the topology is stored. - * You can now get the details via the client obj that's deeply nested - * See: https://github.com/mongodb/node-mongodb-native/pull/2594/files#diff-1d214e57ddda9095d296e5700ebce701333bfefcf417e234c584d14091b2f50dR168 - * - * @param {Shim} shim instance of shim - * @param {object} mongo instance of mongo - * @returns {object} db params - */ -function getInstanceAttributeParameters(shim, mongo) { - let params = { - host: null, - port_path_or_id: null, - database_name: null - } - - if (mongo?.s?.topology) { - shim.logger.trace('Adding datastore instance attributes from mongo.s.db + mongo.s.topology') - const databaseName = mongo?.s?.db?.databaseName || mongo?.s?.namespace?.db || null - const topology = mongo.s.topology - params = getParametersFromTopology(topology, databaseName) - } else if (mongo?.s?.db?.s?.client?.s?.options?.hosts?.length) { - const databaseName = mongo?.s?.db?.databaseName || null - const hosts = mongo.s.db.s.client.s.options.hosts - params = getParametersFromHosts(hosts, databaseName) - } else { - shim.logger.trace('Could not find datastore instance attributes.') - } - - return params -} - -/** - * Extracts the database parameters from the first host. - * - * @param {Array} hosts mongodb connected hosts - * @param {string} database name of database - * @returns {object} db params - */ -function getParametersFromHosts(hosts, database) { - let [{ host, port }] = hosts - const [{ socketPath }] = hosts - - if (socketPath) { - port = socketPath - host = 'localhost' - } - return { - host, - port_path_or_id: port, - database_name: database - } -} - -/** - * Extracts the database parameters from the relevant - * topology configuration - * - * @param {object} conf topology configuration - * @param {string} database name of database - * @returns {object} db params - */ -function getParametersFromTopology(conf, database) { - // in older versions of 3.x the host/port - // lived directly on the topology - let { host, port } = conf - - // servers is an array but we will always pull the first for consistency - if (conf?.s?.options?.servers?.length) { - ;[{ host, port }] = conf.s.options.servers - } - - // host is a domain socket. set host as localhost and use the domain - // socket host as the port - if (host && host.endsWith('.sock')) { - port = host - host = 'localhost' - } - - return { - host: host, - port_path_or_id: port, - database_name: database - } -} - -/** - * Parses mongo address that accounts for IPv6 - * - * @param {string} address mongo address string - * @returns {Array} host/port of address string - */ -common.parseAddress = function parseAddress(address) { - const lastColon = address.lastIndexOf(':') - const host = address.slice(0, lastColon) - const port = address.slice(lastColon + 1) - return [host, port] -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/constants.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/constants.js deleted file mode 100644 index f6ccb19cb..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/constants.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const DB_OPS = [ - 'addUser', - 'authenticate', - 'collection', - 'collectionNames', - 'collections', - 'command', - 'createCollection', - 'createIndex', - 'cursorInfo', - 'dereference', - 'dropCollection', - 'dropDatabase', - 'dropIndex', - 'ensureIndex', - 'eval', - 'executeDbAdminCommand', - 'indexInformation', - 'logout', - 'open', - 'reIndex', - 'removeUser', - 'renameCollection', - 'stats', - '_executeInsertCommand', - '_executeQueryCommand' -] - -const COLLECTION_OPS = [ - 'aggregate', - 'bulkWrite', - 'count', - 'createIndex', - 'deleteMany', - 'deleteOne', - 'distinct', - 'drop', - 'dropAllIndexes', - 'dropIndex', - 'ensureIndex', - 'findAndModify', - 'findAndRemove', - 'findOne', - 'findOneAndDelete', - 'findOneAndReplace', - 'findOneAndUpdate', - 'geoHaystackSearch', - 'geoNear', - 'group', - 'indexes', - 'indexExists', - 'indexInformation', - 'insert', - 'insertMany', - 'insertOne', - 'isCapped', - 'mapReduce', - 'options', - 'parallelCollectionScan', - 'reIndex', - 'remove', - 'rename', - 'replaceOne', - 'save', - 'stats', - 'update', - 'updateMany', - 'updateOne' -] - -const GRID_OPS = ['put', 'get', 'delete'] - -const CURSOR_OPS = ['nextObject', 'next', 'toArray', 'count', 'explain'] - -module.exports = { - COLLECTION_OPS, - CURSOR_OPS, - DB_OPS, - GRID_OPS -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v2-mongo.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v2-mongo.js deleted file mode 100644 index 50369dadf..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v2-mongo.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { captureAttributesOnStarted, makeQueryDescFunc } = require('./common') - -/** - * parser used to grab the collection and operation - * from a running query - * - * @param {object} operation - */ -function queryParser(operation) { - let collection = this.collectionName || 'unknown' - if (this.ns) { - collection = this.ns.split(/\./)[1] || collection - } - - return { operation, collection } -} -/** - * Registers relevant instrumentation for mongo <= 3.0.6 - * and >= 2. This relies on the built-in "APM" hook points - * to instrument their provided objects as well as sets - * up a listener for when commands start to properly - * add necessary attributes to segments - * - * @param {Shim} shim - * @param {object} mongodb resolved package - */ -module.exports = function instrument(shim, mongodb) { - shim.setParser(queryParser) - - const recordDesc = { - Gridstore: { - isQuery: false, - makeDescFunc: function makeGridDesc(opName) { - return { name: 'GridFS-' + opName, callback: shim.LAST } - } - }, - OrderedBulkOperation: { isQuery: true, makeDescFunc: makeQueryDescFunc }, - UnorderedBulkOperation: { isQuery: true, makeDescFunc: makeQueryDescFunc }, - CommandCursor: { isQuery: true, makeDescFunc: makeQueryDescFunc }, - AggregationCursor: { isQuery: true, makeDescFunc: makeQueryDescFunc }, - Cursor: { isQuery: true, makeDescFunc: makeQueryDescFunc }, - Collection: { isQuery: true, makeDescFunc: makeQueryDescFunc }, - Db: { - isQuery: false, - makeDescFunc: function makeDbDesc() { - return { callback: shim.LAST } - } - } - } - - // instrument using the apm api - const instrumenter = mongodb.instrument(Object.create(null), instrumentModules) - captureAttributesOnStarted(shim, instrumenter) - - /** - * Every module groups instrumentations by their - * promise, callback, return permutations - * Iterate over permutations and properly - * wrap depending on the `recordDesc` above - * See: https://github.com/mongodb/node-mongodb-native/blob/v3.0.5/lib/collection.js#L384 - * - * @param _ - * @param modules - */ - function instrumentModules(_, modules) { - modules.forEach((module) => { - const { obj, instrumentations, name } = module - instrumentations.forEach((meta) => { - applyInstrumentation(name, obj, meta) - }) - }) - } - - /** - * Iterate over methods on object and lookup in `recordDesc` to decide - * if it needs to be wrapped as an operation or query - * - * @param {string} objectName name of class getting instrumented - * @param {object} object reference to the class getting instrumented - * @param {Define} meta describes the methods and if they are callbacks - * promises, and return values - */ - function applyInstrumentation(objectName, object, meta) { - const { methods, options } = meta - if (options.callback) { - methods.forEach((method) => { - const { isQuery, makeDescFunc } = recordDesc[objectName] - const proto = object.prototype - if (isQuery) { - shim.recordQuery(proto, method, makeDescFunc(shim, method)) - } else if (isQuery === false) { - // could be unset - shim.recordOperation(proto, method, makeDescFunc(shim, method)) - } else { - shim.logger.trace('No wrapping method found for %s', objectName) - } - }) - } - - // the cursor object implements Readable stream and internally calls nextObject on - // each read, in which case we do not want to record each nextObject() call - if (/Cursor$/.test(objectName)) { - shim.recordOperation(object.prototype, 'pipe') - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v3-mongo.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v3-mongo.js deleted file mode 100644 index e1ca8e509..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v3-mongo.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { - captureAttributesOnStarted, - instrumentBulkOperation, - instrumentCollection, - instrumentCursor, - instrumentDb, - NR_ATTRS -} = require('./common') - -/** - * parser used to grab the collection and operation - * on every mongo operation - * - * @param {object} operation - */ -function queryParser(operation) { - let collection = this.collectionName || 'unknown' - // in v3.3.0 aggregate commands added the collection - // to target - if (this.operation && this.operation.target) { - collection = this.operation.target - } else if (this.ns) { - collection = this.ns.split(/\./)[1] || collection - } else if (this.s && this.s.collection && this.s.collection.collectionName) { - collection = this.s.collection.collectionName - } - return { operation, collection } -} - -/** - * Records the `mongo.MongoClient.connect` operations. It also adds the first arg of connect(url) - * to a Symbol on the MongoClient to be used later to extract the host/port in cases where the topology - * is a cluster of domain sockets - * - * @param {Shim} shim - * @param {object} mongodb resolved package - */ -function instrumentClient(shim, mongodb) { - shim.recordOperation(mongodb.MongoClient, 'connect', function wrappedConnect(shim, _, __, args) { - // Add the connection url to the MongoClient to retrieve later in the `lib/instrumentation/mongo/common` - // captureAttributesOnStarted listener - this[NR_ATTRS] = args[0] - return { callback: shim.LAST } - }) -} - -/** - * Registers relevant instrumentation for mongo >= 3.0.6 - * In 3.0.6 they refactored their "APM" module which removed - * a lot of niceities around instrumentation classes. - * see: https://github.com/mongodb/node-mongodb-native/pull/1675/files - * This reverts back to instrumenting pre-canned methods on classes - * as well as sets up a listener for when commands start to properly - * add necessary attributes to segments - * - * @param {Shim} shim - * @param {object} mongodb resolved package - */ -module.exports = function instrument(shim, mongodb) { - shim.setParser(queryParser) - instrumentClient(shim, mongodb) - const instrumenter = mongodb.instrument(Object.create(null), () => {}) - // in v3 of mongo endSessions fires after every command and it updates the active segment - // attributes with the admin database name which stomps on the database name where the original - // command runs on - captureAttributesOnStarted(shim, instrumenter, { skipCommands: ['endSessions'] }) - instrumentCursor(shim, mongodb.Cursor) - instrumentCursor(shim, shim.require('./lib/aggregation_cursor')) - instrumentCursor(shim, shim.require('./lib/command_cursor')) - instrumentBulkOperation(shim, shim.require('./lib/bulk/common')) - instrumentCollection(shim, mongodb.Collection) - instrumentDb(shim, mongodb.Db) - - // calling instrument sets up listeners for a few events - // we should restore this on unload to avoid leaking - // event emitters - shim.agent.once('unload', function uninstrumentMongo() { - instrumenter.uninstrument() - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v4-mongo.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v4-mongo.js deleted file mode 100644 index 157a3acd4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mongodb/v4-mongo.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { instrumentCollection, instrumentCursor, instrumentDb, parseAddress } = require('./common') - -/** - * parser used to grab the collection and operation - * from a running query - * - * @param {object} operation - */ -function queryParser(operation) { - let collection = this.collectionName || 'unknown' - - // cursor methods have collection on namespace.collection - if (this.namespace && this.namespace.collection) { - collection = this.namespace.collection - } - - return { operation, collection } -} - -/** - * `commandStarted` handler used to - * update host, port and database_name - * on segment attributes - * - * @param {Shim} shim - * @param {CommandStartedEvent} evnt - */ -function cmdStartedHandler(shim, evnt) { - if (evnt.connectionId) { - let [host, port] = parseAddress(evnt.address) - - // connection via socket get port from 1st host - // socketPath property - // which looks like mongodb:///tmp/mongodb-27017.sock" - if (['undefined'].includes(host, port)) { - host = 'localhost' - const hosts = this.s.options.hosts - if (hosts && hosts.length && hosts[0].socketPath) { - port = hosts[0].socketPath - } - } else if (['127.0.0.1', '::1', '[::1]'].includes(host)) { - host = 'localhost' - } - - shim.captureInstanceAttributes(host, port, evnt.databaseName) - } -} - -/** - * function executed when client.connect is called - * enable APM(monitorCommands) and add the - * `commandStarted` listener - * - * @param {Shim} shim - */ -function wrapConnect(shim) { - this.monitorCommands = true - this.on('commandStarted', cmdStartedHandler.bind(this, shim)) - return { callback: shim.LAST } -} - -/** - * Wraps connect to record as operation but also to add a listener - * for `commandStarted`. This will be emitted before every command starts - * so we can properly update the segment attributes with a more accurate - * host/port/database name - * - * @param {Shim} shim - * @param {MongoClient} MongoClient reference - */ -function instrumentMongoClient(shim, MongoClient) { - shim.recordOperation(MongoClient.prototype, 'connect', wrapConnect) -} - -module.exports = function instrument(shim, mongodb) { - shim.setParser(queryParser) - instrumentMongoClient(shim, mongodb.MongoClient) - instrumentCursor(shim, mongodb.AbstractCursor) - instrumentCursor(shim, mongodb.FindCursor) - instrumentCursor(shim, mongodb.AggregationCursor) - instrumentCollection(shim, mongodb.Collection) - instrumentDb(shim, mongodb.Db) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mysql/mysql.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mysql/mysql.js deleted file mode 100644 index ea8904dd3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mysql/mysql.js +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const dbutils = require('../../db/utils') -const properties = require('../../util/properties') -const symbols = require('../../symbols') - -exports.callbackInitialize = function callbackInitialize(shim, mysql) { - shim.setDatastore(shim.MYSQL) - shim[symbols.wrappedPoolConnection] = true - - shim.wrapReturn(mysql, 'createConnection', wrapCreateConnection) - function wrapCreateConnection(shim, fn, fnName, connection) { - if (shim[symbols.unwrapConnection]) { - return - } - shim.logger.debug('Wrapping Connection#query') - if (wrapQueryable(shim, connection, false)) { - const connProto = Object.getPrototypeOf(connection) - connProto[symbols.storeDatabase] = true - shim[symbols.unwrapConnection] = true - } - } - - shim.wrapReturn(mysql, 'createPool', wrapCreatePool) - function wrapCreatePool(shim, fn, fnName, pool) { - if (shim[symbols.unwrapPool]) { - return - } - shim.logger.debug('Wrapping Pool#query and Pool#getConnection') - if (wrapQueryable(shim, pool, true) && wrapGetConnection(shim, pool)) { - shim[symbols.unwrapPool] = true - } - } - - shim.wrapReturn(mysql, 'createPoolCluster', wrapCreatePoolCluster) - function wrapCreatePoolCluster(shim, fn, fnName, poolCluster) { - if (shim[symbols.createPoolCluster]) { - return - } - shim.logger.debug('Wrapping PoolCluster#of') - const proto = Object.getPrototypeOf(poolCluster) - shim.wrapReturn(proto, 'of', wrapPoolClusterOf) - function wrapPoolClusterOf(shim, of, _n, poolNamespace) { - if (shim[symbols.clusterOf]) { - return - } - if (wrapGetConnection(shim, poolNamespace)) { - shim[symbols.clusterOf] = true - } - } - - shim.logger.debug('Wrapping PoolCluster#getConnection') - if (wrapGetConnection(shim, poolCluster)) { - shim[symbols.createPoolCluster] = true - } - } -} - -exports.promiseInitialize = function promiseInitialize(shim) { - const callbackAPI = shim.require('./index') - if (callbackAPI && !shim.isWrapped(callbackAPI.createConnection)) { - exports.callbackInitialize(shim, callbackAPI) - } -} - -function wrapGetConnection(shim, connectable) { - if (!connectable || !connectable.getConnection || shim.isWrapped(connectable.getConnection)) { - shim.logger.trace( - { - connectable: !!connectable, - getConnection: !!(connectable && connectable.getConnection), - isWrapped: !!(connectable && shim.isWrapped(connectable.getConnection)) - }, - 'Not wrapping getConnection' - ) - return false - } - - const proto = Object.getPrototypeOf(connectable) - shim.wrap(proto, 'getConnection', function doWrapGetConnection(shim, fn) { - return function wrappedGetConnection() { - const args = shim.toArray(arguments) - const cbIdx = args.length - 1 - - if (shim.isFunction(args[cbIdx]) && !shim.isWrapped(args[cbIdx])) { - shim.logger.trace( - { - hasSegment: !!shim.getSegment() - }, - 'Wrapping callback with segment' - ) - let cb = args[cbIdx] - if (!shim[symbols.wrappedPoolConnection]) { - cb = shim.wrap(cb, wrapGetConnectionCallback) - } - args[cbIdx] = shim.bindSegment(cb) - } - return fn.apply(this, args) - } - }) - - return true -} - -function wrapGetConnectionCallback(shim, cb) { - return function wrappedGetConnectionCallback(err, conn) { - try { - shim.logger.debug('Wrapping PoolConnection#query') - if (!err && wrapQueryable(shim, conn, false)) { - // Leave getConnection wrapped in order to maintain TX state, but we can - // simplify the wrapping of its callback in future calls. - shim[symbols.wrappedPoolConnection] = true - } - } catch (_err) { - shim.logger.debug( - { error: _err }, - 'Attempt to wrap PoolConnection#query resulted in thrown error' - ) - } - return cb.apply(this, arguments) - } -} - -function wrapQueryable(shim, queryable, isPoolQuery) { - if (!queryable || !queryable.query || shim.isWrapped(queryable.query)) { - shim.logger.debug( - { - queryable: !!queryable, - query: !!(queryable && queryable.query), - isWrapped: !!(queryable && shim.isWrapped(queryable.query)) - }, - 'Not wrapping queryable' - ) - return false - } - - const proto = Object.getPrototypeOf(queryable) - - let describe - if (isPoolQuery) { - describe = describePoolQuery - } else { - describe = describeQuery - proto[symbols.databaseName] = null - } - - shim.recordQuery(proto, 'query', describe) - - if (queryable.execute) { - shim.recordQuery(proto, 'execute', describe) - } - - return true -} - -function extractQueryArgs(shim, args) { - let query = '' - let callback = null - - // Figure out the query parameter. - if (shim.isString(args[0])) { - // query(sql [, values], callback) - query = args[0] - } else { - // query(opts [, values], callback) - query = args[0].sql - } - - // Then determine the query values and callback parameters. - if (shim.isArray(args[1])) { - // query({opts|sql}, values, callback) - callback = 2 - } else { - // query({opts|sql}, callback) - callback = 1 - } - - return { - query: query, - callback: callback - } -} - -function describeQuery(shim, queryFn, fnName, args) { - shim.logger.trace('Recording query') - const extractedArgs = extractQueryArgs(shim, args) - - // Pull out instance attributes. - const parameters = getInstanceParameters(shim, this, extractedArgs.query) - - shim.logger.trace( - { - query: !!extractedArgs.query, - callback: !!extractedArgs.callback, - parameters: !!parameters - }, - 'Query segment descriptor' - ) - - return { - stream: true, - query: extractedArgs.query, - callback: extractedArgs.callback, - parameters: parameters, - record: true - } -} - -function describePoolQuery(shim, queryFn, fnName, args) { - shim.logger.trace('Recording pool query') - const extractedArgs = extractQueryArgs(shim, args) - return { - stream: true, - query: null, - callback: extractedArgs.callback, - name: 'MySQL Pool#query', - record: false - } -} - -function getInstanceParameters(shim, queryable, query) { - const parameters = { host: null, port_path_or_id: null, database_name: null } - let conf = queryable.config - conf = (conf && conf.connectionConfig) || conf - let databaseName = queryable[symbols.databaseName] || null - if (conf) { - parameters.database_name = databaseName = databaseName || conf.database - - if (properties.hasOwn(conf, 'socketPath') && conf.socketPath) { - // In the unix domain socket case we force the host to be localhost - parameters.host = 'localhost' - parameters.port_path_or_id = conf.socketPath - } else { - parameters.host = conf.host - parameters.port_path_or_id = conf.port - } - } else { - shim.logger.trace('No query config detected, not collecting db instance data') - } - - storeDatabaseName(shim, queryable, query) - return parameters -} - -function storeDatabaseName(shim, queryable, query) { - if (queryable[symbols.storeDatabase]) { - const databaseName = dbutils.extractDatabaseChangeFromUse(query) - if (databaseName) { - queryable[symbols.databaseName] = databaseName - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mysql/nr-hooks.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mysql/nr-hooks.js deleted file mode 100644 index 95b2039af..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/mysql/nr-hooks.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const instrumentation = require('./mysql') - -module.exports = [ - { - type: 'datastore', - moduleName: 'mysql', - onRequire: instrumentation.callbackInitialize - }, - { - type: 'datastore', - moduleName: 'mysql2', - onRequire: instrumentation.callbackInitialize - }, - { - type: 'datastore', - moduleName: 'mysql2/promise', - onRequire: instrumentation.promiseInitialize - } -] diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/nr-winston-transport.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/nr-winston-transport.js deleted file mode 100644 index 30d7127d6..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/nr-winston-transport.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const TransportStream = require('winston-transport') -const logger = require('../logger').child({ component: 'nr-winston-transport' }) -const { truncate } = require('../util/application-logging') - -/** - * Transport used to prepare a log line and add to the new relic agent - * log aggregator. - * - * Note*: This copies the log line so no other transports will get the - * mutated data. - */ -class NrTransport extends TransportStream { - constructor(opts = {}) { - // set this option to have winston handle uncaught exceptions - // See: https://github.com/winstonjs/winston#handling-uncaught-exceptions-with-winston - opts.handleExceptions = true - super(opts) - this.name = 'newrelic' - this.agent = opts.agent - this.config = opts.agent.config - } - - /** - * Executed on every log line. We will get the linking metadata - * and add this, along with reformatting of timestamp and error - * to a copy of the log line - * - * @param {object} logLine a winston log line - * @param {Function} callback callback to invoke once we are done - */ - log(logLine, callback) { - const metadata = this.agent.getLinkingMetadata() - const formattedLine = reformatLogLine(logLine, metadata) - this.agent.logs.add(formattedLine) - callback() - } -} - -module.exports = NrTransport - -/** - * Reformats a log line by reformatting errors, timestamp and adding - * new relic linking metadata(context). When uncaught exceptions exist - * an exception property will exist on the log line. This will tell us - * that we need to reformat the error - * - * @param {object} logLine log line - * @param {object} metadata linking metadata - * @returns {object} copy of log line with NR linking metadata - */ -function reformatLogLine(logLine, metadata) { - // Add the metadata to a copy of the logLine - const formattedLine = Object.assign({}, logLine, metadata) - - if (formattedLine.exception === true) { - reformatError(formattedLine) - } - - reformatTimestamp(formattedLine) - - return formattedLine -} - -/** - * Decorates the log line with truncated error.message, error.class, and error.stack and removes - * trace and stack - * - * @param {object} logLine a log line - */ -function reformatError(logLine) { - // Due to Winston internals sometimes the error on the logLine object is a string or an - // empty object, and so the message property is all we have - const errorMessage = logLine.error.message || logLine.message || '' - - logLine['error.message'] = truncate(errorMessage) - logLine['error.class'] = - logLine.error.name === 'Error' ? logLine.error.constructor.name : logLine.error.name - logLine['error.stack'] = truncate(logLine.error.stack) - logLine.message = truncate(logLine.message) - - // Removes additional capture of stack to reduce overall payload/log-line size. - // The server has a maximum of ~4k characters per line allowed. - delete logLine.trace - delete logLine.stack -} - -/** - * Turns timestamp into unix timestamp. If timestamp existed it will move original - * to `original_timestamp` key - * - * @param {object} logLine a log line - */ -function reformatTimestamp(logLine) { - if (logLine.timestamp) { - logger.traceOnce( - 'Overwriting `timestamp` key; assigning original value to `original_timestamp`.' - ) - logLine.original_timestamp = logLine.timestamp - } - logLine.timestamp = Date.now() -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pg.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pg.js deleted file mode 100644 index f69292f53..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pg.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -function getQuery(shim, original, name, args) { - const config = args[0] - let statement - if (config && (typeof config === 'string' || config instanceof String)) { - statement = config - } else if (config && config.text) { - statement = config.text - } else { - // Won't be matched by parser, but should be handled properly - statement = 'Other' - } - return statement -} - -module.exports = function initialize(agent, pgsql, moduleName, shim) { - shim.setDatastore(shim.POSTGRES) - - // allows for native wrapping to not happen if not necessary - // when env var is true - if (process.env.NODE_PG_FORCE_NATIVE) { - return instrumentPGNative(pgsql) - } - - function wrapJSClientQuery(shim, _, __, queryArgs) { - // As of pg v7.0.0, Client.query returns a Promise from an async call. - // pg supports event based Client.query when a Query object is passed in, - // and works similarly in pg version <7.0.0 - if (typeof queryArgs[0] === 'string') { - return { - callback: shim.LAST, - query: getQuery, - promise: true, - parameters: getInstanceParameters(shim, this), - internal: false - } - } - - return { - callback: shim.LAST, - query: getQuery, - stream: 'row', - parameters: getInstanceParameters(shim, this), - internal: false - } - } - - // wrapping for native - function instrumentPGNative(pg) { - shim.wrapReturn(pg, 'Client', clientFactoryWrapper) - shim.wrapClass(pg, 'Pool', { post: poolPostConstructor, es6: true }) - } - - function poolPostConstructor(shim) { - if (!shim.isWrapped(this.Client)) { - shim.wrapClass(this, 'Client', clientPostConstructor) - } - } - - function clientFactoryWrapper(shim, fn, fnName, client) { - clientPostConstructor.call(client, shim) - } - - function clientPostConstructor(shim) { - shim.recordQuery(this, 'query', wrapJSClientQuery) - - shim.record(this, 'connect', function pgConnectNamer() { - return { - name: 'connect', - callback: shim.LAST - } - }) - } - - // The pg module defines "native" getter which sets up the native client lazily - // (only when called). We replace the getter, so that we can instrument the native - // client. The original getter replaces itself with the instance of the native - // client, so only instrument if the getter exists (otherwise assume already - // instrumented). - const origGetter = pgsql.__lookupGetter__('native') - if (origGetter) { - delete pgsql.native - pgsql.__defineGetter__('native', function getNative() { - const temp = origGetter() - if (temp != null) { - instrumentPGNative(temp) - } - return temp - }) - } - - // wrapping for JS - shim.recordQuery(pgsql && pgsql.Client && pgsql.Client.prototype, 'query', wrapJSClientQuery) -} - -function getInstanceParameters(shim, client) { - return { - host: client.host || null, - port_path_or_id: client.port || null, - database_name: client.database || null - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pino/nr-hooks.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pino/nr-hooks.js deleted file mode 100644 index 576c39eb4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pino/nr-hooks.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const pino = require('./pino') - -/** - * Need to use nr-hooks style for pino because we're using the onResolved hook - * to register instrumentation. - */ -module.exports = [ - { - type: 'generic', - moduleName: 'pino', - onResolved: pino - } -] diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pino/pino.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pino/pino.js deleted file mode 100644 index a39090f1d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/pino/pino.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const { - createModuleUsageMetric, - isApplicationLoggingEnabled, - isLogForwardingEnabled, - isMetricsEnabled, - isLocalDecoratingEnabled, - incrementLoggingLinesMetrics, - truncate -} = require('../../util/application-logging') -const semver = require('semver') - -module.exports = function instrument(shim) { - const pinoVersion = shim.require('./package.json').version - - if (semver.lt(pinoVersion, '7.0.0')) { - shim.logger.debug('Instrumentation only supported on pino >=7.0.0.') - return - } - - const tools = shim.require('./lib/tools') - const agent = shim.agent - const config = agent.config - - if (!isApplicationLoggingEnabled(config)) { - shim.logger.debug('Application logging not enabled. Not instrumenting pino.') - return - } - - const metrics = agent.metrics - createModuleUsageMetric('pino', metrics) - - const levelUtils = shim.require('./lib/levels') - - /** - * Creates an object where the keys are the level labels and values are the level number. - * Pino passes in level as number but our spec needs it to be the label - */ - const levelMap = Object.entries(levelUtils.levels).reduce((levels, level) => { - const [label, number] = level - levels[number] = label - return levels - }, {}) - - const symbols = shim.require('./lib/symbols') - - shim.wrap(tools, 'asJson', function wrapJson(shim, asJson) { - /** - * Wraps function in pino that is used to construct/serialize a log - * line to json - * - * @param {object} obj data from mixins - * @param {string} msg message of log line - * @param {number} num log level as number - * @param {string} time formatted snippet of json with time(`,"time":`) - * @returns {string} serialized log line - */ - return function wrappedAsJson() { - const args = shim.argsToArray.apply(shim, arguments) - - if (isMetricsEnabled(config)) { - const level = args[2] - incrementLoggingLinesMetrics(levelMap[level], metrics) - } - - if (isLocalDecoratingEnabled(config)) { - args[1] += agent.getNRLinkingMetadata() - } - - /** - * must call original asJson to allow pino - * to construct the entire log line before we - * add to the log aggregator - */ - const logLine = asJson.apply(this, args) - - if (isLogForwardingEnabled(config, agent)) { - const chindings = this[symbols.chindingsSym] - const formatLogLine = reformatLogLine({ msg: args[1], logLine, agent, chindings, levelMap }) - - agent.logs.add(formatLogLine) - } - - return logLine - } - }) -} - -/** - * reformats error and assigns NR context data - * to log line - * - * @param logLine.logLine - * @param {object} logLine log line - * @param {object} metadata NR context data - * @param {string} chindings serialized string of all common log line data - * @param logLine.args - * @param logLine.agent - * @param logLine.chindings - * @param logLine.msg - * @param logLine.levelMap - */ -function reformatLogLine({ logLine, msg, agent, chindings = '', levelMap }) { - const metadata = agent.getLinkingMetadata() - - /** - * pino adds this already for us at times - * since asJson manually constructs the json string, - * it will have hostname twice if we do not delete ours. - */ - if (chindings.includes('hostname')) { - delete metadata.hostname - } - - const agentMeta = Object.assign({}, { timestamp: Date.now(), message: msg }, metadata) - - /** - * A function that gets executed in `_toPayloadSync` of log aggregator. - * This will parse the serialized log line and then add the relevant NR - * context metadata and rename the time/msg keys to timestamp/message - */ - return function formatLogLine() { - const formattedLog = JSON.parse(logLine) - if (formattedLog.err) { - reformatError(formattedLog) - } - Object.assign(formattedLog, agentMeta) - formattedLog.level = levelMap[formattedLog.level] - delete formattedLog.time - delete formattedLog.msg - return formattedLog - } -} - -/** - * Truncates the message, stack and class of error - * and reassigns to a `error.*` keyspace. Also removes the `err` - * key on a log line - * - * @param {object} logLine log line - */ -function reformatError(logLine) { - logLine['error.message'] = truncate(logLine.err.message) - logLine['error.stack'] = truncate(logLine.err.stack) - logLine['error.class'] = logLine.err.type - delete logLine.err -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/q.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/q.js deleted file mode 100644 index 6da56b346..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/q.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const wrap = require('../shimmer').wrapMethod - -module.exports = initialize - -function initialize(agent, Q) { - function wrapUninstrumented(original, method) { - return agent.tracer.wrapFunctionFirstNoSegment(original, method) - } - - if (Q.nextTick) { - // The wrap() call for nextTick wipes the sub-function. Save a reference - // now so it can be restored later - const savedRunAfter = Q.nextTick.runAfter - - wrap(Q, 'Q', 'nextTick', wrapUninstrumented) - - if (savedRunAfter) { - Q.nextTick.runAfter = savedRunAfter - wrap(Q.nextTick, 'Q.nextTick', 'runAfter', wrapUninstrumented) - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/redis.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/redis.js deleted file mode 100644 index 11a732cc6..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/redis.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const hasOwnProperty = require('../util/properties').hasOwn -const stringify = require('json-stringify-safe') - -module.exports = function initialize(_agent, redis, _moduleName, shim) { - const proto = redis?.RedisClient?.prototype - if (!proto) { - return false - } - - shim.setDatastore(shim.REDIS) - - if (proto.internal_send_command) { - registerInternalSendCommand(shim, proto) - } else { - registerSendCommand(shim, proto) - } -} - -/** - * Instrumentation used in versions of redis > 2.6.1 < 4 to record all redis commands - * - * @param {Shim} shim instance of shim - * @param {object} proto RedisClient prototype - */ -function registerInternalSendCommand(shim, proto) { - shim.recordOperation( - proto, - 'internal_send_command', - function wrapInternalSendCommand(shim, _, __, args) { - const commandObject = args[0] - const keys = commandObject.args - const parameters = getInstanceParameters(shim, this) - - parameters.key = stringifyKeys(shim, keys) - - return { - name: commandObject.command || 'other', - parameters, - callback: function bindCallback(shim, _f, _n, segment) { - if (shim.isFunction(commandObject.callback)) { - shim.bindCallbackSegment(commandObject, 'callback', segment) - } else { - const self = this - commandObject.callback = shim.bindSegment( - function NRCallback(err) { - if (err && self.emit instanceof Function) { - self.emit('error', err) - } - }, - segment, - true - ) - } - } - } - } - ) -} - -/** - * Instrumentation used in versions of redis < 2.6.1 to record all redis commands - * - * @param {Shim} shim instance of shim - * @param {object} proto RedisClient prototype - */ -function registerSendCommand(shim, proto) { - shim.recordOperation(proto, 'send_command', function wrapSendCommand(shim, _, __, args) { - const [command, keys] = args - const parameters = getInstanceParameters(shim, this) - - parameters.key = stringifyKeys(shim, keys) - - return { - name: command || 'other', - parameters, - callback: function bindCallback(shim, _f, _n, segment) { - const last = args[args.length - 1] - if (shim.isFunction(last)) { - shim.bindCallbackSegment(args, shim.LAST, segment) - } else if (shim.isArray(last) && shim.isFunction(last[last.length - 1])) { - shim.bindCallbackSegment(last, shim.LAST, segment) - } - } - } - }) -} - -function stringifyKeys(shim, keys) { - let key = null - if (keys && keys.length && !shim.isFunction(keys)) { - try { - key = stringify(keys[0]) - } catch (err) { - shim.logger.debug(err, 'Failed to stringify redis key for send command') - key = '' - } - } - - return key -} - -/** - * Captures the necessary datastore parameters based on the specific version of redis - * - * @param {Shim} shim instance of shim - * @param {object} client instance of redis client - * @returns {object} datastore parameters - */ -function getInstanceParameters(shim, client) { - if (hasOwnProperty(client, 'connection_options')) { - // for redis 2.4.0 - 2.6.2 - return doCapture(client, client.connection_options) - } else if (hasOwnProperty(client, 'connectionOption')) { - // for redis 0.12 - 2.2.5 - return doCapture(client, client.connectionOption) - } else if (hasOwnProperty(client, 'options')) { - // for redis 2.3.0 - 2.3.1 - return doCapture(client, client.options) - } - shim.logger.debug('Could not access instance attributes on connection.') - return doCapture() -} - -/** - * Extracts the relevant datastore parameters - * - * @param {object} client instance of redis client - * @param {object} opts options for the client instance - * @returns {object} datastore parameters - */ -function doCapture(client = {}, opts = {}) { - return { - host: opts.host || 'localhost', - port_path_or_id: opts.path || opts.port || '6379', - database_name: client.selected_db || opts.db || 0 - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/restify.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/restify.js deleted file mode 100644 index 5cb8698c6..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/restify.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = function initialize(agent, restify, moduleName, shim) { - shim.setFramework(shim.RESTIFY) - shim.setRouteParser(function routeParser(shim, fn, fnName, route) { - return (route && route.path) || route - }) - let wrappedServerClass = false - - shim.setErrorPredicate(function restifyErrorPredicate(err) { - return err instanceof Error - }) - - // Restify extends the core http.ServerResponse object when it's loaded, - // so these methods are separate from core instrumentation. - const http = require('http') - const methods = ['send', 'sendRaw', 'redirect'] - - shim.wrap(http.ServerResponse.prototype, methods, function wrapMethod(shim, fn) { - return function wrappedMethod() { - const segment = shim.getActiveSegment() - - if (segment) { - // Freezing the name state prevents transaction names from potentially being - // manipulated by asynchronous response methods executed as part of res.send() - // but before `next()` is called. - segment.transaction.nameState.freeze() - } - - return fn.apply(this, arguments) - } - }) - - shim.wrapReturn(restify, 'createServer', wrapCreateServer) - function wrapCreateServer(shim, fn, fnName, server) { - // If we have not wrapped the server class, now's the time to do that. - if (server && !wrappedServerClass) { - wrappedServerClass = true - wrapServer(Object.getPrototypeOf(server)) - } - } - - function wrapServer(serverProto) { - // These are all the methods for mounting routed middleware. - const routings = ['del', 'get', 'head', 'opts', 'post', 'put', 'patch'] - shim.wrapMiddlewareMounter(serverProto, routings, { - route: shim.FIRST, - endpoint: shim.LAST, - wrapper: function wrapMiddleware(shim, middleware, name, route) { - if (shim.isWrapped(middleware)) { - return middleware - } - return shim.recordMiddleware(middleware, { - matchArity: true, - route, - req: shim.FIRST, - next: shim.LAST - }) - } - }) - - // These methods do not accept a route, just middleware functions. - const mounters = ['pre', 'use'] - shim.wrapMiddlewareMounter(serverProto, mounters, function wrapper(shim, middleware) { - if (shim.isWrapped(middleware)) { - return middleware - } - return shim.recordMiddleware(middleware, { - matchArity: true, - req: shim.FIRST, - next: shim.LAST - }) - }) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/undici.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/undici.js deleted file mode 100644 index d1026d8bb..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/undici.js +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2021 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const cat = require('../util/cat') -const recordExternal = require('../metrics/recorders/http_external') -const logger = require('../logger').child({ component: 'undici' }) -const NAMES = require('../metrics/names') -const NEWRELIC_SYNTHETICS_HEADER = 'x-newrelic-synthetics' -const symbols = require('../symbols') -const { executionAsyncResource } = require('async_hooks') -const tls = require('tls') -const net = require('net') - -let diagnosticsChannel = null -try { - diagnosticsChannel = require('diagnostics_channel') -} catch (e) { - // quick check to see if module exists - // module was not added until v15.x -} - -module.exports = function addUndiciChannels(agent, _undici, _modName, shim) { - if (!diagnosticsChannel || !agent.config.feature_flag.undici_instrumentation) { - logger.warn( - 'diagnostics_channel or feature_flag.undici_instrumentation = false. Skipping undici instrumentation.' - ) - return - } - - registerHookPoints(shim) -} - -/** - * Subscribes to all relevant undici hook points - * See: https://github.com/nodejs/undici/blob/main/docs/api/DiagnosticsChannel.md - * - * @param {Shim} shim instance of shim - */ -function registerHookPoints(shim) { - diagnosticsChannel.channel('undici:request:create').subscribe(requestCreateHook.bind(null, shim)) - diagnosticsChannel - .channel('undici:client:sendHeaders') - .subscribe(responseHeadersHook.bind(null, shim)) - diagnosticsChannel - .channel('undici:request:headers') - .subscribe(requestHeadersHook.bind(null, shim)) - diagnosticsChannel - .channel('undici:request:trailers') - .subscribe(endAndRestoreSegment.bind(null, shim)) - diagnosticsChannel - .channel('undici:request:error') - .subscribe(endAndRestoreSegment.bind(null, shim)) -} - -/** - * Retrieves the current segment in transaction(parent in our context) from executionAsyncResource - * or from `shim.getSegment()` then adds to the executionAsyncResource for future - * undici requests within same async context. - * - * It was found that when running concurrent undici requests - * within a transaction that the parent segment would get out of sync - * depending on the async context of the transaction. By using - * `async_hooks.executionResource` it is more reliable. - * - * Note: However, if you have concurrent undici requests in a transaction - * and the request to the transaction is using a keep alive there is a chance the - * executionAsyncResource may be incorrect because of shared connections. To revert to a more - * naive tracking of parent set `config.feature_flag.undici_async_tracking: false` and - * it will just call `shim.getSegment()` - * - * @param {Shim} shim instance of shim - * @returns {TraceSegment} parent segment - */ -function getParentSegment(shim) { - const { config } = shim.agent - if (config.feature_flag.undici_async_tracking) { - const resource = executionAsyncResource() - - if (!resource[symbols.parentSegment]) { - const parent = shim.getSegment() - resource[symbols.parentSegment] = parent - } - return resource[symbols.parentSegment] - } - return shim.getSegment() -} - -/** - * This event occurs after the Undici Request is created - * We will check current segment for opaque and also attach - * relevant headers to outgoing http request - * - * @param {Shim} shim instance of shim - * @param {object} params object from undici hook - * @param {object} params.request undici request object - */ -function requestCreateHook(shim, { request }) { - const { config } = shim.agent - const parent = getParentSegment(shim) - request[symbols.parentSegment] = parent - if (!parent || (parent && parent.opaque)) { - logger.trace( - 'Not capturing data for outbound request (%s) because parent segment opaque (%s)', - request.path, - parent && parent.name - ) - - return - } - - const transaction = parent.transaction - const outboundHeaders = Object.create(null) - if (config.encoding_key && transaction.syntheticsHeader) { - outboundHeaders[NEWRELIC_SYNTHETICS_HEADER] = transaction.syntheticsHeader - } - - if (config.distributed_tracing.enabled) { - transaction.insertDistributedTraceHeaders(outboundHeaders) - } else if (config.cross_application_tracer.enabled) { - cat.addCatHeaders(config, transaction, outboundHeaders) - } else { - logger.trace('Both DT and CAT are disabled, not adding headers!') - } - - // eslint-disable-next-line guard-for-in - for (const key in outboundHeaders) { - request.addHeader(key, outboundHeaders[key]) - } -} - -/** - * This event occurs right before the data is written to the socket. - * Undici has some abstracted headers that are only created at this time, one - * is the `host` header which we need to name the Undici segment. So in this - * handler we create, start and set the segment active, name it, and - * attach the url/procedure/request.parameters - * - * @param {Shim} shim instance of shim - * @param {object} params object from undici hook - * @param {object} params.request undici request object - * @param {tls.TLSSocket | net.Socket} params.socket active socket connection - */ -function responseHeadersHook(shim, { request, socket }) { - const parentSegment = request[symbols.parentSegment] - if (!parentSegment || (parentSegment && parentSegment.opaque)) { - return - } - - const port = socket.remotePort - const isHttps = socket.servername - let urlString - if (isHttps) { - urlString = `https://${socket.servername}` - urlString += port === 443 ? request.path : `:${port}${request.path}` - } else { - urlString = `http://${socket._host}` - urlString += port === 80 ? request.path : `:${port}${request.path}` - } - - const url = new URL(urlString) - - const name = NAMES.EXTERNAL.PREFIX + url.host + url.pathname - const segment = shim.createSegment(name, recordExternal(url.host, 'undici'), parentSegment) - if (segment) { - segment.start() - shim.setActiveSegment(segment) - segment.addAttribute('url', `${url.protocol}//${url.host}${url.pathname}`) - - url.searchParams.forEach((value, key) => { - segment.addSpanAttribute(`request.parameters.${key}`, value) - }) - segment.addAttribute('procedure', request.method || 'GET') - request[symbols.segment] = segment - } -} - -/** - * This event occurs after the response headers have been received. - * We will add the relevant http response attributes to active segment. - * Also add CAT specific keys to active segment. - * - * @param {Shim} shim instance of shim - * @param {object} params object from undici hook - * @param {object} params.request undici request object - * @param {object} params.response { statusCode, headers, statusText } - */ -function requestHeadersHook(shim, { request, response }) { - const { config } = shim.agent - const activeSegment = request[symbols.segment] - if (!activeSegment) { - return - } - - activeSegment.addSpanAttribute('http.statusCode', response.statusCode) - activeSegment.addSpanAttribute('http.statusText', response.statusText) - - if (config.cross_application_tracer.enabled && !config.distributed_tracing.enabled) { - try { - const { appData } = cat.extractCatHeaders(response.headers) - const decodedAppData = cat.parseAppData(config, appData) - const attrs = activeSegment.getAttributes() - const url = new URL(attrs.url) - cat.assignCatToSegment(decodedAppData, activeSegment, url.host) - } catch (err) { - logger.warn(err, 'Cannot add CAT data to segment') - } - } -} - -/** - * Gets the active and parent from given ctx(request, client connector) - * and ends active and restores parent to active. If an error exists - * it will add the error to the transaction - * - * @param {Shim} shim instance of shim - * @param {object} params object from undici hook - * @param {object} params.request or client connector - * @param {Error} params.error error from undici request - */ -function endAndRestoreSegment(shim, { request, error }) { - const activeSegment = request[symbols.segment] - const parentSegment = request[symbols.parentSegment] - if (activeSegment) { - activeSegment.end() - - if (error) { - handleError(shim, activeSegment, error) - } - - if (parentSegment) { - shim.setActiveSegment(parentSegment) - } - } -} - -/** - * Adds the error to the active transaction - * - * @param {Shim} shim instance of shim - * @param {TraceSegment} activeSegment active segment - * @param {Error} error error from undici request - */ -function handleError(shim, activeSegment, error) { - logger.trace(error, 'Captured outbound error on behalf of the user.') - const { transaction } = activeSegment - shim.agent.errors.add(transaction, error) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/constants.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/constants.js deleted file mode 100644 index cf87166d4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/constants.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const STATIC_PROMISE_METHODS = [ - 'reject', - 'resolve', - 'all', - 'any', - 'some', - 'map', - 'reduce', - 'filter', - 'reduceRight' -] - -const WHEN_SPEC = { - name: 'when', - // name of the property where the Promise constructor lives - constructor: 'Promise', - // wrap The Promise constructor - executor: true, - /** - * The mapping for Promise instance method concepts (i.e. `then`). These are - * mapped on the Promise class' prototype. - */ - $proto: { - then: ['then', 'done', 'spread', 'finally', 'ensure'], - catch: ['catch', 'otherwise'] - }, - /** - * The mapping for Promise static method concepts (i.e. `settle`, `race`). These - * are mapped on the Promise class itself. - */ - $static: { - cast: STATIC_PROMISE_METHODS, - $copy: STATIC_PROMISE_METHODS.concat([ - '_defer', - '_handler', - 'race', - '_traverse', - '_visitRemaining', - 'settle', - 'iterate', - 'unfold', - 'never' - ]), - $passThrough: [ - 'enterContext', - 'exitContext', - 'createContext', - 'onFatalRejection', - 'onPotentiallyUnhandledRejectionHandled', - 'onPotentiallyUnhandledRejection' - ] - }, - // The mapping for library-level static method concepts (i.e. `reject`, `resolve`). - $library: { - cast: STATIC_PROMISE_METHODS - } -} - -module.exports.WHEN_SPEC = WHEN_SPEC diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/contextualizer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/contextualizer.js deleted file mode 100644 index ed95351e1..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/contextualizer.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const symbols = require('../../symbols') - -function Context(segment) { - this.segments = [segment] -} - -Context.prototype = Object.create(null) - -Context.prototype.branch = function branch() { - return this.segments.push(null) - 1 -} - -function Contextualizer(idx, context) { - this.parentIdx = -1 - this.idx = idx - this.context = context - this.child = null -} - -module.exports = Contextualizer - -/** - * Manually bind the async context to every - * child within the promise chain - * - * @param {object} ctxlzr current promise - * @param {object} next the next link in promise chain - * @returns {void} - */ -function bindChild(ctxlzr, next) { - // If prev has one child already, branch the context and update the child. - if (ctxlzr.child) { - // When the branch-point is the 2nd through nth link in the chain, it is - // necessary to track its segment separately so the branches can parent - // their segments on the branch-point. - if (ctxlzr.parentIdx !== -1) { - ctxlzr.idx = ctxlzr.context.branch() - } - - // The first child needs to be updated to have its own branch as well. And - // each of that child's children must be updated with the new parent index. - // This is the only non-constant-time action for linking, but it only - // happens with branching promise chains specifically when the 2nd branch - // is added. - // - // Note: This does not account for branches of branches. That may result - // in improperly parented segments. - let parent = ctxlzr - let child = ctxlzr.child - const branchIdx = ctxlzr.context.branch() - do { - child.parentIdx = parent.idx - child.idx = branchIdx - parent = child - child = child.child - } while (child) - - // We set the child to something falsey that isn't `null` so we can - // distinguish between having no child, having one child, and having - // multiple children. - ctxlzr.child = false - } - - // If this is a branching link then create a new branch for the next promise. - // Otherwise, we can just piggy-back on the previous link's spot. - const idx = ctxlzr.child === false ? ctxlzr.context.branch() : ctxlzr.idx - - // Create a new context for this next promise. - next[symbols.context] = new Contextualizer(idx, ctxlzr.context) - next[symbols.context].parentIdx = ctxlzr.idx - - // If this was our first child, remember it in case we have a 2nd. - if (ctxlzr.child === null) { - ctxlzr.child = next[symbols.context] - } -} - -/** - * Binds segment to the entire promise chain - * - * @param {Function} prev previous function in chain - * @param {Function} next next function in chain - * @param {object} segment proper segment to bind - * @returns {void} - */ -Contextualizer.link = function link(prev, next, segment) { - let ctxlzr = prev && prev[symbols.context] - if (ctxlzr && !ctxlzr.isActive()) { - ctxlzr = prev[symbols.context] = null - } - - if (ctxlzr) { - bindChild(ctxlzr, next) - } else if (segment) { - // This next promise is the root of a chain. Either there was no previous - // promise or the promise was created out of context. - next[symbols.context] = new Contextualizer(0, new Context(segment)) - } -} - -Contextualizer.prototype = Object.create(null) - -/** - * Checks if segment is currently active - * - * @returns {boolean} if segment is active - */ -Contextualizer.prototype.isActive = function isActive() { - const segments = this.context.segments - const segment = segments[this.idx] || segments[this.parentIdx] || segments[0] - return segment && segment.transaction.isActive() -} - -/** - * Gets the segment at the appropriate index. - * If there is none it will get the segment at the parent index or the first one - * then assign to current index. - * - * @returns {object} segment by idx or parentIdx or the first one - */ -Contextualizer.prototype.getSegment = function getSegment() { - const segments = this.context.segments - let segment = segments[this.idx] - if (segment == null) { - segment = segments[this.idx] = segments[this.parentIdx] || segments[0] - } - return segment -} - -/** - * Sets the set to the appropriate index - * - * @param {object} segment segment to assign to index - * @returns {object} same segment passed in - */ -Contextualizer.prototype.setSegment = function setSegment(segment) { - return (this.context.segments[this.idx] = segment) -} - -/** - * Propagates the segment to the finally function - * - * @param {Function} prom current promise - * @returns {Function} current promise or wrapped finally that will propagate the segment - */ -Contextualizer.prototype.continue = function continueContext(prom) { - const self = this - const nextContext = prom[symbols.context] - if (!nextContext) { - return prom - } - - // If we have `finally`, use that to sneak our context update. - if (typeof prom.finally === 'function') { - return prom.finally(__NR_continueContext) - } - - // eslint-disable-next-line camelcase - function __NR_continueContext() { - self.setSegment(nextContext.getSegment()) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/index.js deleted file mode 100644 index 9b7706898..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/index.js +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const util = require('util') -const properties = require('../../util/properties') -const shimmer = require('../../shimmer') -const symbols = require('../../symbols') -const ANONYMOUS = '' -const { WHEN_SPEC } = require('./constants') -const Contextualizer = require('./contextualizer') - -/** - * Instruments when.js - * - * @param {Shim} shim instance of shim - * @param {Function} when the exported when.js library. - */ -module.exports = function initialize(shim, when) { - const agent = shim.agent - const contextManager = agent._contextManager - const spec = WHEN_SPEC - - // Wrap library-level methods. - wrapStaticMethods(when, spec.name, spec.$library) - - // Wrap prototype methods. - const Promise = when[spec.constructor] - wrapPrototype(Promise.prototype) - wrapStaticMethods(Promise, spec.constructor, spec.$static) - - // See if we are wrapping the class itself. - shimmer.wrapMethod(when, spec.name, spec.constructor, wrapPromise) - - /** - * Wraps every method of when.js and also defines properties on - * the $passThrough methods. - * - * @returns {Function} our wrapped promise - */ - function wrapPromise() { - spec.$static.$copy.forEach(function copyKeys(key) { - if (!wrappedPromise[key]) { - wrappedPromise[key] = Promise[key] - } - }) - - spec.$static.$passThrough.forEach(function assignProxy(proxyProp) { - if (!properties.hasOwn(wrappedPromise, proxyProp)) { - Object.defineProperty(wrappedPromise, proxyProp, { - enumerable: true, - configurable: true, - get: function getOriginal() { - return Promise[proxyProp] - }, - set: function setOriginal(newValue) { - Promise[proxyProp] = newValue - } - }) - } - }) - - // Inherit to pass `instanceof` checks. - util.inherits(wrappedPromise, Promise) - - // Make the wrapper. - return wrappedPromise - } - - /** - * Wraps the promise handler and binds to the - * agent async context manager - * - * @param {Function} executor promise handler - * @returns {Function} wrapped handler - */ - function wrappedPromise(executor) { - if (!(this instanceof wrappedPromise)) { - return Promise(executor) // eslint-disable-line new-cap - } - - const parent = contextManager.getContext() - let promise = null - if ( - !parent || - !parent.transaction.isActive() || - typeof executor !== 'function' || - arguments.length !== 1 - ) { - // We are expecting one function argument for executor, anything else is - // non-standard, do not attempt to wrap. Also do not attempt to wrap if we - // are not in a transaction. - const cnstrctArgs = agent.tracer.slice(arguments) - cnstrctArgs.unshift(Promise) // `unshift` === `push_front` - promise = new (Promise.bind.apply(Promise, cnstrctArgs))() - } else { - const segmentName = 'Promise ' + (executor.name || ANONYMOUS) - const context = { - promise: null, - self: null, - args: null - } - promise = new Promise(wrapExecutorContext(context)) - context.promise = promise - const segment = _createSegment(segmentName) - Contextualizer.link(null, promise, segment) - - segment.start() - try { - // Must run after promise is defined so that `__NR_wrapper` can be set. - contextManager.runInContext(segment, executor, context.self, context.args) - } catch (e) { - context.args[1](e) - } finally { - segment.touch() - } - } - - // The Promise must be created using the "real" Promise constructor (using - // normal Promise.apply(this) method does not work). But the prototype - // chain must include the wrappedPromise.prototype, V8's promise - // implementation uses promise.constructor to create new Promises for - // calls to `then`, `chain` and `catch` which allows these Promises to - // also be instrumented. - promise.__proto__ = wrappedPromise.prototype // eslint-disable-line no-proto - - return promise - } - - /** - * Wraps then and catch on the when.js prototype - * - * @param {Function} PromiseProto when.js prototype - * @returns {void} - */ - function wrapPrototype(PromiseProto) { - const name = spec.constructor + '.prototype' - - // Wrap up instance methods. - _safeWrap(PromiseProto, name, spec.$proto.then, wrapThen) - _safeWrap(PromiseProto, name, spec.$proto.catch, wrapCatch) - } - - /** - * Wraps all the static methods on when.js - * See: constants.STATIC_PROMISE_METHODS - * - * @param {Function} lib when.Promise - * @param {string} name `Promise` - * @param {object} staticSpec see WHEN_SPEC.$static - * @returns {void} - */ - function wrapStaticMethods(lib, name, staticSpec) { - _safeWrap(lib, name, staticSpec.cast, wrapCast) - } - - /** - * Creates a function which will export the context and arguments of its - * execution. - * - * @param {object} context - The object to export the execution context with. - * @returns {Function} A function which, when executed, will add its context - * and arguments to the `context` parameter. - */ - function wrapExecutorContext(context) { - return function contextExporter(resolve, reject) { - context.self = this - context.args = [].slice.call(arguments) - context.args[0] = wrapResolver(context, resolve) - context.args[1] = wrapResolver(context, reject) - } - } - - /** - * Wraps the resolve/reject functions of a when.js Promise - * - * @param {object} context object to update execution context - * @param {Function} fn function reference `resolve` or `rejct` - * @returns {Function} wrapped function - */ - function wrapResolver(context, fn) { - return function wrappedResolveReject(val) { - const promise = context.promise - if (promise && promise[symbols.context]) { - promise[symbols.context].getSegment().touch() - } - fn(val) - } - } - - /** - * Creates a wrapper for `Promise#then` that extends the transaction context. - * - * @param {Function} then function reference to instrument - * @param {string} name `then` - * @returns {Function} A wrapped version of `Promise#then`. - */ - function wrapThen(then, name) { - return _wrapThen(then, name, true) - } - - /** - * Creates a wrapper for `Promise#catch` that extends the transaction context. - * - * @param {Function} catchMethod function reference to instrument - * @param {string} name `catch` - * @returns {Function} A wrapped version of `Promise#catch`. - */ - function wrapCatch(catchMethod, name) { - return _wrapThen(catchMethod, name, false) - } - - /** - * Creates a wrapper for promise chain extending methods. - * - * @param {Function} then - * The function we are to wrap as a chain extender. - * @param {string} name name of function being wrapped - * @param {boolean} useAllParams - * When true, all parameters which are functions will be wrapped. Otherwise, - * only the last parameter will be wrapped. - * @returns {Function} A wrapped version of the function. - */ - function _wrapThen(then, name, useAllParams) { - // Don't wrap non-functions. - if (typeof then !== 'function' || then.name === '__NR_wrappedThen') { - return then - } - - // eslint-disable-next-line camelcase - return function __NR_wrappedThen() { - if (!(this instanceof Promise)) { - return then.apply(this, arguments) - } - - const segmentNamePrefix = 'Promise#' + name + ' ' - const thenSegment = agent.tracer.getSegment() - const promise = this - const ctx = { next: undefined, useAllParams, isWrapped: false, segmentNamePrefix } - - // Wrap up the arguments and execute the real then. - const args = [].map.call(arguments, wrapHandler.bind(this, ctx)) - ctx.next = then.apply(this, args) - - // If we got a promise (which we should have), link the parent's context. - if (!ctx.isWrapped && ctx.next instanceof Promise && ctx.next !== promise) { - Contextualizer.link(promise, ctx.next, thenSegment) - } - return ctx.next - } - } - - /** - * Wraps every function passed to .then - * - * @param {object} ctx context to pass data from caller to callee and back - * @param {Function} fn function reference - * @param {number} i position of function in .then handler - * @param {Array} arr all args passed to .then - * @returns {Function} wraps every function pass to then - */ - function wrapHandler(ctx, fn, i, arr) { - if ( - typeof fn !== 'function' || // Not a function - fn.name === '__NR_wrappedThenHandler' || // Already wrapped - (!ctx.useAllParams && i !== arr.length - 1) // Don't want all and not last - ) { - ctx.isWrapped = fn && fn.name === '__NR_wrappedThenHandler' - return fn - } - - // eslint-disable-next-line camelcase - return function __NR_wrappedThenHandler() { - if (!ctx.next || !ctx.next[symbols.context]) { - return fn.apply(this, arguments) - } - - let promSegment = ctx.next[symbols.context].getSegment() - const segmentName = ctx.segmentNamePrefix + (fn.name || ANONYMOUS) - const segment = _createSegment(segmentName, promSegment) - if (segment && segment !== promSegment) { - ctx.next[symbols.context].setSegment(segment) - promSegment = segment - } - - let ret = null - try { - ret = agent.tracer.bindFunction(fn, promSegment, true).apply(this, arguments) - } finally { - if (ret && typeof ret.then === 'function') { - ret = ctx.next[symbols.context].continue(ret) - } - } - return ret - } - } - - /** - * Creates a wrapper around the static `Promise` factory method. - * - * @param {Function} cast reference of function to wrap - * @param {string} name name of the function being wrapped - * @returns {Function} wrapped function - */ - function wrapCast(cast, name) { - if (typeof cast !== 'function' || cast.name === '__NR_wrappedCast') { - return cast - } - - const CAST_SEGMENT_NAME = 'Promise.' + name - // eslint-disable-next-line camelcase - return function __NR_wrappedCast() { - const segment = _createSegment(CAST_SEGMENT_NAME) - const prom = cast.apply(this, arguments) - if (segment) { - Contextualizer.link(null, prom, segment) - } - return prom - } - } - - /** - * Creates a segment for a given handler in promise chain - * if `config.feature_flag.promise_segments` is true - * Otherwise it just returns the current if existing or gets the current - * - * @param {string} name name of segment to create - * @param {object} parent current parent segment - * @returns {object} segment - */ - function _createSegment(name, parent) { - return agent.config.feature_flag.promise_segments === true - ? agent.tracer.createSegment(name, null, parent) - : parent || agent.tracer.getSegment() - } -} - -/** - * Performs a `wrapMethod` if and only if `methods` is truthy and has a length - * greater than zero. - * - * @param {object} obj - The source of the methods to wrap. - * @param {string} name - The name of this source. - * @param {string | Array} methods - The names of the methods to wrap. - * @param {Function} wrapper - The function which wraps the methods. - */ -function _safeWrap(obj, name, methods, wrapper) { - if (methods && methods.length) { - shimmer.wrapMethod(obj, name, methods, wrapper) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/nr-hooks.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/nr-hooks.js deleted file mode 100644 index da00bf2f9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/when/nr-hooks.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const instrumentation = require('./index') - -module.exports = [ - { - type: null, - moduleName: 'when', - onRequire: instrumentation - } -] diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/winston.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/winston.js deleted file mode 100644 index 887a66a55..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentation/winston.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Stream = require('stream') -const { - isApplicationLoggingEnabled, - isLogForwardingEnabled, - isLocalDecoratingEnabled, - isMetricsEnabled, - createModuleUsageMetric, - incrementLoggingLinesMetrics -} = require('../util/application-logging') - -const logger = require('../logger').child({ component: 'winston' }) -const NrTransport = require('./nr-winston-transport') - -module.exports = function instrument(agent, winston, _, shim) { - const config = agent.config - - if (!isApplicationLoggingEnabled(config)) { - logger.debug('Application logging not enabled. Not instrumenting winston.') - return - } - - shim.wrap(winston, 'createLogger', function wrapCreate(shim, createLogger) { - return function wrappedCreateLogger() { - const args = shim.argsToArray.apply(shim, arguments) - const opts = args[0] || {} - if (isStream(opts)) { - return createLogger.apply(this, args) - } - return performInstrumentation({ - obj: this, - args, - opts, - agent, - winston, - registerLogger: createLogger - }) - } - }) - - shim.wrap(winston.loggers, 'add', function wrapAdd(shim, add) { - return function wrappedAdd() { - const args = shim.argsToArray.apply(shim, arguments) - const id = args[0] - const opts = args[1] || {} - // add does nothing if the logger has already been added, so we - // have to do the same nothingness here. - const alreadyAdded = this.loggers.has(id) - if (alreadyAdded || isStream(opts)) { - return add.apply(this, args) - } - return performInstrumentation({ - obj: this, - args, - opts, - agent, - winston, - registerLogger: add - }) - } - }) -} - -function performInstrumentation({ obj, args, opts, agent, winston, registerLogger }) { - const config = agent.config - - createModuleUsageMetric('winston', agent.metrics) - - if (isLocalDecoratingEnabled(config) || isMetricsEnabled(config)) { - registerFormatter({ opts, agent, winston }) - } - - const winstonLogger = registerLogger.apply(obj, args) - - if (isLogForwardingEnabled(config, agent)) { - winstonLogger.add(new NrTransport({ agent })) - } - - return winstonLogger -} - -/** - * Apply a formatter to keep track of logging metrics, and in the case of local decorating appending - * the NR-LINKING metadata to message. We want to do this first so any formatter that is transforming - * data will have the changes. - * - * @param {object} params object passed to function - * @param {object} params.opts options from winston.createLogger - * @param {object} params.agent NR agent - * @param {object} params.winston exported winston package - */ -function registerFormatter({ opts, agent, winston }) { - const instrumentedFormatter = nrWinstonFormatter(agent, winston) - - if (opts.format) { - opts.format = winston.format.combine(instrumentedFormatter(), opts.format) - } else { - opts.format = instrumentedFormatter() - } -} - -/** - * This formatter is being used to facilitate - * the two application logging use cases: metrics and local log decorating. - * - * Local log decorating appends `NR-LINKING` piped metadata to - * the message key in log line. You must configure a log forwarder to get - * this data to NR1. - * - * @param {object} agent NR agent - * @param {object} winston exported winston package - * @returns {object} log line NR-LINKING metadata on message when local log decorating is enabled - */ -function nrWinstonFormatter(agent, winston) { - const config = agent.config - const metrics = agent.metrics - - return winston.format((logLine) => { - if (isMetricsEnabled(config)) { - incrementLoggingLinesMetrics(logLine.level, metrics) - } - - if (isLocalDecoratingEnabled(config)) { - logLine.message += agent.getNRLinkingMetadata() - } - - return logLine - }) -} - -/** - * winston allows you to compose a logger - * from an instantiated logger. Through a series - * of inherited classes, this logger instance is a Stream. - * Check what gets passed into `winston.createLogger` to avoid - * instrumenting an already instrumented instance of a logger. - * - * @param {*} obj obj to check if a stream - * @returns {boolean} is object is a stream or not - */ -function isStream(obj) { - return obj instanceof Stream -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentations.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentations.js deleted file mode 100644 index a9b46811d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/instrumentations.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const MODULE_TYPE = require('./shim/constants').MODULE_TYPE - -// Return a new copy of this array every time we're called -module.exports = function instrumentations() { - return { - 'aws-sdk': { module: '@newrelic/aws-sdk' }, - 'amqplib': { type: MODULE_TYPE.MESSAGE }, - 'cassandra-driver': { type: MODULE_TYPE.DATASTORE }, - 'connect': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'bluebird': { type: MODULE_TYPE.PROMISE }, - 'bunyan': { type: MODULE_TYPE.GENERIC }, - 'director': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'express': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'fastify': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'generic-pool': { type: MODULE_TYPE.GENERIC }, - '@grpc/grpc-js': { module: './instrumentation/grpc-js' }, - '@hapi/hapi': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'ioredis': { type: MODULE_TYPE.DATASTORE }, - 'koa': { module: '@newrelic/koa' }, - 'memcached': { type: MODULE_TYPE.DATASTORE }, - 'mongodb': { type: MODULE_TYPE.DATASTORE }, - 'mysql': { module: './instrumentation/mysql' }, - '@nestjs/core': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'pino': { module: './instrumentation/pino' }, - 'pg': { type: MODULE_TYPE.DATASTORE }, - 'q': { type: null }, - 'redis': { type: MODULE_TYPE.DATASTORE }, - '@node-redis/client': { type: MODULE_TYPE.DATASTORE }, - '@redis/client': { type: MODULE_TYPE.DATASTORE }, - 'restify': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'superagent': { module: '@newrelic/superagent' }, - 'undici': { type: MODULE_TYPE.TRANSACTION }, - '@hapi/vision': { type: MODULE_TYPE.WEB_FRAMEWORK }, - 'when': { module: './instrumentation/when' }, - 'winston': { type: MODULE_TYPE.GENERIC }, - /** - * The modules below are listed here purely to take - * advantage of the Supportability/Features/onRequire/ - * metrics for libraries we want to track for some reason or another. - * The big uses cases are: - * Logging libraries we want to instrument in the future - * Libraries that have OpenTelemetry instrumentation we want to register - * or have already registered. - */ - 'loglevel': { type: MODULE_TYPE.TRACKING }, - 'npmlog': { type: MODULE_TYPE.TRACKING }, - 'fancy-log': { type: MODULE_TYPE.TRACKING }, - '@prisma/client': { type: MODULE_TYPE.DATASTORE }, - 'knex': { type: MODULE_TYPE.TRACKING } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/logger.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/logger.js deleted file mode 100644 index 8f1048971..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/logger.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Logger = require('./util/logger') -const fs = require('./util/unwrapped-core').fs - -// create bootstrapping logger -const logger = new Logger({ - name: 'newrelic_bootstrap', - level: 'info', - - // logger is configured below. Logs are queued until configured - configured: false -}) - -module.exports = logger - -/** - * Don't load config until this point, because it requires this - * module, and if it gets loaded too early, module.exports will have no - * value. - */ -const config = require('./config').getOrCreateInstance() -if (config) { - const options = { - name: 'newrelic', - level: config.logging.level, - enabled: config.logging.enabled - } - - // configure logger - logger.configure(options) - - if (config.logging.enabled) { - let stream - switch (config.logging.filepath) { - case 'stdout': - stream = process.stdout - break - - case 'stderr': - stream = process.stderr - break - - default: - stream = fs.createWriteStream(config.logging.filepath, { flags: 'a+' }) - stream.on('error', function logStreamOnError(err) { - /* eslint-disable no-console */ - // Since our normal logging didn't work, dump this to stderr. - console.error('New Relic failed to open log file ' + config.logging.filepath) - console.error(err) - /* eslint-enable no-console */ - }) - } - logger.pipe(stream) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/index.js deleted file mode 100644 index b44c932aa..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/index.js +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Stats = require('../stats') -const ApdexStats = require('../stats/apdex.js') -const NAMES = require('./names') - -/* - * - * CONSTANTS - * - */ -const FROM_MILLIS = 1e-3 - -/** - * A metric is a set of aggregated data (summary statistics) associated with a - * metric name. Some metrics belong to scopes, which are typically the name of - * a transaction or a background task. This class is a collection of mappings - * from names (or scopes and names) to data, as well as functions for - * manipulating those data directly. It also can produce a serialized - * representation suitable for stringifying into JSON and sending to the - * collector. - * - * There are several metrics collections in existence at any given time. Each - * agent has one metrics collection, which is created at the beginning of each - * harvest cycle. Each new transaction also gets its own metrics collection, - * which is merged into the agent's metrics when the transaction is finalized. - * This allows each set of metrics to be added to the harvest cycle atomically, - * which guarantees that each transaction will not have its metrics split - * across multiple harvest cycles. If delivery to the collector fails, the - * metrics collection associated with the failed delivery can be merged back - * into the metrics collection for the ongoing harvest cycle. - * - * Metrics can be remapped, which is a process by which they are assigned a - * short, numerical ID by New Relic. This can shrink the serialized JSON - * considerably. The mapping from transaction name (and scope) happens only - * at serialization time, which allows the mappings from name to ID to happen - * on the fly. - * - * @param {number} apdexT The apdex-tolerating value, for use in creating apdex - * statistics. - * @param {MetricMapper} mapper The mapper that turns metric names into IDs. - * @param normalizer - */ -function Metrics(apdexT, mapper, normalizer) { - if (apdexT == null || apdexT === '') { - throw new Error('metrics must be created with apdexT') - } - if (!mapper) { - throw new Error('metrics must be created with a mapper') - } - if (!normalizer) { - throw new Error('metrics must be created with a name normalizer') - } - - this.empty = true - this.started = Date.now() - this.apdexT = apdexT - this.mapper = mapper - this.normalizer = normalizer - this.unscoped = Object.create(null) // {name : stats} - this.scoped = Object.create(null) // {scope : {name : stats}} -} - -/** - * This is the preferred way for interacting with metrics. Set the duration - * (and optionally the amount of that duration that was exclusive to that - * particular metric and not any child operations to that metric) of an - * operation. If there are no data for the name (and optional scope) existing, - * the collection will create a set of data before recording the measurement. - * - * @param {string} name The name of the metric. - * @param {string} scope (Optional) The scope to which the metric belongs. - * @param {number} duration The duration of the related operation, in milliseconds. - * @param {number} exclusive (Optional) The portion of the operation specific to this - * metric. - * @returns {Stats} The aggregated data related to this metric. - */ -Metrics.prototype.measureMilliseconds = measureMilliseconds - -function measureMilliseconds(name, scope, duration, exclusive) { - const stats = this.getOrCreateMetric(name, scope) - stats.recordValueInMillis(duration, exclusive) - return stats -} - -/** - * Set the size of an operation. If there are no data for the name existing, - * the collection will create a set of data before recording the measurement. - * - * @param {string} name The name of the metric. - * @param {number} size The size of the related operation, in bytes. - * @param {number} exclusiveSize The exclusive size of the related operation, in megabytes. - * @param {boolean} exact If true, size is interpreted as bytes rather than megabytes - * @returns {Stats} The aggregated data related to this metric. - */ -Metrics.prototype.measureBytes = function measureBytes(name, size, exclusiveSize, exact) { - const stats = this.getOrCreateMetric(name) - stats.recordValueInBytes(size, exclusiveSize, exact) - return stats -} - -/** - * Look up the mapping from a name (and optionally a scope) to a set of metric - * data for that name, creating the data if they don't already exist. - * - * @param {string} name The name of the requested metric. - * @param {string} scope (Optional) The scope to which the metric is bound. - * @returns {Stats} The aggregated data for that name. - */ -Metrics.prototype.getOrCreateMetric = function getOrCreateMetric(name, scope) { - const resolved = this._resolve(scope) - let stats = resolved[name] - if (!stats) { - this.empty = false - stats = resolved[name] = new Stats() - } - return stats -} - -/** - * Look up the mapping from a name (and optionally a scope) to a set of metric - * apdex data for that name, creating the data if they don't already exist. - * - * @param {string} name The name of the requested metric. - * @param {string} scope The scope to which the metric is bound - * (optional). - * @param {number} overrideApdex A custom apdexT for this metric, in - * milliseconds. This will be the same for - * a given run, because key transaction metrics - * are set at connect time via server-side - * configuration. - * @returns {ApdexStats} The aggregated data for that name. - */ -Metrics.prototype.getOrCreateApdexMetric = getOrCreateApdexMetric - -function getOrCreateApdexMetric(name, scope, overrideApdex) { - if (!name) { - throw new Error('Metrics must be named') - } - - const resolved = this._resolve(scope) - - if (!resolved[name]) { - this.empty = false - - // Only use the given override to create the metric if this is not the - // global apdex AND we have a valid value. - const apdexT = - name !== NAMES.APDEX && overrideApdex > 0 ? overrideApdex * FROM_MILLIS : this.apdexT - resolved[name] = new ApdexStats(apdexT) - } - return resolved[name] -} - -/** - * Look up a metric, and don't create it if it doesn't exist. Can create scopes - * as a byproduct, but this function is only intended for use in testing, so - * it's not a big deal. - * - * @param {string} name Metric name. - * @param {string} scope (Optional) The scope, if any, to which the metric - * belongs. - * @returns {object} Either a stats aggregate, an apdex stats aggregate, or - * undefined. - */ -Metrics.prototype.getMetric = function getMetric(name, scope) { - if (!name) { - throw new Error('Metrics must be named') - } - - return this._resolve(scope)[name] -} - -/** - * Convert this collection into a representation suitable for serialization - * by JSON.stringify and delivery to the collector. Hope you like nested - * arrays! - * - * @returns {object} Set of nested arrays containing metric information. - */ -Metrics.prototype.toJSON = function toJSON() { - return this._toUnscopedData().concat(this._toScopedData()) -} - -/** - * Combine two sets of metric data. Intended to be used as described above, - * either when folding a transaction's metrics into the agent's metrics for - * later harvest, or one harvest cycle's metrics into the next when a - * delivery attempt to the collector fails. Among the more performance- - * critical pieces of code in the agent, so some performance tuning would - * probably be a good idea. - * - * @param {Metrics} other - * The collection to be folded into this one. - * @param {boolean} adjustStartTime - * If the start time for the timeslice should be adjusted. - */ -Metrics.prototype.merge = function merge(other, adjustStartTime) { - this.empty = this.empty && other.empty - if (adjustStartTime) { - this.started = Math.min(this.started, other.started) - } - _merge(this.unscoped, other.unscoped) - - // Loop through all scopes and merge them. Since we know `.scoped` has a `null` - // prototype we don't need to worry about own property checks. - // eslint-disable-next-line guard-for-in - for (const scope in other.scoped) { - _merge(this._resolve(scope), other.scoped[scope]) - } -} -function _merge(a, b) { - for (const name in b) { - if (a[name]) { - a[name].merge(b[name]) - } else { - a[name] = b[name] - } - } -} - -/** - * Look up the metric namespace belonging to a scope, creating it if it doesn't - * already exist. - * - * @param {string} scope (Optional) The scope to look up. - * @returns {object} The namespace associated with the provided scope, or the - * un-scoped metrics if the scope isn't set. - */ -Metrics.prototype._resolve = function _resolve(scope) { - let resolved = this.unscoped - - if (scope) { - resolved = this.scoped[scope] - if (!resolved) { - resolved = this.scoped[scope] = Object.create(null) - } - } - - return resolved -} - -/** - * Map a metric to its nested-array representation, applying any name -> ID - * mappings along the way. Split from _getScopedData for performance. - * - * @param {string} name The string to look up. - */ -Metrics.prototype._getUnscopedData = function _getUnscopedData(name) { - if (!this.unscoped[name]) { - return - } - - const normalized = this.normalizer.normalize(name) - if (normalized.ignore || !normalized.value) { - return - } - - return [this.mapper.map(normalized.value), this.unscoped[name]] -} - -/** - * Map a metric to its nested-array representation, applying any name -> ID - * mappings along the way. Split from _getUnscopedData for performance. - * - * @param {string} name The string to look up. - * @param scope - */ -Metrics.prototype._getScopedData = function _getScopedData(name, scope) { - if (!this.scoped[scope][name]) { - return - } - - const normalized = this.normalizer.normalize(name) - if (normalized.ignore || !normalized.value) { - return - } - - return [this.mapper.map(normalized.value, scope), this.scoped[scope][name]] -} - -/** - * @returns {object} A serializable version of the unscoped metrics. Intended - * for use by toJSON. - */ -Metrics.prototype._toUnscopedData = function _toUnscopedData() { - const metricData = [] - - Object.keys(this.unscoped).forEach((name) => { - const data = this._getUnscopedData(name) - if (data) { - metricData.push(data) - } - }) - - return metricData -} - -/** - * @returns {object} A serializable version of the scoped metrics. Intended for - * use by toJSON. - */ -Metrics.prototype._toScopedData = function _toScopedData() { - const metricData = [] - - Object.keys(this.scoped).forEach(function forEachScope(scope) { - Object.keys(this.scoped[scope]).forEach(function forEachMetric(name) { - const data = this._getScopedData(name, scope) - if (data) { - metricData.push(data) - } - }, this) - }, this) - - return metricData -} - -module.exports = Metrics diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/mapper.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/mapper.js deleted file mode 100644 index 788b881d9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/mapper.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'mapper' }) - -/** - * To tighten up the metrics JSON, the collector will maintain a list of - * mappings from metric names (which sometimes include scopes as well) to - * numeric IDs. As the agent sends new metric names to the collector, the - * collector will return corresponding metric IDs, in the expectation that the - * agent will uses those IDs instead of the names going forward. - * - * @param {Array} raw A list of metric spec -> ID mappings represented as - * 2-element arrays: [{name : 'Metric', scope : 'Scope'}, 1] - */ -function MetricMapper(raw) { - this.unscoped = Object.create(null) - this.scoped = Object.create(null) - this.length = 0 - - this.load(raw) -} - -/** - * Parse the list of metric mappings returned on metric_data responses from the - * collector. These continue to stream in as the agent runs, so keep adding to - * the collection rather than resetting. - * - * https://hudson.newrelic.com/job/collector-master/javadoc/com/nr/collector/datatypes/MetricData.html - * - * @param {Array} raw A list of metric spec -> ID mappings represented as - * 2-element arrays: [{name : 'Metric', scope : 'Scope'}, 1] - */ -MetricMapper.prototype.load = function load(raw) { - if (!(raw && raw.length)) { - logger.debug('No new metric mappings from server.') - return - } - - for (let i = 0; i < raw.length; i++) { - const spec = raw[i][0] - const scope = spec.scope - const name = spec.name - const id = raw[i][1] - let resolved - - if (scope) { - if (!this.scoped[scope]) { - this.scoped[scope] = Object.create(null) - } - resolved = this.scoped[scope] - } else { - resolved = this.unscoped - } - - if (!resolved[name]) { - this.length++ - } - resolved[name] = id - logger.trace('Metric spec %s has been mapped to ID %s.', spec, id) - } - logger.debug('Parsed %d metric ids (%d total).', raw.length, this.length) -} - -/** - * @param {string} name The metric name. - * @param {string} scope The scope for the metric, if set. - * @returns {object} Either a metric spec based on the parameters, or the - * server-sent ID. - */ -MetricMapper.prototype.map = function map(name, scope) { - if (scope) { - if (this.scoped[scope] && this.scoped[scope][name]) { - return this.scoped[scope][name] - } - return { name: name, scope: scope } - } - - if (this.unscoped[name]) { - return this.unscoped[name] - } - - return { name: name } -} - -module.exports = MetricMapper diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/metric-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/metric-aggregator.js deleted file mode 100644 index 1278277e9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/metric-aggregator.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'metric-aggregator' }) -const Aggregator = require('../aggregators/base-aggregator') -const Metrics = require('../metrics') - -const FROM_MILLIS = 1e-3 - -class MetricAggregator extends Aggregator { - constructor(opts, collector) { - _isValidOrThrow(opts) - - opts.method = opts.method || 'metric_data' - - super(opts, collector) - - this._apdexT = opts.apdexT - this._mapper = opts.mapper - this._normalizer = opts.normalizer - - this._metrics = new Metrics(this._apdexT, this._mapper, this._normalizer) - } - - get empty() { - return this._metrics.empty - } - - get started() { - return this._metrics.started - } - - _toPayloadSync() { - if (this._metrics.empty) { - logger.debug('No metrics to send.') - return - } - - const beginSeconds = this._metrics.started * FROM_MILLIS - const endSeconds = Date.now() * FROM_MILLIS - - return [this.runId, beginSeconds, endSeconds, this._metrics.toJSON()] - } - - _getMergeData() { - return this._metrics - } - - _merge(metrics) { - if (!metrics) { - return - } - - // Adjust start when merging due to server round-trip - this.merge(metrics, true) - } - - merge(metrics, adjustStartTime) { - this._metrics.merge(metrics, adjustStartTime) - } - - clear() { - this._metrics = new Metrics(this._apdexT, this._mapper, this._normalizer) - } - - /** - * Look up the mapping from a name (and optionally a scope) to a set of metric - * data for that name, creating the data if they don't already exist. - * - * @param {string} name The name of the requested metric. - * @param {string} scope (Optional) The scope to which the metric is bound. - * @returns {Stats} The aggregated data for that name. - */ - getOrCreateMetric(name, scope) { - return this._metrics.getOrCreateMetric(name, scope) - } - - /** - * This is the preferred way for interacting with metrics. Set the duration - * (and optionally the amount of that duration that was exclusive to that - * particular metric and not any child operations to that metric) of an - * operation. If there are no data for the name (and optional scope) existing, - * the collection will create a set of data before recording the measurement. - * - * @param {string} name The name of the metric. - * @param {string} scope (Optional) The scope to which the metric belongs. - * @param {number} duration The duration of the related operation, in milliseconds. - * @param {number} exclusive (Optional) The portion of the operation specific to this - * metric. - * @returns {Stats} The aggregated data related to this metric. - */ - measureMilliseconds(name, scope, duration, exclusive) { - return this._metrics.measureMilliseconds(name, scope, duration, exclusive) - } - - /** - * Set the size of an operation. If there are no data for the name existing, - * the collection will create a set of data before recording the measurement. - * If data do exist for the given name, the value will be incremented by the - * given size. Use `exclusiveSize` to set the size of this specific operation, - * if it is different from the overall size of the operation. - * - * @param {string} name The name of the metric. - * @param {number} size The size of the related operation, in megabytes. - * @param {number} exclusiveSize The exclusive size of the related operation, in megabytes. - * @param {boolean} exact If true, size is interpreted as bytes rather than megabytes - * @returns {Stats} The aggregated data related to this metric. - */ - measureBytes(name, size, exclusiveSize, exact) { - return this._metrics.measureBytes(name, size, exclusiveSize, exact) - } - - /** - * Look up a metric, and don't create it if it doesn't exist. Can create scopes - * as a byproduct, but this function is only intended for use in testing, so - * it's not a big deal. - * - * @param {string} name Metric name. - * @param {string} scope (Optional) The scope, if any, to which the metric - * belongs. - * @returns {object} Either a stats aggregate, an apdex stats aggregate, or - * undefined. - */ - getMetric(name, scope) { - return this._metrics.getMetric(name, scope) - } - - /** - * Look up the mapping from a name (and optionally a scope) to a set of metric - * apdex data for that name, creating the data if they don't already exist. - * - * @param {string} name The name of the requested metric. - * @param {string} scope The scope to which the metric is bound - * (optional). - * @param {number} overrideApdex A custom apdexT for this metric, in - * milliseconds. This will be the same for - * a given run, because key transaction metrics - * are set at connect time via server-side - * configuration. - * @returns {ApdexStats} The aggregated data for that name. - */ - getOrCreateApdexMetric(name, scope, overrideApdex) { - return this._metrics.getOrCreateApdexMetric(name, scope, overrideApdex) - } - - reconfigure(config) { - super.reconfigure(config) - - this._apdexT = config.apdex_t - this._metrics.apdexT = this._apdexT - } -} - -function _isValidOrThrow(opts) { - if (!opts) { - throw new Error('Metric aggregator must be created with options.') - } - - if (opts.apdexT == null || opts.apdexT === '') { - throw new Error('Metric aggregator must be created with apdexT') - } - - if (!opts.mapper) { - throw new Error('Metric aggregator must be created with a mapper') - } - - if (!opts.normalizer) { - throw new Error('Metric aggregator must be created with a name normalizer') - } -} - -module.exports = MetricAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/names.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/names.js deleted file mode 100644 index c43ab4e3e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/names.js +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NODEJS = { - PREFIX: 'Nodejs/' -} - -const ALL = 'all' -const POSTGRES_LITERAL = 'Postgres' -const CASSANDRA_LITERAL = 'Cassandra' -const PRISMA_LITERAL = 'Prisma' -const EXPRESS_LITERAL = 'Expressjs' -const OTHER_TRANSACTION_MESSAGE = 'OtherTransaction/Message' - -const SUPPORTABILITY = { - PREFIX: 'Supportability/', - UNINSTRUMENTED: 'Supportability/Uninstrumented', - EVENTS: 'Supportability/Events', - API: 'Supportability/API', - TRANSACTION_API: 'Supportability/API/Transaction', - UTILIZATION: 'Supportability/utilization', - DEPENDENCIES: 'Supportability/InstalledDependencies', - NODEJS: 'Supportability/Nodejs', - REGISTRATION: 'Supportability/Registration', - EVENT_HARVEST: 'Supportability/EventHarvest', - INFINITE_TRACING: 'Supportability/InfiniteTracing', - FEATURES: 'Supportability/Features', - LOGGING: 'Supportability/Logging' -} - -const ERRORS = { - PREFIX: 'Errors/', - ALL: 'Errors/' + ALL, - EXPECTED: 'ErrorsExpected/' + ALL, - WEB: 'Errors/allWeb', - OTHER: 'Errors/allOther' -} - -const EVENTS = { - WAIT: 'Events/wait', - DROPPED: SUPPORTABILITY.PREFIX + 'AnalyticsEvents/Discarded', - SEEN: SUPPORTABILITY.PREFIX + 'AnalyticsEvents/TotalEventsSeen', - SENT: SUPPORTABILITY.PREFIX + 'AnalyticsEvents/TotalEventsSent' -} - -const MEMORY = { - PHYSICAL: 'Memory/Physical', - FREE_HEAP: 'Memory/Heap/Free', - USED_HEAP: 'Memory/Heap/Used', - MAX_HEAP: 'Memory/Heap/Max', - USED_NONHEAP: 'Memory/NonHeap/Used' -} - -const CPU = { - SYSTEM_TIME: 'CPU/System Time', - SYSTEM_UTILIZATION: 'CPU/System/Utilization', - USER_TIME: 'CPU/User Time', - USER_UTILIZATION: 'CPU/User/Utilization' -} - -const GC = { - PREFIX: 'GC/', - PAUSE_TIME: 'GC/System/Pauses' -} - -const VIEW = { - PREFIX: 'View/', - RENDER: '/Rendering' -} - -const LOOP = { - PREFIX: NODEJS.PREFIX + 'EventLoop/', - USAGE: NODEJS.PREFIX + 'EventLoop/CPU/Usage' -} - -const DB = { - PREFIX: 'Datastore/', - STATEMENT: 'Datastore/statement', - OPERATION: 'Datastore/operation', - INSTANCE: 'Datastore/instance', - ALL: 'Datastore/' + ALL, - WEB: 'allWeb', - OTHER: 'allOther' -} - -const EXTERNAL = { - PREFIX: 'External/', - ALL: 'External/' + ALL, - WEB: 'External/allWeb', - OTHER: 'External/allOther', - APP: 'ExternalApp/', - TRANSACTION: 'ExternalTransaction/' -} - -const FUNCTION = { - PREFIX: 'Function/' -} - -const MIDDLEWARE = { - PREFIX: NODEJS.PREFIX + 'Middleware/' -} - -const FS = { - PREFIX: 'Filesystem/' -} - -const MEMCACHE = { - PREFIX: 'Memcache', - OPERATION: DB.OPERATION + '/Memcache/', - INSTANCE: DB.INSTANCE + '/Memcache/', - ALL: DB.PREFIX + 'Memcache/' + ALL -} - -const MONGODB = { - PREFIX: 'MongoDB', - STATEMENT: DB.STATEMENT + '/MongoDB/', - OPERATION: DB.OPERATION + '/MongoDB/', - INSTANCE: DB.INSTANCE + '/MongoDB/' -} - -const MYSQL = { - PREFIX: 'MySQL', - STATEMENT: DB.STATEMENT + '/MySQL/', - OPERATION: DB.OPERATION + '/MySQL/', - INSTANCE: DB.INSTANCE + '/MySQL/' -} - -const REDIS = { - PREFIX: 'Redis', - OPERATION: DB.OPERATION + '/Redis/', - INSTANCE: DB.INSTANCE + '/Redis/', - ALL: DB.PREFIX + 'Redis/' + ALL -} - -const POSTGRES = { - PREFIX: POSTGRES_LITERAL, - STATEMENT: DB.STATEMENT + `/${POSTGRES_LITERAL}/`, - OPERATION: DB.OPERATION + `/${POSTGRES_LITERAL}/`, - INSTANCE: DB.INSTANCE + `/${POSTGRES_LITERAL}/` -} - -const CASSANDRA = { - PREFIX: CASSANDRA_LITERAL, - OPERATION: DB.OPERATION + `/${CASSANDRA_LITERAL}/`, - STATEMENT: DB.STATEMENT + `/${CASSANDRA_LITERAL}/`, - INSTANCE: DB.INSTANCE + `/${CASSANDRA_LITERAL}/`, - ALL: DB.PREFIX + `${CASSANDRA_LITERAL}/` + ALL -} - -const PRISMA = { - PREFIX: PRISMA_LITERAL, - STATEMENT: `${DB.STATEMENT}/${PRISMA_LITERAL}/`, - OPERATION: `${DB.OPERATION}/${PRISMA_LITERAL}/`, - INSTANCE: `${DB.INSTANCE}/${PRISMA_LITERAL}/` -} - -const EXPRESS = { - PREFIX: `${EXPRESS_LITERAL}/`, - MIDDLEWARE: MIDDLEWARE.PREFIX + `${EXPRESS_LITERAL}/`, - ERROR_HANDLER: MIDDLEWARE.PREFIX + `${EXPRESS_LITERAL}/` -} - -const RESTIFY = { - PREFIX: 'Restify/' -} - -const HAPI = { - PREFIX: 'Hapi/', - MIDDLEWARE: MIDDLEWARE.PREFIX + 'Hapi/' -} - -const UTILIZATION = { - AWS_ERROR: SUPPORTABILITY.UTILIZATION + '/aws/error', - PCF_ERROR: SUPPORTABILITY.UTILIZATION + '/pcf/error', - AZURE_ERROR: SUPPORTABILITY.UTILIZATION + '/azure/error', - GCP_ERROR: SUPPORTABILITY.UTILIZATION + '/gcp/error', - DOCKER_ERROR: SUPPORTABILITY.UTILIZATION + '/docker/error', - BOOT_ID_ERROR: SUPPORTABILITY.UTILIZATION + '/boot_id/error' -} - -const CUSTOM_EVENTS = { - PREFIX: SUPPORTABILITY.EVENTS + '/Customer/', - DROPPED: SUPPORTABILITY.EVENTS + '/Customer/Dropped', - SEEN: SUPPORTABILITY.EVENTS + '/Customer/Seen', - SENT: SUPPORTABILITY.EVENTS + '/Customer/Sent', - TOO_LARGE: SUPPORTABILITY.EVENTS + '/Customer/TooLarge', - FAILED: SUPPORTABILITY.EVENTS + '/Customer/FailedToSend' -} - -const TRANSACTION_ERROR = { - DROPPED: SUPPORTABILITY.EVENTS + '/TransactionError/Dropped', - SEEN: SUPPORTABILITY.EVENTS + '/TransactionError/Seen', - SENT: SUPPORTABILITY.EVENTS + '/TransactionError/Sent' -} - -const EVENT_HARVEST = { - REPORT_PERIOD: SUPPORTABILITY.EVENT_HARVEST + '/ReportPeriod', - HARVEST_LIMIT: { - ANALYTIC: SUPPORTABILITY.EVENT_HARVEST + '/AnalyticEventData/HarvestLimit', - CUSTOM: SUPPORTABILITY.EVENT_HARVEST + '/CustomEventData/HarvestLimit', - ERROR: SUPPORTABILITY.EVENT_HARVEST + '/ErrorEventData/HarvestLimit', - SPAN: SUPPORTABILITY.EVENT_HARVEST + '/SpanEventData/HarvestLimit', - LOG: SUPPORTABILITY.EVENT_HARVEST + '/LogEventData/HarvestLimit' - } -} - -const DATA_USAGE_PREFIX = `${SUPPORTABILITY.NODEJS}/Collector` -const DATA_USAGE_SUFFIX = 'Output/Bytes' - -const DATA_USAGE = { - SUFFIX: DATA_USAGE_SUFFIX, - PREFIX: DATA_USAGE_PREFIX, - COLLECTOR: `${DATA_USAGE_PREFIX}/${DATA_USAGE_SUFFIX}` -} - -const WEB = { - RESPONSE_TIME: 'WebTransaction', - FRAMEWORK_PREFIX: 'WebFrameworkUri', - TOTAL_TIME: 'WebTransactionTotalTime' -} - -const OTHER_TRANSACTION = { - PREFIX: 'OtherTransaction', - RESPONSE_TIME: 'OtherTransaction', - TOTAL_TIME: 'OtherTransactionTotalTime', - MESSAGE: OTHER_TRANSACTION_MESSAGE -} - -const MESSAGE_TRANSACTION = { - PREFIX: OTHER_TRANSACTION_MESSAGE, - RESPONSE_TIME: OTHER_TRANSACTION_MESSAGE, - TOTAL_TIME: 'OtherTransactionTotalTime/Message' -} - -const TRUNCATED = { - PREFIX: 'Truncated/' -} - -const DISTRIBUTED_TRACE = { - DURATION: 'DurationByCaller', - ERRORS: 'ErrorsByCaller', - TRANSPORT: 'TransportDuration' -} - -const SPAN_EVENT_PREFIX = 'SpanEvent/' - -const SPAN_EVENTS = { - SEEN: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'TotalEventsSeen', - SENT: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'TotalEventsSent', - DROPPED: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'Discarded', - LIMIT: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'Limit' -} - -const INFINITE_TRACING = { - SEEN: SUPPORTABILITY.INFINITE_TRACING + '/Span/Seen', - SENT: SUPPORTABILITY.INFINITE_TRACING + '/Span/Sent', - DROPPED: SUPPORTABILITY.INFINITE_TRACING + '/Span/Dropped', - SPAN_RESPONSE_ERROR: SUPPORTABILITY.INFINITE_TRACING + '/Span/Response/Error', - SPAN_RESPONSE_GRPC_UNIMPLEMENTED: SUPPORTABILITY.INFINITE_TRACING + '/Span/gRPC/UNIMPLEMENTED', - SPAN_RESPONSE_GRPC_STATUS: SUPPORTABILITY.INFINITE_TRACING + '/Span/gRPC/%s', - QUEUE_CAPACITY: SUPPORTABILITY.INFINITE_TRACING + '/Span/QueueCapacity', - QUEUE_SIZE: SUPPORTABILITY.INFINITE_TRACING + '/Span/QueueSize', - DRAIN_DURATION: SUPPORTABILITY.INFINITE_TRACING + '/Drain/Duration', - COMPRESSION: `${SUPPORTABILITY.INFINITE_TRACING}/gRPC/Compression`, - BATCHING: `${SUPPORTABILITY.INFINITE_TRACING}/gRPC/Batching` -} - -const FEATURES = { - ESM: { - LOADER: `${SUPPORTABILITY.FEATURES}/ESM/Loader`, - UNSUPPORTED_LOADER: `${SUPPORTABILITY.FEATURES}/ESM/UnsupportedLoader`, - CUSTOM_INSTRUMENTATION: `${SUPPORTABILITY.FEATURES}/ESM/CustomInstrumentation` - }, - CERTIFICATES: SUPPORTABILITY.FEATURES + '/Certificates', - INSTRUMENTATION: { - ON_RESOLVED: SUPPORTABILITY.FEATURES + '/Instrumentation/OnResolved', - ON_REQUIRE: SUPPORTABILITY.FEATURES + '/Instrumentation/OnRequire' - } -} - -const LOGGING_LINES_PREFIX = 'Logging/lines' -const LOGGING_FORWARDING_PREFIX = `${SUPPORTABILITY.LOGGING}/Forwarding` -const LOGGING = { - LINES: LOGGING_LINES_PREFIX, - LEVELS: { - INFO: `${LOGGING_LINES_PREFIX}/INFO`, - WARN: `${LOGGING_LINES_PREFIX}/WARN`, - ERROR: `${LOGGING_LINES_PREFIX}/ERROR`, - FATAL: `${LOGGING_LINES_PREFIX}/FATAL`, - DEBUG: `${LOGGING_LINES_PREFIX}/DEBUG`, - TRACE: `${LOGGING_LINES_PREFIX}/TRACE`, - UNKNOWN: `${LOGGING_LINES_PREFIX}/UNKNOWN` - }, - LIBS: { - BUNYAN: `${SUPPORTABILITY.LOGGING}/${NODEJS.PREFIX}bunyan/enabled`, - PINO: `${SUPPORTABILITY.LOGGING}/${NODEJS.PREFIX}pino/enabled`, - WINSTON: `${SUPPORTABILITY.LOGGING}/${NODEJS.PREFIX}winston/enabled` - }, - DROPPED: `Logging/Forwarding/Dropped`, - SEEN: `${LOGGING_FORWARDING_PREFIX}/Seen`, - SENT: `${LOGGING_FORWARDING_PREFIX}/Sent`, - FORWARDING: `${LOGGING_FORWARDING_PREFIX}/${NODEJS.PREFIX}`, - METRICS: `${SUPPORTABILITY.LOGGING}/Metrics/${NODEJS.PREFIX}`, - LOCAL_DECORATING: `${SUPPORTABILITY.LOGGING}/LocalDecorating/${NODEJS.PREFIX}` -} - -module.exports = { - ACTION_DELIMITER: '/', - ALL: ALL, - APDEX: 'Apdex', - CASSANDRA: CASSANDRA, - CLIENT_APPLICATION: 'ClientApplication', - CONTROLLER: 'Controller', - CPU: CPU, - CUSTOM: 'Custom', - CUSTOM_EVENTS: CUSTOM_EVENTS, - DATA_USAGE, - DB: DB, - DISTRIBUTED_TRACE, - ERRORS: ERRORS, - EVENTS: EVENTS, - EVENT_HARVEST: EVENT_HARVEST, - EXPRESS: EXPRESS, - EXTERNAL: EXTERNAL, - FEATURES, - FS: FS, - FUNCTION: FUNCTION, - GC: GC, - HAPI: HAPI, - HTTP: 'HttpDispatcher', - INFINITE_TRACING: INFINITE_TRACING, - LOOP: LOOP, - LOGGING, - MEMCACHE: MEMCACHE, - MEMORY: MEMORY, - MESSAGE_TRANSACTION: MESSAGE_TRANSACTION, - MIDDLEWARE: MIDDLEWARE, - MONGODB: MONGODB, - MYSQL: MYSQL, - NODEJS: NODEJS, - NORMALIZED: 'NormalizedUri', - OTHER_TRANSACTION: OTHER_TRANSACTION, - POSTGRES: POSTGRES, - QUEUETIME: 'WebFrontend/QueueTime', - REDIS: REDIS, - RESTIFY: RESTIFY, - SPAN_EVENTS: SPAN_EVENTS, - SUPPORTABILITY: SUPPORTABILITY, - TRANSACTION_ERROR: TRANSACTION_ERROR, - TRUNCATED: TRUNCATED, - URI: 'Uri', - UTILIZATION: UTILIZATION, - VIEW: VIEW, - WEB: WEB, - PRISMA: PRISMA -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer.js deleted file mode 100644 index b9743fe56..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer.js +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const EventEmitter = require('events').EventEmitter -const util = require('util') -const logger = require('../logger').child({ component: 'metric_normalizer' }) -const deepEqual = require('../util/deep-equal') -const NormalizerRule = require('./normalizer/rule') -const NAMES = require('../metrics/names.js') - -function url(normalized, path, config) { - if (normalized) { - return NAMES.NORMALIZED + normalized - } - - if (config.enforce_backstop) { - return NAMES.NORMALIZED + '/*' - } - - return NAMES.URI + path -} - -function plain(normalized, path) { - if (normalized) { - return normalized - } - - return path -} - -/** - * The collector keeps track of rules that should be applied to metric names, - * and sends these rules to the agent at connection time. These rules can - * either change the name of the metric or indicate that metrics associated with - * this name (which is generally a URL path) should be ignored altogether. - * - * @param {object} config The agent's configuration blob, which has a parameter - * that indicates whether to enforce the normalization - * backstop. - * @param type - */ -function MetricNormalizer(config, type) { - if (!config) { - throw new Error('normalizer must be created with configuration.') - } - if (!type) { - throw new Error('normalizer must be created with a type.') - } - - EventEmitter.call(this) - - this.config = config - this.type = type - // some mildly cheesy polymorphism to make normalizers work generically - if (type === 'URL') { - this.formatter = url - } else { - this.formatter = plain - } - - this.rules = [] -} -util.inherits(MetricNormalizer, EventEmitter) - -// -------------------------------------------------------------------------- // - -/** - * @typedef {object} NormalizationResults - * @property {bool} matched - True if a rule was found that matched. - * @property {bool} ignore - True if the given input should be ignored. - * @property {string} value - The normalized input value. - */ - -// -------------------------------------------------------------------------- // - -/** - * Convert the raw, de-serialized JSON response into a set of - * NormalizationRules. - * - * @param object json The de-serialized JSON response sent on collector - * connection. - * @param json - */ -MetricNormalizer.prototype.load = function load(json) { - if (json) { - this.rules = [] - logger.debug('Received %s %s normalization rule(s) from the server', json.length, this.type) - - json.forEach((ruleJSON) => { - // no need to add the same rule twice - const rule = new NormalizerRule(ruleJSON) - if (!this.rules.find(deepEqual.bind(null, rule))) { - this.rules.push(rule) - logger.trace('Loaded %s normalization rule: %s', this.type, rule) - } - }) - - /* I (FLN) always forget this, so making a note: JS sort is always - * IN-PLACE, even though it returns the sorted array. - */ - this.rules.sort((a, b) => { - return a.precedence - b.precedence - }) - - logger.debug('Loaded %s %s normalization rule(s).', this.rules.length, this.type) - } -} - -/** - * Helper for loadFromConfig - * - * @param rule {object} from this.config.rules - * @param ctx {object} context from the calling function - */ -function processNameRule(rule, ctx) { - if (!rule.pattern) { - return logger.error({ rule: rule }, 'Simple naming rules require a pattern.') - } - if (!rule.name) { - return logger.error({ rule: rule }, 'Simple naming rules require a replacement name.') - } - - const precedence = rule.precedence - const terminal = rule.terminate_chain - const json = { - match_expression: rule.pattern, - eval_order: typeof precedence === 'number' ? precedence : 500, - terminate_chain: typeof terminal === 'boolean' ? terminal : true, - replace_all: rule.replace_all, - replacement: rule.name, - ignore: false - } - - // Find where the rule should be inserted and do so. - const reverse = ctx.config.feature_flag.reverse_naming_rules - const insert = ctx.rules.findIndex(function findRule(r) { - return reverse ? r.precedence >= json.eval_order : r.precedence > json.eval_order - }) - if (insert === -1) { - ctx.rules.push(new NormalizerRule(json)) - } else { - ctx.rules.splice(insert, 0, new NormalizerRule(json)) - } -} -/** - * Load any rules found in the configuration into a metric normalizer. - * - * Operates via side effects. - */ -MetricNormalizer.prototype.loadFromConfig = function loadFromConfig() { - const ctx = this - const rules = this.config.rules - - if (rules && rules.name && rules.name.length > 0) { - rules.name.forEach((name) => processNameRule(name, ctx)) - } - - if (rules && rules.ignore && rules.ignore.length > 0) { - rules.ignore.forEach((pattern) => { - this.addSimple(pattern) - }) - } -} - -/** - * Add simple, user-provided rules to the head of the match list. These rules - * will always be highest precedence, always will terminate matching, and - * will always apply to the URL as a whole. If no name is provided, then - * transactions attached to the matching URLs will be ignored. - * - * - `addSimple(opts)` - * - `addSimple(pattern [, name])` - * - * @param {RegExp} pattern The pattern to rename (with capture groups). - * @param {string} [name] The name to use for the transaction. - */ -MetricNormalizer.prototype.addSimple = function addSimple(pattern, name) { - if (!pattern) { - return logger.error('Simple naming rules require a pattern.') - } - - const json = { - match_expression: pattern, - eval_order: 0, - terminate_chain: true, - replace_all: false, - replacement: null, - ignore: false - } - - if (name) { - json.replacement = name - } else { - json.ignore = true - } - - this.rules.unshift(new NormalizerRule(json)) -} - -/** - * Turn a (scrubbed) URL path into partial metric name. - * - * @param {string} path - The URL path to turn into a name. - * @returns {NormalizationResults} - The results of normalization. - */ -MetricNormalizer.prototype.normalize = function normalize(path) { - let last = path - const length = this.rules.length - let normalized - let matched = false - let ignored = false - - // Apply each of our rules in turn. - for (let i = 0; i < length; i++) { - const rule = this.rules[i] - const applied = rule.apply(last) - if (!rule.matched) { - continue - } - - if (rule.ignore) { - ignored = true - } else { - matched = true - normalized = applied - - // emit event when a rule is matched - // we could also include an array of matched rules in the returned map, but - // that would increase memory overhead by creating additional array - this.emit('appliedRule', rule, normalized, last) - - logger.trace({ rule: rule, type: this.type }, 'Normalized %s to %s.', last, normalized) - last = normalized - } - - if (rule.isTerminal) { - logger.trace({ rule: rule }, 'Terminating normalization.') - break - } - } - - // Return the normalized path. - return { - matched: matched, - ignore: ignored, - value: this.formatter(normalized, path, this.config) - } -} - -module.exports = MetricNormalizer diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer/rule.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer/rule.js deleted file mode 100644 index cb7253acd..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer/rule.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../../logger').child({ component: 'normalizer_rule' }) - -/** - * JavaScript just has to do things slightly differently. - * - * @param input - */ -const replaceReplacer = function replaceReplacer(input) { - return input.replace(/\\/g, '$') -} - -/** - * Be liberal about accepting incomplete information, because we don't want - * bad rules from the collector to crash client apps. Otherwise, this is a - * fairly straightforward mapping of the concepts in metric normalization - * rules into an object form. - * - * @param {object} json A JavaScript object literal parsed out from the JSON - * from the collector. - */ -function NormalizerRule(json) { - if (!json) { - logger.debug('Received incompletely specified metric normalization rule from collector.') - json = Object.create(null) - } - - this.eachSegment = json.each_segment || false - this.precedence = json.eval_order || 0 - this.isTerminal = json.terminate_chain || false - this.replacement = replaceReplacer(json.replacement || '$0') - this.replaceAll = json.replace_all || false - this.ignore = json.ignore || false - this.matched = false - - let modifiers = 'i' - if (this.replaceAll) { - modifiers += 'g' - } - - // don't allow this to fail - if (json.match_expression instanceof RegExp) { - this.pattern = _addRegExpFlags(json.match_expression, modifiers) - } else { - try { - this.pattern = new RegExp(json.match_expression || '^$', modifiers) - } catch (error) { - logger.warn(error, 'Problem compiling metric normalization rule pattern.') - this.pattern = /^$/ - } - } -} - -/** - * Allow the higher-level functions to operate on input uniformly. - * - * @param {string} input URL to potentially be split. - */ -NormalizerRule.prototype.getSegments = function getSegments(input) { - if (this.eachSegment) { - return input.split('/') - } - - return [input] -} - -/** - * Check if a URL matches a rule. - * - * Does not set {NormalizerRule#matched}. - * - * @param {string} input - URL to match. - * @returns {bool} - True if this rule matches the given input, otherwise false. - */ -NormalizerRule.prototype.matches = function matches(input) { - const segments = this.getSegments(input) - - for (let i = 0; i < segments.length; ++i) { - if (this.pattern.test(segments[i])) { - return true - } - } - - return false -} - -/** - * Apply the substitutions, if any, to the input. - * - * Also sets {NormalizerRule#matched} to true if this rule did match the given - * input. - * - * String.split will return empty segments when the path has a leading slash or - * contains a run of slashes. Don't inadvertently substitute or drop these empty - * segments, or the normalized path will be wrong. - * - * XXX In Node v0.8 and Node v0.10, `RegExp#test` advances internal state and - * XXX tracks where it left off from the previous match. This has the side - * XXX effect that reusing the same object may cause false negatives if you do - * XXX not reset that state. The only way to reset the state is to set - * XXX `RegExp#lastIndex` to `0`. - * - * @param {string} input - URL to normalize. - * @returns {string?} - The normalized url, or `null` if this is an ignore rule - * that matched this url. - */ -NormalizerRule.prototype.apply = function apply(input) { - // For ignore rules, just see if we match and return either `null` or the - // original input. - if (this.ignore) { - return (this.matched = this.matches(input)) ? null : input - } - - this.matched = false - const result = this.getSegments(input) - .map(function applyMap(segment) { - // Discussion of why we use `lastIndex` in function documentation to - // prevent de-opt due to long function. - this.pattern.lastIndex = 0 - if (segment && this.pattern.test(segment)) { - this.matched = true - return segment.replace(this.pattern, this.replacement) - } - return segment - }, this) - .join('/') - return input[0] === '/' && result[0] !== '/' ? '/' + result : result -} - -NormalizerRule.prototype.toJSON = function toJSON() { - return { - eachSegment: this.eachSegment, - precedence: this.precedence, - isTerminal: this.isTerminal, - replacement: this.replacement, - replaceAll: this.replaceAll, - ignore: this.ignore, - pattern: this.pattern.source - } -} - -/** - * Merges the given flags with those already in a regular expression. - * - * @param {RegExp} re - The regular expression to add flags to. - * @param {string} flags - The flags to add to the regex. - * @returns {RegExp} - A regular expression with all the given flags added. - */ -function _addRegExpFlags(re, flags) { - let foundMissing = false - let reFlags = re.flags - for (let i = 0; i < flags.length; ++i) { - if (reFlags.indexOf(flags[i]) === -1) { - foundMissing = true - reFlags += flags[i] - } - } - return foundMissing ? new RegExp(re.source, reFlags) : re -} - -module.exports = NormalizerRule diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer/tx_segment.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer/tx_segment.js deleted file mode 100644 index 8f8c95b65..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/normalizer/tx_segment.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../../logger').child({ component: 'tx_segment_normalizer' }) - -module.exports = TxSegmentNormalizer - -function TxSegmentNormalizer() { - this.terms = [] -} - -/** - * This normalize method is wicked. The best bet is to read the spec: - * https://source.datanerd.us/agents/agent-specs/blob/main/Metric-Name-Rules-PORTED.md - * - * A copy paste of the rules that were followed: - * 1. Find the first rule where the prefix key matches the prefix of the - * transaction name. If no matching rules are found, abort. - * 2. Strip the prefix from the transaction name. - * 3. Split the rest of the transaction name into segments on slashes ('/'). - * 4. For each segment: - * If the segment appears in the array of strings given under the terms key, - * keep it unchanged. Else, replace it with a placeholder ('*') - * 5. Collapse all adjacent placeholder segments into a single '*' segment. - * 6. Join together the modified segments with slashes, and re-prepend the prefix. - * - * @param {string} path - The transaction metric path to normalize. - * @returns {{ignore: boolean, matched: boolean, value: string}} - The results of normalizing the given path. - */ -TxSegmentNormalizer.prototype.normalize = function normalize(path) { - let currentTerm - let prefix - let result - let prev - - const normalizeParts = (part, idx, parts) => { - if (part === '' && idx + 1 === parts.length) { - return // if this is the last one, don't iterate - } - if (currentTerm.terms.indexOf(part) === -1) { - if (prev === '*') { - return - } - result.push((prev = '*')) - } else { - result.push((prev = part)) - } - } - - for (let i = 0; i < this.terms.length; i++) { - currentTerm = this.terms[i] - prefix = currentTerm.prefix - if (path.lastIndexOf(prefix, 0) === -1) { - continue - } - const fragment = path.slice(prefix.length) - const parts = fragment.split('/') - result = [] - - parts.forEach(normalizeParts) - - logger.trace('Normalizing %s because of rule: %s', path, currentTerm) - return { - matched: true, // To match MetricNormalizer - ignore: false, // ^^ - value: prefix + result.join('/') - } - } - - return { - matched: false, // To match MetricNormalizer - ignore: false, // ^^ - value: path - } -} - -TxSegmentNormalizer.prototype.load = function load(json) { - if (Array.isArray(json)) { - this.terms = filterRules(json) - } else { - logger.warn('transaction_segment_terms was not an array got: %s (%s)', typeof json, json) - } -} - -function filterRules(rules) { - const map = Object.create(null) - - for (let i = 0, l = rules.length; i < l; ++i) { - let prefix = rules[i].prefix - - if (!prefix || typeof prefix !== 'string') { - continue - } - - if (prefix[prefix.length - 1] !== '/') { - prefix = prefix + '/' - rules[i].prefix = prefix - } - - const segments = prefix.split('/') - if (segments.length !== 3 || !segments[0] || !segments[1] || segments[3]) { - continue - } - - if (Array.isArray(rules[i].terms)) { - map[prefix] = rules[i] - } - } - - const keys = Object.keys(map) - const filtered = new Array(keys.length) - - for (let i = 0, l = keys.length; i < l; ++i) { - filtered[i] = map[keys[i]] - } - - return filtered -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/custom.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/custom.js deleted file mode 100644 index b2d1c588c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/custom.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('../names') - -function record(segment, scope) { - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - const name = NAMES.CUSTOM + NAMES.ACTION_DELIMITER + segment.name - - if (scope) { - transaction.measure(name, scope, duration, exclusive) - } - - transaction.measure(name, null, duration, exclusive) -} - -module.exports = record diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/distributed-trace.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/distributed-trace.js deleted file mode 100644 index f065f461a..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/distributed-trace.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('../names') - -function recordDistributedTrace(tx, suffix, duration, exclusive) { - const distTraceReceived = !!tx.acceptedDistributedTrace - const tag = [ - tx.parentType || 'Unknown', - tx.parentAcct || 'Unknown', - tx.parentApp || 'Unknown', - tx.parentTransportType || 'Unknown', - 'all' - ].join('/') - - const suffixes = ['', suffix] - - suffixes.forEach(function record(suf) { - tx.measure(`${NAMES.DISTRIBUTED_TRACE.DURATION}/${tag}${suf}`, null, duration, exclusive) - - if (tx.hasErrors()) { - tx.measure(`${NAMES.DISTRIBUTED_TRACE.ERRORS}/${tag}${suf}`, null, duration, exclusive) - } - - if (distTraceReceived) { - tx.measure(`${NAMES.DISTRIBUTED_TRACE.TRANSPORT}/${tag}${suf}`, null, duration, exclusive) - } - }) -} - -module.exports = recordDistributedTrace diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/generic.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/generic.js deleted file mode 100644 index 3deed95d3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/generic.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -function record(segment, scope) { - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - - if (scope) { - transaction.measure(segment.name, scope, duration, exclusive) - } - - transaction.measure(segment.name, null, duration, exclusive) -} - -module.exports = record diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/http.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/http.js deleted file mode 100644 index 83a0880bb..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/http.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('../../metrics/names') -const recordDistributedTrace = require('./distributed-trace') - -const TO_MILLIS = 1e3 - -function recordWeb(segment, scope) { - // in web metrics, scope is required - if (!scope) { - return - } - - const tx = segment.transaction - // if there was a nested webTransaction use its recorder instead - if (tx.type === 'web' && tx.baseSegment && segment !== tx.baseSegment) { - return - } - - const duration = segment.getDurationInMillis() - const totalTime = tx.trace.getTotalTimeDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const partial = segment.partialName - const config = segment.transaction.agent.config - // named / key transaction support requires per-name apdexT - const keyApdexInMillis = config.web_transactions_apdex[scope] * TO_MILLIS || 0 - - tx.measure(NAMES.WEB.RESPONSE_TIME, null, duration, exclusive) - tx.measure(NAMES.WEB.TOTAL_TIME, null, totalTime, exclusive) - tx.measure(NAMES.HTTP, null, duration, exclusive) - tx.measure(scope, null, duration, exclusive) - tx.measure(NAMES.WEB.TOTAL_TIME + '/' + partial, null, totalTime, exclusive) - - if (tx.queueTime > 0) { - tx.measure(NAMES.QUEUETIME, null, tx.queueTime) - } - - if (config.distributed_tracing.enabled) { - recordDistributedTrace(tx, 'Web', duration, exclusive) - } else if (tx.incomingCatId) { - tx.measure(NAMES.CLIENT_APPLICATION + '/' + tx.incomingCatId + '/all', null, tx.catResponseTime) - } - - tx._setApdex(NAMES.APDEX + '/' + partial, duration, keyApdexInMillis) - tx._setApdex(NAMES.APDEX, duration, keyApdexInMillis) -} - -module.exports = recordWeb diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/http_external.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/http_external.js deleted file mode 100644 index 2e3bd7e2e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/http_external.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const EXTERNAL = require('../../metrics/names').EXTERNAL - -function recordExternal(host, library) { - return function externalRecorder(segment, scope) { - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - const metricName = EXTERNAL.PREFIX + host + '/' + library - const rollupType = transaction.isWeb() ? EXTERNAL.WEB : EXTERNAL.OTHER - const rollupHost = EXTERNAL.PREFIX + host + '/all' - - if (segment.catId && segment.catTransaction) { - transaction.measure( - EXTERNAL.APP + host + '/' + segment.catId + '/all', - null, - duration, - exclusive - ) - - transaction.measure( - EXTERNAL.TRANSACTION + host + '/' + segment.catId + '/' + segment.catTransaction, - null, - duration, - exclusive - ) - - // This CAT metric replaces scoped External/{host}/{method} - if (scope) { - transaction.measure( - EXTERNAL.TRANSACTION + host + '/' + segment.catId + '/' + segment.catTransaction, - scope, - duration, - exclusive - ) - } - } else if (scope) { - transaction.measure(metricName, scope, duration, exclusive) - } - - transaction.measure(metricName, null, duration, exclusive) - transaction.measure(rollupType, null, duration, exclusive) - transaction.measure(rollupHost, null, duration, exclusive) - transaction.measure(EXTERNAL.ALL, null, duration, exclusive) - } -} - -module.exports = recordExternal diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/message-transaction.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/message-transaction.js deleted file mode 100644 index ed7172d95..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/message-transaction.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('../../metrics/names.js') - -function recordMessageTransaction(segment, scope) { - const tx = segment.transaction - if (tx.type !== 'message' || tx.baseSegment !== segment) { - return - } - - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const totalTime = segment.transaction.trace.getTotalTimeDurationInMillis() - - if (scope) { - tx.measure(scope, null, duration, exclusive) - tx.measure( - NAMES.MESSAGE_TRANSACTION.TOTAL_TIME + '/' + tx.getName(), - null, - totalTime, - exclusive - ) - } - - tx.measure(NAMES.MESSAGE_TRANSACTION.RESPONSE_TIME + '/all', null, duration, exclusive) - tx.measure(NAMES.OTHER_TRANSACTION.RESPONSE_TIME + '/all', null, duration, exclusive) - tx.measure(NAMES.OTHER_TRANSACTION.TOTAL_TIME, null, totalTime, exclusive) -} - -module.exports = recordMessageTransaction diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/other.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/other.js deleted file mode 100644 index 11d472d39..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/metrics/recorders/other.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('../../metrics/names') -const recordDistributedTrace = require('./distributed-trace') - -function recordBackground(segment, scope) { - // if there was a nested otherTransaction use its recorder instead - const tx = segment.transaction - if (tx.type === 'bg' && tx.baseSegment && segment !== tx.baseSegment) { - return - } - - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const totalTime = segment.transaction.trace.getTotalTimeDurationInMillis() - const name = segment.partialName - - if (scope) { - tx.measure(scope, null, duration, exclusive) - tx.measure(NAMES.OTHER_TRANSACTION.TOTAL_TIME + '/' + name, null, totalTime, exclusive) - } - // rollup for background total time doesn't have `/all` where the response - // time version does. - tx.measure(NAMES.OTHER_TRANSACTION.RESPONSE_TIME + '/all', null, duration, exclusive) - tx.measure(NAMES.OTHER_TRANSACTION.TOTAL_TIME, null, totalTime, exclusive) - - if (tx.agent.config.distributed_tracing.enabled) { - recordDistributedTrace(tx, 'Other', duration, exclusive) - } -} - -module.exports = recordBackground diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/parse-proc-cpuinfo.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/parse-proc-cpuinfo.js deleted file mode 100644 index 2c8118f88..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/parse-proc-cpuinfo.js +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('./logger.js').child({ component: 'proc-cpuinfo' }) -const PHYSICAL_ID = 'physical id' -const CPU_CORES = 'cpu cores' -const PROCESSOR = 'processor' -const CORE_ID = 'core id' - -module.exports = parseProcCPUInfo - -function parseProcCPUInfo(data) { - const relevantAttributes = [PROCESSOR, PHYSICAL_ID, CPU_CORES, CORE_ID] - - let processorStats = { - logical: null, - cores: null, - packages: null - } - - // In some rare cases the OS may be locked down so that you cannot retrieve this info. - if (!data) { - logger.debug('No CPU data to parse, returning empty stats.') - return processorStats - } - - // separate the processors - let splitData = data.split('\n').map(function formatAttribute(attr) { - return attr.split(':').map(function eliminateExtraWhitespace(s) { - return s.replace(/\\r|\\t| {2,}/g, '').trim() - }) - }) - - const validData = splitData.filter(function checkForValidAttrs(a) { - return a.length === 2 && relevantAttributes.indexOf(a[0]) !== -1 - }) - if (validData.length === 0) { - logger.debug('No applicable cpu attributes found') - return processorStats - } - - splitData = collapseMultilineValues(splitData) - - const processors = separateProcessors(splitData) - - processorStats = countProcessorStats(processors) - if (!processorStats.cores) { - if (processorStats.logical === 1) { - // some older, single-core processors might not list ids, - // so we'll mark them 1 - processorStats.cores = 1 - processorStats.packages = 1 - } else { - // there is no way of knowing how many packages - // or cores there are - processorStats.cores = null - processorStats.packages = null - } - } - return processorStats -} - -// some values are split up over multiple lines, these won't be broken -// by split(':'), and should be folded into the last seen valid value -function collapseMultilineValues(li) { - const tmp = [] - let last - for (let i = 0; i < li.length; ++i) { - if (li[i].length === 2) { - // store the last valid entry to append invalid entries to - last = li[i] - tmp.push(last) - } else { - last[1] += li[i][0] - } - } - - return tmp -} - -// walk through the processed list of key, value pairs and populate -// objects till you find a collision -function separateProcessors(processorData) { - const processors = [] - let processor = Object.create(null) - for (let i = 0; i < processorData.length; ++i) { - const key = processorData[i][0] - const value = processorData[i][1] - if (processor[key] !== undefined) { - processors.push(processor) - processor = Object.create(null) - } - processor[key] = value - } - processors.push(processor) - return processors -} - -function countProcessorStats(processors) { - const phys = [] - const cores = [] - - for (let i = 0; i < processors.length; i++) { - const processor = processors[i] - if ( - processor[PHYSICAL_ID] && - processor[CPU_CORES] && - phys.indexOf(processor[PHYSICAL_ID]) === -1 - ) { - phys.push(processor[PHYSICAL_ID]) - cores.push(processor[CPU_CORES]) - } - } - - return { - logical: processors.length, - cores: cores - .map(function convertToInt(s) { - return parseInt(s, 10) - }) - .reduce(function sum(a, b) { - return a + b - }, 0), - packages: phys.length - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/parse-proc-meminfo.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/parse-proc-meminfo.js deleted file mode 100644 index 2045569ab..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/parse-proc-meminfo.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('./logger.js').child({ component: 'proc-meminfo' }) - -module.exports = parseProcMeminfo - -function parseProcMeminfo(data) { - // In some rare cases the OS may be locked down so that you cannot retrieve this info. - if (!data) { - logger.debug('No memory data to parse.') - return null - } - - const memTotal = parseInt(data.replace(/MemTotal:\s*(\d*)\skB/, '$1'), 10) - - if (memTotal) { - return memTotal / 1024 - } - - logger.debug('Unable to parse memory string:', data) - return null -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/prioritized-attributes.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/prioritized-attributes.js deleted file mode 100644 index 9ff1479ff..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/prioritized-attributes.js +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Config = require('./config') -const logger = require('./logger').child({ component: 'attributes' }) -const isValidType = require('./util/attribute-types') -const byteUtils = require('./util/byte-limit') -const properties = require('./util/properties') - -const ATTRIBUTE_PRIORITY = { - HIGH: Infinity, - LOW: -Infinity -} - -class PrioritizedAttributes { - constructor(scope, limit = Infinity) { - this.filter = makeFilter(scope) - this.limit = limit - - this.attributes = new Map() - } - - isValidLength(str) { - return typeof str === 'number' || byteUtils.isValidLength(str, 255) - } - - _set(destinations, key, value, truncateExempt, priority) { - this.attributes.set(key, { value, destinations, truncateExempt, priority }) - } - - get(dest) { - const attrs = Object.create(null) - - for (const [key, attr] of this.attributes) { - if (!(attr.destinations & dest)) { - continue - } - - attrs[key] = - typeof attr.value === 'string' && !attr.truncateExempt - ? byteUtils.truncate(attr.value, 255) - : attr.value - } - - return attrs - } - - has(key) { - this.attributes.has(key) - } - - reset() { - this.attributes = new Map() - } - - addAttribute( - destinations, - key, - value, - truncateExempt = false, - priority = ATTRIBUTE_PRIORITY.HIGH - ) { - const existingAttribute = this.attributes.get(key) - - let droppableAttributeKey = null - if (!existingAttribute && this.attributes.size === this.limit) { - droppableAttributeKey = this._getDroppableAttributeKey(priority) - - if (!droppableAttributeKey) { - logger.debug( - `Maximum number of custom attributes have been added. - Dropping attribute ${key} with ${value} type.` - ) - - return - } - } - - if (existingAttribute && priority < existingAttribute.priority) { - logger.debug("incoming priority for '%s' is lower than existing, not updating.", key) - logger.trace( - '%s attribute retained value: %s, ignored value: %s', - key, - existingAttribute.value, - value - ) - return - } - - if (!isValidType(value)) { - logger.debug( - 'Not adding attribute %s with %s value type. This is expected for undefined' + - 'attributes and only an issue if an attribute is not expected to be undefined' + - 'or not of the type expected.', - key, - typeof value - ) - return - } - - if (!this.isValidLength(key)) { - logger.warn('Length limit exceeded for attribute name, not adding: %s', key) - return - } - - // Only set the attribute if at least one destination passed - const validDestinations = this.filter(destinations, key) - if (!validDestinations) { - return - } - - if (droppableAttributeKey) { - logger.trace( - 'dropping existing lower priority attribute %s ' + 'to add higher priority attribute %s', - droppableAttributeKey, - key - ) - - this.attributes.delete(droppableAttributeKey) - } - - this._set(validDestinations, key, value, truncateExempt, priority) - } - - addAttributes(destinations, attrs) { - for (const key in attrs) { - if (properties.hasOwn(attrs, key)) { - this.addAttribute(destinations, key, attrs[key]) - } - } - } - - /** - * Returns true if a given key is valid for any of the - * provided destinations. - * - * @param {DESTINATIONS} destinations - * @param {string} key - */ - hasValidDestination(destinations, key) { - const validDestinations = this.filter(destinations, key) - return !!validDestinations - } - - _getDroppableAttributeKey(incomingPriority) { - // There will never be anything lower priority to drop - if (incomingPriority === ATTRIBUTE_PRIORITY.LOW) { - return null - } - - this.lastFoundIndexCache = this.lastFoundIndexCache || Object.create(null) - const lastFoundIndex = this.lastFoundIndexCache[incomingPriority] - - // We've already dropped all items lower than incomingPriority. - // We can honor the cache because at the point by which we've dropped - // all lower priority items, due to being at max capacity, there will never be another - // lower-priority item added. Lower priority items are unable to drop higher priority items. - if (lastFoundIndex === -1) { - return null - } - - // We can't reverse iterate w/o creating an array that will iterate, - // so we just iterate forward stopping once we've checked the last cached index. - let lowerPriorityAttributeName = null - let foundIndex = -1 - - let index = 0 - for (const [key, attribute] of this.attributes) { - // Don't search past last found lower priority item. - // At the point of dropping items for this priority, - // lower priority items will never be added. - if (lastFoundIndex && index > lastFoundIndex) { - break - } - - if (attribute.priority < incomingPriority) { - lowerPriorityAttributeName = key - foundIndex = index - } - - index++ - } - - // Item may not get dropped, so we simply store the index as - // an upper maximum and allow a future pass to clear out. - this.lastFoundIndexCache[incomingPriority] = foundIndex - - return lowerPriorityAttributeName - } -} - -function makeFilter(scope) { - const { attributeFilter } = Config.getInstance() - if (scope === 'transaction') { - return (d, k) => attributeFilter.filterTransaction(d, k) - } else if (scope === 'segment') { - return (d, k) => attributeFilter.filterSegment(d, k) - } -} - -module.exports = { - PrioritizedAttributes: PrioritizedAttributes, - ATTRIBUTE_PRIORITY: ATTRIBUTE_PRIORITY -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/priority-queue.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/priority-queue.js deleted file mode 100644 index 49a9fdda3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/priority-queue.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Heap = require('@tyriar/fibonacci-heap').FibonacciHeap - -function PriorityQueue(limit) { - this.limit = limit == null ? 10 : limit - this.seen = 0 - this._data = new Heap() - - Object.defineProperty(this, 'length', { - get: function getLength() { - return this._data._nodeCount - } - }) -} - -PriorityQueue.prototype.overflow = function overflow() { - const diff = this.seen - this.limit - return diff >= 0 ? diff : 0 -} - -PriorityQueue.prototype.getMinimumPriority = function getMinimumPriority() { - return this.length < this.limit ? 0 : this._data.findMinimum().key -} - -PriorityQueue.prototype.add = function add(value, priority) { - this.seen++ - if (this.limit <= 0) { - return false - } - priority = priority || Math.random() - if (this.length === this.limit) { - return this._replace(value, priority) - } - this._data.insert(priority, value) - return true -} - -PriorityQueue.prototype._replace = function _replace(value, priority) { - if (priority > this._data.findMinimum().key) { - this._data.insert(priority, value) - this._data.extractMinimum() - return true - } - return false -} - -PriorityQueue.prototype.getRawEvents = function getRawEvents() { - const events = [] - const min = this._data.findMinimum() - - if (min) { - _getRawEvents(min, events) - } - - return events - - function _getRawEvents(head, evts) { - let current = head - - do { - evts.push({ value: current.value, priority: current.key }) - if (current.child) { - _getRawEvents(current.child, evts) - } - current = current.next - } while (current !== head) - } -} - -PriorityQueue.prototype.toArray = function toArray() { - const nodes = [] - const min = this._data.findMinimum() - - if (min) { - serializeHeap(min, nodes) - } - - return nodes - - function serializeHeap(head, arr) { - let current = head - - do { - arr.push(current.value) - if (current.child) { - serializeHeap(current.child, arr) - } - current = current.next - } while (current !== head) - } -} - -PriorityQueue.prototype.setLimit = function setLimit(newLimit) { - this.limit = newLimit - while (this.length > newLimit) { - this._data.extractMinimum() - } -} - -PriorityQueue.prototype.merge = function merge(events) { - if (!events || !events.length) { - return - } - - if (events instanceof PriorityQueue) { - while (events.length) { - const current = events._data.extractMinimum() - this.add(current.value, current.key) - } - } else { - for (let i = 0; i < events.length; ++i) { - this.add(events[i].value, events[i].priority) - } - } -} - -module.exports = PriorityQueue diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/proxy/grpc.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/proxy/grpc.js deleted file mode 100644 index 2841c190c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/proxy/grpc.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -class ProxyGrpc { - constructor(grpcLibrary = '@grpc/grpc-js') { - this.library = require(grpcLibrary) - - // add methods or objects from base grpc class that we need as needed - this.credentials = this.library.credentials - this.Metadata = this.library.Metadata - this.loadPackageDefinition = this.library.loadPackageDefinition - this.status = this.library.status - this.Server = this.library.Server - this.ServerCredentials = this.library.ServerCredentials - } -} -module.exports = new ProxyGrpc() diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/reservoir.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/reservoir.js deleted file mode 100644 index fc4491e1b..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/reservoir.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// from http://en.wikipedia.org/wiki/Reservoir_sampling - -function Reservoir(limit) { - this.limit = limit || 10 - this.seen = 0 - this._data = [] -} - -Reservoir.prototype.overflow = function overflow() { - const diff = this.seen - this.limit - return diff >= 0 ? diff : 0 -} - -Reservoir.prototype.add = function add(item) { - if (this.seen < this.limit) { - this._data.push(item) - } else { - // Take a number between 0 and n + 1, drop the element at that index - // from the array. If the element to drop is the (n + 1)th, the new item is - // not added, otherwise the new item replaces the item that was - // dropped. - // This is effectively the same as adding the new element to the - // end, swapping the last element (the new one) with a random element in the list, - // then dropping the last element (the potentially swapped one) in the list. - const toReplace = Math.floor(Math.random() * (this.seen + 2)) - if (toReplace < this.limit) { - this._data[toReplace] = item - } - } - this.seen++ -} - -Reservoir.prototype.toArray = function toArray() { - return this._data -} - -Reservoir.prototype.merge = function merge(items) { - if (!items || !items.length) { - return - } - if (items === this._data) { - return - } - for (let i = 0; i < items.length; i++) { - this.add(items[i]) - } -} - -Reservoir.prototype.setLimit = function setLimit(newLimit) { - this.limit = newLimit - if (this._data.length > newLimit) { - this._data = this._data.slice(0, newLimit) - } -} - -module.exports = Reservoir diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/sampler.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/sampler.js deleted file mode 100644 index 96c7c66f0..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/sampler.js +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('./metrics/names') -const logger = require('./logger').child({ component: 'sampler' }) -const Timer = require('./timer') -const os = require('os') - -/* - * - * CONSTANTS - * - */ -const MILLIS = 1e3 -const MICROS = 1e6 -const CPUS = os.cpus().length -const SAMPLE_INTERVAL = 15 * MILLIS - -let samplers = [] - -function Sampler(sampler, interval) { - this.id = setInterval(sampler, interval) - this.id.unref() -} - -Sampler.prototype.stop = function stop() { - clearInterval(this.id) -} - -function recordQueueTime(agent, timer) { - timer.end() - agent.metrics.measureMilliseconds(NAMES.EVENTS.WAIT, null, timer.getDurationInMillis()) -} - -function sampleMemory(agent) { - return function memorySampler() { - try { - const mem = process.memoryUsage() - agent.metrics.measureBytes(NAMES.MEMORY.PHYSICAL, mem.rss) - agent.metrics.measureBytes(NAMES.MEMORY.USED_HEAP, mem.heapUsed) - agent.metrics.measureBytes(NAMES.MEMORY.MAX_HEAP, mem.heapTotal) - agent.metrics.measureBytes(NAMES.MEMORY.FREE_HEAP, mem.heapTotal - mem.heapUsed) - agent.metrics.measureBytes(NAMES.MEMORY.USED_NONHEAP, mem.rss - mem.heapTotal) - logger.trace(mem, 'Recorded memory') - } catch (e) { - logger.debug('Could not record memory usage', e) - } - } -} - -function checkEvents(agent) { - return function eventSampler() { - const timer = new Timer() - timer.begin() - setTimeout(recordQueueTime.bind(null, agent, timer), 0) - } -} - -function getCpuSample(lastSample) { - try { - return process.cpuUsage(lastSample) - } catch (e) { - logger.debug('Could not record cpu usage', e) - return null - } -} - -function generateCPUMetricRecorder(agent) { - let lastSampleTime - // userTime and sysTime are in seconds - return function recordCPUMetrics(userTime, sysTime) { - let elapsedUptime - if (!lastSampleTime) { - elapsedUptime = process.uptime() - } else { - elapsedUptime = (Date.now() - lastSampleTime) / MILLIS - } - - const totalCpuTime = CPUS * elapsedUptime - - lastSampleTime = Date.now() - - const userUtil = userTime / totalCpuTime - const sysUtil = sysTime / totalCpuTime - - recordValue(agent, NAMES.CPU.USER_TIME, userTime) - recordValue(agent, NAMES.CPU.SYSTEM_TIME, sysTime) - recordValue(agent, NAMES.CPU.USER_UTILIZATION, userUtil) - recordValue(agent, NAMES.CPU.SYSTEM_UTILIZATION, sysUtil) - } -} - -function sampleCpu(agent) { - let lastSample - const recordCPU = generateCPUMetricRecorder(agent) - return function cpuSampler() { - const cpuSample = getCpuSample(lastSample) - lastSample = getCpuSample() - - if (lastSample == null) { - return - } - - recordCPU(cpuSample.user / MICROS, cpuSample.system / MICROS) - } -} - -function sampleLoop(agent, nativeMetrics) { - return function loopSampler() { - // Convert from microseconds to seconds - const loopMetrics = nativeMetrics.getLoopMetrics() - divideMetric(loopMetrics.usage, MICROS) - - recordCompleteMetric(agent, NAMES.LOOP.USAGE, loopMetrics.usage) - } -} - -function sampleGc(agent, nativeMetrics) { - return function gcSampler() { - const gcMetrics = nativeMetrics.getGCMetrics() - - Object.keys(gcMetrics).forEach(function forEachGCType(gcType) { - // Convert from milliseconds to seconds. - const gc = gcMetrics[gcType] - divideMetric(gc.metrics, MILLIS) - - recordCompleteMetric(agent, NAMES.GC.PAUSE_TIME, gc.metrics) - if (gc.type) { - recordCompleteMetric(agent, NAMES.GC.PREFIX + gc.type, gc.metrics) - } else { - logger.debug(gc, 'Unknown GC type %j', gc.typeId) - } - }) - } -} - -module.exports = { - state: 'stopped', - sampleMemory: sampleMemory, - checkEvents: checkEvents, - sampleCpu: sampleCpu, - sampleGc: sampleGc, - sampleLoop: sampleLoop, - nativeMetrics: null, - - start: function start(agent) { - samplers.push(new Sampler(sampleMemory(agent), 5 * MILLIS)) - samplers.push(new Sampler(checkEvents(agent), SAMPLE_INTERVAL)) - - // This requires a native module which may have failed to build. - if (agent.config.plugins.native_metrics.enabled && !this.nativeMetrics) { - try { - this.nativeMetrics = require('@newrelic/native-metrics')({ - timeout: SAMPLE_INTERVAL - }) - } catch (err) { - logger.info( - { error: { message: err.message, stack: err.stack } }, - 'Not adding native metric sampler.' - ) - agent.metrics - .getOrCreateMetric(NAMES.SUPPORTABILITY.DEPENDENCIES + '/NoNativeMetricsModule') - .incrementCallCount() - } - } - - if (this.nativeMetrics) { - if (!this.nativeMetrics.bound) { - this.nativeMetrics.bind(SAMPLE_INTERVAL) - } - - // Add GC events if available. - if (this.nativeMetrics.gcEnabled) { - samplers.push(new Sampler(sampleGc(agent, this.nativeMetrics), SAMPLE_INTERVAL)) - } - - // Add loop metrics if available. - if (this.nativeMetrics.loopEnabled) { - samplers.push(new Sampler(sampleLoop(agent, this.nativeMetrics), SAMPLE_INTERVAL)) - } - } - - // Add CPU sampling using the built-in data (introduced in 6.1.0) - samplers.push(new Sampler(sampleCpu(agent), SAMPLE_INTERVAL)) - - this.state = 'running' - }, - - stop: function stop() { - samplers.forEach(function forEachSampler(s) { - s.stop() - }) - samplers = [] - this.state = 'stopped' - if (this.nativeMetrics) { - this.nativeMetrics.unbind() - this.nativeMetrics.removeAllListeners() - - // Setting this.nativeMetrics to null allows us to config a new - // nativeMetrics object after the first start call. - this.nativeMetrics = null - } - } -} - -function recordValue(agent, metric, value) { - const stats = agent.metrics.getOrCreateMetric(metric) - stats.recordValue(value) - logger.trace('Recorded metric %s: %j', metric, value) -} - -function recordCompleteMetric(agent, metricName, metric) { - const stats = agent.metrics.getOrCreateMetric(metricName) - stats.merge(metric) - logger.trace('Recorded metric %s: %j', metricName, metric) -} - -function divideMetric(metric, divisor) { - metric.min /= divisor - metric.max /= divisor - metric.total /= divisor - metric.sumOfSquares /= divisor * divisor -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/api-gateway.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/api-gateway.js deleted file mode 100644 index 2913a8013..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/api-gateway.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * This class captures data needed to construct a web transaction from - * an API Gateway Lambda proxy request. This is to be used with the setWebRequest - * method. - */ -class LambdaProxyWebRequest { - constructor(event) { - const lowerCaseHeaders = normalizeHeaders(event, true) - - this.headers = normalizeHeaders(event) - this.url = { - path: event.path, - port: lowerCaseHeaders['x-forwarded-port'], - requestParameters: normalizeQueryStringParameters(event) - } - this.method = event.httpMethod - this.transportType = lowerCaseHeaders['x-forwarded-proto'] - } -} - -/** - * This class captures data necessary to create a web transaction from the lambda's web - * response to API Gateway when used with API Gateway Lambda proxy. This is to be used - * with the setWebResponse method. - */ -class LambdaProxyWebResponse { - constructor(lambdaResponse) { - this.headers = normalizeHeaders(lambdaResponse) - this.statusCode = lambdaResponse.statusCode - } -} - -/** - * normalizes query string parameters either from multi value query string parameters or normal query string parameters to a - * key map with comma separated strings - * - * @param {object} event The event with query string to normalize - * @returns {Object} The normalized query string map - */ -function normalizeQueryStringParameters(event) { - if (!event.multiValueQueryStringParameters) { - return event.queryStringParameters - } - return Object.fromEntries( - Object.entries(event.multiValueQueryStringParameters).map(([param, value]) => { - if (Array.isArray(value)) { - return [param, value.join(',')] - } - return [param, value] - }) - ) -} - -/** - * Normalizes both request and response headers, - * either from Multi Value headers or "normal" headers to a - * lowercase key map with comma separated string - * - * @param {object} event The event with headers to normalize - * @param {boolean} lowerCaseKey Whether to lowercase the header names or not - * @returns {Object} The normalized headers map - */ -function normalizeHeaders(event, lowerCaseKey = false) { - const headers = event.multiValueHeaders ?? event.headers - - if (!headers) { - return - } - - return Object.fromEntries( - Object.entries(headers).map(([headerKey, headerValue]) => { - const newKey = lowerCaseKey ? headerKey.toLowerCase() : headerKey - - if (Array.isArray(headerValue)) { - return [newKey, headerValue.join(',')] - } - return [newKey, headerValue] - }) - ) -} - -/** - * Determines if Lambda event appears to be a valid Lambda Proxy event. - * - * @param {object} event The event to inspect. - * @returns {boolean} Whether the given object contains fields necessary - * to create a web transaction. - */ -function isLambdaProxyEvent(event) { - return !!(event.path && (event.headers ?? event.multiValueHeaders) && event.httpMethod) -} - -/** - * Determines if Lambda event appears to be a valid Lambda Proxy response. - * - * @param {object} response The response to inspect. - * @returns {boolean} Whether the given object contains fields necessary - * to create a web transaction. - */ -function isValidLambdaProxyResponse(response) { - return !!(response && response.statusCode) -} - -module.exports = { - LambdaProxyWebRequest, - LambdaProxyWebResponse, - isLambdaProxyEvent, - isValidLambdaProxyResponse -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/aws-lambda.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/aws-lambda.js deleted file mode 100644 index f5b6739eb..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/aws-lambda.js +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const apiGateway = require('./api-gateway') -const headerAttributes = require('../header-attributes') -const get = require('../util/get') -const logger = require('../logger').child({ component: 'aws-lambda' }) -const recordBackground = require('../metrics/recorders/other') -const recordWeb = require('../metrics/recorders/http') -const TransactionShim = require('../shim/transaction-shim') -const urltils = require('../util/urltils') - -// CONSTANTS -const ATTR_DEST = require('../config/attribute-filter').DESTINATIONS -const COLD_START_KEY = 'aws.lambda.coldStart' -const EVENT_SOURCE_PREFIX = 'aws.lambda.eventSource' -const EVENT_SOURCE_ARN_KEY = `${EVENT_SOURCE_PREFIX}.arn` -const EVENT_SOURCE_TYPE_KEY = `${EVENT_SOURCE_PREFIX}.eventType` -const NAMES = require('../metrics/names') - -const EVENT_SOURCE_INFO = require('./event-sources') - -// A function with no references used to stub out closures -function cleanClosure() {} - -// this array holds all the closures used to end transactions -let transactionEnders = [] - -// this tracks unhandled exceptions to be able to relate them back to -// the invocation transaction. -let uncaughtException = null - -// Tracking the first time patchLambdaHandler is called for one off functionality -let patchCalled = false -let coldStartRecorded = false - -class AwsLambda { - constructor(agent) { - this.agent = agent - this.shim = new TransactionShim(agent, 'aws-lambda') - } - - // FOR TESTING PURPOSES ONLY - _resetModuleState() { - patchCalled = false - coldStartRecorded = false - transactionEnders = [] - } - - _detectEventType(event) { - const pathMatch = (obj, path) => { - return get(obj, path, null) !== null - } - - for (const typeInfo of Object.values(EVENT_SOURCE_INFO)) { - if (typeInfo.required_keys.every((path) => pathMatch(event, path))) { - return typeInfo - } - } - - return null - } - - wrapEnders() { - const shim = this.shim - // There is no prependListener in node 4, so we wrap emit to look for 'beforeExit' - // NOTE: This may be converted to holding onto a single ender function if only - // one invocation is executing at a time. - shim.wrap(process, 'emit', function wrapEmit(shim, emit) { - return function wrappedEmit(ev, error) { - // need to add error as uncaughtException to be used - // later to add to transaction errors - if (ev === 'unhandledRejection') { - uncaughtException = error - } - - if (['beforeExit', 'unhandledRejection'].includes(ev)) { - transactionEnders.forEach((ender) => { - ender() - }) - transactionEnders = [] - } - return emit.apply(process, arguments) - } - }) - } - - wrapFatal() { - const shim = this.shim - shim.wrap(process, '_fatalException', function wrapper(shim, original) { - return function wrappedFatalException(error) { - // logic placed before the _fatalException call, since it ends the invocation - uncaughtException = error - transactionEnders.forEach((ender) => { - ender() - }) - transactionEnders = [] - return original.apply(this, arguments) - } - }) - } - - patchLambdaHandler(handler) { - const awsLambda = this - const shim = this.shim - - if (typeof handler !== 'function') { - logger.warn('handler argument is not a function and cannot be recorded') - return handler - } - - if (!patchCalled) { - // Only wrap emit on process the first time patch is called. - patchCalled = true - - this.wrapEnders() - this.wrapFatal() - } - - return shim.bindCreateTransaction(wrappedHandler, { type: shim.BG }) - - function wrappedHandler() { - const args = shim.argsToArray.apply(shim, arguments) - - const event = args[0] - const context = args[1] - - const functionName = context.functionName - const group = NAMES.FUNCTION.PREFIX - const transactionName = group + functionName - - const transaction = shim.tracer.getTransaction() - if (!transaction) { - return handler.apply(this, arguments) - } - - transaction.setPartialName(transactionName) - - const isApiGatewayLambdaProxy = apiGateway.isLambdaProxyEvent(event) - const segmentRecorder = isApiGatewayLambdaProxy ? recordWeb : recordBackground - const segment = shim.createSegment(functionName, segmentRecorder) - transaction.baseSegment = segment - // resultProcessor is used to execute additional logic based on the - // payload supplied to the callback. - let resultProcessor - if (isApiGatewayLambdaProxy) { - const webRequest = new apiGateway.LambdaProxyWebRequest(event) - setWebRequest(shim, transaction, webRequest) - resultProcessor = getApiGatewayLambdaProxyResultProcessor(transaction) - } - - const cbIndex = args.length - 1 - - // Add transaction ending closure to the list of functions to be called on - // beforeExit (i.e. in the case that context.{done,fail,succeed} or callback - // were not called). - const txnEnder = endTransaction.bind(null, transaction, transactionEnders.length) - - transactionEnders.push(txnEnder) - - args[cbIndex] = awsLambda.wrapCallbackAndCaptureError( - transaction, - txnEnder, - args[cbIndex], - resultProcessor - ) - - // context.{done,fail,succeed} are all considered deprecated by - // AWS, but are considered functional. - context.done = awsLambda.wrapCallbackAndCaptureError(transaction, txnEnder, context.done) - context.fail = awsLambda.wrapCallbackAndCaptureError(transaction, txnEnder, context.fail) - shim.wrap(context, 'succeed', function wrapSucceed(shim, original) { - return function wrappedSucceed() { - txnEnder() - return original.apply(this, arguments) - } - }) - - const awsAttributes = awsLambda._getAwsAgentAttributes(event, context) - transaction.trace.attributes.addAttributes(ATTR_DEST.TRANS_COMMON, awsAttributes) - - shim.agent.setLambdaArn(context.invokedFunctionArn) - - shim.agent.setLambdaFunctionVersion(context.functionVersion) - segment.addSpanAttributes(awsAttributes) - - segment.start() - - let res - try { - res = shim.applySegment(handler, segment, false, this, args) - } catch (err) { - uncaughtException = err - txnEnder() - throw err - } - if (shim.isPromise(res)) { - res = lambdaInterceptPromise(res, resultProcessor, txnEnder) - } - return res - } - - // In order to capture error events - // we need to store the error in uncaughtException - // otherwise the transaction will end before they are captured - function lambdaInterceptPromise(prom, resultProcessor, cb) { - prom.then( - function onThen(arg) { - if (resultProcessor) { - resultProcessor(arg) - } - cb() - }, - function onCatch(err) { - uncaughtException = err - cb() - } - ) - return prom - } - } - - wrapCallbackAndCaptureError(transaction, txnEnder, cb, processResult) { - const shim = this.shim - return function wrappedCallback() { - let err = arguments[0] - if (typeof err === 'string') { - err = new Error(err) - } - - shim.agent.errors.add(transaction, err) - - if (processResult) { - const result = arguments[1] - processResult(result) - } - - txnEnder() - - return cb.apply(this, arguments) - } - } - - _getAwsAgentAttributes(event, context) { - const attributes = { - 'aws.lambda.arn': context.invokedFunctionArn, - 'aws.requestId': context.awsRequestId - } - - const eventSourceInfo = this._detectEventType(event) - - if (eventSourceInfo) { - attributes[EVENT_SOURCE_TYPE_KEY] = eventSourceInfo.name - - for (const key of Object.keys(eventSourceInfo.attributes)) { - const value = get(event, eventSourceInfo.attributes[key], null) - - if (value === null) { - continue - } - - attributes[key] = value - } - } - - setEventSourceAttributes(event, attributes) - - if (!coldStartRecorded) { - coldStartRecorded = attributes[COLD_START_KEY] = true - } - - return attributes - } -} - -function setEventSourceAttributes(event, attributes) { - if (event.Records) { - const record = event.Records[0] - if (record.eventSourceARN) { - // SQS/Kinesis Stream/DynamoDB/CodeCommit - attributes[EVENT_SOURCE_ARN_KEY] = record.eventSourceARN - } else if (record.s3 && record.s3.bucket && record.s3.bucket.arn) { - // S3 - attributes[EVENT_SOURCE_ARN_KEY] = record.s3.bucket.arn - } else if (record.EventSubscriptionArn) { - // SNS - attributes[EVENT_SOURCE_ARN_KEY] = record.EventSubscriptionArn - } else { - logger.trace('Unable to determine ARN from event record.', event, record) - } - } else if (event.records && event.deliveryStreamArn) { - // Kinesis Firehose - attributes[EVENT_SOURCE_ARN_KEY] = event.deliveryStreamArn - } else if ( - event.requestContext && - event.requestContext.elb && - event.requestContext.elb.targetGroupArn - ) { - attributes[EVENT_SOURCE_ARN_KEY] = event.requestContext.elb.targetGroupArn - } else if (event.resources && event.resources[0]) { - attributes[EVENT_SOURCE_ARN_KEY] = event.resources[0] - } else { - logger.trace('Unable to determine ARN for event type.', event) - } -} - -function getApiGatewayLambdaProxyResultProcessor(transaction) { - return function processApiGatewayLambdaProxyResponse(response) { - if (apiGateway.isValidLambdaProxyResponse(response)) { - const webResponse = new apiGateway.LambdaProxyWebResponse(response) - setWebResponse(transaction, webResponse) - } else { - logger.debug('Did not contain a valid API Gateway Lambda Proxy response.') - } - } -} - -function setWebRequest(shim, transaction, request) { - transaction.type = shim.WEB - - const segment = transaction.baseSegment - - transaction.url = urltils.scrub(request.url.path) - transaction.verb = request.method - transaction.trace.attributes.addAttribute( - ATTR_DEST.TRANS_COMMON, - 'request.method', - request.method - ) - - segment.addSpanAttribute('request.method', request.method) - - transaction.port = request.url.port - - // These are only query parameters, from lib/serverless/api-gateway.js - transaction.addRequestParameters(request.url.requestParameters) - - // URL is sent as an agent attribute with transaction events - transaction.trace.attributes.addAttribute( - ATTR_DEST.TRANS_EVENT | ATTR_DEST.ERROR_EVENT, - 'request.uri', - request.url.path - ) - - segment.addSpanAttribute('request.uri', request.url.path) - - headerAttributes.collectRequestHeaders(request.headers, transaction) - - if (shim.agent.config.distributed_tracing.enabled) { - const lowercaseHeaders = lowercaseObjectKeys(request.headers) - - const transportType = request.transportType && request.transportType.toUpperCase() - transaction.acceptDistributedTraceHeaders(transportType, lowercaseHeaders) - } -} - -function lowercaseObjectKeys(original) { - return Object.keys(original).reduce((destination, key) => { - destination[key.toLowerCase()] = original[key] - return destination - }, {}) -} - -function endTransaction(transaction, enderIndex) { - if (transactionEnders[enderIndex] === cleanClosure) { - // In the case where we have already been called, we return early. There may be a - // case where this is called more than once, given the lambda is left in a dirty - // state after thread suspension (e.g. timeouts) - return - } - - if (uncaughtException !== null) { - transaction.agent.errors.add(transaction, uncaughtException) - uncaughtException = null - } - - transaction.baseSegment.end() - - // Clear the end closure to let go of captured references - transactionEnders[enderIndex] = cleanClosure - transaction.finalizeName() - transaction.end() - try { - transaction.agent.harvestSync() - } catch (err) { - logger.warn('Failed to harvest transaction', err) - } -} - -function setWebResponse(transaction, response) { - transaction.statusCode = response.statusCode - - const responseCode = String(response.statusCode) - - if (/^\d+$/.test(responseCode)) { - transaction.trace.attributes.addAttribute( - ATTR_DEST.TRANS_COMMON, - 'http.statusCode', - responseCode - ) - - // We are adding http.statusCode to base segment as - // we found in testing async invoked lambdas, the - // active segement is not available at this point. - const segment = transaction.baseSegment - - segment.addSpanAttribute('http.statusCode', responseCode) - } - - headerAttributes.collectResponseHeaders(response.headers, transaction) -} - -module.exports = AwsLambda diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/event-sources.json b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/event-sources.json deleted file mode 100644 index d2f48e12d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/serverless/event-sources.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "alb": { - "attributes": {}, - "name": "alb", - "required_keys": [ - "httpMethod", - "requestContext.elb" - ] - }, - "apiGateway": { - "attributes": { - "aws.lambda.eventSource.accountId": "requestContext.accountId", - "aws.lambda.eventSource.apiId": "requestContext.apiId", - "aws.lambda.eventSource.resourceId": "requestContext.resourceId", - "aws.lambda.eventSource.resourcePath": "requestContext.resourcePath", - "aws.lambda.eventSource.stage": "requestContext.stage" - }, - "name": "apiGateway", - "required_keys": [ - "headers", - "httpMethod", - "path", - "requestContext", - "requestContext.stage" - ] - }, - "cloudFront": { - "attributes": {}, - "name": "cloudFront", - "required_keys": [ - "Records[0].cf" - ] - }, - "cloudWatchScheduled": { - "attributes": { - "aws.lambda.eventSource.account": "account", - "aws.lambda.eventSource.id": "id", - "aws.lambda.eventSource.region": "region", - "aws.lambda.eventSource.resource": "resources[0]", - "aws.lambda.eventSource.time": "time" - }, - "name": "cloudWatch_scheduled", - "required_keys": [ - "detail-type", - "source" - ] - }, - "dynamoStreams": { - "attributes": { - "aws.lambda.eventSource.length": "Records.length" - }, - "name": "dynamo_streams", - "required_keys": [ - "Records[0].dynamodb" - ] - }, - "firehose": { - "attributes": { - "aws.lambda.eventSource.length": "records.length", - "aws.lambda.eventSource.region": "region" - }, - "name": "firehose", - "required_keys": [ - "deliveryStreamArn", - "records[0].kinesisRecordMetadata" - ] - }, - "kinesis": { - "attributes": { - "aws.lambda.eventSource.length": "Records.length", - "aws.lambda.eventSource.region": "Records[0].awsRegion" - }, - "name": "kinesis", - "required_keys": [ - "Records[0].kinesis" - ] - }, - "s3": { - "attributes": { - "aws.lambda.eventSource.bucketName": "Records[0].s3.bucket.name", - "aws.lambda.eventSource.eventName": "Records[0].eventName", - "aws.lambda.eventSource.eventTime": "Records[0].eventTime", - "aws.lambda.eventSource.length": "Records.length", - "aws.lambda.eventSource.objectKey": "Records[0].s3.object.key", - "aws.lambda.eventSource.objectSequencer": "Records[0].s3.object.sequencer", - "aws.lambda.eventSource.objectSize": "Records[0].s3.object.size", - "aws.lambda.eventSource.region": "Records[0].awsRegion" - }, - "name": "s3", - "required_keys": [ - "Records[0].s3" - ] - }, - "ses": { - "attributes": { - "aws.lambda.eventSource.date": "Records[0].ses.mail.commonHeaders.date", - "aws.lambda.eventSource.length": "Records.length", - "aws.lambda.eventSource.messageId": "Records[0].ses.mail.commonHeaders.messageId", - "aws.lambda.eventSource.returnPath": "Records[0].ses.mail.commonHeaders.returnPath" - }, - "name": "ses", - "required_keys": [ - "Records[0].ses" - ] - }, - "sns": { - "attributes": { - "aws.lambda.eventSource.length": "Records.length", - "aws.lambda.eventSource.messageId": "Records[0].Sns.MessageId", - "aws.lambda.eventSource.timestamp": "Records[0].Sns.Timestamp", - "aws.lambda.eventSource.topicArn": "Records[0].Sns.TopicArn", - "aws.lambda.eventSource.type": "Records[0].Sns.Type" - }, - "name": "sns", - "required_keys": [ - "Records[0].Sns" - ] - }, - "sqs": { - "attributes": { - "aws.lambda.eventSource.length": "Records.length" - }, - "name": "sqs", - "required_keys": [ - "Records[0].receiptHandle" - ] - } -} \ No newline at end of file diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/conglomerate-shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/conglomerate-shim.js deleted file mode 100644 index 976b3c879..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/conglomerate-shim.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'ConglomerateShim' }) -const Shim = require('./shim') - -const { MODULE_TYPE } = require('./constants') -const SHIM_CLASSES = { - [MODULE_TYPE.GENERIC]: Shim, - [MODULE_TYPE.DATASTORE]: require('./datastore-shim'), - [MODULE_TYPE.MESSAGE]: require('./message-shim'), - [MODULE_TYPE.PROMISE]: require('./promise-shim'), - [MODULE_TYPE.TRANSACTION]: require('./transaction-shim'), - [MODULE_TYPE.WEB_FRAMEWORK]: require('./webframework-shim') -} - -/** - * A shim for wrapping all-in-one modules which implement multiple services. - * - * @private - * @augments Shim - * @param {Agent} agent The agent this shim will use. - * @param {string} moduleName The name of the module being instrumented. - * @param {string} resolvedName The full path to the loaded module. - * @param {string} shimName Used to persist shim ids across different shim instances. - */ -class ConglomerateShim extends Shim { - constructor(agent, moduleName, resolvedName, shimName) { - super(agent, moduleName, resolvedName, shimName) - this._logger = logger.child({ module: moduleName }) - this._resolvedName = resolvedName - } - - get GENERIC() { - return MODULE_TYPE.GENERIC - } - get DATASTORE() { - return MODULE_TYPE.DATASTORE - } - get MESSAGE() { - return MODULE_TYPE.MESSAGE - } - get PROMISE() { - return MODULE_TYPE.PROMISE - } - get TRANSACTION() { - return MODULE_TYPE.TRANSACTION - } - get WEB_FRAMEWORK() { - return MODULE_TYPE.WEB_FRAMEWORK - } - - /** - * Constructs a new `Shim` of the specified type for instrumenting submodules - * of the conglomerate module. - * - * @param {MODULE_TYPE} type - The type of shim to construct. - * @param {string} submodule - The name of the submodule this will instrument. - * @returns {Shim} A new shim of the given type. - */ - makeSpecializedShim(type, submodule) { - const ShimClass = SHIM_CLASSES[type] - const shim = new ShimClass(this.agent, this.moduleName, this._resolvedName) - shim._logger = shim._logger.child({ submodule }) - return shim - } -} - -module.exports = ConglomerateShim diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/constants.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/constants.js deleted file mode 100644 index 8fa34ead9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/constants.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Enumeration of module instrumentation types. - * - * @private - * @readonly - * @enum {string} - */ -exports.MODULE_TYPE = { - /** Utility/generic module, such as pooling libraries. */ - GENERIC: 'generic', - - /** @private */ - CONGLOMERATE: 'conglomerate', - - /** Database module, such as the MongoDB or MySQL drivers. */ - DATASTORE: 'datastore', - - /** Messaging module, such as AMQP */ - MESSAGE: 'message', - - /** Promise module, such as Bluebird */ - PROMISE: 'promise', - - /** @private */ - TRANSACTION: 'transaction', - - /** Web server framework module, such as Express or Restify. */ - WEB_FRAMEWORK: 'web-framework', - - /** - * Used to load supportability metrics on installed verisions of packages - * that the Node.js agent does not instrument(i.e. - otel instrumentation or top logging libraries) - */ - TRACKING: 'tracking' -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/datastore-shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/datastore-shim.js deleted file mode 100644 index e1b255637..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/datastore-shim.js +++ /dev/null @@ -1,847 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const dbutil = require('../db/utils') -const hasOwnProperty = require('../util/properties').hasOwn -const logger = require('../logger').child({ component: 'DatastoreShim' }) -const metrics = require('../metrics/names') -const parseSql = require('../db/query-parsers/sql') -const ParsedStatement = require('../db/parsed-statement') -const Shim = require('./shim') -const urltils = require('../util/urltils') -const util = require('util') - -/** - * An enumeration of well-known datastores so that new instrumentations can use - * the same names we already use for first-party instrumentation. - * - * Each of these values is also exposed directly on the DatastoreShim class as - * static members. - * - * @readonly - * @memberof DatastoreShim - * @enum {string} - */ -const DATASTORE_NAMES = { - CASSANDRA: 'Cassandra', - DYNAMODB: 'DynamoDB', - MEMCACHED: 'Memcache', - MONGODB: 'MongoDB', - MYSQL: 'MySQL', - NEPTUNE: 'Neptune', - POSTGRES: 'Postgres', - REDIS: 'Redis', - PRISMA: 'Prisma' -} - -/** - * Default value for unknown instance parameters. - * - * @readonly - * @private - */ -const INSTANCE_UNKNOWN = 'unknown' - -const defaultParsers = { - SQL: parseSql -} - -/** - * Pre-defined query parsers for well-known languages. - * - * Each of these values is also exposed directly on the DatastoreShim class as - * static members. - * - * @readonly - * @memberof DatastoreShim - * @enum {string} - */ -const QUERY_PARSERS = { - SQL_PARSER: 'SQL' -} - -/** - * Constructs a shim associated with the given agent instance, specialized for - * instrumenting datastores. - * - * @class - * @augments Shim - * @classdesc A helper class for wrapping datastore modules. - * @param {Agent} agent The agent this shim will use. - * @param {string} moduleName The name of the module being instrumented. - * @param {string} resolvedName The full path to the loaded module. - * @param {string} shimName Used to persist shim ids across different shim instances. - * @see Shim - * @see DatastoreShim.DATASTORE_NAMES - */ -function DatastoreShim(agent, moduleName, resolvedName, shimName) { - Shim.call(this, agent, moduleName, resolvedName, shimName) - this._logger = logger.child({ module: moduleName }) - this.queryParser = defaultParsers[this.SQL_PARSER] -} -module.exports = DatastoreShim - -util.inherits(DatastoreShim, Shim) - -// Add constants on the shim for the well-known datastores. -DatastoreShim.DATASTORE_NAMES = DATASTORE_NAMES -Object.keys(DATASTORE_NAMES).forEach(function defineDatastoreMetricEnum(dsName) { - Shim.defineProperty(DatastoreShim, dsName, DATASTORE_NAMES[dsName]) - Shim.defineProperty(DatastoreShim.prototype, dsName, DATASTORE_NAMES[dsName]) -}) - -// Add constants on the shim for the provided query parsers. -DatastoreShim.QUERY_PARSERS = QUERY_PARSERS -Object.keys(QUERY_PARSERS).forEach(function defineQueryParserEnum(qpName) { - Shim.defineProperty(DatastoreShim, qpName, QUERY_PARSERS[qpName]) - Shim.defineProperty(DatastoreShim.prototype, qpName, QUERY_PARSERS[qpName]) -}) - -DatastoreShim.prototype.setDatastore = setDatastore -DatastoreShim.prototype.recordOperation = recordOperation -DatastoreShim.prototype.recordQuery = recordQuery -DatastoreShim.prototype.recordBatchQuery = recordBatchQuery -DatastoreShim.prototype.parseQuery = parseQuery -DatastoreShim.prototype.setParser = setParser -DatastoreShim.prototype.bindRowCallbackSegment = bindRowCallbackSegment -DatastoreShim.prototype.captureInstanceAttributes = captureInstanceAttributes -DatastoreShim.prototype.getDatabaseNameFromUseQuery = getDatabaseNameFromUseQuery - -// -------------------------------------------------------------------------- // - -/** - * @callback QuerySpecFunction - * @summary - * Used for determining information about a query when it can not be simply - * found in the arguments. - * @param {Shim} shim - * The shim this function was passed to. - * @param {Function} func - * The function being recorded. - * @param {string} name - * The name of the function. - * @param {Array.<*>} args - * The arguments being passed into the function. - * @returns {QuerySpec} The spec for how this query should be recorded. - * @see DatastoreShim#recordQuery - * @see DatastoreShim#recordBatchQuery - * @see QuerySpec - */ - -/** - * @callback QueryFunction - * @summary - * Pulls the query argument out from an array of arguments. - * @param {Shim} shim - * The shim this function was passed to. - * @param {Function} func - * The function being recorded. - * @param {string} name - * The name of the function. - * @param {Array.<*>} args - * The arguments being passed into the function. - * @returns {string} The query string from the arguments list. - * @see QuerySpec - * @see QuerySpecFunction - */ - -/** - * @callback QueryParserFunction - * @summary - * Used to parse queries to extract the basic information about it. - * @param {string} query - The query to be parsed. - * @returns {ParsedQueryData} An object containing the basic information about - * the query. - * @see DatastoreShim#setParser - * @see ParsedQueryData - */ - -/** - * @interface OperationSpec - * @description - * Describes the interface for an operation function. - * @property {string} [name] - * The name for this operation. If omitted, the operation function's name will - * used instead. - * @property {DatastoreParameters} [parameters] - * Extra parameters to be set on the metric for the operation. - * @property {boolean} [record=true] - * Indicates if the operation should be recorded as a metric. A segment will be - * created even if this is `false`. - * @property {number|CallbackBindFunction} [callback] - * If a number, it is the offset in the arguments array for the operation's - * callback argument. If it is a function, it should perform the segment - * binding to the callback. - * @property {boolean} [promise=false] - * If `true`, the return value will be wrapped as a Promise. - * @see DatastoreShim#recordOperation - * @see QuerySpec - * @see DatastoreParameters - */ - -/** - * @interface QuerySpec - * @augments OperationSpec - * @description - * Describes the interface for a query function. Extends {@link OperationSpec} - * with query-specific parameters. - * @property {boolean} [stream=false] - * If `true`, the return value will be wrapped as a stream. - * @property {number|string|QueryFunction} query - * If a number, it is the offset in the arguments array for the query string - * argument. If a string, it is the query being executed. If a function, it - * will be passed the arguments and must return the query string. - * @see DatastoreShim#recordQuery - * @see DatastoreShim#recordBatchQuery - * @see QuerySpecFunction - * @see QueryFunction - * @see OperationSpec - * @see DatastoreParameters - */ - -/** - * @interface DatastoreParameters - * @description - * Extra parameters which may be added to an operation or query segment. All of - * these properties are optional. - * @property {string} host - * The host of the database server being interacted with. If provided, along - * with `port_path_or_id`, then an instance metric will also be generated for - * this database. - * @property {number|string} port_path_or_id - * The port number or path to domain socket used to connect to the database - * server. - * @property {string} database_name - * The name of the database being queried or operated on. - * @see OperationSpec - * @see QuerySpec - */ - -/** - * @interface ParsedQueryData - * @description - * Returned by a {@link QueryParserFunction}, this information is used to - * generate the name for recording datastore queries. - * @property {string} operation - * The datastore operation such as `SELECT` or `UPDATE`. - * @property {string} collection - * The collection being queried. This would be the table name from a SQL - * statement or the collection name in a MongoDB query. - * @property {string} [query] - * The query with any sensitive information redacted and comments removed. - * @see DatastoreShim#setParser - * @see QueryParserFunction - */ - -// -------------------------------------------------------------------------- // - -/** - * Sets the vendor the module implements. - * - * This is used to determine the names for metrics and segments. If a string is - * passed, metric names will be generated using that name. - * - * This method *MUST* be called to use any methods that generate - * segments or metrics. - * - * @memberof DatastoreShim.prototype - * @param {string} datastore - * The name of this datastore. Use one of the well-known constants listed in - * {@link DatastoreShim.DATASTORE_NAMES} if available for the datastore. - * @see DatastoreShim.DATASTORE_NAMES - * @see DatastoreShim#recordBatchQuery - * @see DatastoreShim#recordQuery - * @see DatastoreShim#recordOperation - * @see DatastoreShim#parseQuery - */ -function setDatastore(datastore) { - this._metrics = { - PREFIX: datastore, - STATEMENT: metrics.DB.STATEMENT + '/' + datastore + '/', - OPERATION: metrics.DB.OPERATION + '/' + datastore + '/', - INSTANCE: metrics.DB.INSTANCE + '/' + datastore + '/', - ALL: metrics.DB.PREFIX + datastore + '/' + metrics.ALL - } - - this._datastore = datastore - - this._logger = this._logger.child({ datastore: this._metrics.PREFIX }) - this.logger.trace({ metrics: this._metrics }, 'Datastore metric names set') -} - -/** - * Sets the query parser used by this shim instance. - * - * @memberof DatastoreShim.prototype - * @param {string|QueryParserFunction} parser - * The string used to look up a default parser or the function used to parse - * queries. It is recommended that you use one of the well-known constants if - * available in the {@link DatastoreShim.QUERY_PARSERS}. - * @see DatastoreShim.QUERY_PARSERS - * @see QueryParserFunction - * @see ParsedQueryData - */ -function setParser(parser) { - if (this.isString(parser)) { - const newParser = defaultParsers[parser] - if (newParser) { - this.queryParser = newParser - } else { - this.logger.debug( - 'Attempted to set the query parser to invalid parser %s, not setting new parser', - parser - ) - } - } else if (this.isFunction(parser)) { - this.queryParser = parser - } else { - this.logger.trace('Received invalid parser (%s)', parser) - } -} - -/** - * Wraps the given properties as datastore operations that should be recorded. - * - * - `recordOperation(nodule, properties, opSpec)` - * - `recordOperation(func, opSpec)` - * - * The resulting wrapped methods will record their actions using the datastore - * `OPERATION` metric. - * - * NOTE: Calling this method before {@link DatastoreShim#setDatastore} - * will result in an exception. - * - * @memberof DatastoreShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {OperationSpec|SegmentFunction} opSpec - * The spec for this operation function. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see OperationSpec - * @see SegmentFunction - */ -function recordOperation(nodule, properties, opSpec) { - if (this.isObject(properties) && !this.isArray(properties)) { - // operation(func, opSpec) - opSpec = properties - properties = null - } - if (!opSpec) { - opSpec = Object.create(null) - } - - return this.record(nodule, properties, function opRecorder(shim, fn, fnName, args) { - shim.logger.trace('Recording datastore operation "%s"', fnName) - - // Derive the segment information, starting from some defaults - let segDesc = null - if (shim.isFunction(opSpec)) { - segDesc = opSpec.call(this, shim, fn, fnName, args) - } else { - segDesc = { - name: fnName || 'other', - opaque: false, - after: null, - promise: null, - ...opSpec - } - } - if (hasOwnProperty(segDesc, 'parameters')) { - _normalizeParameters.call(shim, segDesc.parameters) - } - - // Adjust the segment name with the metric prefix and add a recorder. - if (!hasOwnProperty(segDesc, 'record') || segDesc.record !== false) { - segDesc.name = shim._metrics.OPERATION + segDesc.name - segDesc.recorder = _recordOperationMetrics.bind(shim) - - segDesc.internal = true - } - - // And done. - return segDesc - }) -} - -/** - * Wraps the given properties as datastore query that should be recorded. - * - * - `recordQuery(nodule, properties, querySpec)` - * - `recordQuery(func, querySpec)` - * - * The resulting wrapped methods will record their actions using the datastore - * `STATEMENT` metric. - * - * NOTE: Calling this method before {@link DatastoreShim#setDatastore} - * will result in an exception. - * - * @memberof DatastoreShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {QuerySpec|QuerySpecFunction} querySpec - * The spec for this query function. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see DatastoreShim#recordBatchQuery - * @see QuerySpec - * @see QuerySpecFunction - */ -function recordQuery(nodule, properties, querySpec) { - return _recordQuery.call(this, '', nodule, properties, querySpec) -} - -/** - * Just like {@link DatastoreShim#recordQuery}, but with a `batch` suffix for - * the recorded metric. - * - * - `recordBatchQuery(nodule, properties, querySpec)` - * - `recordBatchQuery(func, querySpec)` - * - * The resulting wrapped methods will record their actions using the datastore - * `STATEMENT` metric with a `/batch` suffix. - * - * NOTE: Calling this method before {@link DatastoreShim#setDatastore} - * will result in an exception. - * - * @memberof DatastoreShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {QuerySpec|QuerySpecFunction} querySpec - * The spec for this query function. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see DatastoreShim#recordQuery - * @see QuerySpec - * @see QuerySpecFunction - */ -function recordBatchQuery(nodule, properties, querySpec) { - return _recordQuery.call(this, '/batch', nodule, properties, querySpec) -} - -/** - * Parses the given query to extract information for any metrics that will be - * created. - * - * NOTE: Calling this method before {@link DatastoreShim#setDatastore} - * will result in an exception. - * - * @memberof DatastoreShim.prototype - * @param {string} query - The query to parse. - * @param {object} nodule - Context for the queryParse to run under. - * @returns {ParsedStatement} The parsed query object. - * @see DatastoreShim#setParser - */ -function parseQuery(query, nodule) { - const parsed = this.queryParser.call(nodule, query) - - let collection = parsed.collection - // strip enclosing special characters from collection (table) name - if (typeof collection === 'string' && collection.length > 2) { - if (/^[\[{'"`]/.test(collection)) { - collection = collection.substr(1) - } - if (/[\]}'"`]$/.test(collection)) { - collection = collection.substr(0, collection.length - 1) - } - } - - const queryRecorded = - this.agent.config.transaction_tracer.record_sql === 'raw' || - this.agent.config.transaction_tracer.record_sql === 'obfuscated' - - return new ParsedStatement( - this._metrics.PREFIX, - parsed.operation, - collection, - queryRecorded ? parsed.query : null - ) -} - -/** - * Wraps the callback in an arguments array with one that is bound to a segment. - * - * - `bindRowCallbackSegment(args, cbIdx [, parentSegment])` - * - * @memberof DatastoreShim.prototype - * @param {Array} args - * The arguments array to replace the callback in. - * @param {number} cbIdx - * The index of the callback in the arguments array. - * @param {TraceSegment} [parentSegment] - * Optional. The segment to be the parent row callback's segment. Defaults to - * the segment active when the row callback is first called. - */ -function bindRowCallbackSegment(args, cbIdx, parentSegment) { - const idx = this.normalizeIndex(args.length, cbIdx) - if (idx === null) { - this.logger.debug('Not binding row callback, invalid cbIdx %s', cbIdx) - return - } - - // Pull out the callback and make sure it is a function. - const cb = args[idx] - if (!this.isFunction(cb)) { - this.logger.debug('Argument %d is not a function, not binding row callback', cbIdx) - return cb - } - this.logger.trace('Wrapping argument %d as a row callback.', cbIdx) - - // We have a little state to maintain through potentially multiple calls. - let callCounter = 0 - let segment = null - const segmentName = 'Callback: ' + this.getName(cb) - const shim = this - - const wrapper = this.bindSegment(function rowCallbackWrapper() { - // The first time this row callback is fired we want to touch the parent - // segment and create the callback segment. - if (++callCounter === 1) { - const realParent = parentSegment || shim.getSegment() - realParent && realParent.touch() - segment = shim.createSegment(segmentName, realParent) - - if (segment) { - segment.async = false - } - } - - // Update the segment name and run the actual callback. - if (segment) { - segment.addAttribute('count', callCounter) - } - - return shim.applySegment(cb, segment, true, this, arguments) - }, parentSegment) - - shim.assignOriginal(wrapper, cb, true) - args[idx] = wrapper -} - -/** - * Normalizes and adds datastore instance attributes to the current segment. - * - * If the current segment was not created by this shim then no action is taken. - * - * @memberof DatastoreShim.prototype - * @param {string} host - The name of the database host. - * @param {number|string} port - The port, path, or ID of the database server. - * @param {string} database - The name of the database in use. - */ -function captureInstanceAttributes(host, port, database) { - // See if we are currently in a segment created by us. - const segment = this.getSegment() - if (!segment || segment.shim !== this) { - this.logger.trace( - 'Not adding db instance metric attributes to segment %j', - segment && segment.name - ) - return - } - this.logger.trace('Adding db instance attributes to segment %j', segment.name) - - // Normalize the instance attributes. - const attributes = _normalizeParameters.call(this, { - host, - port_path_or_id: port, - database_name: database - }) - - for (const key in attributes) { - if (attributes[key]) { - segment.addAttribute(key, attributes[key]) - } - } -} - -/** - * Parses the database name from a `USE` SQL query. - * - * @param {string} query - The SQL query to parse the database name from. - * @returns {?string} The name of the database if it could be parsed, otherwise - * `null`. - */ -function getDatabaseNameFromUseQuery(query) { - return dbutil.extractDatabaseChangeFromUse(query) -} - -// -------------------------------------------------------------------------- // - -/** - * Wraps the given properties as datastore query that should be recorded. - * - * - `_recordQuery(suffix, nodule, properties, querySpec)` - * - `_recordQuery(suffix, func, querySpec)` - * - * The resulting wrapped methods will record their actions using the datastore - * `STATEMENT` metric. - * - * @private - * @this DatastoreShim - * @param {string} suffix - * Suffix to be added to the segment name. - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {QuerySpec|QueryFunction} querySpec - * The spec for this query function. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see DatastoreShim#recordQuery - * @see DatastoreShim#recordBatchQuery - * @see QuerySpec - * @see QuerySpecFunction - */ -function _recordQuery(suffix, nodule, properties, querySpec) { - if (this.isObject(properties) && !this.isArray(properties)) { - // _recordQuery(suffix, func, querySpec) - querySpec = properties - properties = null - } - if (!querySpec) { - this.logger.debug('Missing query spec for recordQuery, not wrapping.') - return nodule - } - - return this.record(nodule, properties, function queryRecord(shim, fn, fnName, args) { - shim.logger.trace('Determining query information for %j', fnName) - - let queryDesc = querySpec - if (shim.isFunction(querySpec)) { - queryDesc = querySpec.call(this, shim, fn, fnName, args) || Object.create(null) - } - - // Set some default values, in case they're missing. - queryDesc = { - name: fnName, - callback: null, - rowCallback: null, - stream: null, - after: null, - promise: null, - opaque: false, - inContext: null, - ...queryDesc - } - - const parameters = _normalizeParameters.call(shim, queryDesc.parameters || Object.create(null)) - - // If we're not actually recording this, then just return the segment - // descriptor now. - if (queryDesc?.record === false) { - return { - internal: false, - ...queryDesc, - parameters - } - } - - // Fetch the query string. - const queryStr = _extractQueryStr.call(shim, fn, fnName, queryDesc, this, args) - if (!shim.isString(queryStr)) { - return null - } - - // Parse the query and assemble the name. - const parsed = shim.parseQuery(queryStr, this) - const name = (parsed.collection || 'other') + '/' + parsed.operation + suffix - shim.logger.trace('Found and parsed query %s -> %s', parsed.type, name) - - // Return the segment descriptor. - return { - internal: true, - ...queryDesc, - // This name and parameters might override those in the original - // queryDesc. - name: shim._metrics.STATEMENT + name, - parameters, - recorder: function queryRecorder(segment, scope) { - if (segment) { - parsed.recordMetrics(segment, scope) - } - } - } - }) -} - -/** - * Records all the metrics required for database operations. - * - * - `_recordOperationMetrics(segment [, scope])` - * - * @private - * @this DatastoreShim - * @implements {MetricFunction} - * @param {TraceSegment} segment - The segment being recorded. - * @param {string} [scope] - The scope of the segment. - * @see DatastoreShim#recordOperation - * @see MetricFunction - */ -function _recordOperationMetrics(segment, scope) { - if (!segment) { - return - } - - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - const type = transaction.isWeb() ? 'allWeb' : 'allOther' - const operation = segment.name - - if (scope) { - transaction.measure(operation, scope, duration, exclusive) - } - - transaction.measure(operation, null, duration, exclusive) - transaction.measure(metrics.DB.PREFIX + type, null, duration, exclusive) - transaction.measure(metrics.DB.ALL, null, duration, exclusive) - transaction.measure(this._metrics.ALL, null, duration, exclusive) - transaction.measure( - metrics.DB.PREFIX + this._metrics.PREFIX + '/' + type, - null, - duration, - exclusive - ) - - const attributes = segment.getAttributes() - if (attributes.host && attributes.port_path_or_id) { - const instanceName = [ - metrics.DB.INSTANCE, - this._metrics.PREFIX, - attributes.host, - attributes.port_path_or_id - ].join('/') - - transaction.measure(instanceName, null, duration, exclusive) - } -} - -/** - * Extracts the query string from the arguments according to the given spec. - * - * - `_extractQueryStr(fn, fnName, spec, ctx, args)` - * - * @private - * @this DatastoreShim - * @param {Function} fn - The query function to be executed. - * @param {string} fnName - The name of the query function. - * @param {QuerySpec} spec - The query spec. - * @param {*} ctx - The context of the query function's execution. - * @param {Array} args - The arguments for the query function. - * @returns {?string} The query from the arguments if found, otherwise `null`. - */ -function _extractQueryStr(fn, fnName, spec, ctx, args) { - let queryStr = spec.query - if (this.isNumber(queryStr)) { - const queryIdx = this.normalizeIndex(args.length, queryStr) - if (queryIdx === null) { - this.logger.debug('Invalid query index %d of %d', queryStr, args.length) - return null - } - queryStr = args[queryIdx] - } else if (this.isFunction(queryStr)) { - queryStr = queryStr.call(ctx, this, fn, fnName, args) - } - - return queryStr -} - -/** - * Normalizes segment parameter values. - * - * - `_normalizeParameters([parameters])` - * - * Removes disabled parameters and corrects other values, such as changing host - * from `localhost` to the actual host name. - * - * @private - * @this DatastoreShim - * @param {object} [parameters={}] - The segment parameters to clean up. - * @returns {object} - The normalized segment parameters. - */ -function _normalizeParameters(parameters) { - parameters = parameters || Object.create(null) - const config = this.agent.config - const dsTracerConf = config.datastore_tracer - - parameters.product = parameters.product || this._datastore - - _normalizeDatabaseName(parameters, dsTracerConf) - _normalizeInstanceInformation(parameters, dsTracerConf, config) - - return parameters -} - -/** - * Normalizes the database name from segment parameter values. - * - * @private - * @param {object} parameters - The segment parameters to clean up. - * @param {object} dsTracerConf - The datastore tracer configuration - */ -function _normalizeDatabaseName(parameters, dsTracerConf) { - // Add database name if provided and enabled. - if (!dsTracerConf.database_name_reporting.enabled) { - delete parameters.database_name - } else if (hasOwnProperty(parameters, 'database_name') && parameters.database_name !== false) { - parameters.database_name = - typeof parameters.database_name === 'number' - ? String(parameters.database_name) - : parameters.database_name || INSTANCE_UNKNOWN - } -} - -/** - * Normalizes the database instance information from segment parameter - * values: host and the port/path/id. - * - * @private - * @param {object} parameters - The segment parameters to clean up. - * @param {object} dsTracerConf - The datastore tracer configuration - * @param {object} config - The agent configuration - */ -function _normalizeInstanceInformation(parameters, dsTracerConf, config) { - // Add instance information if enabled. - if (!dsTracerConf.instance_reporting.enabled) { - delete parameters.host - delete parameters.port_path_or_id - } else { - // Determine appropriate defaults for host and port. - if (hasOwnProperty(parameters, 'port_path_or_id')) { - parameters.port_path_or_id = String(parameters.port_path_or_id || INSTANCE_UNKNOWN) - } - if (hasOwnProperty(parameters, 'host')) { - if (parameters.host && urltils.isLocalhost(parameters.host)) { - parameters.host = config.getHostnameSafe(parameters.host) - } - - // Config's default name of a host is `UNKNOWN_BOX`. - if (!parameters.host || parameters.host === 'UNKNOWN_BOX') { - parameters.host = INSTANCE_UNKNOWN - } - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/index.js deleted file mode 100644 index 0b2a4cb13..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const constants = require('./constants') - -const Shim = require('./shim') -const ConglomerateShim = require('./conglomerate-shim') -const DatastoreShim = require('./datastore-shim') -const MessageShim = require('./message-shim') -const PromiseShim = require('./promise-shim') -const TransactionShim = require('./transaction-shim') -const WebFrameworkShim = require('./webframework-shim') -const properties = require('../util/properties') -const SHIM_TYPE_MAP = Object.create(null) -SHIM_TYPE_MAP[constants.MODULE_TYPE.GENERIC] = Shim -SHIM_TYPE_MAP[constants.MODULE_TYPE.CONGLOMERATE] = ConglomerateShim -SHIM_TYPE_MAP[constants.MODULE_TYPE.DATASTORE] = DatastoreShim -SHIM_TYPE_MAP[constants.MODULE_TYPE.MESSAGE] = MessageShim -SHIM_TYPE_MAP[constants.MODULE_TYPE.PROMISE] = PromiseShim -SHIM_TYPE_MAP[constants.MODULE_TYPE.TRANSACTION] = TransactionShim -SHIM_TYPE_MAP[constants.MODULE_TYPE.WEB_FRAMEWORK] = WebFrameworkShim - -/** - * - * @param type - * @param agent - * @param moduleName - * @param resolvedName - * @param shimName - */ -function createShimFromType(type, agent, moduleName, resolvedName, shimName) { - let shim = null - if (properties.hasOwn(SHIM_TYPE_MAP, type)) { - const ShimClass = SHIM_TYPE_MAP[type] - shim = new ShimClass(agent, moduleName, resolvedName, shimName) - } else { - shim = new Shim(agent, moduleName, resolvedName, shimName) - } - return shim -} - -exports.constants = constants -exports.Shim = Shim -exports.ConglomerateShim = ConglomerateShim -exports.DatastoreShim = DatastoreShim -exports.MessageShim = MessageShim -exports.PromiseShim = PromiseShim -exports.TransactionShim = TransactionShim -exports.WebFrameworkShim = WebFrameworkShim -exports.createShimFromType = createShimFromType diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/message-shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/message-shim.js deleted file mode 100644 index 2745b4844..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/message-shim.js +++ /dev/null @@ -1,822 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* eslint sonarjs/cognitive-complexity: ["error", 72] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252*/ - -const copy = require('../util/copy') -const genericRecorder = require('../metrics/recorders/generic') -const logger = require('../logger').child({ component: 'MessageShim' }) -const messageTransactionRecorder = require('../metrics/recorders/message-transaction') -const props = require('../util/properties') -const TransactionShim = require('./transaction-shim') -const Shim = require('./shim') // For Shim.defineProperty -const util = require('util') - -const ATTR_DESTS = require('../config/attribute-filter').DESTINATIONS - -/** - * Enumeration of well-known message brokers. - * - * @readonly - * @memberof MessageShim - * @enum {string} - */ -const LIBRARY_NAMES = { - IRONMQ: 'IronMQ', - KAFKA: 'Kafka', - RABBITMQ: 'RabbitMQ', - SNS: 'SNS', - SQS: 'SQS' -} - -/** - * Mapping of well-known message brokers to their distributed tracing transport - * type. - * - * @private - * @readonly - * @enum {string} - */ -const LIBRARY_TRANSPORT_TYPES = { - AMQP: TransactionShim.TRANSPORT_TYPES.AMQP, - IronMQ: TransactionShim.TRANSPORT_TYPES.IRONMQ, - Kafka: TransactionShim.TRANSPORT_TYPES.KAFKA, - RabbitMQ: TransactionShim.TRANSPORT_TYPES.AMQP -} - -/** - * Enumeration of possible message broker destination types. - * - * @readonly - * @memberof MessageShim - * @enum {string} - */ -const DESTINATION_TYPES = { - EXCHANGE: 'Exchange', - QUEUE: 'Queue', - TOPIC: 'Topic' -} - -/** - * Constructs a shim specialized for instrumenting message brokers. - * - * @class - * @augments TransactionShim - * @classdesc Used for instrumenting message broker client libraries. - * @param {Agent} agent The agent this shim will use. - * @param {string} moduleName The name of the module being instrumented. - * @param {string} resolvedName The full path to the loaded module. - * @param {string} shimName Used to persist shim ids across different shim instances. - * @see Shim - * @see TransactionShim - */ -function MessageShim(agent, moduleName, resolvedName, shimName) { - TransactionShim.call(this, agent, moduleName, resolvedName, shimName) - this._logger = logger.child({ module: moduleName }) - this._metrics = null - this._transportType = TransactionShim.TRANSPORT_TYPES.UNKNOWN -} -module.exports = MessageShim -util.inherits(MessageShim, TransactionShim) - -// Add constants on the shim for message broker libraries. -MessageShim.LIBRARY_NAMES = LIBRARY_NAMES -Object.keys(LIBRARY_NAMES).forEach(function defineLibraryEnum(libName) { - Shim.defineProperty(MessageShim, libName, LIBRARY_NAMES[libName]) - Shim.defineProperty(MessageShim.prototype, libName, LIBRARY_NAMES[libName]) -}) - -// Add constants to the shim for message broker destination types. -MessageShim.DESTINATION_TYPES = DESTINATION_TYPES -Object.keys(DESTINATION_TYPES).forEach(function defineTypesEnum(type) { - Shim.defineProperty(MessageShim, type, DESTINATION_TYPES[type]) - Shim.defineProperty(MessageShim.prototype, type, DESTINATION_TYPES[type]) -}) - -MessageShim.prototype.setLibrary = setLibrary -MessageShim.prototype.recordProduce = recordProduce -MessageShim.prototype.recordConsume = recordConsume -MessageShim.prototype.recordPurgeQueue = recordPurgeQueue -MessageShim.prototype.recordSubscribedConsume = recordSubscribedConsume - -// -------------------------------------------------------------------------- // - -/** - * @callback MessageFunction - * @summary - * Used for determining information about a message either being produced or - * consumed. - * @param {MessageShim} shim - * The shim this function was handed to. - * @param {Function} func - * The produce method or message consumer. - * @param {string} name - * The name of the producer or consumer. - * @param {Array.<*>} args - * The arguments being passed into the produce method or consumer. - * @returns {MessageSpec} The specification for the message being produced or - * consumed. - * @see MessageShim#recordProduce - * @see MessageShim#recordConsume - */ - -/** - * @callback MessageHandlerFunction - * @summary - * A function that is used to extract properties from a consumed message. This - * method is handed the results of a consume call. If the consume used a - * callback, then this method will receive the arguments to the callback. If - * the consume used a promise, then this method will receive the resolved - * value. - * @param {MessageShim} shim - * The shim this function was handed to. - * @param {Function} func - * The produce method or message consumer. - * @param {string} name - * The name of the producer or consumer. - * @param {Array|*} args - * Either the arguments for the consumer callback function or the result of - * the resolved consume promise, depending on the mode of the instrumented - * method. - * @returns {MessageSpec} The extracted properties of the consumed message. - * @see MessageShim#recordConsume - */ - -/** - * @callback MessageConsumerWrapperFunction - * @summary - * Function that is used to wrap message consumer functions. Used along side - * the MessageShim#recordSubscribedConsume API method. - * @param {MessageShim} shim - * The shim this function was handed to. - * @param {Function} consumer - * The message consumer to wrap. - * @param {string} name - * The name of the consumer method. - * @param {string} queue - * The name of the queue this consumer is being subscribed to. - * @returns {Function} The consumer method, possibly wrapped. - * @see MessageShim#recordSubscribedConsume - * @see MessageShim#recordConsume - */ - -/** - * @interface MessageSpec - * @augments RecorderSpec - * @description - * The specification for a message being produced or consumed. - * @property {string} destinationName - * The name of the exchange or queue the message is being produced to or - * consumed from. - * @property {MessageShim.DESTINATION_TYPES} [destinationType=null] - * The type of the destination. Defaults to `shim.EXCHANGE`. - * @property {object} [headers=null] - * A reference to the message headers. On produce, more headers will be added - * to this object which should be sent along with the message. On consume, - * cross-application headers will be read from this object. - * @property {string} [routingKey=null] - * The routing key for the message. If provided on consume, the routing key - * will be added to the transaction attributes as `message.routingKey`. - * @property {string} [queue=null] - * The name of the queue the message was consumed from. If provided on - * consume, the queue name will be added to the transaction attributes as - * `message.queueName`. - * @property {string} [parameters.correlation_id] - * In AMQP, this should be the correlation Id of the message, if it has one. - * @property {string} [parameters.reply_to] - * In AMQP, this should be the name of the queue to reply to, if the message - * has one. - * @property {MessageHandlerFunction} [messageHandler] - * An optional function to extract message properties from a consumed message. - * This method is only used in the consume case to pull data from the - * retrieved message. - * @see RecorderSpec - * @see MessageShim#recordProduce - * @see MessageShim#recordConsume - * @see MessageShim.DESTINATION_TYPES - */ - -/** - * @interface MessageSubscribeSpec - * @augments MessageSpec - * @description - * Specification for message subscriber methods. That is, methods which - * register a consumer to start receiving messages. - * @property {number} consumer - * The index of the consumer in the method's arguments. Note that if the - * consumer and callback indexes point to the same argument, the argument will - * be wrapped as a consumer. - * @property {MessageHandlerFunction} messageHandler - * A function to extract message properties from a consumed message. - * This method is only used in the consume case to pull data from the - * retrieved message. Its return value is combined with the `MessageSubscribeSpec` - * to fully describe the consumed message. - * @see MessageSpec - * @see MessageConsumerWrapperFunction - * @see MessageShim#recordSubscribedConsume - */ - -// -------------------------------------------------------------------------- // - -/** - * Sets the vendor of the message broker being instrumented. - * - * This is used to generate the names for metrics and segments. If a string is - * passed, metric names will be generated using that. - * - * @memberof MessageShim.prototype - * @param {MessageShim.LIBRARY_NAMES|string} library - * The name of the message broker library. Use one of the well-known constants - * listed in {@link MessageShim.LIBRARY_NAMES} if available for the library. - * @see MessageShim.LIBRARY_NAMES - */ -function setLibrary(library) { - this._metrics = { - PREFIX: 'MessageBroker/', - LIBRARY: library, - PRODUCE: 'Produce/', - CONSUME: 'Consume/', - PURGE: 'Purge/', - NAMED: 'Named/', - TEMP: 'Temp' - } - - if (LIBRARY_TRANSPORT_TYPES[library]) { - this._transportType = LIBRARY_TRANSPORT_TYPES[library] - } - - this._logger = this._logger.child({ library: library }) - this.logger.trace({ metrics: this._metrics }, 'Library metric names set') -} - -/** - * Wraps the given properties as message producing methods to be recorded. - * - * - `recordProduce(nodule, properties, recordNamer)` - * - `recordProduce(func, recordNamer)` - * - * The resulting wrapped methods will record their executions using the messaging - * `PRODUCE` metric. - * - * @memberof MessageShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {MessageFunction} recordNamer - * A function which specifies details of the message. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see MessageSpec - * @see MessageFunction - */ -function recordProduce(nodule, properties, recordNamer) { - if (this.isFunction(properties)) { - // recordProduce(func, recordNamer) - recordNamer = properties - properties = null - } - - return this.record(nodule, properties, function recordProd(shim) { - const msgDesc = recordNamer.apply(this, arguments) - if (!msgDesc) { - return null - } - - const name = _nameMessageSegment(shim, msgDesc, shim._metrics.PRODUCE) - if (!shim.agent.config.message_tracer.segment_parameters.enabled) { - delete msgDesc.parameters - } else if (msgDesc.routingKey) { - msgDesc.parameters = shim.setDefaults(msgDesc.parameters, { - routing_key: msgDesc.routingKey - }) - } - - return { - name: name, - promise: msgDesc.promise || false, - callback: msgDesc.callback || null, - recorder: genericRecorder, - inContext: function generateCATHeaders() { - if (msgDesc.headers) { - shim.insertCATRequestHeaders(msgDesc.headers, true) - } - }, - parameters: msgDesc.parameters || null, - opaque: msgDesc.opaque || false - } - }) -} - -/** - * Wraps the given properties as message consumers to be recorded. - * - * - `recordConsume(nodule, properties, spec)` - * - `recordConsume(func, spec)` - * - * The resulting wrapped methods will record their executions using the messaging - * `CONSUME` metric, possibly also starting a message transaction. Note that - * this should wrap the message _consumer_, to record methods which subscribe - * consumers see {@link MessageShim#recordSubscribedConsume} - * - * @memberof MessageShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {MessageSpec|MessageFunction} spec - * The spec for the method or a function which returns the details of the - * method. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see MessageShim#recordSubscribedConsume - * @see MessageSpec - * @see MessageFunction - */ -function recordConsume(nodule, properties, spec) { - if (this.isObject(properties) && !this.isArray(properties)) { - // recordConsume(func, spec) - spec = properties - properties = null - } - const DEFAULT_SPEC = { - destinationName: null, - promise: false, - callback: null, - messageHandler: null - } - if (!this.isFunction(spec)) { - spec = this.setDefaults(spec, DEFAULT_SPEC) - } - - // This is using wrap instead of record because the spec allows for a messageHandler - // which is being used to handle the result of the callback or promise of the - // original wrapped consume function. - // TODO: https://github.com/newrelic/node-newrelic/issues/981 - return this.wrap(nodule, properties, function wrapConsume(shim, fn, fnName) { - if (!shim.isFunction(fn)) { - shim.logger.debug('Not wrapping %s (%s) as consume', fn, fnName) - return fn - } - - return function consumeRecorder() { - const parent = shim.getSegment() - if (!parent || !parent.transaction.isActive()) { - shim.logger.trace('Not recording consume, no active transaction.') - return fn.apply(this, arguments) - } - - // Process the message args. - const args = shim.argsToArray.apply(shim, arguments) - let msgDesc = null - if (shim.isFunction(spec)) { - msgDesc = spec.call(this, shim, fn, fnName, args) - shim.setDefaults(msgDesc, DEFAULT_SPEC) - } else { - msgDesc = { - destinationName: null, - callback: spec.callback, - promise: spec.promise, - messageHandler: spec.messageHandler - } - - const destIdx = shim.normalizeIndex(args.length, spec.destinationName) - if (destIdx !== null) { - msgDesc.destinationName = args[destIdx] - } - } - - // Make the segment if we can. - if (!msgDesc) { - shim.logger.trace('Not recording consume, no message descriptor.') - return fn.apply(this, args) - } - - const name = _nameMessageSegment(shim, msgDesc, shim._metrics.CONSUME) - - // Adds details needed by createSegment when used with a spec - msgDesc.name = name - msgDesc.recorder = genericRecorder - msgDesc.parent = parent - - const segment = shim.createSegment(msgDesc) - const getParams = shim.agent.config.message_tracer.segment_parameters.enabled - const resHandler = shim.isFunction(msgDesc.messageHandler) ? msgDesc.messageHandler : null - - const cbIdx = shim.normalizeIndex(args.length, msgDesc.callback) - if (cbIdx !== null) { - shim.bindCallbackSegment(args, cbIdx, segment) - - // If we have a callback and a results handler, then wrap the callback so - // we can call the results handler and get the message properties. - if (resHandler) { - shim.wrap(args, cbIdx, function wrapCb(shim, cb, cbName) { - if (shim.isFunction(cb)) { - return function cbWrapper() { - const cbArgs = shim.argsToArray.apply(shim, arguments) - const msgProps = resHandler.call(this, shim, cb, cbName, cbArgs) - if (getParams && msgProps && msgProps.parameters) { - shim.copySegmentParameters(segment, msgProps.parameters) - } - - return cb.apply(this, arguments) - } - } - }) - } - } - - // Call the method in the context of our segment. - let ret = shim.applySegment(fn, segment, true, this, args) - - if (ret && msgDesc.promise && shim.isPromise(ret)) { - ret = shim.bindPromise(ret, segment) - - // Intercept the promise to handle the result. - if (resHandler) { - ret = ret.then(function interceptValue(res) { - const msgProps = resHandler.call(this, shim, fn, fnName, res) - if (getParams && msgProps && msgProps.parameters) { - shim.copySegmentParameters(segment, msgProps.parameters) - } - return res - }) - } - } - - return ret - } - }) -} - -/** - * Wraps the given properties as queue purging methods. - * - * - `recordPurgeQueue(nodule, properties, spec)` - * - `recordPurgeQueue(func, spec)` - * - * @memberof MessageShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {RecorderSpec} spec - * The specification for this queue purge method's interface. - * @param {string} spec.queue - * The name of the queue being purged. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see RecorderSpec - */ -function recordPurgeQueue(nodule, properties, spec) { - if (!nodule) { - this.logger.debug('Not wrapping non-existent nodule.') - return nodule - } - - // Sort out the parameters. - if (!this.isString(properties) && !this.isArray(properties)) { - // recordPurgeQueue(nodule, spec) - spec = properties - properties = null - } - - // Fill the spec with defaults. - const specIsFunction = this.isFunction(spec) - if (!specIsFunction) { - spec = this.setDefaults(spec, { - queue: null, - callback: null, - promise: false, - internal: false - }) - } - - return this.record(nodule, properties, function purgeRecorder(shim, fn, name, args) { - let descriptor = spec - if (specIsFunction) { - descriptor = spec.apply(this, arguments) - } - - let queue = descriptor.queue - if (shim.isNumber(queue)) { - const queueIdx = shim.normalizeIndex(args.length, descriptor.queue) - queue = args[queueIdx] - } - - return { - name: _nameMessageSegment( - shim, - { - destinationType: shim.QUEUE, - destinationName: queue - }, - shim._metrics.PURGE - ), - recorder: genericRecorder, - callback: descriptor.callback, - promise: descriptor.promise, - internal: descriptor.internal - } - }) -} - -/** - * Wraps the given properties as message subscription methods. - * - * - `recordSubscribedConsume(nodule, properties, spec)` - * - `recordSubscribedConsume(func, spec)` - * - * Message subscriber methods are ones used to register a message consumer with - * the message library. See {@link MessageShim#recordConsume} for recording - * the consumer itself. - * - * Note that unlike most `shim.recordX` methods, this method will call the - * `spec.wrapper` method even if no transaction is active. - * - * @memberof MessageShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {MessageSubscribeSpec} spec - * The specification for this subscription method's interface. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see Shim#record - * @see MessageShim#recordConsume - * @see MessageSubscribeSpec - */ -function recordSubscribedConsume(nodule, properties, spec) { - if (!nodule) { - this.logger.debug('Not wrapping non-existent nodule.') - return nodule - } - - // Sort out the parameters. - if (this.isObject(properties) && !this.isArray(properties)) { - // recordSubscribedConsume(nodule, spec) - spec = properties - properties = null - } - - // Fill the spec with defaults. - spec = this.setDefaults(spec, { - name: null, - destinationName: null, - destinationType: null, - consumer: null, - callback: null, - messageHandler: null, - promise: false - }) - - // Make sure our spec has what we need. - if (!this.isFunction(spec.messageHandler)) { - this.logger.debug('spec.messageHandler should be a function') - return nodule - } else if (!this.isNumber(spec.consumer)) { - this.logger.debug('spec.consumer is required for recordSubscribedConsume') - return nodule - } - - const destNameIsArg = this.isNumber(spec.destinationName) - - // Must wrap the subscribe method independently to ensure that we can wrap - // the consumer regardless of transaction state. - const wrapped = this.wrap(nodule, properties, function wrapSubscribe(shim, fn) { - if (!shim.isFunction(fn)) { - return fn - } - return function wrappedSubscribe() { - const args = shim.argsToArray.apply(shim, arguments) - const queueIdx = shim.normalizeIndex(args.length, spec.queue) - const consumerIdx = shim.normalizeIndex(args.length, spec.consumer) - const queue = queueIdx === null ? null : args[queueIdx] - let destName = null - - if (destNameIsArg) { - const destNameIdx = shim.normalizeIndex(args.length, spec.destinationName) - if (destNameIdx !== null) { - destName = args[destNameIdx] - } - } - - if (consumerIdx !== null) { - args[consumerIdx] = shim.wrap(args[consumerIdx], makeWrapConsumer(queue, destName)) - } - - return fn.apply(this, args) - } - }) - - // Wrap the subscriber with segment creation. - return this.record(wrapped, properties, function recordSubscribe(shim, fn, name, args) { - // Make sure the specified consumer and callback indexes do not overlap. - // This could happen for instance if the function signature is - // `fn(consumer [, callback])` and specified as `consumer: shim.FIRST`, - // `callback: shim.LAST`. - const consumerIdx = shim.normalizeIndex(args.length, spec.consumer) - let cbIdx = shim.normalizeIndex(args.length, spec.callback) - if (cbIdx === consumerIdx) { - cbIdx = null - } - - return { - name: spec.name || name, - callback: cbIdx, - promise: spec.promise, - - stream: false, - internal: false - } - }) - - /** - * @param queue - * @param destinationName - */ - function makeWrapConsumer(queue, destinationName) { - const msgDescDefaults = copy.shallow(spec) - if (destNameIsArg && destinationName != null) { - msgDescDefaults.destinationName = destinationName - } - if (queue != null) { - msgDescDefaults.queue = queue - } - - return function wrapConsumer(shim, consumer, cName) { - if (!shim.isFunction(consumer)) { - return consumer - } - - return shim.bindCreateTransaction( - function createConsumeTrans() { - // If there is no transaction or we're in a pre-existing transaction, - // then don't do anything. Note that the latter should never happen. - const args = shim.argsToArray.apply(shim, arguments) - const tx = shim.tracer.getTransaction() - - if (!tx || tx.baseSegment) { - shim.logger.debug({ transaction: !!tx }, 'Failed to start message transaction.') - return consumer.apply(this, args) - } - - const msgDesc = spec.messageHandler.call(this, shim, consumer, cName, args) - - // If message could not be handled, immediately kill this transaction. - if (!msgDesc) { - shim.logger.debug('No description for message, cancelling transaction.') - tx.setForceIgnore(true) - tx.end() - return consumer.apply(this, args) - } - - // Derive the transaction name. - shim.setDefaults(msgDesc, msgDescDefaults) - const txName = _nameMessageTransaction(shim, msgDesc) - tx.setPartialName(txName) - tx.baseSegment = shim.createSegment({ - name: tx.getFullName(), - recorder: messageTransactionRecorder - }) - - // Add would-be baseSegment attributes to transaction trace - for (const key in msgDesc.parameters) { - if (props.hasOwn(msgDesc.parameters, key)) { - tx.trace.attributes.addAttribute( - ATTR_DESTS.NONE, - 'message.parameters.' + key, - msgDesc.parameters[key] - ) - - tx.baseSegment.attributes.addAttribute( - ATTR_DESTS.NONE, - 'message.parameters.' + key, - msgDesc.parameters[key] - ) - } - } - - // If we have a routing key, add it to the transaction. Note that it is - // camel cased here, but snake cased in the segment parameters. - if (!shim.agent.config.high_security) { - if (msgDesc.routingKey) { - tx.trace.attributes.addAttribute( - ATTR_DESTS.TRANS_COMMON, - 'message.routingKey', - msgDesc.routingKey - ) - - tx.baseSegment.addSpanAttribute('message.routingKey', msgDesc.routingKey) - } - if (shim.isString(msgDesc.queue)) { - tx.trace.attributes.addAttribute( - ATTR_DESTS.TRANS_COMMON, - 'message.queueName', - msgDesc.queue - ) - - tx.baseSegment.addSpanAttribute('message.queueName', msgDesc.queue) - } - } - if (msgDesc.headers) { - shim.handleCATHeaders(msgDesc.headers, tx.baseSegment, shim._transportType) - } - - shim.logger.trace('Started message transaction %s named %s', tx.id, txName) - - // Execute the original function and attempt to hook in the transaction - // finish. - let ret = null - try { - ret = shim.applySegment(consumer, tx.baseSegment, true, this, args) - } finally { - if (shim.isPromise(ret)) { - shim.logger.trace('Got a promise, attaching tx %s ending to promise', tx.id) - ret = shim.interceptPromise(ret, endTransaction) - } else if (!tx.handledExternally) { - // We have no way of knowing when this transaction ended! ABORT! - shim.logger.trace('Immediately ending message tx %s', tx.id) - setImmediate(endTransaction) - } - } - - return ret - - /** - * - */ - function endTransaction() { - tx.finalizeName(null) // Use existing partial name. - tx.end() - } - }, - { - type: shim.MESSAGE, - nest: true - } - ) - } - } -} - -// -------------------------------------------------------------------------- // - -/** - * Constructs a message segment name from the given message descriptor. - * - * @private - * @param {MessageShim} shim - The shim the segment will be constructed by. - * @param {MessageSpec} msgDesc - The message descriptor. - * @param {string} action - Produce or consume? - * @returns {string} The generated name of the message segment. - */ -function _nameMessageSegment(shim, msgDesc, action) { - let name = - shim._metrics.PREFIX + - shim._metrics.LIBRARY + - '/' + - (msgDesc.destinationType || shim.EXCHANGE) + - '/' + - action - - if (msgDesc.destinationName) { - name += shim._metrics.NAMED + msgDesc.destinationName - } else { - name += shim._metrics.TEMP - } - - return name -} - -/** - * @param shim - * @param msgDesc - */ -function _nameMessageTransaction(shim, msgDesc) { - let name = shim._metrics.LIBRARY + '/' + (msgDesc.destinationType || shim.EXCHANGE) + '/' - - if (msgDesc.destinationName) { - name += shim._metrics.NAMED + msgDesc.destinationName - } else { - name += shim._metrics.TEMP - } - - return name -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/promise-shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/promise-shim.js deleted file mode 100644 index 13d149266..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/promise-shim.js +++ /dev/null @@ -1,579 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* eslint sonarjs/cognitive-complexity: ["error", 30] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252 */ - -const logger = require('../logger').child({ component: 'PromiseShim' }) -const Shim = require('./shim') -const symbols = require('../symbols') - -/** - * A helper class for wrapping promise modules. - * - * @augments Shim - */ -/* eslint-disable camelcase */ -class PromiseShim extends Shim { - /** - * Constructs a shim associated with the given agent instance, specialized for - * instrumenting promise libraries. - * - * @param {Agent} agent The agent this shim will use. - * @param {string} moduleName The name of the module being instrumented. - * @param {string} resolvedName The full path to the loaded module. - * @param {string} shimName Used to persist shim ids across different shim instances. - * @param shimName - * @see Shim - */ - constructor(agent, moduleName, resolvedName, shimName) { - super(agent, moduleName, resolvedName, shimName) - this._logger = logger.child({ module: moduleName }) - this._class = null - } - - /** - * Grants access to the `Contextualizer` class used by the `PromiseShim` to - * propagate context down promise chains. - * - * @private - */ - static get Contextualizer() { - return Contextualizer - } - - /** - * Sets the class used to identify promises from the wrapped promise library. - * - * @param {Function} clss - The promise library's class. - */ - setClass(clss) { - this._class = clss - } - - /** - * Checks if the given object is an instance of a promise from the promise - * library being wrapped. - * - * @param {*} obj - The object to check the instance type of. - * @returns {bool} True if the provided object is an instance of a promise from - * this promise library. - * @see PromiseShim#setClass - */ - isPromiseInstance(obj) { - return !!this._class && obj instanceof this._class - } - - /** - * Wraps the given properties as constructors for the promise library. - * - * - `wrapConstructor(nodule, properties)` - * - `wrapConstructor(func)` - * - * It is only necessary to wrap the constructor for the class if there is no - * other way to access the executor function. Some libraries expose a separate - * method which is called to execute the executor. If that is available, it is - * better to wrap that using {@link PromiseShim#wrapExecutorCaller} than to - * use this method. - * - * @param {object | Function} nodule - * The source of the properties to wrap, or a single function to wrap. - * @param {string | Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the constructor to wrap. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see PromiseShim#wrapExecutorCaller - */ - wrapConstructor(nodule, properties) { - return this.wrapClass(nodule, properties, { - pre: function prePromise(shim, Promise, name, args) { - // We are expecting one function argument for executor, anything else is - // non-standard, do not attempt to wrap. Also do not attempt to wrap if - // we are not in a transaction. - if (args.length !== 1 || !shim.isFunction(args[0]) || !shim.getActiveSegment()) { - return - } - _wrapExecutorContext(shim, args) - }, - post: function postPromise(shim, Promise, name, args) { - // This extra property is added by `_wrapExecutorContext` in the pre step. - const executor = args[0] - const context = executor && executor[symbols.executorContext] - if (!context || !shim.isFunction(context.executor)) { - return - } - - context.promise = this - Contextualizer.link(null, this, shim.getSegment()) - try { - // Must run after promise is defined so that `__NR_wrapper` can be set. - context.executor.apply(context.self, context.args) - } catch (e) { - const reject = context.args[1] - reject(e) - } - } - }) - } - - /** - * Wraps the given properties as the caller of promise executors. - * - * - `wrapExecutorCaller(nodule, properties)` - * - `wrapExecutorCaller(func)` - * - * Wrapping the executor caller method directly is preferable to wrapping - * the constructor of the promise class. - * - * @param {object | Function} nodule - * The source of the properties to wrap, or a single function to wrap. - * @param {string | Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see PromiseShim#wrapConstructor - */ - wrapExecutorCaller(nodule, properties) { - return this.wrap(nodule, properties, function executorWrapper(shim, caller) { - if (!shim.isFunction(caller) || shim.isWrapped(caller)) { - return - } - - return function wrappedExecutorCaller(executor) { - const parent = shim.getActiveSegment() - if (!this || !parent) { - return caller.apply(this, arguments) - } - - if (!this[symbols.context]) { - Contextualizer.link(null, this, parent) - } - - const args = shim.argsToArray.apply(shim, arguments) - _wrapExecutorContext(shim, args) - const ret = caller.apply(this, args) - const context = args[0][symbols.executorContext] - context.promise = this - - // Bluebird catches executor errors and auto-rejects when it catches them, - // thus we need to do so as well. - // - // When adding new libraries, make sure to check that they behave the same - // way. We may need to enhance the promise spec to handle this variance. - try { - executor.apply(context.self, context.args) - } catch (e) { - const reject = context.args[1] - reject(e) - } - return ret - } - }) - } - - /** - * Wraps the given properties as methods which take is some value other than - * a function to call and return a promise. - * - * - `wrapCast(nodule, properties)` - * - `wrapCast(func)` - * - * Examples of promise cast methods include `Promise.resolve`, `Promise.all`, - * and Bluebird's `Promise.delay`. These are static methods which accept some - * arbitrary value and return a Promise instance. - * - * @param {object | Function} nodule - * The source of the properties to wrap, or a single function to wrap. - * @param {string | Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - */ - wrapCast(nodule, properties) { - return this.wrap(nodule, properties, function castWrapper(shim, cast) { - if (!shim.isFunction(cast) || shim.isWrapped(cast)) { - return - } - - return function __NR_wrappedCast() { - const segment = shim.getSegment() - const prom = cast.apply(this, arguments) - if (segment) { - Contextualizer.link(null, prom, segment) - } - return prom - } - }) - } - - /** - * Wraps the given properties as promise chaining methods. - * - * - `wrapThen(nodule, properties)` - * - `wrapThen(func)` - * - * NOTE: You must set class used by the library before wrapping then-methods. - * - * Examples of promise then methods include `Promise#then`, `Promise#finally`, - * and Bluebird's `Promise#map`. These are methods which take a function to - * execute once the promise resolves and hands back a new promise. - * - * @param {object | Function} nodule - * The source of the properties to wrap, or a single function to wrap. - * @param {string | Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see PromiseShim#setClass - * @see PromiseShim#wrapCatch - */ - wrapThen(nodule, properties) { - return this.wrap(nodule, properties, _wrapThen, [true]) - } - - /** - * Wraps the given properties as rejected promise chaining methods. - * - * - `wrapCatch(nodule, properties)` - * - `wrapCatch(func)` - * - * NOTE: You must set class used by the library before wrapping catch-methods. - * - * Promise catch methods differ from then methods in that only one function - * will be executed and only if the promise is rejected. Some libraries accept - * an additional argument to `Promise#catch` which is usually an error class - * to filter rejections by. This wrap method will handle that case. - * - * @param {object | Function} nodule - * The source of the properties to wrap, or a single function to wrap. - * @param {string | Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see PromiseShim#setClass - * @see PromiseShim#wrapThen - */ - wrapCatch(nodule, properties) { - return this.wrap(nodule, properties, _wrapThen, [false]) - } - - /** - * Wraps the given properties as callback-to-promise conversion methods. - * - * - `wrapPromisify(nodule, properties)` - * - `wrapPromisify(func)` - * - * @param {object | Function} nodule - * The source of the properties to wrap, or a single function to wrap. - * @param {string | Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - */ - wrapPromisify(nodule, properties) { - return this.wrap(nodule, properties, function promisifyWrapper(shim, promisify) { - if (!shim.isFunction(promisify) || shim.isWrapped(promisify)) { - return - } - - return function __NR_wrappedPromisify() { - const promisified = promisify.apply(this, arguments) - if (typeof promisified !== 'function') { - return promisified - } - - Object.keys(promisified).forEach(function forEachProperty(prop) { - __NR_wrappedPromisified[prop] = promisified[prop] - }) - - return __NR_wrappedPromisified - /** - * - */ - function __NR_wrappedPromisified() { - const segment = shim.getActiveSegment() - if (!segment) { - return promisified.apply(this, arguments) - } - - const prom = shim.applySegment(promisified, segment, true, this, arguments) - Contextualizer.link(null, prom, segment) - return prom - } - } - }) - } -} -module.exports = PromiseShim - -// -------------------------------------------------------------------------- // - -/** - * @param shim - * @param args - * @private - */ -function _wrapExecutorContext(shim, args) { - const context = { - executor: args[0], - promise: null, - self: null, - args: null - } - contextExporter[symbols.executorContext] = context - args[0] = contextExporter - - /** - * - * @param resolve - * @param reject - */ - function contextExporter(resolve, reject) { - context.self = this - context.args = shim.argsToArray.apply(shim, arguments) - context.args[0] = _wrapResolver(context, resolve) - context.args[1] = _wrapResolver(context, reject) - } -} - -/** - * @param context - * @param fn - * @private - */ -function _wrapResolver(context, fn) { - return function wrappedResolveReject(val) { - const promise = context.promise - if (promise && promise[symbols.context]) { - promise[symbols.context].getSegment().touch() - } - fn(val) - } -} - -/** - * @param shim - * @param fn - * @param name - * @param useAllParams - * @private - */ -function _wrapThen(shim, fn, name, useAllParams) { - // Don't wrap non-functions. - if (shim.isWrapped(fn) || !shim.isFunction(fn)) { - return - } - - return function __NR_wrappedThen() { - if (!(this instanceof shim._class)) { - return fn.apply(this, arguments) - } - - const thenSegment = shim.getSegment() - const promise = this - - // Wrap up the arguments and execute the real then. - let isWrapped = false - const args = new Array(arguments.length) - for (let i = 0; i < arguments.length; ++i) { - args[i] = wrapHandler(arguments[i], i, arguments.length) - } - const next = fn.apply(this, args) - - // If we got a promise (which we should have), link the parent's context. - if (!isWrapped && next instanceof shim._class && next !== promise) { - Contextualizer.link(promise, next, thenSegment) - } - return next - - /** - * - * @param handler - * @param i - * @param length - */ - function wrapHandler(handler, i, length) { - if ( - !shim.isFunction(handler) || // Not a function - shim.isWrapped(handler) || // Already wrapped - (!useAllParams && i !== length - 1) // Don't want all and not last - ) { - isWrapped = shim.isWrapped(handler) - return handler - } - - return function __NR_wrappedThenHandler() { - if (!next || !next[symbols.context]) { - return handler.apply(this, arguments) - } - - let promSegment = next[symbols.context].getSegment() - const segment = promSegment || shim.getSegment() - if (segment && segment !== promSegment) { - next[symbols.context].setSegment(segment) - promSegment = segment - } - - let ret = null - try { - ret = shim.applySegment(handler, promSegment, true, this, arguments) - } finally { - if (ret && typeof ret.then === 'function') { - ret = next[symbols.context].continueContext(ret) - } - } - return ret - } - } - } -} - -/** - * @private - */ -class Context { - constructor(segment) { - this.segments = [segment] - } - - branch() { - return this.segments.push(null) - 1 - } -} - -/** - * @private - */ -class Contextualizer { - constructor(idx, context) { - this.parentIdx = -1 - this.idx = idx - this.context = context - this.child = null - } - - static link(prev, next, segment) { - let ctxlzr = prev && prev[symbols.context] - if (ctxlzr && !ctxlzr.isActive()) { - ctxlzr = prev[symbols.context] = null - } - - if (ctxlzr) { - // If prev has one child already, branch the context and update the child. - if (ctxlzr.child) { - // When the branch-point is the 2nd through nth link in the chain, it is - // necessary to track its segment separately so the branches can parent - // their segments on the branch-point. - if (ctxlzr.parentIdx !== -1) { - ctxlzr.idx = ctxlzr.context.branch() - } - - // The first child needs to be updated to have its own branch as well. And - // each of that child's children must be updated with the new parent index. - // This is the only non-constant-time action for linking, but it only - // happens with branching promise chains specifically when the 2nd branch - // is added. - // - // Note: This does not account for branches of branches. That may result - // in improperly parented segments. - let parent = ctxlzr - let child = ctxlzr.child - const branchIdx = ctxlzr.context.branch() - do { - child.parentIdx = parent.idx - child.idx = branchIdx - parent = child - child = child.child - } while (child) - - // We set the child to something falsey that isn't `null` so we can - // distinguish between having no child, having one child, and having - // multiple children. - ctxlzr.child = false - } - - // If this is a branching link then create a new branch for the next promise. - // Otherwise, we can just piggy-back on the previous link's spot. - const idx = ctxlzr.child === false ? ctxlzr.context.branch() : ctxlzr.idx - - // Create a new context for this next promise. - next[symbols.context] = new Contextualizer(idx, ctxlzr.context) - next[symbols.context].parentIdx = ctxlzr.idx - - // If this was our first child, remember it in case we have a 2nd. - if (ctxlzr.child === null) { - ctxlzr.child = next[symbols.context] - } - } else if (segment) { - // This next promise is the root of a chain. Either there was no previous - // promise or the promise was created out of context. - next[symbols.context] = new Contextualizer(0, new Context(segment)) - } - } - - isActive() { - const segments = this.context.segments - const segment = segments[this.idx] || segments[this.parentIdx] || segments[0] - return segment && segment.transaction.isActive() - } - - getSegment() { - const segments = this.context.segments - let segment = segments[this.idx] - if (segment == null) { - segment = segments[this.idx] = segments[this.parentIdx] || segments[0] - } - return segment - } - - setSegment(segment) { - return (this.context.segments[this.idx] = segment) - } - - toJSON() { - // No-op. - } - - continueContext(prom) { - const self = this - const nextContext = prom[symbols.context] - if (!nextContext) { - return prom - } - - // If we have `finally`, use that to sneak our context update. - if (typeof prom.finally === 'function') { - return prom.finally(__NR_continueContext) - } - - // No `finally` means we need to hook into resolve and reject individually and - // pass through whatever happened. - return prom.then( - function __NR_thenContext(val) { - __NR_continueContext() - return val - }, - function __NR_catchContext(err) { - __NR_continueContext() - throw err // Re-throwing promise rejection, this is not New Relic's error. - } - ) - - /** - * - */ - function __NR_continueContext() { - self.setSegment(nextContext.getSegment()) - } - } -} -/* eslint-enable camelcase */ diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/shim.js deleted file mode 100644 index 651cce920..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/shim.js +++ /dev/null @@ -1,2144 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* eslint sonarjs/cognitive-complexity: ["error", 59] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252 */ - -const arity = require('../util/arity') -const hasOwnProperty = require('../util/properties').hasOwn -const logger = require('../logger').child({ component: 'Shim' }) -const path = require('path') -const specs = require('./specs') -const util = require('util') -const symbols = require('../symbols') -const { addCLMAttributes: maybeAddCLMAttributes } = require('../util/code-level-metrics') -const { makeId } = require('../util/hashes') - -// Some modules do terrible things, like change the prototype of functions. To -// avoid crashing things we'll use a cached copy of apply everywhere. -const fnApply = Function.prototype.apply - -/** - * Constructs a shim associated with the given agent instance. - * - * @class - * @classdesc A helper class for wrapping modules with segments. - * @param {Agent} agent - The agent this shim will use. - * @param {string} moduleName - The name of the module being instrumented. - * @param {string} resolvedName - The full path to the loaded module. - * @param {string} shimName - Used to persist shim ids across different instances. This is - * applicable to instrument that compliments each other across libraries(i.e - koa + koa-route/koa-router) - */ -function Shim(agent, moduleName, resolvedName, shimName) { - if (!agent || !moduleName) { - throw new Error('Shim must be initialized with an agent and module name.') - } - - this._logger = logger.child({ module: moduleName }) - this._agent = agent - this._contextManager = agent._contextManager - this._toExport = null - this._debug = false - this.defineProperty(this, 'moduleName', moduleName) - this.assignId(shimName) - - // Determine the root directory of the module. - let moduleRoot = null - let next = resolvedName || '/' - do { - moduleRoot = next - next = path.dirname(moduleRoot) - } while (moduleRoot.length > 1 && !/node_modules(?:\/@[^/]+)?$/.test(next)) - this._moduleRoot = moduleRoot -} -module.exports = Shim - -Shim.defineProperty = defineProperty -Shim.defineProperties = defineProperties - -// This is for backwards compat for external libraries like aws-sdk that expect the symbol to be defined here -defineProperty(Shim, 'DISABLE_DT', symbols.disableDT) -defineProperty(Shim.prototype, 'DISABLE_DT', symbols.disableDT) - -// Copy the argument index enumeration onto the shim. -Shim.prototype.ARG_INDEXES = specs.ARG_INDEXES -defineProperties(Shim.prototype, specs.ARG_INDEXES) - -// Define other miscellaneous properties of the shim. -defineProperties(Shim.prototype, { - /** - * The agent associated with this shim. - * - * @readonly - * @member {Agent} Shim.prototype.agent - * @returns {Agent} The instance of the agent. - */ - agent: function getAgent() { - return this._agent - }, - - /** - * The tracer in use by the agent for the shim. - * - * @readonly - * @member {Tracer} Shim.prototype.tracer - * @returns {Tracer} The instance of the tracer - */ - tracer: function getTracer() { - return this._agent.tracer - }, - - /** - * The logger for this shim. - * - * @readonly - * @member {Logger} Shim.prototype.logger - * @returns {Logger} The logger. - */ - logger: function getLogger() { - return this._logger - } -}) - -Shim.prototype.wrap = wrap -Shim.prototype.bindSegment = bindSegment -Shim.prototype.bindPromise = bindPromise - -Shim.prototype.execute = execute -Shim.prototype.wrapReturn = wrapReturn -Shim.prototype.wrapClass = wrapClass -Shim.prototype.wrapExport = wrapExport -Shim.prototype.record = record -Shim.prototype.isWrapped = isWrapped -Shim.prototype.unwrap = unwrap -Shim.prototype.unwrapOnce = unwrap -Shim.prototype.getOriginal = getOriginal -Shim.prototype.assignOriginal = assignOriginal -Shim.prototype.getSegment = getSegment -Shim.prototype.getActiveSegment = getActiveSegment -Shim.prototype.setActiveSegment = setActiveSegment -Shim.prototype.storeSegment = storeSegment -Shim.prototype.bindCallbackSegment = bindCallbackSegment -Shim.prototype.applySegment = applySegment -Shim.prototype.createSegment = createSegment -Shim.prototype.getName = getName -Shim.prototype.isObject = isObject -Shim.prototype.isFunction = isFunction -Shim.prototype.isPromise = isPromise -Shim.prototype.isString = isString -Shim.prototype.isNumber = isNumber -Shim.prototype.isBoolean = isBoolean -Shim.prototype.isArray = isArray -Shim.prototype.isNull = isNull -Shim.prototype.toArray = toArray -Shim.prototype.argsToArray = argsToArray -Shim.prototype.normalizeIndex = normalizeIndex -Shim.prototype.once = once - -Shim.prototype.defineProperty = defineProperty -Shim.prototype.defineProperties = defineProperties -Shim.prototype.setDefaults = setDefaults -Shim.prototype.proxy = proxy -Shim.prototype.require = shimRequire -Shim.prototype.copySegmentParameters = copySegmentParameters -Shim.prototype.prefixRouteParameters = prefixRouteParameters -Shim.prototype.interceptPromise = interceptPromise -Shim.prototype.fixArity = arity.fixArity -Shim.prototype.assignId = assignId - -// Internal methods. -Shim.prototype.getExport = getExport -Shim.prototype.enableDebug = enableDebug -Shim.prototype[symbols.unwrap] = unwrapAll - -// -------------------------------------------------------------------------- // - -/** - * @callback WrapFunction - * @summary - * A function which performs the actual wrapping logic. - * @description - * If the return value of this function is not `original` then the return value - * will be marked as a wrapper. - * @param {Shim} shim - * The shim this function was passed to. - * @param {object|Function} original - * The item which needs wrapping. Most of the time this will be a function. - * @param {string} name - * The name of `original` if it can be determined, otherwise `''`. - * @returns {*} The wrapper for the original, or the original value itself. - */ - -/** - * @private - * @callback ArrayWrapFunction - * @description - * A wrap function used on elements of an array. In addition to the parameters - * of `WrapFunction`, these also receive an `index` and `total` as described - * below. - * @see WrapFunction - * @param {number} index - The index of the current element in the array. - * @param {number} total - The total number of items in the array. - */ - -/** - * @private - * @callback ArgumentsFunction - * @param {Shim} shim - * The shim this function was passed to. - * @param {Function} func - * The function these arguments were passed to. - * @param {*} context - * The context the function is executing under (i.e. `this`). - * @param {Array.<*>} args - * The arguments being passed into the function. - */ - -/** - * @callback SegmentFunction - * @summary - * A function which is called to compose a segment. - * @param {Shim} shim - * The shim this function was passed to. - * @param {Function} func - * The function the segment is created for. - * @param {string} name - * The name of the function. - * @param {Array.<*>} args - * The arguments being passed into the function. - * @returns {string|SegmentSpec} The desired properties for the new segment. - */ - -/** - * @callback RecorderFunction - * @summary - * A function which is called to compose a segment for recording. - * @param {Shim} shim - * The shim this function was passed to. - * @param {Function} func - * The function being recorded. - * @param {string} name - * The name of the function. - * @param {Array.<*>} args - * The arguments being passed into the function. - * @returns {string|RecorderSpec} The desired properties for the new segment. - */ - -/** - * @callback CallbackBindFunction - * @summary - * Performs segment binding on a callback function. Useful when identifying a - * callback is more complex than a simple argument offset. - * @param {Shim} shim - * The shim this function was passed to. - * @param {Function} func - * The function being recorded. - * @param {string} name - * The name of the function. - * @param {TraceSegment} segment - * The segment that the callback should be bound to. - * @param {Array.<*>} args - * The arguments being passed into the function. - */ - -/** - * @private - * @callback MetricFunction - * @summary - * Measures all the necessary metrics for the given segment. This functionality - * is meant to be used by Shim subclasses, instrumentations should never create - * their own recorders. - * @param {TraceSegment} segment - The segment to record. - * @param {string} [scope] - The scope of the recording. - */ - -/** - * @callback ConstructorHookFunction - * @summary - * Pre/post constructor execution hook for wrapping classes. Used by - * {@link ClassWrapSpec}. - * @param {Shim} shim - * The shim performing the wrapping/binding. - * @param {Function} Base - * The class that was wrapped. - * @param {string} name - * The name of the `Base` class. - * @param {Array.<*>} args - * The arguments to the class constructor. - * @see ClassWrapSpec - */ - -/** - * @private - * @interface Spec - * @description - * The syntax for declarative instrumentation. It can be used interlaced with - * custom, hand-written instrumentation for one-off or hard to simplify - * instrumentation logic. - * @property {Spec|WrapFunction} $return - * Changes the context to the return value of the current context. This means - * the sub spec will not be executed up front, but instead upon every execution - * of the current context. - * - * ```js - * var ret = func.apply(this, args); - * return shim.wrap(ret, spec.$return) - * ``` - * @property {Spec|WrapFunction} $proto - * Changes the context to the prototype of the current context. The prototype - * is found using `Object.getPrototypeOf`. - * - * ```js - * shim.wrap(Object.getPrototypeOf(context), spec.$proto) - * ``` - * @property {bool} $once - * Ensures that the parent spec will only be executed one time if the value is - * `true`. Good for preventing double wrapping of prototype methods. - * - * ```js - * if (spec.$once && spec[symbols.onceExecuted]) { - * return context - * } - * spec[symbols.onceExecuted] = true - * ``` - * @property {ArgumentsFunction} $arguments - * Executes the function with all of the arguments passed in. The arguments can - * be modified in place. This will execute before `$eachArgument`. - * - * ```js - * spec.$arguments(args) - * ``` - * @property {Spec|ArrayWrapFunction} $eachArgument - * Executes `shim.wrap` on each argument passed to the current context. The - * returned arguments will then be used to actually execute the function. - * - * ```js - * var argLength = arguments.length - * var extraArgs = extras.concat([0, argLength]) - * var iIdx = extraArgs.length - 2 - * var args = new Array(argLength) - * for (var i = 0; i < argLength; ++i) { - * extraArgs[iIdx] = i - * args[i] = shim.wrap(arguments[i], spec.$eachArgument, extraArgs) - * } - * func.apply(this, args) - * ``` - * @property {Array.<{$properties: Array., $spec: Spec}>} $wrappings - * Executes `shim.wrap` with the current context as the `nodule` for each - * element in the array. The `$properties` sub-key must list one or more - * properties to be wrapped. The `$spec` sub-key must be a {@link Spec} or - * {@link WrapFunction} for wrapping the properties. - * - * ```js - * spec.$wrappings.forEach(function($wrap) { - * shim.wrap(context, $wrap.$properties, $wrap.$spec) - * }) - * ``` - * @property {bool|string|SegmentFunction} $segment - * Controls segment creation. If a falsey value (i.e. `undefined`, `false`, - * `null`, etc) then no segment will be created. If the value is `true`, then - * the name of the current context is used to name the segment. If the value is - * a string then that string will be the name of the segment. Lastly, if the - * value is a function, that function will be called with the current context - * and arguments. - * - * ```js - * var segment = null - * if (spec.$segment) { - * var seg = {name: spec.$segment} - * if (shim.isFunction(seg.name)) { - * seg = seg.name(func, this, arguments) - * } - * else if (seg.name === true) { - * seg.name = func.name - * } - * segment = shim.createSegment(seg.name, seg.recorder, seg.parent) - * } - * ``` - * @property {Object} $cache - * Adds the value as an extra parameter to all specs in the same context as the - * cache. If the current context is a function, the cache will be recreated on - * each invocation of the function. This value can be useful for passing a - * value at runtime from one spec into another. - * - * ```js - * var args = extras || [] - * if (spec.$cache) { - * args.push({}) - * } - * ``` - * @property {number} $callback - * Indicates that one of the parameters is a callback which should be wrapped. - * - * ```js - * if (shim.isNumber(spec.$callback)) { - * var idx = spec.$callback - * if (idx < 0) { - * idx = args.length + idx - * } - * args[idx] = shim.bindSegment(args[idx], segment) - * } - * ``` - * @property {Spec|WrapFunction} property - * Any field which does not start with a `$` is assumed to name a property on - * the current context which should be wrapped. This is simply shorthand for a - * `$wrappings` with only one `$properties` value. - */ - -/** - * @interface SegmentSpec - * @description - * The return value from a {@link SegmentFunction}, used to set the parameters - * of segment creation. - * @property {string} name - * The name for the segment to-be. - * @property {MetricFunction} [recorder] - * A metric recorder for the segment. This is purely for internal use by shim - * classes. Instrumentations should never implement their own metric functions. - * @property {TraceSegment} [parent] - * The parent segment. Defaults to the currently active segment. - * @see RecorderSpec - * @see SegmentFunction - */ - -/** - * @interface RecorderSpec - * @augments SegmentSpec - * @description - * The return value from a {@link RecorderFunction}, used to set the parameters - * of segment creation and lifetime. Extends the {@link SegmentSpec}. - * @property {bool|string} [stream] - * Indicates if the return value from the wrapped function is a stream. If the - * value is truthy then the recording will extend to the `end` event of the - * stream. If the value is a string it is assumed to be the name of an event to - * measure. A segment will be created to record emissions of the event. - * @property {bool} [promise] - * Indicates if the return value from the wrapped function is a Promise. If the - * value is truthy then the recording will extend to the completion of the - * Promise. - * @property {number|CallbackBindFunction} [callback] - * If this is a number, it identifies which argument is the callback and the - * segment will also be bound to the callback. Otherwise, the passed function - * should perform the segment binding itself. - * @property {number|CallbackBindFunction} [rowCallback] - * Like `callback`, this identifies a callback function in the arguments. The - * difference is that the default behavior for row callbacks is to only create - * one segment for all calls to the callback. This is mostly useful for - * functions which will be called repeatedly, such as once for each item in a - * result set. - * @property {bool} [internal=false] - * Marks this as the boundary point into the instrumented library. If `true` - * and the current segment is _also_ marked as `internal` by the same shim, - * then we will not record this inner activity. - * - * This is useful when instrumenting a library which implements high-order - * methods which simply call other public methods and you only want to record - * the method directly called by the user while still instrumenting all - * endpoints. - * @property {Function} [after=null] - * A function to call after the synchronous execution of the recorded method. - * If the function synchronously threw an error, that error will be handed to - * this function. - * @property {bool} [callbackRequired] - * When `true`, a recorded method must be called with a callback for a segment - * to be created. Does not apply if a custom callback method has been assigned - * via {@link callback}. - * @see SegmentSpec - * @see RecorderFunction - */ - -/** - * @interface ClassWrapSpec - * @description - * Specifies the style of wrapping and construction hooks for wrapping classes. - * @property {bool} [es6=false] - * @property {ConstructorHookFunction} [pre=null] - * A function called with the constructor's arguments before the base class' - * constructor is executed. The `this` value will be `null`. - * @property {ConstructorHookFunction} [post=null] - * A function called with the constructor's arguments after the base class' - * constructor is executed. The `this` value will be the just-constructed object. - */ - -// -------------------------------------------------------------------------- // - -/** - * Entry point for executing a spec. - * - * @param nodule - * @param spec - * @memberof Shim.prototype - */ -function execute(nodule, spec) { - if (this.isFunction(spec)) { - spec(this, nodule) - } else { - _specToFunction(spec) - } -} - -/** - * Executes the provided spec on one or more objects. - * - * - `wrap(nodule, properties, spec [, args])` - * - `wrap(func, spec [, args])` - * - * When called with a `nodule` and one or more properties, the spec will be - * executed on each property listed and the return value put back on the - * `nodule`. - * - * When called with just a function, the spec will be executed on the function - * and the return value of the spec simply passed back. - * - * The wrapped version will have the same prototype as the original - * method. - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {Spec|WrapFunction} spec - * The spec for wrapping these items. - * @param {Array.<*>} [args=[]] - * Optional extra arguments to be sent to the spec when executing it. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see WrapFunction - */ -function wrap(nodule, properties, spec, args) { - if (!nodule) { - this.logger.debug('Not wrapping non-existent nodule.') - return nodule - } - - // Sort out the parameters. - if (this.isObject(properties) && !this.isArray(properties)) { - // wrap(nodule, spec [, args]) - args = spec - spec = properties - properties = null - } - if (this.isFunction(spec)) { - // wrap(nodule [, properties], wrapper [, args]) - spec = { - wrapper: spec - } - } - - // TODO: Add option for omitting symbols.original; unwrappable: false - spec = this.setDefaults(spec, { matchArity: false }) - - // If we're just wrapping one thing, just wrap it and return. - if (properties == null) { - const name = this.getName(nodule) - this.logger.trace('Wrapping nodule itself (%s).', name) - return _wrap(this, nodule, name, spec, args) - } - - // Coerce properties into an array. - if (!this.isArray(properties)) { - properties = [properties] - } - - // Wrap each property and return the nodule. - this.logger.trace('Wrapping %d properties on nodule.', properties.length) - properties.forEach(function wrapEachProperty(prop) { - // Skip nonexistent properties. - const original = nodule[prop] - if (!original) { - this.logger.debug('Not wrapping missing property "%s"', prop) - return - } - - // Wrap up the property and add a special unwrapper. - const wrapped = _wrap(this, original, prop, spec, args) - if (wrapped && wrapped !== original) { - this.logger.trace('Replacing "%s" with wrapped version', prop) - - nodule[prop] = wrapped - wrapped[symbols.unwrap] = function unwrapWrap() { - nodule[prop] = original - return original - } - } - }, this) - return nodule -} - -/** - * Executes the provided spec with the return value of the given properties. - * - * - `wrapReturn(nodule, properties, spec [, args])` - * - `wrapReturn(func, spec [, args])` - * - * If the wrapper is executed with `new` then the wrapped function will also be - * called with `new`. This feature should only be used with factory methods - * disguised as classes. Normally {@link Shim#wrapClass} should be used to wrap - * constructors instead. - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {Spec|WrapReturnFunction} spec - * The spec for wrapping the returned value from the properties. - * @param {Array.<*>} [args=[]] - * Optional extra arguments to be sent to the spec when executing it. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - * @see WrapReturnFunction - */ -function wrapReturn(nodule, properties, spec, args) { - // Munge our parameters as needed. - if (this.isObject(properties) && !this.isArray(properties)) { - // wrapReturn(nodule, spec [, args]) - args = spec - spec = properties - properties = null - } - if (!this.isFunction(spec)) { - _specToFunction(spec) - } - if (!this.isArray(args)) { - args = [] - } - - // Perform the wrapping! - return this.wrap(nodule, properties, function returnWrapper(shim, fn, fnName) { - // Only functions can have return values for us to wrap. - if (!shim.isFunction(fn)) { - return fn - } - - let unwrapReference = null - const handler = { - get: function getTrap(target, prop) { - // The wrapped symbol only lives on proxy - // not the proxied item. - if (prop === symbols.wrapped) { - return this[prop] - } - // Allow for look up of the target - if (prop === symbols.original) { - return target - } - if (prop === symbols.unwrap) { - return unwrapReference - } - - return target[prop] - }, - defineProperty: function definePropertyTrap(target, key, descriptor) { - if (key === symbols.unwrap) { - unwrapReference = descriptor.value - } else { - Object.defineProperty(target, key, descriptor) - } - return true - }, - set: function setTrap(target, key, val) { - // If we are setting the wrapped symbol on proxy - // we do not actually want to assign to proxied - // item but the proxy itself. - if (key === symbols.wrapped) { - this[key] = val - } else if (key === symbols.unwrap) { - unwrapReference = val - } else { - target[key] = val - } - return true - }, - construct: function constructTrap(target, proxyArgs, newTarget) { - // Call the underlying function via Reflect. - let ret = Reflect.construct(target, proxyArgs, newTarget) - - // Assemble the arguments to hand to the spec. - const _args = [shim, fn, fnName, ret] - if (args.length > 0) { - _args.push.apply(_args, args) - } - - // Call the spec and see if it handed back a different return value. - const newRet = spec.apply(ret, _args) - if (newRet) { - ret = newRet - } - - return ret - }, - apply: function applyTrap(target, thisArg, proxyArgs) { - // Call the underlying function. If this was called as a constructor, call - // the wrapped function as a constructor too. - let ret = target.apply(thisArg, proxyArgs) - - // Assemble the arguments to hand to the spec. - const _args = [shim, fn, fnName, ret] - if (args.length > 0) { - _args.push.apply(_args, args) - } - - // Call the spec and see if it handed back a different return value. - const newRet = spec.apply(thisArg, _args) - if (newRet) { - ret = newRet - } - - return ret - } - } - return new Proxy(fn, handler) - }) -} - -/** - * Wraps a class constructor using a subclass with pre- and post-construction - * hooks. - * - * - `wrapClass(nodule, properties, spec [, args])` - * - `wrapClass(func, spec [, args])` - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the constructor to wrap. - * @param {ClassWrapSpec|ConstructorHookFunction} spec - * The spec for wrapping the returned value from the properties or a post hook. - * @param {Array.<*>} [args=[]] - * Optional extra arguments to be sent to the spec when executing it. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see Shim#wrap - */ -function wrapClass(nodule, properties, spec, args) { - // Munge our parameters as needed. - if (this.isObject(properties) && !this.isArray(properties)) { - // wrapReturn(nodule, spec [, args]) - args = spec - spec = properties - properties = null - } - if (this.isFunction(spec)) { - spec = { pre: null, post: spec } - } else { - spec.pre = spec.pre || null - spec.post = spec.post || null - } - if (!this.isArray(args)) { - args = [] - } - - // Perform the wrapping! - return this.wrap(nodule, properties, function classWrapper(shim, Base, fnName) { - // Only functions can have return values for us to wrap. - if (!shim.isFunction(Base) || shim.isWrapped(Base)) { - return Base - } - - // When es6 classes are being wrapped, we need to use an es6 class due to - // the fact our es5 wrapper depends on calling the constructor without `new`. - const wrapper = spec.es6 || /^class /.test(Base.toString()) ? _es6WrapClass : _es5WrapClass - - return wrapper(shim, Base, fnName, spec, args) - }) -} - -/** - * Wraps the actual module being instrumented to change what `require` returns. - * - * - `wrapExport(nodule, spec)` - * - * @memberof Shim.prototype - * @param {*} nodule - * The original export to replace with our new one. - * @param {WrapFunction} spec - * A wrapper function. The return value from this spec is what will replace - * the export. - * @returns {*} The return value from `spec`. - */ -function wrapExport(nodule, spec) { - return (this._toExport = this.wrap(nodule, null, spec)) -} - -/** - * If the export was wrapped, that wrapper is returned, otherwise `defaultExport`. - * - * @private - * @memberof Shim.prototype - * @param {*} defaultExport - The original export in case it was never wrapped. - * @returns {*} The result from calling {@link Shim#wrapExport} or `defaultExport` - * if it was never used. - * @see Shim.wrapExport - */ -function getExport(defaultExport) { - return this._toExport || defaultExport -} - -/** - * Determines if the specified function or property exists and is wrapped. - * - * - `isWrapped(nodule, property)` - * - `isWrapped(func)` - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the property or a single function to check. - * @param {string} [property] - * The property to check. If omitted, the `nodule` parameter is assumed to be - * the function to check. - * @returns {bool} True if the item exists and has been wrapped. - * @see Shim#wrap - * @see Shim#bindSegment - */ -function isWrapped(nodule, property) { - if (property) { - return !!(nodule?.[property]?.[symbols.wrapped] === this.id) - } - return !!(nodule?.[symbols.wrapped] === this.id) -} - -/** - * Wraps a function with segment creation and binding. - * - * - `record(nodule, properties, recordNamer)` - * - `record(func, recordNamer)` - * - * This is shorthand for calling {@link Shim#wrap} and manually creating a segment. - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the properties to record, or a single function to record. - * @param {string|Array.} [properties] - * One or more properties to record. If omitted, the `nodule` parameter is - * assumed to be the function to record. - * @param {RecorderFunction} recordNamer - * A function which returns a record descriptor that gives the name and type of - * record we'll make. - * @returns {object | Function} The first parameter, possibly wrapped. - * @see RecorderFunction - * @see RecorderSpec - * @see Shim#wrap - */ -function record(nodule, properties, recordNamer) { - if (this.isFunction(properties)) { - recordNamer = properties - properties = null - } - - return this.wrap(nodule, properties, function makeWrapper(shim, fn, name) { - // Can't record things that aren't functions. - if (!shim.isFunction(fn)) { - shim.logger.debug('Not recording non-function "%s".', name) - return fn - } - shim.logger.trace('Wrapping "%s" with metric recording.', name) - - return function wrapper() { - // Create the segment that will be recorded. - const args = argsToArray.apply(shim, arguments) - let segDesc = recordNamer.call(this, shim, fn, name, args) - if (!segDesc) { - shim.logger.trace('No segment descriptor for "%s", not recording.', name) - return fnApply.call(fn, this, args) - } - segDesc = new specs.RecorderSpec(segDesc) - - // See if we're in an active transaction. - let parent - if (segDesc.parent) { - // We only want to continue recording in a transaction if the - // transaction is active. - parent = segDesc.parent.transaction.isActive() ? segDesc.parent : null - } else { - parent = shim.getActiveSegment() - } - - if (!parent) { - shim.logger.debug('Not recording function %s, not in a transaction.', name) - return fnApply.call(fn, this, arguments) - } - - if (segDesc.callbackRequired && !_hasValidCallbackArg(shim, args, segDesc.callback)) { - return fnApply.call(fn, this, arguments) - } - - // Only create a segment if: - // - We are _not_ making an internal segment. - // - OR the parent segment is either not internal or not from this shim. - const shouldCreateSegment = !( - parent.opaque || - (segDesc.internal && parent.internal && shim === parent.shim) - ) - - const segment = shouldCreateSegment ? _rawCreateSegment(shim, segDesc) : parent - maybeAddCLMAttributes(fn, segment) - - return _doRecord.call(this, segment, args, segDesc, shouldCreateSegment) - } - - /** - * @param shim - * @param args - * @param specCallback - */ - function _hasValidCallbackArg(shim, args, specCallback) { - if (shim.isNumber(specCallback)) { - const cbIdx = normalizeIndex(args.length, specCallback) - if (cbIdx === null) { - return false - } - - const callback = args[cbIdx] - return shim.isFunction(callback) - } - - return true - } - - /** - * @param segment - * @param args - * @param segDesc - * @param shouldCreateSegment - */ - function _doRecord(segment, args, segDesc, shouldCreateSegment) { - // Now bind any callbacks specified in the segment descriptor. - _bindAllCallbacks.call(this, shim, fn, name, args, { - spec: segDesc, - segment: segment, - shouldCreateSegment: shouldCreateSegment - }) - - // Apply the function, and (if it returned a stream) bind that too. - // The reason there is no check for `segment` is because it should - // be guaranteed by the parent and active transaction check - // at the beginning of this function. - let ret = _applyRecorderSegment(segment, this, args, segDesc) - if (ret) { - if (segDesc.stream) { - shim.logger.trace('Binding return value as stream.') - _bindStream(shim, ret, segment, { - event: shim.isString(segDesc.stream) ? segDesc.stream : null, - shouldCreateSegment: shouldCreateSegment - }) - } else if (segDesc.promise && shim.isPromise(ret)) { - shim.logger.trace('Binding return value as Promise.') - ret = shim.bindPromise(ret, segment) - } - } - return ret - } - - /** - * @param segment - * @param ctx - * @param args - * @param segDesc - */ - function _applyRecorderSegment(segment, ctx, args, segDesc) { - let error = null - let promised = false - let ret - try { - ret = shim.applySegment(fn, segment, true, ctx, args, segDesc.inContext) - if (segDesc.after && segDesc.promise && shim.isPromise(ret)) { - promised = true - return ret.then( - function onThen(val) { - segment.touch() - segDesc.after(shim, fn, name, null, val) - return val - }, - function onCatch(err) { - segment.touch() - segDesc.after(shim, fn, name, err, null) - throw err // NOTE: This is not an error from our instrumentation. - } - ) - } - return ret - } catch (err) { - error = err - throw err // Just rethrowing this error, not our error! - } finally { - if (segDesc.after && (error || !promised)) { - segDesc.after(shim, fn, name, error, ret) - } - } - } - }) -} - -/** - * Unwraps one item, revealing the underlying value. If item is wrapped multiple times, - * the unwrap will not occur as we cannot safely unwrap. - * - * - `unwrap(nodule, property)` - * - `unwrap(func)` - * - * If called with a `nodule` and properties, the unwrapped value will be put - * back on the nodule. Otherwise, the unwrapped function is just returned. - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the properties to unwrap, or a single function to unwrap. - * @param {string|Array.} [properties] - * One or more properties to unwrap. If omitted, the `nodule` parameter is - * assumed to be the function to unwrap. - * @returns {object | Function} The first parameter after unwrapping. - */ -function unwrap(nodule, properties) { - // Don't try to unwrap potentially `null` or `undefined` things. - if (!nodule) { - return nodule - } - - // If we're unwrapping multiple things - if (this.isArray(properties)) { - properties.forEach(unwrap.bind(this, nodule)) - return nodule - } - - const unwrapObj = properties || '' - this.logger.trace('Unwrapping %s', unwrapObj) - const original = properties ? nodule[properties] : nodule - if (!original || (original && !original[symbols.original])) { - return original - } else if (original?.[symbols.original]?.[symbols.original]) { - this.logger.warn( - 'Attempting to unwrap %s, which its unwrapped version is also wrapped. This is unsupported, unwrap will not occur.', - unwrapObj - ) - return original - } - return this.isFunction(original[symbols.unwrap]) - ? original[symbols.unwrap]() - : original[symbols.original] -} - -/** - * Retrieves the original method for a wrapped function. - * - * - `getOriginal(nodule, property)` - * - `getOriginal(func)` - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source of the property to get the original of, or a function to unwrap. - * @param {string} [property] - * A property on `nodule` to get the original value of. - * @returns {object | Function} The original value for the given item. - */ -function getOriginal(nodule, property) { - if (!nodule) { - return nodule - } - - let original = property ? nodule[property] : nodule - while (original && original[symbols.original]) { - original = original[symbols.original] - } - return original -} - -/** - * Binds the execution of a function to a single segment. - * - * - `bindSegment(nodule , property [, segment [, full]])` - * - `bindSegment(func [, segment [, full]])` - * - * If called with a `nodule` and a property, the wrapped property will be put - * back on the nodule. Otherwise, the wrapped function is just returned. - * - * @memberof Shim.prototype - * @param {object | Function} nodule - * The source for the property or a single function to bind to a segment. - * @param {string} [property] - * The property to bind. If omitted, the `nodule` parameter is assumed - * to be the function to bind the segment to. - * @param {?TraceSegment} [segment=null] - * The segment to bind the execution of the function to. If omitted or `null` - * the currently active segment will be bound instead. - * @param {bool} [full=false] - * Indicates if the full lifetime of the segment is bound to this function. - * @returns {object | Function} The first parameter after wrapping. - */ -function bindSegment(nodule, property, segment, full) { - // Don't bind to null arguments. - if (!nodule) { - return nodule - } - - // Determine our arguments. - if (this.isObject(property) && !this.isArray(property)) { - // bindSegment(func, segment [, full]) - full = segment - segment = property - property = null - } - - // This protects against the `bindSegment(func, null, true)` case, where the - // segment is `null`, and thus `true` (the full param) is detected as the - // segment. - if (segment != null && !this.isObject(segment)) { - this.logger.debug({ segment: segment }, 'Segment is not a segment, not binding.') - return nodule - } - - return this.wrap(nodule, property, function wrapFunc(shim, func) { - if (!shim.isFunction(func)) { - return func - } - - // Wrap up the function with this segment. - segment = segment || shim.getSegment() - if (!segment) { - return func - } - - const binder = _makeBindWrapper(shim, func, segment, full || false) - shim.storeSegment(binder, segment) - return binder - }) -} - -/** - * Replaces the callback in an arguments array with one that has been bound to - * the given segment. - * - * - `bindCallbackSegment(args, cbIdx [, segment])` - * - `bindCallbackSegment(obj, property [, segment])` - * - * @memberof Shim.prototype - * @param {Array | object} args - * The arguments array to pull the cb from. - * @param {number|string} cbIdx - * The index of the callback. - * @param {TraceSegment} [parentSegment] - * The segment to use as the callback segment's parent. Defaults to the - * currently active segment. - * @see Shim#bindSegment - */ -function bindCallbackSegment(args, cbIdx, parentSegment) { - if (!args) { - return - } - - if (this.isNumber(cbIdx)) { - const normalizedCBIdx = normalizeIndex(args.length, cbIdx) - if (normalizedCBIdx === null) { - // Bad index. - this.logger.debug( - 'Invalid index %d for args of length %d, not binding callback segment', - cbIdx, - args.length - ) - return - } - cbIdx = normalizedCBIdx - } - - // Pull out the callback and make sure it is a function. - const cb = args[cbIdx] - if (this.isFunction(cb)) { - const shim = this - const realParent = parentSegment || shim.getSegment() - args[cbIdx] = shim.wrap(cb, null, function callbackWrapper(shim, fn, name) { - return function wrappedCallback() { - if (realParent) { - realParent.opaque = false - } - const segment = _rawCreateSegment( - shim, - new specs.SegmentSpec({ - name: 'Callback: ' + name, - parent: realParent - }) - ) - - if (segment) { - segment.async = false - } - - // CB may end the transaction so update the parent's time preemptively. - realParent && realParent.touch() - return shim.applySegment(cb, segment, true, this, arguments) - } - }) - shim.storeSegment(args[cbIdx], realParent) - } -} - -/** - * Retrieves the segment associated with the given object, or the current - * segment if no object is given. - * - * - `getSegment([obj])` - * - * @memberof Shim.prototype - * @param {*} [obj] - The object to retrieve a segment from. - * @returns {?TraceSegment} The trace segment associated with the given object or - * the current segment if no object is provided or no segment is associated - * with the object. - */ -function getSegment(obj) { - if (obj && obj[symbols.segment]) { - return obj[symbols.segment] - } - - return this._contextManager.getContext() -} - -/** - * Retrieves the segment associated with the given object, or the currently - * active segment if no object is given. - * - * - `getActiveSegment([obj])` - * - * An active segment is one whose transaction is still active (e.g. has not - * ended yet). - * - * @memberof Shim.prototype - * @param {*} [obj] - The object to retrieve a segment from. - * @returns {?TraceSegment} The trace segment associated with the given object or - * the currently active segment if no object is provided or no segment is - * associated with the object. - */ -function getActiveSegment(obj) { - const segment = this.getSegment(obj) - if (segment && segment.transaction && segment.transaction.isActive()) { - return segment - } - return null -} - -/** - * Explicitly sets the active segment to the one passed in. This method - * should only be used if there is no function to tie a segment's timing - * to. - * - * - `setActiveSegment(segment)` - * - * @memberof Shim.prototype - * @param {TraceSegment} segment - The segment to set as the active segment. - * @returns {TraceSegment} - The segment set as active on the context. - */ -function setActiveSegment(segment) { - this._contextManager.setContext(segment) - return segment -} - -/** - * Associates a segment with the given object. - * - * - `storeSegment(obj [, segment])` - * - * If no segment is provided, the currently active segment is used. - * - * @memberof Shim.prototype - * @param {!*} obj - The object to retrieve a segment from. - * @param {TraceSegment} [segment] - The segment to link the object to. - */ -function storeSegment(obj, segment) { - if (obj) { - obj[symbols.segment] = segment || this.getSegment() - } -} - -/* eslint-disable max-params */ -/** - * Sets the given segment as the active one for the duration of the function's - * execution. - * - * - `applySegment(func, segment, full, context, args[, inContextCB])` - * - * @memberof Shim.prototype - * @param {Function} func The function to execute in the context of the given segment. - * @param {TraceSegment} segment The segment to make active for the duration of the function. - * @param {bool} full Indicates if the full lifetime of the segment is bound to this function. - * @param {*} context The `this` argument for the function. - * @param {Array.<*>} args The arguments to be passed into the function. - * @param {Function} [inContextCB] The function used to do more instrumentation work. This function is - * guaranteed to be executed with the segment associated with. - * @returns {*} Whatever value `func` returned. - */ -function applySegment(func, segment, full, context, args, inContextCB) { - // Exist fast for bad arguments. - if (!this.isFunction(func)) { - return - } - - if (!segment) { - this.logger.trace('No segment to apply to function.') - return fnApply.call(func, context, args) - } - - this.logger.trace('Applying segment %s', segment.name) - - const contextManager = this._contextManager - const prevSegment = contextManager.getContext() - - return contextManager.runInContext(segment, function runInContextCb() { - if (full) { - segment.start() - } - - if (typeof inContextCB === 'function') { - inContextCB(segment) - } - - try { - return fnApply.call(func, context, args) - } catch (error) { - if (prevSegment === null && process.domain != null) { - process.domain[symbols.segment] = contextManager.getContext() - } - - throw error // Re-throwing application error, this is not an agent error. - } finally { - if (full) { - segment.touch() - } - } - }) -} -/* eslint-enable max-params */ - -/** - * Creates a new segment. - * - * - `createSegment(opts)` - * - `createSegment(name [, recorder] [, parent])` - * - * @memberof Shim.prototype - * @param {string} name - * The name to give the new segment. - * @param {?Function} [recorder=null] - * Optional. A function which will record the segment as a metric. Default is - * to not record the segment. - * @param {TraceSegment} [parent] - * Optional. The segment to use as the parent. Default is to use the currently - * active segment. - * @returns {?TraceSegment} A new trace segment if a transaction is active, else - * `null` is returned. - */ -function createSegment(name, recorder, parent) { - let opts = null - if (this.isString(name)) { - // createSegment(name [, recorder] [, parent]) - opts = new specs.SegmentSpec({ name }) - - // if the recorder arg is not used, it can either be omitted or null - if (this.isFunction(recorder) || this.isNull(recorder)) { - // createSegment(name, recorder [, parent]) - opts.recorder = recorder - opts.parent = parent - } else { - // createSegment(name [, parent]) - opts.parent = recorder - } - } else { - // createSegment(opts) - opts = name - } - - return _rawCreateSegment(this, opts) -} - -/** - * @param shim - * @param opts - */ -function _rawCreateSegment(shim, opts) { - // Grab parent segment when none in opts so we can check opaqueness - opts.parent = opts.parent || shim.getActiveSegment() - - // When parent exists and is opaque, no new segment will be created - // by tracer.createSegment and the parent will be returned. We bail - // out early so we do not risk modifying the parent segment. - if (opts.parent && opts.parent.opaque) { - shim.logger.trace(opts, 'Did not create segment because parent is opaque') - return opts.parent - } - - const segment = shim.tracer.createSegment(opts.name, opts.recorder, opts.parent) - if (segment) { - segment.internal = opts.internal - segment.opaque = opts.opaque - segment.shim = shim - - if (hasOwnProperty(opts, 'parameters')) { - shim.copySegmentParameters(segment, opts.parameters) - } - shim.logger.trace(opts, 'Created segment') - } else { - shim.logger.debug(opts, 'Failed to create segment') - } - - return segment -} - -/** - * Determine the name of an object. - * - * @memberof Shim.prototype - * @param {*} obj - The object to get a name for. - * @returns {string} The name of the object if it has one, else ``. - */ -function getName(obj) { - return String(!obj || obj === true ? obj : obj.name || '') -} - -/** - * Determines if the given object is an Object. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is an Object, else false. - */ -function isObject(obj) { - return obj instanceof Object -} - -/** - * Determines if the given object exists and is a function. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is a function, else false. - */ -function isFunction(obj) { - return typeof obj === 'function' -} - -/** - * Determines if the given object exists and is a string. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is a string, else false. - */ -function isString(obj) { - return typeof obj === 'string' || obj instanceof String -} - -/** - * Determines if the given object is a number literal. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is a number literal, else false. - */ -function isNumber(obj) { - return typeof obj === 'number' -} - -/** - * Determines if the given object is a boolean literal. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is a boolean literal, else false. - */ -function isBoolean(obj) { - return typeof obj === 'boolean' -} - -/** - * Determines if the given object exists and is an array. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is an array, else false. - */ -function isArray(obj) { - return obj instanceof Array -} - -/** - * Determines if the given object is a promise instance. - * - * @memberof Shim.prototype - * @param {*} obj - The object to check. - * @returns {bool} True if the object is a promise, else false. - */ -function isPromise(obj) { - return obj && typeof obj.then === 'function' -} - -/** - * Determines if the given value is null. - * - * @memberof Shim.prototype - * @param {*} val - The value to check. - * @returns {bool} True if the value is null, else false. - */ -function isNull(val) { - return val === null -} - -/** - * Converts an array-like object into an array. - * - * @memberof Shim.prototype - * @param {*} obj - The array-like object (i.e. `arguments`). - * @returns {Array.<*>} An instance of `Array` containing the elements of the - * array-like. - */ -function toArray(obj) { - const len = obj.length - const arr = new Array(len) - for (let i = 0; i < len; ++i) { - arr[i] = obj[i] - } - return arr -} - -/** - * Like {@link Shim#toArray}, but converts `arguments` to an array. - * - * This is the preferred function, when used with `.apply`, for converting the - * `arguments` object into an actual `Array` as it will not cause deopts. - * - * @memberof Shim.prototype - * @returns {Array} An array containing the elements of `arguments`. - * @see Shim#toArray - * @see https://github.com/petkaantonov/bluebird/wiki/Optimization-killers - */ -function argsToArray() { - const len = arguments.length - const arr = new Array(len) - for (let i = 0; i < len; ++i) { - arr[i] = arguments[i] - } - return arr -} - -/** - * Ensures the given index is a valid index inside the array. - * - * A negative index value is converted to a positive one by adding it to the - * array length before checking it. - * - * @memberof Shim.prototype - * @param {number} arrayLength - The length of the array this index is for. - * @param {number} idx - The index to normalize. - * @returns {?number} The adjusted index value if it is valid, else `null`. - */ -function normalizeIndex(arrayLength, idx) { - if (idx < 0) { - idx = arrayLength + idx - } - return idx < 0 || idx >= arrayLength ? null : idx -} - -/** - * Wraps a function such that it will only be executed once. - * - * @memberof Shim.prototype - * @param {Function} fn - The function to wrap in an execution guard. - * @returns {Function} A function which will execute `fn` at most once. - */ -function once(fn) { - let called = false - return function onceCaller() { - if (!called) { - called = true - return fn.apply(this, arguments) - } - } -} - -/** - * Defines a read-only property on the given object. - * - * @memberof Shim.prototype - * @param {object} obj - * The object to add the property to. - * @param {string} name - * The name of the property to add. - * @param {* | Function} value - * The value to set. If a function is given, it is used as a getter, otherwise - * the value is directly set as an unwritable property. - */ -function defineProperty(obj, name, value) { - // We have define property! Use that. - const prop = { - enumerable: true, - configurable: true - } - if (isFunction(value)) { - prop.get = value - } else { - prop.writable = false - prop.value = value - } - Object.defineProperty(obj, name, prop) -} - -/** - * Adds several properties to the given object. - * - * @memberof Shim.prototype - * @param {object} obj - The object to add the properties to. - * @param {object} props - A mapping of properties to values to add. - * @see Shim#defineProperty - */ -function defineProperties(obj, props) { - const keys = Object.keys(props) - for (let i = 0; i < keys.length; ++i) { - const key = keys[i] - defineProperty(obj, key, props[key]) - } -} - -/** - * Performs a shallow copy of each property from `defaults` only if `obj` does - * not already have that property. - * - * @memberof Shim.prototype - * @param {object?} obj - The object to copy the defaults onto. - * @param {object} defaults - A mapping of keys to default values. - * @returns {object} The `obj` with the default values copied onto it. If `obj` - * was falsey, then a new object with the defaults copied onto it is returned - * instead. - */ -function setDefaults(obj, defaults) { - if (!obj) { - obj = Object.create(null) - } - const keys = Object.keys(defaults) - - for (let i = 0; i < keys.length; ++i) { - const key = keys[i] - if (!hasOwnProperty(obj, key)) { - obj[key] = defaults[key] - } - } - - return obj -} - -/** - * Proxies all set/get actions for each given property on `dest` onto `source`. - * - * @memberof Shim.prototype - * @param {*} source - * The object on which all the set/get actions will actually occur. - * @param {string|Array.} properties - * All of the properties to proxy. - * @param {*} dest - * The object which is proxying the source's properties. - */ -function proxy(source, properties, dest) { - if (!this.isArray(properties)) { - properties = [properties] - } - - properties.forEach(function forEachProxyProp(prop) { - Object.defineProperty(dest, prop, { - get: function proxyGet() { - return source[prop] - }, - set: function proxySet(val) { - return (source[prop] = val) - } - }) - }) -} - -/** - * Loads a node module from the instrumented library's own root directory. - * - * @memberof Shim.prototype - * @param {string} filePath - A relative path inside the module's directory. - * @returns {*?} The result of loading the given module. If the module fails to - * load, `null` is returned instead. - */ -function shimRequire(filePath) { - try { - return require(path.resolve(this._moduleRoot, filePath)) - } catch (e) { - this.logger.debug( - "Failed to load '%s' from module root: '%s'. Stack: %s", - filePath, - this._moduleRoot, - e.stack - ) - return null - } -} - -/** - * Executes the given callback when the promise is finalized, whether it is - * resolved or rejected. - * - * @memberof Shim.prototype - * @param {Promise} prom - Some kind of promise. Must have a `then` method. - * @param {Function} cb - A function to call when the promise resolves. - * @returns {Promise} A new promise to replace the original one. - */ -function interceptPromise(prom, cb) { - prom.then(cb, cb) - return prom -} - -/** - * Binds the given segment to the completion of the Promise. - * Updates segment timing and resets opaque state. - * - * @memberof Shim.prototype - * @param {!Promise} promise - * The Promise to bind. - * @param {!TraceSegment} segment - * The segment to bind to the Promise. - * @returns {Promise} The promise to continue with. - */ -function bindPromise(promise, segment) { - return this.interceptPromise(promise, function thenTouch() { - segment.opaque = false - segment.touch() - }) -} - -/** - * Copies the given parameters onto the segment, respecting the current agent - * configuration. - * - * @memberof Shim.prototype - * @param {TraceSegment} segment - The segment to copy the parameters onto. - * @param {object} parameters - The parameters to copy. - */ -function copySegmentParameters(segment, parameters) { - for (const key in parameters) { - if (hasOwnProperty(parameters, key)) { - segment.addAttribute(key, parameters[key]) - } - } -} - -/** - * Enables debugging mode of the shim. - * - * In debug mode the shim will track all methods that it wraps so they can be - * unwrapped. This should _not_ be done in production code because a lot more - * objects are held onto in memory. - * - * @private - * @memberof Shim.prototype - */ -function enableDebug() { - this.logger.warn('Enabling debug mode for shim!') - this._debug = true - this._wrapped = [] -} - -/** - * Unwraps everything that the shim has wrapped. Only works if debugging mode is - * enabled first. - * - * @private - * @member Shim.prototype.unwrap - */ -function unwrapAll() { - if (this._wrapped) { - this.logger.debug('Unwrapping %d items.', this._wrapped.length) - this._wrapped.forEach(function unwrapEach(wrapped) { - this.unwrap(wrapped) - }, this) - } -} - -// -------------------------------------------------------------------------- // - -/** - * Coerces the given spec into a function which {@link Shim#wrap} can use. - * - * @private - * @param {Spec|WrapFunction} spec - The spec to coerce into a function. - * @returns {WrapFunction} The spec itself if spec is a function, otherwise a - * function which will execute the spec when called. - */ -/* eslint-disable no-unused-vars */ -/** - * @param spec - */ -function _specToFunction(spec) { - throw new Error('Declarative specs are not implemented yet.') -} -/* eslint-enable no-unused-vars */ - -/** - * Assigns the shim id and original on the wrapped item. - * TODO: Once all wrapping is converted to proxies, we won't need to - * set this property as the trap on 'get' will return the original for - * symbols.original. For now, we have to prevent setting this on original. - * - * @param {*} wrapped wrapped item - * @param {*} original * The item being wrapped. - * @param {boolean} forceOrig flag to indicate to overwrite original function - */ -function assignOriginal(wrapped, original, forceOrig) { - wrapped[symbols.wrapped] = this.id - if (!wrapped[symbols.original] || forceOrig) { - wrapped[symbols.original] = original - } -} - -const shimIds = new Map() - -/** - * Assigns id to shim instance. - * If shimName is present it will reuse an id - * otherwise it'll create a unique id. - * - * @param {string} shimName Used to persist shim ids across different instances. - */ -function assignId(shimName) { - const id = shimIds.get(shimName) - this.id = id || makeId() - - if (shimName && !id) { - shimIds.set(shimName, this.id) - } -} - -/** - * Executes the provided spec on the given object. - * - * - `_wrap(shim, original, name, spec [, args])` - * - * @private - * @param {Shim} shim - * The shim that is executing the wrapping. - * @param {*} original - * The object being wrapped. - * @param {string} name - * A logical name for the item to be wrapped. - * @param {WrapFunction} spec - * The spec for wrapping these items. - * @param {Array.<*>} [args=[]] - * Optional extra arguments to be sent to the spec when executing it. - * @returns {Function} The return value from `spec` or the original value if it - * did not return anything. - */ -function _wrap(shim, original, name, spec, args) { - // Assemble the spec's arguments. - const specArgs = [shim, original, name] - if (args && args.length) { - specArgs.push.apply(specArgs, args) - } - - // Apply the spec and see if it returned a wrapped version of the property. - let wrapped = spec.wrapper.apply(null, specArgs) - if (wrapped && wrapped !== original) { - if (spec.matchArity && shim.isFunction(wrapped)) { - wrapped = arity.fixArity(original, wrapped) - } - - shim.assignOriginal(wrapped, original) - - if (shim._debug) { - shim._wrapped.push(wrapped) - } - } else { - wrapped = original - } - return wrapped -} - -/** - * Creates the `bindSegment` wrapper function in its own, clean closure. - * - * @private - * @param {Shim} shim - * The shim used for the binding. - * @param {Function} fn - * The function to be bound to the segment. - * @param {TraceSegment} segment - * The segment the function is bound to. - * @param {boolean} full - * Indicates if the segment's full lifetime is bound to the function. - * @returns {Function} A function which wraps `fn` and makes the given segment - * active for the duration of its execution. - */ -function _makeBindWrapper(shim, fn, segment, full) { - return function wrapper() { - return shim.applySegment(fn, segment, full, this, arguments) - } -} - -/** - * Binds all callbacks identified in the given spec. - * - * The callbacks are bound using the method meant for that type if available - * (i.e. `bindRowCallbackSegment` for `rowCallback`), but will fall back to the - * generic callback binding method, `bindCallbackSegment`, otherwise. - * - * @this * - * @private - * @param {Shim} shim - * The shim performing this binding. - * @param {Function} fn - * The function the spec describes. - * @param {string} name - * The name of the function the spec describes. - * @param {Array} args - * The arguments to be passed into `fn`. - * @param {object} spec - * The specification for bind the callbacks. - * @param {SegmentSpec} spec.spec - * The segment specification for the function we're pulling callbacks out of. - * @param {TraceSegment} spec.segment - * The segment measuring the function which will be the parent of any callback - * segments that may be created. - * @param {bool} spec.shouldCreateSegment - * Flag indicating if we should create segments for the callbacks. We almost - * always do, but in the special case of nested internal methods we do not. - */ -function _bindAllCallbacks(shim, fn, name, args, spec) { - // Check for a normal callback. - if (hasOwnProperty(spec.spec, 'callback') && spec.spec.callback !== null) { - _bindCallback(this, spec.spec.callback, shim.bindCallbackSegment) - } - - // And check for a row callback. - if (hasOwnProperty(spec.spec, 'rowCallback') && spec.spec.rowCallback !== null) { - _bindCallback( - this, - spec.spec.rowCallback, - shim.bindRowCallbackSegment || shim.bindCallbackSegment - ) - } - - /** - * @param context - * @param callback - * @param binder - */ - function _bindCallback(context, callback, binder) { - if (shim.isFunction(callback)) { - callback.call(context, shim, fn, name, spec.segment, args) - } else if (shim.isNumber(callback)) { - shim.logger.trace('Binding callback %d segment: %j', callback, !!spec.segment) - const cbIdx = normalizeIndex(args.length, callback) - if (cbIdx !== null) { - if (spec.shouldCreateSegment) { - binder.call(shim, args, cbIdx, spec.segment) - } else { - args[cbIdx] = shim.bindSegment(args[cbIdx], spec.segment, true) - } - } - } - } -} - -/** - * Binds the given segment to the lifetime of the stream. - * - * @private - * @param {Shim} shim - * The shim performing the wrapping/binding. - * @param {EventEmitter} stream - * The stream to bind. - * @param {?TraceSegment} segment - * The segment to bind to the stream. - * @param {object} [spec] - * Specification for how to bind the stream. The `end` and `error` events will - * always be bound, so if no functionality is desired beyond that, then this - * parameter may be omitted. - * @param {string} [spec.event] - * The name of an event to record. If provided, a new segment will be created - * for this event and will measure each time the event is emitted. - * @param {bool} spec.shouldCreateSegment - * Indicates if any child segments should be created. This should always be - * true unless this segment and its parent are both internal segments. - */ -function _bindStream(shim, stream, segment, spec) { - if (!segment || !shim.isFunction(stream.emit)) { - shim.logger.trace( - 'Not binding stream; have segment=%j; typeof emit=%s', - !!segment, - typeof stream.emit - ) - return - } - - // We have a segment and an emit function, pull out the relevant parts of the - // spec and prepare to create an event segment. - const specEvent = (spec && spec.event) || null - const shouldCreateSegment = (spec && spec.shouldCreateSegment) || false - const segmentName = 'Event callback: ' + specEvent - - // Wrap emit such that each event handler is executed within context of this - // segment or the event-specific segment. - shim.wrap(stream, 'emit', function wrapStreamEmit(shim, emit) { - const tx = segment.transaction - const streamBoundEmit = shim.bindSegment(emit, segment, true) - let eventSegment = null - let eventBoundEmit = null - let emitCount = 0 - - if (!shouldCreateSegment) { - return streamBoundEmit - } - - return function wrappedEmit(evnt) { - let emitToCall = streamBoundEmit - if (evnt === specEvent && tx.isActive()) { - if (!eventBoundEmit) { - eventSegment = shim.createSegment(segmentName, segment) - eventBoundEmit = shim.bindSegment(emit, eventSegment, true) - } - eventSegment.addAttribute('count', ++emitCount) - emitToCall = eventBoundEmit - } - if (evnt === 'end' || evnt === 'error') { - segment.opaque = false - segment.touch() - } - - return emitToCall.apply(this, arguments) - } - }) - - // Also wrap up any listeners for end or error events. - shim.wrap(stream, ['on', 'addListener'], function wrapOn(shim, fn) { - if (!shim.isFunction(fn)) { - return fn - } - - return function wrappedOn(onEvent) { - if (onEvent !== specEvent && (onEvent === 'end' || onEvent === 'error')) { - const args = argsToArray.apply(shim, arguments) - shim.bindCallbackSegment(args, shim.LAST, segment) - return fn.apply(this, args) - } - return fn.apply(this, arguments) - } - }) -} - -/** - * Wraps an es6-style class using a subclass. - * - * - `_es6WrapClass(shim, Base, fnName, spec, args)` - * - * @private - * @param {Shim} shim - * The shim performing the wrapping/binding. - * @param {class} Base - * The es6 class to be wrapped. - * @param {string} fnName - * The name of the base class. - * @param {ClassWrapSpec} spec - * The spec with pre- and post-execution hooks to call. - * @param {Array.<*>} args - * Extra arguments to pass through to the pre- and post-execution hooks. - * @returns {class} A class that extends Base with execution hooks. - */ -function _es6WrapClass(shim, Base, fnName, spec, args) { - return class WrappedClass extends Base { - constructor() { - const cnstrctArgs = shim.argsToArray.apply(shim, arguments) - // Assemble the arguments to hand to the spec. - const _args = [shim, Base, fnName, cnstrctArgs] - if (args.length > 0) { - _args.push.apply(_args, args) - } - - // Call the spec's before hook, then call the base constructor, then call - // the spec's after hook. - spec.pre && spec.pre.apply(null, _args) - super(...cnstrctArgs) - spec.post && spec.post.apply(this, _args) - } - } -} - -/** - * Wraps an es5-style class using a subclass. - * - * - `_es5WrapClass(shim, Base, fnName, spec, args)` - * - * @private - * @param {Shim} shim - * The shim performing the wrapping/binding. - * @param {Function} Base - * The class to be wrapped. - * @param {string} fnName - * The name of the base class. - * @param {ClassWrapSpec} spec - * The spec with pre- and post-execution hooks to call. - * @param {Array.<*>} args - * Extra arguments to pass through to the pre- and post-execution hooks. - * @returns {Function} A class that extends Base with execution hooks. - */ -function _es5WrapClass(shim, Base, fnName, spec, args) { - /** - * - */ - function WrappedClass() { - const cnstrctArgs = argsToArray.apply(shim, arguments) - if (!(this instanceof WrappedClass)) { - // Some libraries support calling constructors without the `new` keyword. - // In order to support this we must apply the super constructor if `this` - // is not an instance of ourself. JavaScript really needs a better way - // to generically apply constructors. - cnstrctArgs.unshift(WrappedClass) // `unshift` === `push_front` - return new (WrappedClass.bind.apply(WrappedClass, cnstrctArgs))() - } - - // Assemble the arguments to hand to the spec. - const _args = [shim, Base, fnName, cnstrctArgs] - if (args.length > 0) { - _args.push.apply(_args, args) - } - - // Call the spec's before hook, then call the base constructor, then call - // the spec's after hook. - spec.pre && spec.pre.apply(null, _args) - Base.apply(this, cnstrctArgs) - spec.post && spec.post.apply(this, _args) - } - util.inherits(WrappedClass, Base) - WrappedClass.prototype = Base.prototype - - return WrappedClass -} - -/** - * Method for prefixing Route (aka URL) parameters with `request.parameters.route` - * - * Many web frameworks support adding parameters to routes when defining your API structure, and this function - * updates those parameters names to be prefixed by `request.parameters.route`. This is to avoid collision with reserved - * attribute names, as parameters used to be blindly stored on router span attributes (see https://github.com/newrelic/node-newrelic/issues/1574) - * in addition to being prefixed by `request.parameters`. - * - * Route parameters used to be stored under `request.parameters.*` just like query parameters pre v10, but we - * now prefix with `request.parameter.route` to avoid collision in the event an application uses the same name for a query and route - * parameter. Additionally, we now store the same key on the attributes of the base segment, trace, and router span. - * - * Exported on shim to be used in our Next.js instrumentation, as that instrumentation does not follow the same pattern as all the other - * web frameworks we support. - * - * @param {object} params - Object containing route/url parameter key/value pairs - * @returns {object} the updated object, `key` will now be `request.parameters.route.key`, value remains untouched - */ -function prefixRouteParameters(params) { - if (params && isObject(params)) { - return Object.fromEntries( - Object.entries(params).map(([key, value]) => [`request.parameters.route.${key}`, value]) - ) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/specs/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/specs/index.js deleted file mode 100644 index cb06ef2de..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/specs/index.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const hasOwnProperty = require('../../util/properties').hasOwn -const util = require('util') - -/** - * Enumeration of argument indexes. - * - * Anywhere that an argument index is used, one of these or a direct integer - * value can be used. These are just named constants to improve readability. - * - * Each of these values is also exposed directly on the DatastoreShim class as - * static members. - * - * @readonly - * @memberof Shim.prototype - * @enum {number} - */ -const ARG_INDEXES = { - FIRST: 0, - SECOND: 1, - THIRD: 2, - FOURTH: 3, - LAST: -1 -} - -exports.ARG_INDEXES = ARG_INDEXES - -exports.cast = cast - -exports.MiddlewareSpec = MiddlewareSpec -exports.RecorderSpec = RecorderSpec -exports.SegmentSpec = SegmentSpec -exports.WrapSpec = WrapSpec - -function cast(Class, spec) { - return spec instanceof Class ? spec : new Class(spec) -} - -function WrapSpec(spec) { - this.wrapper = typeof spec === 'function' ? spec : spec.wrapper - this.matchArity = hasOwnProperty(spec, 'matchArity') ? spec.matchArity : false -} - -function SegmentSpec(spec) { - this.name = hasOwnProperty(spec, 'name') ? spec.name : null - this.recorder = hasOwnProperty(spec, 'recorder') ? spec.recorder : null - this.inContext = hasOwnProperty(spec, 'inContext') ? spec.inContext : null - this.parent = hasOwnProperty(spec, 'parent') ? spec.parent : null - this.parameters = hasOwnProperty(spec, 'parameters') ? spec.parameters : null - this.internal = hasOwnProperty(spec, 'internal') ? spec.internal : false - this.opaque = hasOwnProperty(spec, 'opaque') ? spec.opaque : false -} - -function RecorderSpec(spec) { - SegmentSpec.call(this, spec) - this.stream = hasOwnProperty(spec, 'stream') ? spec.stream : null - this.promise = hasOwnProperty(spec, 'promise') ? spec.promise : null - this.callback = hasOwnProperty(spec, 'callback') ? spec.callback : null - this.rowCallback = hasOwnProperty(spec, 'rowCallback') ? spec.rowCallback : null - this.after = hasOwnProperty(spec, 'after') ? spec.after : null - this.callbackRequired = hasOwnProperty(spec, 'callbackRequired') ? spec.callbackRequired : null -} -util.inherits(RecorderSpec, SegmentSpec) - -function MiddlewareSpec(spec) { - RecorderSpec.call(this, spec) - this.req = hasOwnProperty(spec, 'req') ? spec.req : ARG_INDEXES.FIRST - this.res = hasOwnProperty(spec, 'res') ? spec.res : ARG_INDEXES.SECOND - this.next = hasOwnProperty(spec, 'next') ? spec.next : ARG_INDEXES.THIRD - this.type = hasOwnProperty(spec, 'type') ? spec.type : 'MIDDLEWARE' - this.route = hasOwnProperty(spec, 'route') ? spec.route : null - this.params = hasOwnProperty(spec, 'params') ? spec.params : _defaultGetParams - this.appendPath = hasOwnProperty(spec, 'appendPath') ? spec.appendPath : true -} -util.inherits(MiddlewareSpec, RecorderSpec) - -function _defaultGetParams(shim, fn, name, args, req) { - return req && req.params -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/transaction-shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/transaction-shim.js deleted file mode 100644 index 2f5510e99..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/transaction-shim.js +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const cat = require('../util/cat') -const logger = require('../logger').child({ component: 'TransactionShim' }) -const Shim = require('./shim') -const Transaction = require('../transaction') -const util = require('util') - -const TRANSACTION_TYPES_SET = Transaction.TYPES_SET - -/** - * Constructs a transaction managing shim. - * - * @class - * @augments Shim - * @classdesc - * @param shimName - * A helper class for working with transactions. - * @param {Agent} agent - The agent the shim will use. - * @param {string} moduleName - The name of the module being instrumented. - * @param {string} resolvedName - The full path to the loaded module. - * @see Shim - * @see WebFrameworkShim - */ -function TransactionShim(agent, moduleName, resolvedName, shimName) { - Shim.call(this, agent, moduleName, resolvedName, shimName) - this._logger = logger.child({ module: moduleName }) -} -module.exports = TransactionShim -util.inherits(TransactionShim, Shim) - -/** - * Enumeration of transaction types. - * - * Each of these values is also exposed directly on the `TransactionShim` class - * as static members. - * - * @readonly - * @memberof TransactionShim.prototype - * @enum {string} - */ -TransactionShim.TRANSACTION_TYPES = Transaction.TYPES -Object.keys(Transaction.TYPES).forEach(function defineTypeEnum(type) { - Shim.defineProperty(TransactionShim, type, Transaction.TYPES[type]) - Shim.defineProperty(TransactionShim.prototype, type, Transaction.TYPES[type]) -}) - -/** - * Enumeration of possible transaction transport types used for distributed tracing. - * - * This enumeration is also exposed on the `TransactionShim` class. - * - * @readonly - * @memberof TransactionShim.prototype - * @enum {string} - */ -Shim.defineProperty(TransactionShim, 'TRANSPORT_TYPES', Transaction.TRANSPORT_TYPES) -Shim.defineProperty(TransactionShim.prototype, 'TRANSPORT_TYPES', Transaction.TRANSPORT_TYPES) - -TransactionShim.prototype.bindCreateTransaction = bindCreateTransaction -TransactionShim.prototype.pushTransactionName = pushTransactionName -TransactionShim.prototype.popTransactionName = popTransactionName -TransactionShim.prototype.setTransactionName = setTransactionName -TransactionShim.prototype.handleCATHeaders = handleCATHeaders -TransactionShim.prototype.insertCATReplyHeader = insertCATReplyHeader -TransactionShim.prototype.insertCATRequestHeaders = insertCATRequestHeaders - -// -------------------------------------------------------------------------- // - -/** - * @interface TransactionSpec - * @description - * Describes the type of transaction to be created by the function being - * wrapped by {@link Shim#bindCreateTransaction}. - * @property {string} type - * The type of transaction to create. Must be one of the values from - * {@link Shim#TRANSACTION_TYPES}. - * @property {bool} [nest=false] - * Indicates if the transaction being created is allowed to be nested within - * another transaction of the same type. If `false`, the default, the transaction - * will only be created if there is no existing transaction, or the current - * transaction is of a different type. If `true`, the transaction will be - * created regardless of the current transaction's type. - * @see Shim#bindCreateTransaction - * @see Shim#TRANSACTION_TYPES - */ - -// -------------------------------------------------------------------------- // - -/** - * Wraps one or more functions such that new transactions are created when - * invoked. - * - * - `bindCreateTransaction(nodule, property, spec)` - * - `bindCreateTransaction(func, spec)` - * - * @memberof TransactionShim.prototype - * @param {object | Function} nodule - * The source for the property to wrap, or a single function to wrap. - * @param {string} [property] - * The property to wrap. If omitted, the `nodule` parameter is assumed to be - * the function to wrap. - * @param {TransactionSpec} spec - * The spec for creating the transaction. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its property. - */ -function bindCreateTransaction(nodule, property, spec) { - if (this.isObject(property) && !this.isArray(property)) { - // bindCreateTransaction(nodule, spec) - spec = property - property = null - } - - // Refuse to perform the wrapping if `spec.type` is not valid. - if (!TRANSACTION_TYPES_SET[spec.type]) { - this.logger.error( - { stack: new Error().stack }, - 'Invalid spec type "%s", must be one of %j.', - spec.type, - Object.keys(TRANSACTION_TYPES_SET) - ) - return nodule - } - - // Perform the actual wrapping. - return this.wrap(nodule, property, function makeTransWrapper(shim, fn, name) { - if (!shim.isFunction(fn)) { - shim.logger.debug('Not wrapping "%s" with transaction, not a function.', name) - return fn - } - - // Is this transaction supposed to be nested? Pick the right wrapper for the - // job. - const makeWrapper = spec.nest ? _makeNestedTransWrapper : _makeTransWrapper - return makeWrapper(shim, fn, name, spec) - }) -} - -/** - * Pushes a new path segment onto the transaction naming stack. - * - * - `pushTransactionName(pathSegment)` - * - * Transactions are named for the middlware that sends the response. Some web - * frameworks are capable of mounting middlware in complex routing stacks. In - * order to maintain the correct name, transactions keep a stack of mount points - * for each middlware/router/app/whatever. The instrumentation should push on - * the mount path for wrapped things when route resolution enters and pop it - * back off when resolution exits the item. - * - * @memberof TransactionShim.prototype - * @param {string} pathSegment - The path segment to add to the naming stack. - */ -function pushTransactionName(pathSegment) { - const tx = this.tracer.getTransaction() - if (tx && tx.nameState) { - tx.nameState.appendPath(pathSegment) - } -} - -/** - * Pops one or more elements off the transaction naming stack. - * - * - `popTransactionName([pathSegment])` - * - * Ideally it is not necessary to ever provide the `pathSegment` parameter for - * this function, but we do not live in an ideal world. - * - * @memberof TransactionShim.prototype - * @param {string} [pathSegment] - * Optional. Path segment to pop the stack repeatedly until a segment matching - * `pathSegment` is removed. - */ -function popTransactionName(pathSegment) { - const tx = this.tracer.getTransaction() - if (tx && tx.nameState) { - tx.nameState.popPath(pathSegment) - } -} - -/** - * Sets the name to be used for this transaction. - * - * - `setTransactionName(name)` - * - * Either this _or_ the naming stack should be used. Do not use them together. - * - * @memberof TransactionShim.prototype - * @param {string} name - The name to use for the transaction. - */ -function setTransactionName(name) { - const tx = this.tracer.getTransaction() - if (tx) { - tx.setPartialName(name) - } -} - -/** - * Retrieves whatever CAT headers may be in the given headers. - * - * - `handleCATHeaders(headers [, segment [, transportType]])` - * - * @memberof TransactionShim.prototype - * - * This will check for either header naming style, and both request and reply - * CAT headers. - * @param {object} headers - * The request/response headers object to look in. - * @param {TraceSegment} [segment=null] - * The trace segment to associate the header data with. If no segment is - * provided then the currently active segment is used. - * @param {string} [transportType='Unknown'] - * The transport type that brought the headers. Usually `HTTP` or `HTTPS`. - */ -function handleCATHeaders(headers, segment, transportType) { - // TODO: rename function or replace functionality when CAT fully removed. - - if (!headers) { - this.logger.debug('No headers for CAT or DT processing.') - return - } - - const config = this.agent.config - - if (!config.cross_application_tracer.enabled && !config.distributed_tracing.enabled) { - this.logger.trace('CAT and DT disabled, not extracting headers.') - return - } - - // Check that we're in an active transaction. - const currentSegment = segment || this.getSegment() - if (!currentSegment || !currentSegment.transaction.isActive()) { - this.logger.trace('Not processing headers for CAT or DT, not in an active transaction.') - return - } - - const transaction = currentSegment.transaction - - if (config.distributed_tracing.enabled) { - transaction.acceptDistributedTraceHeaders(transportType, headers) - return - } - - // Not DT so processing CAT. - // TODO: Below will be removed when CAT removed. - const { appData, id, transactionId } = cat.extractCatHeaders(headers) - const { externalId, externalTransaction } = cat.parseCatData( - id, - transactionId, - config.encoding_key - ) - cat.assignCatToTransaction(externalId, externalTransaction, transaction) - const decodedAppData = cat.parseAppData(config, appData) - cat.assignCatToSegment(decodedAppData, currentSegment) - // TODO: Handle adding ExternalTransaction metrics for this segment. -} - -/** - * Adds CAT headers for an outbound request. - * - * - `insertCATRequestHeaders(headers [, useAlternateHeaderNames])` - * - * @memberof TransactionShim.prototype - * @param {object} headers - * The outbound request headers object to inject our CAT headers into. - * @param {bool} [useAlternateHeaderNames=false] - * Indicates if HTTP-style headers should be used or alternate style. Some - * transport protocols are more strict on the characters allowed in headers - * and this option can be used to toggle use of pure-alpha header names. - */ -// TODO: abstract header logic shared with wrapRequest in http instrumentation -function insertCATRequestHeaders(headers, useAlternateHeaderNames) { - const crossAppTracingEnabled = this.agent.config.cross_application_tracer.enabled - const distributedTracingEnabled = this.agent.config.distributed_tracing.enabled - - if (!distributedTracingEnabled && !crossAppTracingEnabled) { - this.logger.trace('Distributed Tracing and CAT are both disabled, not adding headers.') - return - } - - if (!headers) { - this.logger.debug('Missing headers object, not adding headers!') - return - } - - const tx = this.tracer.getTransaction() - if (!tx || !tx.isActive()) { - this.logger.trace('No active transaction found, not adding headers.') - return - } - - if (distributedTracingEnabled) { - // TODO: Should probably honor symbols.disableDT. - // TODO: Official testing and support. - tx.insertDistributedTraceHeaders(headers) - } else { - cat.addCatHeaders(this.agent.config, tx, headers, useAlternateHeaderNames) - } -} - -/** - * Adds CAT headers for an outbound response. - * - * - `insertCATReplyHeaders(headers [, useAlternateHeaderNames])` - * - * @memberof TransactionShim.prototype - * @param {object} headers - * The outbound response headers object to inject our CAT headers into. - * @param {bool} [useAlternateHeaderNames=false] - * Indicates if HTTP-style headers should be used or alternate style. Some - * transport protocols are more strict on the characters allowed in headers - * and this option can be used to toggle use of pure-alpha header names. - */ -function insertCATReplyHeader(headers, useAlternateHeaderNames) { - // Is CAT enabled? - const config = this.agent.config - if (!config.cross_application_tracer.enabled) { - this.logger.trace('CAT disabled, not adding CAT reply header.') - return - } else if (config.distributed_tracing.enabled) { - this.logger.warn('Distributed tracing is enabled, not adding CAT reply header.') - return - } else if (!config.encoding_key) { - this.logger.warn('Missing encoding key, not adding CAT reply header!') - return - } else if (!headers) { - this.logger.debug('Missing headers object, not adding CAT reply header!') - return - } - - // Are we in a transaction? - const segment = this.getSegment() - if (!segment || !segment.transaction.isActive()) { - this.logger.trace('Not adding CAT reply header, not in an active transaction.') - return - } - const tx = segment.transaction - - // Hunt down the content length. - // NOTE: In AMQP, content-type and content-encoding are guaranteed fields, but - // there is no content-length field or header. For that, content length will - // always be -1. - let contentLength = -1 - for (const key in headers) { - if (key.toLowerCase() === 'content-length') { - contentLength = headers[key] - break - } - } - - const { key, data } = cat.encodeAppData(config, tx, contentLength, useAlternateHeaderNames) - // Add the header. - if (key && data) { - headers[key] = data - this.logger.trace('Added outbound response CAT headers for transaction %s', tx.id) - } -} - -/** - * Creates a function that binds transactions to the execution of the function. - * - * The created transaction may be nested within an existing transaction if - * `spec.type` is not the same as the current transaction's type. - * - * @private - * @param {Shim} shim - * The shim used for the binding. - * @param {Function} fn - * The function link with the transaction. - * @param {string} name - * The name of the wrapped function. - * @param {TransactionSpec} spec - * The spec for the transaction to create. - * @returns {Function} A function which wraps `fn` and creates potentially nested - * transactions linked to its execution. - */ -function _makeNestedTransWrapper(shim, fn, name, spec) { - return function nestedTransactionWrapper() { - if (!shim.agent.canCollectData()) { - return fn.apply(this, arguments) - } - - // Reuse existing transactions only if the type matches. - let transaction = shim.tracer.getTransaction() - let segment = shim.getSegment() - - // Only create a new transaction if we either do not have a current - // transaction _or_ the current transaction is not of the type we want. - if (!transaction || spec.type !== transaction.type) { - shim.logger.trace('Creating new nested %s transaction for %s', spec.type, name) - transaction = new Transaction(shim.agent) - transaction.type = spec.type - segment = transaction.trace.root - } - - return shim.applySegment(fn, segment, false, this, arguments) - } -} - -/** - * Creates a function that binds transactions to the execution of the function. - * - * A transaction will only be created if there is not a currently active one. - * - * @private - * @param {Shim} shim - * The shim used for the binding. - * @param {Function} fn - * The function link with the transaction. - * @param {string} name - * The name of the wrapped function. - * @param {TransactionSpec} spec - * The spec for the transaction to create. - * @returns {Function} A function which wraps `fn` and potentially creates a new - * transaction linked to the function's execution. - */ -function _makeTransWrapper(shim, fn, name, spec) { - return function transactionWrapper() { - // Don't nest transactions, reuse existing ones! - const existingTransaction = shim.tracer.getTransaction() - if (!shim.agent.canCollectData() || existingTransaction) { - return fn.apply(this, arguments) - } - - shim.logger.trace('Creating new %s transaction for %s', spec.type, name) - const transaction = new Transaction(shim.agent) - transaction.type = spec.type - return shim.applySegment(fn, transaction.trace.root, false, this, arguments) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/webframework-shim.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/webframework-shim.js deleted file mode 100644 index 6a75f0fe0..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shim/webframework-shim.js +++ /dev/null @@ -1,1101 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* eslint sonarjs/cognitive-complexity: ["error", 69] -- TODO: https://issues.newrelic.com/browse/NEWRELIC-5252 */ - -const genericRecorder = require('../metrics/recorders/generic') -const logger = require('../logger.js').child({ component: 'WebFrameworkShim' }) -const metrics = require('../metrics/names') -const TransactionShim = require('./transaction-shim') -const Shim = require('./shim') -const specs = require('./specs') -const util = require('util') -const symbols = require('../symbols') -const { assignCLMSymbol } = require('../util/code-level-metrics') - -/** - * An enumeration of well-known web frameworks so that new instrumentations can - * use the same names we already use for first-party instrumentation. - * - * Each of these values is also exposed directly on the WebFrameworkShim class - * as static members. - * - * @readonly - * @memberof WebFrameworkShim - * @enum {string} - */ -const FRAMEWORK_NAMES = { - CONNECT: 'Connect', - DIRECTOR: 'Director', - EXPRESS: 'Expressjs', - FASTIFY: 'Fastify', - HAPI: 'Hapi', - KOA: 'Koa', - NEXT: 'Nextjs', - NEST: 'Nestjs', - RESTIFY: 'Restify' -} - -const MIDDLEWARE_TYPE_DETAILS = { - APPLICATION: { name: 'Mounted App: ', path: true, record: false }, - ERRORWARE: { name: '', path: false, record: true }, - MIDDLEWARE: { name: '', path: false, record: true }, - PARAMWARE: { name: '', path: false, record: true }, - ROUTE: { name: 'Route Path: ', path: true, record: false }, - ROUTER: { name: 'Router: ', path: true, record: false } -} - -const MIDDLEWARE_TYPE_NAMES = { - APPLICATION: 'APPLICATION', - ERRORWARE: 'ERRORWARE', - MIDDLEWARE: 'MIDDLEWARE', - PARAMWARE: 'PARAMWARE', - ROUTE: 'ROUTE', - ROUTER: 'ROUTER' -} - -/** - * Constructs a shim associated with the given agent instance, specialized for - * instrumenting web frameworks. - * - * @class - * @augments TransactionShim - * @classdesc - * A helper class for wrapping web framework modules. - * @param {Agent} agent - * The agent this shim will use. - * @param shimName - * @param {string} moduleName - * The name of the module being instrumented. - * @param {string} resolvedName - * The full path to the loaded module. - * @see TransactionShim - * @see WebFrameworkShim.FRAMEWORK_NAMES - */ -function WebFrameworkShim(agent, moduleName, resolvedName, shimName) { - TransactionShim.call(this, agent, moduleName, resolvedName, shimName) - this._logger = logger.child({ module: moduleName }) - this._routeParser = _defaultRouteParser - this._errorPredicate = _defaultErrorPredicate - this._responsePredicate = _defaultResponsePredicate -} -module.exports = WebFrameworkShim -util.inherits(WebFrameworkShim, TransactionShim) - -// Add constants on the shim for the well-known frameworks. -WebFrameworkShim.FRAMEWORK_NAMES = FRAMEWORK_NAMES -Object.keys(FRAMEWORK_NAMES).forEach(function defineWebFrameworkMetricEnum(fwName) { - Shim.defineProperty(WebFrameworkShim, fwName, FRAMEWORK_NAMES[fwName]) - Shim.defineProperty(WebFrameworkShim.prototype, fwName, FRAMEWORK_NAMES[fwName]) -}) - -WebFrameworkShim.MIDDLEWARE_TYPE_NAMES = MIDDLEWARE_TYPE_NAMES -Object.keys(MIDDLEWARE_TYPE_NAMES).forEach(function defineMiddlewareTypeEnum(mtName) { - Shim.defineProperty(WebFrameworkShim, mtName, MIDDLEWARE_TYPE_NAMES[mtName]) - Shim.defineProperty(WebFrameworkShim.prototype, mtName, MIDDLEWARE_TYPE_NAMES[mtName]) -}) - -WebFrameworkShim.prototype.setRouteParser = setRouteParser -WebFrameworkShim.prototype.setFramework = setFramework -WebFrameworkShim.prototype.setTransactionUri = setTransactionUri -WebFrameworkShim.prototype.wrapMiddlewareMounter = wrapMiddlewareMounter -WebFrameworkShim.prototype.recordParamware = recordParamware -WebFrameworkShim.prototype.recordMiddleware = recordMiddleware -WebFrameworkShim.prototype.recordRender = recordRender -WebFrameworkShim.prototype.noticeError = noticeError -WebFrameworkShim.prototype.errorHandled = errorHandled -WebFrameworkShim.prototype.setErrorPredicate = setErrorPredicate -WebFrameworkShim.prototype.setResponsePredicate = setResponsePredicate -WebFrameworkShim.prototype.savePossibleTransactionName = savePossibleTransactionName - -// -------------------------------------------------------------------------- // - -/** - * @callback RouteParserFunction - * @summary - * Called whenever new middleware are mounted using the instrumented framework, - * this method should pull out a representation of the mounted path. - * @param {WebFrameworkShim} shim - * The shim in use for this instrumentation. - * @param {Function} fn - * The function which received this route string/RegExp. - * @param {string} fnName - * The name of the function to which this route was given. - * @param {string|RegExp} route - * The route that was given to the function. - * @returns {string|RegExp} The mount point from the given route. - */ - -/** - * @callback RouteRequestFunction - * @summary - * Extracts the request object from the arguments to the middleware function. - * @param {WebFrameworkShim} shim - The shim used for instrumentation. - * @param {Function} fn - The middleware function. - * @param {string} fnName - The name of the middleware function. - * @param {Array} args - The arguments to the middleware function. - * @returns {object} The request object. - */ - -/** - * @callback RouteNextFunction - * @summary - * Used to wrap functions that users can call to continue to the next middleware. - * @param {WebFrameworkShim} shim - The shim used for instrumentation. - * @param {Function} fn - The middleware function. - * @param {string} fnName - The name of the middleware function. - * @param {Array} args - The arguments to the middleware function. - * @param {NextWrapperFunction} wrap - A function to wrap an individual next function. - * @returns {object} The request object. - */ - -/** - * @callback RouteParameterFunction - * @summary - * Extracts the route parameters from the arguments to the middleware function. - * @param {WebFrameworkShim} shim - The shim used for instrumentation. - * @param {Function} fn - The middleware function. - * @param {string} fnName - The name of the middleware function. - * @param {Array} args - The arguments to the middleware function. - * @returns {object} A map of route parameter names to values. - */ - -/** - * @callback MiddlewareWrapperFunction - * @summary - * Called for each middleware passed to a mounting method. Should perform the - * wrapping of the middleware. - * @param {WebFrameworkShim} shim - * The shim used for instrumentation. - * @param {Function} middleware - * The middleware function to wrap. - * @param {string} fnName - * The name of the middleware function. - * @param {string} [route=null] - * The route the middleware is mounted on if one was found. - * @see WebFrameworkShim#recordMiddleware - * @see WebFrameworkShim#recordParamware - */ - -/** - * @interface MiddlewareSpec - * @description - * Describes the interface for middleware functions with this instrumentation. - * @property {number|RouteRequestFunction} [req=shim.FIRST] - * Indicates which argument to the middleware is the request object. It can also be - * a function to extract the request object from the middleware arguments. - * @property {number} [res=shim.SECOND] - * Indicates which argument to the middleware is the response object. - * @property {number|RouteNextFunction} [next=shim.THIRD] - * Indicates which argument to the middleware function is the callback. When it is - * a function, it will be called with the arguments of the middleware and a function - * for wrapping calls that represent continuation from the current middleware. - * @property {string} [name] - * The name to use for this middleware. Defaults to `middleware.name`. - * @property {RouteParameterFunction} [params] - * A function to extract the route parameters from the middleware arguments. - * Defaults to using `req.params`. - * @property {string} [type='MIDDLEWARE'] - * @property {string | Function} [route=null] - * Route/path used for naming segments and transaction name candidates. If a function, - * will be invoked just before segment creation with middleware invocation. - * @property {boolean} [appendPath=true] - * Indicates that the path associated with the middleware should be appended - * and popped from the stack of name candidates. - */ - -/** - * @interface MiddlewareMounterSpec - * @description - * Describes the arguments provided to mounting methods (e.g. `app.post()`). - * @property {number|string} [route=null] - * Tells which argument may be the mounting path for the other arguments. If - * the indicated argument is a function it is assumed the route was not provided - * and the indicated argument is a middleware function. If a string is provided - * it will be used as the mounting path. - * @property {MiddlewareWrapperFunction} [wrapper] - * A function to call for each middleware function passed to the mounter. - */ - -/** - * @interface RenderSpec - * @augments RecorderSpec - * @description - * Describes the interface for render methods. - * @property {number} [view=shim.FIRST] - * Identifies which argument is the name of the view being rendered. Defaults - * to {@link Shim#ARG_INDEXES shim.FIRST}. - * @see SegmentSpec - * @see RecorderSpec - */ - -// -------------------------------------------------------------------------- // - -/** - * Sets the function used to convert the route handed to middleware-adding - * methods into a string. - * - * - `setRouteParser(parser)` - * - * @memberof WebFrameworkShim.prototype - * @param {RouteParserFunction} parser - The parser function to use. - */ -function setRouteParser(parser) { - if (!this.isFunction(parser)) { - return this.logger.debug('Given route parser is not a function.') - } - this._routeParser = parser -} - -/** - * Sets the name of the web framework in use by the server to the one given. - * - * - `setFramework(framework)` - * - * This should be the first thing the instrumentation does. - * - * @memberof WebFrameworkShim.prototype - * @param {WebFrameworkShim.FRAMEWORK_NAMES|string} framework - * The name of the framework. - * @see WebFrameworkShim.FRAMEWORK_NAMES - */ -function setFramework(framework) { - this._metrics = { - PREFIX: framework + '/', - FRAMEWORK: framework, - MIDDLEWARE: metrics.MIDDLEWARE.PREFIX - } - this.agent.environment.setFramework(framework) - - this._logger = this._logger.child({ framework: framework }) - this.logger.trace({ metrics: this._metrics }, 'Framework metric names set') -} - -/** - * Sets the URI path to be used for naming the transaction currently in scope. - * - * @memberof WebFrameworkShim.prototype - * @param {string} uri - The URI path to use for the transaction. - */ -function setTransactionUri(uri) { - const tx = this.tracer.getTransaction() - if (!tx) { - return - } - - tx.nameState.setName(this._metrics.FRAMEWORK, tx.verb, metrics.ACTION_DELIMITER, uri) -} - -/** - * Records calls to methods used for rendering views. - * - * - `recordRender(nodule, properties [, spec])` - * - `recordRender(func [, spec])` - * - * @memberof WebFrameworkShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {RenderSpec} [spec] - * The spec for wrapping the render method. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - */ -function recordRender(nodule, properties, spec) { - if (this.isObject(properties) && !this.isArray(properties)) { - // recordRender(func, spec) - spec = properties - properties = null - } - - spec = this.setDefaults(spec, { - view: this.FIRST, - callback: null, - promise: null - }) - - return this.record(nodule, properties, function renderRecorder(shim, fn, name, args) { - const viewIdx = shim.normalizeIndex(args.length, spec.view) - if (viewIdx === null) { - shim.logger.debug('Invalid spec.view (%d vs %d), not recording.', spec.view, args.length) - return null - } - - return { - name: metrics.VIEW.PREFIX + args[viewIdx] + metrics.VIEW.RENDER, - callback: spec.callback, - promise: spec.promise, - recorder: genericRecorder, - - // Hidden class stuff - rowCallback: null, - stream: null, - internal: false - } - }) -} - -/** - * Wraps a method that is used to add middleware to a server. The middleware - * can then be recorded as metrics. - * - * - `wrapMiddlewareMounter(nodule, properties [, spec])` - * - `wrapMiddlewareMounter(func [, spec])` - * - * @memberof WebFrameworkShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {MiddlewareMounterSpec} [spec] - * Spec describing the parameters for this middleware mount point. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see WebFrameworkShim#recordMiddleware - */ -function wrapMiddlewareMounter(nodule, properties, spec) { - if (properties && !this.isString(properties) && !this.isArray(properties)) { - // wrapMiddlewareMounter(func, spec) - spec = properties - properties = null - } - if (this.isFunction(spec)) { - // wrapMiddlewareMounter(nodule [, properties], wrapper) - spec = { wrapper: spec } - } - - spec = this.setDefaults(spec, { - route: null, - endpoint: null - }) - - const wrapSpec = { - wrapper: function wrapMounter(shim, fn, fnName) { - if (!shim.isFunction(fn)) { - return fn - } - - return function wrappedMounter() { - const args = shim.argsToArray.apply(shim, arguments) - - // Normalize the route index and pull out the route argument if provided. - let routeIdx = null - let route = null - if (shim.isNumber(spec.route)) { - routeIdx = shim.normalizeIndex(args.length, spec.route) - route = routeIdx === null ? null : args[routeIdx] - const isArrayOfFunctions = shim.isArray(route) && shim.isFunction(route[0]) - if (shim.isFunction(route) || isArrayOfFunctions) { - routeIdx = null - route = null - } else if (shim.isArray(route)) { - route = route.map((routeArg) => { - return shim._routeParser.call(this, shim, fn, fnName, routeArg) - }) - } else { - route = shim._routeParser.call(this, shim, fn, fnName, route) - } - } else if (spec.route !== null) { - route = shim._routeParser.call(this, shim, fn, fnName, spec.route) - } - - _wrapMiddlewares.call(this, routeIdx, args) - /** - * @param _routeIdx - * @param middlewares - */ - function _wrapMiddlewares(_routeIdx, middlewares) { - for (let i = 0; i < middlewares.length; ++i) { - // If this argument is the route argument skip it. - if (i === _routeIdx) { - continue - } - - // Some platforms accept an arbitrarily nested array of middlewares, - // so if this argument is an array we must recurse into it. - const middleware = middlewares[i] - if (middleware instanceof Array) { - _wrapMiddlewares(null, middleware) - continue - } - - middlewares[i] = spec.wrapper.call( - this, - shim, - middleware, - shim.getName(middleware), - route - ) - } - } - - return fn.apply(this, args) - } - } - } - - _copyExpectedSpecParameters(wrapSpec, spec) - - return this.wrap(nodule, properties, wrapSpec) -} - -/** - * Records the provided function as a middleware. - * - * - `recordMiddleware(nodule, properties [, spec])` - * - `recordMiddleware(func [, spec])` - * - * @memberof WebFrameworkShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {MiddlewareSpec} [spec] - * The spec for wrapping the middleware. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - * @see WebFrameworkShim#wrapMiddlewareMounter - */ -function recordMiddleware(nodule, properties, spec) { - if (this.isObject(properties) && !this.isArray(properties)) { - // recordMiddleware(func, spec) - spec = properties - properties = null - } - spec = spec || Object.create(null) - - const mwSpec = new specs.MiddlewareSpec(spec) - const wrapSpec = new specs.WrapSpec(function wrapMiddleware(shim, middleware) { - return _recordMiddleware(shim, middleware, mwSpec) - }) - - _copyExpectedSpecParameters(wrapSpec, spec) - - return this.wrap(nodule, properties, wrapSpec) -} - -/** - * Records the provided function as a paramware. - * - * - `recordParamware(nodule, properties [, spec])` - * - `recordParamware(func [, spec])` - * - * Paramware are specialized middleware that execute when certain route - * parameters are encountered. For example, the route `/users/:userId` could - * trigger a paramware hooked to `userId`. - * - * For every new request that comes in, this should be called as early in the - * processing as possible. - * - * @memberof WebFrameworkShim.prototype - * @param {object | Function} nodule - * The source for the properties to wrap, or a single function to wrap. - * @param {string|Array.} [properties] - * One or more properties to wrap. If omitted, the `nodule` parameter is - * assumed to be the function to wrap. - * @param {MiddlewareSpec} [spec] - * The spec for wrapping the middleware. - * @returns {object | Function} The first parameter to this function, after - * wrapping it or its properties. - */ -function recordParamware(nodule, properties, spec) { - if (this.isObject(properties) && !this.isArray(properties)) { - // recordParamware(func, spec) - spec = properties - properties = null - } - spec = spec || Object.create(null) - - const mwSpec = new specs.MiddlewareSpec(spec) - if (spec && this.isString(spec.name)) { - mwSpec.route = '[param handler :' + spec.name + ']' - } else { - mwSpec.route = '[param handler]' - } - mwSpec.type = MIDDLEWARE_TYPE_NAMES.PARAMWARE - - const wrapSpec = new specs.WrapSpec(function wrapParamware(shim, middleware, name) { - mwSpec.name = name - return _recordMiddleware(shim, middleware, mwSpec) - }) - - _copyExpectedSpecParameters(wrapSpec, spec) - - return this.wrap(nodule, properties, wrapSpec) -} - -/** - * Tells the shim that the given request has caused an error. - * - * The given error will be checked for truthiness and if it passes the error - * predicate check before being held onto. - * - * Use {@link WebFrameworkShim#errorHandled} to unnotice an error if it is later - * caught by the user. - * - * @memberof WebFrameworkShim.prototype - * @param {Request} req - The request which caused the error. - * @param {*?} err - The error which has occurred. - * @see WebFrameworkShim#errorHandled - * @see WebFrameworkShim#setErrorPredicate - */ -function noticeError(req, err) { - const txInfo = _getTransactionInfo(this, req) - if (txInfo && _isError(this, err)) { - _noticeError(this, txInfo, err) - } -} - -/** - * Indicates that the given error has been handled for this request. - * - * @memberof WebFrameworkShim.prototype - * @param {Request} req - The request which caused the error. - * @param {*} err - The error which has been handled. - * @see WebFrameworkShim#noticeError - * @see WebFrameworkShim#setErrorPredicate - */ -function errorHandled(req, err) { - const txInfo = _getTransactionInfo(this, req) - if (txInfo && txInfo.error === err) { - txInfo.errorHandled = true - } -} - -/** - * Sets a function to call when an error is noticed to determine if it is really - * an error. - * - * @memberof WebFrameworkShim.prototype - * @param {function(object): bool} pred - * Function which should return true if the object passed to it is considered - * an error. - * @see WebFrameworkShim#noticeError - * @see WebFrameworkShim#errorHandled - */ -function setErrorPredicate(pred) { - this._errorPredicate = pred -} - -/** - * Marks the current path as a potential responder. - * - * @memberof WebFrameworkShim.prototype - * @param {Request} req - The request which caused the error. - */ -function savePossibleTransactionName(req) { - const txInfo = _getTransactionInfo(this, req) - if (txInfo && txInfo.transaction) { - txInfo.transaction.nameState.markPath() - } -} - -/** - * Sets a function to call with the result of a middleware to determine if it has - * responded. - * - * @memberof WebFrameworkShim.prototype - * @param {function(args, object): bool} pred - * Function which should return true if the object passed to it is considered - * a response. - */ -function setResponsePredicate(pred) { - this._responsePredicate = pred -} - -// -------------------------------------------------------------------------- // - -/** - * Default route parser function if one is not provided. - * - * @private - * @param {WebFrameworkShim} shim - * The shim in use for this instrumentation. - * @param {Function} fn - * The function which received this route string/RegExp. - * @param {string} fnName - * The name of the function to which this route was given. - * @param {string|RegExp} route - * The route that was given to the function. - * @see RouteParserFunction - */ -function _defaultRouteParser(shim, fn, fnName, route) { - if (route instanceof RegExp) { - return '/' + route.source + '/' - } else if (typeof route === 'string') { - return route - } - - return '' -} - -/** - * Default error predicate just returns true. - * - * @private - * @returns {bool} True. Always. - */ -function _defaultErrorPredicate() { - return true -} - -/** - * Default response predicate just returns false. - * - * @private - * @returns {bool} False. Always. - */ -function _defaultResponsePredicate() { - return false -} - -/** - * Wraps the given function in a middleware recorder function. - * - * @private - * @param {WebFrameworkShim} shim - * The shim used for this instrumentation. - * @param {Function} middleware - * The middleware function to record. - * @param {MiddlewareSpec} spec - * The spec describing the middleware. - * @returns {Function} The middleware function wrapped in a recorder. - */ -function _recordMiddleware(shim, middleware, spec) { - /** - * - */ - function getRoute() { - let route = spec.route || '/' - - if (shim.isFunction(route)) { - route = route() - } - - if (route instanceof RegExp) { - route = '/' + route.source + '/' - } else if (shim.isArray(route)) { - route = route.join(',') - } else if (route[0] !== '/') { - route = '/' + route - } - - return route - } - - const typeDetails = MIDDLEWARE_TYPE_DETAILS[spec.type] - const name = spec.name || shim.getName(shim.getOriginal(middleware)) - let metricName = shim._metrics.PREFIX + typeDetails.name - if (typeDetails.record) { - metricName = shim._metrics.MIDDLEWARE + metricName + name - } - - /** - * @param route - */ - function getSegmentName(route) { - let segmentName = metricName - if (typeDetails.path) { - segmentName += route - } else if (route.length > 1) { - segmentName += '/' + route - } - - return segmentName - } - - const isErrorWare = spec.type === MIDDLEWARE_TYPE_NAMES.ERRORWARE - const getReq = shim.isFunction(spec.req) ? spec.req : _makeGetReq(shim, spec.req) - - assignCLMSymbol(shim, middleware) - - return shim.record( - middleware, - spec.promise ? middlewareWithPromiseRecorder : middlewareWithCallbackRecorder - ) - - // TODO: let's please break these out - /** - * @param shim - * @param fn - * @param fnName - * @param args - */ - function middlewareWithCallbackRecorder(shim, fn, fnName, args) { - const route = getRoute() - - // Pull out the request object. - const req = getReq.call(this, shim, fn, fnName, args) - - // Fetch the transaction information from that request. - const txInfo = _getTransactionInfo(shim, req) - if (!txInfo || !txInfo.transaction) { - shim.logger.debug( - { txInfo: txInfo }, - 'Could not get transaction info in %s (%s)', - route, - fnName - ) - return null - } - txInfo.transaction.nameState.setPrefix(shim._metrics.FRAMEWORK) - txInfo.errorHandled |= isErrorWare - - // Copy over route parameters onto the transaction root. - let params = shim.agent.config.high_security - ? null - : spec.params.call(this, shim, fn, fnName, args, req) - - // Route parameters are handled here, query parameters are handled in lib/transaction/index.js#_markAsWeb as part of finalization - params = shim.prefixRouteParameters(params) - - // Wrap up `next` and push on our name state if we find it. We only want to - // push the name state if there is a next so that we can safely remove it - // if context leaves this middleware. - let nextWrapper = null - if (shim.isFunction(spec.next)) { - const nextDetails = { - route, - wrapNext: spec.next, - isErrorWare, - isPromise: false, - appendPath: spec.appendPath - } - - nextWrapper = _makeNextBinder(nextDetails, txInfo) - } else { - const nextIdx = shim.normalizeIndex(args.length, spec.next) - if (nextIdx !== null && args[nextIdx] instanceof Function) { - const nextDetails = { - route, - wrapNext: function wrapNext(s, f, n, _args, wrap) { - wrap(_args, nextIdx) - }, - isErrorWare, - isPromise: false, - appendPath: spec.appendPath - } - - nextWrapper = _makeNextBinder(nextDetails, txInfo) - } - } - - // Append this middleware's mount point if it's not an errorware... - // (to avoid doubling up, a la 'WebTransaction/Expressjs/GET//test/test') - if (!isErrorWare && spec.appendPath) { - txInfo.transaction.nameState.appendPath(route, params) - } - - // ...and possibly construct a recorder - let recorder = null - if (typeDetails.record) { - const stackPath = txInfo.transaction.nameState.getPath() || '' - recorder = _makeMiddlewareRecorder(shim, metricName + '/' + stackPath) - } - - const segmentName = getSegmentName(route) - - // Finally, return the segment descriptor. - return { - name: segmentName, - callback: nextWrapper, - parent: txInfo.segmentStack[txInfo.segmentStack.length - 1], - recorder: recorder, - parameters: params, - after: function afterExec(shim, _fn, _name, err) { - const errIsError = _isError(shim, err) - if (errIsError) { - _noticeError(shim, txInfo, err) - } else if (!nextWrapper && !isErrorWare && spec.appendPath) { - txInfo.transaction.nameState.popPath(route) - } - if (errIsError || !nextWrapper) { - txInfo.segmentStack.pop() - } - } - } - } - - /** - * @param shim - * @param fn - * @param fnName - * @param args - */ - function middlewareWithPromiseRecorder(shim, fn, fnName, args) { - const route = getRoute() - - // Pull out the request object. - const req = getReq.call(this, shim, fn, fnName, args) - - // Fetch the transaction information from that request. - const txInfo = _getTransactionInfo(shim, req) - if (!txInfo || !txInfo.transaction) { - shim.logger.debug( - { txInfo: txInfo }, - 'Could not get transaction info in %s (%s)', - route, - fnName - ) - return null - } - txInfo.transaction.nameState.setPrefix(shim._metrics.FRAMEWORK) - txInfo.errorHandled |= isErrorWare - - // Copy over route parameters onto the transaction root. - let params = shim.agent.config.high_security - ? null - : spec.params.call(this, shim, fn, fnName, args, req) - - // Route parameters are handled here, query parameters are handled in lib/transaction/index.js#_markAsWeb as part of finalization - params = shim.prefixRouteParameters(params) - - // Append this middleware's mount point and possibly construct a recorder. - if (spec.appendPath) { - txInfo.transaction.nameState.appendPath(route, params) - } - let recorder = null - if (typeDetails.record) { - const stackPath = txInfo.transaction.nameState.getPath() || '' - recorder = _makeMiddlewareRecorder(shim, metricName + '/' + stackPath) - } - - // The next callback style can still apply to promise based - // middleware (e.g. koa). In this case we would like to remove the - // path for the current executing middleware, then readd it once the - // next callback is done (either asynchronously or after the - // returned promise is resolved). - let nextWrapper = function pushSegment(shim, _fn, _name, segment) { - txInfo.segmentStack.push(segment) - } - if (shim.isFunction(spec.next)) { - const nextDetails = { - route, - wrapNext: spec.next, - isErrorWare, - isPromise: true, - appendPath: spec.appendPath - } - nextWrapper = _makeNextBinder(nextDetails, txInfo) - } else { - const nextIdx = shim.normalizeIndex(args.length, spec.next) - if (nextIdx !== null && args[nextIdx] instanceof Function) { - const nextDetails = { - route, - wrapNext: function wrapNext(s, f, n, _args, wrap) { - wrap(_args, nextIdx) - }, - isErrorWare, - isPromise: true, - appendPath: spec.appendPath - } - - nextWrapper = _makeNextBinder(nextDetails, txInfo) - } - } - - const segmentName = getSegmentName(route) - - // Finally, return the segment descriptor. - return { - name: segmentName, - parent: txInfo.segmentStack[txInfo.segmentStack.length - 1], - promise: spec.promise, - callback: nextWrapper, - recorder: recorder, - parameters: params, - after: function afterExec(shim, _fn, _name, err, result) { - if (shim._responsePredicate(args, result)) { - txInfo.transaction.nameState.freeze() - } - if (_isError(shim, err)) { - _noticeError(shim, txInfo, err) - } else { - txInfo.errorHandled = true - - if (spec.appendPath) { - txInfo.transaction.nameState.popPath(route) - } - } - txInfo.segmentStack.pop() - } - } - } -} - -/** - * @param shim - * @param req - */ -function _makeGetReq(shim, req) { - return function getReqFromArgs(shim, fn, name, args) { - const reqIdx = shim.normalizeIndex(args.length, req) - if (reqIdx === null || !args[reqIdx]) { - shim.logger.debug('Can not find request parameter, not recording.') - return null - } - return args[reqIdx] - } -} - -/** - * @param nextDetails - * @param txInfo - */ -function _makeNextBinder(nextDetails, txInfo) { - return function bindNext(shim, fn, _name, segment, args) { - if (!segment) { - return - } - txInfo.segmentStack.push(segment) - - nextDetails.wrapNext(shim, fn, _name, args, nextWrapper) - - // Called from outside to wrap functions that could be called to continue - // to the next middleware - /** - * @param nodule - * @param property - * @param isFinal - */ - function nextWrapper(nodule, property, isFinal) { - shim.wrap(nodule, property, function wrapper(shim, original) { - const parentSegment = segment || shim.getSegment() - return shim.bindSegment(function boundNext(err) { - // Only pop the stack if we didn't error. This way the transaction - // name is derived from the failing middleware. - if (_isError(shim, err)) { - _noticeError(shim, txInfo, err) - } else if (!isFinal && !nextDetails.isErrorWare && nextDetails.appendPath) { - segment.transaction.nameState.popPath(nextDetails.route) - } - - // The next call does not signify the end of the segment - // calling next in the promise case. Keep the segment on the - // stack and wait for its promise to be resolved to end it. - if (!nextDetails.isPromise) { - txInfo.segmentStack.pop() - segment.end() - } - const ret = original.apply(this, arguments) - - if (nextDetails.isPromise && shim.isPromise(ret)) { - // After the next call has resolved, we should reinstate the - // segment responsible for calling next in case there is - // more work to do in that scope. - return ret.then(function onNextFinish(v) { - if (nextDetails.appendPath) { - segment.transaction.nameState.appendPath(nextDetails.route) - } - - txInfo.segmentStack.push(segment) - - return v - }) - } - - return ret - }, parentSegment) // Bind to parent. - }) - } - } -} - -/** - * Retrieves the cached transaction information from the given object if it is - * available. - * - * @private - * @param {WebFrameworkShim} shim - The shim used for this instrumentation. - * @param {http.IncomingMessage} req - The incoming request object. - * @returns {object?} The transaction information if available, otherwise null. - */ -function _getTransactionInfo(shim, req) { - try { - return req[symbols.transactionInfo] || null - } catch (e) { - shim.logger.debug(e, 'Failed to fetch transaction info from req') - return null - } -} - -/** - * Creates a recorder for middleware metrics. - * - * @private - * @param shim - * @param metricName - * @param {string} path - The mounting path of the middleware. - * @param {Segment} segment - The segment generated for this middleware. - * @param {string} scope - The scope of the metric to record. - */ -function _makeMiddlewareRecorder(shim, metricName) { - return function middlewareMetricRecorder(segment, scope) { - const duration = segment.getDurationInMillis() - const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - - if (scope) { - transaction.measure(metricName, scope, duration, exclusive) - } - transaction.measure(metricName, null, duration, exclusive) - } -} - -/** - * Adds the given error to the transaction information if it is actually an error. - * - * @private - * @param {WebFrameworkShim} shim - * The shim used for this web framework. - * @param {TransactionInfo} txInfo - * The transaction context information for the request. - * @param {*} err - * The error to notice. - */ -function _noticeError(shim, txInfo, err) { - txInfo.error = err - txInfo.errorHandled = false -} - -/** - * Determines if the given object is an error according to the shim. - * - * @private - * @param {WebFrameworkShim} shim - * The shim used for this web framework. - * @param {?*} err - * The object to check for error-ness. - * @returns {bool} True if the given object is an error according to the shim. - */ -function _isError(shim, err) { - return err && shim._errorPredicate(err) -} - -/** - * Copy the keys expected from source to destination. - * - * @private - * @param {object} destination - * The spec object receiving the expected values - * @param {object} source - * The spec object the values are coming from - */ -function _copyExpectedSpecParameters(destination, source) { - const keys = ['matchArity'] - - for (let i = 0; i < keys.length; ++i) { - const key = keys[i] - if (source[key] != null) { - destination[key] = source[key] - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shimmer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shimmer.js deleted file mode 100644 index af876594b..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/shimmer.js +++ /dev/null @@ -1,768 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const path = require('path') -const semver = require('semver') -const fs = require('./util/unwrapped-core').fs -const logger = require('./logger').child({ component: 'shimmer' }) -const INSTRUMENTATIONS = require('./instrumentations')() -const properties = require('./util/properties') -const shims = require('./shim') - -const NAMES = require('./metrics/names') -const symbols = require('./symbols') - -const MODULE_TYPE = shims.constants.MODULE_TYPE - -const CORE_INSTRUMENTATION = { - child_process: { - type: MODULE_TYPE.GENERIC, - file: 'child_process.js' - }, - crypto: { - type: MODULE_TYPE.GENERIC, - file: 'crypto.js' - }, - // domain: { // XXX Do not include domains in this list! The - // type: MODULE_TYPE.GENERIC, // core instrumentations are run at startup by - // file: 'domain.js' // requiring each of their modules. Loading - // }, // `domain` has side effects that we try to avoid. - dns: { - type: MODULE_TYPE.GENERIC, - file: 'dns.js' - }, - fs: { - type: MODULE_TYPE.GENERIC, - file: 'fs.js' - }, - http: { - type: MODULE_TYPE.TRANSACTION, - file: 'http.js' - }, - https: { - type: MODULE_TYPE.TRANSACTION, - file: 'http.js' - }, - inspector: { - type: MODULE_TYPE.GENERIC, - file: 'inspector.js' - }, - net: { - type: MODULE_TYPE.GENERIC, - file: 'net.js' - }, - timers: { - type: MODULE_TYPE.GENERIC, - file: 'timers.js' - }, - zlib: { - type: MODULE_TYPE.GENERIC, - file: 'zlib.js' - } -} - -const FORCE_MODULE_RESOLUTION_WARNING = - 'Unable to retrieve cached path for one or more modules ' + - 'with an already loaded parent. Forcing resolution. ' + - 'This should not occur during normal agent execution. ' + - 'Module resolution performance my be impacted. ' + - 'See trace-level logs for specific modules.' - -/** - * Unwrapping is only likely to be used by test code, and is a fairly drastic - * maneuver, but it should be pretty safe if there's a desire to reboot the - * agent in flight. - * - * All of the wrapped methods are tracked in this constiable and used by unwrapAll - * below. - */ -let instrumented = [] - -const shimmer = (module.exports = { - /** - * If debug isn't false, the agent will retain references to wrapped methods - * for the entire lifetime of the agent. Some instrumentation depends on - * wrapping functions on individual objects, and this will cause the agent - * to retain references to a large number of dead objects. - */ - debug: false, - - /** - * Detects if the given function has already been wrapped. - * - * @param {Function} fn - The function to look for a wrapper on. - * @returns {bool} True if `fn` exists and has an attached original, else false. - */ - isWrapped: function isWrapped(fn) { - return !!(fn && fn[symbols.original]) - }, - - /** - * Don't throw, but do log and bail out if wrapping fails. - * - * Provide an escape hatch by creating a closure around the original method - * and object / module wrapped into a helper function that will restore the - * original function / method. See Sinon for a systematic use of this - * pattern. - * - * @param {object} nodule Class or module containing the function to wrap. - * @param {object} noduleName Human-readable module / Class name. More - * helpful than you'd think. - * @param {string} methods One or more names of methods or functions to extract - * and wrap. - * @param {Function} wrapper A generator that, when called, returns a - * wrapped version of the original function. - */ - wrapMethod: function wrapMethod(nodule, noduleName, methods, wrapper) { - if (!methods) { - logger.warn(new Error(), 'Must include a method name to wrap. Called from:') - return - } - - if (!noduleName) { - noduleName = '[unknown]' - } - if (!Array.isArray(methods)) { - methods = [methods] - } - - methods.forEach((method) => { - const fqmn = noduleName + '.' + method - - if (!nodule) { - logger.debug("Can't wrap %s from nonexistent object.", fqmn) - return - } - - if (!wrapper) { - logger.debug("Can't wrap %s without a wrapper generator.", fqmn) - return - } - - const original = nodule[method] - - if (!original) { - logger.trace('%s not defined, so not wrapping.', fqmn) - return - } - if (original[symbols.unwrap]) { - logger.debug('%s already wrapped by agent.', fqmn) - return - } - - const wrapped = wrapper(original, method) - Object.keys(original).forEach((key) => { - wrapped[key] = original[key] - }) - wrapped[symbols.original] = original - // eslint-disable-next-line camelcase - wrapped[symbols.unwrap] = function unwrap() { - nodule[method] = original - logger.trace('Removed instrumentation from %s.', fqmn) - } - - nodule[method] = wrapped - if (shimmer.debug) { - instrumented.push(wrapped) - } - logger.trace('Instrumented %s.', fqmn) - }) - }, - - /** - * Sometimes you gotta do some crazy stuff to get the job done. Instead of using - * regular monkeypatching, wrapDeprecated allows you to pass in a getter and setter - * and then uses defineProperty to replace the original property with an - * accessor. Note that responsibility for unwrapping is not handled by this - * function. - * - * @param {object} nodule Class or module containing the property to - * wrap. - * @param {object} noduleName Human-readable module / Class name. More - * helpful than you'd think. - * @param {string} property The property to replace with the accessor. - * @param {Function} options Optional getter and setter to use for the accessor. - * @returns {object} The original value of the property. - */ - wrapDeprecated: function wrapDeprecated(nodule, noduleName, property, options) { - if (!property) { - logger.warn(new Error(), 'Must include a function name to wrap. Called from:') - return - } - - if (!noduleName) { - noduleName = '[unknown]' - } - - const fqmn = noduleName + '.' + property - if (!nodule) { - logger.debug("Can't wrap %s from nonexistent object.", fqmn) - return - } - - const original = nodule[property] - if (!original) { - logger.trace('%s not defined, so not wrapping.', fqmn) - return - } - - delete nodule[property] - - const descriptor = { - configurable: true, - enumerable: true - } - if (options.get) { - descriptor.get = options.get - } - if (options.set) { - descriptor.set = options.set - } - Object.defineProperty(nodule, property, descriptor) - logger.trace('Instrumented %s.', fqmn) - - if (shimmer.debug) { - instrumented.push({ - [symbols.unwrap]: function unwrapDeprecated() { - delete nodule[property] - nodule[property] = original - } - }) - } - - return original - }, - - unwrapMethod: function unwrapMethod(nodule, noduleName, method) { - if (!noduleName) { - noduleName = '[unknown]' - } - if (!method) { - return logger.debug( - 'Must include a method name to unwrap. ' + 'Called from: %s', - new Error().stack - ) - } - - const fqmn = noduleName + '.' + method - - if (!nodule) { - return logger.debug("Can't unwrap %s from nonexistent object.", fqmn) - } - - const wrapped = nodule[method] - - // keep instrumented up to date - const pos = instrumented.indexOf(wrapped) - if (pos !== -1) { - instrumented.splice(pos, 1) - } - - if (!wrapped) { - return logger.debug('%s not defined, so not unwrapping.', fqmn) - } - if (!wrapped[symbols.unwrap]) { - return logger.debug("%s isn't unwrappable.", fqmn) - } - - wrapped[symbols.unwrap]() - }, - - unwrapAll: function unwrapAll() { - instrumented.forEach((wrapper) => { - wrapper[symbols.unwrap]() - }) - instrumented = [] - }, - - /** - * Patch the module.load function so that we see modules loading and - * have an opportunity to patch them with instrumentation. - * - * @param agent - */ - patchModule: function patchModule(agent) { - logger.trace('Wrapping module loader.') - const Module = require('module') - const filepathMap = {} - - shimmer.wrapMethod(Module, 'Module', '_resolveFilename', function wrapRes(resolve) { - return function wrappedResolveFilename(file) { - // This is triggered by the load call, so record the path that has been seen so - // we can examine it after the load call has returned. - const resolvedFilepath = resolve.apply(this, arguments) - - // Only fire the first time we see a specific module resolved - if (filepathMap[file] !== resolvedFilepath) { - filepathMap[file] = resolvedFilepath - - _onResolveFileName(agent, file, resolvedFilepath) - } - - return resolvedFilepath - } - }) - - shimmer.wrapMethod(Module, 'Module', '_load', function wrapLoad(load) { - return function wrappedLoad(request, parent, isMain) { - // _load() will invoke _resolveFilename() first time resolving a module. - const m = load.apply(this, arguments) - - const fileName = resolveFileName(request, parent, isMain) - return _postLoad(agent, m, request, fileName) - } - }) - - /** - * Forces file name resolve for modules not in our cache when - * their parent has already been loaded/cached by Node. - * Provides a fall-back for unexpected cases that may occur. - * Also provides flexibility for testing now that node 11+ caches these. - * - * @param {*} request - * @param {*} parent - * @param {*} isMain - */ - function resolveFileName(request, parent, isMain) { - const cachedPath = filepathMap[request] - if (!cachedPath && parent && parent.loaded) { - logger.warnOnce('Force Resolution', FORCE_MODULE_RESOLUTION_WARNING) - - if (logger.traceEnabled()) { - logger.trace(`No cached path found for ${request}. Forcing resolution.`) - } - - // Our patched _resolveFilename will cache. No need to here. - return Module._resolveFilename(request, parent, isMain) - } - - return cachedPath - } - }, - - unpatchModule: function unpatchModule() { - logger.trace('Unwrapping to previous module loader.') - const Module = require('module') - - shimmer.unwrapMethod(Module, 'Module', '_resolveFilename') - shimmer.unwrapMethod(Module, 'Module', '_load') - }, - - /** - * Registers all instrumentation for 3rd party libraries. - * - * This is all 3rd party libs with the exception of the domain library in Node.js core - * - * @param {object} agent NR agent - */ - registerThirdPartyInstrumentation(agent) { - for (const [moduleName, instrInfo] of Object.entries(INSTRUMENTATIONS)) { - if (instrInfo.module) { - // Because external instrumentations can change independent of - // the agent core, we don't want breakages in them to entirely - // disable the agent. - try { - const hooks = require(instrInfo.module + '/nr-hooks') - hooks.forEach(shimmer.registerInstrumentation) - } catch (e) { - logger.warn('Failed to load instrumentation for ' + instrInfo.module, e) - return - } - } else if (moduleName === 'amqplib') { - // TODO: Remove this code when amqplib instrumentation is made external. - require('./instrumentation/amqplib').selfRegister(shimmer) - } else { - const fileName = path.join(__dirname, 'instrumentation', moduleName + '.js') - shimmer.registerInstrumentation({ - moduleName: moduleName, - type: instrInfo.type, - onRequire: _firstPartyInstrumentation.bind(null, agent, fileName) - }) - } - } - - // Even though domain is a core module we add it as a registered - // instrumentation to be lazy-loaded because we do not want to cause domain - // usage. - const domainPath = path.join(__dirname, 'instrumentation/core/domain.js') - shimmer.registerInstrumentation({ - moduleName: 'domain', - type: null, - onRequire: _firstPartyInstrumentation.bind(null, agent, domainPath) - }) - }, - - /** - * Registers all instrumentation for Node.js core libraries. - * - * @param {object} agent NR agent - */ - registerCoreInstrumentation(agent) { - // Instrument global. - const globalShim = new shims.Shim(agent, 'globals', 'globals') - applyDebugState(globalShim, global) - const globalsFilepath = path.join(__dirname, 'instrumentation', 'core', 'globals.js') - _firstPartyInstrumentation(agent, globalsFilepath, globalShim, global, 'globals') - - // Instrument each of the core modules. - for (const [mojule, core] of Object.entries(CORE_INSTRUMENTATION)) { - const filePath = path.join(__dirname, 'instrumentation', 'core', core.file) - let uninstrumented = null - - try { - uninstrumented = require(mojule) - } catch (err) { - logger.trace('Could not load core module %s got error %s', mojule, err) - } - - const shim = shims.createShimFromType(core.type, agent, mojule, mojule) - applyDebugState(shim, core) - _firstPartyInstrumentation(agent, filePath, shim, uninstrumented, mojule) - } - }, - - bootstrapInstrumentation: function bootstrapInstrumentation(agent) { - shimmer.registerCoreInstrumentation(agent) - shimmer.registerThirdPartyInstrumentation(agent) - }, - - registerInstrumentation: function registerInstrumentation(opts) { - if (!hasValidRegisterOptions(opts)) { - return - } - - const registeredInstrumentation = shimmer.registeredInstrumentations[opts.moduleName] - - if (!registeredInstrumentation) { - shimmer.registeredInstrumentations[opts.moduleName] = [] - } - - shimmer.registeredInstrumentations[opts.moduleName].push({ ...opts }) - }, - - registeredInstrumentations: Object.create(null), - - /** - * NOT FOR USE IN PRODUCTION CODE - * - * If an instrumented module has a dependency on another instrumented module, - * and multiple tests are being run in a single test suite with their own - * setup and teardown between tests, it's possible transitive dependencies - * will be unwrapped in the module cache in-place (which needs to happen to - * prevent stale closures from channeling instrumentation data to incorrect - * agents, but which means the transitive dependencies won't get re-wrapped - * the next time the parent module is required). - * - * Since this only applies in test code, it's not worth the drastic - * monkeypatching to Module necessary to walk the list of child modules and - * re-wrap them. - * - * Use this to re-apply any applicable instrumentation. - * - * @param agent - * @param modulePath - */ - reinstrument: function reinstrument(agent, modulePath) { - return _postLoad(agent, require(modulePath), modulePath) - }, - - /** - * Given a NodeJS module name, return the name/identifier of our - * instrumentation. These two things are usually, but not always, - * the same. - * - * @param moduleName - */ - getInstrumentationNameFromModuleName(moduleName) { - // XXX When updating these special cases, also update `uninstrumented`. - // To allow for instrumenting both 'pg' and 'pg.js'. - if (moduleName === 'pg.js') { - moduleName = 'pg' - } - - return moduleName - }, - - /** - * Checks all registered instrumentation for a module and returns true - * only if every hook succeeded. - * - * @param {string} moduleName name of registered instrumentation - * @returns {boolean} - */ - isInstrumented(moduleName) { - const instrumentations = shimmer.registeredInstrumentations[moduleName] - const didInstrument = instrumentations.filter( - (instrumentation) => instrumentation[symbols.instrumented] - ) - return didInstrument.length === instrumentations.length - }, - - instrumentPostLoad(agent, module, moduleName, resolvedName, returnModule = false) { - const result = _postLoad(agent, module, moduleName, resolvedName) - // This is to not break the public API - // previously it would just call instrumentation - // and not check the result - return returnModule ? result : shimmer.isInstrumented(moduleName) - } -}) - -function applyDebugState(shim, nodule) { - if (shimmer.debug) { - shim.enableDebug() - instrumented.push(shim) - instrumented.push({ - [symbols.unwrap]: function unwrapNodule() { - delete nodule[symbols.shim] - } - }) - nodule[symbols.shim] = shim - } -} - -/** - * All instrumentation files must export the same interface: a single - * initialization function that takes the agent and the module to be - * instrumented. - * - * @param agent - * @param nodule - * @param moduleName - * @param resolvedName - */ -function instrumentPostLoad(agent, nodule, moduleName, resolvedName) { - const instrumentations = shimmer.registeredInstrumentations[moduleName] - instrumentations.forEach((instrumentation) => { - if ( - properties.hasOwn(instrumentation, symbols.instrumented) || - properties.hasOwn(instrumentation, symbols.instrumentedErrored) - ) { - logger.trace( - 'Already instrumented or failed to instrument %s, skipping redundant instrumentation', - moduleName - ) - return - } - - const shim = shims.createShimFromType( - instrumentation.type, - agent, - moduleName, - resolvedName, - instrumentation.shimName - ) - - applyDebugState(shim, nodule) - trackInstrumentationUsage( - agent, - shim, - instrumentation.specifier || moduleName, - NAMES.FEATURES.INSTRUMENTATION.ON_REQUIRE - ) - - // Tracking instrumentation is only used to add the supportability metrics - // that occur directly above this. No reason to attempt to load instrumentation - // as it does not exist. - if (instrumentation.type === MODULE_TYPE.TRACKING) { - instrumentation[symbols.instrumented] = true - return - } - - try { - if (instrumentation.onRequire(shim, nodule, moduleName) !== false) { - nodule = shim.getExport(nodule) - instrumentation[symbols.instrumented] = true - } - } catch (instrumentationError) { - instrumentation[symbols.instrumentedErrored] = true - if (instrumentation.onError) { - try { - instrumentation.onError(instrumentationError) - } catch (e) { - logger.warn( - e, - instrumentationError, - 'Custom instrumentation for %s failed, then the onError handler threw an error', - moduleName - ) - } - } else { - logger.warn( - instrumentationError, - 'Custom instrumentation for %s failed. Please report this to the ' + - 'maintainers of the custom instrumentation.', - moduleName - ) - } - } - }) - - return nodule -} - -function _firstPartyInstrumentation(agent, fileName, shim, nodule, moduleName) { - const fullPath = path.resolve(fileName) - if (!fs.existsSync(fileName)) { - return logger.warn('Tried to load instrumentation from %s, but file does not exist', fullPath) - } - try { - return require(fileName)(agent, nodule, moduleName, shim) - } catch (error) { - logger.warn( - error, - 'Failed to instrument module %s using %s', - path.basename(fileName, '.js'), - fullPath - ) - } -} - -function _postLoad(agent, nodule, name, resolvedName) { - const instrumentation = shimmer.getInstrumentationNameFromModuleName(name) - const registeredInstrumentation = shimmer.registeredInstrumentations[instrumentation] - const hasPostLoadInstrumentation = - registeredInstrumentation && - registeredInstrumentation.length && - registeredInstrumentation.filter((instrumentation) => instrumentation.onRequire).length - - // Check if this is a known instrumentation and then run it. - if (hasPostLoadInstrumentation) { - logger.trace('Instrumenting %s with onRequire (module loaded) hook.', name) - return instrumentPostLoad(agent, nodule, instrumentation, resolvedName) - } - - return nodule -} - -function _onResolveFileName(agent, requiredNameOrPath, resolvedFilepath) { - const instrumentation = shimmer.getInstrumentationNameFromModuleName(requiredNameOrPath) - const registeredInstrumentation = shimmer.registeredInstrumentations[instrumentation] - const hasResolvedFileInstrumentation = - registeredInstrumentation && - registeredInstrumentation.length && - registeredInstrumentation.filter((instrumentation) => instrumentation.onResolved).length - - // Check if this is a known instrumentation and then run it. - if (hasResolvedFileInstrumentation) { - logger.trace('Instrumenting %s with onResolved hook.', requiredNameOrPath) - _instrumentOnResolved(agent, instrumentation, resolvedFilepath) - } -} - -/** - * Invokes the onResolved handler with a shim instance. - * - * Given Node.js caches resolvedFilePaths in versions we support and we cache as well - * for the cases we force resolution, we should not run into the case of multiple - * invocations for the same module. As such, this function does not defend against multiple runs. - * - * @param agent - * @param moduleName - * @param resolvedFilepath - */ -function _instrumentOnResolved(agent, moduleName, resolvedFilepath) { - const instrumentations = shimmer.registeredInstrumentations[moduleName] - instrumentations.forEach((instrumentation) => { - const shim = shims.createShimFromType(instrumentation.type, agent, moduleName, resolvedFilepath) - - trackInstrumentationUsage( - agent, - shim, - instrumentation.specifier || moduleName, - NAMES.FEATURES.INSTRUMENTATION.ON_RESOLVED - ) - - try { - instrumentation.onResolved(shim, moduleName, resolvedFilepath) - } catch (instrumentationError) { - if (instrumentation.onError) { - try { - instrumentation.onError(instrumentationError) - } catch (error) { - logger.warn( - error, - instrumentationError, - 'OnResolved instrumentation for %s failed, then the onError handler threw an error', - moduleName - ) - } - } else { - logger.warn( - instrumentationError, - 'OnResolved instrumentation for %s failed. Please report this to the ' + - 'maintainers of the custom instrumentation.', - moduleName - ) - } - } - }) -} - -function hasValidRegisterOptions(opts) { - if (!opts) { - logger.warn('Instrumentation registration failed, no options provided') - return false - } - - if (!opts.moduleName) { - logger.warn(`Instrumentation registration failed, 'moduleName' not provided`) - return false - } - - if (!opts.onRequire && !opts.onResolved) { - logger.warn( - 'Instrumentation registration for %s failed, no require hooks provided.', - opts.moduleName - ) - - return false - } - - return true -} - -/** - * Adds metrics to indicate instrumentation was used for a particular module and - * what major version the module was at, if possible. - * - * @param {*} agent The agent instance. - * @param {*} shim The instance of the shim used to instrument the module. - * @param {string} moduleName The name of the required module. - * @param {string} metricPrefix Support metric prefix to prepend to the metrics. Will indicate onRequire or onResolved - * from NAMES.FEATURES.INSTRUMENTATION. - */ -function trackInstrumentationUsage(agent, shim, moduleName, metricPrefix) { - try { - const version = tryGetVersion(shim) - const instrumentationMetricName = `${metricPrefix}/${moduleName}` - - agent.metrics.getOrCreateMetric(instrumentationMetricName).incrementCallCount() - - if (version) { - const majorVersion = semver.major(version) - const versionMetricName = `${instrumentationMetricName}/Version/${majorVersion}` - - agent.metrics.getOrCreateMetric(versionMetricName).incrementCallCount() - } - } catch (error) { - logger.debug('Unable to track instrumentation usage for: ', moduleName, error) - } -} - -function tryGetVersion(shim) { - // Global module (i.e. domain) or finding root failed - if (shim._moduleRoot === '.') { - return - } - - const packageInfo = shim.require('./package.json') - if (!packageInfo) { - return - } - - return packageInfo.version -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/base-span-streamer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/base-span-streamer.js deleted file mode 100644 index b8ea56744..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/base-span-streamer.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'base-span-streamer' }) -const NAMES = require('../metrics/names').INFINITE_TRACING -const SPAN_DROP_MSG_INTERVAL_MS = 30000 -const SPAN_DROP_MSG = - 'Queue full, dropping spans. ' + - `Will not warn again for ${SPAN_DROP_MSG_INTERVAL_MS / 1000} seconds.` - -class BaseSpanStreamer { - constructor(licenseKey, connection, metrics, queueSize) { - this.stream = null - this.license_key = licenseKey - this.connection = connection - this.queue_size = queueSize - this.spans = [] - this._metrics = metrics - this._writable = false - - // 'connected' indicates a safely writeable stream. - // May still be mid-connect to gRPC server. - this.connection.on('connected', (stream) => { - logger.info('Span streamer connected') - this.stream = stream - this._writable = true - this.sendQueue() - }) - - this.connection.on('disconnected', () => { - logger.info('Span streamer disconnected') - this.stream = null - this._writable = false - }) - } - - addToQueue() { - throw new Error('addToQueue is not implemented') - } - - sendQueue() { - throw new Error('sendQueue is not implemented') - } - - /* Accepts a span and either writes it to the stream, queues it to be sent, - * or drops it depending on stream/queue state - */ - write(span) { - this._metrics.getOrCreateMetric(NAMES.SEEN).incrementCallCount() - - // If not writeable (because of backpressure) queue the span - if (!this._writable) { - if (this.spans.length < this.queue_size) { - this.addToQueue(span) - return - } - - // While this can be directionally calculated between seen/sent the - // queue makes that a bit more disconnected. This will be a bit more specific. - this._metrics.getOrCreateMetric(NAMES.DROPPED).incrementCallCount() - - // If the queue is full drop the span - logger.infoOncePer( - 'SPAN_DROP_MSG', // key for the OncePer - SPAN_DROP_MSG_INTERVAL_MS, - SPAN_DROP_MSG - ) - } - } - - /** - * Sends the data(spans or span) over the stream. Spans are only sent here if the stream is - * in a writable state. If the stream becomes unwritable after sending the - * span, a drain event handler is setup to continue writing when possible. - * - * @param {*} data spans or span - * @param {number} [spanLen=1] number of spans sent in a stream(defaults to 1) - */ - send(data, spanLen = 1) { - // false indicates the stream has reached the highWaterMark - // and future writes should be avoided until drained. written items, - // including the one that returned false, will still be buffered. - this._writable = this.stream.write(data) - this._metrics.getOrCreateMetric(NAMES.SENT).incrementCallCount(spanLen) - - if (!this._writable) { - const waitDrainStart = Date.now() - const onDrain = this.drain.bind(this, waitDrainStart) - this.stream.once('drain', onDrain) - } - } - - /** - * Drains the span queue that built up when the connection was - * back-pressured or disconnected. `waitDrainStart` is when the stream - * initially blocked, used to time how long the stream was blocked. If this - * is not defined, it is assumed this is being called after a reconnect, - * and the metric is not used. - * - * @param {number} waitDrainStart time that drain started - */ - drain(waitDrainStart) { - // Metric can be used to see how frequently completing drains as well as - // average time to drain from when we first notice. - const drainCompleted = Date.now() - const drainDurationMs = drainCompleted - waitDrainStart - this._metrics.getOrCreateMetric(NAMES.DRAIN_DURATION).recordValue(drainDurationMs / 1000) - - // Once the 'drain' event fires we can begin writing to the stream again - this._writable = true - - this.sendQueue() - } - - connect(agentRunId, requestHeadersMap) { - this.connection.setConnectionDetails(this.license_key, agentRunId, requestHeadersMap) - - this.connection.connectSpans(this.method) - } - - disconnect() { - this.connection.disconnect() - } - - createMetrics() { - this._metrics.getOrCreateMetric(NAMES.QUEUE_CAPACITY).recordValue(this.queue_size) - this._metrics.getOrCreateMetric(NAMES.QUEUE_SIZE).recordValue(this.spans.length) - } -} - -module.exports = BaseSpanStreamer diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/batch-span-streamer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/batch-span-streamer.js deleted file mode 100644 index ea3bbaa13..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/batch-span-streamer.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2023 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'batch-span-streamer' }) -const BaseSpanStreamer = require('./base-span-streamer') - -class BatchSpanStreamer extends BaseSpanStreamer { - constructor(licenseKey, connection, metrics, queueSize) { - super(licenseKey, connection, metrics, queueSize) - this.sendTimer = null - this.batchSize = 750 - this.connection.on('connected', () => { - logger.debug('Setting up batch interval') - this.sendTimer = setInterval(this.sendQueue.bind(this), 5000) - this.sendTimer.unref() - }) - - this.connection.on('disconnected', () => { - logger.debug('Clearing batch interval') - if (this.sendTimer) { - clearInterval(this.sendTimer) - } - }) - } - - addToQueue(span) { - this.spans.push(span.toStreamingFormat()) - } - - /* Accepts a span and either writes it to the stream, queues it to be sent, - * or drops it depending on stream/queue state - */ - write(span) { - super.write(span) - - if (!this._writable) { - return - } - - this.addToQueue(span) - - if (this.spans.length < this.queue_size) { - return - } - - this.sendQueue() - } - - /** - * Chunks the span queue into n per batch(currently at 750). - * The avg span is generally 1kb, picking an option slightly under to avoid - * being over 1MB uncompressed limit being imposed on the gRPC server. - * Since the processing happens asyc it'll be very hard to split further - * if a span batch is too big. We are being conservative here and other - * language agents transmit even smaller batches(100 per batch). - */ - sendQueue() { - if (!this.spans.length) { - logger.trace('Queue is empty, not sending spans.') - return - } - - for (let i = 0; i < this.spans.length; i += this.batchSize) { - const spans = this.spans.slice(i, i + this.batchSize) - logger.trace('Sending spans from queue: %s', spans.length) - this.send({ spans }, spans.length) - } - - this.spans = [] - - logger.trace('Finished sending spans from queue.') - } -} - -module.exports = BatchSpanStreamer diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/create-span-event-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/create-span-event-aggregator.js deleted file mode 100644 index a8b19bafa..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/create-span-event-aggregator.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger') -const SpanEventAggregator = require('./span-event-aggregator') -const StreamingSpanEventAggregator = require('./streaming-span-event-aggregator') -const NAMES = require('../metrics/names').INFINITE_TRACING - -function createSpanEventAggregator(config, collector, metrics) { - const traceObserver = config.infinite_tracing.trace_observer - - if (traceObserver.host) { - traceObserver.host = traceObserver.host.trim() - - if (typeof traceObserver.port !== 'string') { - traceObserver.port = String(traceObserver.port) - } - traceObserver.port = traceObserver.port.trim() - - try { - return createStreamingAggregator(config, collector, metrics) - } catch (err) { - logger.warn( - err, - 'Failed to create streaming span event aggregator for infinite tracing. ' + - 'Reverting to standard span event aggregator and disabling infinite tracing' - ) - config.infinite_tracing.trace_observer = { - host: '', - port: '' - } - return createStandardAggregator(config, collector, metrics) - } - } - - return createStandardAggregator(config, collector, metrics) -} - -function createStreamingAggregator(config, collector, metrics) { - logger.trace('Creating streaming span event aggregator for infinite tracing.') - const GrpcConnection = require('../grpc/connection') - - const connection = new GrpcConnection(config.infinite_tracing, metrics) - let spanStreamer - - if (config.infinite_tracing.batching) { - const BatchSpanStreamer = require('./batch-span-streamer') - spanStreamer = new BatchSpanStreamer( - config.license_key, - connection, - metrics, - config.infinite_tracing.span_events.queue_size - ) - metrics.getOrCreateMetric(`${NAMES.BATCHING}/enabled`).incrementCallCount() - } else { - const SpanStreamer = require('./span-streamer') - spanStreamer = new SpanStreamer( - config.license_key, - connection, - metrics, - config.infinite_tracing.span_events.queue_size - ) - metrics.getOrCreateMetric(`${NAMES.BATCHING}/disabled`).incrementCallCount() - } - - // this periodMs has no affect on gRPC calls - // the send method on StreamingSpanEventAggregator is a no-op - const opts = { - periodMs: 1000, - limit: 50000, - span_streamer: spanStreamer - } - - return new StreamingSpanEventAggregator(opts, collector, metrics) -} - -function createStandardAggregator(config, collector, metrics) { - logger.trace('Creating standard span event aggregator.') - - const opts = { - periodMs: config.event_harvest_config.report_period_ms, - limit: config.event_harvest_config.harvest_limits.span_event_data - } - - return new SpanEventAggregator(opts, collector, metrics) -} - -module.exports = createSpanEventAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/map-to-streaming-type.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/map-to-streaming-type.js deleted file mode 100644 index 58feff53e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/map-to-streaming-type.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const STRING_TYPE = 'string_value' -const BOOL_TYPE = 'bool_value' -const INT_TYPE = 'int_value' -const DOUBLE_TYPE = 'double_value' - -function mapToStreamingType(value) { - if (value === null || value === undefined) { - return - } - - const valueType = typeof value - - let protoTypeString = null - switch (valueType) { - case 'string': { - protoTypeString = STRING_TYPE - break - } - case 'boolean': { - protoTypeString = BOOL_TYPE - break - } - case 'number': { - const isInteger = Number.isInteger(value) - protoTypeString = isInteger ? INT_TYPE : DOUBLE_TYPE - break - } - default: { - protoTypeString = null - } - } - - if (protoTypeString) { - return { - [protoTypeString]: value - } - } -} - -module.exports = mapToStreamingType diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-context.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-context.js deleted file mode 100644 index b134482e6..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-context.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { MAXIMUM_CUSTOM_ATTRIBUTES } = require('../attributes') -const { PrioritizedAttributes, ATTRIBUTE_PRIORITY } = require('../prioritized-attributes') -const { DESTINATIONS } = require('../config/attribute-filter') - -// Scoping impacts memoization. We could decide to add a scope instead of including -// spans in segment scope in the future. -const ATTRIBUTE_SCOPE = 'segment' - -class SpanContext { - constructor(intrinsicAttributes, customAttributes) { - this.intrinsicAttributes = intrinsicAttributes || Object.create(null) - - this.customAttributes = - customAttributes || new PrioritizedAttributes(ATTRIBUTE_SCOPE, MAXIMUM_CUSTOM_ATTRIBUTES) - - this.ATTRIBUTE_PRIORITY = ATTRIBUTE_PRIORITY - - this.hasError = false - this.errorDetails = null - } - - addIntrinsicAttribute(key, value) { - this.intrinsicAttributes[key] = value - } - - addCustomAttribute(key, value, priority) { - this.customAttributes.addAttribute(DESTINATIONS.SPAN_EVENT, key, value, false, priority) - } - - /** - * Set error details to be potentially be used to create span - * attributes. Attributes will be created unless the transaction - * ends with an ignored error status code. - * - * Last error wins. - * - * @param details - */ - setError(details) { - this.hasError = true - - // Error details will be used to create attributes unless the transaction ends - // with an ignored status code. - this.errorDetails = details - } -} - -module.exports = SpanContext diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-event-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-event-aggregator.js deleted file mode 100644 index 0f016a723..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-event-aggregator.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'span_aggregator' }) -const EventAggregator = require('../aggregators/event-aggregator') -const SpanEvent = require('./span-event') -const NAMES = require('../metrics/names') - -const DEFAULT_SPAN_EVENT_LIMIT = 2000 -// Used only when server value missing -const SPAN_EVENT_FALLBACK_MAX_LIMIT = 10000 - -class SpanEventAggregator extends EventAggregator { - constructor(opts, collector, metrics) { - opts = opts || {} - opts.method = opts.method || 'span_event_data' - opts.metricNames = opts.metricNames || NAMES.SPAN_EVENTS - - super(opts, collector, metrics) - } - - _toPayloadSync() { - const events = this.events - - if (events.length === 0) { - logger.debug('No span events to send.') - return - } - - const metrics = { - reservoir_size: events.limit, - events_seen: events.seen - } - const eventData = events.toArray() - - return [this.runId, metrics, eventData] - } - - start() { - logger.debug('starting SpanEventAggregator') - return super.start() - } - - send() { - if (logger.traceEnabled()) { - logger.trace( - { - spansCollected: this.length, - spansSeen: this.seen - }, - 'Entity stats on span harvest' - ) - } - super.send() - } - - /** - * Attempts to add the given segment to the collection. - * - * @param {TraceSegment} segment - The segment to add. - * @param {string} [parentId=null] - The GUID of the parent span. - * @param isRoot - * @returns {boolean} True if the segment was added, or false if it was discarded. - */ - addSegment(segment, parentId, isRoot) { - // Check if the priority would be accepted before creating the event object. - const tx = segment.transaction - - if (tx.priority < this._items.getMinimumPriority()) { - ++this.events.seen - this._metrics.getOrCreateMetric(this._metricNames.SEEN).incrementCallCount() - - return false - } - const span = SpanEvent.fromSegment(segment, parentId || null, isRoot) - return this.add(span, tx.priority) - } - - /** - * Reconfigure the `SpanEventAggregator` based on values from server - * - * @param {Config} config - */ - reconfigure(config) { - super.reconfigure(config) - - const { periodMs, limit } = this._getValidSpanConfiguration(config) - - this.periodMs = periodMs - this.limit = limit - this._metrics.getOrCreateMetric(this._metricNames.LIMIT).recordValue(this.limit) - this._items.setLimit(this.limit) - } - - /** - * Retrieves report period and harvest limits defined in `span_event_harvest_config`. - * When no `span_event_harvest_config` has been received from the server, applies an - * agent-defined fallback maximum to protect against collecting and sending too many spans. - * - * @param {Config} config - */ - _getValidSpanConfiguration(config) { - const spanHarvestConfig = config.span_event_harvest_config - if (spanHarvestConfig) { - logger.trace('Using span_event_harvest_config values.') - - return { - periodMs: spanHarvestConfig.report_period_ms, - limit: spanHarvestConfig.harvest_limit - } - } - - const configuredLimit = config.span_events.max_samples_stored || DEFAULT_SPAN_EVENT_LIMIT - - return { - periodMs: this.defaultPeriod, - limit: _enforceMaxLimit(configuredLimit, SPAN_EVENT_FALLBACK_MAX_LIMIT) - } - } -} - -function _enforceMaxLimit(currentLimit, maxLimit) { - let spanLimit = currentLimit - if (spanLimit > maxLimit) { - spanLimit = maxLimit - - logger.debug('Using maximum allowed span event limit of %s', maxLimit) - } - - return spanLimit -} - -module.exports = SpanEventAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-event.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-event.js deleted file mode 100644 index 3f117cf40..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-event.js +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Config = require('../config') -const { truncate } = require('../util/byte-limit') - -const { DESTINATIONS } = require('../config/attribute-filter') - -const HTTP_LIBRARY = 'http' -const CLIENT_KIND = 'client' -const CATEGORIES = { - HTTP: 'http', - DATASTORE: 'datastore', - GENERIC: 'generic' -} - -const EXTERNAL_REGEX = /^(?:Truncated\/)?External\// -const DATASTORE_REGEX = /^(?:Truncated\/)?Datastore\// - -const EMPTY_USER_ATTRS = Object.freeze(Object.create(null)) - -/** - * All the intrinsic attributes for span events, regardless of kind. - */ -class SpanIntrinsics { - constructor() { - this.type = 'Span' - this.traceId = null - this.guid = null - this.parentId = null - this.transactionId = null - this.sampled = null - this.priority = null - this.name = null - this.category = CATEGORIES.GENERIC - this.component = null - this.timestamp = null - this.duration = null - this['nr.entryPoint'] = null - this['span.kind'] = null - this.trustedParentId = null - this.tracingVendors = null - } -} - -/** - * General span event class. - * - * Do not construct directly, instead use one of the static `from*` methods such - * as `SpanEvent.fromSegment`. - * - * @private - * @class - */ -class SpanEvent { - constructor(attributes, customAttributes) { - this.customAttributes = customAttributes - this.attributes = attributes - this.intrinsics = new SpanIntrinsics() - } - - static get CATEGORIES() { - return CATEGORIES - } - - static get DatastoreSpanEvent() { - return DatastoreSpanEvent - } - - static get HttpSpanEvent() { - return HttpSpanEvent - } - - /** - * Constructs a `SpanEvent` from the given segment. - * - * The constructed span event will contain extra data depending on the - * category of the segment. - * - * @param {TraceSegment} segment - The segment to turn into a span event. - * @param {?string} [parentId=null] - The ID of the segment's parent. - * @param isRoot - * @returns {SpanEvent} The constructed event. - */ - static fromSegment(segment, parentId = null, isRoot = false) { - const spanContext = segment.getSpanContext() - - // Since segments already hold span agent attributes and we want to leverage - // filtering, we add to the segment attributes prior to processing. - if (spanContext.hasError && !segment.transaction.hasIgnoredErrorStatusCode()) { - const details = spanContext.errorDetails - segment.addSpanAttribute('error.message', details.message) - segment.addSpanAttribute('error.class', details.type) - if (details.expected) { - segment.addSpanAttribute('error.expected', details.expected) - } - } - - const attributes = segment.attributes.get(DESTINATIONS.SPAN_EVENT) - - const customAttributes = spanContext.customAttributes.get(DESTINATIONS.SPAN_EVENT) - - let span = null - if (HttpSpanEvent.testSegment(segment)) { - span = new HttpSpanEvent(attributes, customAttributes) - } else if (DatastoreSpanEvent.testSegment(segment)) { - span = new DatastoreSpanEvent(attributes, customAttributes) - } else { - span = new SpanEvent(attributes, customAttributes) - } - - for (const [key, value] of Object.entries(spanContext.intrinsicAttributes)) { - span.intrinsics[key] = value - } - - const tx = segment.transaction - - span.intrinsics.traceId = tx.traceId - span.intrinsics.guid = segment.id - span.intrinsics.parentId = parentId - span.intrinsics.transactionId = tx.id - span.intrinsics.sampled = tx.sampled - span.intrinsics.priority = tx.priority - span.intrinsics.name = segment.name - - if (isRoot) { - span.intrinsics.trustedParentId = tx.traceContext.trustedParentId - if (tx.traceContext.tracingVendors) { - span.intrinsics.tracingVendors = tx.traceContext.tracingVendors - } - } - - // Only set this if it will be `true`. Must be `null` otherwise. - if (tx.baseSegment === segment) { - span.intrinsics['nr.entryPoint'] = true - } - - // Timestamp in milliseconds, duration in seconds. Yay consistency! - span.intrinsics.timestamp = segment.timer.start - span.intrinsics.duration = segment.timer.getDurationInMillis() / 1000 - - return span - } - - toJSON() { - return [ - _filterNulls(this.intrinsics), - this.customAttributes ? _filterNulls(this.customAttributes) : EMPTY_USER_ATTRS, - _filterNulls(this.attributes) - ] - } - - addCustomAttribute(key, value, truncateExempt = false) { - const { attributeFilter } = Config.getInstance() - const dest = attributeFilter.filterSegment(DESTINATIONS.SPAN_EVENT, key) - if (dest & DESTINATIONS.SPAN_EVENT) { - this.customAttributes[key] = truncateExempt ? value : _truncate(value) - } - } - - addAttribute(key, value, truncateExempt = false) { - const { attributeFilter } = Config.getInstance() - const dest = attributeFilter.filterSegment(DESTINATIONS.SPAN_EVENT, key) - if (dest & DESTINATIONS.SPAN_EVENT) { - this.attributes[key] = truncateExempt ? value : _truncate(value) - } - } -} - -/** - * Span event class for external requests. - * - * @private - * @class - */ -class HttpSpanEvent extends SpanEvent { - constructor(attributes, customAttributes) { - super(attributes, customAttributes) - - this.intrinsics.category = CATEGORIES.HTTP - this.intrinsics.component = attributes.library || HTTP_LIBRARY - this.intrinsics['span.kind'] = CLIENT_KIND - - if (attributes.library) { - attributes.library = null - } - - if (attributes.url) { - this.addAttribute('http.url', attributes.url) - attributes.url = null - } - - if (attributes.procedure) { - this.addAttribute('http.method', attributes.procedure) - attributes.procedure = null - } - } - - static testSegment(segment) { - return EXTERNAL_REGEX.test(segment.name) - } -} - -/** - * Span event class for datastore operations and queries. - * - * @private - * @class. - */ -class DatastoreSpanEvent extends SpanEvent { - constructor(attributes, customAttributes) { - super(attributes, customAttributes) - - this.intrinsics.category = CATEGORIES.DATASTORE - this.intrinsics['span.kind'] = CLIENT_KIND - - if (attributes.product) { - this.intrinsics.component = attributes.product - attributes.product = null - } - - if (attributes.collection) { - this.addAttribute('db.collection', attributes.collection) - attributes.collection = null - } - - if (attributes.sql || attributes.sql_obfuscated) { - let sql = null - if (attributes.sql_obfuscated) { - sql = _truncate(attributes.sql_obfuscated) - attributes.sql_obfuscated = null - } else if (attributes.sql) { - sql = _truncate(attributes.sql) - attributes.sql = null - } - - // Flag as exempt from normal attribute truncation - this.addAttribute('db.statement', sql, true) - } - - if (attributes.database_name) { - this.addAttribute('db.instance', attributes.database_name) - attributes.database_name = null - } - - if (attributes.host) { - this.addAttribute('peer.hostname', attributes.host) - - if (attributes.port_path_or_id) { - const address = `${attributes.host}:${attributes.port_path_or_id}` - this.addAttribute('peer.address', address) - attributes.port_path_or_id = null - } - attributes.host = null - } - } - - static testSegment(segment) { - return DATASTORE_REGEX.test(segment.name) - } -} - -function _truncate(val) { - let truncated = truncate(val, 1997) - if (truncated !== val) { - truncated += '...' - } - return truncated -} - -function _filterNulls(obj) { - const out = Object.create(null) - for (const key in obj) { - if (obj[key] != null) { - out[key] = obj[key] - } - } - return out -} - -module.exports = SpanEvent diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-streamer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-streamer.js deleted file mode 100644 index 69c5fa450..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/span-streamer.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2023 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'span-streamer' }) -const BaseSpanStreamer = require('./base-span-streamer') - -class SpanStreamer extends BaseSpanStreamer { - constructor(licenseKey, connection, metrics, queueSize) { - super(licenseKey, connection, metrics, queueSize) - } - - addToQueue(span) { - this.spans.push(span) - } - - /* Accepts a span and either writes it to the stream, queues it to be sent, - * or drops it depending on stream/queue state - */ - write(span) { - super.write(span) - - if (!this._writable) { - return - } - - const formattedSpan = span.toStreamingFormat() - - try { - this.send(formattedSpan) - } catch (err) { - logger.error(err) - // TODO: something has gone horribly wrong. - // We may want to log and turn off this aggregator - // to prevent sending further spans. Maybe even "disable" their creation? - // or is there a situation where we can recover? - } - } - - sendQueue() { - if (!this.spans.length) { - logger.trace('Queue is empty, not sending spans.') - return - } - - logger.trace('Sending spans from queue: %s.', this.spans.length) - - // Continue sending the spans that were in the queue. _writable is checked - // so that if a send fails while clearing the queue, this drain handler can - // finish, and the drain handler setup on the failed send will then attempt - // to clear the queue - while (this.spans.length > 0 && this._writable) { - const nextObject = this.spans.shift() - this.send(nextObject.toStreamingFormat()) - } - - logger.trace('Finished sending spans from queue. Items left in queue: %s', this.spans.length) - } -} - -module.exports = SpanStreamer diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-attributes.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-attributes.js deleted file mode 100644 index e791d1b21..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-attributes.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const mapToStreamingType = require('./map-to-streaming-type') - -/** - * Specialized attribute collection class for use with infinite streaming. - * Currently designed to be sent over grpc via the v1.proto definition. - * - * @private - * @class - */ -class StreamingSpanAttributes { - constructor(attributes) { - if (attributes) { - this.addAttributes(attributes) - } - } - - /** - * Add a key/value pair to the attribute collection. - * null/undefined values will be dropped. - * - * Does not apply filtering/truncation. - * - * @param {string} key Name of the attribute to be stored. - * @param {string|boolean|number} value Value of the attribute to be stored. - */ - addAttribute(key, value) { - const streamingValue = mapToStreamingType(value) - if (streamingValue) { - this[key] = streamingValue - return true - } - - return false - } - - /** - * Adds all attributes in an object to the attribute collection. - * null/undefined values will be dropped. - * - * Does not apply filtering/truncation. - * - * @param {object} [attributes] - * @param {string} [attributes.key] Name of the attribute to be stored. - * @param {string|boolean|number} [attributes.value] Value of the attribute to be stored. - */ - addAttributes(attributes) { - if (!attributes) { - return - } - - for (const [key, value] of Object.entries(attributes)) { - this.addAttribute(key, value) - } - } -} - -module.exports = StreamingSpanAttributes diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-event-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-event-aggregator.js deleted file mode 100644 index 2bfc03f30..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-event-aggregator.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Aggregator = require('../aggregators/base-aggregator') -const StreamingSpanEvent = require('./streaming-span-event') -const logger = require('../logger').child({ component: 'streaming-span-event-aggregator' }) - -const SEND_WARNING = - 'send() is not currently supported on streaming span event aggregator. ' + - 'This warning will not appear again this agent run.' - -// TODO: this doesn't "aggregate". Perhaps we need a different terminology -// for the base-class and then this implementation can avoid the misleading language. -class StreamingSpanEventAggregator extends Aggregator { - constructor(opts, collector, metrics) { - opts = opts || {} - opts.periodMs = opts.periodMs ? opts.periodMs : 1000 - opts.limit = opts.limit ? opts.limit : 10000 - opts.method = opts.method || 'span_event_data' - - super(opts, collector) - - this.stream = opts.span_streamer - this.metrics = metrics - this.started = false - this.isStream = true - } - - start() { - if (this.started) { - return - } - - logger.trace('StreamingSpanEventAggregator starting up') - this.stream.connect(this.runId, this.requestHeadersMap) - this.started = true - - this.emit('started') - } - - stop() { - if (!this.started) { - return - } - - logger.trace('StreamingSpanEventAggregator stopping') - this.stream.disconnect() - this.started = false - - this.emit('stopped') - } - - send() { - if (this.started) { - logger.warnOnce('SEND_WARNING', SEND_WARNING) - } - - this.emit(`finished ${this.method} data send.`) - } - - /** - * Not a payload based aggregator - * - * This is here to implement the implicit interface - */ - _toPayloadSync() { - return - } - - /** - * Attempts to add the given segment to the collection. - * - * @param {TraceSegment} segment - The segment to add. - * @param {string} [parentId=null] - The GUID of the parent span. - * @param isRoot - * @returns {bool} True if the segment was added, or false if it was discarded. - */ - addSegment(segment, parentId, isRoot) { - if (!this.started) { - logger.trace('Aggregator has not yet started, dropping span (%s).', segment.name) - return - } - - const span = StreamingSpanEvent.fromSegment(segment, parentId, isRoot) - this.stream.write(span) - } - - reconfigure(config) { - super.reconfigure(config) - - this.requestHeadersMap = config.request_headers_map - } - - createMetrics() { - this.stream.createMetrics() - } -} - -module.exports = StreamingSpanEventAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-event.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-event.js deleted file mode 100644 index 83efb461f..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/spans/streaming-span-event.js +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const StreamingSpanAttributes = require('./streaming-span-attributes') -const { truncate } = require('../util/byte-limit') -const Config = require('../config') - -const { DESTINATIONS } = require('../config/attribute-filter') - -const HTTP_LIBRARY = 'http' -const CLIENT_KIND = 'client' -const CATEGORIES = { - HTTP: 'http', - DATASTORE: 'datastore', - GENERIC: 'generic' -} - -const EXTERNAL_REGEX = /^(?:Truncated\/)?External\// -const DATASTORE_REGEX = /^(?:Truncated\/)?Datastore\// - -/** - * Specialized span event class for use with infinite streaming. - * Currently designed to be sent over grpc via the v1.proto definition. - * - * @private - * @class - */ -class StreamingSpanEvent { - /** - * @param {*} traceId TraceId for the Span. - * @param {object} agentAttributes Initial set of agent attributes. - * Must be pre-filtered and truncated. - * @param {object} customAttributes Initial set of custom attributes. - * Must be pre-filtered and truncated. - */ - constructor(traceId, agentAttributes, customAttributes) { - this._traceId = traceId - - this._intrinsicAttributes = new StreamingSpanAttributes() - this._intrinsicAttributes.addAttribute('traceId', traceId) - this._intrinsicAttributes.addAttribute('type', 'Span') - this._intrinsicAttributes.addAttribute('category', CATEGORIES.GENERIC) - - this._customAttributes = new StreamingSpanAttributes(customAttributes) - this._agentAttributes = new StreamingSpanAttributes(agentAttributes) - } - - /** - * Add a key/value pair to the Span's instrinisics collection. - * - * @param {string} key Name of the attribute to be stored. - * @param {string|boolean|number} value Value of the attribute to be stored. - */ - addIntrinsicAttribute(key, value) { - this._intrinsicAttributes.addAttribute(key, value) - } - - /** - * Add a key/value pair to the Span's custom/user attributes collection. - * - * @param {string} key Name of the attribute to be stored. - * @param {string|boolean|number} value Value of the attribute to be stored. - * @param {boolean} [truncateExempt=false] Set to true if attribute should not be truncated. - */ - addCustomAttribute(key, value, truncateExempt = false) { - const shouldKeep = this._checkFilter(key) - if (shouldKeep) { - const processedValue = truncateExempt ? value : _truncate(value) - this._customAttributes.addAttribute(key, processedValue) - } - } - - /** - * Add a key/value pair to the Span's agent attributes collection. - * - * @param {string} key Name of the attribute to be stored. - * @param {string|boolean|number} value Value of the attribute to be stored. - * @param {boolean} [truncateExempt=false] Set to true if attribute should not be truncated. - */ - addAgentAttribute(key, value, truncateExempt = false) { - const shouldKeep = this._checkFilter(key) - if (shouldKeep) { - const processedValue = truncateExempt ? value : _truncate(value) - this._agentAttributes.addAttribute(key, processedValue) - } - } - - _checkFilter(key) { - const { attributeFilter } = Config.getInstance() - const dest = attributeFilter.filterSegment(DESTINATIONS.SPAN_EVENT, key) - return dest & DESTINATIONS.SPAN_EVENT - } - - toStreamingFormat() { - // Attributes are pre-formatted. - return { - trace_id: this._traceId, - intrinsics: this._intrinsicAttributes, - user_attributes: this._customAttributes, - agent_attributes: this._agentAttributes - } - } - - static fromSegment(segment, parentId = null, isRoot = false) { - const spanContext = segment.getSpanContext() - - // Since segments already hold span agent attributes and we want to leverage - // filtering, we add to the segment attributes prior to processing. - if (spanContext.hasError && !segment.transaction.hasIgnoredErrorStatusCode()) { - const details = spanContext.errorDetails - segment.addSpanAttribute('error.message', details.message) - segment.addSpanAttribute('error.class', details.type) - if (details.expected) { - segment.addSpanAttribute('error.expected', details.expected) - } - } - - const agentAttributes = segment.attributes.get(DESTINATIONS.SPAN_EVENT) - - const customAttributes = spanContext.customAttributes.get(DESTINATIONS.SPAN_EVENT) - - const transaction = segment.transaction - const traceId = transaction.traceId - - let span = null - if (StreamingHttpSpanEvent.isHttpSegment(segment)) { - span = new StreamingHttpSpanEvent(traceId, agentAttributes, customAttributes) - } else if (StreamingDatastoreSpanEvent.isDatastoreSegment(segment)) { - span = new StreamingDatastoreSpanEvent(traceId, agentAttributes, customAttributes) - } else { - span = new StreamingSpanEvent(traceId, agentAttributes, customAttributes) - } - - for (const [key, value] of Object.entries(spanContext.intrinsicAttributes)) { - span.addIntrinsicAttribute(key, value) - } - - span.addIntrinsicAttribute('guid', segment.id) - span.addIntrinsicAttribute('parentId', parentId) - span.addIntrinsicAttribute('transactionId', transaction.id) - span.addIntrinsicAttribute('sampled', transaction.sampled) - span.addIntrinsicAttribute('priority', transaction.priority) - span.addIntrinsicAttribute('name', segment.name) - - if (isRoot) { - span.addIntrinsicAttribute('trustedParentId', transaction.traceContext.trustedParentId) - if (transaction.traceContext.tracingVendors) { - span.addIntrinsicAttribute('tracingVendors', transaction.traceContext.tracingVendors) - } - } - - // Only set this if it will be `true`. Must be `null` otherwise. - if (transaction.baseSegment === segment) { - span.addIntrinsicAttribute('nr.entryPoint', true) - } - - // Timestamp in milliseconds, duration in seconds. Yay consistency! - span.addIntrinsicAttribute('timestamp', segment.timer.start) - span.addIntrinsicAttribute('duration', segment.timer.getDurationInMillis() / 1000) - - return span - } -} - -/** - * Specialized span event class for external requests for use with infinite streaming. - * Currently designed to be sent over grpc via the v1.proto definition. - * - * @private - * @class - */ -class StreamingHttpSpanEvent extends StreamingSpanEvent { - /** - * @param {*} traceId TraceId for the Span. - * @param {object} agentAttributes Initial set of agent attributes. - * Must be pre-filtered and truncated. - * @param {object} customAttributes Initial set of custom attributes. - * Must be pre-filtered and truncated. - */ - constructor(traceId, agentAttributes, customAttributes) { - super(traceId, agentAttributes, customAttributes) - - this.addIntrinsicAttribute('category', CATEGORIES.HTTP) - this.addIntrinsicAttribute('component', agentAttributes.library || HTTP_LIBRARY) - this.addIntrinsicAttribute('span.kind', CLIENT_KIND) - - if (agentAttributes.library) { - agentAttributes.library = null - } - - if (agentAttributes.url) { - this.addAgentAttribute('http.url', agentAttributes.url) - agentAttributes.url = null - } - - if (agentAttributes.procedure) { - this.addAgentAttribute('http.method', agentAttributes.procedure) - agentAttributes.procedure = null - } - } - - static isHttpSegment(segment) { - return EXTERNAL_REGEX.test(segment.name) - } -} - -/** - * Specialized span event class for datastore operations and queries for use with - * infinite streaming. - * Currently designed to be sent over grpc via the v1.proto definition. - * - * @private - * @class. - */ -class StreamingDatastoreSpanEvent extends StreamingSpanEvent { - /** - * @param {*} traceId TraceId for the Span. - * @param {object} agentAttributes Initial set of agent attributes. - * Must be pre-filtered and truncated. - * @param {object} customAttributes Initial set of custom attributes. - * Must be pre-filtered and truncated. - */ - constructor(traceId, agentAttributes, customAttributes) { - super(traceId, agentAttributes, customAttributes) - - this.addIntrinsicAttribute('category', CATEGORIES.DATASTORE) - this.addIntrinsicAttribute('span.kind', CLIENT_KIND) - - if (agentAttributes.product) { - this.addIntrinsicAttribute('component', agentAttributes.product) - agentAttributes.product = null - } - - if (agentAttributes.collection) { - this.addAgentAttribute('db.collection', agentAttributes.collection) - agentAttributes.collection = null - } - - if (agentAttributes.sql || agentAttributes.sql_obfuscated) { - let sql = null - if (agentAttributes.sql_obfuscated) { - sql = _truncate(agentAttributes.sql_obfuscated) - agentAttributes.sql_obfuscated = null - } else if (agentAttributes.sql) { - sql = _truncate(agentAttributes.sql) - agentAttributes.sql = null - } - - // Flag as exempt from normal attribute truncation - this.addAgentAttribute('db.statement', sql, true) - } - - if (agentAttributes.database_name) { - this.addAgentAttribute('db.instance', agentAttributes.database_name) - agentAttributes.database_name = null - } - - if (agentAttributes.host) { - this.addAgentAttribute('peer.hostname', agentAttributes.host) - - if (agentAttributes.port_path_or_id) { - const address = `${agentAttributes.host}:${agentAttributes.port_path_or_id}` - this.addAgentAttribute('peer.address', address) - agentAttributes.port_path_or_id = null - } - - agentAttributes.host = null - } - } - - static isDatastoreSegment(segment) { - return DATASTORE_REGEX.test(segment.name) - } -} - -function _truncate(val) { - let truncated = truncate(val, 1997) - if (truncated !== val) { - truncated += '...' - } - return truncated -} - -module.exports = StreamingSpanEvent diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/stats/apdex.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/stats/apdex.js deleted file mode 100644 index ca9b808d5..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/stats/apdex.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* - * - * CONSTANTS - * - */ -const FROM_MILLIS = 1e-3 - -function ApdexStats(apdexT) { - if (!apdexT && apdexT !== 0) { - throw new Error('Apdex summary must be created with apdexT.') - } - this.apdexT = apdexT - - this.satisfying = 0 - this.tolerating = 0 - this.frustrating = 0 -} - -ApdexStats.prototype.recordValue = function recordValue(time, overrideApdex) { - const apdexT = overrideApdex || this.apdexT - if (time <= apdexT) { - ++this.satisfying - } else if (time <= 4 * apdexT) { - ++this.tolerating - } else { - ++this.frustrating - } -} - -ApdexStats.prototype.recordValueInMillis = function recordValueInMillis( - timeInMillis, - overrideApdex -) { - this.recordValue(timeInMillis * FROM_MILLIS, overrideApdex * FROM_MILLIS) -} - -/** - * Used by the error handler to indicate that a user was frustrated by a page - * error. - */ -ApdexStats.prototype.incrementFrustrating = function incrementFrustrating() { - ++this.frustrating -} - -/** - * When merging apdex stastics, the apdex tolerating value isn't brought along - * for the ride. - * - * @param {ApdexStats} other The existing apdex stats being merged in. - */ -ApdexStats.prototype.merge = function merge(other) { - this.satisfying += other.satisfying - this.tolerating += other.tolerating - this.frustrating += other.frustrating -} - -/** - * This feels dirty: ApdexStats override the ordinary statistics serialization - * format by putting satisfying, tolerating and frustrating values in the - * first three fields in the array and setting the next two to the apdex (used - * by calculations inside RPM), followed by 0. - * - * @returns {Array} A six-value array where only the first three values are - * significant: satisfying, tolerating, and frustrating - * load times, respectively. - */ -ApdexStats.prototype.toJSON = function toJSON() { - return [this.satisfying, this.tolerating, this.frustrating, this.apdexT, this.apdexT, 0] -} - -module.exports = ApdexStats diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/stats/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/stats/index.js deleted file mode 100644 index 7fe269267..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/stats/index.js +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/* - * - * CONSTANTS - * - */ -const BYTES_PER_MB = 1024 * 1024 -const FROM_MILLIS = 1e-3 - -/** - * Simple container for tracking running statistics for a metric. - */ -function Stats() { - this.total = 0 - this.totalExclusive = 0 - this.min = 0 - this.max = 0 - this.sumOfSquares = 0 - this.callCount = 0 -} - -/** - * Update the summary statistics with a new value. - * - * @param {number} totalTime Time, in seconds, of the measurement. - * @param {number} exclusiveTime Time that was taken by only the - * current measurement (optional). - */ -Stats.prototype.recordValue = function recordValue(totalTime, exclusiveTime) { - // even if a caller messes up, don't break everything else - if (totalTime !== 0 && !totalTime) { - totalTime = 0 - } - if (exclusiveTime !== 0 && !exclusiveTime) { - exclusiveTime = totalTime - } - - if (this.callCount > 0) { - this.min = Math.min(totalTime, this.min) - } else { - this.min = totalTime - } - this.max = Math.max(totalTime, this.max) - - this.sumOfSquares += totalTime * totalTime - ++this.callCount - this.total += totalTime - this.totalExclusive += exclusiveTime -} - -/** - * Until the collector accepts statistics in milliseconds, this code is going - * to have some hinky floating-point values to deal with. - */ -Stats.prototype.recordValueInMillis = recordValueInMillis -function recordValueInMillis(totalTime, exclusiveTime) { - this.recordValue(totalTime * FROM_MILLIS, exclusiveTime >= 0 ? exclusiveTime * FROM_MILLIS : null) -} - -Stats.prototype.recordValueInBytes = function recordValueInBytes(bytes, exclusiveBytes, exact) { - exclusiveBytes = typeof exclusiveBytes === 'number' ? exclusiveBytes : bytes - if (!exact) { - // normally values are recorded in megabytes and so must be converted from bytes. - // set exact=true to set the byte value directly. - bytes = bytes / BYTES_PER_MB - exclusiveBytes = exclusiveBytes / BYTES_PER_MB - } - this.recordValue(bytes, exclusiveBytes) -} - -Stats.prototype.incrementCallCount = function incrementCallCount(count) { - if (typeof count === 'undefined') { - count = 1 - } - this.callCount += count -} - -/** - * Fold another summary's statistics into this one. - * - * @param other - */ -Stats.prototype.merge = function merge(other) { - if (other.count && !other.callCount) { - other.callCount = other.count - } - - if (other.totalExclusive == null) { - other.totalExclusive = other.total - } - - if (other.callCount > 0) { - if (this.callCount > 0) { - this.min = Math.min(this.min, other.min) - } else { - this.min = other.min - } - } - this.max = Math.max(this.max, other.max) - - this.total += other.total - this.totalExclusive += other.totalExclusive - this.sumOfSquares += other.sumOfSquares - this.callCount += other.callCount -} - -/** - * The serializer relies upon this representation, so don't change the - * values, cardinality, or ordering of this array without ensuring that - * it matches the version of the "protocol" being sent to the collector. - * - * @returns {Array} Number of calls, - * total time in seconds, - * time for this metric alone in seconds, - * shortest individual time in seconds, - * longest individual time in seconds, - * running sum of squares. - */ -Stats.prototype.toJSON = function toJSON() { - return [this.callCount, this.total, this.totalExclusive, this.min, this.max, this.sumOfSquares] -} - -module.exports = Stats diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/symbols.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/symbols.js deleted file mode 100644 index e9ba955e7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/symbols.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = { - clm: Symbol('codeLevelMetrics'), - context: Symbol('context'), - databaseName: Symbol('databaseName'), - disableDT: Symbol('Disable distributed tracing'), // description for backwards compatibility - executorContext: Symbol('executorContext'), - instrumented: Symbol('instrumented'), - instrumentedErrored: Symbol('instrumentedErrored'), - name: Symbol('name'), - onceExecuted: Symbol('onceExecuted'), - offTheRecord: Symbol('offTheRecord'), - original: Symbol('original'), - wrapped: Symbol('shimWrapped'), - prismaConnection: Symbol('prismaConnection'), - prismaModelCall: Symbol('modelCall'), - segment: Symbol('segment'), - shim: Symbol('shim'), - storeDatabase: Symbol('storeDatabase'), - transaction: Symbol('transaction'), - transactionInfo: Symbol('transactionInfo'), - unwrap: Symbol('unwrap'), - // mysql instrumentation symbols - unwrapConnection: Symbol('unwrapConnection'), - unwrapPool: Symbol('unwrapPool'), - clusterOf: Symbol('clusterOf'), - createPoolCluster: Symbol('createPoolCluster'), - wrappedPoolConnection: Symbol('wrappedPoolConnection') -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/system-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/system-info.js deleted file mode 100644 index eb02b9d1a..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/system-info.js +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const util = require('util') -const execFile = util.promisify(require('child_process').execFile) -const readProc = util.promisify(require('./utilization/common').readProc) -const getBootId = util.promisify(require('./utilization/docker-info').getBootId) -const getVendors = util.promisify(require('./utilization').getVendors) -const logger = require('./logger.js').child({ component: 'system-info' }) -const os = require('os') -const parseCpuInfo = require('./parse-proc-cpuinfo') -const parseMemInfo = require('./parse-proc-meminfo') -const Agent = require('./agent') -const platform = os.platform() - -module.exports = fetchSystemInfo - -/** - * Helper method for determining if given value can be an integer - * - * @param {*} value the value to check - * @returns {boolean} whether or not the value can be coerced to an integer - */ -function isInteger(value) { - return value === parseInt(value, 10) -} - -/** - * Helper method for updating the utilization info with processor information from the config - * - * @param {*} processorConfig agent.config.utilization.logical_processors - * @param {object} utilizationConfig Utilization configuration object defined in #fetchSystemInfo - */ -function maybeAddProcessorUtilization(processorConfig, utilizationConfig) { - const parsedConfigProcessors = parseFloat(processorConfig, 10) - if (!isNaN(parsedConfigProcessors) && isInteger(parsedConfigProcessors)) { - utilizationConfig.logical_processors = parsedConfigProcessors - } else { - logger.info( - '%s supplied in config for utilization.logical_processors, expected a number', - processorConfig - ) - } -} - -/** - * Helper method for updating the utilization info with RAM information from the config - * - * @param {*} ramConfig agent.config.utilization.total_ram_mib - * @param {object} utilizationConfig Utilization configuration object defined in #fetchSystemInfo - */ -function maybeAddRamUtilization(ramConfig, utilizationConfig) { - const parsedConfigRam = parseFloat(ramConfig, 10) - if (!isNaN(parsedConfigRam) && isInteger(parsedConfigRam)) { - utilizationConfig.total_ram_mib = parsedConfigRam - } else { - logger.info('%s supplied in config for utilization.total_ram_mib, expected a number', ramConfig) - } -} - -/** - * Helper method for updating the utilization info with hostname information from the config - * - * @param {*} configHostname agent.config.utilization.billing_hostname - * @param {object} utilizationConfig Utilization configuration object defined in #fetchSystemInfo - */ -function maybeAddHostUtilization(configHostname, utilizationConfig) { - if (typeof configHostname === 'string') { - utilizationConfig.hostname = configHostname - } else { - logger.info('%s supplied in config for utilization.Hostname, expected a string', configHostname) - } -} - -/** - * Helper method for updating the system info with architecture dependent processor info - * - * @param {*} processorStats output of #getProcessorStats - * @param {object} systemInfo System Information object defined in #fetchSystemInfo - */ -function maybeSetProcessorStats(processorStats, systemInfo) { - if (processorStats) { - systemInfo.packages = processorStats.packages - systemInfo.logicalProcessors = processorStats.logical - systemInfo.cores = processorStats.cores - } -} - -/** - * Helper method for updating the system info with architecture dependent RAM info - * - * @param {*} memoryStats output of #getMemoryStats - * @param {object} systemInfo System Information object defined in #fetchSystemInfo - */ -function maybeSetMemoryStats(memoryStats, systemInfo) { - if (memoryStats) { - systemInfo.memory = memoryStats - } -} - -/** - * Helper method for updating the system info with architecture dependent Kernel info - * - * @param {*} kernelStats output of #getKernelVersion - * @param {object} systemInfo System Information object defined in #fetchSystemInfo - */ -function maybeSetKernelStats(kernelStats, systemInfo) { - if (kernelStats) { - systemInfo.kernelVersion = kernelStats - } -} - -/** - * Helper method for updating the system info with vendor info - * - * @param {*} vendorStats output of #utilization.getVendors - * @param {object} systemInfo System Information object defined in #fetchSystemInfo - */ -function maybeSetVendorStats(vendorStats, systemInfo) { - if (vendorStats) { - systemInfo.vendors = vendorStats - } -} - -/** - * Helper method for updating the system info with the Docker boot id - * - * @param {*} bootId output of #utilization/docker-info.getBootId - * @param {object} systemInfo System Information object defined in #fetchSystemInfo - */ -function maybeSetBootId(bootId, systemInfo) { - if (bootId) { - systemInfo.bootId = bootId - } -} - -/** - * Main method for retrieving system level statistics, used for fact gathering on Agent startup - * - * @param {Agent} agent Instantiation of Node.js agent - * @param {Function} callback Callback to fire after we've gathered all the necessary stats - */ -async function fetchSystemInfo(agent, callback) { - const utilizationConfig = Object.create(null) - const systemInfo = { - processorArch: os.arch() - } - - const processorConfig = agent.config.utilization?.logical_processors - if (processorConfig) { - maybeAddProcessorUtilization(processorConfig, utilizationConfig) - } - - const ramConfig = agent.config.utilization?.total_ram_mib - if (ramConfig) { - maybeAddRamUtilization(ramConfig, utilizationConfig) - } - - const configHostname = agent.config.utilization?.billing_hostname - if (configHostname) { - maybeAddHostUtilization(configHostname, utilizationConfig) - } - - if (Object.keys(utilizationConfig).length > 0) { - systemInfo.config = utilizationConfig - } - - const processorStats = await module.exports._getProcessorStats() - const memoryStats = await module.exports._getMemoryStats() - const kernelStats = await getKernelVersion() - const vendorStats = await getVendors(agent) - const bootId = await getBootId(agent) - - maybeSetProcessorStats(processorStats, systemInfo) - maybeSetMemoryStats(memoryStats, systemInfo) - maybeSetKernelStats(kernelStats, systemInfo) - maybeSetVendorStats(vendorStats, systemInfo) - maybeSetBootId(bootId, systemInfo) - - callback(null, systemInfo) -} - -/** - * Helper method for getting detailed, architecture specific processor information from the system - * Exported for testing purposes - * - * @returns {*} null if unknown platform, otherwise the processor stats - */ -module.exports._getProcessorStats = async function getProcessorStats() { - const processorStats = { - logical: null, - cores: null, - packages: null - } - - if (platform.match(/darwin/i)) { - const packages = await getSysctlValue(['hw.packages']) - const cores = await getSysctlValue(['hw.physicalcpu_max', 'hw.physicalcpu']) - const logical = await getSysctlValue(['hw.logicalcpu_max', 'hw.logicalcpu', 'hw.ncpu']) - - processorStats.logical = isInteger(logical) ? parseFloat(logical, 10) : null - processorStats.cores = isInteger(cores) ? parseFloat(cores, 10) : null - processorStats.packages = isInteger(packages) ? parseFloat(packages, 10) : null - - return processorStats - } else if (platform.match(/bsd/i)) { - const logical = await getSysctlValue(['hw.ncpu']) - - processorStats.logical = logical - - return processorStats - } else if (platform.match(/linux/i)) { - const data = await getProcInfo('/proc/cpuinfo') - - return parseCpuInfo(data) - } - - logger.debug('Unknown platform: %s; could not retrieve processor info', platform) - return processorStats -} - -/** - * Helper method for getting detailed, architecture specific RAM information from the system - * Exported for testing purposes - * - * @returns {*} null if unknown platform, otherwise the RAM amount - */ -module.exports._getMemoryStats = async function getMemoryStats() { - if (platform.match(/darwin/i)) { - const memory = await getSysctlValue(['hw.memsize']) - return parseInt(memory, 10) / (1024 * 1024) - } else if (platform.match(/bsd/i)) { - const memory = await getSysctlValue(['hw.realmem']) - return parseInt(memory, 10) / (1024 * 1024) - } else if (platform.match(/linux/i)) { - const data = await getProcInfo('/proc/meminfo') - return parseMemInfo(data) - } - - logger.debug('Unknown platform: %s; could not retrieve memory info', platform) - return null -} - -/** - * Helper method for retrieving Kernel version information for different platforms - * - * @returns {*} null if unknown platform, otherwise string representation of kernel version - */ -async function getKernelVersion() { - if (platform.match(/darwin/i) || platform.match(/bsd/i)) { - return await getSysctlValue(['kern.version']) - } else if (platform.match(/linux/i)) { - return await getProcInfo('/proc/version') - } - - logger.debug('Unknown platform: %s; could not read kernel version', platform) - return null -} - -/** - * Helper method for getting sysctl information given a list of potential values to look up - * Returns the first successful sysctl's output - * - * @param {Array.} names List of sysctl values to look up - * @returns {*} null if we failed to lookup any info (error or not), or the first successful sysctl's output - */ -async function getSysctlValue(names = []) { - let returnValue = null - - for (const name of names) { - // returnValue being set means we already found what we were looking for, early exit for performance - if (returnValue) { - break - } - - try { - const { stderr, stdout } = await execFile('sysctl', ['-n', name]) - - if (!stderr) { - returnValue = stdout - } - } catch (err) { - logger.debug('Error when trying to run: sysctl -n %s: %s', name, err.message) - } - } - - if (returnValue === null) { - logger.debug('No sysctl info found for names: %j', names) - } - - return returnValue -} - -/** - * Helper method for getting /proc/* file information in Linux environments - * - * @param {string} procPath - the proc file to read - * @returns {*} null if the lookup fails, otherwise the proc file information - */ -async function getProcInfo(procPath) { - try { - return await readProc(procPath) - } catch (err) { - // swallow the error if reading fails, logging handled in readProc() - return null - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/timer.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/timer.js deleted file mode 100644 index 47eaf48db..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/timer.js +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - - * Explicit enumeration of the states a transaction can be in: - * - * PENDING upon instantiation (implicitly, no start time set) - * RUNNING while timer is running (implicitly, start time is set but no stop - * time is set). - * STOPPED timer has been completed (implicitly, start time and stop time - * are set, but the timer has not yet been harvested). - * DEAD timer has been harvested and can only have its duration read. - */ -const PENDING = 1 -const RUNNING = 2 -const STOPPED = 3 - -function hrToMillis(hr) { - // process.hrTime gives you [second, nanosecond] duration pairs - return hr[0] * 1e3 + hr[1] / 1e6 -} - -/** - * A mildly tricky timer that tracks its own state and allows its duration - * to be set manually. - */ -function Timer() { - this.state = PENDING - this.touched = false - this.hrDuration = null - this.hrstart = null - this.start = null - this.durationInMillis = null -} - -/** - * Start measuring time elapsed. - * - * Uses process.hrtime if available, Date.now() otherwise. - */ -Timer.prototype.begin = function begin() { - if (this.state > PENDING) { - return - } - - this.start = Date.now() - this.hrstart = process.hrtime() - this.state = RUNNING -} - -/** - * End measurement. - */ -Timer.prototype.end = function end() { - if (this.state > RUNNING) { - return - } - if (this.state === PENDING) { - this.begin() - } - this.hrDuration = process.hrtime(this.hrstart) - this.touched = true - this.state = STOPPED -} - -/** - * Update the duration of the timer without ending it.. - */ -Timer.prototype.touch = function touch() { - this.touched = true - if (this.state > RUNNING) { - return - } - if (this.state === PENDING) { - this.begin() - } - - this.hrDuration = process.hrtime(this.hrstart) -} - -/** - * End the segment if it is still running, if touched use that time instead of - * "now". Returns a boolean indicating whether the end time changed. - */ -Timer.prototype.softEnd = function softEnd() { - if (this.state > RUNNING) { - return false - } - if (this.state === PENDING) { - this.begin() - } - - this.state = STOPPED - - if (this.touched) { - return false - } - this.hrDuration = process.hrtime(this.hrstart) - this.touched = true - return true -} - -/** - * @returns {bool} Is this timer currently running? - */ -Timer.prototype.isRunning = function isRunning() { - return this.state === RUNNING -} - -/** - * @returns {bool} Is this timer still alive? - */ -Timer.prototype.isActive = function isActive() { - return this.state < STOPPED -} - -/** - * @returns {bool} Has the timer been touched or ended? - */ -Timer.prototype.hasEnd = function hasEnd() { - return !!this.hrDuration -} - -/* - * Sets duration and stops the timer, since the passed-in duration will take precedence - * over the measured duration. - * @param {number} duration The duration the timer should report. - */ -Timer.prototype.overwriteDurationInMillis = overwriteDurationInMillis -function overwriteDurationInMillis(duration) { - this.touched = true - this.durationInMillis = duration - this.state = STOPPED -} - -/** - * When testing, it's convenient to be able to control time. Stops the timer - * as a byproduct. - * - * @param {number} duration How long the timer ran. - * @param {number} start When the timer started running (optional). - */ -Timer.prototype.setDurationInMillis = function setDurationInMillis(duration, start) { - if (this.state > RUNNING) { - return - } - - if (this.state === PENDING && !start && start !== 0) { - this.begin() - } - - this.state = STOPPED - this.durationInMillis = duration - - // this assignment is incorrect, process.hrtime doesn't time from epoch, which - // is the assumption being made here. since hrstart isn't used - // anywhere except to calculate duration, and we are setting duration - // this is fine. - this.hrstart = [Math.floor(start / 1e3), (start % 1e3) * 1e6] - if (start != null) { - this.start = start - } -} - -/** - * Returns how long the timer has been running (if it's still running) or - * how long it ran (if it's been ended or touched). - */ -Timer.prototype.getDurationInMillis = function getDurationInMillis() { - if (this.state === PENDING) { - return 0 - } - - // only set by setDurationInMillis - if (this.durationInMillis !== null && this.durationInMillis >= 0) { - return this.durationInMillis - } - - // prioritize .end() and .touch() - if (this.hrDuration) { - return hrToMillis(this.hrDuration) - } - - return hrToMillis(process.hrtime(this.hrstart)) -} - -/** - * Get a single object containing the interval this timer was active. - * - * @returns {Array} 2-tuple of start time in milliseconds, end time in - * milliseconds. - */ -Timer.prototype.toRange = function toRange() { - return [this.start, this.start + this.getDurationInMillis()] -} - -/** - * Abstract away the nonsense related to having both an - * hrtime start time and a regular one, and always return - * milliseconds since start. - * - * @param {Timer} other The point relative to which this timer started. - * @returns {number} The offset in (floating-point) milliseconds. - */ -Timer.prototype.startedRelativeTo = function startedRelativeTo(other) { - if (this.hrstart && other.hrstart) { - const s = this.hrstart[0] - other.hrstart[0] - const ns = this.hrstart[1] - other.hrstart[1] - - return hrToMillis([s, ns]) - } - - return this.start - other.start -} - -/** - * Returns true if this timer ends after the other. - * - * @param other - */ -Timer.prototype.endsAfter = function compare(other) { - return this.getDurationInMillis() + this.start > other.getDurationInMillis() + other.start -} - -module.exports = Timer diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/dt-payload.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/dt-payload.js deleted file mode 100644 index 34c219142..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/dt-payload.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'distributedTracePayload' }) - -const DT_VERSION_MAJOR = 0 -const DT_VERSION_MINOR = 1 - -module.exports = class DistributedTracePayload { - /** - * The class responsible for producing distributed trace payloads. - * Created by calling {@link TransactionHandle#_createDistributedTracePayload}. - * - * @param payload - * @class - */ - constructor(payload) { - logger.trace('DistributedTracePayload created with %s', payload) - this.plainTextPayload = JSON.stringify({ - v: [DT_VERSION_MAJOR, DT_VERSION_MINOR], - d: payload - }) - this.base64Payload = null - } - - /** - * @returns {string} The base64 encoded JSON representation of the - * distributed trace payload. - */ - text() { - logger.trace('DistributedTracePayload text: %s', this.plainTextPayload) - return this.plainTextPayload - } - - /** - * Construct a payload suitable for HTTP transport. - * - * @returns {string} The base64 encoded JSON representation of the - * distributed trace payload. - */ - httpSafe() { - if (!this.base64Payload) { - this.base64Payload = Buffer.from(this.plainTextPayload, 'utf-8').toString('base64') - } - logger.trace('DistributedTracePayload httpSafe: %s', this.base64Payload) - return this.base64Payload - } -} - -module.exports.Stub = class DistributedTracePayloadStub { - text() { - logger.debug('DistributedTracePayloadStub text') - return '' - } - - httpSafe() { - logger.debug('DistributedTracePayloadStub httpSafe') - return '' - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/handle.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/handle.js deleted file mode 100644 index c64540ecd..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/handle.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'transactionHandle' }) - -const NAMES = require('../../lib/metrics/names') - -class TransactionHandle { - /** - * A light representation of a transaction instance, returned by calling - * {@link API#getTransaction}. - * - * @param transaction - * @param metrics - * @class - */ - constructor(transaction, metrics) { - this._transaction = transaction - this._metrics = metrics - } - - /** - * End the transaction. - * - * @param {Function} callback - */ - end(callback) { - const tx = this._transaction.end() - if (typeof callback === 'function') { - // XXX: Since Transaction#end is now synchronous, this needs to - // asynchronously call the callback like Transaction#end used to. - // Change this to be synchronous in the next major version. - setImmediate(callback, tx) - } - } - - /** - * Mark the transaction to be ignored. - */ - ignore() { - this._transaction.setForceIgnore(true) - } - - /** - * Return whether this Transaction is being sampled - */ - isSampled() { - return this._transaction.isSampled() - } - - /** - * Parsing incoming headers for use in a distributed trace. - * W3C TraceContext format is preferred over the NewRelic DT format. - * NewRelic DT format will be used if no `traceparent` header is found. - * - * @param @param {string} [transportType='Unknown'] - The transport type that delivered the trace. - * @param transportType - * @param {object} headers - Headers to search for supported formats. Keys must be lowercase. - */ - acceptDistributedTraceHeaders(transportType, headers) { - incrementApiSupportMetric(this._metrics, 'acceptDistributedTraceHeaders') - return this._transaction.acceptDistributedTraceHeaders(transportType, headers) - } - - /** - * Inserts distributed trace headers into the provided headers map. - * - * @param {object} headers - */ - insertDistributedTraceHeaders(headers) { - incrementApiSupportMetric(this._metrics, 'insertDistributedTraceHeaders') - return this._transaction.insertDistributedTraceHeaders(headers) - } -} - -module.exports = TransactionHandle - -/** - * - * @param metrics - * @param functionName - */ -function incrementApiSupportMetric(metrics, functionName) { - if (!metrics) { - logger.warnOnce( - 'Cannot add TransactionHandle API support metric. The metrics collection is missing.' - ) - return - } - - const metric = metrics.getOrCreateMetric( - NAMES.SUPPORTABILITY.TRANSACTION_API + '/' + functionName - ) - - metric.incrementCallCount() - return metric -} - -module.exports.Stub = class TransactionHandleStub { - end(callback) { - if (callback instanceof Function) { - setImmediate(callback) - } - logger.debug('No transaction found when calling Transaction.end') - } - - ignore() { - logger.debug('No transaction found when calling Transaction.ignore') - } - - isSampled() { - logger.debug('No transaction found when calling Transaction.isSampled') - } - - acceptDistributedTraceHeaders() { - logger.debug('No transaction found when calling Transaction.acceptDistributedTraceHeaders') - } - - insertDistributedTraceHeaders() { - logger.debug('No transaction found when calling Transaction.insertDistributedTraceHeaders') - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/index.js deleted file mode 100644 index 215c7a0a8..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/index.js +++ /dev/null @@ -1,1405 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const errorHelper = require('../errors/helper') -const hashes = require('../util/hashes') -const logger = require('../logger').child({ component: 'transaction' }) -const Metrics = require('../metrics') -const NAMES = require('../metrics/names') -const NameState = require('./name-state') -const props = require('../util/properties') -const Timer = require('../timer') -const Trace = require('./trace') -const url = require('url') -const urltils = require('../util/urltils') -const TraceContext = require('./tracecontext').TraceContext -const Logs = require('./logs') -const DT_ACCEPT_PAYLOAD_EXCEPTION_METRIC = 'DistributedTrace/AcceptPayload/Exception' -const DT_ACCEPT_PAYLOAD_PARSE_EXCEPTION_METRIC = 'DistributedTrace/AcceptPayload/ParseException' -const REQUEST_PARAMS_PATH = 'request.parameters.' - -/* - * - * CONSTANTS - * - */ -const DESTS = require('../config/attribute-filter').DESTINATIONS -const FROM_MILLIS = 1e-3 -const TYPES = { - WEB: 'web', - BG: 'bg', - MESSAGE: 'message' -} -const TYPES_SET = _makeValueSet(TYPES) -const TYPE_METRICS = { - web: NAMES.WEB.RESPONSE_TIME, - bg: NAMES.OTHER_TRANSACTION.RESPONSE_TIME, - message: NAMES.OTHER_TRANSACTION.MESSAGE -} -const TRANSPORT_TYPES = { - AMQP: 'AMQP', - HTTP: 'HTTP', - HTTPS: 'HTTPS', - IRONMQ: 'IronMQ', - JMS: 'JMS', - KAFKA: 'Kafka', - OTHER: 'Other', - QUEUE: 'Queue', - UNKNOWN: 'Unknown' -} -const TRANSPORT_TYPES_SET = _makeValueSet(TRANSPORT_TYPES) -const REQUIRED_DT_KEYS = ['ty', 'ac', 'ap', 'tr', 'ti'] -const DTPayload = require('./dt-payload') -const DTPayloadStub = DTPayload.Stub - -const TRACE_CONTEXT_PARENT_HEADER = 'traceparent' -const TRACE_CONTEXT_STATE_HEADER = 'tracestate' -const NEWRELIC_TRACE_HEADER = 'newrelic' - -const MULTIPLE_INSERT_MESSAGE = - 'insertDistributedTraceHeaders called on headers object that already contains ' + - "distributed trace data. These may be overwritten. traceparent? '%s', newrelic? '%s'." - -/** - * Bundle together the metrics and the trace segment for a single agent - * transaction. - * - * @param {object} agent The agent. - */ -function Transaction(agent) { - if (!agent) { - throw new Error('every transaction must be bound to the agent') - } - - this.traceFlag = false - if (agent.config.logging.diagnostics) { - this.traceStacks = [] - } else { - this.traceStacks = null - } - - this.agent = agent - this.metrics = new Metrics(agent.config.apdex_t, agent.mapper, agent.metricNameNormalizer) - - ++agent.activeTransactions - - this.numSegments = 0 - this.id = hashes.makeId(16) - - this.trace = new Trace(this) - this.exceptions = [] - this.userErrors = [] - this.timer = new Timer() - this.timer.begin() - - this._recorders = [] - this._intrinsicAttributes = Object.create(null) - this._partialName = null - - // If handledExternally is set to true the transaction will not ended - // automatically, instead it should be ended by user code. - this.handledExternally = false - - // hidden class optimization - this.catResponseTime = 0 - this.error = null - this.forceIgnore = null - this.forceName = null - this.ignore = false - this.incomingCatId = null - this.name = null - this.nameState = new NameState(null, null, null, null) - this.pathHashes = [] - this.queueTime = 0 - this.referringPathHash = null - this.referringTransactionGuid = null - this.invalidIncomingExternalTransaction = false - this.statusCode = null - this.syntheticsHeader = null - this.syntheticsData = null - this.url = null - this.parsedUrl = null - this.verb = null - this.baseSegment = null - this.type = TYPES.WEB - // DT fields - this.parentId = null - this.parentType = null - this.parentApp = null - this.parentAcct = null - this.parentTransportType = null - this.parentTransportDuration = null - this._traceId = null - Object.defineProperty(this, 'traceId', { - get() { - if (this._traceId === null) { - this._traceId = hashes.makeId(32) - } - return this._traceId - }, - set(traceId) { - this._traceId = traceId - } - }) - this.parentSpanId = null - this.isDistributedTrace = null - this.acceptedDistributedTrace = null - - // Lazy evaluate the priority and sampling in case we end up accepting a payload. - this.priority = null - this.sampled = null - this.traceContext = new TraceContext(this) - this.logs = new Logs(agent) - - agent.emit('transactionStarted', this) - this.probe('Transaction created', { id: this.id }) -} - -Transaction.TYPES = TYPES -Transaction.TYPES_SET = TYPES_SET -Transaction.TRANSPORT_TYPES = TRANSPORT_TYPES -Transaction.TRANSPORT_TYPES_SET = TRANSPORT_TYPES_SET -Transaction.TRACE_CONTEXT_PARENT_HEADER = TRACE_CONTEXT_PARENT_HEADER - -Transaction.prototype.probe = function probe(action, extra) { - if (this.traceStacks) { - this.traceStacks.push({ - stack: new Error(action).stack.split('\n'), - extra: extra - }) - } -} - -/** - * Add a clear API method for determining whether a transaction is web or - * background. - * - * @returns {boolean} Whether this transaction has a URL. - */ -Transaction.prototype.isWeb = function isWeb() { - return this.type === TYPES.WEB -} - -/** - * @returns {boolean} Is this transaction still alive? - */ -Transaction.prototype.isActive = function isActive() { - return this.timer.isActive() -} - -/** - * Close out the current transaction and its associated trace. Remove any - * instances of this transaction annotated onto the call stack. - * - * @returns {(Transaction|undefined)} this transaction, or undefined - */ -Transaction.prototype.end = function end() { - if (!this.timer.isActive()) { - return - } - if (this.traceFlag) { - logger.warn( - { segment: { name: this.name, stacks: this.traceStacks } }, - 'Flagged transaction ended.' - ) - } - - if (!this.name) { - this.finalizeName(null) // Use existing partial name. - } - if (this.baseSegment) { - this.baseSegment.touch() - } - - this.agent.recordSupportability('Nodejs/Transactions/Segments', this.numSegments) - this._calculatePriority() - - this.trace.end() - - this.timer.end() - // recorders must be run before the trace is collected - if (!this.ignore) { - this.record() - - // This method currently must be called after all recorders have been fired due - // to some of the recorders (namely the db recorders) adding parameters to the - // segments. - this.trace.generateSpanEvents() - this.logs.flush(this.priority) - } - - this.agent.emit('transactionFinished', this) - - // Do after emit so all post-processing can complete - this._cleanUneededReferences() - - return this -} - -/** - * Cleans up references that will not be used later for processing such as - * transaction traces. - * - * Errors won't be needed for later processing but can contain extra details we - * don't want to hold in memory. Particularly, axios errors can result in indirect - * references to promises which will prevent them from being destroyed and result - * in a memory leak. This is due to the TraceSegment not getting removed from the - * async-hooks segmentMap because 'destroy' never fires. - */ -Transaction.prototype._cleanUneededReferences = function _cleanUneededReferences() { - this.userErrors = null - this.exceptions = null -} - -/** - * For web transactions, this represents the time from when the request was received - * to when response was sent. For background transactions, it is equal to duration - * of the transaction trace (until last segment ended). - * - * @returns {number} timer or trace duration in milliseconds - */ -Transaction.prototype.getResponseTimeInMillis = function getResponseTimeInMillis() { - if (this.isWeb()) { - return this.timer.getDurationInMillis() - } - return this.trace.getDurationInMillis() -} - -/** - * Executes the user and server provided naming rules to clean up the given url. - * - * @private - * @param {string} requestUrl - The URL to normalize. - * @returns {object} The normalization results after running user and server rules. - */ -Transaction.prototype._runUserNamingRules = function _runUserNamingRules(requestUrl) { - // 1. user normalization rules (set in configuration) - const normalized = this.agent.userNormalizer.normalize(requestUrl) - if (normalized.matched) { - // After applying user naming rule, apply server-side sent rules to - // further squash possible MGIs - const serverNormalized = this.agent.urlNormalizer.normalize(normalized.value) - if (serverNormalized.ignore) { - normalized.ignore = true - } - if (serverNormalized.matched) { - // NAMES.NORMALIZED is prepended by the sever rule normalizer - normalized.value = serverNormalized.value - } else { - normalized.value = NAMES.NORMALIZED + normalized.value - } - } - return normalized -} - -/** - * Executes the user naming rules and applies the results to the transaction. - * - * @param {string} requestUrl - The URL to normalize and apply to this transaction. - */ -Transaction.prototype.applyUserNamingRules = function applyUserNamingRules(requestUrl) { - const normalized = this._runUserNamingRules(requestUrl) - if (normalized.ignore) { - this.ignore = normalized.ignore - } - if (normalized.matched) { - this._partialName = normalized.value - } -} - -/** - * Set's the transaction partial name. - * - * The partial name is everything after the `WebTransaction/` part. - * - * @param {string} name - The new transaction partial name to use. - */ -Transaction.prototype.setPartialName = function setPartialName(name) { - this._partialName = name -} - -/** - * Derive the transaction partial name from the given url and status code. - * - * @private - * @param {string} requestUrl - The URL to derive the name from. - * @param {number} status - The status code of the response. - * @returns {object} An object with the derived partial name in `value` and a - * boolean flag in `ignore`. - */ -Transaction.prototype._partialNameFromUri = _partialNameFromUri -function _partialNameFromUri(requestUrl, status) { - const scrubbedUrl = urltils.scrub(requestUrl) - - // 0. If there is a name in the name-state stack, use it. - let partialName = this._partialName - let ignore = false - if (!this.nameState.isEmpty()) { - partialName = this.nameState.getFullName() - } - - // 1. name set by the api - if (this.forceName !== null) { - partialName = this.forceName - } - - // 2. user normalization rules (set in configuration) can override transaction - // naming from API - const userNormalized = this._runUserNamingRules(scrubbedUrl) - ignore = ignore || userNormalized.ignore - if (userNormalized.matched) { - partialName = userNormalized.value - } - - // 3. URL normalization rules (sent by server). - // Nothing has already set a name for this transaction, so normalize and - // potentially apply the URL backstop now. Only do so if no user rules matched. - if (!partialName) { - // avoid polluting root path when 404 - const statusName = this.nameState.getStatusName(status) - if (statusName) { - partialName = statusName - } else { - const normalized = this.agent.urlNormalizer.normalize(scrubbedUrl) - ignore = ignore || normalized.ignore - partialName = normalized.value - } - } - - return { - ignore: ignore, - value: partialName - } -} - -/** - * Set the forceIgnore value on the transaction. This will cause the - * transaction to clean up after itself without collecting any data. - * - * @param {boolean} ignore The value to assign to transaction.ignore - */ -Transaction.prototype.setForceIgnore = function setForceIgnore(ignore) { - if (ignore != null) { - this.forceIgnore = ignore - } else { - logger.debug('Transaction#setForceIgnore called with null value') - } -} - -/** - * - * Gets the current ignore state for the transaction. - * - */ - -Transaction.prototype.isIgnored = function getIgnore() { - return this.ignore || this.forceIgnore -} - -/** - * Derives the transaction's name from the given URL and status code. - * - * The transaction's name will be set after this as well as its ignored status - * based on the derived name. - * - * @param {string} requestURL - The URL to derive the request's name and status from. - * @param {number} statusCode - The response status code. - */ -Transaction.prototype.finalizeNameFromUri = finalizeNameFromUri - -function finalizeNameFromUri(requestURL, statusCode) { - if (logger.traceEnabled()) { - logger.trace( - { - requestURL: requestURL, - statusCode: statusCode, - transactionId: this.id, - transactionName: this.name - }, - 'Setting transaction name' - ) - } - - this.url = urltils.scrub(requestURL) - this.statusCode = statusCode - this.name = this.getFullName() - - // If a namestate stack exists, copy route parameters over to the trace. - if (!this.nameState.isEmpty() && this.baseSegment) { - this.nameState.forEachParams(forEachRouteParams, this) - } - - // Allow the API to explicitly set the ignored status. - if (this.forceIgnore !== null) { - this.ignore = this.forceIgnore - } - - this.baseSegment && this._markAsWeb(requestURL) - - this._copyNameToActiveSpan(this.name) - - if (logger.traceEnabled()) { - logger.trace( - { - transactionId: this.id, - transactionName: this.name, - ignore: this.ignore - }, - 'Finished setting transaction name from Uri' - ) - } -} - -function forEachRouteParams(params) { - for (const key in params) { - if (props.hasOwn(params, key)) { - this.trace.attributes.addAttribute(DESTS.NONE, key, params[key]) - - const segment = this.agent.tracer.getSegment() - - if (!segment) { - logger.trace( - 'Active segment not available, not adding request.parameters.route attribute for %s', - key - ) - } else { - segment.attributes.addAttribute(DESTS.NONE, key, params[key]) - } - } - } -} - -Transaction.prototype._copyNameToActiveSpan = function _copyNameToActiveSpan(name) { - const spanContext = this.agent.tracer.getSpanContext() - if (!spanContext) { - logger.trace('Span context not available, not adding transaction.name attribute for %s', name) - return - } - - spanContext.addIntrinsicAttribute('transaction.name', name) -} - -/** - * Copies final base segment parameters to trace attributes before reapplying - * them to the segment. - * - * Handles adding query parameters to `request.parameter.*` attributes - * - * @param {string} rawURL The URL, as it came in, for parameter extraction. - */ -Transaction.prototype._markAsWeb = function _markAsWeb(rawURL) { - // Because we are assured we have the URL here, lets grab query params. - const params = urltils.parseParameters(rawURL) - for (const key in params) { - if (props.hasOwn(params, key)) { - this.trace.attributes.addAttribute(DESTS.NONE, REQUEST_PARAMS_PATH + key, params[key]) - - const segment = this.agent.tracer.getSegment() - - if (!segment) { - logger.trace( - 'Active segment not available, not adding request.parameters span attribute for %s', - key - ) - } else { - segment.attributes.addAttribute(DESTS.NONE, REQUEST_PARAMS_PATH + key, params[key]) - } - } - } - this.baseSegment.markAsWeb() -} - -/** - * Sets the transaction's name and determines if it will be ignored. - * - * @param {string} [name] - * Optional. The partial name to use for the finalized transaction. If omitted - * the current partial name is used. - * @returns {undefined} undefined, finalizing name as a side effect - */ -Transaction.prototype.finalizeName = function finalizeName(name) { - // If no name is given, and this is a web transaction with a url, then - // finalize the name using the stored url. - if (name == null && this.isWeb() && this.url) { - return this.finalizeNameFromUri(this.url, this.statusCode) - } - - // this may seem out of place but certain API methods - // set the _partialName directly so use that as a fallback - this._partialName = name || this._partialName - - name = this.getFullName() - - if (!name) { - logger.debug('No name for transaction %s, not finalizing.', this.id) - return - } - - this.name = name - - if (this.forceIgnore !== null) { - this.ignore = this.forceIgnore - } - - this.baseSegment && this.baseSegment.setNameFromTransaction() - - this._copyNameToActiveSpan(this.name) - - if (logger.traceEnabled()) { - logger.trace( - { - transactionId: this.id, - transactionName: this.name, - ignore: this.ignore - }, - 'Finished setting transaction name from string' - ) - } -} - -/** - * Gets the transaction name safely. - * - * Gathering the transaction name for WebTransactions is risky complicated - * business. OtherTransactions (aka background) are much simpler as they are - * always fully specified by the user at creation time. - * - * This has the potential of causing the normalizers run extra times, which can - * cause extra performance overhead. Once this is refactored we can make the - * caching better and eliminate this extra overhead. Be mindful of if/when this - * is called. - * - * @returns {string} finalized name value or partial name - */ -Transaction.prototype.getName = function getName() { - if (this.isWeb() && this.url) { - const finalName = this._partialNameFromUri(this.url, this.statusCode) - if (finalName.ignore) { - this.ignore = true - } - return finalName.value - } - return this._partialName -} - -Transaction.prototype.getFullName = function getFullName() { - let name = null - // use value from `api.setTransaction` - if (this.forceName) { - name = this.forceName - // use value from previously finalized named - } else if (this.name) { - return this.name - // derive name from uri in web case - // or just use whatever was this._partialName - } else { - name = this.getName() - } - - if (!name) { - return null - } - - this._partialName = name - let fullName = TYPE_METRICS[this.type] + '/' + name - const normalized = this.agent.transactionNameNormalizer.normalize(fullName) - if (normalized.ignore) { - this.ignore = true - } - - fullName = normalized.value - - // apply transaction segment term normalizer - // only to web transactions - if (this.isWeb() && this.url) { - fullName = this.agent.txSegmentNormalizer.normalize(fullName).value - } - - return fullName -} - -/** - * Returns the full URL of the transaction with query, search, or hash portions - * removed. This is only applicable for web transactions. - * - * Caches to ._scrubbedUrl, pulls in from .parsedUrl if it is available, - * otherwise it will parse .url, store it on .parsedUrl, then scrub the URL and - * store it in the cache. - * - * @returns {(string|undefined)} Returns a string or undefined. - */ -Transaction.prototype.getScrubbedUrl = function getScrubbedUrl() { - if (!this.isWeb()) { - return - } - if (this._scrubbedUrl) { - return this._scrubbedUrl - } - - // If we don't have a parsedUrl, lets populate it from .url - if (!this.parsedUrl) { - // At time of writing .url should always be set by the time we get here - // because that is what .isWeb() checks against. In the future it may be - // instead checking a enum or other property so guard ourselves just in - // case. - if (!this.url) { - return - } - this.parsedUrl = url.parse(this.url) - } - - const scrubbedParsedUrl = Object.assign(Object.create(null), this.parsedUrl) - scrubbedParsedUrl.search = null - scrubbedParsedUrl.query = null - scrubbedParsedUrl.href = null - scrubbedParsedUrl.path = null - scrubbedParsedUrl.hash = null - - this._scrubbedUrl = url.format(scrubbedParsedUrl) - - return this._scrubbedUrl -} - -/** - * The instrumentation associates metrics with the different kinds of trace - * segments. The metrics recorders are dependent on the transaction name to - * collect their scoped metrics, and so must wait for the transaction's - * name to be finalized before the recording process. Segments are only - * responsible for their own life cycle, so responsibility for understanding - * when the transaction name has been finalized is handed off to the trace, - * which for now defers running these recorders until the trace is ended. - * - * @param {Function} recorder The callback which records metrics. Takes a - * single parameter, which is the transaction's - * name. - */ -Transaction.prototype.addRecorder = function addRecorder(recorder) { - this._recorders.push(recorder) -} - -/** - * Run the metrics recorders for this trace. If the transaction's name / - * scope hasn't been set yet, the recorder will be passed an undefined name, - * and should be written to handle this. - */ -Transaction.prototype.record = function record() { - const name = this.name - for (let i = 0, l = this._recorders.length; i < l; ++i) { - this._recorders[i](name) - } -} - -/** - * Measure the duration of an operation named by a metric, optionally - * belonging to a scope. - * - * @param {string} name The name of the metric to gather. - * @param {string} scope (optional) Scope to which the metric is bound. - * @param {number} duration The time taken by the operation, in milliseconds. - * @param {number} exclusive The time exclusively taken by an operation, and - * not its children. - */ -Transaction.prototype.measure = function measure(name, scope, duration, exclusive) { - this.metrics.measureMilliseconds(name, scope, duration, exclusive) -} - -/** - * Based on the status code and the duration of a web transaction, either - * mark the transaction as frustrating, or record its time for apdex purposes. - * - * @param {string} name Metric name. - * @param {number} duration Duration of the transaction, in milliseconds. - * @param {number} keyApdexInMillis Duration sent to the metrics getOrCreateApdexMetric method, to - * derive apdex from timing in milliseconds - */ -Transaction.prototype._setApdex = function _setApdex(name, duration, keyApdexInMillis) { - const apdexStats = this.metrics.getOrCreateApdexMetric(name, null, keyApdexInMillis) - - // if we have an error-like status code, and all the errors are - // expected, we know the status code was caused by an expected - // error, so we will not report "frustrating." Otherwise, we - // don't know which error triggered the error-like status code, - // and will still increment "frustrating." If this is an issue, - // users can either set a status code as expected, or ignore the - // specific error to avoid incrementing to frustrating - if ( - urltils.isError(this.agent.config, this.statusCode) && - !urltils.isExpectedError(this.agent.config, this.statusCode) && - !this.hasOnlyExpectedErrors() - ) { - apdexStats.incrementFrustrating() - } else { - apdexStats.recordValueInMillis(duration, keyApdexInMillis) - } -} - -/** - * Store first 10 unique path hashes calculated for a transaction. - * - * @param {string} pathHash Path hash - * @returns {undefined} - */ -Transaction.prototype.pushPathHash = function pushPathHash(pathHash) { - if (this.pathHashes.length >= 10 || this.pathHashes.indexOf(pathHash) !== -1) { - return - } - this.pathHashes.unshift(pathHash) -} - -/** - * Return whether transaction spawned any outbound requests. - * - * @returns {boolean} if there are more than zero pathHashes - */ -Transaction.prototype.includesOutboundRequests = function includesOutboundRequests() { - return this.pathHashes.length > 0 -} - -/** - * Get unique previous path hashes for a transaction. Does not include - * current path hash. - * - * @returns {(string|null)} Returns sorted altHashes joined by commas, or null. - */ -Transaction.prototype.alternatePathHashes = function alternatePathHashes() { - const curHash = hashes.calculatePathHash( - this.agent.config.applications()[0], - this.getFullName(), - this.referringPathHash - ) - const altHashes = this.pathHashes.slice() - const curIndex = altHashes.indexOf(curHash) - - if (curIndex !== -1) { - altHashes.splice(curIndex, 1) - } - - return altHashes.length === 0 ? null : altHashes.sort().join(',') -} - -/** - * Add the error information to the current segment and add the segment ID as - * an attribute onto the exception. - * - * @param {Exception} exception The exception object to be collected. - */ -Transaction.prototype._linkExceptionToSegment = _linkExceptionToSegment - -function _linkExceptionToSegment(exception) { - const segment = this.agent.tracer.getSegment() - if (!segment) { - return - } - - const spanContext = segment.getSpanContext() - if (spanContext) { - // Exception attributes will be added to span unless transaction - // status code has been ignored. Last error wins. - const config = this.agent.config - const details = exception.getErrorDetails(config) - spanContext.setError(details) - } - - // Add the span/segment ID to the exception as agent attributes - exception.agentAttributes.spanId = segment.id -} - -/** - * Associate an exception with the transaction. When the transaction ends, - * the exception will be collected along with the transaction details. - * - * @param {Exception} exception The exception object to be collected. - */ -Transaction.prototype.addException = _addException - -function _addException(exception) { - if (!this.isActive()) { - logger.trace('Transaction is not active. Not capturing error: ', exception) - return - } - - this._linkExceptionToSegment(exception) - this.exceptions.push(exception) -} - -/** - * Associate a user error (reported using the noticeError() API) with the transaction. - * When the transaction ends, the exception will be collected along with the transaction - * details. - * - * @param {Exception} exception The exception object to be collected. - */ -Transaction.prototype.addUserError = _addUserError - -function _addUserError(exception) { - if (!this.isActive()) { - logger.trace('Transaction is not active. Not capturing user error: ', exception) - return - } - - this._linkExceptionToSegment(exception) - this.userErrors.push(exception) -} - -/** - * @returns {boolean} true if the transaction's current status code is errored - * but considered ignored via the config. - */ -Transaction.prototype.hasIgnoredErrorStatusCode = function _hasIgnoredErrorStatusCode() { - return urltils.isIgnoredError(this.agent.config, this.statusCode) -} - -/** - * @returns {boolean} true if an error happened during the transaction or if the transaction itself is - * considered to be an error. - */ -Transaction.prototype.hasErrors = function _hasErrors() { - const isErroredTransaction = urltils.isError(this.agent.config, this.statusCode) - const transactionHasExceptions = this.exceptions.length > 0 - const transactionHasuserErrors = this.userErrors.length > 0 - return transactionHasExceptions || transactionHasuserErrors || isErroredTransaction -} - -/** - * @returns {boolean} true if all the errors/exceptions collected so far are expected errors - */ -Transaction.prototype.hasOnlyExpectedErrors = function hasOnlyExpectedErrors() { - if (0 === this.exceptions.length) { - return false - } - - for (let i = 0; i < this.exceptions.length; i++) { - const exception = this.exceptions[i] - // this exception is neither expected nor ignored - const isUnexpected = !( - errorHelper.isExpectedException(this, exception, this.agent.config, urltils) || - errorHelper.shouldIgnoreError(this, exception.error, this.agent.config) - ) - if (isUnexpected) { - return false - } - } - return true -} - -/** - * @returns {object} agent intrinsic attribute for this transaction. - */ -Transaction.prototype.getIntrinsicAttributes = function getIntrinsicAttributes() { - if (!this._intrinsicAttributes.totalTime) { - const config = this.agent.config - this._intrinsicAttributes.totalTime = this.trace.getTotalTimeDurationInMillis() * FROM_MILLIS - - if (config.distributed_tracing.enabled) { - this.addDistributedTraceIntrinsics(this._intrinsicAttributes) - } else if (config.cross_application_tracer.enabled) { - this._intrinsicAttributes.path_hash = hashes.calculatePathHash( - config.applications()[0], - this.name || this._partialName, - this.referringPathHash - ) - this._intrinsicAttributes.trip_id = this.tripId || this.id - if (this.referringTransactionGuid) { - this._intrinsicAttributes.referring_transaction_guid = this.referringTransactionGuid - } - if (this.incomingCatId) { - this._intrinsicAttributes.client_cross_process_id = this.incomingCatId - } - } - - if (this.syntheticsData) { - this._intrinsicAttributes.synthetics_resource_id = this.syntheticsData.resourceId - this._intrinsicAttributes.synthetics_job_id = this.syntheticsData.jobId - this._intrinsicAttributes.synthetics_monitor_id = this.syntheticsData.monitorId - } - } - return Object.assign(Object.create(null), this._intrinsicAttributes) -} - -/** - * Parsing incoming headers for use in a distributed trace. - * W3C TraceContext format is preferred over the NewRelic DT format. - * NewRelic DT format will be used if no `traceparent` header is found. - * - * @param {string} [transport='Unknown'] - The transport type that delivered the trace. - * @param {object} headers - Headers to search for supported trace formats. Keys must be lowercase. - */ -Transaction.prototype.acceptDistributedTraceHeaders = acceptDistributedTraceHeaders -function acceptDistributedTraceHeaders(transportType, headers) { - if (headers == null || typeof headers !== 'object') { - logger.trace( - 'Ignoring distributed trace headers for transaction %s. Headers not passed in as object.', - this.id - ) - return - } - - const transport = TRANSPORT_TYPES_SET[transportType] ? transportType : TRANSPORT_TYPES.UNKNOWN - - // assumes header keys already lowercase - const traceparent = headers[TRACE_CONTEXT_PARENT_HEADER] - - if (traceparent) { - logger.trace('Accepting trace context DT payload for transaction %s', this.id) - // assumes header keys already lowercase - const tracestate = headers[TRACE_CONTEXT_STATE_HEADER] - this.acceptTraceContextPayload(traceparent, tracestate, transport) - } else if (NEWRELIC_TRACE_HEADER in headers) { - logger.trace('Accepting newrelic DT payload for transaction %s', this.id) - // assumes header keys already lowercase - const payload = headers[NEWRELIC_TRACE_HEADER] - this._acceptDistributedTracePayload(payload, transport) - } -} - -/** - * Inserts distributed trace headers into the provided headers map. - * - * @param {object} headers - */ -Transaction.prototype.insertDistributedTraceHeaders = insertDistributedTraceHeaders -function insertDistributedTraceHeaders(headers) { - if (!headers) { - logger.trace('insertDistributedTraceHeaders called without headers.') - return - } - - checkForExistingNrTraceHeaders(headers) - - // Ensure we have priority before generating trace headers. - this._calculatePriority() - - this.traceContext.addTraceContextHeaders(headers) - this.isDistributedTrace = true - - logger.trace('Added outbound request w3c trace context headers in transaction %s', this.id) - - if (this.agent.config.distributed_tracing.exclude_newrelic_header) { - logger.trace('Excluding newrelic header due to exclude_newrelic_header: true') - return - } - - try { - const newrelicFormatData = this._createDistributedTracePayload().httpSafe() - headers[NEWRELIC_TRACE_HEADER] = newrelicFormatData - logger.trace('Added outbound request distributed tracing headers in transaction %s', this.id) - } catch (error) { - logger.trace(error, 'Failed to create distributed trace payload') - } -} - -function checkForExistingNrTraceHeaders(headers) { - const traceparentHeader = headers[TRACE_CONTEXT_PARENT_HEADER] - const newrelicHeader = headers[NEWRELIC_TRACE_HEADER] - - const hasExisting = traceparentHeader || newrelicHeader - if (hasExisting) { - logger.trace(MULTIPLE_INSERT_MESSAGE, traceparentHeader, newrelicHeader) - } -} - -Transaction.prototype.acceptTraceContextPayload = acceptTraceContextPayload -function acceptTraceContextPayload(traceparent, tracestate, transport) { - if (this.isDistributedTrace) { - logger.warn( - 'Already accepted or created a distributed trace payload for transaction %s, ignoring call', - this.id - ) - - if (this.acceptedDistributedTrace) { - this.agent.recordSupportability('TraceContext/Accept/Ignored/Multiple') - } else { - this.agent.recordSupportability('TraceContext/Accept/Ignored/CreateBeforeAccept') - } - - return - } - - const traceContext = this.traceContext.acceptTraceContextPayload(traceparent, tracestate) - - if (traceContext.acceptedTraceparent) { - this.acceptedDistributedTrace = true - this.isDistributedTrace = true - - this.traceId = traceContext.traceId - this.parentSpanId = traceContext.parentSpanId - this.parentTransportDuration = traceContext.transportDuration - this.parentTransportType = transport - - if (traceContext.acceptedTracestate) { - this.parentType = traceContext.parentType - this.parentAcct = traceContext.accountId - this.parentApp = traceContext.appId - this.parentId = traceContext.transactionId - this.sampled = traceContext.sampled - this.priority = traceContext.priority - } - } -} - -/* - The following underscored functions are used exclusively by the - _acceptDistributedTracePayload method. They're broken out to reduce - its cognitive complexity. - */ -const _dtPayloadTest = function _dtPayloadTest(payload) { - if (!payload) { - this.agent.recordSupportability('DistributedTrace/AcceptPayload/Ignored/Null') - } - return !!payload -} -const _isDtTest = function _isDtTest() { - if (this.isDistributedTrace) { - logger.warn( - 'Already accepted or created a distributed trace payload for transaction %s, ignoring call', - this.id - ) - let supportabilityMetric = 'DistributedTrace/AcceptPayload/Ignored/CreateBeforeAccept' - if (this.parentId) { - supportabilityMetric = 'DistributedTrace/AcceptPayload/Ignored/Multiple' - } - this.agent.recordSupportability(supportabilityMetric) - return true - } - return false -} -const _dtConfigTest = function _dtConfigTest() { - const config = this.agent.config - const distTraceEnabled = config.distributed_tracing.enabled - const trustedAccount = config.trusted_account_key || config.account_id - - if (!distTraceEnabled || !trustedAccount) { - logger.debug( - 'Invalid configuration for distributed trace payload, not accepting ' + - '(distributed_tracing.enabled: %s, trustKey: %s', - distTraceEnabled, - trustedAccount - ) - - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_EXCEPTION_METRIC) - return false - } - return trustedAccount -} -const _dtParseTest = function _dtParseTest(payload) { - const parsed = this._getParsedPayload(payload) - - if (!parsed) { - return false - } - - if (!parsed.v) { - logger.warn('Received a distributed trace payload with no version field', this.id) - } - if (!parsed.d) { - logger.warn('Received a distributed trace payload with no data field', this.id) - } - if (!parsed.v || !parsed.d) { - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_PARSE_EXCEPTION_METRIC) - return false - } - return parsed -} -const _dtVersionTest = function _dtVersionTest(parsed) { - const majorVersion = parsed.v && typeof parsed.v[0] === 'number' && parsed.v[0] - - if (majorVersion === null) { - logger.warn('Invalid distributed trace payload, not accepting') - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_EXCEPTION_METRIC) - } - if (majorVersion > 0) { - // TODO: Add DistributedTracePayload class? - this.agent.recordSupportability('DistributedTrace/AcceptPayload/Ignored/MajorVersion') - } - return majorVersion -} -const _dtRequiredKeyTest = function _dtRequiredKeyTest(data) { - return REQUIRED_DT_KEYS.every(function checkExists(key) { - return data[key] != null - }) -} -const _dtSpanParentTest = function _dtSpanParentTest(requiredKeysExist, data) { - // Either parentSpanId or parentId are required. - if (!requiredKeysExist || (data.tx == null && data.id == null)) { - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_PARSE_EXCEPTION_METRIC) - return false - } - return true -} -const _dtDefineAttrsFromTraceData = function _dtDefineAttrsFromTraceData(data, transport) { - this.parentType = data.ty - this.parentApp = data.ap - this.parentAcct = data.ac - this.parentTransportType = transport - this.parentTransportDuration = Math.max(0, (Date.now() - data.ti) / 1000) - this.traceId = data.tr - - if (data.pr) { - this.priority = data.pr - this.sampled = data.sa != null ? data.sa : this.sampled - } - - if (data.tx) { - this.parentId = data.tx - } - - if (data.id) { - this.parentSpanId = data.id - } - - this.isDistributedTrace = true - // Track if the distributed trace was created through accepting, since - // there is potentially no data difference between creation from - // Mobile or Browser trace payloads and creation. - this.acceptedDistributedTrace = true - - this.agent.recordSupportability('DistributedTrace/AcceptPayload/Success') -} - -/** - * Parses incoming distributed trace header payload. - * - * @param {object} payload - The distributed trace payload to accept. - * @param {string} [transport='Unknown'] - The transport type that delivered the payload. - */ -Transaction.prototype._acceptDistributedTracePayload = _acceptDistributedTracePayload -function _acceptDistributedTracePayload(payload, transport) { - const payloadTest = _dtPayloadTest.bind(this) - if (!payloadTest(payload)) { - return - } - - const isDtTest = _isDtTest.bind(this) - if (isDtTest()) { - return - } - - const configTest = _dtConfigTest.bind(this) - const configTestResult = configTest() - if (!configTestResult) { - return - } - - const traceParseTest = _dtParseTest.bind(this) - const parsed = traceParseTest(payload) - if (!parsed) { - return - } - - const traceVersionTest = _dtVersionTest.bind(this) - if (traceVersionTest(parsed) > 0) { - return - } - - const data = parsed.d - - if (!data) { - logger.warn('No distributed trace data received, not accepting payload') - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_EXCEPTION_METRIC) - return - } - - const requiredKeyTest = _dtRequiredKeyTest.bind(this) - const requiredKeysExist = requiredKeyTest(data) - const spanParentTest = _dtSpanParentTest.bind(this) - const spanParentResult = spanParentTest(requiredKeysExist, data) - - if (!spanParentResult) { - return - } - - const trustedAccount = configTestResult - const trustedAccountKey = data.tk || data.ac - if (trustedAccountKey !== trustedAccount) { - this.agent.recordSupportability(`DistributedTrace/AcceptPayload/Ignored/UntrustedAccount`) - return - } - - const defineAttrsFromTraceData = _dtDefineAttrsFromTraceData.bind(this) - defineAttrsFromTraceData(data, transport) -} - -/** - * Returns parsed payload object after attempting to decode it from base64, - * and parsing the JSON string. - * - * @param {string} payload Payload string to be JSON.parsed - * @returns {(object|null)} parsed JSON payload or null - */ -Transaction.prototype._getParsedPayload = function _getParsedPayload(payload) { - let parsed = payload - - if (typeof payload === 'string') { - if (payload.charAt(0) !== '{' && payload.charAt(0) !== '[') { - try { - payload = Buffer.from(payload, 'base64').toString('utf-8') - } catch (err) { - logger.warn(err, 'Got unparseable distributed trace payload in transaction %s', this.id) - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_PARSE_EXCEPTION_METRIC) - return null - } - } - try { - parsed = JSON.parse(payload) - } catch (err) { - logger.warn(err, 'Failed to parse distributed trace payload in transaction %s', this.id) - this.agent.recordSupportability(DT_ACCEPT_PAYLOAD_PARSE_EXCEPTION_METRIC) - return null - } - } - - return parsed -} - -/** - * Creates a distributed trace payload. - */ -Transaction.prototype._createDistributedTracePayload = _createDistributedTracePayload - -function _createDistributedTracePayload() { - const config = this.agent.config - const accountId = config.account_id - const appId = config.primary_application_id - const distTraceEnabled = config.distributed_tracing.enabled - - if (!accountId || !appId || !distTraceEnabled) { - logger.debug( - 'Invalid configuration for distributed trace payload ' + - '(distributed_tracing.enabled: %s, account_id: %s, application_id: %s) ' + - 'in transaction %s', - distTraceEnabled, - accountId, - appId, - this.id - ) - - return new DTPayloadStub() - } - - const currSegment = this.agent.tracer.getSegment() - const data = { - ty: 'App', - ac: accountId, - ap: appId, - tx: this.id, - tr: this.traceId, - pr: this.priority, - sa: this.sampled, - ti: Date.now() - } - - if (config.span_events.enabled && this.sampled && currSegment) { - data.id = currSegment.id - } - - if (config.trusted_account_key && config.trusted_account_key !== accountId) { - data.tk = config.trusted_account_key - } - - this.isDistributedTrace = true - this.agent.recordSupportability('DistributedTrace/CreatePayload/Success') - - return new DTPayload(data) -} - -/** - * Adds distributed trace attributes to instrinsics object. - */ -Transaction.prototype.addDistributedTraceIntrinsics = addDistributedTraceIntrinsics -function addDistributedTraceIntrinsics(attrs) { - this._calculatePriority() - - // *always* add these if DT flag is enabled. - attrs.traceId = this.traceId - attrs.guid = this.id - attrs.priority = this.priority - - attrs.sampled = !!this.sampled - - // add the rest only if payload was received - if (this.parentType) { - attrs['parent.type'] = this.parentType - } - - if (this.parentApp) { - attrs['parent.app'] = this.parentApp - } - - if (this.parentAcct) { - attrs['parent.account'] = this.parentAcct - } - - if (this.parentTransportType) { - attrs['parent.transportType'] = this.parentTransportType - } - - if (this.parentTransportDuration != null) { - attrs['parent.transportDuration'] = this.parentTransportDuration - } -} - -Transaction.prototype.isSampled = function isSampled() { - this._calculatePriority() - return this.sampled -} - -/** - * Generates a priority for the transaction if it does not have one already. - */ -Transaction.prototype._calculatePriority = function _calculatePriority() { - if (this.priority === null) { - this.priority = Math.random() - // We want to separate the priority roll from the decision roll to - // avoid biasing the priority range - this.sampled = this.agent.transactionSampler.shouldSample(Math.random()) - if (this.sampled) { - this.priority += 1 - } - - // Truncate the priority after potentially modifying it to avoid floating - // point errors. - this.priority = ((this.priority * 1e6) | 0) / 1e6 - } -} - -function _makeValueSet(obj) { - return Object.keys(obj) - .map((t) => obj[t]) - .reduce(function reduceToMap(o, t) { - o[t] = true - return o - }, Object.create(null)) -} - -Transaction.prototype.addRequestParameters = addRequestParameters - -/** - * Adds query parameters to create attributes in the form - * 'request.parameters.{key}'. These attributes will only be created - * when 'request.parameters.*' is included in the attribute config. - * - * Used by the "serverless mode" lambda logic - * - * @param {Object} requestParameters of the request object - */ -function addRequestParameters(requestParameters) { - for (const key in requestParameters) { - if (props.hasOwn(requestParameters, key)) { - this.trace.attributes.addAttribute( - DESTS.NONE, - REQUEST_PARAMS_PATH + key, - requestParameters[key] - ) - - const segment = this.baseSegment - - segment.attributes.addAttribute(DESTS.NONE, REQUEST_PARAMS_PATH + key, requestParameters[key]) - } - } -} - -module.exports = Transaction diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/logs.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/logs.js deleted file mode 100644 index c78fd6998..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/logs.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Storage mechanism for logs within a transaction - * As logs are seen during a transaction they are added to the storage - * if max limit has not been met. When a transaction ends they are flushed - * and added to the Log Aggregator and then cleared - * - * @param {object} agent the agent - */ -function Logs(agent) { - this.maxLimit = agent.config.event_harvest_config.harvest_limits.log_event_data - this.aggregator = agent.logs - this.storage = [] -} - -/** - * Adds a log line to storage if max limit has not been met - * - * @param {object} logLine log line to store - */ -Logs.prototype.add = function add(logLine) { - if (this.storage.length === this.maxLimit) { - return - } - - this.storage.push(logLine) -} - -/** - * Adds all logs gathered during transaction to log aggregator - * with the appropriate priority. The storage is then cleared out. - * - * @param {number} priority of transaction - */ -Logs.prototype.flush = function flush(priority) { - this.aggregator.addBatch(this.storage, priority) - this.storage = [] -} - -module.exports = Logs diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/name-state.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/name-state.js deleted file mode 100644 index 3bcd746c7..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/name-state.js +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger.js').child({ component: 'name-state' }) -const NAMES = require('../metrics/names') - -// TODO: Figure out a way to phase out legacy transaction names. -const LEGACY_NAMING = { - Custom: true, - - Connect: true, - Director: true, - Expressjs: true, - Hapi: true, - Nodejs: true, - Restify: true -} - -const STATUS_CODE_NAMES = { - 404: '(not found)', - 501: '(not implemented)', - 405: '(method not allowed)' -} - -/** - * Manages transaction names using a stack of paths. - * - * @param prefix - * @param verb - * @param delimiter - * @param path - * @class - */ -function NameState(prefix, verb, delimiter, path) { - this.reset() - this.setName(prefix, verb, delimiter, path) - this._frozen = false -} - -NameState.prototype.setName = function setName(prefix, verb, delimiter, path) { - if (this._frozen) { - return - } - - this.setPrefix(prefix) - this.verb = verb && verb.toUpperCase() - this.delimiter = delimiter - this.pathStack = path ? [{ path: path, params: null }] : [] - this._pathCache = null - this.markedPath = [] - logger.trace('setName called on name state, path stack now %j', this.pathStack) -} - -NameState.prototype.getStatusName = function getStatusName(statusCode) { - const name = STATUS_CODE_NAMES[statusCode] - if (name) { - if (LEGACY_NAMING.hasOwnProperty(this.prefix)) { - return _getName(this, name) - } - return NAMES.WEB.FRAMEWORK_PREFIX + '/' + _getName(this, name) - } -} - -NameState.prototype.markPath = function markPath() { - this.markedPath = this.pathStack.slice() -} - -/** - * Sets the metric prefix (i.e. Expressjs). - * - * @param prefix - */ -NameState.prototype.setPrefix = function setPrefix(prefix) { - if (this._frozen) { - return - } - - if (prefix === null) { - this.prefix = null - return - } - this.prefix = prefix[prefix.length - 1] === '/' ? prefix.substring(0, prefix.length - 1) : prefix -} - -/** - * Sets the HTTP verb (i.e. GET/POST/PUT) - * - * @param verb - */ -NameState.prototype.setVerb = function setVerb(verb) { - if (!this._frozen) { - this.verb = verb && verb.toUpperCase() - } -} - -/** - * Sets the delimiter character used to separate the http verb from the path. - * - * @param delimiter - */ -NameState.prototype.setDelimiter = function setDelimiter(delimiter) { - if (!this._frozen) { - this.delimiter = delimiter - } -} - -NameState.prototype.isEmpty = function isEmpty() { - return this.pathStack.length === 0 && this.markedPath.length === 0 -} - -/** - * Pushes a new path element onto the naming stack. - * - * @param path - * @param params - */ -NameState.prototype.appendPath = function appendPath(path, params) { - if (!this._frozen && path != null) { - const strPath = path instanceof RegExp ? path.source : String(path) - this.pathStack.push({ path: strPath, params: params || null }) - - if (path !== '') { - this._pathCache = null - } - logger.trace('Appended %s to path stack', strPath) - } -} - -/** - * Pushes a new path element onto the naming stack if the stack is - * empty. - * - * @param path - * @param params - */ -NameState.prototype.appendPathIfEmpty = function appendPathIfEmpty(path, params) { - if (!this._frozen && this.isEmpty()) { - return this.appendPath(path, params || null) - } -} - -/** - * Pops the last element off the name stack. - * - * If `path` is provided, the stack is popped back to the first element matching - * `path`. If no element matches, the stack is left unchanged. - * - * @param {string} [path] - Optional. A path piece to pop back to. - */ -NameState.prototype.popPath = function popPath(path) { - if (this._frozen || this.pathStack.length === 0) { - return - } - - this._pathCache = null - let pops = 0 - if (path != null) { - const idx = _findLastIndex(this.pathStack, (a) => a.path === path) - if (idx !== -1) { - pops = this.pathStack.length - idx - this.pathStack.splice(idx) - } - } else { - pops = 1 - this.pathStack.pop() - } - logger.trace('Popped %j from path, %d removed', path, pops) -} - -NameState.prototype.getPath = function getPath() { - const ps = !this.pathStack.length ? this.markedPath : this.pathStack - const psLength = ps.length - if (this._pathCache) { - return this._pathCache - } else if (psLength === 0) { - return null // nameState initialized but never set - } - - let path = '/' - for (let i = 0; i < psLength; ++i) { - let a = ps[i].path - if (a && a !== '/') { - if (a[0] !== '/' && path[path.length - 1] !== '/') { - path += '/' - } else if (a[0] === '/' && path[path.length - 1] === '/') { - a = a.substr(1) - } - path += a - } - } - - return (this._pathCache = path) -} - -NameState.prototype.getNameNotFound = function getNameNotFound() { - const name = _getName(this, '(not found)') - if (LEGACY_NAMING.hasOwnProperty(this.prefix)) { - return name - } - return NAMES.WEB.FRAMEWORK_PREFIX + '/' + name -} - -NameState.prototype.getName = function getName() { - const path = this.getPath() - if (path === null) { - return null - } - - return _getName(this, path) -} - -NameState.prototype.getFullName = function getFullName() { - const name = this.getName() - if (LEGACY_NAMING.hasOwnProperty(this.prefix)) { - return name - } - return NAMES.WEB.FRAMEWORK_PREFIX + '/' + name -} - -NameState.prototype.forEachParams = function forEachParams(fn, ctx) { - this.pathStack.forEach(function forEachPathStack(a) { - if (a.params) { - fn.call(ctx, a.params) - } - }) -} - -/** - * Locks the name state, preventing future changes from taking effect. - */ -NameState.prototype.freeze = function freeze() { - this._frozen = true -} - -NameState.prototype.reset = function reset() { - if (this._frozen) { - return - } - - logger.trace('Reset called on name state, path stack was %j', this.pathStack) - this.prefix = null - this.verb = null - this.delimiter = null - this.pathStack = [] - this._pathCache = null -} - -function _getName(nameState, path) { - const verb = nameState.verb ? '/' + nameState.verb : '' - return (nameState.prefix || '') + verb + (nameState.delimiter || '') + path -} - -/** - * Finds the last index of a single element in an array matching `pred`. - * - * @param {Array} arr - Array to search. - * @param {Function} pred - Predicate function that returns `true` on matches. - * @param {*} ctx - The `this` arg for `pred`. - * @returns {number} - This index of the last matching item, or `-1`. - */ -function _findLastIndex(arr, pred, ctx) { - for (let i = arr.length - 1; i >= 0; --i) { - if (pred.call(ctx, arr[i], i, arr)) { - return i - } - } - return -1 -} - -module.exports = NameState diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/aggregator.js deleted file mode 100644 index 75fe6d3f9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/aggregator.js +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const logger = require('../../logger').child({ component: 'Transaction Trace Aggregator' }) - -/* - * - * CONSTANTS - * - */ -const TO_MILLIS = 1e3 -const TraceAggregator = require('../../aggregators/trace-aggregator') - -/** - * Locus for the complicated logic surrounding the selection of slow - * transaction traces for submission to the collector. - * - * @param {object} config Dictionary containing transaction tracing - * parameters. Required. - */ -class TransactionTraceAggregator extends TraceAggregator { - constructor(opts, collector) { - opts = opts || {} - opts.method = opts.method || 'trace_sample_data' - if (!opts.config) { - throw new Error('config required by trace aggregator') - } - - super(opts, collector) - /* - * From - * - * https://newrelic.atlassian.net/wiki/display/eng/Transaction+Trace+Collection+Improvements - * - * 5 Transaction Trace Guarantee - * - * For the initial experience problem, the Agent will sample up to 1 - * transaction per minute until it has sampled 5 transactions. This - * guarantees that the agent will always report some transaction traces. - * There is no time out for this sampling period - the agent always - * samples until it has collected 5 transactions. The agent doesn't - * simply report the first 5 transactions that it sees because it's - * likely (particularly for a local dev test) that all 5 transactions - * would be associated with one request (a single web page and its - * resources). - */ - - const config = opts.config - this.reported = 0 - this.config = config - - // Setting up top n capacity. - this.capacity = 1 - if (config.transaction_tracer && config.transaction_tracer.top_n) { - this.capacity = config.transaction_tracer.top_n - } - - // hidden class optimization - this.trace = null - this.syntheticsTraces = [] - this.requestTimes = Object.create(null) - this.noTraceSubmitted = 0 - } - - /** - * For every five harvest cycles (or "minutes"), if no new slow transactions - * have been added, reset the requestTime match and allow a new set of five - * to start populating the Top N Slow Trace list. - */ - resetTimingTracker() { - this.requestTimes = Object.create(null) - this.noTraceSubmitted = 0 - } - - /** - * Add a trace to the slow trace list, if and only if it fulfills the necessary - * criteria. - * - * @param {Transaction} transaction The transaction, which we need to check - * apdexT, as well as getting the trace. - */ - add(transaction) { - if (!transaction) { - return - } - - if ( - this.config.collect_traces && - this.config.transaction_tracer && - this.config.transaction_tracer.enabled && - transaction && - transaction.metrics - ) { - const trace = transaction.trace - const name = transaction.getFullName() - const duration = trace.getDurationInMillis() - const apdexT = transaction.metrics.apdexT - - if (transaction.syntheticsData) { - this.addSyntheticsTrace(trace) - } else if (this.isBetter(name, duration, apdexT)) { - this.trace = trace - - // because of the "first 5" rule, this may or may not be the slowest - if (!this.requestTimes[name] || this.requestTimes[name] < duration) { - this.requestTimes[name] = duration - } - } - } - } - - addSyntheticsTrace(trace) { - if (this.syntheticsTraces.length < 20) { - this.syntheticsTraces.push(trace) - return true - } - return false - } - - /** - * Reset the trace diversity settings. - */ - clear() { - this.trace = null - this.syntheticsTraces = [] - } - - _merge(data) { - if (!data) { - return - } - if (data.trace) { - this.add(data.trace.transaction) - } - if (data.synthetics) { - for (let i = 0; i < data.synthetics.length; ++i) { - const trace = data.synthetics[i] - if (!this.addSyntheticsTrace(trace)) { - break - } - } - } - } - - _getMergeData() { - return { - trace: this.trace, - synthetics: this.synthetricsTraces - } - } - - getTraces() { - const traces = [].concat(this.syntheticsTraces) - const maxTraceSegments = this.config.max_trace_segments - if (this.trace) { - const trace = this.trace - if (trace.segmentsSeen > maxTraceSegments) { - logger.warn( - 'Transaction %s (%s) contained %d segments, only collecting the first %d', - trace.transaction.name, - trace.transaction.id, - trace.segmentsSeen, - maxTraceSegments - ) - } - this.noTraceSubmitted = 0 - traces.push(trace) - } else if (++this.noTraceSubmitted >= 5) { - this.resetTimingTracker() - } - return traces.length === 0 ? null : traces - } - - _toPayloadSync() { - const traces = this.getTraces() - if (!traces) { - logger.debug('No transaction traces to send.') - return null - } - - return [this.runId, traces.map((trace) => trace.generateJSONSync())] - } - - async _toPayload(callback) { - const traces = this.getTraces() - if (!traces) { - return callback(null, traces) - } - - const tracePromises = traces.map((trace) => { - return new Promise((resolve, reject) => { - trace.generateJSON((err, data) => { - if (err) { - reject(err) - } - resolve(data) - }) - }) - }) - - try { - const encodedTraces = await Promise.all(tracePromises) - callback(null, [this.runId, encodedTraces]) - } catch (err) { - callback(err) - } - } - - _afterSend(successful) { - if (successful) { - ++this.reported - } - } - - /** - * Determine whether a new trace is more worth keeping than an old one. - * This gets called on every single transactionFinished event, so return as - * quickly as possible and call as few external functions as possible. On the - * converse, there's some complicated logic here, so spell things out. - * - * All specifications are from - * https://newrelic.atlassian.net/wiki/display/eng/Transaction+Trace+Collection+Improvements - * - * @param {string} name Name of this transaction's key metric. - * @param {number} duration Time the transaction took, in milliseconds. - * @param {number} apdexT Apdex tolerating threshold, in seconds. - */ - isBetter(name, duration, apdexT) { - /* 1. If the transaction duration is below the tracing threshold, the - * transaction is skipped. - * - * The threshold for slow traces defaults to apdex_f, which is 4 * apdex_t. - */ - const config = this.config.transaction_tracer - let isOverThreshold - - if ( - config && - config.transaction_threshold != null && - config.transaction_threshold !== 'apdex_f' && - typeof config.transaction_threshold === 'number' - ) { - isOverThreshold = duration >= config.transaction_threshold * TO_MILLIS - } else { - isOverThreshold = duration >= 4 * TO_MILLIS * apdexT - } - if (!isOverThreshold) { - return false - } - - /* 2. If the transaction duration is less than the duration of the current - * slow transaction, the transaction is skipped. - */ - let slowerThanExisting = true - if (this.trace) { - slowerThanExisting = this.trace.getDurationInMillis() < duration - } - if (!slowerThanExisting) { - return false - } - - /* We always gather some slow transactions at the start, regardless of - * the size of Top N. This changes the behavior of the rest of the - * decision-making process in some subtle ways. - */ - const hasMetGuarantee = this.reported >= 5 - - /* 3. If the transaction's name is in the transaction map and its duration - * is less than the response time in the map, it is skipped. - */ - let slowerThanCaptured = true - if (hasMetGuarantee && this.requestTimes[name]) { - slowerThanCaptured = this.requestTimes[name] < duration - } - if (!slowerThanCaptured) { - return false - } - - /* Not part of enumerated rules, but necessary for Top N support: - * Ensure this name is either already in the request time map - * or that the map still hasn't hit capacity. - */ - return !( - hasMetGuarantee && - !this.requestTimes[name] && - Object.keys(this.requestTimes).length >= this.capacity - ) - } -} - -module.exports = TransactionTraceAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/exclusive-time-calculator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/exclusive-time-calculator.js deleted file mode 100644 index fd2fb022e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/exclusive-time-calculator.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -class ExclusiveCalculator { - constructor(root) { - this.toProcess = [root] - // use a second stack to do a post-order traversal - this.parentStack = [] - } - - /** - * Kicks off the exclusive duration calculation. This is performed - * using a depth first, postorder traversal over the tree. - */ - process() { - while (this.toProcess.length) { - const segment = this.toProcess.pop() - const children = segment.getChildren() - // when we hit a leaf, calc the exclusive time and report the time - // range to the parent - if (children.length === 0) { - segment._exclusiveDuration = segment.getDurationInMillis() - if (this.parentStack.length) { - this.finishLeaf(segment.timer.toRange()) - } - } else { - // in the case we are processing an internal node, we just push it on the stack - // and push its children to be processed. all processing will be done after its - // children are all done (i.e. postorder) - this.parentStack.push({ - childrenLeft: children.length, - segment: segment, - childPairs: [] - }) - for (let i = children.length - 1; i >= 0; --i) { - this.toProcess.push(children[i]) - } - } - } - } - - /** - * Updates the immediate parent in the parent stack that a leaf node has - * been processed. If the parent isn't expecting any more children to - * be processed, it pops the stack and propagates the processing to - * more distant predecessors. - * - * @param {Array} childRange An array of start and end time for the finished leaf node - */ - finishLeaf(childRange) { - let parent = this.parentStack[this.parentStack.length - 1] - // push the current segment's range pair up to the parent's child pairs - parent.childPairs = merge(parent.childPairs, [childRange]) - // decrement the number of children expected for the current parent; process the - // parent if it is not expecting any further children to finish (i.e. the number - // of children left to process is 0). - while (--parent.childrenLeft === 0) { - // pull off the finished parent and assign the exclusive duration - const { segment: finishedParent, childPairs } = this.parentStack.pop() - const timer = finishedParent.timer - const finishedEnd = timer.getDurationInMillis() + timer.start - let duration = finishedParent.getDurationInMillis() - for (let i = 0; i < childPairs.length; ++i) { - const pair = childPairs[i] - // since these are non-overlapping and ordered by start time, the first one - // to start after the parent's end marks the end of the segments we care - // about. - if (pair[0] >= finishedEnd) { - break - } - duration -= Math.min(pair[1], finishedEnd) - pair[0] - } - - finishedParent._exclusiveDuration = duration - parent = this.parentStack[this.parentStack.length - 1] - // since the parent was potentially a child of another segment, we need to - // rerun this for the parent's parent till we hit a parent with children yet - // to be processed. - if (parent) { - // merge the current child segments in with the finished parent's range - const inserted = merge(childPairs, [finishedParent.timer.toRange()]) - // merge the finished parent's merged range into its parent's range - parent.childPairs = merge(parent.childPairs, inserted) - } else { - // in the case where the parent doesn't exist, we are done and can break out. - break - } - } - } -} - -function merge(first, second) { - if (!first.length) { - return second - } - - if (!second.length) { - return first - } - - const res = [] - let resIdx = 0 - let firstIdx = 0 - let secondIdx = 0 - // N.B. this is destructive, it will be updating the end times for range arrays in - // the input arrays. If we need to reuse these arrays for anything, this behavior - // must be changed. - let currInterval = - first[firstIdx][0] < second[secondIdx][0] ? first[firstIdx++] : second[secondIdx++] - - while (firstIdx < first.length && secondIdx < second.length) { - const next = first[firstIdx][0] < second[secondIdx][0] ? first[firstIdx++] : second[secondIdx++] - if (next[0] <= currInterval[1]) { - // if the segment overlaps, update the end of the current merged segment - currInterval[1] = Math.max(next[1], currInterval[1]) - } else { - // if there is no overlap, start a new merging segment and push the old one - res[resIdx++] = currInterval - currInterval = next - } - } - - const firstIsRemainder = firstIdx !== first.length - const remainder = firstIsRemainder ? first : second - let remainderIdx = firstIsRemainder ? firstIdx : secondIdx - - // merge the segments overlapping with the current interval - while (remainder[remainderIdx] && remainder[remainderIdx][0] <= currInterval[1]) { - currInterval[1] = Math.max(remainder[remainderIdx++][1], currInterval[1]) - } - - res[resIdx++] = currInterval - - // append the remaining non-overlapping ranges - for (; remainderIdx < remainder.length; ++remainderIdx) { - res[resIdx++] = remainder[remainderIdx] - } - - return res -} - -module.exports = ExclusiveCalculator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/index.js deleted file mode 100644 index 192a466af..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/index.js +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const codec = require('../../util/codec') -const urltils = require('../../util/urltils') -const Segment = require('./segment') -const { Attributes, MAXIMUM_CUSTOM_ATTRIBUTES } = require('../../attributes') -const logger = require('../../logger').child({ component: 'trace' }) - -const { DESTINATIONS } = require('../../config/attribute-filter') -const FROM_MILLIS = 1e-3 -const ATTRIBUTE_SCOPE = 'transaction' - -const REQUEST_URI_KEY = 'request.uri' -const UNKNOWN_URI_PLACEHOLDER = '/Unknown' - -/** - * A Trace holds the root of the Segment graph and produces the final - * serialization of the transaction trace. - * - * @param {Transaction} transaction The transaction bound to the trace. - */ -function Trace(transaction) { - if (!transaction) { - throw new Error('All traces must be associated with a transaction.') - } - - this.transaction = transaction - - this.root = new Segment(transaction, 'ROOT') - this.root.start() - - this.intrinsics = Object.create(null) - this.segmentsSeen = 0 - this.totalTimeCache = null - - this.custom = new Attributes(ATTRIBUTE_SCOPE, MAXIMUM_CUSTOM_ATTRIBUTES) - this.attributes = new Attributes(ATTRIBUTE_SCOPE) - - // sending displayName if set by user - const displayName = transaction.agent.config.getDisplayHost() - const hostName = transaction.agent.config.getHostnameSafe() - if (displayName !== hostName) { - this.attributes.addAttribute(DESTINATIONS.TRANS_COMMON, 'host.displayName', displayName) - - this.displayName = displayName - } - this.domain = null -} - -/** - * End and close the current trace. Triggers metric recording for trace - * segments that support recording. - */ -Trace.prototype.end = function end() { - const segments = [this.root] - - while (segments.length) { - const segment = segments.pop() - segment.finalize() - - const children = segment.getChildren() - for (let i = 0; i < children.length; ++i) { - segments.push(children[i]) - } - } -} - -/** - * Iterates over the trace tree and generates a span event for each segment. - */ -Trace.prototype.generateSpanEvents = function generateSpanEvents() { - const config = this.transaction.agent.config - - if (!shouldGenerateSpanEvents(config, this.transaction)) { - return - } - const toProcess = [] - - // Root segment does not become a span, so we need to process it separately. - const spanAggregator = this.transaction.agent.spanEventAggregator - - const children = this.root.getChildren() - - if (children.length > 0) { - // At the point where these attributes are available, we only have a - // root span. Adding attributes to first non-root span here. - const attributeMap = { - 'host.displayName': this.displayName, - 'parent.type': this.transaction.parentType, - 'parent.app': this.transaction.parentApp, - 'parent.account': this.transaction.parentAcct, - 'parent.transportType': this.transaction.parentTransportType, - 'parent.transportDuration': this.transaction.parentTransportDuration - } - - for (const [key, value] of Object.entries(attributeMap)) { - if (value !== null) { - children[0].addSpanAttribute(key, value) - } - } - } - - for (let i = 0; i < children.length; ++i) { - toProcess.push(new DTTraceNode(children[i], this.transaction.parentSpanId, true)) - } - - while (toProcess.length) { - const segmentInfo = toProcess.pop() - const segment = segmentInfo.segment - - // Even though at some point we might want to stop adding events because all the priorities - // should be the same, we need to count the spans as seen. - spanAggregator.addSegment(segment, segmentInfo.parentId, segmentInfo.isRoot) - - const nodes = segment.getChildren() - for (let i = 0; i < nodes.length; ++i) { - const node = new DTTraceNode(nodes[i], segment.id) - toProcess.push(node) - } - } -} - -function shouldGenerateSpanEvents(config, txn) { - if (!config.distributed_tracing.enabled) { - return false - } - if (!config.span_events.enabled) { - return false - } - - const infiniteTracingConfigured = Boolean(config.infinite_tracing.trace_observer.host) - return infiniteTracingConfigured || txn.sampled -} - -function DTTraceNode(segment, parentId, isRoot = false) { - this.segment = segment - this.parentId = parentId - this.isRoot = isRoot -} - -/** - * Add a child to the list of segments. - * - * @param {string} childName Name for the new segment. - * @param {Function} callback Callback function to record metrics related to the trace - * @returns {Segment} Newly-created Segment. - */ -Trace.prototype.add = function add(childName, callback) { - return this.root.add(childName, callback) -} - -/** - * Explicitly set a trace's runtime instead of using it as a stopwatch. - * (As a byproduct, stops the timer.) - * - * @param {number} duration Duration of this particular trace. - * @param {number} startTimeInMillis (optional) Start of this trace. - */ -Trace.prototype.setDurationInMillis = setDurationInMillis - -function setDurationInMillis(duration, startTimeInMillis) { - this.root.setDurationInMillis(duration, startTimeInMillis) -} - -/** - * @returns {number} The amount of time the trace took, in milliseconds. - */ -Trace.prototype.getDurationInMillis = function getDurationInMillis() { - return this.root.getDurationInMillis() -} - -/** - * Adds given key-value pair to trace's custom attributes, if it passes filtering rules. - * - * @param {string} key - The attribute name. - * @param {string} value - The attribute value. - */ -Trace.prototype.addCustomAttribute = function addCustomAttribute(key, value) { - if (this.custom.has(key)) { - logger.debug( - 'Potentially changing custom attribute %s from %s to %s.', - key, - this.custom.attributes[key].value, - value - ) - } - - this.custom.addAttribute(DESTINATIONS.TRANS_SCOPE, key, value) -} - -/** - * The duration of the transaction trace tree that only this level accounts - * for. - * - * @returns {number} The amount of time the trace took, minus any child - * traces, in milliseconds. - */ -Trace.prototype.getExclusiveDurationInMillis = function getExclusiveDurationInMillis() { - return this.root.getExclusiveDurationInMillis() -} - -/** - * The duration of all segments in a transaction trace. The root is not - * accounted for, since it doesn't represent a unit of work. - * - * @returns {number} The sum of durations for all segments in a trace in - * milliseconds - */ -Trace.prototype.getTotalTimeDurationInMillis = function getTotalTimeDurationInMillis() { - if (this.totalTimeCache !== null) { - return this.totalTimeCache - } - if (this.root.children.length === 0) { - return 0 - } - let segments = this.root.getChildren() - let totalTimeInMillis = 0 - - while (segments.length !== 0) { - const segment = segments.pop() - totalTimeInMillis += segment.getExclusiveDurationInMillis() - segments = segments.concat(segment.getChildren()) - } - - if (!this.transaction.isActive()) { - this.totalTimeCache = totalTimeInMillis - } - return totalTimeInMillis -} - -/** - * The serializer is asynchronous, so serialization is as well. - * - * The transaction trace sent to the collector is a nested set of arrays. The - * outermost array has the following fields, in order: - * - * 0: start time of the trace, in milliseconds - * 1: duration, in milliseconds - * 2: the path, or root metric name - * 3: the URL (fragment) for this trace - * 4: an array of segment arrays, deflated and then base64 encoded - * 5: the guid for this transaction, used to correlate across - * transactions - * 6: reserved for future use, specified to be null for now - * 7: FIXME: RUM2 force persist flag - * - * In addition, there is a "root node" (not the same as the first child, which - * is a node with the special name ROOT and contents otherwise identical to the - * top-level segment of the actual trace) with the following fields: - * - * 0: start time IN SECONDS - * 1: a dictionary containing request parameters - * 2: a dictionary containing custom parameters (currently not user-modifiable) - * 3: the transaction trace segments (including the aforementioned root node) - * 4: FIXME: a dictionary containing "parameter groups" with special information - * related to this trace - * - * @param {Function} callback Called after serialization with either - * an error (in the first parameter) or - * the serialized transaction trace. - */ -Trace.prototype.generateJSON = function generateJSON(callback) { - const serializedTrace = this._serializeTrace() - - const trace = this - if (!this.transaction.agent.config.simple_compression) { - codec.encode(serializedTrace, respond) - } else { - setImmediate(respond, null, serializedTrace) - } - - function respond(err, data) { - if (err) { - return callback(err, null, null) - } - - return callback(null, trace._generatePayload(data), trace) - } -} - -/** - * This is the synchronous version of Trace#generateJSON - * - * @returns {object} JSON payload - */ -Trace.prototype.generateJSONSync = function generateJSONSync() { - const serializedTrace = this._serializeTrace() - const shouldCompress = !this.transaction.agent.config.simple_compression - const data = shouldCompress ? codec.encodeSync(serializedTrace) : serializedTrace - return this._generatePayload(data) -} - -/** - * Generates the payload used in a trace harvest. - * - * @private - * @param {string} data base64 string, from zlib.deflateSync - * @returns {Array} The formatted payload. - */ -Trace.prototype._generatePayload = function _generatePayload(data) { - let syntheticsResourceId = null - if (this.transaction.syntheticsData) { - syntheticsResourceId = this.transaction.syntheticsData.resourceId - } - - const requestUri = this._getRequestUri() - - return [ - this.root.timer.start, // start - this.transaction.getResponseTimeInMillis(), // response time - this.transaction.getFullName(), // path - requestUri, // request.uri - data, // encodedCompressedData - this.transaction.id, // guid - null, // reserved for future use - false, // forcePersist - null, // xraySessionId - syntheticsResourceId // synthetics resource id - ] -} - -/** - * Returns the transaction URL if attribute is not excluded globally or - * for transaction traces. Returns '/Unknown' if included but not known. - * - * The URI on a trace is a special attribute. It is included as a positional field, - * not as an "agent attribute", to avoid having to decompress on the backend. - * But it still needs to be gated by the same attribute exclusion/inclusion - * rules so sensitive information can be removed. - * - * @returns {string} requestUri - */ -Trace.prototype._getRequestUri = function _getRequestUri() { - const canAddUri = this.attributes.hasValidDestination(DESTINATIONS.TRANS_TRACE, REQUEST_URI_KEY) - let requestUri = null // must be null if excluded - if (canAddUri) { - // obfuscate the path if config is set - const url = urltils.obfuscatePath(this.transaction.agent.config, this.transaction.url) - requestUri = url || UNKNOWN_URI_PLACEHOLDER - } - - return requestUri -} - -/** - * Serializes the trace into the expected JSON format to be sent. - * - * @private - * @returns {Array} Serialized trace data. - */ -Trace.prototype._serializeTrace = function _serializeTrace() { - const attributes = { - agentAttributes: this.attributes.get(DESTINATIONS.TRANS_TRACE), - userAttributes: this.custom.get(DESTINATIONS.TRANS_TRACE), - intrinsics: this.intrinsics - } - - return [ - this.root.timer.start * FROM_MILLIS, - {}, // moved to agentAttributes - { - // hint to RPM for how to display this trace's segments - nr_flatten_leading: false - }, // moved to userAttributes - this.root.toJSON(), - attributes, - [] // FIXME: parameter groups - ] -} - -module.exports = Trace diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/segment.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/segment.js deleted file mode 100644 index 3d95c7412..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/trace/segment.js +++ /dev/null @@ -1,471 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const { DESTINATIONS } = require('../../config/attribute-filter') -const logger = require('../../logger').child({ component: 'segment' }) -const Timer = require('../../timer') -const urltils = require('../../util/urltils') -const hashes = require('../../util/hashes') - -const { Attributes } = require('../../attributes') -const ExclusiveCalculator = require('./exclusive-time-calculator') -const SpanContext = require('../../spans/span-context') - -const NAMES = require('../../metrics/names') -const INSTANCE_UNKNOWN = 'unknown' -const STATE = { - EXTERNAL: 'EXTERNAL', - CALLBACK: 'CALLBACK' -} -const ATTRIBUTE_SCOPE = 'segment' - -/** - * Initializes the segment and binds the recorder to itself, if provided. - * - * @class - * @classdesc - * TraceSegments are inserted to track instrumented function calls. Each one is - * bound to a transaction, given a name (used only internally to the framework - * for now), and has one or more children (that are also part of the same - * transaction), as well as an associated timer. - * @param {Transaction} transaction - * The transaction to which this segment will be bound. - * @param {string} name - * Human-readable name for this segment (e.g. 'http', 'net', 'express', - * 'mysql', etc). - * @param {?Function} recorder - * Callback that takes a segment and a scope name as attributes (intended to be - * used to record metrics related to the segment). - */ -function TraceSegment(transaction, name, recorder) { - this.name = name - this.transaction = transaction - - ++transaction.numSegments - ++transaction.agent.totalActiveSegments - ++transaction.agent.segmentsCreatedInHarvest - - if (recorder) { - transaction.addRecorder(recorder.bind(null, this)) - } - - this.attributes = new Attributes(ATTRIBUTE_SCOPE) - - this.children = [] - - // Generate a unique id for use in span events. - this.id = hashes.makeId() - this.timer = new Timer() - - this.internal = false - this.opaque = false - this.shim = null - - // hidden class optimization - this.partialName = null - this._exclusiveDuration = null - this._collect = true - this.host = null - this.port = null - this.state = STATE.EXTERNAL - this.async = true - this.ignore = false - - this.probe('new TraceSegment') -} - -TraceSegment.prototype.getSpanContext = function getSpanContext() { - const config = this.transaction.agent.config - const spansEnabled = config.distributed_tracing.enabled && config.span_events.enabled - - if (!this._spanContext && spansEnabled) { - this._spanContext = new SpanContext() - } - - return this._spanContext -} - -TraceSegment.prototype.addAttribute = function addAttribute(key, value, truncateExempt = false) { - this.attributes.addAttribute(DESTINATIONS.SEGMENT_SCOPE, key, value, truncateExempt) -} - -TraceSegment.prototype.addSpanAttribute = function addSpanAttribute( - key, - value, - truncateExempt = false -) { - this.attributes.addAttribute(DESTINATIONS.SPAN_EVENT, key, value, truncateExempt) -} - -TraceSegment.prototype.addSpanAttributes = function addSpanAttributes(attributes) { - this.attributes.addAttributes(DESTINATIONS.SPAN_EVENT, attributes) -} - -TraceSegment.prototype.getAttributes = function getAttributes() { - return this.attributes.get(DESTINATIONS.TRANS_SEGMENT) -} - -TraceSegment.prototype.getSpanId = function getSpanId() { - const conf = this.transaction.agent.config - const enabled = conf.span_events.enabled && conf.distributed_tracing.enabled - if (enabled) { - return this.id - } - - return null -} - -/** - * @param {string} host - * The name of the host of the database. This will be normalized if the string - * represents localhost. - * @param {string|number} port - * The database's port, path to unix socket, or id. - * @param {string|number|bool} database - * The name or ID of the database that was connected to. Or `false` if there is - * no database name (i.e. Redis has no databases, only hosts). - */ -TraceSegment.prototype.captureDBInstanceAttributes = captureDBInstanceAttributes - -function captureDBInstanceAttributes(host, port, database) { - const config = this.transaction.agent.config - const dsTracerConf = config.datastore_tracer - - // Add database name if provided and enabled. - if (database !== false && dsTracerConf.database_name_reporting.enabled) { - this.addAttribute( - 'database_name', - typeof database === 'number' ? database : database || INSTANCE_UNKNOWN - ) - } - - // Add instance information if enabled. - if (dsTracerConf.instance_reporting.enabled) { - // Determine appropriate defaults for host and port. - port = port || INSTANCE_UNKNOWN - if (host && urltils.isLocalhost(host)) { - host = config.getHostnameSafe(host) - } - if (!host || host === 'UNKNOWN_BOX') { - // Config's default name of a host. - host = INSTANCE_UNKNOWN - } - - this.addAttribute('host', host) - this.addAttribute('port_path_or_id', String(port)) - } -} - -TraceSegment.prototype.moveToCallbackState = function moveToCallbackState() { - this.state = STATE.CALLBACK -} - -TraceSegment.prototype.isInCallbackState = function isInCallbackState() { - return this.state === STATE.CALLBACK -} - -TraceSegment.prototype.probe = function probe(action) { - if (this.transaction.traceStacks) { - this.transaction.probe(action, { segment: this.name }) - } -} - -/** - * For use when a transaction is ending. The transaction segment should - * be named after the transaction it belongs to (which is only known by - * the end). - */ -TraceSegment.prototype.setNameFromTransaction = function setNameFromTransaction() { - const transaction = this.transaction - - // transaction name and transaciton segment name must match - this.name = transaction.getFullName() - - // partialName is used to name apdex metrics when recording - this.partialName = transaction._partialName -} - -/** - * Once a transaction is named, the web segment also needs to be updated to - * match it (which implies this method must be called subsequent to - * transaction.finalizeNameFromUri). To properly name apdex metrics during metric - * recording, it's also necessary to copy the transaction's partial name. And - * finally, marking the trace segment as being a web segment copies the - * segment's parameters onto the transaction. - */ -TraceSegment.prototype.markAsWeb = function markAsWeb() { - const transaction = this.transaction - this.setNameFromTransaction() - - const traceAttrs = transaction.trace.attributes.get(DESTINATIONS.TRANS_TRACE) - Object.keys(traceAttrs).forEach((key) => { - if (!this.attributes.has(key)) { - this.addAttribute(key, traceAttrs[key]) - } - }) -} - -/** - * A segment attached to something evented (such as a database - * cursor) just finished an action, so set the timer to mark - * the timer as having a stop time. - */ -TraceSegment.prototype.touch = function touch() { - this.probe('Touched') - this.timer.touch() - this._updateRootTimer() -} - -TraceSegment.prototype.overwriteDurationInMillis = overwriteDurationInMillis -function overwriteDurationInMillis(duration, start) { - this.timer.overwriteDurationInMillis(duration, start) -} - -TraceSegment.prototype.start = function start() { - this.timer.begin() -} - -/** - * Stop timing the related action. - */ -TraceSegment.prototype.end = function end() { - if (!this.timer.isActive()) { - return - } - this.probe('Ended') - this.timer.end() - this._updateRootTimer() -} - -TraceSegment.prototype.finalize = function finalize() { - if (this.timer.softEnd()) { - this._updateRootTimer() - // timer.softEnd() returns true if the timer was ended prematurely, so - // in that case we can name the segment as truncated - this.name = NAMES.TRUNCATED.PREFIX + this.name - } - - this.addAttribute('nr_exclusive_duration_millis', this.getExclusiveDurationInMillis()) -} - -/** - * Helper to set the end of the root timer to this segment's root if it is later - * in time. - */ -TraceSegment.prototype._updateRootTimer = function _updateRootTimer() { - const root = this.transaction.trace.root - if (this.timer.endsAfter(root.timer)) { - const newDuration = this.timer.start + this.getDurationInMillis() - root.timer.start - root.overwriteDurationInMillis(newDuration) - } -} - -/** - * Test to see if underlying timer is still active - * - * @returns {boolean} true if no longer active, else false. - */ -TraceSegment.prototype._isEnded = function _isEnded() { - return !this.timer.isActive() || this.timer.touched -} - -/** - * Add a new segment to a scope implicitly bounded by this segment. - * - * @param {string} childName New human-readable name for the segment. - * @param recorder - * @returns {TraceSegment} New nested TraceSegment. - */ -TraceSegment.prototype.add = function add(childName, recorder) { - if (this.opaque) { - logger.trace('Skipping child addition on opaque segment') - return this - } - logger.trace('Adding segment %s to %s in %s', childName, this.name, this.transaction.id) - const segment = new TraceSegment(this.transaction, childName, recorder) - const config = this.transaction.agent.config - - if (this.transaction.trace.segmentsSeen++ >= config.max_trace_segments) { - segment._collect = false - } - this.children.push(segment) - - if (config.debug && config.debug.double_linked_transactions) { - segment.parent = this - } - - return segment -} - -/** - * Set the duration of the segment explicitly. - * - * @param {number} duration Duration in milliseconds. - */ -TraceSegment.prototype.setDurationInMillis = setDurationInMillis - -function setDurationInMillis(duration, start) { - this.timer.setDurationInMillis(duration, start) -} - -TraceSegment.prototype.getDurationInMillis = function getDurationInMillis() { - return this.timer.getDurationInMillis() -} - -/** - * Only for testing! - * - * @param {number} duration Milliseconds of exclusive duration. - */ -TraceSegment.prototype._setExclusiveDurationInMillis = _setExclusiveDurationInMillis - -function _setExclusiveDurationInMillis(duration) { - this._exclusiveDuration = duration -} - -/** - * The duration of the transaction trace tree that only this level accounts - * for. - * - * @returns {integer} The amount of time the trace took, minus any child - * segments, in milliseconds. - */ -TraceSegment.prototype.getExclusiveDurationInMillis = getExclusiveDurationInMillis - -function getExclusiveDurationInMillis() { - if (this._exclusiveDuration == null) { - // Calculate the exclusive time for the subtree rooted at `this` - const calculator = new ExclusiveCalculator(this) - calculator.process() - } - return this._exclusiveDuration -} - -TraceSegment.prototype.getChildren = function getChildren() { - const children = [] - for (let i = 0, len = this.children.length; i < len; ++i) { - if (!this.children[i].ignore) { - children.push(this.children[i]) - } - } - return children -} - -TraceSegment.prototype.getCollectedChildren = function getCollectedChildren() { - const children = [] - for (let i = 0, len = this.children.length; i < len; ++i) { - if (this.children[i]._collect && !this.children[i].ignore) { - children.push(this.children[i]) - } - } - return children -} - -/** - * Enumerate the timings of this segment's descendants. - * - * @param {number} end The end of this segment, to keep the calculated - * duration from exceeding the duration of the - * parent. Defaults to Infinity. - * @returns {Array} Unsorted list of [start, end] pairs, with no pair - * having an end greater than the passed in end time. - */ -TraceSegment.prototype._getChildPairs = function _getChildPairs(end) { - // quick optimization - if (this.children.length < 1) { - return [] - } - if (!end) { - end = Infinity - } - - let children = this.getChildren() - const childPairs = [] - while (children.length) { - const child = children.pop() - const pair = child.timer.toRange() - - if (pair[0] >= end) { - continue - } - - children = children.concat(child.getChildren()) - - pair[1] = Math.min(pair[1], end) - childPairs.push(pair) - } - - return childPairs -} - -/** - * This is perhaps the most poorly-documented element of transaction traces: - * what do each of the segment representations look like prior to encoding? - * Spelunking in the code for the other agents has revealed that each child - * node is an array with the following field in the following order: - * - * 0: entry timestamp relative to transaction start time - * 1: exit timestamp - * 2: metric name - * 3: parameters as a name -> value JSON dictionary - * 4: any child segments - * - * Other agents include further fields in this. I haven't gotten to the bottom - * of all of them (and Ruby, of course, sends marshalled Ruby object), but - * here's what I know so far: - * - * in Java: - * 5: class name - * 6: method name - * - * in Python: - * 5: a "label" - * - * FIXME: I don't know if it makes sense to add custom fields for Node. TBD - */ -TraceSegment.prototype.toJSON = function toJSON() { - // use depth-first search on the segment tree using stack - const resultDest = [] - // array of objects relating a segment and the destination for its - // serialized data. - const segmentsToProcess = [ - { - segment: this, - destination: resultDest - } - ] - - while (segmentsToProcess.length !== 0) { - const { segment, destination } = segmentsToProcess.pop() - - const start = segment.timer.startedRelativeTo(segment.transaction.trace.root.timer) - const duration = segment.getDurationInMillis() - - const segmentChildren = segment.getCollectedChildren() - const childArray = [] - - // push serialized data into the specified destination - destination.push([start, start + duration, segment.name, segment.getAttributes(), childArray]) - - if (segmentChildren.length) { - // push the children and the parent's children array into the stack. - // to preserve the chronological order of the children, push them - // onto the stack backwards (so the first one created is on top). - for (let i = segmentChildren.length - 1; i >= 0; --i) { - segmentsToProcess.push({ - segment: segmentChildren[i], - destination: childArray - }) - } - } - } - - // pull the result out of the array we serialized it into - return resultDest[0] -} - -module.exports = TraceSegment diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/tracecontext.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/tracecontext.js deleted file mode 100644 index afe0750a8..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/tracecontext.js +++ /dev/null @@ -1,607 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'TraceContext' }) -const hashes = require('../util/hashes') - -const TRACE_CONTEXT_PARENT_HEADER = 'traceparent' -const TRACE_CONTEXT_STATE_HEADER = 'tracestate' -const PARENT_TYPES = ['App', 'Browser', 'Mobile'] -const APP_PARENT_TYPE = PARENT_TYPES.indexOf('App') - -const W3C_TRACEPARENT_VERSION = '00' -const NR_TRACESTATE_VERSION = 0 - -// 255 (ff) explicitly not allowed for version -const VERSION_VALID_RGX = /^((?![f]{2})[a-f0-9]{2})$/ -const TRACEID_VALID_RGX = /^((?![0]{32})[a-f0-9]{32})$/ -const PARENTID_VALID_RGX = /^((?![0]{16})[a-f0-9]{16})$/ -const FLAGS_VALID_RGX = /^([a-f0-9]{2})$/ - -const FLAGS = { - sampled: 0x00000001 -} - -/** - * The class responsible for accepting, validating, and producing w3c tracecontext headers. - */ -class TraceContext { - /** - * Create a TraceContext object - * - * @param {Transaction} transaction - a transaction object to attach to. - */ - constructor(transaction) { - this.transaction = transaction - this.tracingVendors = null - this.trustedParentId = null - this._traceStateRaw = null - this.flags = { - get sampled() { - return transaction.sampled - } - } - } - - /** - * @returns {string} a W3C TraceContext traceparent header payload. - */ - createTraceparent() { - // In case we receive a trace ID that isn't the proper length, zero pad - let traceId = this.transaction.traceId - traceId = traceId.padStart(32, '0') - - // If we had to pad, there's a chance this is an invalid upper-case header - // originating from a newrelic format DT payload being accepted. - if (traceId !== this.transaction.traceId && !TRACEID_VALID_RGX.test(traceId)) { - traceId = traceId.toLowerCase() - } - - // If no segment/span is in context, generate one so we can have a valid traceparent - const segment = this.transaction.agent.tracer.getSegment() - let parentId = segment && segment.id - if (!parentId) { - parentId = hashes.makeId(16) - logger.debug( - 'No segment/span in context. Generated new traceparent parentId (%s) for traceId (%s)', - parentId, - traceId - ) - } - - return `${W3C_TRACEPARENT_VERSION}-${traceId}-${parentId}-${this.createFlagsHex()}` - } - - /** - * Creates a W3C TraceContext tracestate header payload. - * - * @returns {string} tracestate, a hyphen-delimited string of trace information fields - */ - createTracestate() { - const config = this.transaction.agent.config - const trustedAccountKey = config.trusted_account_key - const version = NR_TRACESTATE_VERSION - const parentType = APP_PARENT_TYPE - const appId = config.primary_application_id - const accountId = config.account_id - - if (!accountId || !appId || !trustedAccountKey) { - logger.debug( - 'Unable to create tracestate header due to missing required fields ' + - '(account_id: %s, primary_application_id: %s, trusted_account_key: %s) in transaction %s' + - 'This may occur if a trace is created prior to the agent fully starting.', - accountId, - appId, - trustedAccountKey, - this.transaction.id - ) - - this.transaction.agent.recordSupportability('TraceContext/TraceState/Create/Exception') - - return this._traceStateRaw || '' - } - - // If no segment/span is in context, we do not send one as - // we technically do not have a "span" on the agent side and - // this trace data is newrelic specific. - let spanId = '' - if (config.span_events.enabled) { - const segment = this.transaction.agent.tracer.getSegment() - if (segment) { - spanId = segment.id - } else { - logger.debug('No segment/span in context. Not sending spanId in tracestate.') - } - } else { - logger.trace('Span events disabled. Not sending spanId in tracestate.') - } - - const transactionId = config.transaction_events.enabled ? this.transaction.id : '' - const sampled = this.transaction.sampled ? '1' : '0' - const priority = this.transaction.priority ? this.transaction.priority.toFixed(6) : '' - const timestamp = Date.now() - - const nrTraceState = - `${trustedAccountKey}@nr=${version}-${parentType}-${accountId}` + - `-${appId}-${spanId}-${transactionId}-${sampled}-${priority}-${timestamp}` - - if (this._traceStateRaw) { - return `${nrTraceState},${this._traceStateRaw}` - } - - return nrTraceState - } - - /** - * Takes a headers object and modifies it in place by adding Trace Context headers - * - * @param {object} headers - Headers for an HTTP request - */ - addTraceContextHeaders(headers) { - if (!headers) { - return - } - - const traceParent = this.createTraceparent() - headers[TRACE_CONTEXT_PARENT_HEADER] = traceParent - - logger.trace('traceparent added with %s', traceParent) - - const tracestate = this.createTracestate() - if (tracestate) { - headers[TRACE_CONTEXT_STATE_HEADER] = tracestate - logger.trace('tracestate added with %s', tracestate) - } - - this.transaction.agent.recordSupportability('TraceContext/Create/Success') - } - - /** - * @typedef TraceContextData - * @property {boolean} acceptedTraceparent - Whether a W3C traceparent headers was - * parsed, validated, and accepted - * @property {boolean} acceptedTracestate - Whether a New Relic tracestate headers was - * parsed, validated, and accepted - * @property {boolean} entryValid - Whether the matching NR tracestate string is valid - * @property {Intrinsics} intrinsics - All the parts of the New Relic tracestate string - * parsed and split out into an object - * @property {string} newTraceState - The raw tracestate without the New Relic entry - */ - - /** - * Takes a TraceContext headers from an HTTP request, parses them, validates them, and - * applies the values to the internal state, returning an object with the - * relevant Trace Context data and validation information. - * - * @param {string} traceparent - W3C traceparent header from an HTTP request - * @param {string} tracestate - W3C tracestate header from an HTTP request - * @returns {object} returns an Object with the traceparent data and validation info - */ - acceptTraceContextPayload(traceparent, tracestate) { - const traceContextData = { - acceptedTraceparent: false, - acceptedTracestate: false, - acceptedNRTracestate: false, - traceId: null, - parentSpanId: null, - parentType: null, - accountId: null, - appId: null, - transactionId: null, - sampled: null, - priority: null, - transportDuration: null - } - - // - // Parsing traceparent - // - if (!traceparent) { - // From the W3C spec: If the vendor failed to parse traceparent, it MUST NOT - // attempt to parse tracestate - return traceContextData - } - - logger.trace('Accepting TraceContext for transaction %s', this.transaction.id) - const parsedParent = this._validateAndParseTraceParentHeader(traceparent) - - // Log if there is a version mismatch in traceparent - if (parsedParent.version !== W3C_TRACEPARENT_VERSION) { - logger.trace( - 'Incoming traceparent version: %s, agent traceparent version: %s', - parsedParent.version, - W3C_TRACEPARENT_VERSION - ) - } - - if (parsedParent.entryValid) { - logger.trace('Accepted traceparent for transaction %s', this.transaction.id) - traceContextData.acceptedTraceparent = true - - traceContextData.traceId = parsedParent.traceId - traceContextData.parentSpanId = parsedParent.parentId - } else { - logger.trace('Invalid traceparent for transaction %s: %s', this.transaction.id, traceparent) - - this.transaction.agent.recordSupportability('TraceContext/TraceParent/Parse/Exception') - // From the W3C spec: If the vendor failed to parse traceparent, it MUST NOT - // attempt to parse tracestate - return traceContextData - } - - // - // Parsing tracestate - // - if (!tracestate) { - logger.trace('No tracestate for transaction %s', this.transaction.id) - - return traceContextData - } - - const parsedState = this._validateAndParseTraceStateHeader(tracestate) - - if (!parsedState.traceStateValid) { - logger.trace('Invalid tracestate for transaction %s: %s', this.transaction.id, tracestate) - - this.transaction.agent.recordSupportability('TraceContext/TraceState/Parse/Exception') - return traceContextData - } - - // Keep the raw, non-NewRelic tracestate string stored so that we can propagate it - this._traceStateRaw = parsedState.newTraceState - - // These need to be kept to be added to root span events as an attribute - this.tracingVendors = parsedState.vendors - - if (parsedState.intrinsics && parsedState.intrinsics.version !== NR_TRACESTATE_VERSION) { - logger.trace( - 'Incoming tracestate version: %s, agent tracestate version: %s', - parsedState.intrinsics.version, - NR_TRACESTATE_VERSION - ) - } - - if (parsedState.entryValid) { - logger.trace('Accepted tracestate for transaction %s', this.transaction.id) - traceContextData.acceptedTracestate = true - - traceContextData.parentType = parsedState.intrinsics.parentType - traceContextData.accountId = parsedState.intrinsics.accountId - traceContextData.appId = parsedState.intrinsics.appId - traceContextData.transactionId = parsedState.intrinsics.transactionId - traceContextData.sampled = parsedState.intrinsics.sampled - traceContextData.priority = parsedState.intrinsics.priority - traceContextData.transportDuration = Math.max( - 0, - (Date.now() - parsedState.intrinsics.timestamp) / 1000 - ) - - this.trustedParentId = parsedState.intrinsics.spanId - this._traceStateRaw = parsedState.newTraceState - - this.transaction.agent.recordSupportability('TraceContext/Accept/Success') - } else if (parsedState.entryFound) { - logger.error('Invalid tracestate for transaction %s: %s', this.transaction.id, tracestate) - - this.transaction.agent.recordSupportability('TraceContext/TraceState/InvalidNrEntry') - } - - return traceContextData - } - - /** - * Validate a traceparent header string and return an object with the relevant parts - * parsed out if valid. - * - * @param {string} traceparent - a W3C traceparent header string - * @returns {object} returns an Object with the traceparent data and validation info - */ - _validateAndParseTraceParentHeader(traceparent) { - const traceParentInfo = { - entryValid: false, - version: null, - traceId: null, - parentId: null, - flags: null - } - - if (!traceparent) { - return traceParentInfo - } - - const trimmed = traceparent.trim() - const parts = trimmed.split('-') - - // No extra data allowed this version. - if (parts[0] === W3C_TRACEPARENT_VERSION && parts.length !== 4) { - return traceParentInfo - } - - const [version, traceId, parentId, flags] = parts - const isValid = - VERSION_VALID_RGX.test(version) && - TRACEID_VALID_RGX.test(traceId) && - PARENTID_VALID_RGX.test(parentId) && - FLAGS_VALID_RGX.test(flags) - - if (isValid) { - traceParentInfo.entryValid = true - traceParentInfo.version = version - traceParentInfo.traceId = traceId - traceParentInfo.parentId = parentId - traceParentInfo.flags = flags - } - - return traceParentInfo - } - - // Not used now, but will be useful when traceparent has more flags - parseFlagsHex(flags) { - const flagsInt = parseInt(flags, 16) - return Object.keys(FLAGS).reduce((o, key) => { - o[key] = Boolean(flagsInt & FLAGS[key]) - return o - }, {}) - } - - createFlagsHex() { - const flagsNum = Object.keys(this.flags).reduce((num, key) => { - if (this.flags[key]) { - num += FLAGS[key] - } - return num - }, 0) - return flagsNum.toString(16).padStart(2, '0') - } - - /** - * @typedef TraceStateData - * @property {boolean} entryFound - Whether a New Relic tracestate string with a match - * trusted account key field is found - * @property {boolean} entryValid - Whether the matching NR tracestate string is valid - * @property {string} entryInvalidReason - Why the tracestate did not validate - * @property {Intrinsics} intrinsics - All the parts of the New Relic tracestate string - * parsed and split out into an object - * @property {string} newTraceState - The raw tracestate without the New Relic entry - * @property {Array} vendors - All the vendor strings found in the tracestate - */ - - /** - * Accepts a W3C tracestate header string and returns an object with information about - * the validity and intrinsics of the parsed tracestate string - * - * @param {string} tracestate - A raw W3C tracestate header string - * @returns {TraceStateData} returns an object with validation information and - * instrinsics on any relevant New Relic tracestate strings found - */ - _validateAndParseTraceStateHeader(tracestate) { - const tsd = { - entryFound: false, - entryValid: undefined, - entryInvalidReason: undefined, - traceStateValid: undefined, - intrinsics: undefined, - newTraceState: undefined, - vendors: undefined - } - - // See if there's a New Relic Trace State - const trustedKey = this.transaction.agent.config.trusted_account_key - const hasTrustKey = Boolean(trustedKey) - const expectedNrKey = `${trustedKey}@nr` - - if (!hasTrustKey) { - logger.debug( - 'Unable to accept any New Relic tracestate list members. ' + - 'Missing trusted_account_key. ' + - 'This may occur if a trace is received prior to the agent fully starting.' - ) - - this.transaction.agent.recordSupportability('TraceContext/TraceState/Accept/Exception') - } - - const { finalListMembers, vendors, nrTraceStateValue, traceStateValid } = this._parseTraceState( - { tracestate, hasTrustKey, expectedNrKey } - ) - - tsd.traceStateValid = traceStateValid - - if (!traceStateValid) { - return tsd - } - - // Rebuild potentially cleaned-up listmembers - tsd.newTraceState = finalListMembers.join(',') - - if (vendors.length > 0) { - tsd.vendors = vendors.join(',') - } - - if (!hasTrustKey) { - return tsd - } - - if (nrTraceStateValue) { - tsd.entryFound = true - - const intrinsicsValidation = this._validateAndParseIntrinsics(nrTraceStateValue) - if (intrinsicsValidation.entryValid) { - tsd.entryValid = true - tsd.intrinsics = intrinsicsValidation - } else { - tsd.entryInvalidReason = intrinsicsValidation.invalidReason - tsd.entryValid = false - } - } else { - // TraceParent has been accepted, but no trustedKey on tracestate - this.transaction.agent.recordSupportability('TraceContext/TraceState/NoNrEntry') - } - - return tsd - } - - _parseTraceState(params) { - const { tracestate, hasTrustKey, expectedNrKey } = params - let nrTraceStateValue = null - const finalListMembers = [] - const vendors = [] - const incomingListMembers = tracestate.split(',') - for (let i = 0; i < incomingListMembers.length; i++) { - const listMember = incomingListMembers[i].trim() - - // Multiple tracestate headers may get combined. Empty headers - // can result in a header such as tracestate: 'foo=1, ' which - // should still be considered valid with the empty item discarded. - if (listMember !== '') { - const listMemberParts = listMember.split('=') - if (listMemberParts.length !== 2) { - logger.debug('Unable to parse tracestate list members.') - this.transaction.agent.recordSupportability( - 'TraceContext/TraceState/Parse/Exception/ListMember' - ) - - return { traceStateValid: false } - } - - const [vendorKey, vendorValue] = listMemberParts - if (hasTrustKey && vendorKey === expectedNrKey) { - // Matching members do not get added to vendors. - // We'll replace the first valid entry and drop the rest - // (which would be invalid members if they exist). - - // We only want the first one. - nrTraceStateValue = nrTraceStateValue || vendorValue - } else { - vendors.push(vendorKey) - - finalListMembers.push(listMember) - } - } - } - return { finalListMembers, vendors, nrTraceStateValue, traceStateValid: true } - } - - /** - * @typedef Intrinsics - * @property {number} version - TraceContext spec version used - * @property {number} parentType - The type of component that produced this tracestate - * @property {string} accountId New Relic account ID - * @property {string} appId ID of the application generating the trace header - * @property {string} spanId unique identifier for the span - * @property {string} transactionId unique identifier for the transaction - * @property {number} sampled - 1 or 0, whether the receiving agent should sample - * @property {number} priority - floating point of the priority the agent should use, - * rounded to 6 decimal places - * @property {number} timestamp - when the payload was created, milliseconds since epoch - * @property {boolean} entryValid - if all entries in the Intrinsics object is valid - */ - - /** - * Accepts a New Relic intrinsics string and returls a validation object w/ - * the validity and intrinsics of the tracestate - * - * @param {string} nrTracestateValue - The value part of a New Relic tracestate entry - * @returns {Intrinsics} returns an Intrinsics object with validation information and - * instrinsics on any relevant New Relic tracestate strings found - */ - _validateAndParseIntrinsics(nrTracestateValue) { - const intrinsics = this._parseIntrinsics(nrTracestateValue) - - // Functions that return true when the field is invalid - const isNull = (v) => v == null - const intrinsicInvalidations = { - version: isNaN, // required, int - parentType: isNull, // required, str - accountId: isNull, // required, str - appId: isNull, // required, str - sampled: (v) => (v == null ? false : isNaN(v)), // not required, int - priority: (v) => (v == null ? false : isNaN(v)), // not required, float - timestamp: isNaN // required, int - } - - // If a field is found invalid, flag the entry as not valid - intrinsics.entryValid = true - for (const key of Object.keys(intrinsicInvalidations)) { - const invalidation = intrinsicInvalidations[key] - if (invalidation && invalidation(intrinsics[key])) { - intrinsics.entryValid = false - intrinsics.entryInvalidReason = `${key} failed invalidation test` - } - } - - // Convert to types expected by Transaction - if (intrinsics.sampled != null) { - intrinsics.sampled = Boolean(intrinsics.sampled) - } - - intrinsics.parentType = PARENT_TYPES[intrinsics.parentType] - if (!intrinsics.parentType) { - intrinsics.entryValid = false - } - - return intrinsics - } - - /** - * Parses intrinsics of a New Relic tracestate entry's value - * - * @param {object} nrTracestateValue An object consisting of split value intrinsics derived from - * the trace state, having the form { version, parentType, accountId, appId, spanId, - * transactionId, sampled, priority, timestamp } - * @returns {object} Intrinsics: trace state information extracted from trace state value - */ - _parseIntrinsics(nrTracestateValue) { - const intrinsics = this._extractTraceStateIntrinsics(nrTracestateValue) - - const intrinsicConversions = { - version: parseInt, - parentType: parseInt, - - // these two can be null, don't try to parse a null - sampled: (v) => (v == null ? v : parseInt(v, 10)), - priority: (v) => (v == null ? v : parseFloat(v)), - - timestamp: parseInt - } - - for (const key of Object.keys(intrinsicConversions)) { - const conversion = intrinsicConversions[key] - if (conversion) { - intrinsics[key] = conversion(intrinsics[key]) - } - } - - return intrinsics - } - - _extractTraceStateIntrinsics(nrTracestate) { - const splitValues = nrTracestate.split('-') - - // convert empty strings to null - splitValues.forEach((value, i) => { - if (value === '') { - splitValues[i] = null - } - }) - - return { - version: splitValues[0], - parentType: splitValues[1], - accountId: splitValues[2], - appId: splitValues[3], - spanId: splitValues[4], - transactionId: splitValues[5], - sampled: splitValues[6], - priority: splitValues[7], - timestamp: splitValues[8] - } - } -} - -module.exports.TraceContext = TraceContext -module.exports.TRACE_CONTEXT_PARENT_HEADER = TRACE_CONTEXT_PARENT_HEADER -module.exports.TRACE_CONTEXT_STATE_HEADER = TRACE_CONTEXT_STATE_HEADER diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/tracer/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/tracer/index.js deleted file mode 100644 index 7caa05426..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/tracer/index.js +++ /dev/null @@ -1,488 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const Transaction = require('../index.js') -const logger = require('../../logger').child({ component: 'tracer' }) -const symbols = require('../../symbols') -const INACTIVE_TRANSACTION_MESSAGE = 'Not creating segment "%s" because no transaction was active' -const SKIP_WRAPPING_FUNCTION_MESSAGE = 'Not wrapping "%s" because it was not a function' -const CREATE_SEGMENT_MESSAGE = 'Creating "%s" segment for transaction %s.' -const { addCLMAttributes: maybeAddCLMAttributes } = require('../../util/code-level-metrics') - -module.exports = Tracer - -function Tracer(agent, contextManager) { - if (!agent) { - throw new Error('Must be initialized with an agent.') - } - - this.agent = agent - this._contextManager = contextManager -} - -Tracer.prototype.getTransaction = getTransaction -Tracer.prototype.getSegment = getSegment -Tracer.prototype.getSpanContext = getSpanContext -Tracer.prototype.createSegment = createSegment -Tracer.prototype.addSegment = addSegment -Tracer.prototype.transactionProxy = transactionProxy -Tracer.prototype.transactionNestProxy = transactionNestProxy -Tracer.prototype.bindFunction = bindFunction -Tracer.prototype.bindEmitter = bindEmitter -Tracer.prototype.getOriginal = getOriginal -Tracer.prototype.slice = argSlice -Tracer.prototype.wrapFunctionNoSegment = wrapFunctionNoSegment -Tracer.prototype.wrapFunctionFirstNoSegment = wrapFunctionFirstNoSegment -Tracer.prototype.wrapFunction = wrapFunction -Tracer.prototype.wrapFunctionLast = wrapFunctionLast -Tracer.prototype.wrapFunctionFirst = wrapFunctionFirst -Tracer.prototype.wrapSyncFunction = wrapSyncFunction -Tracer.prototype.wrapCallback = wrapCallback - -function getTransaction() { - const currentSegment = this._contextManager.getContext() - if (currentSegment && currentSegment.transaction && currentSegment.transaction.isActive()) { - return currentSegment.transaction - } - - return null -} - -// TODO: Remove/replace external uses to tracer.getSegment() -function getSegment() { - return this._contextManager.getContext() -} - -// TODO: Remove/replace external uses to tracer.getSpanContext() -function getSpanContext() { - const currentSegment = this.getSegment() - return currentSegment && currentSegment.getSpanContext() -} - -function createSegment(name, recorder, _parent) { - const parent = _parent || this.getSegment() - if (!parent || !parent.transaction.isActive()) { - logger.trace( - { - hasParent: !!parent, - transactionActive: parent && parent.transaction.isActive() - }, - 'Not creating segment %s, no parent or active transaction available.', - name - ) - return null - } - return parent.add(name, recorder) -} - -function addSegment(name, recorder, parent, full, task) { - if (typeof task !== 'function') { - throw new Error('task must be a function') - } - - const segment = this.createSegment(name, recorder, parent) - - maybeAddCLMAttributes(task, segment) - return this.bindFunction(task, segment, full)(segment) -} - -function transactionProxy(handler) { - // if there's no handler, there's nothing to proxy. - if (typeof handler !== 'function') { - return handler - } - - const tracer = this - const wrapped = function wrapTransactionInvocation() { - if (!tracer.agent.canCollectData()) { - return handler.apply(this, arguments) - } - - // don't nest transactions, reuse existing ones - const segment = tracer.getSegment() - if (segment) { - if (segment.transaction.traceStacks) { - segment.probe('!!! Nested transaction creation !!!') - segment.transaction.traceFlag = true // Will log the stacks when it ends. - } - logger.warn( - { - transaction: { id: segment.transaction.id, name: segment.transaction.getName() }, - segment: segment.name - }, - 'Active transaction when creating non-nested transaction' - ) - tracer.agent.recordSupportability('Nodejs/Transactions/Nested') - return handler.apply(this, arguments) - } - const transaction = new Transaction(tracer.agent) - return tracer.bindFunction(handler, transaction.trace.root, true).apply(this, arguments) - } - - wrapped[symbols.original] = handler - - return wrapped -} - -/** - * Use transactionNestProxy to wrap a closure that is a top-level handler that - * is meant to start transactions. This wraps the first half of asynchronous - * handlers. Use bindFunction to wrap handler callbacks. This detects to see - * if there is an in play segment and uses that as the root instead of - * transaction.trace.root. - * - * @param {string} type - Type of transaction to create. 'web' or 'bg'. - * @param {Function} handler - Generator to proxy. - * @returns {Function} Proxy. - */ -function transactionNestProxy(type, handler) { - if (handler === undefined && typeof type === 'function') { - handler = type - type = undefined - } - // if there's no handler, there's nothing to proxy. - if (typeof handler !== 'function') { - return handler - } - - const tracer = this - const wrapped = function wrapTransactionInvocation() { - if (!tracer.agent.canCollectData()) { - return handler.apply(this, arguments) - } - - // don't nest transactions, reuse existing ones - let transaction = tracer.getTransaction() - let segment = tracer.getSegment() - - let createNew = false - - if (!transaction || transaction.type !== type) { - createNew = true - } - - if (createNew) { - transaction = new Transaction(tracer.agent) - transaction.type = type - segment = transaction.trace.root - } - - return tracer.bindFunction(handler, segment).apply(this, arguments) - } - - wrapped[symbols.original] = handler - - return wrapped -} - -function bindFunction(handler, segment, full) { - if (typeof handler !== 'function') { - return handler - } - - return _makeWrapped(this, handler, segment || this.getSegment(), !!full) -} -function _makeWrapped(tracer, handler, active, full) { - wrapped[symbols.original] = getOriginal(handler) - wrapped[symbols.segment] = active - - return wrapped - - function wrapped() { - const prev = tracer.getSegment() - - if (active && full) { - active.start() - } - - try { - return tracer._contextManager.runInContext(active, handler, this, arguments) - } catch (err) { - logger.trace(err, 'Error from wrapped function:') - - if (prev === null && process.domain != null) { - process.domain[symbols.segment] = tracer.getSegment() - } - - throw err // Re-throwing application error, this is not an agent error. - } finally { - if (active && full) { - active.touch() - } - } - } -} - -function getOriginal(fn) { - const original = fn[symbols.original] - if (original) { - return original - } - return fn -} - -function bindEmitter(emitter, segment) { - if (!emitter || !emitter.emit) { - return emitter - } - - const emit = getOriginal(emitter.emit) - emitter.emit = this.bindFunction(emit, segment) - - return emitter -} - -function argSlice(args) { - /** - * Usefully nerfed version of slice for use in instrumentation. Way faster - * than using [].slice.call, and maybe putting it in here (instead of the - * same module context where it will be used) will make it faster by - * defeating inlining. - * - * http://jsperf.com/array-slice-call-arguments-2 - * - * for untrustworthy benchmark numbers. Only useful for copying whole - * arrays, and really only meant to be used with the arguments array like. - * - * Also putting this comment inside the function in an effort to defeat - * inlining. - * - */ - const length = args.length - const array = new Array(length) - - for (let i = 0; i < length; i++) { - array[i] = args[i] - } - - return array -} - -function wrapFunctionNoSegment(original, name, wrapper) { - if (typeof original !== 'function') { - return original - } - - logger.trace('Wrapping function %s (no segment)', name || original.name || 'anonymous') - const tracer = this - - return wrappedFunction - - function wrappedFunction() { - if (!tracer.getTransaction()) { - return original.apply(this, arguments) - } - let args = tracer.slice(arguments) - - if (wrapper === undefined) { - const last = args.length - 1 - const cb = args[last] - if (typeof cb === 'function') { - args[last] = tracer.bindFunction(cb) - } - } else { - args = wrapper(args) - } - return original.apply(this, args) - } -} - -function wrapFunctionFirstNoSegment(original, name) { - if (typeof original !== 'function') { - return original - } - - logger.trace('Wrapping function %s (no segment)', name || original.name || 'anonymous') - const tracer = this - - return wrappedFunction - - function wrappedFunction() { - if (!tracer.getTransaction()) { - return original.apply(this, arguments) - } - const args = tracer.slice(arguments) - const cb = args[0] - if (typeof cb === 'function') { - args[0] = tracer.bindFunction(cb) - } - return original.apply(this, args) - } -} - -function wrapFunctionLast(name, recorder, original) { - if (typeof original !== 'function') { - logger.trace(SKIP_WRAPPING_FUNCTION_MESSAGE, name) - return original - } - - logger.trace('Wrapping %s as a callback-last function', name) - const tracer = this - - return wrappedFunction - - function wrappedFunction() { - const transaction = tracer.getTransaction() - if (!transaction) { - logger.trace(INACTIVE_TRANSACTION_MESSAGE, name) - return original.apply(this, arguments) - } - - logger.trace(CREATE_SEGMENT_MESSAGE, name, transaction.id) - const args = tracer.slice(arguments) - const last = args.length - 1 - const cb = args[last] - if (typeof cb !== 'function') { - return original.apply(this, arguments) - } - const child = tracer.createSegment(name, recorder) - args[last] = tracer.wrapCallback(cb, child, function wrappedCallback() { - logger.trace('Ending "%s" segment for transaction %s.', name, transaction.id) - child.touch() - return cb.apply(this, arguments) - }) - child.start() - return tracer.bindFunction(original, child).apply(this, args) - } -} - -function wrapFunctionFirst(name, recorder, original) { - if (typeof original !== 'function') { - logger.trace(SKIP_WRAPPING_FUNCTION_MESSAGE, name) - return original - } - - logger.trace('Wrapping %s as a callback-first function', name) - const tracer = this - - return wrappedFunction - - function wrappedFunction() { - const transaction = tracer.getTransaction() - if (!transaction) { - logger.trace(INACTIVE_TRANSACTION_MESSAGE, name) - return original.apply(this, arguments) - } - - logger.trace(CREATE_SEGMENT_MESSAGE, name, transaction.id) - const args = tracer.slice(arguments) - const cb = args[0] - if (typeof cb !== 'function') { - return original.apply(this, arguments) - } - const child = tracer.createSegment(name, recorder) - args[0] = tracer.wrapCallback(cb, child, function wrappedCallback() { - logger.trace('Ending "%s" segment for transaction %s.', name, transaction.id) - child.touch() - return cb.apply(this, arguments) - }) - child.start() - return tracer.bindFunction(original, child).apply(this, args) - } -} - -function wrapFunction(name, recorder, original, wrapper, resp) { - if (typeof original !== 'function' || !wrapper) { - logger.trace(SKIP_WRAPPING_FUNCTION_MESSAGE, name) - return original - } - - logger.trace('Wrapping %s using a custom wrapper', name) - - const tracer = this - - return wrappedFunction - - function wrappedFunction() { - const transaction = tracer.getTransaction() - if (!transaction) { - logger.trace(INACTIVE_TRANSACTION_MESSAGE, name) - return original.apply(this, arguments) - } - - logger.trace(CREATE_SEGMENT_MESSAGE, name, transaction.id) - - const child = tracer.createSegment(name, recorder) - const args = wrapper.call(this, child, tracer.slice(arguments), bind) - child.start() - let result = tracer.bindFunction(original, child).apply(this, args) - if (resp) { - result = resp.call(this, child, result, bind) - } - return result - - function bind(fn) { - if (!fn) { - return fn - } - return tracer.wrapCallback(fn, child, function nrWrappedHandler() { - logger.trace('Touching "%s" segment for transaction %s.', name, transaction.id) - child.touch() - return fn.apply(this, arguments) - }) - } - } -} - -function wrapSyncFunction(name, recorder, original) { - if (typeof original !== 'function') { - logger.trace(SKIP_WRAPPING_FUNCTION_MESSAGE, name) - return original - } - - logger.trace('Wrapping "%s" as a synchronous function', name) - - const tracer = this - - return wrappedFunction - - function wrappedFunction() { - const transaction = tracer.getTransaction() - if (!transaction) { - logger.trace(INACTIVE_TRANSACTION_MESSAGE, name) - return original.apply(this, arguments) - } - logger.trace('Creating "%s" sync segment for transaction %s.', name, transaction.id) - const child = tracer.createSegment(name, recorder) - if (child) { - child.async = false - } - return tracer.bindFunction(original, child, true).apply(this, arguments) - } -} - -function wrapCallback(original, segment, wrapped) { - const tracer = this - - if (typeof original !== 'function') { - return original - } - - logger.trace('Wrapping callback for "%s" segment', segment ? segment.name : 'unknown') - - return tracer.bindFunction( - function wrappedCallback() { - if (wrapped) { - wrapped[symbols.original] = original - } - - const child = tracer.createSegment( - 'Callback: ' + (original.name || 'anonymous'), - null, - segment - ) - - if (child) { - child.async = false - } - - return tracer.bindFunction(wrapped || original, child, true).apply(this, arguments) - }, - segment, - false - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/transaction-event-aggregator.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/transaction-event-aggregator.js deleted file mode 100644 index fbf1899b5..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/transaction/transaction-event-aggregator.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'transaction-event-aggregator' }) -const EventAggregator = require('../aggregators/event-aggregator') - -const NAMES = require('../metrics/names') - -const SPLIT_THRESHOLD = 5000 - -class TransactionEventAggregator extends EventAggregator { - constructor(opts, collector, metrics) { - opts = opts || {} - opts.method = opts.method || 'analytic_event_data' - opts.metricNames = NAMES.EVENTS - - super(opts, collector, metrics) - - this.splitThreshold = opts.splitThreshold || SPLIT_THRESHOLD - } - - _toPayloadSync() { - // this is still used by traditional send when payloads not split - const events = this.events - - if (events.length === 0) { - logger.debug('No transaction events to send.') - return - } - - const metrics = { - reservoir_size: events.limit, - events_seen: events.seen - } - - const eventData = events.toArray() - - return [this.runId, metrics, eventData] - } - - send() { - if (this.events.length < this.splitThreshold) { - return super.send() - } - - // TODO: log? - this.emit(`starting ${this.method} data send.`) - - logger.debug('Splitting transaction events into multiple payloads') - - const data = this._getMergeData() - - this.clear() - - const eventPayloadPairs = this._splitData(data) - - this._sendMultiple(eventPayloadPairs, () => { - // TODO: Log? - this.emit(`finished ${this.method} data send.`) - }) - } - - _splitData(data) { - // TODO: update this to pull the priority off the event when DT is released - const events = data.getRawEvents() - const size = Math.floor(data.length / 2) - const limit = Math.floor(data.limit / 2) - const seen = Math.floor(data.seen / 2) - - const firstHalfRawEvents = events.splice(0, size) - const firstMetrics = { - reservoir_size: limit, - events_seen: seen - } - const firstHalfEventData = firstHalfRawEvents.map(this._rawEventsToValues) - const firstPayload = [this.runId, firstMetrics, firstHalfEventData] - - const secondHalfRawEvents = events - const secondMetrics = { - reservoir_size: data.limit - limit, - events_seen: data.seen - seen - } - const secondHalfEventData = secondHalfRawEvents.map(this._rawEventsToValues) - const secondPayload = [this.runId, secondMetrics, secondHalfEventData] - - return [ - { rawData: firstHalfRawEvents, payload: firstPayload }, - { rawData: secondHalfRawEvents, payload: secondPayload } - ] - } - - _rawEventsToValues(rawEvent) { - return rawEvent.value - } - - async _sendMultiple(eventPayloadPairs, sendCallback) { - const self = this - - // Send payloads one at a time - const promises = eventPayloadPairs.map((payloadPair, index) => { - logger.debug( - 'Sending payload %d of %d to %s', - index + 1, - eventPayloadPairs.length, - self.method - ) - - return new Promise((resolve) => { - self._sendSplitPayload(payloadPair.rawData, payloadPair.payload, (error) => { - if (error) { - logger.warn(error, 'An error occurred sending payload') - } - - logger.trace( - 'Finished sending payload %d of %d to %s', - index + 1, - eventPayloadPairs.length, - self.method - ) - - // swallow error, allow all payloads to attempt to send - resolve() - }) - }) - }) - - await Promise.all(promises) - logger.debug('Finished sending %d payloads to %s', eventPayloadPairs.length, self.method) - - sendCallback() - } - - _sendSplitPayload(rawData, payload, callback) { - this.collector[this.method](payload, (error, response) => { - if (response && response.retainData) { - this._merge(rawData) - } - - callback(error) - }) - } -} - -module.exports = TransactionEventAggregator diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/uninstrumented.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/uninstrumented.js deleted file mode 100644 index 6f2349d18..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/uninstrumented.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const path = require('path') -const logger = require('./logger') -const NAMES = require('./metrics/names') -const properties = require('./util/properties') -const shimmer = require('./shimmer') - -// Static variable holding map of un-instrumented modules for use in the future -const uninstrumented = Object.create(null) - -// Log a helpful message about un-instrumented modules -function logUninstrumented() { - const modules = Object.keys(uninstrumented) - if (modules.length > 0) { - let message = - 'The newrelic module must be the first module required.\n' + - 'The following modules were required before newrelic and are not being ' + - 'instrumented:' - - modules.forEach(function buildMessage(module) { - message += '\n\t' + uninstrumented[module].name + ': ' + uninstrumented[module].filename - }) - - logger.warn(message) - } -} - -// Create Supportability/Uninstrumented/ metrics -// -// @param metrics Agent metrics aggregator -function createMetrics(metrics) { - const modules = Object.keys(uninstrumented) - if (modules.length > 0) { - metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.UNINSTRUMENTED).incrementCallCount() - } - - modules.forEach(function addMetrics(module) { - metrics - .getOrCreateMetric(NAMES.SUPPORTABILITY.UNINSTRUMENTED + '/' + uninstrumented[module].name) - .incrementCallCount() - }) -} - -// Check for any instrument-able modules that have already been loaded. This does -// not check core modules as we don't have access to the core module loader -// cache. But, users probably are missing instrumentation for other modules if -// they are missing instrumentation for core modules. -function check() { - const instrumentations = Object.keys(shimmer.registeredInstrumentations) - // Special case since we do some hackish stuff in lib/shimmer.js to make pg.js, - // and mysql2 work. - instrumentations.push('pg.js', 'mysql2') - - for (const filename in require.cache) { - if (!properties.hasOwn(require.cache, filename)) { - continue - } - - // only interested in whatever follows the last occurrence of node_modules - const paths = filename.split('node_modules' + path.sep) - const modulePath = paths[paths.length - 1] - - for (let i = 0; i < instrumentations.length; i++) { - const name = instrumentations[i] - if (modulePath.startsWith(name) && !uninstrumented[name]) { - uninstrumented[name] = { name, filename } - } - } - } - - logUninstrumented() -} - -module.exports = { check, createMetrics } diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/application-logging.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/application-logging.js deleted file mode 100644 index cd68d2ba2..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/application-logging.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const utils = module.exports -const MAX_LENGTH = 1021 -const OUTPUT_LENGTH = 1024 -const { LOGGING } = require('../metrics/names') - -/** - * Truncates a string to MAX_LENGTH constant above. - * - * @param {string} str string to truncate - * @returns {string} - */ -utils.truncate = function truncate(str) { - if (typeof str === 'string' && str.length > OUTPUT_LENGTH) { - return str.substring(0, MAX_LENGTH) + '...' - } - - return str -} - -/** - * Checks if application_logging and one of the features are enabled - * - * @param {object} config agent config - * @returns {boolean} is application logging enabled - */ -utils.isApplicationLoggingEnabled = function isApplicationLoggingEnabled(config) { - return !!( - config.application_logging.enabled && - (config.application_logging.metrics.enabled || - config.application_logging.forwarding.enabled || - config.application_logging.local_decorating.enabled) - ) -} - -/** - * Checks if application_logging and application_logging.metrics are both enabled - * - * @param {object} config agent config - * @returns {boolean} is metrics enabled - */ -utils.isMetricsEnabled = function isMetricsEnabled(config) { - return !!(config.application_logging.enabled && config.application_logging.metrics.enabled) -} - -/** - * Checks if application_logging and application_logging.local_decorating are both enabled - * - * @param {object} config agent config - * @returns {boolean} is forwarding enabled - */ -utils.isLocalDecoratingEnabled = function isLocalDecoratingEnabled(config) { - return !!( - config.application_logging.enabled && config.application_logging.local_decorating.enabled - ) -} - -/** - * Checks if log aggregator exists on agent & application_logging and application_logging.forwarding are both enabled - * - * @param {object} config agent config - * @param {Agent} agent Node.js agent - * @returns {boolean} is forwarding enabled - */ -utils.isLogForwardingEnabled = function isLogForwardingEnabled(config, agent) { - return !!( - agent.logs && - config.application_logging.enabled && - config.application_logging.forwarding.enabled - ) -} - -/** - * Increments both `Logging/lines` and `Logging/lines/` call count - * - * @param {string} level log level - * @param {object} metrics metrics module - */ -utils.incrementLoggingLinesMetrics = function incrementLoggingLinesMetrics(level, metrics) { - const levelMetric = getLogLevel(level) - - metrics.getOrCreateMetric(LOGGING.LINES).incrementCallCount() - metrics.getOrCreateMetric(levelMetric).incrementCallCount() -} - -/** - * Increments call count when instrumentation for a logging library is loaded - * - * @param {string} lib name of library - * @param {object} metrics agent metrics instance - */ -utils.createModuleUsageMetric = function createModuleUsageMetric(lib, metrics) { - metrics.getOrCreateMetric(LOGGING.LIBS[lib.toUpperCase()]).incrementCallCount() -} - -function getLogLevel(level) { - if (!level) { - return LOGGING.LEVELS.UNKNOWN - } - const logLevel = LOGGING.LEVELS[level.toUpperCase()] - if (!logLevel) { - return LOGGING.LEVELS.UNKNOWN - } - return logLevel -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/arity.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/arity.js deleted file mode 100644 index 56b596827..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/arity.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const hasOwnProperty = require('./properties').hasOwn -const symbols = require('../symbols') - -// Starting in what we believe to be Node v4 you can set the name and length of -// a function as properties. This is more ideal than wrapping a function. -exports.fixArity = fixArity - -function fixArity(original, wrapper) { - const toDefine = { - name: { value: original.name }, - length: { value: original.length } - } - Object.defineProperties(wrapper, toDefine) - - if (!hasOwnProperty(wrapper, symbols.name)) { - wrapper[symbols.name] = wrapper.name - } - - return wrapper -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/async-each-limit.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/async-each-limit.js deleted file mode 100644 index bc60e9e77..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/async-each-limit.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Helper method for limiting number of concurrent async executions to a certain limit - * Native replacement for async.eachLimit, fixes https://issues.newrelic.com/browse/NR-69739 - * - * Shamelessly ripped off from https://github.com/nodejs/help/issues/2192#issuecomment-533730280 - * and https://timtech.blog/posts/limiting-async-operations-promise-concurrency-javascript/ - * - * @param {Array} items Array to iterate over - * @param {Function} fn the callback from Array.map you would normally write that contains an async operation - * @param {number} limit the maximum allowed concurrent invocations of `fn` - */ -async function eachLimit(items, fn, limit) { - const results = [] - - while (items.length) { - const resolved = await Promise.all(items.splice(0, limit).map(fn)) - results.push(...resolved) - } - - return results -} - -module.exports = eachLimit diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/attribute-types.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/attribute-types.js deleted file mode 100644 index 6fa2aa917..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/attribute-types.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const VALID_ATTR_TYPES = new Set(['string', 'number', 'boolean']) - -/** - * Checks incoming attribute value against valid types: - * string, number, & boolean. - * - * @param {*} val - * @returns {boolean} - */ -function isValidType(val) { - return VALID_ATTR_TYPES.has(typeof val) -} - -module.exports = isValidType diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/attributes.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/attributes.js deleted file mode 100644 index 76697a875..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/attributes.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const NAMES = require('../metrics/names') -const hashes = require('../util/hashes') - -/** - * Helper method for modifying attributes by reference if transaction has queue metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - */ -function maybeAddQueueAttributes(transaction, attributes) { - const metric = transaction.metrics.getMetric(NAMES.QUEUETIME) - - if (metric) { - attributes.queueDuration = metric.total - } -} - -/** - * Helper method for modifying attributes by reference if transaction has external call metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - */ -function maybeAddExternalAttributes(transaction, attributes) { - const metric = transaction.metrics.getMetric(NAMES.EXTERNAL.ALL) - - if (metric) { - attributes.externalDuration = metric.total - attributes.externalCallCount = metric.callCount - } -} - -/** - * Helper method for modifying attributes by reference if transaction has database metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - */ -function maybeAddDatabaseAttributes(transaction, attributes) { - const metric = transaction.metrics.getMetric(NAMES.DB.ALL) - - if (metric) { - attributes.databaseDuration = metric.total - attributes.databaseCallCount = metric.callCount - } -} - -/** - * Helper method for modifying attributes by reference if transaction has DT metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - */ -function maybeAddParentAttributes(transaction, attributes) { - if (transaction.parentSpanId) { - attributes.parentSpanId = transaction.parentSpanId - } - - if (transaction.parentId) { - attributes.parentId = transaction.parentId - } -} - -/** - * Helper method for modifying attributes by reference if transaction has CAT metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - * @param {object} configuration Agent configuration options - */ -function addRequiredCATAttributes(transaction, attributes, configuration) { - attributes['nr.guid'] = transaction.id - attributes['nr.tripId'] = transaction.tripId || transaction.id - attributes['nr.pathHash'] = hashes.calculatePathHash( - configuration.applications()[0], - transaction.getFullName(), - transaction.referringPathHash - ) -} - -/** - * Helper method for modifying attributes by reference if transaction has additional CAT metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - * @param {object} configuration Agent configuration options - */ -function maybeAddExtraCATAttributes(transaction, attributes, configuration) { - if (transaction.referringPathHash) { - attributes['nr.referringPathHash'] = transaction.referringPathHash - } - - if (transaction.referringTransactionGuid) { - const refId = transaction.referringTransactionGuid - attributes['nr.referringTransactionGuid'] = refId - } - - const alternatePathHashes = transaction.alternatePathHashes() - if (alternatePathHashes) { - attributes['nr.alternatePathHashes'] = alternatePathHashes - } - - if (transaction.baseSegment && transaction.type === 'web') { - const apdex = - configuration.web_transactions_apdex[transaction.getFullName()] || configuration.apdex_t - const duration = transaction.baseSegment.getDurationInMillis() / 1000 - attributes['nr.apdexPerfZone'] = calculateApdexZone(duration, apdex) - } -} - -/** - * Helper method for determining a transaction's apdex score based on an apdex threshold and transaction duration - * - * @param {number} duration number of seconds the transaction took - * @param {number} apdexT the apdex threshold - * @returns {string} String representation of apdex "zone" - */ -function calculateApdexZone(duration, apdexT) { - if (duration <= apdexT) { - return 'S' // satisfied - } - - if (duration <= apdexT * 4) { - return 'T' // tolerating - } - - return 'F' // frustrated -} - -/** - * Helper method for modifying attributes by reference if transaction has Synthetics metrics - * - * @param {object} transaction The current transaction - * @param {object} attributes The attributes object to modify (by reference) - */ -function maybeAddSyntheticAttributes(transaction, attributes) { - if (transaction.syntheticsData) { - attributes['nr.syntheticsResourceId'] = transaction.syntheticsData.resourceId - attributes['nr.syntheticsJobId'] = transaction.syntheticsData.jobId - attributes['nr.syntheticsMonitorId'] = transaction.syntheticsData.monitorId - } -} - -module.exports = { - maybeAddQueueAttributes, - maybeAddExternalAttributes, - maybeAddDatabaseAttributes, - maybeAddParentAttributes, - addRequiredCATAttributes, - maybeAddExtraCATAttributes, - maybeAddSyntheticAttributes -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/byte-limit.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/byte-limit.js deleted file mode 100644 index f4b0497bd..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/byte-limit.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -/** - * Checks if a given string is within agent attribute limits. - * - * @param {string} str - Object key name or value - * @param {number} limit - String byte limit - */ -function isValidLength(str, limit) { - return Buffer.byteLength(str, 'utf8') <= limit -} - -/** - * Returns the relative position of the end of the string (in bytes) and the limit. - * >1 if the string is longer than the limit - * 0 if the string is at the limit - * <1 if the string is shorter than the limit - * - * @param {string} str - * @param {number} limit - String byte limit - */ -function compareLength(str, limit) { - return Buffer.byteLength(str) - limit -} - -/** - * Trims a string value to given byte limit, if necessary. - * - * @private - * @param {string} val - The value to truncate to given byte limit. - * @param {number} limit - The byte limit - * @returns {string} The truncated value. - */ -function truncate(val, limit) { - // First truncation handles the simple case of only one-byte characters. - val = val.substring(0, limit) - if (isValidLength(val, limit)) { - return val - } - - // Our limitation is on byte length, and the string could contain multi-byte - // characters. Doing a byte-substring could chop a character in half. Instead - // we do a binary search over the byte length of the substrings. - let substrLen = val.length - let delta = Math.ceil(substrLen / 2) - let cmpVal = compareLength(val.substring(0, substrLen), limit) - - // Continue the binary search till: - // 1) The string is the desired length (i.e. cmpVal = 0) OR - // 2) The desired string must split a character to achieve the desired byte length - // In this case, we should cut the character that would be split. - // (i.e. delta > 1 character OR the string is larger than the limit) - let substr - while (cmpVal && (cmpVal > 0 || delta > 1)) { - substrLen = cmpVal < 0 ? substrLen + delta : substrLen - delta - substr = val.substring(0, substrLen) - cmpVal = compareLength(substr, limit) - delta = Math.ceil(delta / 2) - } - - return substr -} - -module.exports.isValidLength = isValidLength -module.exports.compareLength = compareLength -module.exports.truncate = truncate diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/cat.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/cat.js deleted file mode 100644 index 78cb15d0c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/cat.js +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const cat = module.exports -const hashes = require('./hashes') -const logger = require('../logger').child({ component: 'cat' }) -const NAMES = require('../metrics/names') - -const HTTP_CAT_ID_HEADER = 'X-NewRelic-Id' -const MQ_CAT_ID_HEADER = 'NewRelicID' -const MATCH_CAT_ID_HEADER = new RegExp( - '^(?:' + HTTP_CAT_ID_HEADER + '|' + MQ_CAT_ID_HEADER + ')$', - 'i' -) -const HTTP_CAT_TRANSACTION_HEADER = 'X-NewRelic-Transaction' -const MQ_CAT_TRANSACTION_HEADER = 'NewRelicTransaction' -const MATCH_CAT_TRANSACTION_HEADER = new RegExp( - '^(?:' + HTTP_CAT_TRANSACTION_HEADER + '|' + MQ_CAT_TRANSACTION_HEADER + ')$', - 'i' -) -const HTTP_CAT_APP_DATA_HEADER = 'X-NewRelic-App-Data' -const MQ_CAT_APP_DATA_HEADER = 'NewRelicAppData' -const MATCH_CAT_APP_DATA_HEADER = new RegExp( - '^(?:' + HTTP_CAT_APP_DATA_HEADER + '|' + MQ_CAT_APP_DATA_HEADER + ')$', - 'i' -) - -/** - * Decodes the CAT id and transaction headers from incoming request - * - * @param {object} headers incoming headers - * @param id - * @param transactionId - * @param {string} encKey config.encoding_key used to decode CAT headers - * @param {object} { externalId, externalTransaction } - */ -cat.parseCatData = function parseCatData(id, transactionId, encKey) { - if (!encKey) { - logger.warn('Missing encoding key, not extract CAT headers!') - return {} - } - - let externalId = null - - if (id) { - externalId = hashes.deobfuscateNameUsingKey(id, encKey) - } - - let externalTransaction = null - if (transactionId) { - try { - externalTransaction = JSON.parse(hashes.deobfuscateNameUsingKey(transactionId, encKey)) - } catch (e) { - logger.trace(`Got an unparsable CAT header ${HTTP_CAT_ID_HEADER} %s`, transactionId) - } - } - - return { externalId, externalTransaction } -} - -/** - * Adds the appropriate keys to transaction based on the incoming parsed CAT data - * - * @param {string} externalId decoded CAT id - * @param {Array} externalTransaction CAT transaction - * @param {Transaction} transaction active transaction - */ -cat.assignCatToTransaction = function assignCatToTransaction( - externalId, - externalTransaction, - transaction -) { - if (typeof externalId === 'string') { - transaction.incomingCatId = externalId - } - - if (Array.isArray(externalTransaction)) { - const [referringGuid, , tripId, referringPathHash] = externalTransaction - transaction.referringTransactionGuid = referringGuid - - if (typeof tripId === 'string') { - transaction.tripId = tripId - } else if (tripId) { - transaction.invalidIncomingExternalTransaction = true - } - - if (typeof referringPathHash === 'string') { - transaction.referringPathHash = referringPathHash - } else if (referringPathHash) { - transaction.invalidIncomingExternalTransaction = true - } - } - - if (transaction.incomingCatId) { - logger.trace( - 'Got inbound CAT headers in transaction %s from %s', - transaction.id, - transaction.incomingCatId - ) - } -} - -/** - * Encodes the data to be set on the CAT app data header - * for incoming requests - * - * @param {object} config agent config - * @param {Transaction} transaction - * @param {string} contentLength - * @param {boolean} useMqHeaders flag to return proper headers for MQ compliance - * @returns {object} { key, data} to add as header - */ -cat.encodeAppData = function encodeAppData(config, transaction, contentLength, useMqHeaders) { - let appData = null - const transactionName = transaction.getFullName() || '' - - try { - appData = JSON.stringify([ - config.cross_process_id, // cross_process_id - transactionName, // transaction name - transaction.queueTime / 1000, // queue time (s) - transaction.catResponseTime / 1000, // response time (s) - contentLength, // content length (if content-length header is also being sent) - transaction.id, // TransactionGuid - false // force a transaction trace to be recorded - ]) - } catch (err) { - logger.trace( - err, - 'Failed to serialize transaction: %s - not adding CAT response headers', - transactionName - ) - return - } - - const encKey = config.encoding_key - const obfAppData = hashes.obfuscateNameUsingKey(appData, encKey) - const key = useMqHeaders ? MQ_CAT_APP_DATA_HEADER : HTTP_CAT_APP_DATA_HEADER - return { key, data: obfAppData } -} - -/** - * Adds CAT headers to outbound request. - * - * @param {object} config agent config - * @param {Transaction} transaction - * @param {object} headers object that contains headers the agent is adding to client request - * @param {boolean} useMqHeaders flag to return proper headers for MQ compliance - */ -cat.addCatHeaders = function addCatHeaders(config, transaction, headers, useMqHeaders) { - if (!config.encoding_key) { - logger.warn('Missing encoding key, not adding CAT headers!') - return - } - - const idHeader = useMqHeaders ? MQ_CAT_ID_HEADER : HTTP_CAT_ID_HEADER - const transactionHeader = useMqHeaders ? MQ_CAT_TRANSACTION_HEADER : HTTP_CAT_TRANSACTION_HEADER - - // Add in the application ID - if (config.obfuscatedId) { - headers[idHeader] = config.obfuscatedId - } - - const transactionName = transaction.getFullName() || '' - - const pathHash = hashes.calculatePathHash( - config.applications()[0], - transactionName, - transaction.referringPathHash - ) - transaction.pushPathHash(pathHash) - - try { - const transactionData = hashes.obfuscateNameUsingKey( - JSON.stringify([transaction.id, false, transaction.tripId || transaction.id, pathHash]), - config.encoding_key - ) - headers[transactionHeader] = transactionData - - logger.trace('Added outbound request CAT headers in transaction %s', transaction.id) - } catch (err) { - logger.trace(err, 'Failed to create CAT payload') - } -} - -/** - * Find the CAT id, transaction, app data headers - * from the headers of either HTTP or MQ request - * - * @param {object} headers - * @returns {object} { id, transactionId, appData } - */ -cat.extractCatHeaders = function extractCatHeaders(headers) { - // Hunt down the CAT headers. - let id = null - let transactionId = null - let appData = null - // eslint-disable-next-line guard-for-in - for (const key in headers) { - if (MATCH_CAT_ID_HEADER.test(key)) { - id = headers[key] - } else if (MATCH_CAT_TRANSACTION_HEADER.test(key)) { - transactionId = headers[key] - } else if (MATCH_CAT_APP_DATA_HEADER.test(key)) { - appData = headers[key] - } - if (id && transactionId && appData) { - break - } - } - - return { id, transactionId, appData } -} - -/** - * Extracts the account Id from CAT data and verifies if it is - * a trusted account id - * - * @param {object} CAT data - * @param data - * @param {Array} trustedAccounts from config - * @returns {boolean} - */ -cat.isTrustedAccountId = function isTrustedAccountId(data, trustedAccounts) { - const accountId = parseInt(data.split('#')[0], 10) - const trusted = trustedAccounts.includes(accountId) - if (!trusted) { - logger.trace('Response from untrusted CAT header account id: %s', accountId) - } - return trusted -} - -/** - * Decodes the CAT App Data header and extracts the downstream - * CAT id, transaction id - * - * @param {object} config agent config - * @param {string} obfAppData encoded app data to parse and use - * @param {Array} decoded app data header - */ -cat.parseAppData = function parseAppData(config, obfAppData) { - if (!config.encoding_key) { - logger.trace('config.encoding_key is not set - not parsing response CAT headers') - return - } - - if (!config.trusted_account_ids) { - logger.trace('config.trusted_account_ids is not set - not parsing response CAT headers') - return - } - - let appData = null - try { - appData = JSON.parse(hashes.deobfuscateNameUsingKey(obfAppData, config.encoding_key)) - } catch (e) { - logger.warn(`Got an unparsable CAT header ${HTTP_CAT_APP_DATA_HEADER}: %s`, obfAppData) - return - } - - // Make sure it is a trusted account - if (!cat.isTrustedAccountId(appData && appData[0], config.trusted_account_ids)) { - return - } - - return appData -} - -/** - * Assigns the CAT id, transaction to segment and adds `transaction_guid` when it exists. - * It also renames the segment name based on the newly decoded app data when host is present - * - * @param {Array} appData decodes CAT app data - * @param {TraceSegment} segment - * @param {string} [host] if host is present it will rename segment with app data and host - */ -cat.assignCatToSegment = function assignCatToSegment(appData, segment, host) { - if (!Array.isArray(appData) || typeof appData[0] !== 'string') { - logger.trace(`Unknown format for CAT header ${HTTP_CAT_APP_DATA_HEADER}.`) - return - } - - segment.catId = appData[0] - segment.catTransaction = appData[1] - - if (host) { - segment.name = `${NAMES.EXTERNAL.TRANSACTION}${host}/${segment.catId}/${segment.catTransaction}` - } - - let transactionGuid - if (appData.length >= 6) { - transactionGuid = appData[5] - segment.addAttribute('transaction_guid', transactionGuid) - } - logger.trace( - 'Got inbound response CAT headers in transaction %s from %s', - segment.transaction.id, - transactionGuid - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/code-level-metrics.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/code-level-metrics.js deleted file mode 100644 index 965537bdf..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/code-level-metrics.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2022 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const logger = require('../logger').child({ component: 'code-level-metrics' }) -const { isValidLength } = require('./byte-limit') -const symbols = require('../symbols') -const clmUtils = module.exports - -/** - * Attaches a flag on function indicating that - * CLM attributes need to be associated with it. - * - * Note: director middleware instrumentation passes in a string as the "function" so we have to check if the function is actually a function - * to avoid crashing, abstraction not FTW - * - * @param {Shim} shim instance of shim - * @param {Function} fn function to apply clm symbol - */ -clmUtils.assignCLMSymbol = function assignCLMSymbol(shim, fn) { - if (shim.isFunction(fn) && shim.agent.config.code_level_metrics.enabled) { - fn[symbols.clm] = true - } -} - -/** - * Uses function name if truthy - * otherwise it defaults to (anonymous) - * - * @param {string} name name of function - * @returns {string} function name or (anonymous) - */ -function setFunctionName(name) { - return name || '(anonymous)' -} - -/** - * Helper used to assign Code Level Metrics(CLM) - * to an active segment. - * - * spec states if function or filepath are > 255, do not assign - * CLM attrs - * - * @param {Function} fn function reference - * @param {TraceSegment} segment active segment to attach code.* attrs - */ -clmUtils.addCLMAttributes = function addCLMAttributes(fn, segment) { - if (!fn[symbols.clm]) { - return - } - - try { - const { funcInfo } = require('@contrast/fn-inspect') - const { lineNumber, method, file: filePath, column } = funcInfo(fn) - const fnName = setFunctionName(method) - - if (isValidLength(fnName, 255) && filePath && isValidLength(filePath, 255)) { - segment.addAttribute('code.filepath', filePath) - segment.addAttribute('code.function', fnName) - // both line numbers and columns start at 0 in v8, add 1 to reflect js code - // See: https://v8.github.io/api/head/classv8_1_1Function.html#a87bc63f97a9a39f83051570519fc63c2 - segment.addAttribute('code.lineno', lineNumber + 1) - segment.addAttribute('code.column', column + 1) - } - } catch (err) { - logger.infoOnce( - 'clm:function-inspector', - { err }, - 'Not using v8 function inspector, falling back to function name' - ) - const fnName = setFunctionName(fn.name) - - if (isValidLength(fnName, 255)) { - segment.addAttribute('code.function', fnName) - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/codec.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/codec.js deleted file mode 100644 index 2fbe529d3..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/codec.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const stringify = require('json-stringify-safe') -const zlib = require('zlib') - -module.exports = { - /** - * Take in an object literal, and deflate and then Base64 encode it. - * - * zlib works with streams, so this must be used asynchronously. - * - * @param {object} data - * The data to encode. - * @param {Function} callback - * The callback to take the results. The first parameter is any errors from - * encoding, and the second parameter is the encoded data object. - */ - encode: function encode(data, callback) { - try { - zlib.deflate(stringify(data), function cbDeflate(err, raw) { - if (err) { - return callback(err) - } - - return callback(null, raw.toString('base64')) - }) - } catch (err) { - return callback(err) - } - }, - - /** - * Base64 decode a string, decompress it, and then turn the results back into - * a JavaScript object. - * - * zlib works with streams, so this must be used asynchronously. - * - * @param {object} encoded - * The data to decode. - * @param {Function} callback - * The callback to take the results. The first parameter is any errors from - * decoding, and the second parameter is the decoded data object. - */ - decode: function decode(encoded, callback) { - zlib.inflate(Buffer.from(encoded, 'base64'), function cbInflate(err, raw) { - if (err) { - return callback(err) - } - - let json - try { - json = JSON.parse(raw) - } catch (error) { - return callback(error) - } - - return callback(null, json) - }) - }, - - /** - * Take in an object literal, and deflate and then Base64 encode it. - * - * This is the synchronous version. - * - * @param {object} data - * The data to encode. - */ - encodeSync: function encodeSync(data) { - return zlib.deflateSync(stringify(data)).toString('base64') - }, - - /** - * Base64 decode a string, decompress it, and then turn the results back into - * a JavaScript object. - * - * This is the synchronous version. - * - * @param {object} encoded - * The data to decode. - */ - decodeSync: function decodeSync(encoded) { - return JSON.parse(zlib.inflateSync(Buffer.from(encoded, 'base64'))) - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/copy.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/copy.js deleted file mode 100644 index 0930138f9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/copy.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const hasOwnProperty = require('./properties').hasOwn - -exports.shallow = shallowCopy - -/** - * Performs a shallow copy of all properties on the source object. - * - * @param {object} source - The object to copy the properties from. - * @param {object} [dest={}] - The object to copy the properties to. - * @returns {object} The destination object. - */ -function shallowCopy(source, dest) { - dest = dest || Object.create(null) - for (const k in source) { - if (hasOwnProperty(source, k)) { - dest[k] = source[k] - } - } - return dest -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/deep-equal.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/deep-equal.js deleted file mode 100644 index a36316151..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/deep-equal.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const util = require('util') - -module.exports = function exports(a, b) { - /* - * NaN is a special case, util.isDeepStrictEqual will return true for comparing two NaNs, - * but comparing a NaN to itself like this returns false (yay for weird JS stuff) - * - * Added this special check because the original implementation of this - * did not consider two NaNs as equal, so preserving existing functionality - */ - if (a !== a && b !== b) { - return false - } - - return util.isDeepStrictEqual(a, b) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/flatten.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/flatten.js deleted file mode 100644 index d4e104b3d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/flatten.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -exports = module.exports = flatten -exports.keys = flatKeys - -/** - * Flatten nested maps of JSONifiable data. - * - * Ex: {a: 5, b: {c: true, d: 7}} -> {a: 5, 'b.c': true, 'b.d': 7} - * - * @private - * @param {object} result Object to place key-value pairs into, normally called with `{}`. - * @param {string} prefix Prefix for keys, normally called with `''`. - * @param seen - * @param {object} obj Object to be flattened. - * @returns {object} Object with flattened key-value pairs - */ -function flatten(result, prefix, obj, seen) { - seen = seen || [] - seen.push(obj) - - for (const key in obj) { - if (seen.indexOf(obj[key]) > -1) { - continue - } - - if (obj[key] instanceof Object) { - flatten(result, prefix + key + '.', obj[key], seen) - } else { - result[prefix + key] = obj[key] - } - } - - return result -} - -/** - * Retrieves all the keys that would exist in the flattened version of the object. - * - * @private - * @param {object} obj - The object to get the flat keys of. - * @param {string} prefix - A prefix for the keys, usually `''`. - * @param arrayIdxs - * @param {bool} arrayIdx - Flag indicating if array indexes should be iterated. - * @returns {Array.} An array of keys names. - */ -function flatKeys(obj, prefix, arrayIdxs) { - const keys = [] - const seen = [] - recurse(prefix || '', obj) - return keys - - function recurse(p, o) { - seen.push(o) - - for (const key in o) { - if (seen.indexOf(o[key]) !== -1) { - continue - } - - if (o[key] instanceof Object && (arrayIdxs || !Array.isArray(o[key]))) { - recurse(p + key + '.', o[key]) - } else { - keys.push(p + key) - } - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/get.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/get.js deleted file mode 100644 index 2d1947282..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/get.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -// A simplified implementation of lodash.get -// see: https://www.npmjs.com/package/lodash.get -function get(obj, keys, defaultVal) { - keys = Array.isArray(keys) ? keys : keys.replace(/(\[(\d)\])/g, '.$2').split('.') - obj = obj[keys[0]] - - if (obj && keys.length > 1) { - return get(obj, keys.slice(1), defaultVal) - } - - return obj === undefined ? defaultVal : obj -} - -module.exports = get diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/hashes.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/hashes.js deleted file mode 100644 index 9e269598e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/hashes.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const crypto = require('crypto') - -function encode(bytes, keyBytes) { - for (let i = 0; i < bytes.length; i++) { - // This is really dense but happens commonly so I'm in-lining some of what - // could be tossed into variables. It takes the current byte of bytes, then - // XORs it with the current byte of the key (which uses modulo to make sure - // to not overrun the end.) - bytes.writeUInt8(bytes.readUInt8(i) ^ keyBytes.readUInt8(i % keyBytes.length), i) - } - return bytes -} - -function obfuscateNameUsingKey(name, key) { - const encodedBytes = Buffer.from(name, 'utf-8') - const keyBytes = Buffer.from(key) - return encode(encodedBytes, keyBytes).toString('base64') -} - -function deobfuscateNameUsingKey(name, key) { - const bytes = Buffer.from(name, 'base64') - const keyBytes = Buffer.from(key) - - return encode(bytes, keyBytes).toString('utf-8') -} - -function calculatePathHash(appName, pathName, referingPathHash) { - if (typeof referingPathHash === 'string') { - referingPathHash = parseInt(referingPathHash, 16) - } - const rotated = ((referingPathHash << 1) | (referingPathHash >>> 31)) >>> 0 - const hash = getHash(appName, pathName) - - const result = (rotated ^ hash) >>> 0 - - // This is a trick to pad it out to 8 chars regardless of length. - return ('00000000' + result.toString(16)).substr(-8) -} - -function getHash(appName, txName) { - const md5sum = crypto.createHash('md5') - md5sum.update(appName + ';' + txName, 'utf8') - let buf = md5sum.digest() - if (!(buf instanceof Buffer)) { - buf = Buffer.from(buf) - } - // pull the low 4 bytes in network byte order - return buf.slice(buf.length - 4, buf.length).readUInt32BE(0) -} - -const rand = Math.random - -const max32 = Math.pow(2, 32) - 1 -function randInt32() { - return Math.floor(rand() * max32) -} - -function int32ToByteArray(int32) { - // we want to represent the input as a 4-bytes array - const byteArray = new Uint8Array(4) - - for (let i = 0; i < byteArray.length; i++) { - const byte = int32 & 0xff - byteArray[i] = byte - int32 = (int32 - byte) / 256 - } - - return byteArray -} - -// Lookup table for converting byte values to hex -const byteToHex = [] -for (let i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1) -} - -function makeId(length = 16) { - // length is number of hex characters, which multiplied by 4 is the number of - // bits, then divided by 8 is number of bytes. Or just divide by 2 - const numBytes = Math.ceil(length / 2) - const randBytes = new Uint8Array(numBytes) - - // Generate random bytes one 32-bit integer at a time - const numInts = Math.ceil(numBytes / 4) // 32 bit integers are 4 bytes - for (let i = 0; i < numInts; i++) { - const int = randInt32() - const bytes = int32ToByteArray(int) - for (let j = 0; j < 4; j++) { - // This could "overflow" since we're iterating over the number of ints, which could - // be more data than needed. But out-of-bound index assignment on typed arrays are - // discarded - randBytes[i * 4 + j] = bytes[j] - } - } - - // Convert the byte array to a hex string - let id = '' - for (let i = 0; i < randBytes.length; i++) { - id += byteToHex[randBytes[i]] - } - - // For odd number lengths, we may get an extra character since byteToHex returns two - // characters, so trim to the desired length. - return id.substring(0, length) -} - -exports.obfuscateNameUsingKey = obfuscateNameUsingKey -exports.deobfuscateNameUsingKey = deobfuscateNameUsingKey -exports.calculatePathHash = calculatePathHash -exports.getHash = getHash -exports.makeId = makeId diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/label-parser.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/label-parser.js deleted file mode 100644 index fb18a7248..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/label-parser.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = parse -module.exports.fromString = fromString -module.exports.fromMap = fromMap - -// this creates a copy of trim that can be used with map -const trim = Function.prototype.call.bind(String.prototype.trim) -const logger = require('../logger').child({ component: 'label-parser' }) -const stringify = require('json-stringify-safe') - -function parse(labels) { - let results - - if (!labels) { - return [] - } else if (typeof labels === 'string') { - results = fromString(labels) - } else if (labels) { - results = fromMap(labels) - } - - results.warnings.forEach(function logWarnings(messaage) { - logger.warn(messaage) - }) - - return results.labels -} - -function fromString(raw) { - const map = Object.create(null) - - if (!raw) { - return { labels: [], warnings: [] } - } - - const pairs = raw.split(';').map(trim) - let parts - - while (!pairs[pairs.length - 1]) { - pairs.pop() - } - - while (!pairs[0]) { - pairs.shift() - } - - for (let i = 0, l = pairs.length; i < l; ++i) { - parts = pairs[i].split(':').map(trim) - - if (parts.length !== 2) { - return warn('Could not create a Label pair from ' + parts[i]) - } else if (!parts[0]) { - return warn('Label key can not be empty') - } else if (!parts[1]) { - return warn('Label value can not be empty') - } - - map[parts[0]] = parts[1] - } - - return fromMap(map) - - function warn(message) { - return { labels: [], warnings: ['Invalid Label String: ' + raw, message] } - } -} - -function fromMap(map) { - const warnings = [] - let labels = [] - - Object.keys(map).forEach(function processKeys(key) { - const type = truncate(key, 255) - - if (!map[key] || typeof map[key] !== 'string') { - return warnings.push( - 'Label value for ' + type + 'should be a string with a length between 1 and 255 characters' - ) - } - - const value = truncate(map[key], 255) - - if (type !== key) { - warnings.push('Label key too long: ' + type) - } - - if (value !== map[key]) { - warnings.push('Label value too long: ' + value) - } - - labels.push({ label_type: type, label_value: value }) - }) - - if (labels.length > 64) { - warnings.push('Too many Labels, list truncated to 64') - labels = labels.slice(0, 64) - } - - if (warnings.length) { - try { - warnings.unshift('Partially Invalid Label Setting: ' + stringify(map)) - } catch (err) { - logger.debug(err, 'Failed to stringify labels') - } - } - - return { labels: labels, warnings: warnings } -} - -function truncate(str, max) { - let len = 0 - let i - for (i = 0; i < str.length; ++i) { - const chr = str.charCodeAt(i) - if (chr >= 0xd800 && chr <= 0xdbff && i !== str.length) { - i += 1 - } - - if (++len === max) { - break - } - } - - return str.slice(0, i + 1) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/logger.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/logger.js deleted file mode 100644 index faec2648f..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/logger.js +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const stringify = require('json-stringify-safe') -const util = require('util') -const Readable = require('readable-stream') -const os = require('os') - -module.exports = Logger - -const LEVELS = { - trace: 10, - debug: 20, - info: 30, - warn: 40, - error: 50, - fatal: 60 -} - -// The maximum string length in V8 was somewhere around 256M characters for a -// long time. Note that is characters, not bytes. This limit was upped to around -// 1G characters sometime during Node 8's lifetime (before 8.3.0 I believe). -// Using 128M characters as limit to keep the logger well away from the limit -// and not balloon host machine's memory. -const MAX_LOG_BUFFER = 1024 * 1024 * 128 // 128M characters - -util.inherits(Logger, Readable) - -function Logger(options, extra) { - if (!(this instanceof Logger)) { - return new Logger(options, extra) - } - - Readable.call(this) - const passedInLevel = this.coerce(options.level) - this.options = { - _level: passedInLevel, - enabled: options.enabled === undefined ? true : options.enabled, - configured: options.configured === undefined ? true : !!options.configured - } - this._nestedLog = false - this.name = options.name - this.hostname = options.hostname || os.hostname() - this.extra = extra || Object.create(null) - this.buffer = '' - this.reading = false - this.logQueue = [] - if (options.stream) { - this.pipe(options.stream) - } -} -Logger.MAX_LOG_BUFFER = MAX_LOG_BUFFER - -Logger.prototype.configure = function configure(options) { - if (options.name !== undefined) { - this.name = options.name - } - - if (options.enabled !== undefined) { - this.options.enabled = options.enabled - } - - if (options.level !== undefined) { - this.options._level = this.coerce(options.level) - } - - this.options.configured = true - this._flushQueuedLogs() -} - -Logger.prototype.coerce = function coerce(value) { - if (!isNaN(parseInt(value, 10)) && isFinite(value)) { - // value is numeric - if (value < 10) { - value = 10 - } - if (value > 60) { - value = 60 - } - - return value - } - return LEVELS[value] || 50 -} - -const loggingFunctions = Object.create(null) - -Object.keys(LEVELS).forEach(function buildLevel(_level) { - const level = Logger.prototype.coerce(LEVELS[_level]) - - function log(extra) { - if (!this.options.configured) { - this.logQueue.unshift({ level: _level, args: arguments }) - return - } - - if (!this.options.enabled) { - return false - } - if (level < this.options._level) { - return false - } - - const hasExtra = typeof extra === 'object' - const args = Array.prototype.slice.call(arguments, hasExtra ? 1 : 0) - return this.write(level, args, hasExtra ? extra : null) - } - - loggingFunctions[_level] = function checkLevel() { - log.apply(this, arguments) - } - - const seenMessages = Object.create(null) - loggingFunctions[_level + 'Once'] = function logOnce(key) { - if (typeof key !== 'string') { - this.debug('Attempted to key on a non-string in ' + _level + 'Once: ' + key) - return - } - - if (!this.options.enabled) { - return false - } - if (level < this.options._level) { - return false - } - - if (seenMessages[key] !== true) { - const args = Array.prototype.slice.call(arguments, 1) - const writeSuccessful = log.apply(this, args) - - if (writeSuccessful) { - seenMessages[key] = true - } - } - } - - const seenPerInterval = Object.create(null) - loggingFunctions[_level + 'OncePer'] = function logOncePer(key, interval) { - if (typeof key !== 'string') { - this.debug('Attempted to key on a non-string in ' + _level + 'Once: ' + key) - return - } - - if (!this.options.enabled) { - return false - } - if (level < this.options._level) { - return false - } - - if (seenPerInterval[key] !== true) { - const args = Array.prototype.slice.call(arguments, 2) - const writeSuccessful = log.apply(this, args) - - if (writeSuccessful) { - seenPerInterval[key] = true - - const clearSeen = setTimeout(function clearKey() { - delete seenPerInterval[key] - }, interval) - - clearSeen.unref() - } - } - } - - loggingFunctions[_level + 'Enabled'] = function levelEnabled() { - return level >= this.options._level - } -}) - -Logger.prototype._flushQueuedLogs = function _flushQueuedLogs() { - while (this.logQueue.length) { - const { level, args } = this.logQueue.shift() - this[level].apply(this, args) - } -} - -Object.assign(Logger.prototype, loggingFunctions) - -Logger.prototype.child = function child(extra) { - const childLogger = Object.create(loggingFunctions) - - childLogger.extra = Object.assign(Object.create(null), this.extra, extra) - - const parent = this - childLogger.options = parent.options - - childLogger.write = function write(level, args, _extra) { - _extra = getPropertiesToLog(_extra) - _extra = Object.assign(Object.create(null), this.extra, _extra) - - return parent.write(level, args, _extra) - } - - childLogger.setEnabled = Logger.prototype.setEnabled - childLogger.child = Logger.prototype.child - - return childLogger -} - -Logger.prototype.level = function level(lvl) { - this.options._level = this.coerce(lvl) -} - -Logger.prototype.setEnabled = function setEnabled(enabled) { - if (typeof enabled === 'boolean') { - this.options.enabled = enabled - } -} - -Logger.prototype._read = function _read() { - if (this.buffer.length !== 0) { - this.reading = this.push(this.buffer) - this.buffer = '' - } else { - this.reading = true - } -} - -/** - * For performance reasons we do not support %j because we will have - * already converted the objects to strings. - * Returns a boolean representing the status of the write - * (success/failure) - * - * @param level - * @param args - * @param extra - */ -Logger.prototype.write = function write(level, args, extra) { - if (this._nestedLog) { - // This log is downstream of another log call and should be ignored - return - } - this._nestedLog = true - for (let i = 0, l = args.length; i < l; ++i) { - if (typeof args[i] === 'function') { - args[i] = args[i].valueOf() - } else if (typeof args[i] === 'object') { - try { - args[i] = stringify(args[i]) - } catch (err) { - // eslint-disable-line no-unused-vars - this.debug('Failed to stringfy object for log') - args[i] = '[UNPARSABLE OBJECT]' - } - } - } - - const entry = new Entry(this, level, util.format.apply(util, args)) - - Object.assign(entry, this.extra, getPropertiesToLog(extra)) - - let data = '' - try { - data = stringify(entry) + '\n' - } catch (err) { - // eslint-disable-line no-unused-vars - this.debug('Unabled to stringify log message') - } - - if (this.reading) { - this.reading = this.push(data) - } else if (this.buffer.length + data.length < MAX_LOG_BUFFER) { - this.buffer += data - } else if (process.emitWarning) { - process.emitWarning( - 'Dropping log message, buffer would overflow.', - 'NewRelicWarning', - 'NRWARN001' - ) - } - this._nestedLog = false - return true -} - -function Entry(logger, level, msg) { - this.v = 0 - this.level = level - this.name = logger.name - this.hostname = logger.hostname - this.pid = process.pid - this.time = new Date().toISOString() - this.msg = msg -} - -function getPropertiesToLog(extra) { - const obj = Object.assign(Object.create(null), extra) - // Error properties (message, stack) are not enumerable, so getting them directly - if (extra instanceof Error) { - const names = Object.getOwnPropertyNames(extra) - if (names) { - for (let i = 0; i < names.length; i++) { - obj[names[i]] = extra[names[i]] - } - } - } - return obj -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/process-version.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/process-version.js deleted file mode 100644 index 6a8d3975e..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/process-version.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const semver = require('semver') - -// The logger needs to be lazy-loaded to get around ordering issues with config. -let logger = null - -exports.satisfies = satisfies -exports.prerelease = prerelease - -/** - * Safely checks if the process version satisfies the given semver range. - * - * @param {string} check - The semantic version range to check. - * @returns {bool} True if the process version satisfies the given version, false - * otherwise. - */ -function satisfies(check) { - try { - return semver.satisfies(process.version, check) - } catch (e) { - _logWarn(e, 'Bad process version for satisfies check.') - return false - } -} - -/** - * Safely checks if the process version is a pre-release version. - * - * @returns {bool} True if the process version is pre-release, false otherwise. - */ -function prerelease() { - try { - return semver.prerelease(process.version) - } catch (e) { - _logWarn(e, 'Bad process version for prelease check.') - return false - } -} - -function _logWarn() { - if (!logger) { - logger = require('../logger').child({ component: 'util-process-version' }) - } - logger.warn.apply(logger, arguments) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/properties.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/properties.js deleted file mode 100644 index 73acde84c..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/properties.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const hasOwnProperty = Object.hasOwnProperty - -/** - * Checks if an object has its own property with the given key. - * - * It is possible to create objects which do not inherit from `Object` by doing - * `Object.create(null)`. These objects do not have the `hasOwnProperty` method. - * This method uses a cached version of `hasOwnProperty` to check for the - * property, thus avoiding the potential `undefined is not a function` error. - * - * @private - * @param {*} obj - The item to check for the property on. - * @param {string} key - The name of the property to look for. - * @returns {bool} True if the given object has its own property with the given - * key. - */ -exports.hasOwn = function hasOwn(obj, key) { - return hasOwnProperty.call(obj, key) -} - -/** - * Checks if a given object is empty. - * - * @param {*} obj - The object to check for properties on. - * @returns {bool} True if the object has no keys of its own. - */ -exports.isEmpty = function isEmpty(obj) { - // Use this case for null prototyped objects. - for (const key in obj) { - if (exports.hasOwn(obj, key)) { - return false - } - } - return true -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/sql/obfuscate.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/sql/obfuscate.js deleted file mode 100644 index b780a04b9..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/sql/obfuscate.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -module.exports = obfuscate - -const singleQuote = /'(?:''|[^'])*?(?:\\'.*|'(?!'))/ -const doubleQuote = /"(?:[^"]|"")*?(?:\\".*|"(?!"))/ -const dollarQuote = /(\$(?!\d)[^$]*?\$).*?(?:\1|$)/ -const oracleQuote = /q'\[.*?(?:\]'|$)|q'\{.*?(?:\}'|$)|q'\<.*?(?:\>'|$)|q'\(.*?(?:\)'|$)/ -const comment = /(?:#|--).*?(?=\r|\n|$)/ -const multilineComment = /\/\*(?:[^/]|\/[^*])*?(?:\*\/|\/\*.*)/ -const uuid = /\{?(?:[0-9a-f]\-*){32}\}?/ -const hex = /0x[0-9a-f]+/ -const boolean = /true|false|null/ -const number = /\b-?(?:[0-9]+\.)?[0-9]+([eE][+-]?[0-9]+)?/ - -const dialects = (obfuscate.dialects = Object.create(null)) - -dialects.mysql = [ - replacer(join([doubleQuote, singleQuote, comment, multilineComment, hex, boolean, number], 'gi')), - unmatchedPairs(/'|"|\/\*|\*\//) -] - -dialects.postgres = [ - replacer( - join([dollarQuote, singleQuote, comment, multilineComment, uuid, boolean, number], 'gi') - ), - unmatchedPairs(/'|\/\*|\*\/|(?:\$(?!\?))/) -] - -dialects.cassandra = [ - replacer(join([singleQuote, comment, multilineComment, uuid, hex, boolean, number], 'gi')), - unmatchedPairs(/'|\/\*|\*\//) -] - -dialects.oracle = [ - replacer(join([oracleQuote, singleQuote, comment, multilineComment, number], 'gi')), - unmatchedPairs(/'|\/\*|\*\//) -] - -dialects.default = dialects.mysql - -function obfuscate(raw, dialect) { - let replacers = dialects[dialect] - if (!replacers) { - replacers = dialects.default - } - - let obfuscated = raw - for (let i = 0, l = replacers.length; i < l; ++i) { - obfuscated = replacers[i](obfuscated) - } - - return obfuscated -} - -function join(expressions, flags) { - return new RegExp(expressions.map(toPart).join('|'), flags) -} - -function toPart(expressions) { - return expressions.toString().slice(1, -1) -} - -function replacer(regex) { - function replace(sql) { - return sql.replace(regex, '?') - } - replace.regex = regex - - return replace -} - -function unmatchedPairs(regex) { - function check(sql) { - return regex.test(sql) ? '?' : sql - } - check.regex = regex - - return check -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/stream-sink.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/stream-sink.js deleted file mode 100644 index 3f81574f4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/stream-sink.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const EventEmitter = require('events').EventEmitter -const util = require('util') - -/** - * Pipe a readable stream into this sink that fulfills the Writable Stream - * contract and the callback will be fired when the stream has been completely - * read. - * - * @param callback - */ -function StreamSink(callback) { - EventEmitter.call(this) - - this.callback = callback - this.sink = '' - this.writable = true - - const sink = this - this.on('error', function handleError(error) { - sink.writable = false - callback(error) - }) -} -util.inherits(StreamSink, EventEmitter) - -StreamSink.prototype.write = function write(string) { - if (!this.writable) { - this.emit('error', new Error('Sink no longer writable!')) - return false - } - - // Explicitly copy buffer contents so we are sure to release references to - // the TLS slab buffer region. - this.sink += string.toString() - - return true -} - -StreamSink.prototype.end = function end() { - this.writable = false - - this.callback(null, this.sink) -} - -StreamSink.prototype.destroy = function destroy() { - this.emit('close') - this.writable = false - - delete this.sink -} - -module.exports = StreamSink diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/unwrapped-core.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/unwrapped-core.js deleted file mode 100644 index 6df9433ba..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/unwrapped-core.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const copy = require('./copy') -const fs = require('fs') -const fsPromises = require('fs/promises') - -exports.fs = copy.shallow(fs) -exports.fsPromises = copy.shallow(fsPromises) diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/urltils.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/urltils.js deleted file mode 100644 index 8652f8a03..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/util/urltils.js +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const url = require('url') -const logger = require('../logger').child({ component: 'urltils' }) - -const LOCALHOST_NAMES = { - 'localhost': true, - '127.0.0.1': true, - '0.0.0.0': true, - '0:0:0:0:0:0:0:1': true, - '::1': true, - '0:0:0:0:0:0:0:0': true, - '::': true -} - -/** - * Utility functions for enforcing New Relic naming conditions on URLs, - * and extracting and setting parameters on traces / web trace segments. - */ -module.exports = { - /** - * Dictionary whose keys are all synonyms for localhost. - * - * @constant - */ - LOCALHOST_NAMES: LOCALHOST_NAMES, - - /** - * Checks if the given name is in the dictionary of localhost names. - * - * @param {string} host - The hostname to lookup. - * @returns {bool} - True if the given hostname is a synonym for localhost. - */ - isLocalhost: function isLocahost(host) { - return LOCALHOST_NAMES[host] != null - }, - - /** - * This was handed down from the prototype as the canonical list of status - * codes that short-circuit naming and normalization. The agent can be - * configured to mark HTTP status codes as not being errors. - * - * @param {Config} config The configuration containing the error list. - * @param {string} code The HTTP status code to check. - * @returns {bool} Whether the status code should be ignored. - */ - isError: function isError(config, code) { - return code >= 400 && !isIgnoredStatusCodeForErrors(config, code) - }, - - /** - * Returns true if the status code is an HTTP error, and it is configured to be ignored. - * - * @param {Config} config The configuration containing the error list. - * @param {string} code The HTTP status code to check. - * @returns {bool} Whether the status code should be ignored. - */ - isIgnoredError: function isIgnoredError(config, code) { - return code >= 400 && isIgnoredStatusCodeForErrors(config, code) - }, - - /** - * Returns true if the status code is configured to be expected - * - * @param {Config} config The configuration containing the error list. - * @param {string} code The HTTP status code to check. - * @returns {bool} Whether the status code is expected. - */ - isExpectedError: function isExpectedError(config, code) { - return isExpectedStatusCodeForErrors(config, code) - }, - - /** - * Get back the pieces of the URL that New Relic cares about. Apply these - * restrictions, in order: - * - * 1. Ensure that after parsing the URL, there's at least '/' - * 2. Strip off session trackers after ';' (a New Relic convention) - * 3. Remove trailing slash. - * - * @param {string} requestURL The URL fragment to be scrubbed. - * @returns {string} The cleaned URL. - */ - scrub: function scrub(requestURL) { - if (typeof requestURL === 'string') { - requestURL = url.parse(requestURL) - } - - let path = requestURL.pathname - - if (path) { - path = path.split(';')[0] - - if (path !== '/' && path.charAt(path.length - 1) === '/') { - path = path.substring(0, path.length - 1) - } - } else { - path = '/' - } - - return path - }, - - /** - * Extract query parameters, dealing with bare parameters and parameters with - * no value as appropriate: - * - * 'var1&var2=value' is not necessarily the same as 'var1=&var2=value' - * - * In my world, one is an assertion of presence, and the other is an empty - * variable. Some web frameworks behave this way as well, so don't lose - * information. - * - * @param {string} requestURL The URL to be parsed. - * @returns {object} The parameters parsed from the request - */ - parseParameters: function parseParameters(requestURL) { - let parsed = requestURL - - if (typeof requestURL === 'string') { - parsed = url.parse(requestURL, true) - } - - const parameters = Object.create(null) - - if (parsed.query) { - const keys = Object.keys(parsed.query) - - for (let i = 0, l = keys.length; i < l; ++i) { - const key = keys[i] - if (parsed.query[key] === '' && parsed.path.indexOf(key + '=') === -1) { - parameters[key] = true - } else { - parameters[key] = parsed.query[key] - } - } - } - - return parameters - }, - - /** - * Performs the logic of `urltils.scrub` and `urltils.parseParameters` with - * only a single parse of the given URL. - * - * @param {string} requestURL - The URL to scrub and extra parameters from. - * @returns {object} An object containing the scrubbed url at `.path` and the - * parsed parameters at `.parameters`. - */ - scrubAndParseParameters: function scrubAndParseParameters(requestURL) { - if (typeof requestURL === 'string') { - requestURL = url.parse(requestURL, true) - } - return { - protocol: requestURL.protocol, - path: this.scrub(requestURL), - parameters: this.parseParameters(requestURL) - } - }, - - /** - * Obfuscates path parameters with regex from config - * - * @param {Config} config The configuration containing the regex - * @param {string} path The path to be obfuscated - * @returns {string} The obfuscated path or the original path - */ - obfuscatePath: function obfuscatePath(config, path) { - const { enabled, regex } = config.url_obfuscation - if (typeof path !== 'string' || !enabled || !regex) { - return path - } - - const { pattern, flags = '', replacement = '' } = regex - try { - const regexPattern = new RegExp(pattern, flags) - return path.replace(regexPattern, replacement) - } catch (e) { - logger.warn('Invalid regular expression for url_obfuscation.regex.pattern', pattern) - return path - } - }, - - /** - * Copy a set of request parameters from one object to another, - * but do not overwrite any existing parameters in destination, - * including parameters set to null or undefined. - * - * @param {object} source Parameters to be copied (not changed). - * @param {object} destination Dictionary to which parameters are copied - * (mutated in place). - */ - copyParameters: function copyParameters(source, destination) { - if (source && destination) { - const keys = Object.keys(source) - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - if (!(key in destination)) { - destination[key] = source[key] - } - } - } - }, - - /** - * Copy a set of request parameters from one object to another. - * Existing attributes on the `destination` will be overwritten. - * - * @param {object} source Parameters to be copied (not changed). - * @param {object} destination Dictionary to which parameters are copied - * (mutated in place). - */ - overwriteParameters: function overwriteParameters(source, destination) { - const keys = Object.keys(source) - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - destination[key] = source[key] - } - } -} - -function isIgnoredStatusCodeForErrors(config, code) { - let codes = [] - if (config && config.error_collector && config.error_collector.ignore_status_codes) { - codes = config.error_collector.ignore_status_codes - } - return codes.indexOf(parseInt(code, 10)) >= 0 -} - -function isExpectedStatusCodeForErrors(config, code) { - let codes = [] - if (config && config.error_collector && config.error_collector.expected_status_codes) { - codes = config.error_collector.expected_status_codes - } - return codes.indexOf(parseInt(code, 10)) >= 0 -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/aws-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/aws-info.js deleted file mode 100644 index 7205b62b4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/aws-info.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger.js').child({ component: 'aws-info' }) -const common = require('./common') -const NAMES = require('../metrics/names.js') -let results = null -const INSTANCE_HOST = '169.254.169.254' - -module.exports = fetchAWSInfo -module.exports.clearCache = function clearAWSCache() { - results = null -} - -function fetchAWSInfo(agent, callback) { - if (!agent.config.utilization || !agent.config.utilization.detect_aws) { - return setImmediate(callback, null) - } - - if (results) { - return setImmediate(callback, null, results) - } - - const authTokenOpts = { - headers: { 'X-aws-ec2-metadata-token-ttl-seconds': '21600' }, - host: INSTANCE_HOST, - method: 'PUT', - path: '/latest/api/token', - timeout: 500 - } - common.request(authTokenOpts, agent, function getAuthToken(err, authToken) { - if (err) { - logger.debug('Failed to get AWS auth token.') - return callback(err) - } - - const metadataOpts = { - headers: { 'X-aws-ec2-metadata-token': authToken }, - host: INSTANCE_HOST, - method: 'GET', - path: '/latest/dynamic/instance-identity/document', - timeout: 500 - } - - common.request(metadataOpts, agent, function getMetadata(metaErr, data) { - if (metaErr) { - return callback(metaErr) - } - - try { - data = JSON.parse(data) - } catch (e) { - logger.debug(e, 'Failed to parse AWS metadata.') - data = null - } - - results = common.getKeys(data, ['availabilityZone', 'instanceId', 'instanceType']) - if (results == null) { - logger.debug('AWS metadata was invalid.') - agent.metrics.getOrCreateMetric(NAMES.UTILIZATION.AWS_ERROR).incrementCallCount() - } - callback(null, results) - }) - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/azure-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/azure-info.js deleted file mode 100644 index a3ce0dcae..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/azure-info.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const common = require('./common') -const logger = require('../logger.js').child({ component: 'azure-info' }) -const NAMES = require('../metrics/names.js') -let results = null - -module.exports = fetchAzureInfo -module.exports.clearCache = function clearAzureCache() { - results = null -} - -function fetchAzureInfo(agent, callback) { - if (!agent.config.utilization || !agent.config.utilization.detect_azure) { - return setImmediate(callback, null, null) - } - - if (results) { - return setImmediate(callback, null, results) - } - - const instanceHost = '169.254.169.254' - const apiVersion = '2017-03-01' - const endpoint = '/metadata/instance/compute' - common.request( - { - host: instanceHost, - path: endpoint + '?api-version=' + apiVersion, - headers: { Metadata: 'true' } - }, - agent, - function getMetadata(err, data) { - if (err) { - return callback(err) - } - - // Hopefully the data is parsable as JSON. - try { - data = JSON.parse(data) - } catch (e) { - logger.debug(e, 'Failed to parse Azure metadata.') - data = null - } - - // Get out just the keys we care about. - results = common.getKeys(data, ['location', 'name', 'vmId', 'vmSize']) - if (results == null) { - logger.debug('Azure metadata was invalid.') - agent.metrics.getOrCreateMetric(NAMES.UTILIZATION.AZURE_ERROR).incrementCallCount() - } - - // Call back! - callback(null, results) - } - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/common.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/common.js deleted file mode 100644 index b5721fa9b..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/common.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const concat = require('concat-stream') -const http = require('http') -const logger = require('../logger').child({ component: 'utilization-request' }) -const fs = require('../util/unwrapped-core').fs -const properties = require('../util/properties') -const url = require('url') - -exports.checkValueString = checkValueString -function checkValueString(str) { - if (!str || !str.length || Buffer.byteLength(str) > 255) { - return false - } - - const len = str.length - const validCharacters = /[0-9a-zA-Z_ ./-]/ - for (let i = 0; i < len; ++i) { - if (str.charCodeAt(i) < 128 && !validCharacters.test(str[i])) { - return false - } - } - return true -} - -exports.getKeys = function getKeys(data, keys) { - if (!data) { - return null - } - - const results = Object.create(null) - for (let i = 0; i < keys.length; ++i) { - const key = keys[i] - if (!properties.hasOwn(data, key) || !data[key]) { - logger.debug('Key %s missing from metadata', key) - return null - } - let value = data[key] - if (typeof value === 'number') { - value = value.toString() - } - - // If any value is invalid, the whole thing must be trashed. - if (!checkValueString(value)) { - logger.debug('Invalid metadata value found: %s -> %s', key, value) - return null - } - results[key] = value - } - - return results -} - -exports.request = function request(opts, agent, cb) { - // Add default timeout of a second to the request - - if (typeof opts === 'string') { - opts = url.parse(opts) - } - - opts.timeout = opts.timeout || 1000 - - // This can make more that GET requests if you pass in an object - // Node.js just pass this method into ClientRequest which accepts - // any valid HTTP Method - // see: https://github.com/nodejs/node/blob/master/lib/http.js#L106 - // Technically this wouldn't work for a PUT/POST with a body - // but works fine in all cases where this is being used. - const req = http.get(opts, function awsRequest(res) { - res.pipe(concat(respond)) - function respond(data) { - agent.removeListener('errored', abortRequest) - agent.removeListener('stopped', abortRequest) - agent.removeListener('disconnected', abortRequest) - - if (res.statusCode !== 200) { - logger.debug( - 'Got %d %s from metadata request %j', - res.statusCode, - res.statusMessage || '', - opts - ) - return cb(new Error('Request for metadata failed.')) - } else if (!data) { - logger.debug('Got no response data?') - return cb(new Error('No response data received.')) - } - - cb(null, data.toString('utf8')) - } - }) - - req.on('timeout', abortRequest) - - req.on('error', function requestError(err) { - if (err.code === 'ECONNRESET') { - logger.debug('Request for metadata %j timed out', opts) - return cb(err) - } - - logger.debug('Message for metadata %j: %s', opts, err.message) - cb(err) - }) - agent.once('errored', abortRequest) - agent.once('stopped', abortRequest) - agent.once('disconnected', abortRequest) - - function abortRequest() { - logger.debug('Aborting request for metadata at %j', opts) - req.abort() - agent.removeListener('errored', abortRequest) - agent.removeListener('stopped', abortRequest) - agent.removeListener('disconnected', abortRequest) - } -} - -exports.readProc = readProc -function readProc(path, callback) { - fs.readFile(path, function readProcFile(err, data) { - if (err) { - logger.error(err, 'Error when trying to read %s', path) - callback(err, null) - } else { - callback(null, data.toString()) - } - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/docker-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/docker-info.js deleted file mode 100644 index a5b26717f..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/docker-info.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'docker-info' }) -const common = require('./common') -const NAMES = require('../metrics/names') -const os = require('os') -let vendorInfo = null - -module.exports.getVendorInfo = fetchDockerVendorInfo -module.exports.clearVendorCache = function clearDockerVendorCache() { - vendorInfo = null -} - -module.exports.getBootId = function getBootId(agent, callback) { - if (!/linux/i.test(os.platform())) { - logger.debug('Platform is not a flavor of linux, omitting boot info') - return setImmediate(callback, null, null) - } - - common.readProc('/proc/sys/kernel/random/boot_id', function readProcBootId(err, data) { - if (!data) { - bootIdError() - return callback(null, null) - } - - data = data.trim() - const asciiData = Buffer.from(data, 'ascii').toString() - - if (data !== asciiData) { - bootIdError() - return callback(null, null) - } - - if (data.length !== 36) { - bootIdError() - if (data.length > 128) { - data = data.substr(0, 128) - } - } - - return callback(null, data) - }) - - function bootIdError() { - agent.metrics.getOrCreateMetric(NAMES.UTILIZATION.BOOT_ID_ERROR).incrementCallCount() - } -} - -function fetchDockerVendorInfo(agent, callback) { - if (!agent.config.utilization || !agent.config.utilization.detect_docker) { - return callback(null, null) - } - - if (vendorInfo) { - return callback(null, vendorInfo) - } - - if (!os.platform().match(/linux/i)) { - logger.debug('Platform is not a flavor of linux, omitting docker info') - return callback(null) - } - - common.readProc('/proc/self/cgroup', function getCGroup(err, data) { - if (!data) { - return callback(null) - } - - let id = null - findCGroups(data, 'cpu', function forEachCpuGroup(cpuGroup) { - const match = /(?:^|[^0-9a-f])([0-9a-f]{64})(?:[^0-9a-f]|$)/.exec(cpuGroup) - if (match) { - id = match[1] - return false - } - - return true - }) - - if (id) { - vendorInfo = { id: id } - callback(null, vendorInfo) - } else { - logger.debug('No matching cpu group found.') - callback(null, null) - } - }) -} - -function findCGroups(info, cgroup, eachCb) { - const target = new RegExp('^\\d+:[^:]*?\\b' + cgroup + '\\b[^:]*:') - const lines = info.split('\n') - for (let i = 0; i < lines.length; ++i) { - const line = lines[i] - if (target.test(line) && !eachCb(line.split(':')[2])) { - break - } - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/gcp-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/gcp-info.js deleted file mode 100644 index 990c4f73d..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/gcp-info.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger.js').child({ component: 'gcp-info' }) -const common = require('./common') -const NAMES = require('../metrics/names.js') -const JSONbig = require('json-bigint')({ useNativeBigInt: true }) -let resultDict = null - -module.exports = fetchGCPInfo -module.exports.clearCache = function clearGCPCache() { - resultDict = null -} - -function fetchGCPInfo(agent, callback) { - if (!agent.config.utilization || !agent.config.utilization.detect_gcp) { - return setImmediate(callback, null) - } - - if (resultDict) { - return setImmediate(callback, null, resultDict) - } - - common.request( - { - host: 'metadata.google.internal', - path: '/computeMetadata/v1/instance/?recursive=true', - headers: { - 'Metadata-Flavor': 'Google' - } - }, - agent, - function getMetadata(err, data) { - if (err) { - return callback(err) - } - try { - data = JSONbig.parse(data) - if (typeof data.id !== 'string') { - data.id = data.id.toString() - } - } catch (e) { - logger.debug(e, 'Failed to parse GCP metadata.') - data = null - } - - const results = common.getKeys(data, ['id', 'machineType', 'name', 'zone']) - if (results == null) { - logger.debug('GCP metadata was invalid.') - agent.metrics.getOrCreateMetric(NAMES.UTILIZATION.GCP_ERROR).incrementCallCount() - } else { - // normalize - results.machineType = results.machineType.substr(results.machineType.lastIndexOf('/') + 1) - results.zone = results.zone.substr(results.zone.lastIndexOf('/') + 1) - - resultDict = results - } - callback(null, results) - } - ) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/index.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/index.js deleted file mode 100644 index 887bdeb95..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger').child({ component: 'utilization' }) - -const VENDOR_METHODS = { - aws: require('./aws-info'), - pcf: require('./pcf-info'), - azure: require('./azure-info'), - gcp: require('./gcp-info'), - docker: require('./docker-info').getVendorInfo, - kubernetes: require('./kubernetes-info') -} -const VENDOR_NAMES = Object.keys(VENDOR_METHODS) - -module.exports.getVendors = getVendors -function getVendors(agent, callback) { - let done = 0 - let vendors = null - VENDOR_NAMES.forEach(function getVendorInfo(vendor) { - VENDOR_METHODS[vendor](agent, function getInfo(err, result) { - logger.trace('Vendor %s finished.', vendor) - if (result) { - vendors = vendors || Object.create(null) - vendors[vendor] = result - } - - if (++done === VENDOR_NAMES.length) { - callback(null, vendors) - } - }) - }) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/kubernetes-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/kubernetes-info.js deleted file mode 100644 index 2845b7b89..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/kubernetes-info.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' -const logger = require('../logger').child({ component: 'kubernetes-info' }) - -let info = null - -module.exports = getKubernetesInfo -module.exports.clearCache = function clearAWSCache() { - info = null -} - -function getKubernetesInfo(agent, callback) { - if (!agent.config.utilization || !agent.config.utilization.detect_kubernetes) { - return setImmediate(callback, null, null) - } - - if (info) { - return setImmediate(callback, null, info) - } - - if (!process.env.KUBERNETES_SERVICE_HOST) { - logger.debug('No Kubernetes service host found.') - return setImmediate(callback, null, null) - } - - info = { kubernetes_service_host: process.env.KUBERNETES_SERVICE_HOST } - - setImmediate(callback, null, info) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/pcf-info.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/pcf-info.js deleted file mode 100644 index 569ac6d83..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/lib/utilization/pcf-info.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('../logger.js').child({ component: 'pcf-info' }) -const NAMES = require('../metrics/names.js') -const common = require('./common') - -module.exports = fetchPCFInfo - -function fetchPCFInfo(agent, callback) { - if (!agent.config.utilization || !agent.config.utilization.detect_pcf) { - return setImmediate(callback, null, null) - } - - const metadataMap = { - CF_INSTANCE_GUID: 'cf_instance_guid', - CF_INSTANCE_IP: 'cf_instance_ip', - MEMORY_LIMIT: 'memory_limit' - } - - const results = Object.create(null) - const keys = Object.keys(metadataMap) - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - const value = process.env[key] - if (value == null) { - logger.trace('Could not find environment value for %s', key) - return setImmediate(callback, null, null) - } - if (!common.checkValueString(value)) { - logger.trace('Invalid environment value for %s: %j', key, value) - agent.metrics.getOrCreateMetric(NAMES.UTILIZATION.PCF_ERROR).incrementCallCount() - return setImmediate(callback, null, null) - } - results[metadataMap[key]] = value - } - - setImmediate(callback, null, results) -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/newrelic.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/newrelic.js deleted file mode 100644 index ba6767d04..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/newrelic.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict' -/** - * New Relic agent configuration. - * - * See lib/config/default.js in the agent distribution for a more complete - * description of configuration variables and their potential values. - */ -exports.config = { - /** - * Array of application names. - */ - app_name: ['My Application'], - /** - * Your New Relic license key. - */ - license_key: 'license key here', - logging: { - /** - * Level at which to log. 'trace' is most useful to New Relic when diagnosing - * issues with the agent, 'info' and higher will impose the least overhead on - * production applications. - */ - level: 'info' - }, - /** - * When true, all request headers except for those listed in attributes.exclude - * will be captured for all traces, unless otherwise specified in a destination's - * attributes include/exclude lists. - */ - allow_all_headers: true, - attributes: { - /** - * Prefix of attributes to exclude from all destinations. Allows * as wildcard - * at end. - * - * NOTE: If excluding headers, they must be in camelCase form to be filtered. - * - * @name NEW_RELIC_ATTRIBUTES_EXCLUDE - */ - exclude: [ - 'request.headers.cookie', - 'request.headers.authorization', - 'request.headers.proxyAuthorization', - 'request.headers.setCookie*', - 'request.headers.x*', - 'response.headers.cookie', - 'response.headers.authorization', - 'response.headers.proxyAuthorization', - 'response.headers.setCookie*', - 'response.headers.x*' - ] - } -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/package.json b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/package.json deleted file mode 100644 index 990549ed4..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/package.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "name": "newrelic", - "version": "10.1.0", - "author": "New Relic Node.js agent team ", - "license": "Apache-2.0", - "contributors": [ - { - "name": "Saxon D'Aubin", - "email": "saxon@newrelic.com", - "web": "http://newrelic.com" - }, - { - "name": "Forrest L Norvell", - "email": "forrest@newrelic.com", - "web": "http://newrelic.com/" - }, - { - "name": "Jacob Groundwater", - "email": "jacob@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Wraithan (Chris McDonald)", - "email": "wmcdonald@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Michael Hayes", - "email": "mhayes@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Bryan Clement", - "email": "bclement@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Jeff Olfert", - "email": "jolfert@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Wilson Bilkovich", - "email": "wbilkovich@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Jonathan Merrill", - "email": "jmerrill@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Martin Kuba", - "email": "mkuba@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Tim Krajcar", - "email": "tkrajcar@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Eric Wang", - "email": "ewang@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Natalie Wolfe", - "email": "nwolfe@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Seth Shober", - "email": "sshober@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Peter Svetlichny", - "email": "psvetlichny@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Michael Goin", - "email": "mgoin@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Alan Storm", - "email": "astorm@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Carlo Pearson", - "email": "cpearson@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Nick Tzaperas", - "email": "ntzaperas@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Bob Evans", - "email": "revans@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Diana Thayer", - "email": "dthayer@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Jordi Gutiérrez Hermoso", - "email": "jgutierrezhermoso@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Maurice Rickard", - "email": "mrickard@newrelic.com", - "web": "https://newrelic.com" - }, - { - "name": "Jessica Lopatta", - "email": "jlopatta@newrelic.com", - "web": "https://newrelic.com" - } - ], - "description": "New Relic agent", - "keywords": [ - "apm", - "performance", - "monitoring", - "instrumentation", - "debugging", - "profiling" - ], - "homepage": "https://github.com/newrelic/node-newrelic", - "engines": { - "node": ">=14", - "npm": ">=6.0.0" - }, - "directories": { - "lib": "lib" - }, - "scripts": { - "bench": "node ./bin/run-bench.js", - "docker-env": "./bin/docker-env-vars.sh", - "docs": "npm ci && jsdoc -c ./jsdoc-conf.json --private -r .", - "integration": "npm run prepare-test && npm run sub-install && time c8 -o ./coverage/integration tap --test-regex='(\\/|^test\\/integration\\/.*\\.tap\\.js)$' --timeout=180 --no-coverage --reporter classic", - "integration:async-local": "npm run prepare-test && npm run sub-install && time c8 -o ./coverage/integration-async-local tap --test-regex='(\\/|^test\\/integration\\/.*\\.tap\\.js)$' --timeout=360 --no-coverage --reporter classic --test-env=NEW_RELIC_FEATURE_FLAG_ASYNC_LOCAL_CONTEXT=1", - "prepare-test": "npm run ssl && npm run docker-env", - "lint": "eslint ./*.{js,mjs} lib test bin examples", - "lint:fix": "eslint --fix, ./*.{js,mjs} lib test bin examples", - "lint:lockfile": "lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https --validate-integrity", - "public-docs": "jsdoc -c ./jsdoc-conf.json --tutorials examples/shim api.js lib/shim/ lib/transaction/handle.js && cp examples/shim/*.png out/", - "publish-docs": "./bin/publish-docs.sh", - "services": "./bin/docker-services.sh", - "smoke": "npm run ssl && time tap test/smoke/**/**/*.tap.js --timeout=180 --no-coverage", - "ssl": "./bin/ssl.sh", - "sub-install": "node test/bin/install_sub_deps", - "test": "npm run integration && npm run unit && npm run unit:esm", - "third-party-updates": "oss third-party manifest --includeOptDeps && oss third-party notices --includeOptDeps && git add THIRD_PARTY_NOTICES.md third_party_manifest.json", - "unit": "rm -f newrelic_agent.log && time c8 -o ./coverage/unit tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.js)$' --timeout=180 --no-coverage --reporter classic", - "unit:scripts": "time c8 -o ./coverage/scripts-unit tap --test-regex='(\\/|^bin\\/test\\/.*\\.test\\.js)$' --timeout=180 --no-coverage --reporter classic", - "unit:async-local": "rm -f newrelic_agent.log && time tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.js)$' --timeout=180 --no-coverage --reporter classic --test-env=NEW_RELIC_FEATURE_FLAG_ASYNC_LOCAL_CONTEXT=1", - "unit:esm": "rm -f newrelic_agent.log && time c8 -o ./coverage/esm-unit --include *.mjs --include **/*.mjs --exclude false tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.mjs)$' --timeout=180 --no-coverage --reporter classic --node-arg=--experimental-loader=testdouble", - "update-cross-agent-tests": "./bin/update-cats.sh", - "versioned-tests": "./bin/run-versioned-tests.sh", - "update-changelog-version": "node ./bin/update-changelog-version", - "checkout-external-versioned": "node ./test/versioned-external/checkout-external-tests.js", - "versioned": "npm run versioned:npm7", - "versioned:major": "VERSIONED_MODE=--major npm run versioned:npm7", - "versioned:npm6": "npm run checkout-external-versioned && npm run prepare-test && time ./bin/run-versioned-tests.sh", - "versioned:npm7": "npm run checkout-external-versioned && npm run prepare-test && NPM7=1 time ./bin/run-versioned-tests.sh", - "versioned:async-local": "NEW_RELIC_FEATURE_FLAG_ASYNC_LOCAL_CONTEXT=1 npm run versioned:npm7", - "versioned:async-local:major": "NEW_RELIC_FEATURE_FLAG_ASYNC_LOCAL_CONTEXT=1 npm run versioned:major", - "prepare": "husky install" - }, - "bin": { - "newrelic-naming-rules": "./bin/test-naming-rules.js" - }, - "dependencies": { - "@grpc/grpc-js": "^1.8.10", - "@grpc/proto-loader": "^0.7.5", - "@newrelic/aws-sdk": "^5.0.2", - "@newrelic/koa": "^7.1.1", - "@newrelic/superagent": "^6.0.0", - "@tyriar/fibonacci-heap": "^2.0.7", - "concat-stream": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "json-bigint": "^1.0.0", - "json-stringify-safe": "^5.0.0", - "readable-stream": "^3.6.1", - "semver": "^5.3.0", - "winston-transport": "^4.5.0" - }, - "optionalDependencies": { - "@contrast/fn-inspect": "^3.3.0", - "@newrelic/native-metrics": "^9.0.0" - }, - "devDependencies": { - "@newrelic/eslint-config": "^0.3.0", - "@newrelic/newrelic-oss-cli": "^0.1.2", - "@newrelic/proxy": "^2.0.0", - "@newrelic/test-utilities": "^7.3.0", - "@octokit/rest": "^18.0.15", - "@slack/bolt": "^3.7.0", - "ajv": "^6.12.6", - "async": "^3.2.4", - "c8": "^7.12.0", - "chai": "^4.1.2", - "clean-jsdoc-theme": "^4.2.4", - "commander": "^7.0.0", - "eslint": "^8.24.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-disable": "^2.0.1", - "eslint-plugin-header": "^3.1.1", - "eslint-plugin-jsdoc": "^39.3.6", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^3.4.0", - "eslint-plugin-sonarjs": "^0.18.0", - "express": "*", - "glob": "^7.1.2", - "got": "^11.8.5", - "husky": "^6.0.0", - "jsdoc": "^4.0.0", - "lint-staged": "^11.0.0", - "lockfile-lint": "^4.9.6", - "memcached": ">=0.2.8", - "nock": "11.8.0", - "prettier": "^2.3.2", - "proxyquire": "^1.8.0", - "q": "*", - "rimraf": "^2.6.3", - "should": "*", - "sinon": "^4.5.0", - "tap": "^16.3.4", - "temp": "^0.8.1", - "testdouble": "^3.16.6", - "when": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/newrelic/node-newrelic.git" - }, - "files": [ - "index.js", - "api.js", - "stub_api.js", - "newrelic.js", - "README.md", - "LICENSE", - "NEWS.md", - "THIRD_PARTY_NOTICES.md", - "lib/", - "bin/tracetractor", - "bin/test-naming-rules.js", - "esm-loader.mjs" - ] -} diff --git a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/stub_api.js b/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/stub_api.js deleted file mode 100644 index 9a0a9c560..000000000 --- a/.yarn/unplugged/newrelic-npm-10.1.0-6c0218eb35/node_modules/newrelic/stub_api.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2020 New Relic Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict' - -const logger = require('./lib/logger.js') -const RealAPI = require('./api.js') -const TransactionHandle = require('./lib/transaction/handle') - -/* eslint-disable no-eval */ -function stubFunction(name) { - return eval( - '(function () {return function ' + - name + - '() {' + - "logger.debug('Not calling " + - name + - " because New Relic is disabled.');" + - '}}())' - ) -} -/* eslint-enable no-eval */ - -function Stub() {} - -const keys = Object.keys(RealAPI.prototype) -const length = keys.length - -/* This way the stub API doesn't have to be updated in lockstep with the regular - * API. - */ -for (let i = 0; i < length; i++) { - const functionName = keys[i] - Stub.prototype[functionName] = stubFunction(functionName) -} - -Stub.prototype.startSegment = startSegment -Stub.prototype.startWebTransaction = startWebTransaction -Stub.prototype.startBackgroundTransaction = startBackgroundTransaction -Stub.prototype.getTransaction = getTransaction -Stub.prototype.getBrowserTimingHeader = getBrowserTimingHeader -Stub.prototype.shutdown = shutdown -Stub.prototype.setLambdaHandler = setLambdaHandler -Stub.prototype.getLinkingMetadata = getLinkingMetadata -Stub.prototype.getTraceMetadata = getTraceMetadata - -// This code gets injected into HTML templates -// and we don't want it to return undefined/null. -function getBrowserTimingHeader() { - logger.debug('Not calling getBrowserTimingHeader because New Relic is disabled.') - return '' -} - -function getTransaction() { - return new TransactionHandle.Stub() -} - -function setLambdaHandler(callback) { - logger.debug('Not calling setLambdaHandler because New Relic is disabled.') - return callback -} - -function startSegment(name, record, handler, callback) { - logger.debug('Not calling `startSegment` because New Relic is disabled.') - if (typeof handler === 'function') { - return handler(callback) - } - return null -} - -function getLinkingMetadata() { - return {} -} - -function getTraceMetadata() { - return { - traceId: '', - spanId: '' - } -} - -function startWebTransaction(url, callback) { - logger.debug('Not calling startWebTransaction because New Relic is disabled.') - if (typeof callback === 'function') { - return callback() - } - - return null -} - -function startBackgroundTransaction(name, group, callback) { - logger.debug('Not calling startBackgroundTransaction because New Relic is disabled.') - if (typeof callback === 'function') { - return callback() - } - - if (typeof group === 'function') { - return group() - } - - return null -} - -// Normally the following call executes callback asynchronously -function shutdown(options, cb) { - logger.debug('Not calling shutdown because New Relic is disabled.') - - let callback = cb - if (!callback) { - if (typeof options === 'function') { - callback = options - } else { - callback = function __NRDefaultCb() {} - } - } - - setImmediate(callback) -} - -module.exports = Stub diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/.ready b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/LICENSE.md b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/LICENSE.md deleted file mode 100644 index e2fad6667..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2017 Node.js API collaborators ------------------------------------ - -*Node.js API collaborators listed at * - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/README.md b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/README.md deleted file mode 100644 index db7cb7ff4..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/README.md +++ /dev/null @@ -1,293 +0,0 @@ -NOTE: The default branch has been renamed! -master is now named main - -If you have a local clone, you can update it by running: - -```shell -git branch -m master main -git fetch origin -git branch -u origin/main main -``` - -# **node-addon-api module** -This module contains **header-only C++ wrapper classes** which simplify -the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) -provided by Node.js when using C++. It provides a C++ object model -and exception handling semantics with low overhead. - -There are three options for implementing addons: Node-API, nan, or direct -use of internal V8, libuv and Node.js libraries. Unless there is a need for -direct access to functionality which is not exposed by Node-API as outlined -in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html) -in Node.js core, use Node-API. Refer to -[C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) -for more information on Node-API. - -Node-API is an ABI stable C interface provided by Node.js for building native -addons. It is independent from the underlying JavaScript runtime (e.g. V8 or ChakraCore) -and is maintained as part of Node.js itself. It is intended to insulate -native addons from changes in the underlying JavaScript engine and allow -modules compiled for one version to run on later versions of Node.js without -recompilation. - -The `node-addon-api` module, which is not part of Node.js, preserves the benefits -of the Node-API as it consists only of inline code that depends only on the stable API -provided by Node-API. As such, modules built against one version of Node.js -using node-addon-api should run without having to be rebuilt with newer versions -of Node.js. - -It is important to remember that *other* Node.js interfaces such as -`libuv` (included in a project via `#include `) are not ABI-stable across -Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api` -exclusively and build against a version of Node.js that includes an -implementation of Node-API (meaning an active LTS version of Node.js) in -order to benefit from ABI stability across Node.js major versions. Node.js -provides an [ABI stability guide][] containing a detailed explanation of ABI -stability in general, and the Node-API ABI stability guarantee in particular. - -As new APIs are added to Node-API, node-addon-api must be updated to provide -wrappers for those new APIs. For this reason node-addon-api provides -methods that allow callers to obtain the underlying Node-API handles so -direct calls to Node-API and the use of the objects/methods provided by -node-addon-api can be used together. For example, in order to be able -to use an API for which the node-addon-api does not yet provide a wrapper. - -APIs exposed by node-addon-api are generally used to create and -manipulate JavaScript values. Concepts and operations generally map -to ideas specified in the **ECMA262 Language Specification**. - -The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an -excellent orientation and tips for developers just getting started with Node-API -and node-addon-api. - -- **[Setup](#setup)** -- **[API Documentation](#api)** -- **[Examples](#examples)** -- **[Tests](#tests)** -- **[More resource and info about native Addons](#resources)** -- **[Badges](#badges)** -- **[Code of Conduct](CODE_OF_CONDUCT.md)** -- **[Contributors](#contributors)** -- **[License](#license)** - -## **Current version: 4.3.0** - -(See [CHANGELOG.md](CHANGELOG.md) for complete Changelog) - -[![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/) - - - -node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions. -This allows addons built with it to run with Node.js versions which support the targeted Node-API version. -**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that -every year there will be a new major which drops support for the Node.js LTS version which has gone out of service. - -The oldest Node.js version supported by the current version of node-addon-api is Node.js 12.x. - -## Setup - - [Installation and usage](doc/setup.md) - - [node-gyp](doc/node-gyp.md) - - [cmake-js](doc/cmake-js.md) - - [Conversion tool](doc/conversion-tool.md) - - [Checker tool](doc/checker-tool.md) - - [Generator](doc/generator.md) - - [Prebuild tools](doc/prebuild_tools.md) - - - -### **API Documentation** - -The following is the documentation for node-addon-api. - - - [Full Class Hierarchy](doc/hierarchy.md) - - [Addon Structure](doc/addon.md) - - Data Types: - - [Env](doc/env.md) - - [CallbackInfo](doc/callbackinfo.md) - - [Reference](doc/reference.md) - - [Value](doc/value.md) - - [Name](doc/name.md) - - [Symbol](doc/symbol.md) - - [String](doc/string.md) - - [Number](doc/number.md) - - [Date](doc/date.md) - - [BigInt](doc/bigint.md) - - [Boolean](doc/boolean.md) - - [External](doc/external.md) - - [Object](doc/object.md) - - [Array](doc/array.md) - - [ObjectReference](doc/object_reference.md) - - [PropertyDescriptor](doc/property_descriptor.md) - - [Function](doc/function.md) - - [FunctionReference](doc/function_reference.md) - - [ObjectWrap](doc/object_wrap.md) - - [ClassPropertyDescriptor](doc/class_property_descriptor.md) - - [Buffer](doc/buffer.md) - - [ArrayBuffer](doc/array_buffer.md) - - [TypedArray](doc/typed_array.md) - - [TypedArrayOf](doc/typed_array_of.md) - - [DataView](doc/dataview.md) - - [Error Handling](doc/error_handling.md) - - [Error](doc/error.md) - - [TypeError](doc/type_error.md) - - [RangeError](doc/range_error.md) - - [Object Lifetime Management](doc/object_lifetime_management.md) - - [HandleScope](doc/handle_scope.md) - - [EscapableHandleScope](doc/escapable_handle_scope.md) - - [Memory Management](doc/memory_management.md) - - [Async Operations](doc/async_operations.md) - - [AsyncWorker](doc/async_worker.md) - - [AsyncContext](doc/async_context.md) - - [AsyncWorker Variants](doc/async_worker_variants.md) - - [Thread-safe Functions](doc/threadsafe.md) - - [ThreadSafeFunction](doc/threadsafe_function.md) - - [TypedThreadSafeFunction](doc/typed_threadsafe_function.md) - - [Promises](doc/promises.md) - - [Version management](doc/version_management.md) - - - -### **Examples** - -Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)** - -- **[Hello World](https://github.com/nodejs/node-addon-examples/tree/HEAD/1_hello_world/node-addon-api)** -- **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/HEAD/2_function_arguments/node-addon-api)** -- **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/HEAD/3_callbacks/node-addon-api)** -- **[Object factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/4_object_factory/node-addon-api)** -- **[Function factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/5_function_factory/node-addon-api)** -- **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/HEAD/6_object_wrap/node-addon-api)** -- **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/HEAD/7_factory_wrap/node-addon-api)** -- **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/HEAD/8_passing_wrapped/node-addon-api)** - - - -### **Tests** - -To run the **node-addon-api** tests do: - -``` -npm install -npm test -``` - -To avoid testing the deprecated portions of the API run -``` -npm install -npm test --disable-deprecated -``` - -To run the tests targeting a specific version of Node-API run -``` -npm install -export NAPI_VERSION=X -npm test --NAPI_VERSION=X -``` - -where X is the version of Node-API you want to target. - -### **Debug** - -To run the **node-addon-api** tests with `--debug` option: - -``` -npm run-script dev -``` - -If you want faster build, you might use the following option: - -``` -npm run-script dev:incremental -``` - -Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)** - -### **Benchmarks** - -You can run the available benchmarks using the following command: - -``` -npm run-script benchmark -``` - -See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks. - - - -### **More resource and info about native Addons** -- **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)** -- **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)** -- **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)** -- **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)** - -As node-addon-api's core mission is to expose the plain C Node-API as C++ -wrappers, tools that facilitate n-api/node-addon-api providing more -convenient patterns on developing a Node.js add-ons with n-api/node-addon-api -can be published to NPM as standalone packages. It is also recommended to tag -such packages with `node-addon-api` to provide more visibility to the community. - -Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api). - - - -### **Other bindings** - -- **[napi-rs](https://napi.rs)** - (`Rust`) - - - -### **Badges** - -The use of badges is recommended to indicate the minimum version of Node-API -required for the module. This helps to determine which Node.js major versions are -supported. Addon maintainers can consult the [Node-API support matrix][] to determine -which Node.js versions provide a given Node-API version. The following badges are -available: - -![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg) -![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg) -![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg) -![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg) -![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg) -![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg) -![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg) -![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg) -![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg) - -## **Contributing** - -We love contributions from the community to **node-addon-api**! -See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module. - - - -## Team members - -### Active -| Name | GitHub Link | -| ------------------- | ----------------------------------------------------- | -| Anna Henningsen | [addaleax](https://github.com/addaleax) | -| Chengzhong Wu | [legendecas](https://github.com/legendecas) | -| Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) | -| Jim Schlight | [jschlight](https://github.com/jschlight) | -| Michael Dawson | [mhdawson](https://github.com/mhdawson) | -| Kevin Eady | [KevinEady](https://github.com/KevinEady) -| Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) | - -### Emeritus -| Name | GitHub Link | -| ------------------- | ----------------------------------------------------- | -| Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) | -| Benjamin Byholm | [kkoopa](https://github.com/kkoopa) | -| Jason Ginchereau | [jasongin](https://github.com/jasongin) | -| Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) | -| Sampson Gao | [sampsongao](https://github.com/sampsongao) | -| Taylor Woll | [boingoing](https://github.com/boingoing) | - - - -Licensed under [MIT](./LICENSE.md) - -[ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/ -[Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/common.gypi b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/common.gypi deleted file mode 100644 index 9be254f0b..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/common.gypi +++ /dev/null @@ -1,21 +0,0 @@ -{ - 'variables': { - 'NAPI_VERSION%': " -inline PropertyDescriptor -PropertyDescriptor::Accessor(const char* utf8name, - Getter getter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ getter, nullptr }); - - return PropertyDescriptor({ - utf8name, - nullptr, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(const std::string& utf8name, - Getter getter, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), getter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name, - Getter getter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ getter, nullptr }); - - return PropertyDescriptor({ - nullptr, - name, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Name name, - Getter getter, - napi_property_attributes attributes, - void* data) { - napi_value nameValue = name; - return PropertyDescriptor::Accessor(nameValue, getter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::AccessorCallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ getter, setter, nullptr }); - - return PropertyDescriptor({ - utf8name, - nullptr, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), getter, setter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(napi_value name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::AccessorCallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ getter, setter, nullptr }); - - return PropertyDescriptor({ - nullptr, - name, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - napi_value nameValue = name; - return PropertyDescriptor::Accessor(nameValue, getter, setter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(const char* utf8name, - Callable cb, - napi_property_attributes attributes, - void* /*data*/) { - using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ cb, nullptr }); - - return PropertyDescriptor({ - utf8name, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(const std::string& utf8name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return Function(utf8name.c_str(), cb, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(napi_value name, - Callable cb, - napi_property_attributes attributes, - void* /*data*/) { - using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({ cb, nullptr }); - - return PropertyDescriptor({ - nullptr, - name, - CbData::Wrapper, - nullptr, - nullptr, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(Name name, - Callable cb, - napi_property_attributes attributes, - void* data) { - napi_value nameValue = name; - return PropertyDescriptor::Function(nameValue, cb, attributes, data); -} - -#endif // !SRC_NAPI_INL_DEPRECATED_H_ diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/napi-inl.h b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/napi-inl.h deleted file mode 100644 index bd54feb67..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/napi-inl.h +++ /dev/null @@ -1,6209 +0,0 @@ -#ifndef SRC_NAPI_INL_H_ -#define SRC_NAPI_INL_H_ - -//////////////////////////////////////////////////////////////////////////////// -// Node-API C++ Wrapper Classes -// -// Inline header-only implementations for "Node-API" ABI-stable C APIs for -// Node.js. -//////////////////////////////////////////////////////////////////////////////// - -// Note: Do not include this file directly! Include "napi.h" instead. - -#include -#include -#include -#include -#include - -namespace Napi { - -// Helpers to handle functions exposed from C++. -namespace details { - -// Attach a data item to an object and delete it when the object gets -// garbage-collected. -// TODO: Replace this code with `napi_add_finalizer()` whenever it becomes -// available on all supported versions of Node.js. -template -static inline napi_status AttachData(napi_env env, - napi_value obj, - FreeType* data, - napi_finalize finalizer = nullptr, - void* hint = nullptr) { - napi_status status; - if (finalizer == nullptr) { - finalizer = [](napi_env /*env*/, void* data, void* /*hint*/) { - delete static_cast(data); - }; - } -#if (NAPI_VERSION < 5) - napi_value symbol, external; - status = napi_create_symbol(env, nullptr, &symbol); - if (status == napi_ok) { - status = napi_create_external(env, - data, - finalizer, - hint, - &external); - if (status == napi_ok) { - napi_property_descriptor desc = { - nullptr, - symbol, - nullptr, - nullptr, - nullptr, - external, - napi_default, - nullptr - }; - status = napi_define_properties(env, obj, 1, &desc); - } - } -#else // NAPI_VERSION >= 5 - status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr); -#endif - return status; -} - -// For use in JS to C++ callback wrappers to catch any Napi::Error exceptions -// and rethrow them as JavaScript exceptions before returning from the callback. -template -inline napi_value WrapCallback(Callable callback) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - return callback(); - } catch (const Error& e) { - e.ThrowAsJavaScriptException(); - return nullptr; - } -#else // NAPI_CPP_EXCEPTIONS - // When C++ exceptions are disabled, errors are immediately thrown as JS - // exceptions, so there is no need to catch and rethrow them here. - return callback(); -#endif // NAPI_CPP_EXCEPTIONS -} - -// For use in JS to C++ void callback wrappers to catch any Napi::Error -// exceptions and rethrow them as JavaScript exceptions before returning from the -// callback. -template -inline void WrapVoidCallback(Callable callback) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - callback(); - } catch (const Error& e) { - e.ThrowAsJavaScriptException(); - } -#else // NAPI_CPP_EXCEPTIONS - // When C++ exceptions are disabled, errors are immediately thrown as JS - // exceptions, so there is no need to catch and rethrow them here. - callback(); -#endif // NAPI_CPP_EXCEPTIONS -} - -template -struct CallbackData { - static inline - napi_value Wrapper(napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - CallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->callback(callbackInfo); - }); - } - - Callable callback; - void* data; -}; - -template -struct CallbackData { - static inline - napi_value Wrapper(napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - CallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->callback(callbackInfo); - return nullptr; - }); - } - - Callable callback; - void* data; -}; - -template -static napi_value -TemplatedVoidCallback(napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - Callback(cbInfo); - return nullptr; - }); -} - -template -static napi_value -TemplatedCallback(napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - return Callback(cbInfo); - }); -} - -template -static napi_value -TemplatedInstanceCallback(napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - T* instance = T::Unwrap(cbInfo.This().As()); - return (instance->*UnwrapCallback)(cbInfo); - }); -} - -template -static napi_value -TemplatedInstanceVoidCallback(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - T* instance = T::Unwrap(cbInfo.This().As()); - (instance->*UnwrapCallback)(cbInfo); - return nullptr; - }); -} - -template -struct FinalizeData { - static inline void Wrapper(napi_env env, - void* data, - void* finalizeHint) NAPI_NOEXCEPT { - WrapVoidCallback([&] { - FinalizeData* finalizeData = static_cast(finalizeHint); - finalizeData->callback(Env(env), static_cast(data)); - delete finalizeData; - }); - } - - static inline void WrapperWithHint(napi_env env, - void* data, - void* finalizeHint) NAPI_NOEXCEPT { - WrapVoidCallback([&] { - FinalizeData* finalizeData = static_cast(finalizeHint); - finalizeData->callback(Env(env), static_cast(data), finalizeData->hint); - delete finalizeData; - }); - } - - Finalizer callback; - Hint* hint; -}; - -#if (NAPI_VERSION > 3 && !defined(__wasm32__)) -template , - typename FinalizerDataType=void> -struct ThreadSafeFinalize { - static inline - void Wrapper(napi_env env, void* rawFinalizeData, void* /* rawContext */) { - if (rawFinalizeData == nullptr) - return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env)); - delete finalizeData; - } - - static inline - void FinalizeWrapperWithData(napi_env env, - void* rawFinalizeData, - void* /* rawContext */) { - if (rawFinalizeData == nullptr) - return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env), finalizeData->data); - delete finalizeData; - } - - static inline - void FinalizeWrapperWithContext(napi_env env, - void* rawFinalizeData, - void* rawContext) { - if (rawFinalizeData == nullptr) - return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env), static_cast(rawContext)); - delete finalizeData; - } - - static inline - void FinalizeFinalizeWrapperWithDataAndContext(napi_env env, - void* rawFinalizeData, - void* rawContext) { - if (rawFinalizeData == nullptr) - return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env), finalizeData->data, - static_cast(rawContext)); - delete finalizeData; - } - - FinalizerDataType* data; - Finalizer callback; -}; - -template -typename std::enable_if::type static inline CallJsWrapper( - napi_env env, napi_value jsCallback, void* context, void* data) { - call(env, - Function(env, jsCallback), - static_cast(context), - static_cast(data)); -} - -template -typename std::enable_if::type static inline CallJsWrapper( - napi_env env, napi_value jsCallback, void* /*context*/, void* /*data*/) { - if (jsCallback != nullptr) { - Function(env, jsCallback).Call(0, nullptr); - } -} - -#if NAPI_VERSION > 4 - -template -napi_value DefaultCallbackWrapper(napi_env /*env*/, std::nullptr_t /*cb*/) { - return nullptr; -} - -template -napi_value DefaultCallbackWrapper(napi_env /*env*/, Napi::Function cb) { - return cb; -} - -#else -template -napi_value DefaultCallbackWrapper(napi_env env, Napi::Function cb) { - if (cb.IsEmpty()) { - return TSFN::EmptyFunctionFactory(env); - } - return cb; -} -#endif // NAPI_VERSION > 4 -#endif // NAPI_VERSION > 3 && !defined(__wasm32__) - -template -struct AccessorCallbackData { - static inline - napi_value GetterWrapper(napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - AccessorCallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->getterCallback(callbackInfo); - }); - } - - static inline - napi_value SetterWrapper(napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - AccessorCallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->setterCallback(callbackInfo); - return nullptr; - }); - } - - Getter getterCallback; - Setter setterCallback; - void* data; -}; - -} // namespace details - -#ifndef NODE_ADDON_API_DISABLE_DEPRECATED -# include "napi-inl.deprecated.h" -#endif // !NODE_ADDON_API_DISABLE_DEPRECATED - -//////////////////////////////////////////////////////////////////////////////// -// Module registration -//////////////////////////////////////////////////////////////////////////////// - -// Register an add-on based on an initializer function. -#define NODE_API_MODULE(modname, regfunc) \ - static napi_value __napi_##regfunc(napi_env env, napi_value exports) { \ - return Napi::RegisterModule(env, exports, regfunc); \ - } \ - NAPI_MODULE(modname, __napi_##regfunc) - -// Register an add-on based on a subclass of `Addon` with a custom Node.js -// module name. -#define NODE_API_NAMED_ADDON(modname, classname) \ - static napi_value __napi_ ## classname(napi_env env, \ - napi_value exports) { \ - return Napi::RegisterModule(env, exports, &classname::Init); \ - } \ - NAPI_MODULE(modname, __napi_ ## classname) - -// Register an add-on based on a subclass of `Addon` with the Node.js module -// name given by node-gyp from the `target_name` in binding.gyp. -#define NODE_API_ADDON(classname) \ - NODE_API_NAMED_ADDON(NODE_GYP_MODULE_NAME, classname) - -// Adapt the NAPI_MODULE registration function: -// - Wrap the arguments in NAPI wrappers. -// - Catch any NAPI errors and rethrow as JS exceptions. -inline napi_value RegisterModule(napi_env env, - napi_value exports, - ModuleRegisterCallback registerCallback) { - return details::WrapCallback([&] { - return napi_value(registerCallback(Napi::Env(env), - Napi::Object(env, exports))); - }); -} - -//////////////////////////////////////////////////////////////////////////////// -// Maybe class -//////////////////////////////////////////////////////////////////////////////// - -template -bool Maybe::IsNothing() const { - return !_has_value; -} - -template -bool Maybe::IsJust() const { - return _has_value; -} - -template -void Maybe::Check() const { - NAPI_CHECK(IsJust(), "Napi::Maybe::Check", "Maybe value is Nothing."); -} - -template -T Maybe::Unwrap() const { - NAPI_CHECK(IsJust(), "Napi::Maybe::Unwrap", "Maybe value is Nothing."); - return _value; -} - -template -T Maybe::UnwrapOr(const T& default_value) const { - return _has_value ? _value : default_value; -} - -template -bool Maybe::UnwrapTo(T* out) const { - if (IsJust()) { - *out = _value; - return true; - }; - return false; -} - -template -bool Maybe::operator==(const Maybe& other) const { - return (IsJust() == other.IsJust()) && - (!IsJust() || Unwrap() == other.Unwrap()); -} - -template -bool Maybe::operator!=(const Maybe& other) const { - return !operator==(other); -} - -template -Maybe::Maybe() : _has_value(false) {} - -template -Maybe::Maybe(const T& t) : _has_value(true), _value(t) {} - -template -inline Maybe Nothing() { - return Maybe(); -} - -template -inline Maybe Just(const T& t) { - return Maybe(t); -} - -//////////////////////////////////////////////////////////////////////////////// -// Env class -//////////////////////////////////////////////////////////////////////////////// - -inline Env::Env(napi_env env) : _env(env) { -} - -inline Env::operator napi_env() const { - return _env; -} - -inline Object Env::Global() const { - napi_value value; - napi_status status = napi_get_global(*this, &value); - NAPI_THROW_IF_FAILED(*this, status, Object()); - return Object(*this, value); -} - -inline Value Env::Undefined() const { - napi_value value; - napi_status status = napi_get_undefined(*this, &value); - NAPI_THROW_IF_FAILED(*this, status, Value()); - return Value(*this, value); -} - -inline Value Env::Null() const { - napi_value value; - napi_status status = napi_get_null(*this, &value); - NAPI_THROW_IF_FAILED(*this, status, Value()); - return Value(*this, value); -} - -inline bool Env::IsExceptionPending() const { - bool result; - napi_status status = napi_is_exception_pending(_env, &result); - if (status != napi_ok) result = false; // Checking for a pending exception shouldn't throw. - return result; -} - -inline Error Env::GetAndClearPendingException() { - napi_value value; - napi_status status = napi_get_and_clear_last_exception(_env, &value); - if (status != napi_ok) { - // Don't throw another exception when failing to get the exception! - return Error(); - } - return Error(_env, value); -} - -inline MaybeOrValue Env::RunScript(const char* utf8script) { - String script = String::New(_env, utf8script); - return RunScript(script); -} - -inline MaybeOrValue Env::RunScript(const std::string& utf8script) { - return RunScript(utf8script.c_str()); -} - -inline MaybeOrValue Env::RunScript(String script) { - napi_value result; - napi_status status = napi_run_script(_env, script, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Value(_env, result), Napi::Value); -} - -#if NAPI_VERSION > 2 -template -void Env::CleanupHook::Wrapper(void* data) NAPI_NOEXCEPT { - auto* cleanupData = - static_cast::CleanupData*>( - data); - cleanupData->hook(); - delete cleanupData; -} - -template -void Env::CleanupHook::WrapperWithArg(void* data) NAPI_NOEXCEPT { - auto* cleanupData = - static_cast::CleanupData*>( - data); - cleanupData->hook(static_cast(cleanupData->arg)); - delete cleanupData; -} -#endif // NAPI_VERSION > 2 - -#if NAPI_VERSION > 5 -template fini> -inline void Env::SetInstanceData(T* data) { - napi_status status = - napi_set_instance_data(_env, data, [](napi_env env, void* data, void*) { - fini(env, static_cast(data)); - }, nullptr); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -template fini> -inline void Env::SetInstanceData(DataType* data, HintType* hint) { - napi_status status = - napi_set_instance_data(_env, data, - [](napi_env env, void* data, void* hint) { - fini(env, static_cast(data), static_cast(hint)); - }, hint); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -template -inline T* Env::GetInstanceData() { - void* data = nullptr; - - napi_status status = napi_get_instance_data(_env, &data); - NAPI_THROW_IF_FAILED(_env, status, nullptr); - - return static_cast(data); -} - -template void Env::DefaultFini(Env, T* data) { - delete data; -} - -template -void Env::DefaultFiniWithHint(Env, DataType* data, HintType*) { - delete data; -} -#endif // NAPI_VERSION > 5 - -//////////////////////////////////////////////////////////////////////////////// -// Value class -//////////////////////////////////////////////////////////////////////////////// - -inline Value::Value() : _env(nullptr), _value(nullptr) { -} - -inline Value::Value(napi_env env, napi_value value) : _env(env), _value(value) { -} - -inline Value::operator napi_value() const { - return _value; -} - -inline bool Value::operator ==(const Value& other) const { - return StrictEquals(other); -} - -inline bool Value::operator !=(const Value& other) const { - return !this->operator ==(other); -} - -inline bool Value::StrictEquals(const Value& other) const { - bool result; - napi_status status = napi_strict_equals(_env, *this, other, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline Napi::Env Value::Env() const { - return Napi::Env(_env); -} - -inline bool Value::IsEmpty() const { - return _value == nullptr; -} - -inline napi_valuetype Value::Type() const { - if (IsEmpty()) { - return napi_undefined; - } - - napi_valuetype type; - napi_status status = napi_typeof(_env, _value, &type); - NAPI_THROW_IF_FAILED(_env, status, napi_undefined); - return type; -} - -inline bool Value::IsUndefined() const { - return Type() == napi_undefined; -} - -inline bool Value::IsNull() const { - return Type() == napi_null; -} - -inline bool Value::IsBoolean() const { - return Type() == napi_boolean; -} - -inline bool Value::IsNumber() const { - return Type() == napi_number; -} - -#if NAPI_VERSION > 5 -inline bool Value::IsBigInt() const { - return Type() == napi_bigint; -} -#endif // NAPI_VERSION > 5 - -#if (NAPI_VERSION > 4) -inline bool Value::IsDate() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_date(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} -#endif - -inline bool Value::IsString() const { - return Type() == napi_string; -} - -inline bool Value::IsSymbol() const { - return Type() == napi_symbol; -} - -inline bool Value::IsArray() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_array(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsArrayBuffer() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_arraybuffer(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsTypedArray() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_typedarray(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsObject() const { - return Type() == napi_object || IsFunction(); -} - -inline bool Value::IsFunction() const { - return Type() == napi_function; -} - -inline bool Value::IsPromise() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_promise(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsDataView() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_dataview(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsBuffer() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_buffer(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsExternal() const { - return Type() == napi_external; -} - -template -inline T Value::As() const { - return T(_env, _value); -} - -inline MaybeOrValue Value::ToBoolean() const { - napi_value result; - napi_status status = napi_coerce_to_bool(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Boolean(_env, result), Napi::Boolean); -} - -inline MaybeOrValue Value::ToNumber() const { - napi_value result; - napi_status status = napi_coerce_to_number(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Number(_env, result), Napi::Number); -} - -inline MaybeOrValue Value::ToString() const { - napi_value result; - napi_status status = napi_coerce_to_string(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::String(_env, result), Napi::String); -} - -inline MaybeOrValue Value::ToObject() const { - napi_value result; - napi_status status = napi_coerce_to_object(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Object(_env, result), Napi::Object); -} - -//////////////////////////////////////////////////////////////////////////////// -// Boolean class -//////////////////////////////////////////////////////////////////////////////// - -inline Boolean Boolean::New(napi_env env, bool val) { - napi_value value; - napi_status status = napi_get_boolean(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, Boolean()); - return Boolean(env, value); -} - -inline Boolean::Boolean() : Napi::Value() { -} - -inline Boolean::Boolean(napi_env env, napi_value value) : Napi::Value(env, value) { -} - -inline Boolean::operator bool() const { - return Value(); -} - -inline bool Boolean::Value() const { - bool result; - napi_status status = napi_get_value_bool(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -// Number class -//////////////////////////////////////////////////////////////////////////////// - -inline Number Number::New(napi_env env, double val) { - napi_value value; - napi_status status = napi_create_double(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, Number()); - return Number(env, value); -} - -inline Number::Number() : Value() { -} - -inline Number::Number(napi_env env, napi_value value) : Value(env, value) { -} - -inline Number::operator int32_t() const { - return Int32Value(); -} - -inline Number::operator uint32_t() const { - return Uint32Value(); -} - -inline Number::operator int64_t() const { - return Int64Value(); -} - -inline Number::operator float() const { - return FloatValue(); -} - -inline Number::operator double() const { - return DoubleValue(); -} - -inline int32_t Number::Int32Value() const { - int32_t result; - napi_status status = napi_get_value_int32(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline uint32_t Number::Uint32Value() const { - uint32_t result; - napi_status status = napi_get_value_uint32(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline int64_t Number::Int64Value() const { - int64_t result; - napi_status status = napi_get_value_int64(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline float Number::FloatValue() const { - return static_cast(DoubleValue()); -} - -inline double Number::DoubleValue() const { - double result; - napi_status status = napi_get_value_double(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -#if NAPI_VERSION > 5 -//////////////////////////////////////////////////////////////////////////////// -// BigInt Class -//////////////////////////////////////////////////////////////////////////////// - -inline BigInt BigInt::New(napi_env env, int64_t val) { - napi_value value; - napi_status status = napi_create_bigint_int64(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, BigInt()); - return BigInt(env, value); -} - -inline BigInt BigInt::New(napi_env env, uint64_t val) { - napi_value value; - napi_status status = napi_create_bigint_uint64(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, BigInt()); - return BigInt(env, value); -} - -inline BigInt BigInt::New(napi_env env, int sign_bit, size_t word_count, const uint64_t* words) { - napi_value value; - napi_status status = napi_create_bigint_words(env, sign_bit, word_count, words, &value); - NAPI_THROW_IF_FAILED(env, status, BigInt()); - return BigInt(env, value); -} - -inline BigInt::BigInt() : Value() { -} - -inline BigInt::BigInt(napi_env env, napi_value value) : Value(env, value) { -} - -inline int64_t BigInt::Int64Value(bool* lossless) const { - int64_t result; - napi_status status = napi_get_value_bigint_int64( - _env, _value, &result, lossless); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline uint64_t BigInt::Uint64Value(bool* lossless) const { - uint64_t result; - napi_status status = napi_get_value_bigint_uint64( - _env, _value, &result, lossless); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline size_t BigInt::WordCount() const { - size_t word_count; - napi_status status = napi_get_value_bigint_words( - _env, _value, nullptr, &word_count, nullptr); - NAPI_THROW_IF_FAILED(_env, status, 0); - return word_count; -} - -inline void BigInt::ToWords(int* sign_bit, size_t* word_count, uint64_t* words) { - napi_status status = napi_get_value_bigint_words( - _env, _value, sign_bit, word_count, words); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} -#endif // NAPI_VERSION > 5 - -#if (NAPI_VERSION > 4) -//////////////////////////////////////////////////////////////////////////////// -// Date Class -//////////////////////////////////////////////////////////////////////////////// - -inline Date Date::New(napi_env env, double val) { - napi_value value; - napi_status status = napi_create_date(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, Date()); - return Date(env, value); -} - -inline Date::Date() : Value() { -} - -inline Date::Date(napi_env env, napi_value value) : Value(env, value) { -} - -inline Date::operator double() const { - return ValueOf(); -} - -inline double Date::ValueOf() const { - double result; - napi_status status = napi_get_date_value( - _env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Name class -//////////////////////////////////////////////////////////////////////////////// - -inline Name::Name() : Value() { -} - -inline Name::Name(napi_env env, napi_value value) : Value(env, value) { -} - -//////////////////////////////////////////////////////////////////////////////// -// String class -//////////////////////////////////////////////////////////////////////////////// - -inline String String::New(napi_env env, const std::string& val) { - return String::New(env, val.c_str(), val.size()); -} - -inline String String::New(napi_env env, const std::u16string& val) { - return String::New(env, val.c_str(), val.size()); -} - -inline String String::New(napi_env env, const char* val) { - // TODO(@gabrielschulhof) Remove if-statement when core's error handling is - // available in all supported versions. - if (val == nullptr) { - // Throw an error that looks like it came from core. - NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); - } - napi_value value; - napi_status status = napi_create_string_utf8(env, val, std::strlen(val), &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String String::New(napi_env env, const char16_t* val) { - napi_value value; - // TODO(@gabrielschulhof) Remove if-statement when core's error handling is - // available in all supported versions. - if (val == nullptr) { - // Throw an error that looks like it came from core. - NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); - } - napi_status status = napi_create_string_utf16(env, val, std::u16string(val).size(), &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String String::New(napi_env env, const char* val, size_t length) { - napi_value value; - napi_status status = napi_create_string_utf8(env, val, length, &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String String::New(napi_env env, const char16_t* val, size_t length) { - napi_value value; - napi_status status = napi_create_string_utf16(env, val, length, &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String::String() : Name() { -} - -inline String::String(napi_env env, napi_value value) : Name(env, value) { -} - -inline String::operator std::string() const { - return Utf8Value(); -} - -inline String::operator std::u16string() const { - return Utf16Value(); -} - -inline std::string String::Utf8Value() const { - size_t length; - napi_status status = napi_get_value_string_utf8(_env, _value, nullptr, 0, &length); - NAPI_THROW_IF_FAILED(_env, status, ""); - - std::string value; - value.reserve(length + 1); - value.resize(length); - status = napi_get_value_string_utf8(_env, _value, &value[0], value.capacity(), nullptr); - NAPI_THROW_IF_FAILED(_env, status, ""); - return value; -} - -inline std::u16string String::Utf16Value() const { - size_t length; - napi_status status = napi_get_value_string_utf16(_env, _value, nullptr, 0, &length); - NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); - - std::u16string value; - value.reserve(length + 1); - value.resize(length); - status = napi_get_value_string_utf16(_env, _value, &value[0], value.capacity(), nullptr); - NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); - return value; -} - -//////////////////////////////////////////////////////////////////////////////// -// Symbol class -//////////////////////////////////////////////////////////////////////////////// - -inline Symbol Symbol::New(napi_env env, const char* description) { - napi_value descriptionValue = description != nullptr ? - String::New(env, description) : static_cast(nullptr); - return Symbol::New(env, descriptionValue); -} - -inline Symbol Symbol::New(napi_env env, const std::string& description) { - napi_value descriptionValue = String::New(env, description); - return Symbol::New(env, descriptionValue); -} - -inline Symbol Symbol::New(napi_env env, String description) { - napi_value descriptionValue = description; - return Symbol::New(env, descriptionValue); -} - -inline Symbol Symbol::New(napi_env env, napi_value description) { - napi_value value; - napi_status status = napi_create_symbol(env, description, &value); - NAPI_THROW_IF_FAILED(env, status, Symbol()); - return Symbol(env, value); -} - -inline MaybeOrValue Symbol::WellKnown(napi_env env, - const std::string& name) { -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - Value symbol_obj; - Value symbol_value; - if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && - symbol_obj.As().Get(name).UnwrapTo(&symbol_value)) { - return Just(symbol_value.As()); - } - return Nothing(); -#else - return Napi::Env(env).Global().Get("Symbol").As().Get(name).As(); -#endif -} - -inline MaybeOrValue Symbol::For(napi_env env, - const std::string& description) { - napi_value descriptionValue = String::New(env, description); - return Symbol::For(env, descriptionValue); -} - -inline MaybeOrValue Symbol::For(napi_env env, const char* description) { - napi_value descriptionValue = String::New(env, description); - return Symbol::For(env, descriptionValue); -} - -inline MaybeOrValue Symbol::For(napi_env env, String description) { - return Symbol::For(env, static_cast(description)); -} - -inline MaybeOrValue Symbol::For(napi_env env, napi_value description) { -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - Value symbol_obj; - Value symbol_for_value; - Value symbol_value; - if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && - symbol_obj.As().Get("for").UnwrapTo(&symbol_for_value) && - symbol_for_value.As() - .Call(symbol_obj, {description}) - .UnwrapTo(&symbol_value)) { - return Just(symbol_value.As()); - } - return Nothing(); -#else - Object symbol_obj = Napi::Env(env).Global().Get("Symbol").As(); - return symbol_obj.Get("for") - .As() - .Call(symbol_obj, {description}) - .As(); -#endif -} - -inline Symbol::Symbol() : Name() { -} - -inline Symbol::Symbol(napi_env env, napi_value value) : Name(env, value) { -} - -//////////////////////////////////////////////////////////////////////////////// -// Automagic value creation -//////////////////////////////////////////////////////////////////////////////// - -namespace details { -template -struct vf_number { - static Number From(napi_env env, T value) { - return Number::New(env, static_cast(value)); - } -}; - -template<> -struct vf_number { - static Boolean From(napi_env env, bool value) { - return Boolean::New(env, value); - } -}; - -struct vf_utf8_charp { - static String From(napi_env env, const char* value) { - return String::New(env, value); - } -}; - -struct vf_utf16_charp { - static String From(napi_env env, const char16_t* value) { - return String::New(env, value); - } -}; -struct vf_utf8_string { - static String From(napi_env env, const std::string& value) { - return String::New(env, value); - } -}; - -struct vf_utf16_string { - static String From(napi_env env, const std::u16string& value) { - return String::New(env, value); - } -}; - -template -struct vf_fallback { - static Value From(napi_env env, const T& value) { - return Value(env, value); - } -}; - -template struct disjunction : std::false_type {}; -template struct disjunction : B {}; -template -struct disjunction - : std::conditional>::type {}; - -template -struct can_make_string - : disjunction::type, - typename std::is_convertible::type, - typename std::is_convertible::type, - typename std::is_convertible::type> {}; -} - -template -Value Value::From(napi_env env, const T& value) { - using Helper = typename std::conditional< - std::is_integral::value || std::is_floating_point::value, - details::vf_number, - typename std::conditional< - details::can_make_string::value, - String, - details::vf_fallback - >::type - >::type; - return Helper::From(env, value); -} - -template -String String::From(napi_env env, const T& value) { - struct Dummy {}; - using Helper = typename std::conditional< - std::is_convertible::value, - details::vf_utf8_charp, - typename std::conditional< - std::is_convertible::value, - details::vf_utf16_charp, - typename std::conditional< - std::is_convertible::value, - details::vf_utf8_string, - typename std::conditional< - std::is_convertible::value, - details::vf_utf16_string, - Dummy - >::type - >::type - >::type - >::type; - return Helper::From(env, value); -} - -//////////////////////////////////////////////////////////////////////////////// -// Object class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Object::PropertyLValue::operator Value() const { - MaybeOrValue val = Object(_env, _object).Get(_key); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - return val.Unwrap(); -#else - return val; -#endif -} - -template template -inline Object::PropertyLValue& Object::PropertyLValue::operator =(ValueType value) { -#ifdef NODE_ADDON_API_ENABLE_MAYBE - MaybeOrValue result = -#endif - Object(_env, _object).Set(_key, value); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - result.Unwrap(); -#endif - return *this; -} - -template -inline Object::PropertyLValue::PropertyLValue(Object object, Key key) - : _env(object.Env()), _object(object), _key(key) {} - -inline Object Object::New(napi_env env) { - napi_value value; - napi_status status = napi_create_object(env, &value); - NAPI_THROW_IF_FAILED(env, status, Object()); - return Object(env, value); -} - -inline Object::Object() : Value() { -} - -inline Object::Object(napi_env env, napi_value value) : Value(env, value) { -} - -inline Object::PropertyLValue Object::operator [](const char* utf8name) { - return PropertyLValue(*this, utf8name); -} - -inline Object::PropertyLValue Object::operator [](const std::string& utf8name) { - return PropertyLValue(*this, utf8name); -} - -inline Object::PropertyLValue Object::operator [](uint32_t index) { - return PropertyLValue(*this, index); -} - -inline Object::PropertyLValue Object::operator[](Value index) { - return PropertyLValue(*this, index); -} - -inline Object::PropertyLValue Object::operator[](Value index) const { - return PropertyLValue(*this, index); -} - -inline MaybeOrValue Object::operator[](const char* utf8name) const { - return Get(utf8name); -} - -inline MaybeOrValue Object::operator[]( - const std::string& utf8name) const { - return Get(utf8name); -} - -inline MaybeOrValue Object::operator[](uint32_t index) const { - return Get(index); -} - -inline MaybeOrValue Object::Has(napi_value key) const { - bool result; - napi_status status = napi_has_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Has(Value key) const { - bool result; - napi_status status = napi_has_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Has(const char* utf8name) const { - bool result; - napi_status status = napi_has_named_property(_env, _value, utf8name, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Has(const std::string& utf8name) const { - return Has(utf8name.c_str()); -} - -inline MaybeOrValue Object::HasOwnProperty(napi_value key) const { - bool result; - napi_status status = napi_has_own_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::HasOwnProperty(Value key) const { - bool result; - napi_status status = napi_has_own_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::HasOwnProperty(const char* utf8name) const { - napi_value key; - napi_status status = napi_create_string_utf8(_env, utf8name, std::strlen(utf8name), &key); - NAPI_MAYBE_THROW_IF_FAILED(_env, status, bool); - return HasOwnProperty(key); -} - -inline MaybeOrValue Object::HasOwnProperty( - const std::string& utf8name) const { - return HasOwnProperty(utf8name.c_str()); -} - -inline MaybeOrValue Object::Get(napi_value key) const { - napi_value result; - napi_status status = napi_get_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); -} - -inline MaybeOrValue Object::Get(Value key) const { - napi_value result; - napi_status status = napi_get_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); -} - -inline MaybeOrValue Object::Get(const char* utf8name) const { - napi_value result; - napi_status status = napi_get_named_property(_env, _value, utf8name, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); -} - -inline MaybeOrValue Object::Get(const std::string& utf8name) const { - return Get(utf8name.c_str()); -} - -template -inline MaybeOrValue Object::Set(napi_value key, const ValueType& value) { - napi_status status = - napi_set_property(_env, _value, key, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -template -inline MaybeOrValue Object::Set(Value key, const ValueType& value) { - napi_status status = - napi_set_property(_env, _value, key, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -template -inline MaybeOrValue Object::Set(const char* utf8name, - const ValueType& value) { - napi_status status = - napi_set_named_property(_env, _value, utf8name, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -template -inline MaybeOrValue Object::Set(const std::string& utf8name, - const ValueType& value) { - return Set(utf8name.c_str(), value); -} - -inline MaybeOrValue Object::Delete(napi_value key) { - bool result; - napi_status status = napi_delete_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Delete(Value key) { - bool result; - napi_status status = napi_delete_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Delete(const char* utf8name) { - return Delete(String::New(_env, utf8name)); -} - -inline MaybeOrValue Object::Delete(const std::string& utf8name) { - return Delete(String::New(_env, utf8name)); -} - -inline MaybeOrValue Object::Has(uint32_t index) const { - bool result; - napi_status status = napi_has_element(_env, _value, index, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Get(uint32_t index) const { - napi_value value; - napi_status status = napi_get_element(_env, _value, index, &value); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, value), Value); -} - -template -inline MaybeOrValue Object::Set(uint32_t index, const ValueType& value) { - napi_status status = - napi_set_element(_env, _value, index, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::Delete(uint32_t index) { - bool result; - napi_status status = napi_delete_element(_env, _value, index, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::GetPropertyNames() const { - napi_value result; - napi_status status = napi_get_property_names(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Array(_env, result), Array); -} - -inline MaybeOrValue Object::DefineProperty( - const PropertyDescriptor& property) { - napi_status status = napi_define_properties(_env, _value, 1, - reinterpret_cast(&property)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::DefineProperties( - const std::initializer_list& properties) { - napi_status status = napi_define_properties(_env, _value, properties.size(), - reinterpret_cast(properties.begin())); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::DefineProperties( - const std::vector& properties) { - napi_status status = napi_define_properties(_env, _value, properties.size(), - reinterpret_cast(properties.data())); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::InstanceOf( - const Function& constructor) const { - bool result; - napi_status status = napi_instanceof(_env, _value, constructor, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -template -inline void Object::AddFinalizer(Finalizer finalizeCallback, T* data) { - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = - details::AttachData(_env, - *this, - data, - details::FinalizeData::Wrapper, - finalizeData); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -template -inline void Object::AddFinalizer(Finalizer finalizeCallback, - T* data, - Hint* finalizeHint) { - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = - details::AttachData(_env, - *this, - data, - details::FinalizeData::WrapperWithHint, - finalizeData); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -#ifdef NAPI_CPP_EXCEPTIONS -inline Object::const_iterator::const_iterator(const Object* object, - const Type type) { - _object = object; - _keys = object->GetPropertyNames(); - _index = type == Type::BEGIN ? 0 : _keys.Length(); -} - -inline Object::const_iterator Napi::Object::begin() const { - const_iterator it(this, Object::const_iterator::Type::BEGIN); - return it; -} - -inline Object::const_iterator Napi::Object::end() const { - const_iterator it(this, Object::const_iterator::Type::END); - return it; -} - -inline Object::const_iterator& Object::const_iterator::operator++() { - ++_index; - return *this; -} - -inline bool Object::const_iterator::operator==( - const const_iterator& other) const { - return _index == other._index; -} - -inline bool Object::const_iterator::operator!=( - const const_iterator& other) const { - return _index != other._index; -} - -inline const std::pair> -Object::const_iterator::operator*() const { - const Value key = _keys[_index]; - const PropertyLValue value = (*_object)[key]; - return {key, value}; -} - -inline Object::iterator::iterator(Object* object, const Type type) { - _object = object; - _keys = object->GetPropertyNames(); - _index = type == Type::BEGIN ? 0 : _keys.Length(); -} - -inline Object::iterator Napi::Object::begin() { - iterator it(this, Object::iterator::Type::BEGIN); - return it; -} - -inline Object::iterator Napi::Object::end() { - iterator it(this, Object::iterator::Type::END); - return it; -} - -inline Object::iterator& Object::iterator::operator++() { - ++_index; - return *this; -} - -inline bool Object::iterator::operator==(const iterator& other) const { - return _index == other._index; -} - -inline bool Object::iterator::operator!=(const iterator& other) const { - return _index != other._index; -} - -inline std::pair> -Object::iterator::operator*() { - Value key = _keys[_index]; - PropertyLValue value = (*_object)[key]; - return {key, value}; -} -#endif // NAPI_CPP_EXCEPTIONS - -#if NAPI_VERSION >= 8 -inline MaybeOrValue Object::Freeze() { - napi_status status = napi_object_freeze(_env, _value); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::Seal() { - napi_status status = napi_object_seal(_env, _value); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} -#endif // NAPI_VERSION >= 8 - -//////////////////////////////////////////////////////////////////////////////// -// External class -//////////////////////////////////////////////////////////////////////////////// - -template -inline External External::New(napi_env env, T* data) { - napi_value value; - napi_status status = napi_create_external(env, data, nullptr, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, External()); - return External(env, value); -} - -template -template -inline External External::New(napi_env env, - T* data, - Finalizer finalizeCallback) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = napi_create_external( - env, - data, - details::FinalizeData::Wrapper, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, External()); - } - return External(env, value); -} - -template -template -inline External External::New(napi_env env, - T* data, - Finalizer finalizeCallback, - Hint* finalizeHint) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = napi_create_external( - env, - data, - details::FinalizeData::WrapperWithHint, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, External()); - } - return External(env, value); -} - -template -inline External::External() : Value() { -} - -template -inline External::External(napi_env env, napi_value value) : Value(env, value) { -} - -template -inline T* External::Data() const { - void* data; - napi_status status = napi_get_value_external(_env, _value, &data); - NAPI_THROW_IF_FAILED(_env, status, nullptr); - return reinterpret_cast(data); -} - -//////////////////////////////////////////////////////////////////////////////// -// Array class -//////////////////////////////////////////////////////////////////////////////// - -inline Array Array::New(napi_env env) { - napi_value value; - napi_status status = napi_create_array(env, &value); - NAPI_THROW_IF_FAILED(env, status, Array()); - return Array(env, value); -} - -inline Array Array::New(napi_env env, size_t length) { - napi_value value; - napi_status status = napi_create_array_with_length(env, length, &value); - NAPI_THROW_IF_FAILED(env, status, Array()); - return Array(env, value); -} - -inline Array::Array() : Object() { -} - -inline Array::Array(napi_env env, napi_value value) : Object(env, value) { -} - -inline uint32_t Array::Length() const { - uint32_t result; - napi_status status = napi_get_array_length(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -// ArrayBuffer class -//////////////////////////////////////////////////////////////////////////////// - -inline ArrayBuffer ArrayBuffer::New(napi_env env, size_t byteLength) { - napi_value value; - void* data; - napi_status status = napi_create_arraybuffer(env, byteLength, &data, &value); - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - - return ArrayBuffer(env, value); -} - -inline ArrayBuffer ArrayBuffer::New(napi_env env, - void* externalData, - size_t byteLength) { - napi_value value; - napi_status status = napi_create_external_arraybuffer( - env, externalData, byteLength, nullptr, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - - return ArrayBuffer(env, value); -} - -template -inline ArrayBuffer ArrayBuffer::New(napi_env env, - void* externalData, - size_t byteLength, - Finalizer finalizeCallback) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = napi_create_external_arraybuffer( - env, - externalData, - byteLength, - details::FinalizeData::Wrapper, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - } - - return ArrayBuffer(env, value); -} - -template -inline ArrayBuffer ArrayBuffer::New(napi_env env, - void* externalData, - size_t byteLength, - Finalizer finalizeCallback, - Hint* finalizeHint) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = napi_create_external_arraybuffer( - env, - externalData, - byteLength, - details::FinalizeData::WrapperWithHint, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - } - - return ArrayBuffer(env, value); -} - -inline ArrayBuffer::ArrayBuffer() : Object() { -} - -inline ArrayBuffer::ArrayBuffer(napi_env env, napi_value value) - : Object(env, value) { -} - -inline void* ArrayBuffer::Data() { - void* data; - napi_status status = napi_get_arraybuffer_info(_env, _value, &data, nullptr); - NAPI_THROW_IF_FAILED(_env, status, nullptr); - return data; -} - -inline size_t ArrayBuffer::ByteLength() { - size_t length; - napi_status status = napi_get_arraybuffer_info(_env, _value, nullptr, &length); - NAPI_THROW_IF_FAILED(_env, status, 0); - return length; -} - -#if NAPI_VERSION >= 7 -inline bool ArrayBuffer::IsDetached() const { - bool detached; - napi_status status = napi_is_detached_arraybuffer(_env, _value, &detached); - NAPI_THROW_IF_FAILED(_env, status, false); - return detached; -} - -inline void ArrayBuffer::Detach() { - napi_status status = napi_detach_arraybuffer(_env, _value); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} -#endif // NAPI_VERSION >= 7 - -//////////////////////////////////////////////////////////////////////////////// -// DataView class -//////////////////////////////////////////////////////////////////////////////// -inline DataView DataView::New(napi_env env, - Napi::ArrayBuffer arrayBuffer) { - return New(env, arrayBuffer, 0, arrayBuffer.ByteLength()); -} - -inline DataView DataView::New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset) { - if (byteOffset > arrayBuffer.ByteLength()) { - NAPI_THROW(RangeError::New(env, - "Start offset is outside the bounds of the buffer"), - DataView()); - } - return New(env, arrayBuffer, byteOffset, - arrayBuffer.ByteLength() - byteOffset); -} - -inline DataView DataView::New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset, - size_t byteLength) { - if (byteOffset + byteLength > arrayBuffer.ByteLength()) { - NAPI_THROW(RangeError::New(env, "Invalid DataView length"), - DataView()); - } - napi_value value; - napi_status status = napi_create_dataview( - env, byteLength, arrayBuffer, byteOffset, &value); - NAPI_THROW_IF_FAILED(env, status, DataView()); - return DataView(env, value); -} - -inline DataView::DataView() : Object() { -} - -inline DataView::DataView(napi_env env, napi_value value) : Object(env, value) { - napi_status status = napi_get_dataview_info( - _env, - _value /* dataView */, - &_length /* byteLength */, - &_data /* data */, - nullptr /* arrayBuffer */, - nullptr /* byteOffset */); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline Napi::ArrayBuffer DataView::ArrayBuffer() const { - napi_value arrayBuffer; - napi_status status = napi_get_dataview_info( - _env, - _value /* dataView */, - nullptr /* byteLength */, - nullptr /* data */, - &arrayBuffer /* arrayBuffer */, - nullptr /* byteOffset */); - NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); - return Napi::ArrayBuffer(_env, arrayBuffer); -} - -inline size_t DataView::ByteOffset() const { - size_t byteOffset; - napi_status status = napi_get_dataview_info( - _env, - _value /* dataView */, - nullptr /* byteLength */, - nullptr /* data */, - nullptr /* arrayBuffer */, - &byteOffset /* byteOffset */); - NAPI_THROW_IF_FAILED(_env, status, 0); - return byteOffset; -} - -inline size_t DataView::ByteLength() const { - return _length; -} - -inline void* DataView::Data() const { - return _data; -} - -inline float DataView::GetFloat32(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline double DataView::GetFloat64(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline int8_t DataView::GetInt8(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline int16_t DataView::GetInt16(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline int32_t DataView::GetInt32(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline uint8_t DataView::GetUint8(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline uint16_t DataView::GetUint16(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline uint32_t DataView::GetUint32(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline void DataView::SetFloat32(size_t byteOffset, float value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetFloat64(size_t byteOffset, double value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetInt8(size_t byteOffset, int8_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetInt16(size_t byteOffset, int16_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetInt32(size_t byteOffset, int32_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetUint8(size_t byteOffset, uint8_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetUint16(size_t byteOffset, uint16_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetUint32(size_t byteOffset, uint32_t value) const { - WriteData(byteOffset, value); -} - -template -inline T DataView::ReadData(size_t byteOffset) const { - if (byteOffset + sizeof(T) > _length || - byteOffset + sizeof(T) < byteOffset) { // overflow - NAPI_THROW(RangeError::New(_env, - "Offset is outside the bounds of the DataView"), 0); - } - - return *reinterpret_cast(static_cast(_data) + byteOffset); -} - -template -inline void DataView::WriteData(size_t byteOffset, T value) const { - if (byteOffset + sizeof(T) > _length || - byteOffset + sizeof(T) < byteOffset) { // overflow - NAPI_THROW_VOID(RangeError::New(_env, - "Offset is outside the bounds of the DataView")); - } - - *reinterpret_cast(static_cast(_data) + byteOffset) = value; -} - -//////////////////////////////////////////////////////////////////////////////// -// TypedArray class -//////////////////////////////////////////////////////////////////////////////// - -inline TypedArray::TypedArray() - : Object(), _type(TypedArray::unknown_array_type), _length(0) { -} - -inline TypedArray::TypedArray(napi_env env, napi_value value) - : Object(env, value), _type(TypedArray::unknown_array_type), _length(0) { -} - -inline TypedArray::TypedArray(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length) - : Object(env, value), _type(type), _length(length) { -} - -inline napi_typedarray_type TypedArray::TypedArrayType() const { - if (_type == TypedArray::unknown_array_type) { - napi_status status = napi_get_typedarray_info(_env, _value, - &const_cast(this)->_type, &const_cast(this)->_length, - nullptr, nullptr, nullptr); - NAPI_THROW_IF_FAILED(_env, status, napi_int8_array); - } - - return _type; -} - -inline uint8_t TypedArray::ElementSize() const { - switch (TypedArrayType()) { - case napi_int8_array: - case napi_uint8_array: - case napi_uint8_clamped_array: - return 1; - case napi_int16_array: - case napi_uint16_array: - return 2; - case napi_int32_array: - case napi_uint32_array: - case napi_float32_array: - return 4; - case napi_float64_array: -#if (NAPI_VERSION > 5) - case napi_bigint64_array: - case napi_biguint64_array: -#endif // (NAPI_VERSION > 5) - return 8; - default: - return 0; - } -} - -inline size_t TypedArray::ElementLength() const { - if (_type == TypedArray::unknown_array_type) { - napi_status status = napi_get_typedarray_info(_env, _value, - &const_cast(this)->_type, &const_cast(this)->_length, - nullptr, nullptr, nullptr); - NAPI_THROW_IF_FAILED(_env, status, 0); - } - - return _length; -} - -inline size_t TypedArray::ByteOffset() const { - size_t byteOffset; - napi_status status = napi_get_typedarray_info( - _env, _value, nullptr, nullptr, nullptr, nullptr, &byteOffset); - NAPI_THROW_IF_FAILED(_env, status, 0); - return byteOffset; -} - -inline size_t TypedArray::ByteLength() const { - return ElementSize() * ElementLength(); -} - -inline Napi::ArrayBuffer TypedArray::ArrayBuffer() const { - napi_value arrayBuffer; - napi_status status = napi_get_typedarray_info( - _env, _value, nullptr, nullptr, nullptr, &arrayBuffer, nullptr); - NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); - return Napi::ArrayBuffer(_env, arrayBuffer); -} - -//////////////////////////////////////////////////////////////////////////////// -// TypedArrayOf class -//////////////////////////////////////////////////////////////////////////////// - -template -inline TypedArrayOf TypedArrayOf::New(napi_env env, - size_t elementLength, - napi_typedarray_type type) { - Napi::ArrayBuffer arrayBuffer = Napi::ArrayBuffer::New(env, elementLength * sizeof (T)); - return New(env, elementLength, arrayBuffer, 0, type); -} - -template -inline TypedArrayOf TypedArrayOf::New(napi_env env, - size_t elementLength, - Napi::ArrayBuffer arrayBuffer, - size_t bufferOffset, - napi_typedarray_type type) { - napi_value value; - napi_status status = napi_create_typedarray( - env, type, elementLength, arrayBuffer, bufferOffset, &value); - NAPI_THROW_IF_FAILED(env, status, TypedArrayOf()); - - return TypedArrayOf( - env, value, type, elementLength, - reinterpret_cast(reinterpret_cast(arrayBuffer.Data()) + bufferOffset)); -} - -template -inline TypedArrayOf::TypedArrayOf() : TypedArray(), _data(nullptr) { -} - -template -inline TypedArrayOf::TypedArrayOf(napi_env env, napi_value value) - : TypedArray(env, value), _data(nullptr) { - napi_status status = napi_ok; - if (value != nullptr) { - void* data = nullptr; - status = napi_get_typedarray_info( - _env, _value, &_type, &_length, &data, nullptr, nullptr); - _data = static_cast(data); - } else { - _type = TypedArrayTypeForPrimitiveType(); - _length = 0; - } - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -template -inline TypedArrayOf::TypedArrayOf(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length, - T* data) - : TypedArray(env, value, type, length), _data(data) { - if (!(type == TypedArrayTypeForPrimitiveType() || - (type == napi_uint8_clamped_array && std::is_same::value))) { - NAPI_THROW_VOID(TypeError::New(env, "Array type must match the template parameter. " - "(Uint8 arrays may optionally have the \"clamped\" array type.)")); - } -} - -template -inline T& TypedArrayOf::operator [](size_t index) { - return _data[index]; -} - -template -inline const T& TypedArrayOf::operator [](size_t index) const { - return _data[index]; -} - -template -inline T* TypedArrayOf::Data() { - return _data; -} - -template -inline const T* TypedArrayOf::Data() const { - return _data; -} - -//////////////////////////////////////////////////////////////////////////////// -// Function class -//////////////////////////////////////////////////////////////////////////////// - -template -static inline napi_status -CreateFunction(napi_env env, - const char* utf8name, - napi_callback cb, - CbData* data, - napi_value* result) { - napi_status status = - napi_create_function(env, utf8name, NAPI_AUTO_LENGTH, cb, data, result); - if (status == napi_ok) { - status = Napi::details::AttachData(env, *result, data); - } - - return status; -} - -template -inline Function Function::New(napi_env env, const char* utf8name, void* data) { - napi_value result = nullptr; - napi_status status = napi_create_function(env, - utf8name, - NAPI_AUTO_LENGTH, - details::TemplatedVoidCallback, - data, - &result); - NAPI_THROW_IF_FAILED(env, status, Function()); - return Function(env, result); -} - -template -inline Function Function::New(napi_env env, const char* utf8name, void* data) { - napi_value result = nullptr; - napi_status status = napi_create_function(env, - utf8name, - NAPI_AUTO_LENGTH, - details::TemplatedCallback, - data, - &result); - NAPI_THROW_IF_FAILED(env, status, Function()); - return Function(env, result); -} - -template -inline Function Function::New(napi_env env, - const std::string& utf8name, - void* data) { - return Function::New(env, utf8name.c_str(), data); -} - -template -inline Function Function::New(napi_env env, - const std::string& utf8name, - void* data) { - return Function::New(env, utf8name.c_str(), data); -} - -template -inline Function Function::New(napi_env env, - Callable cb, - const char* utf8name, - void* data) { - using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); - using CbData = details::CallbackData; - auto callbackData = new CbData{std::move(cb), data}; - - napi_value value; - napi_status status = CreateFunction(env, - utf8name, - CbData::Wrapper, - callbackData, - &value); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, Function()); - } - - return Function(env, value); -} - -template -inline Function Function::New(napi_env env, - Callable cb, - const std::string& utf8name, - void* data) { - return New(env, cb, utf8name.c_str(), data); -} - -inline Function::Function() : Object() { -} - -inline Function::Function(napi_env env, napi_value value) : Object(env, value) { -} - -inline MaybeOrValue Function::operator()( - const std::initializer_list& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call( - const std::initializer_list& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call( - const std::vector& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call(size_t argc, - const napi_value* args) const { - return Call(Env().Undefined(), argc, args); -} - -inline MaybeOrValue Function::Call( - napi_value recv, const std::initializer_list& args) const { - return Call(recv, args.size(), args.begin()); -} - -inline MaybeOrValue Function::Call( - napi_value recv, const std::vector& args) const { - return Call(recv, args.size(), args.data()); -} - -inline MaybeOrValue Function::Call(napi_value recv, - size_t argc, - const napi_value* args) const { - napi_value result; - napi_status status = napi_call_function( - _env, recv, _value, argc, args, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Value(_env, result), Napi::Value); -} - -inline MaybeOrValue Function::MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context) const { - return MakeCallback(recv, args.size(), args.begin(), context); -} - -inline MaybeOrValue Function::MakeCallback( - napi_value recv, - const std::vector& args, - napi_async_context context) const { - return MakeCallback(recv, args.size(), args.data(), context); -} - -inline MaybeOrValue Function::MakeCallback( - napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context) const { - napi_value result; - napi_status status = napi_make_callback( - _env, context, recv, _value, argc, args, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Value(_env, result), Napi::Value); -} - -inline MaybeOrValue Function::New( - const std::initializer_list& args) const { - return New(args.size(), args.begin()); -} - -inline MaybeOrValue Function::New( - const std::vector& args) const { - return New(args.size(), args.data()); -} - -inline MaybeOrValue Function::New(size_t argc, - const napi_value* args) const { - napi_value result; - napi_status status = napi_new_instance( - _env, _value, argc, args, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Object(_env, result), Napi::Object); -} - -//////////////////////////////////////////////////////////////////////////////// -// Promise class -//////////////////////////////////////////////////////////////////////////////// - -inline Promise::Deferred Promise::Deferred::New(napi_env env) { - return Promise::Deferred(env); -} - -inline Promise::Deferred::Deferred(napi_env env) : _env(env) { - napi_status status = napi_create_promise(_env, &_deferred, &_promise); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline Promise Promise::Deferred::Promise() const { - return Napi::Promise(_env, _promise); -} - -inline Napi::Env Promise::Deferred::Env() const { - return Napi::Env(_env); -} - -inline void Promise::Deferred::Resolve(napi_value value) const { - napi_status status = napi_resolve_deferred(_env, _deferred, value); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline void Promise::Deferred::Reject(napi_value value) const { - napi_status status = napi_reject_deferred(_env, _deferred, value); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline Promise::Promise(napi_env env, napi_value value) : Object(env, value) { -} - -//////////////////////////////////////////////////////////////////////////////// -// Buffer class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Buffer Buffer::New(napi_env env, size_t length) { - napi_value value; - void* data; - napi_status status = napi_create_buffer(env, length * sizeof (T), &data, &value); - NAPI_THROW_IF_FAILED(env, status, Buffer()); - return Buffer(env, value, length, static_cast(data)); -} - -template -inline Buffer Buffer::New(napi_env env, T* data, size_t length) { - napi_value value; - napi_status status = napi_create_external_buffer( - env, length * sizeof (T), data, nullptr, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, Buffer()); - return Buffer(env, value, length, data); -} - -template -template -inline Buffer Buffer::New(napi_env env, - T* data, - size_t length, - Finalizer finalizeCallback) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = napi_create_external_buffer( - env, - length * sizeof (T), - data, - details::FinalizeData::Wrapper, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, Buffer()); - } - return Buffer(env, value, length, data); -} - -template -template -inline Buffer Buffer::New(napi_env env, - T* data, - size_t length, - Finalizer finalizeCallback, - Hint* finalizeHint) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = napi_create_external_buffer( - env, - length * sizeof (T), - data, - details::FinalizeData::WrapperWithHint, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, Buffer()); - } - return Buffer(env, value, length, data); -} - -template -inline Buffer Buffer::Copy(napi_env env, const T* data, size_t length) { - napi_value value; - napi_status status = napi_create_buffer_copy( - env, length * sizeof (T), data, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, Buffer()); - return Buffer(env, value); -} - -template -inline Buffer::Buffer() : Uint8Array(), _length(0), _data(nullptr) { -} - -template -inline Buffer::Buffer(napi_env env, napi_value value) - : Uint8Array(env, value), _length(0), _data(nullptr) { -} - -template -inline Buffer::Buffer(napi_env env, napi_value value, size_t length, T* data) - : Uint8Array(env, value), _length(length), _data(data) { -} - -template -inline size_t Buffer::Length() const { - EnsureInfo(); - return _length; -} - -template -inline T* Buffer::Data() const { - EnsureInfo(); - return _data; -} - -template -inline void Buffer::EnsureInfo() const { - // The Buffer instance may have been constructed from a napi_value whose - // length/data are not yet known. Fetch and cache these values just once, - // since they can never change during the lifetime of the Buffer. - if (_data == nullptr) { - size_t byteLength; - void* voidData; - napi_status status = napi_get_buffer_info(_env, _value, &voidData, &byteLength); - NAPI_THROW_IF_FAILED_VOID(_env, status); - _length = byteLength / sizeof (T); - _data = static_cast(voidData); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Error class -//////////////////////////////////////////////////////////////////////////////// - -inline Error Error::New(napi_env env) { - napi_status status; - napi_value error = nullptr; - bool is_exception_pending; - napi_extended_error_info last_error_info_copy; - - { - // We must retrieve the last error info before doing anything else because - // doing anything else will replace the last error info. - const napi_extended_error_info* last_error_info; - status = napi_get_last_error_info(env, &last_error_info); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_get_last_error_info"); - - // All fields of the `napi_extended_error_info` structure gets reset in - // subsequent Node-API function calls on the same `env`. This includes a - // call to `napi_is_exception_pending()`. So here it is necessary to make a - // copy of the information as the `error_code` field is used later on. - memcpy(&last_error_info_copy, - last_error_info, - sizeof(napi_extended_error_info)); - } - - status = napi_is_exception_pending(env, &is_exception_pending); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_is_exception_pending"); - - // A pending exception takes precedence over any internal error status. - if (is_exception_pending) { - status = napi_get_and_clear_last_exception(env, &error); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_get_and_clear_last_exception"); - } - else { - const char* error_message = last_error_info_copy.error_message != nullptr - ? last_error_info_copy.error_message - : "Error in native callback"; - - napi_value message; - status = napi_create_string_utf8( - env, - error_message, - std::strlen(error_message), - &message); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_string_utf8"); - - switch (last_error_info_copy.error_code) { - case napi_object_expected: - case napi_string_expected: - case napi_boolean_expected: - case napi_number_expected: - status = napi_create_type_error(env, nullptr, message, &error); - break; - default: - status = napi_create_error(env, nullptr, message, &error); - break; - } - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_error"); - } - - return Error(env, error); -} - -inline Error Error::New(napi_env env, const char* message) { - return Error::New(env, message, std::strlen(message), napi_create_error); -} - -inline Error Error::New(napi_env env, const std::string& message) { - return Error::New(env, message.c_str(), message.size(), napi_create_error); -} - -inline NAPI_NO_RETURN void Error::Fatal(const char* location, const char* message) { - napi_fatal_error(location, NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH); -} - -inline Error::Error() : ObjectReference() { -} - -inline Error::Error(napi_env env, napi_value value) : ObjectReference(env, nullptr) { - if (value != nullptr) { - // Attempting to create a reference on the error object. - // If it's not a Object/Function/Symbol, this call will return an error - // status. - napi_status status = napi_create_reference(env, value, 1, &_ref); - - if (status != napi_ok) { - napi_value wrappedErrorObj; - - // Create an error object - status = napi_create_object(env, &wrappedErrorObj); - NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_object"); - - // property flag that we attach to show the error object is wrapped - napi_property_descriptor wrapObjFlag = { - ERROR_WRAP_VALUE, // Unique GUID identifier since Symbol isn't a - // viable option - nullptr, - nullptr, - nullptr, - nullptr, - Value::From(env, value), - napi_enumerable, - nullptr}; - - status = napi_define_properties(env, wrappedErrorObj, 1, &wrapObjFlag); - NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_define_properties"); - - // Create a reference on the newly wrapped object - status = napi_create_reference(env, wrappedErrorObj, 1, &_ref); - } - - // Avoid infinite recursion in the failure case. - NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_reference"); - } -} - -inline Object Error::Value() const { - if (_ref == nullptr) { - return Object(_env, nullptr); - } - - napi_value refValue; - napi_status status = napi_get_reference_value(_env, _ref, &refValue); - NAPI_THROW_IF_FAILED(_env, status, Object()); - - napi_valuetype type; - status = napi_typeof(_env, refValue, &type); - NAPI_THROW_IF_FAILED(_env, status, Object()); - - // If refValue isn't a symbol, then we proceed to whether the refValue has the - // wrapped error flag - if (type != napi_symbol) { - // We are checking if the object is wrapped - bool isWrappedObject = false; - - status = napi_has_property( - _env, refValue, String::From(_env, ERROR_WRAP_VALUE), &isWrappedObject); - - // Don't care about status - if (isWrappedObject) { - napi_value unwrappedValue; - status = napi_get_property(_env, - refValue, - String::From(_env, ERROR_WRAP_VALUE), - &unwrappedValue); - NAPI_THROW_IF_FAILED(_env, status, Object()); - - return Object(_env, unwrappedValue); - } - } - - return Object(_env, refValue); -} - -inline Error::Error(Error&& other) : ObjectReference(std::move(other)) { -} - -inline Error& Error::operator =(Error&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline Error::Error(const Error& other) : ObjectReference(other) { -} - -inline Error& Error::operator =(const Error& other) { - Reset(); - - _env = other.Env(); - HandleScope scope(_env); - - napi_value value = other.Value(); - if (value != nullptr) { - napi_status status = napi_create_reference(_env, value, 1, &_ref); - NAPI_THROW_IF_FAILED(_env, status, *this); - } - - return *this; -} - -inline const std::string& Error::Message() const NAPI_NOEXCEPT { - if (_message.size() == 0 && _env != nullptr) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - _message = Get("message").As(); - } - catch (...) { - // Catch all errors here, to include e.g. a std::bad_alloc from - // the std::string::operator=, because this method may not throw. - } -#else // NAPI_CPP_EXCEPTIONS -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - Napi::Value message_val; - if (Get("message").UnwrapTo(&message_val)) { - _message = message_val.As(); - } -#else - _message = Get("message").As(); -#endif -#endif // NAPI_CPP_EXCEPTIONS - } - return _message; -} - -// we created an object on the &_ref -inline void Error::ThrowAsJavaScriptException() const { - HandleScope scope(_env); - if (!IsEmpty()) { -#ifdef NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS - bool pendingException = false; - - // check if there is already a pending exception. If so don't try to throw a - // new one as that is not allowed/possible - napi_status status = napi_is_exception_pending(_env, &pendingException); - - if ((status != napi_ok) || - ((status == napi_ok) && (pendingException == false))) { - // We intentionally don't use `NAPI_THROW_*` macros here to ensure - // that there is no possible recursion as `ThrowAsJavaScriptException` - // is part of `NAPI_THROW_*` macro definition for noexcept. - - status = napi_throw(_env, Value()); - - if (status == napi_pending_exception) { - // The environment must be terminating as we checked earlier and there - // was no pending exception. In this case continuing will result - // in a fatal error and there is nothing the author has done incorrectly - // in their code that is worth flagging through a fatal error - return; - } - } else { - status = napi_pending_exception; - } -#else - // We intentionally don't use `NAPI_THROW_*` macros here to ensure - // that there is no possible recursion as `ThrowAsJavaScriptException` - // is part of `NAPI_THROW_*` macro definition for noexcept. - - napi_status status = napi_throw(_env, Value()); -#endif - -#ifdef NAPI_CPP_EXCEPTIONS - if (status != napi_ok) { - throw Error::New(_env); - } -#else // NAPI_CPP_EXCEPTIONS - NAPI_FATAL_IF_FAILED(status, "Error::ThrowAsJavaScriptException", "napi_throw"); -#endif // NAPI_CPP_EXCEPTIONS - } -} - -#ifdef NAPI_CPP_EXCEPTIONS - -inline const char* Error::what() const NAPI_NOEXCEPT { - return Message().c_str(); -} - -#endif // NAPI_CPP_EXCEPTIONS - -template -inline TError Error::New(napi_env env, - const char* message, - size_t length, - create_error_fn create_error) { - napi_value str; - napi_status status = napi_create_string_utf8(env, message, length, &str); - NAPI_THROW_IF_FAILED(env, status, TError()); - - napi_value error; - status = create_error(env, nullptr, str, &error); - NAPI_THROW_IF_FAILED(env, status, TError()); - - return TError(env, error); -} - -inline TypeError TypeError::New(napi_env env, const char* message) { - return Error::New(env, message, std::strlen(message), napi_create_type_error); -} - -inline TypeError TypeError::New(napi_env env, const std::string& message) { - return Error::New(env, message.c_str(), message.size(), napi_create_type_error); -} - -inline TypeError::TypeError() : Error() { -} - -inline TypeError::TypeError(napi_env env, napi_value value) : Error(env, value) { -} - -inline RangeError RangeError::New(napi_env env, const char* message) { - return Error::New(env, message, std::strlen(message), napi_create_range_error); -} - -inline RangeError RangeError::New(napi_env env, const std::string& message) { - return Error::New(env, message.c_str(), message.size(), napi_create_range_error); -} - -inline RangeError::RangeError() : Error() { -} - -inline RangeError::RangeError(napi_env env, napi_value value) : Error(env, value) { -} - -//////////////////////////////////////////////////////////////////////////////// -// Reference class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Reference Reference::New(const T& value, uint32_t initialRefcount) { - napi_env env = value.Env(); - napi_value val = value; - - if (val == nullptr) { - return Reference(env, nullptr); - } - - napi_ref ref; - napi_status status = napi_create_reference(env, value, initialRefcount, &ref); - NAPI_THROW_IF_FAILED(env, status, Reference()); - - return Reference(env, ref); -} - - -template -inline Reference::Reference() : _env(nullptr), _ref(nullptr), _suppressDestruct(false) { -} - -template -inline Reference::Reference(napi_env env, napi_ref ref) - : _env(env), _ref(ref), _suppressDestruct(false) { -} - -template -inline Reference::~Reference() { - if (_ref != nullptr) { - if (!_suppressDestruct) { - napi_delete_reference(_env, _ref); - } - - _ref = nullptr; - } -} - -template -inline Reference::Reference(Reference&& other) - : _env(other._env), _ref(other._ref), _suppressDestruct(other._suppressDestruct) { - other._env = nullptr; - other._ref = nullptr; - other._suppressDestruct = false; -} - -template -inline Reference& Reference::operator =(Reference&& other) { - Reset(); - _env = other._env; - _ref = other._ref; - _suppressDestruct = other._suppressDestruct; - other._env = nullptr; - other._ref = nullptr; - other._suppressDestruct = false; - return *this; -} - -template -inline Reference::Reference(const Reference& other) - : _env(other._env), _ref(nullptr), _suppressDestruct(false) { - HandleScope scope(_env); - - napi_value value = other.Value(); - if (value != nullptr) { - // Copying is a limited scenario (currently only used for Error object) and always creates a - // strong reference to the given value even if the incoming reference is weak. - napi_status status = napi_create_reference(_env, value, 1, &_ref); - NAPI_FATAL_IF_FAILED(status, "Reference::Reference", "napi_create_reference"); - } -} - -template -inline Reference::operator napi_ref() const { - return _ref; -} - -template -inline bool Reference::operator ==(const Reference &other) const { - HandleScope scope(_env); - return this->Value().StrictEquals(other.Value()); -} - -template -inline bool Reference::operator !=(const Reference &other) const { - return !this->operator ==(other); -} - -template -inline Napi::Env Reference::Env() const { - return Napi::Env(_env); -} - -template -inline bool Reference::IsEmpty() const { - return _ref == nullptr; -} - -template -inline T Reference::Value() const { - if (_ref == nullptr) { - return T(_env, nullptr); - } - - napi_value value; - napi_status status = napi_get_reference_value(_env, _ref, &value); - NAPI_THROW_IF_FAILED(_env, status, T()); - return T(_env, value); -} - -template -inline uint32_t Reference::Ref() { - uint32_t result; - napi_status status = napi_reference_ref(_env, _ref, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -template -inline uint32_t Reference::Unref() { - uint32_t result; - napi_status status = napi_reference_unref(_env, _ref, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -template -inline void Reference::Reset() { - if (_ref != nullptr) { - napi_status status = napi_delete_reference(_env, _ref); - NAPI_THROW_IF_FAILED_VOID(_env, status); - _ref = nullptr; - } -} - -template -inline void Reference::Reset(const T& value, uint32_t refcount) { - Reset(); - _env = value.Env(); - - napi_value val = value; - if (val != nullptr) { - napi_status status = napi_create_reference(_env, value, refcount, &_ref); - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -template -inline void Reference::SuppressDestruct() { - _suppressDestruct = true; -} - -template -inline Reference Weak(T value) { - return Reference::New(value, 0); -} - -inline ObjectReference Weak(Object value) { - return Reference::New(value, 0); -} - -inline FunctionReference Weak(Function value) { - return Reference::New(value, 0); -} - -template -inline Reference Persistent(T value) { - return Reference::New(value, 1); -} - -inline ObjectReference Persistent(Object value) { - return Reference::New(value, 1); -} - -inline FunctionReference Persistent(Function value) { - return Reference::New(value, 1); -} - -//////////////////////////////////////////////////////////////////////////////// -// ObjectReference class -//////////////////////////////////////////////////////////////////////////////// - -inline ObjectReference::ObjectReference(): Reference() { -} - -inline ObjectReference::ObjectReference(napi_env env, napi_ref ref): Reference(env, ref) { -} - -inline ObjectReference::ObjectReference(Reference&& other) - : Reference(std::move(other)) { -} - -inline ObjectReference& ObjectReference::operator =(Reference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline ObjectReference::ObjectReference(ObjectReference&& other) - : Reference(std::move(other)) { -} - -inline ObjectReference& ObjectReference::operator =(ObjectReference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline ObjectReference::ObjectReference(const ObjectReference& other) - : Reference(other) { -} - -inline MaybeOrValue ObjectReference::Get( - const char* utf8name) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Get(utf8name); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue ObjectReference::Get( - const std::string& utf8name) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Get(utf8name); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - napi_value value) { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - Napi::Value value) { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - const char* utf8value) { - HandleScope scope(_env); - return Value().Set(utf8name, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - bool boolValue) { - HandleScope scope(_env); - return Value().Set(utf8name, boolValue); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - double numberValue) { - HandleScope scope(_env); - return Value().Set(utf8name, numberValue); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - napi_value value) { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - Napi::Value value) { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - std::string& utf8value) { - HandleScope scope(_env); - return Value().Set(utf8name, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - bool boolValue) { - HandleScope scope(_env); - return Value().Set(utf8name, boolValue); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - double numberValue) { - HandleScope scope(_env); - return Value().Set(utf8name, numberValue); -} - -inline MaybeOrValue ObjectReference::Get(uint32_t index) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Get(index); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - napi_value value) { - HandleScope scope(_env); - return Value().Set(index, value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - Napi::Value value) { - HandleScope scope(_env); - return Value().Set(index, value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - const char* utf8value) { - HandleScope scope(_env); - return Value().Set(index, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - const std::string& utf8value) { - HandleScope scope(_env); - return Value().Set(index, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, bool boolValue) { - HandleScope scope(_env); - return Value().Set(index, boolValue); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - double numberValue) { - HandleScope scope(_env); - return Value().Set(index, numberValue); -} - -//////////////////////////////////////////////////////////////////////////////// -// FunctionReference class -//////////////////////////////////////////////////////////////////////////////// - -inline FunctionReference::FunctionReference(): Reference() { -} - -inline FunctionReference::FunctionReference(napi_env env, napi_ref ref) - : Reference(env, ref) { -} - -inline FunctionReference::FunctionReference(Reference&& other) - : Reference(std::move(other)) { -} - -inline FunctionReference& FunctionReference::operator =(Reference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline FunctionReference::FunctionReference(FunctionReference&& other) - : Reference(std::move(other)) { -} - -inline FunctionReference& FunctionReference::operator =(FunctionReference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline MaybeOrValue FunctionReference::operator()( - const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value()(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - const std::vector& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - napi_value recv, const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(recv, args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - napi_value recv, const std::vector& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(recv, args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - napi_value recv, size_t argc, const napi_value* args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(recv, argc, args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().MakeCallback(recv, args, context); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::MakeCallback( - napi_value recv, - const std::vector& args, - napi_async_context context) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().MakeCallback(recv, args, context); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::MakeCallback( - napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = - Value().MakeCallback(recv, argc, args, context); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::New( - const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().New(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap()).As()); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Object(); - } - return scope.Escape(result).As(); -#endif -} - -inline MaybeOrValue FunctionReference::New( - const std::vector& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().New(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap()).As()); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Object(); - } - return scope.Escape(result).As(); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -// CallbackInfo class -//////////////////////////////////////////////////////////////////////////////// - -inline CallbackInfo::CallbackInfo(napi_env env, napi_callback_info info) - : _env(env), _info(info), _this(nullptr), _dynamicArgs(nullptr), _data(nullptr) { - _argc = _staticArgCount; - _argv = _staticArgs; - napi_status status = napi_get_cb_info(env, info, &_argc, _argv, &_this, &_data); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - if (_argc > _staticArgCount) { - // Use either a fixed-size array (on the stack) or a dynamically-allocated - // array (on the heap) depending on the number of args. - _dynamicArgs = new napi_value[_argc]; - _argv = _dynamicArgs; - - status = napi_get_cb_info(env, info, &_argc, _argv, nullptr, nullptr); - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -inline CallbackInfo::~CallbackInfo() { - if (_dynamicArgs != nullptr) { - delete[] _dynamicArgs; - } -} - -inline Value CallbackInfo::NewTarget() const { - napi_value newTarget; - napi_status status = napi_get_new_target(_env, _info, &newTarget); - NAPI_THROW_IF_FAILED(_env, status, Value()); - return Value(_env, newTarget); -} - -inline bool CallbackInfo::IsConstructCall() const { - return !NewTarget().IsEmpty(); -} - -inline Napi::Env CallbackInfo::Env() const { - return Napi::Env(_env); -} - -inline size_t CallbackInfo::Length() const { - return _argc; -} - -inline const Value CallbackInfo::operator [](size_t index) const { - return index < _argc ? Value(_env, _argv[index]) : Env().Undefined(); -} - -inline Value CallbackInfo::This() const { - if (_this == nullptr) { - return Env().Undefined(); - } - return Object(_env, _this); -} - -inline void* CallbackInfo::Data() const { - return _data; -} - -inline void CallbackInfo::SetData(void* data) { - _data = data; -} - -//////////////////////////////////////////////////////////////////////////////// -// PropertyDescriptor class -//////////////////////////////////////////////////////////////////////////////// - -template -PropertyDescriptor -PropertyDescriptor::Accessor(const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.utf8name = utf8name; - desc.getter = details::TemplatedCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template -PropertyDescriptor -PropertyDescriptor::Accessor(const std::string& utf8name, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), attributes, data); -} - -template -PropertyDescriptor -PropertyDescriptor::Accessor(Name name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.name = name; - desc.getter = details::TemplatedCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template < -typename PropertyDescriptor::GetterCallback Getter, -typename PropertyDescriptor::SetterCallback Setter> -PropertyDescriptor -PropertyDescriptor::Accessor(const char* utf8name, - napi_property_attributes attributes, - void* data) { - - napi_property_descriptor desc = napi_property_descriptor(); - - desc.utf8name = utf8name; - desc.getter = details::TemplatedCallback; - desc.setter = details::TemplatedVoidCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template < -typename PropertyDescriptor::GetterCallback Getter, -typename PropertyDescriptor::SetterCallback Setter> -PropertyDescriptor -PropertyDescriptor::Accessor(const std::string& utf8name, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), attributes, data); -} - -template < -typename PropertyDescriptor::GetterCallback Getter, -typename PropertyDescriptor::SetterCallback Setter> -PropertyDescriptor -PropertyDescriptor::Accessor(Name name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.name = name; - desc.getter = details::TemplatedCallback; - desc.setter = details::TemplatedVoidCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template -inline PropertyDescriptor -PropertyDescriptor::Accessor(Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - napi_property_attributes attributes, - void* data) { - using CbData = details::CallbackData; - auto callbackData = new CbData({ getter, data }); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({ - utf8name, - nullptr, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - napi_property_attributes attributes, - void* data) { - return Accessor(env, object, utf8name.c_str(), getter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - napi_property_attributes attributes, - void* data) { - using CbData = details::CallbackData; - auto callbackData = new CbData({ getter, data }); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({ - nullptr, - name, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - using CbData = details::AccessorCallbackData; - auto callbackData = new CbData({ getter, setter, data }); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({ - utf8name, - nullptr, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - return Accessor(env, object, utf8name.c_str(), getter, setter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor(Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - using CbData = details::AccessorCallbackData; - auto callbackData = new CbData({ getter, setter, data }); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({ - nullptr, - name, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(Napi::Env env, - Napi::Object /*object*/, - const char* utf8name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return PropertyDescriptor({ - utf8name, - nullptr, - nullptr, - nullptr, - nullptr, - Napi::Function::New(env, cb, utf8name, data), - attributes, - nullptr - }); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return Function(env, object, utf8name.c_str(), cb, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function(Napi::Env env, - Napi::Object /*object*/, - Name name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return PropertyDescriptor({ - nullptr, - name, - nullptr, - nullptr, - nullptr, - Napi::Function::New(env, cb, nullptr, data), - attributes, - nullptr - }); -} - -inline PropertyDescriptor PropertyDescriptor::Value(const char* utf8name, - napi_value value, - napi_property_attributes attributes) { - return PropertyDescriptor({ - utf8name, nullptr, nullptr, nullptr, nullptr, value, attributes, nullptr - }); -} - -inline PropertyDescriptor PropertyDescriptor::Value(const std::string& utf8name, - napi_value value, - napi_property_attributes attributes) { - return Value(utf8name.c_str(), value, attributes); -} - -inline PropertyDescriptor PropertyDescriptor::Value(napi_value name, - napi_value value, - napi_property_attributes attributes) { - return PropertyDescriptor({ - nullptr, name, nullptr, nullptr, nullptr, value, attributes, nullptr - }); -} - -inline PropertyDescriptor PropertyDescriptor::Value(Name name, - Napi::Value value, - napi_property_attributes attributes) { - napi_value nameValue = name; - napi_value valueValue = value; - return PropertyDescriptor::Value(nameValue, valueValue, attributes); -} - -inline PropertyDescriptor::PropertyDescriptor(napi_property_descriptor desc) - : _desc(desc) { -} - -inline PropertyDescriptor::operator napi_property_descriptor&() { - return _desc; -} - -inline PropertyDescriptor::operator const napi_property_descriptor&() const { - return _desc; -} - -//////////////////////////////////////////////////////////////////////////////// -// InstanceWrap class -//////////////////////////////////////////////////////////////////////////////// - -template -inline void InstanceWrap::AttachPropData(napi_env env, - napi_value value, - const napi_property_descriptor* prop) { - napi_status status; - if (!(prop->attributes & napi_static)) { - if (prop->method == T::InstanceVoidMethodCallbackWrapper) { - status = Napi::details::AttachData(env, - value, - static_cast(prop->data)); - NAPI_THROW_IF_FAILED_VOID(env, status); - } else if (prop->method == T::InstanceMethodCallbackWrapper) { - status = Napi::details::AttachData(env, - value, - static_cast(prop->data)); - NAPI_THROW_IF_FAILED_VOID(env, status); - } else if (prop->getter == T::InstanceGetterCallbackWrapper || - prop->setter == T::InstanceSetterCallbackWrapper) { - status = Napi::details::AttachData(env, - value, - static_cast(prop->data)); - NAPI_THROW_IF_FAILED_VOID(env, status); - } - } -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceVoidMethodCallbackData* callbackData = - new InstanceVoidMethodCallbackData({ method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::InstanceVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, - InstanceMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceMethodCallbackData* callbackData = new InstanceMethodCallbackData({ method, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::InstanceMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceVoidMethodCallbackData* callbackData = - new InstanceVoidMethodCallbackData({ method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::InstanceVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, - InstanceMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceMethodCallbackData* callbackData = new InstanceMethodCallbackData({ method, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::InstanceMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceVoidMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedInstanceVoidCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedInstanceCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceVoidMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedInstanceVoidCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedInstanceCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - const char* utf8name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes, - void* data) { - InstanceAccessorCallbackData* callbackData = - new InstanceAccessorCallbackData({ getter, setter, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - Symbol name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes, - void* data) { - InstanceAccessorCallbackData* callbackData = - new InstanceAccessorCallbackData({ getter, setter, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceGetterCallback getter, - typename InstanceWrap::InstanceSetterCallback setter> -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = details::TemplatedInstanceCallback; - desc.setter = This::WrapSetter(This::SetterTag()); - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceGetterCallback getter, - typename InstanceWrap::InstanceSetterCallback setter> -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - Symbol name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = details::TemplatedInstanceCallback; - desc.setter = This::WrapSetter(This::SetterTag()); - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceValue( - const char* utf8name, - Napi::Value value, - napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.value = value; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceValue( - Symbol name, - Napi::Value value, - napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.value = value; - desc.attributes = attributes; - return desc; -} - -template -inline napi_value InstanceWrap::InstanceVoidMethodCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceVoidMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->callback; - (instance->*cb)(callbackInfo); - return nullptr; - }); -} - -template -inline napi_value InstanceWrap::InstanceMethodCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->callback; - return (instance->*cb)(callbackInfo); - }); -} - -template -inline napi_value InstanceWrap::InstanceGetterCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->getterCallback; - return (instance->*cb)(callbackInfo); - }); -} - -template -inline napi_value InstanceWrap::InstanceSetterCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->setterCallback; - (instance->*cb)(callbackInfo, callbackInfo[0]); - return nullptr; - }); -} - -template -template ::InstanceSetterCallback method> -inline napi_value InstanceWrap::WrappedMethod( - napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - const CallbackInfo cbInfo(env, info); - T* instance = T::Unwrap(cbInfo.This().As()); - (instance->*method)(cbInfo, cbInfo[0]); - return nullptr; - }); -} - -//////////////////////////////////////////////////////////////////////////////// -// ObjectWrap class -//////////////////////////////////////////////////////////////////////////////// - -template -inline ObjectWrap::ObjectWrap(const Napi::CallbackInfo& callbackInfo) { - napi_env env = callbackInfo.Env(); - napi_value wrapper = callbackInfo.This(); - napi_status status; - napi_ref ref; - T* instance = static_cast(this); - status = napi_wrap(env, wrapper, instance, FinalizeCallback, nullptr, &ref); - NAPI_THROW_IF_FAILED_VOID(env, status); - - Reference* instanceRef = instance; - *instanceRef = Reference(env, ref); -} - -template -inline ObjectWrap::~ObjectWrap() { - // If the JS object still exists at this point, remove the finalizer added - // through `napi_wrap()`. - if (!IsEmpty()) { - Object object = Value(); - // It is not valid to call `napi_remove_wrap()` with an empty `object`. - // This happens e.g. during garbage collection. - if (!object.IsEmpty() && _construction_failed) { - napi_remove_wrap(Env(), object, nullptr); - } - } -} - -template -inline T* ObjectWrap::Unwrap(Object wrapper) { - void* unwrapped; - napi_status status = napi_unwrap(wrapper.Env(), wrapper, &unwrapped); - NAPI_THROW_IF_FAILED(wrapper.Env(), status, nullptr); - return static_cast(unwrapped); -} - -template -inline Function -ObjectWrap::DefineClass(Napi::Env env, - const char* utf8name, - const size_t props_count, - const napi_property_descriptor* descriptors, - void* data) { - napi_status status; - std::vector props(props_count); - - // We copy the descriptors to a local array because before defining the class - // we must replace static method property descriptors with value property - // descriptors such that the value is a function-valued `napi_value` created - // with `CreateFunction()`. - // - // This replacement could be made for instance methods as well, but V8 aborts - // if we do that, because it expects methods defined on the prototype template - // to have `FunctionTemplate`s. - for (size_t index = 0; index < props_count; index++) { - props[index] = descriptors[index]; - napi_property_descriptor* prop = &props[index]; - if (prop->method == T::StaticMethodCallbackWrapper) { - status = CreateFunction(env, - utf8name, - prop->method, - static_cast(prop->data), - &(prop->value)); - NAPI_THROW_IF_FAILED(env, status, Function()); - prop->method = nullptr; - prop->data = nullptr; - } else if (prop->method == T::StaticVoidMethodCallbackWrapper) { - status = CreateFunction(env, - utf8name, - prop->method, - static_cast(prop->data), - &(prop->value)); - NAPI_THROW_IF_FAILED(env, status, Function()); - prop->method = nullptr; - prop->data = nullptr; - } - } - - napi_value value; - status = napi_define_class(env, - utf8name, - NAPI_AUTO_LENGTH, - T::ConstructorCallbackWrapper, - data, - props_count, - props.data(), - &value); - NAPI_THROW_IF_FAILED(env, status, Function()); - - // After defining the class we iterate once more over the property descriptors - // and attach the data associated with accessors and instance methods to the - // newly created JavaScript class. - for (size_t idx = 0; idx < props_count; idx++) { - const napi_property_descriptor* prop = &props[idx]; - - if (prop->getter == T::StaticGetterCallbackWrapper || - prop->setter == T::StaticSetterCallbackWrapper) { - status = Napi::details::AttachData(env, - value, - static_cast(prop->data)); - NAPI_THROW_IF_FAILED(env, status, Function()); - } else { - // InstanceWrap::AttachPropData is responsible for attaching the data - // of instance methods and accessors. - T::AttachPropData(env, value, prop); - } - } - - return Function(env, value); -} - -template -inline Function ObjectWrap::DefineClass( - Napi::Env env, - const char* utf8name, - const std::initializer_list>& properties, - void* data) { - return DefineClass(env, - utf8name, - properties.size(), - reinterpret_cast(properties.begin()), - data); -} - -template -inline Function ObjectWrap::DefineClass( - Napi::Env env, - const char* utf8name, - const std::vector>& properties, - void* data) { - return DefineClass(env, - utf8name, - properties.size(), - reinterpret_cast(properties.data()), - data); -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, - StaticVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticVoidMethodCallbackData* callbackData = new StaticVoidMethodCallbackData({ method, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::StaticVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, - StaticMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticMethodCallbackData* callbackData = new StaticMethodCallbackData({ method, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::StaticMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, - StaticVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticVoidMethodCallbackData* callbackData = new StaticVoidMethodCallbackData({ method, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::StaticVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, - StaticMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticMethodCallbackData* callbackData = new StaticMethodCallbackData({ method, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::StaticMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticVoidMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedVoidCallback; - desc.data = data; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticVoidMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedVoidCallback; - desc.data = data; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedCallback; - desc.data = data; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedCallback; - desc.data = data; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - const char* utf8name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes, - void* data) { - StaticAccessorCallbackData* callbackData = - new StaticAccessorCallbackData({ getter, setter, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - Symbol name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes, - void* data) { - StaticAccessorCallbackData* callbackData = - new StaticAccessorCallbackData({ getter, setter, data }); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticGetterCallback getter, - typename ObjectWrap::StaticSetterCallback setter> -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - const char* utf8name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = details::TemplatedCallback; - desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); - desc.data = data; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticGetterCallback getter, - typename ObjectWrap::StaticSetterCallback setter> -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - Symbol name, - napi_property_attributes attributes, - void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = details::TemplatedCallback; - desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); - desc.data = data; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticValue(const char* utf8name, - Napi::Value value, napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.value = value; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticValue(Symbol name, - Napi::Value value, napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.value = value; - desc.attributes = static_cast(attributes | napi_static); - return desc; -} - -template -inline void ObjectWrap::Finalize(Napi::Env /*env*/) {} - -template -inline napi_value ObjectWrap::ConstructorCallbackWrapper( - napi_env env, - napi_callback_info info) { - napi_value new_target; - napi_status status = napi_get_new_target(env, info, &new_target); - if (status != napi_ok) return nullptr; - - bool isConstructCall = (new_target != nullptr); - if (!isConstructCall) { - napi_throw_type_error(env, nullptr, "Class constructors cannot be invoked without 'new'"); - return nullptr; - } - - napi_value wrapper = details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - T* instance = new T(callbackInfo); -#ifdef NAPI_CPP_EXCEPTIONS - instance->_construction_failed = false; -#else - if (callbackInfo.Env().IsExceptionPending()) { - // We need to clear the exception so that removing the wrap might work. - Error e = callbackInfo.Env().GetAndClearPendingException(); - delete instance; - e.ThrowAsJavaScriptException(); - } else { - instance->_construction_failed = false; - } -# endif // NAPI_CPP_EXCEPTIONS - return callbackInfo.This(); - }); - - return wrapper; -} - -template -inline napi_value ObjectWrap::StaticVoidMethodCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticVoidMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->callback(callbackInfo); - return nullptr; - }); -} - -template -inline napi_value ObjectWrap::StaticMethodCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->callback(callbackInfo); - }); -} - -template -inline napi_value ObjectWrap::StaticGetterCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->getterCallback(callbackInfo); - }); -} - -template -inline napi_value ObjectWrap::StaticSetterCallbackWrapper( - napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->setterCallback(callbackInfo, callbackInfo[0]); - return nullptr; - }); -} - -template -inline void ObjectWrap::FinalizeCallback(napi_env env, void* data, void* /*hint*/) { - HandleScope scope(env); - T* instance = static_cast(data); - instance->Finalize(Napi::Env(env)); - delete instance; -} - -template -template ::StaticSetterCallback method> -inline napi_value ObjectWrap::WrappedMethod( - napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - const CallbackInfo cbInfo(env, info); - method(cbInfo, cbInfo[0]); - return nullptr; - }); -} - -//////////////////////////////////////////////////////////////////////////////// -// HandleScope class -//////////////////////////////////////////////////////////////////////////////// - -inline HandleScope::HandleScope(napi_env env, napi_handle_scope scope) - : _env(env), _scope(scope) { -} - -inline HandleScope::HandleScope(Napi::Env env) : _env(env) { - napi_status status = napi_open_handle_scope(_env, &_scope); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline HandleScope::~HandleScope() { - napi_status status = napi_close_handle_scope(_env, _scope); - NAPI_FATAL_IF_FAILED(status, - "HandleScope::~HandleScope", - "napi_close_handle_scope"); -} - -inline HandleScope::operator napi_handle_scope() const { - return _scope; -} - -inline Napi::Env HandleScope::Env() const { - return Napi::Env(_env); -} - -//////////////////////////////////////////////////////////////////////////////// -// EscapableHandleScope class -//////////////////////////////////////////////////////////////////////////////// - -inline EscapableHandleScope::EscapableHandleScope( - napi_env env, napi_escapable_handle_scope scope) : _env(env), _scope(scope) { -} - -inline EscapableHandleScope::EscapableHandleScope(Napi::Env env) : _env(env) { - napi_status status = napi_open_escapable_handle_scope(_env, &_scope); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline EscapableHandleScope::~EscapableHandleScope() { - napi_status status = napi_close_escapable_handle_scope(_env, _scope); - NAPI_FATAL_IF_FAILED(status, - "EscapableHandleScope::~EscapableHandleScope", - "napi_close_escapable_handle_scope"); -} - -inline EscapableHandleScope::operator napi_escapable_handle_scope() const { - return _scope; -} - -inline Napi::Env EscapableHandleScope::Env() const { - return Napi::Env(_env); -} - -inline Value EscapableHandleScope::Escape(napi_value escapee) { - napi_value result; - napi_status status = napi_escape_handle(_env, _scope, escapee, &result); - NAPI_THROW_IF_FAILED(_env, status, Value()); - return Value(_env, result); -} - - -#if (NAPI_VERSION > 2) -//////////////////////////////////////////////////////////////////////////////// -// CallbackScope class -//////////////////////////////////////////////////////////////////////////////// - -inline CallbackScope::CallbackScope( - napi_env env, napi_callback_scope scope) : _env(env), _scope(scope) { -} - -inline CallbackScope::CallbackScope(napi_env env, napi_async_context context) - : _env(env) { - napi_status status = napi_open_callback_scope( - _env, Object::New(env), context, &_scope); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline CallbackScope::~CallbackScope() { - napi_status status = napi_close_callback_scope(_env, _scope); - NAPI_FATAL_IF_FAILED(status, - "CallbackScope::~CallbackScope", - "napi_close_callback_scope"); -} - -inline CallbackScope::operator napi_callback_scope() const { - return _scope; -} - -inline Napi::Env CallbackScope::Env() const { - return Napi::Env(_env); -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -// AsyncContext class -//////////////////////////////////////////////////////////////////////////////// - -inline AsyncContext::AsyncContext(napi_env env, const char* resource_name) - : AsyncContext(env, resource_name, Object::New(env)) { -} - -inline AsyncContext::AsyncContext(napi_env env, - const char* resource_name, - const Object& resource) - : _env(env), _context(nullptr) { - napi_value resource_id; - napi_status status = napi_create_string_utf8( - _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - status = napi_async_init(_env, resource, resource_id, &_context); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline AsyncContext::~AsyncContext() { - if (_context != nullptr) { - napi_async_destroy(_env, _context); - _context = nullptr; - } -} - -inline AsyncContext::AsyncContext(AsyncContext&& other) { - _env = other._env; - other._env = nullptr; - _context = other._context; - other._context = nullptr; -} - -inline AsyncContext& AsyncContext::operator =(AsyncContext&& other) { - _env = other._env; - other._env = nullptr; - _context = other._context; - other._context = nullptr; - return *this; -} - -inline AsyncContext::operator napi_async_context() const { - return _context; -} - -inline Napi::Env AsyncContext::Env() const { - return Napi::Env(_env); -} - -//////////////////////////////////////////////////////////////////////////////// -// AsyncWorker class -//////////////////////////////////////////////////////////////////////////////// - -inline AsyncWorker::AsyncWorker(const Function& callback) - : AsyncWorker(callback, "generic") { -} - -inline AsyncWorker::AsyncWorker(const Function& callback, - const char* resource_name) - : AsyncWorker(callback, resource_name, Object::New(callback.Env())) { -} - -inline AsyncWorker::AsyncWorker(const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncWorker(Object::New(callback.Env()), - callback, - resource_name, - resource) { -} - -inline AsyncWorker::AsyncWorker(const Object& receiver, - const Function& callback) - : AsyncWorker(receiver, callback, "generic") { -} - -inline AsyncWorker::AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name) - : AsyncWorker(receiver, - callback, - resource_name, - Object::New(callback.Env())) { -} - -inline AsyncWorker::AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource) - : _env(callback.Env()), - _receiver(Napi::Persistent(receiver)), - _callback(Napi::Persistent(callback)), - _suppress_destruct(false) { - napi_value resource_id; - napi_status status = napi_create_string_latin1( - _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - status = napi_create_async_work(_env, resource, resource_id, OnAsyncWorkExecute, - OnAsyncWorkComplete, this, &_work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline AsyncWorker::AsyncWorker(Napi::Env env) - : AsyncWorker(env, "generic") { -} - -inline AsyncWorker::AsyncWorker(Napi::Env env, - const char* resource_name) - : AsyncWorker(env, resource_name, Object::New(env)) { -} - -inline AsyncWorker::AsyncWorker(Napi::Env env, - const char* resource_name, - const Object& resource) - : _env(env), - _receiver(), - _callback(), - _suppress_destruct(false) { - napi_value resource_id; - napi_status status = napi_create_string_latin1( - _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - status = napi_create_async_work(_env, resource, resource_id, OnAsyncWorkExecute, - OnAsyncWorkComplete, this, &_work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline AsyncWorker::~AsyncWorker() { - if (_work != nullptr) { - napi_delete_async_work(_env, _work); - _work = nullptr; - } -} - -inline void AsyncWorker::Destroy() { - delete this; -} - -inline AsyncWorker::AsyncWorker(AsyncWorker&& other) { - _env = other._env; - other._env = nullptr; - _work = other._work; - other._work = nullptr; - _receiver = std::move(other._receiver); - _callback = std::move(other._callback); - _error = std::move(other._error); - _suppress_destruct = other._suppress_destruct; -} - -inline AsyncWorker& AsyncWorker::operator =(AsyncWorker&& other) { - _env = other._env; - other._env = nullptr; - _work = other._work; - other._work = nullptr; - _receiver = std::move(other._receiver); - _callback = std::move(other._callback); - _error = std::move(other._error); - _suppress_destruct = other._suppress_destruct; - return *this; -} - -inline AsyncWorker::operator napi_async_work() const { - return _work; -} - -inline Napi::Env AsyncWorker::Env() const { - return Napi::Env(_env); -} - -inline void AsyncWorker::Queue() { - napi_status status = napi_queue_async_work(_env, _work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline void AsyncWorker::Cancel() { - napi_status status = napi_cancel_async_work(_env, _work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline ObjectReference& AsyncWorker::Receiver() { - return _receiver; -} - -inline FunctionReference& AsyncWorker::Callback() { - return _callback; -} - -inline void AsyncWorker::SuppressDestruct() { - _suppress_destruct = true; -} - -inline void AsyncWorker::OnOK() { - if (!_callback.IsEmpty()) { - _callback.Call(_receiver.Value(), GetResult(_callback.Env())); - } -} - -inline void AsyncWorker::OnError(const Error& e) { - if (!_callback.IsEmpty()) { - _callback.Call(_receiver.Value(), std::initializer_list{ e.Value() }); - } -} - -inline void AsyncWorker::SetError(const std::string& error) { - _error = error; -} - -inline std::vector AsyncWorker::GetResult(Napi::Env /*env*/) { - return {}; -} -// The OnAsyncWorkExecute method receives an napi_env argument. However, do NOT -// use it within this method, as it does not run on the JavaScript thread and -// must not run any method that would cause JavaScript to run. In practice, -// this means that almost any use of napi_env will be incorrect. -inline void AsyncWorker::OnAsyncWorkExecute(napi_env env, void* asyncworker) { - AsyncWorker* self = static_cast(asyncworker); - self->OnExecute(env); -} -// The OnExecute method receives an napi_env argument. However, do NOT -// use it within this method, as it does not run on the JavaScript thread and -// must not run any method that would cause JavaScript to run. In practice, -// this means that almost any use of napi_env will be incorrect. -inline void AsyncWorker::OnExecute(Napi::Env /*DO_NOT_USE*/) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - Execute(); - } catch (const std::exception& e) { - SetError(e.what()); - } -#else // NAPI_CPP_EXCEPTIONS - Execute(); -#endif // NAPI_CPP_EXCEPTIONS -} - -inline void AsyncWorker::OnAsyncWorkComplete(napi_env env, - napi_status status, - void* asyncworker) { - AsyncWorker* self = static_cast(asyncworker); - self->OnWorkComplete(env, status); -} -inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) { - if (status != napi_cancelled) { - HandleScope scope(_env); - details::WrapCallback([&] { - if (_error.size() == 0) { - OnOK(); - } - else { - OnError(Error::New(_env, _error)); - } - return nullptr; - }); - } - if (!_suppress_destruct) { - Destroy(); - } -} - -#if (NAPI_VERSION > 3 && !defined(__wasm32__)) -//////////////////////////////////////////////////////////////////////////////// -// TypedThreadSafeFunction class -//////////////////////////////////////////////////////////////////////////////// - -// Starting with NAPI 5, the JavaScript function `func` parameter of -// `napi_create_threadsafe_function` is optional. -#if NAPI_VERSION > 4 -// static, with Callback [missing] Resource [missing] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - nullptr, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [missing] Resource [passed] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - nullptr, - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [missing] Resource [missing] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - nullptr, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [missing] Resource [passed] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - nullptr, - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} -#endif - -// static, with Callback [passed] Resource [missing] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - callback, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [passed] Resource [passed] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - callback, - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [passed] Resource [missing] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - callback, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with: Callback [passed] Resource [passed] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - CallbackType callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - details::DefaultCallbackWrapper< - CallbackType, - TypedThreadSafeFunction>(env, - callback), - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -template -inline TypedThreadSafeFunction:: - TypedThreadSafeFunction() - : _tsfn() {} - -template -inline TypedThreadSafeFunction:: - TypedThreadSafeFunction(napi_threadsafe_function tsfn) - : _tsfn(tsfn) {} - -template -inline TypedThreadSafeFunction:: -operator napi_threadsafe_function() const { - return _tsfn; -} - -template -inline napi_status -TypedThreadSafeFunction::BlockingCall( - DataType* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); -} - -template -inline napi_status -TypedThreadSafeFunction::NonBlockingCall( - DataType* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); -} - -template -inline void TypedThreadSafeFunction::Ref( - napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_ref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -template -inline void TypedThreadSafeFunction::Unref( - napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_unref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -template -inline napi_status -TypedThreadSafeFunction::Acquire() const { - return napi_acquire_threadsafe_function(_tsfn); -} - -template -inline napi_status -TypedThreadSafeFunction::Release() { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); -} - -template -inline napi_status -TypedThreadSafeFunction::Abort() { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); -} - -template -inline ContextType* -TypedThreadSafeFunction::GetContext() const { - void* context; - napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); - NAPI_FATAL_IF_FAILED(status, - "TypedThreadSafeFunction::GetContext", - "napi_get_threadsafe_function_context"); - return static_cast(context); -} - -// static -template -void TypedThreadSafeFunction::CallJsInternal( - napi_env env, napi_value jsCallback, void* context, void* data) { - details::CallJsWrapper( - env, jsCallback, context, data); -} - -#if NAPI_VERSION == 4 -// static -template -Napi::Function -TypedThreadSafeFunction::EmptyFunctionFactory( - Napi::Env env) { - return Napi::Function::New(env, [](const CallbackInfo& cb) {}); -} - -// static -template -Napi::Function -TypedThreadSafeFunction::FunctionOrEmpty( - Napi::Env env, Napi::Function& callback) { - if (callback.IsEmpty()) { - return EmptyFunctionFactory(env); - } - return callback; -} - -#else -// static -template -std::nullptr_t -TypedThreadSafeFunction::EmptyFunctionFactory( - Napi::Env /*env*/) { - return nullptr; -} - -// static -template -Napi::Function -TypedThreadSafeFunction::FunctionOrEmpty( - Napi::Env /*env*/, Napi::Function& callback) { - return callback; -} - -#endif - -//////////////////////////////////////////////////////////////////////////////// -// ThreadSafeFunction class -//////////////////////////////////////////////////////////////////////////////// - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount) { - return New(env, callback, Object(), resourceName, maxQueueSize, - initialThreadCount); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - return New(env, callback, Object(), resourceName, maxQueueSize, - initialThreadCount, context); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback) { - return New(env, callback, Object(), resourceName, maxQueueSize, - initialThreadCount, finalizeCallback); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, callback, Object(), resourceName, maxQueueSize, - initialThreadCount, finalizeCallback, data); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback) { - return New(env, callback, Object(), resourceName, maxQueueSize, - initialThreadCount, context, finalizeCallback); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, callback, Object(), resourceName, maxQueueSize, - initialThreadCount, context, finalizeCallback, data); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount) { - return New(env, callback, resource, resourceName, maxQueueSize, - initialThreadCount, static_cast(nullptr) /* context */); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - return New(env, callback, resource, resourceName, maxQueueSize, - initialThreadCount, context, - [](Env, ContextType*) {} /* empty finalizer */); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback) { - return New(env, callback, resource, resourceName, maxQueueSize, - initialThreadCount, static_cast(nullptr) /* context */, - finalizeCallback, static_cast(nullptr) /* data */, - details::ThreadSafeFinalize::Wrapper); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, callback, resource, resourceName, maxQueueSize, - initialThreadCount, static_cast(nullptr) /* context */, - finalizeCallback, data, - details::ThreadSafeFinalize< - void, Finalizer, FinalizerDataType>::FinalizeWrapperWithData); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback) { - return New(env, callback, resource, resourceName, maxQueueSize, - initialThreadCount, context, finalizeCallback, - static_cast(nullptr) /* data */, - details::ThreadSafeFinalize< - ContextType, Finalizer>::FinalizeWrapperWithContext); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, callback, resource, resourceName, maxQueueSize, - initialThreadCount, context, finalizeCallback, data, - details::ThreadSafeFinalize::FinalizeFinalizeWrapperWithDataAndContext); -} - -inline ThreadSafeFunction::ThreadSafeFunction() - : _tsfn() { -} - -inline ThreadSafeFunction::ThreadSafeFunction( - napi_threadsafe_function tsfn) - : _tsfn(tsfn) { -} - -inline ThreadSafeFunction::operator napi_threadsafe_function() const { - return _tsfn; -} - -inline napi_status ThreadSafeFunction::BlockingCall() const { - return CallInternal(nullptr, napi_tsfn_blocking); -} - -template <> -inline napi_status ThreadSafeFunction::BlockingCall( - void* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); -} - -template -inline napi_status ThreadSafeFunction::BlockingCall( - Callback callback) const { - return CallInternal(new CallbackWrapper(callback), napi_tsfn_blocking); -} - -template -inline napi_status ThreadSafeFunction::BlockingCall( - DataType* data, Callback callback) const { - auto wrapper = [data, callback](Env env, Function jsCallback) { - callback(env, jsCallback, data); - }; - return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_blocking); -} - -inline napi_status ThreadSafeFunction::NonBlockingCall() const { - return CallInternal(nullptr, napi_tsfn_nonblocking); -} - -template <> -inline napi_status ThreadSafeFunction::NonBlockingCall( - void* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); -} - -template -inline napi_status ThreadSafeFunction::NonBlockingCall( - Callback callback) const { - return CallInternal(new CallbackWrapper(callback), napi_tsfn_nonblocking); -} - -template -inline napi_status ThreadSafeFunction::NonBlockingCall( - DataType* data, Callback callback) const { - auto wrapper = [data, callback](Env env, Function jsCallback) { - callback(env, jsCallback, data); - }; - return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_nonblocking); -} - -inline void ThreadSafeFunction::Ref(napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_ref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -inline void ThreadSafeFunction::Unref(napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_unref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -inline napi_status ThreadSafeFunction::Acquire() const { - return napi_acquire_threadsafe_function(_tsfn); -} - -inline napi_status ThreadSafeFunction::Release() { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); -} - -inline napi_status ThreadSafeFunction::Abort() { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); -} - -inline ThreadSafeFunction::ConvertibleContext -ThreadSafeFunction::GetContext() const { - void* context; - napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); - NAPI_FATAL_IF_FAILED(status, "ThreadSafeFunction::GetContext", "napi_get_threadsafe_function_context"); - return ConvertibleContext({ context }); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data, - napi_finalize wrapper) { - static_assert(details::can_make_string::value - || std::is_convertible::value, - "Resource name should be convertible to the string type"); - - ThreadSafeFunction tsfn; - auto* finalizeData = new details::ThreadSafeFinalize({ data, finalizeCallback }); - napi_status status = napi_create_threadsafe_function(env, callback, resource, - Value::From(env, resourceName), maxQueueSize, initialThreadCount, - finalizeData, wrapper, context, CallJS, &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction()); - } - - return tsfn; -} - -inline napi_status ThreadSafeFunction::CallInternal( - CallbackWrapper* callbackWrapper, - napi_threadsafe_function_call_mode mode) const { - napi_status status = napi_call_threadsafe_function( - _tsfn, callbackWrapper, mode); - if (status != napi_ok && callbackWrapper != nullptr) { - delete callbackWrapper; - } - - return status; -} - -// static -inline void ThreadSafeFunction::CallJS(napi_env env, - napi_value jsCallback, - void* /* context */, - void* data) { - if (env == nullptr && jsCallback == nullptr) { - return; - } - - if (data != nullptr) { - auto* callbackWrapper = static_cast(data); - (*callbackWrapper)(env, Function(env, jsCallback)); - delete callbackWrapper; - } else if (jsCallback != nullptr) { - Function(env, jsCallback).Call({}); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Async Progress Worker Base class -//////////////////////////////////////////////////////////////////////////////// -template -inline AsyncProgressWorkerBase::AsyncProgressWorkerBase(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource, - size_t queue_size) - : AsyncWorker(receiver, callback, resource_name, resource) { - // Fill all possible arguments to work around ambiguous ThreadSafeFunction::New signatures. - _tsfn = ThreadSafeFunction::New(callback.Env(), - callback, - resource, - resource_name, - queue_size, - /** initialThreadCount */ 1, - /** context */ this, - OnThreadSafeFunctionFinalize, - /** finalizeData */ this); -} - -#if NAPI_VERSION > 4 -template -inline AsyncProgressWorkerBase::AsyncProgressWorkerBase(Napi::Env env, - const char* resource_name, - const Object& resource, - size_t queue_size) - : AsyncWorker(env, resource_name, resource) { - // TODO: Once the changes to make the callback optional for threadsafe - // functions are available on all versions we can remove the dummy Function here. - Function callback; - // Fill all possible arguments to work around ambiguous ThreadSafeFunction::New signatures. - _tsfn = ThreadSafeFunction::New(env, - callback, - resource, - resource_name, - queue_size, - /** initialThreadCount */ 1, - /** context */ this, - OnThreadSafeFunctionFinalize, - /** finalizeData */ this); -} -#endif - -template -inline AsyncProgressWorkerBase::~AsyncProgressWorkerBase() { - // Abort pending tsfn call. - // Don't send progress events after we've already completed. - // It's ok to call ThreadSafeFunction::Abort and ThreadSafeFunction::Release duplicated. - _tsfn.Abort(); -} - -template -inline void AsyncProgressWorkerBase::OnAsyncWorkProgress(Napi::Env /* env */, - Napi::Function /* jsCallback */, - void* data) { - ThreadSafeData* tsd = static_cast(data); - tsd->asyncprogressworker()->OnWorkProgress(tsd->data()); - delete tsd; -} - -template -inline napi_status AsyncProgressWorkerBase::NonBlockingCall(DataType* data) { - auto tsd = new AsyncProgressWorkerBase::ThreadSafeData(this, data); - return _tsfn.NonBlockingCall(tsd, OnAsyncWorkProgress); -} - -template -inline void AsyncProgressWorkerBase::OnWorkComplete(Napi::Env /* env */, napi_status status) { - _work_completed = true; - _complete_status = status; - _tsfn.Release(); -} - -template -inline void AsyncProgressWorkerBase::OnThreadSafeFunctionFinalize(Napi::Env env, void* /* data */, AsyncProgressWorkerBase* context) { - if (context->_work_completed) { - context->AsyncWorker::OnWorkComplete(env, context->_complete_status); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Async Progress Worker class -//////////////////////////////////////////////////////////////////////////////// -template -inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback) - : AsyncProgressWorker(callback, "generic") { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, - const char* resource_name) - : AsyncProgressWorker(callback, resource_name, Object::New(callback.Env())) { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressWorker(Object::New(callback.Env()), - callback, - resource_name, - resource) { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, - const Function& callback) - : AsyncProgressWorker(receiver, callback, "generic") { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name) - : AsyncProgressWorker(receiver, - callback, - resource_name, - Object::New(callback.Env())) { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase(receiver, callback, resource_name, resource), - _asyncdata(nullptr), - _asyncsize(0) { -} - -#if NAPI_VERSION > 4 -template -inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env) - : AsyncProgressWorker(env, "generic") { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, - const char* resource_name) - : AsyncProgressWorker(env, resource_name, Object::New(env)) { -} - -template -inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase(env, resource_name, resource), - _asyncdata(nullptr), - _asyncsize(0) { -} -#endif - -template -inline AsyncProgressWorker::~AsyncProgressWorker() { - { - std::lock_guard lock(this->_mutex); - _asyncdata = nullptr; - _asyncsize = 0; - } -} - -template -inline void AsyncProgressWorker::Execute() { - ExecutionProgress progress(this); - Execute(progress); -} - -template -inline void AsyncProgressWorker::OnWorkProgress(void*) { - T* data; - size_t size; - { - std::lock_guard lock(this->_mutex); - data = this->_asyncdata; - size = this->_asyncsize; - this->_asyncdata = nullptr; - this->_asyncsize = 0; - } - - /** - * The callback of ThreadSafeFunction is not been invoked immediately on the - * callback of uv_async_t (uv io poll), rather the callback of TSFN is - * invoked on the right next uv idle callback. There are chances that during - * the deferring the signal of uv_async_t is been sent again, i.e. potential - * not coalesced two calls of the TSFN callback. - */ - if (data == nullptr) { - return; - } - - this->OnProgress(data, size); - delete[] data; -} - -template -inline void AsyncProgressWorker::SendProgress_(const T* data, size_t count) { - T* new_data = new T[count]; - std::copy(data, data + count, new_data); - - T* old_data; - { - std::lock_guard lock(this->_mutex); - old_data = _asyncdata; - _asyncdata = new_data; - _asyncsize = count; - } - this->NonBlockingCall(nullptr); - - delete[] old_data; -} - -template -inline void AsyncProgressWorker::Signal() const { - this->NonBlockingCall(static_cast(nullptr)); -} - -template -inline void AsyncProgressWorker::ExecutionProgress::Signal() const { - _worker->Signal(); -} - -template -inline void AsyncProgressWorker::ExecutionProgress::Send(const T* data, size_t count) const { - _worker->SendProgress_(data, count); -} - -//////////////////////////////////////////////////////////////////////////////// -// Async Progress Queue Worker class -//////////////////////////////////////////////////////////////////////////////// -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(const Function& callback) - : AsyncProgressQueueWorker(callback, "generic") { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(const Function& callback, - const char* resource_name) - : AsyncProgressQueueWorker(callback, resource_name, Object::New(callback.Env())) { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressQueueWorker(Object::New(callback.Env()), - callback, - resource_name, - resource) { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(const Object& receiver, - const Function& callback) - : AsyncProgressQueueWorker(receiver, callback, "generic") { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(const Object& receiver, - const Function& callback, - const char* resource_name) - : AsyncProgressQueueWorker(receiver, - callback, - resource_name, - Object::New(callback.Env())) { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase>(receiver, callback, resource_name, resource, /** unlimited queue size */0) { -} - -#if NAPI_VERSION > 4 -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(Napi::Env env) - : AsyncProgressQueueWorker(env, "generic") { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(Napi::Env env, - const char* resource_name) - : AsyncProgressQueueWorker(env, resource_name, Object::New(env)) { -} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(Napi::Env env, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase>(env, resource_name, resource, /** unlimited queue size */0) { -} -#endif - -template -inline void AsyncProgressQueueWorker::Execute() { - ExecutionProgress progress(this); - Execute(progress); -} - -template -inline void AsyncProgressQueueWorker::OnWorkProgress(std::pair* datapair) { - if (datapair == nullptr) { - return; - } - - T *data = datapair->first; - size_t size = datapair->second; - - this->OnProgress(data, size); - delete datapair; - delete[] data; -} - -template -inline void AsyncProgressQueueWorker::SendProgress_(const T* data, size_t count) { - T* new_data = new T[count]; - std::copy(data, data + count, new_data); - - auto pair = new std::pair(new_data, count); - this->NonBlockingCall(pair); -} - -template -inline void AsyncProgressQueueWorker::Signal() const { - this->NonBlockingCall(nullptr); -} - -template -inline void AsyncProgressQueueWorker::OnWorkComplete(Napi::Env env, napi_status status) { - // Draining queued items in TSFN. - AsyncProgressWorkerBase>::OnWorkComplete(env, status); -} - -template -inline void AsyncProgressQueueWorker::ExecutionProgress::Signal() const { - _worker->Signal(); -} - -template -inline void AsyncProgressQueueWorker::ExecutionProgress::Send(const T* data, size_t count) const { - _worker->SendProgress_(data, count); -} -#endif // NAPI_VERSION > 3 && !defined(__wasm32__) - -//////////////////////////////////////////////////////////////////////////////// -// Memory Management class -//////////////////////////////////////////////////////////////////////////////// - -inline int64_t MemoryManagement::AdjustExternalMemory(Env env, int64_t change_in_bytes) { - int64_t result; - napi_status status = napi_adjust_external_memory(env, change_in_bytes, &result); - NAPI_THROW_IF_FAILED(env, status, 0); - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -// Version Management class -//////////////////////////////////////////////////////////////////////////////// - -inline uint32_t VersionManagement::GetNapiVersion(Env env) { - uint32_t result; - napi_status status = napi_get_version(env, &result); - NAPI_THROW_IF_FAILED(env, status, 0); - return result; -} - -inline const napi_node_version* VersionManagement::GetNodeVersion(Env env) { - const napi_node_version* result; - napi_status status = napi_get_node_version(env, &result); - NAPI_THROW_IF_FAILED(env, status, 0); - return result; -} - -#if NAPI_VERSION > 5 -//////////////////////////////////////////////////////////////////////////////// -// Addon class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Object Addon::Init(Env env, Object exports) { - T* addon = new T(env, exports); - env.SetInstanceData(addon); - return addon->entry_point_; -} - -template -inline T* Addon::Unwrap(Object wrapper) { - return wrapper.Env().GetInstanceData(); -} - -template -inline void -Addon::DefineAddon(Object exports, - const std::initializer_list& props) { - DefineProperties(exports, props); - entry_point_ = exports; -} - -template -inline Napi::Object -Addon::DefineProperties(Object object, - const std::initializer_list& props) { - const napi_property_descriptor* properties = - reinterpret_cast(props.begin()); - size_t size = props.size(); - napi_status status = napi_define_properties(object.Env(), - object, - size, - properties); - NAPI_THROW_IF_FAILED(object.Env(), status, object); - for (size_t idx = 0; idx < size; idx++) - T::AttachPropData(object.Env(), object, &properties[idx]); - return object; -} -#endif // NAPI_VERSION > 5 - -#if NAPI_VERSION > 2 -template -Env::CleanupHook Env::AddCleanupHook(Hook hook, Arg* arg) { - return CleanupHook(*this, hook, arg); -} - -template -Env::CleanupHook Env::AddCleanupHook(Hook hook) { - return CleanupHook(*this, hook); -} - -template -Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook) - : wrapper(Env::CleanupHook::Wrapper) { - data = new CleanupData{std::move(hook), nullptr}; - napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); - if (status != napi_ok) { - delete data; - data = nullptr; - } -} - -template -Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook, Arg* arg) - : wrapper(Env::CleanupHook::WrapperWithArg) { - data = new CleanupData{std::move(hook), arg}; - napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); - if (status != napi_ok) { - delete data; - data = nullptr; - } -} - -template -bool Env::CleanupHook::Remove(Env env) { - napi_status status = napi_remove_env_cleanup_hook(env, wrapper, data); - delete data; - data = nullptr; - return status == napi_ok; -} - -template -bool Env::CleanupHook::IsEmpty() const { - return data == nullptr; -} -#endif // NAPI_VERSION > 2 - -} // namespace Napi - -#endif // SRC_NAPI_INL_H_ diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/napi.h b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/napi.h deleted file mode 100644 index 286430643..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/napi.h +++ /dev/null @@ -1,2983 +0,0 @@ -#ifndef SRC_NAPI_H_ -#define SRC_NAPI_H_ - -#include -#include -#include -#include -#include -#include -#include - -// VS2015 RTM has bugs with constexpr, so require min of VS2015 Update 3 (known good version) -#if !defined(_MSC_VER) || _MSC_FULL_VER >= 190024210 -#define NAPI_HAS_CONSTEXPR 1 -#endif - -// VS2013 does not support char16_t literal strings, so we'll work around it using wchar_t strings -// and casting them. This is safe as long as the character sizes are the same. -#if defined(_MSC_VER) && _MSC_VER <= 1800 -static_assert(sizeof(char16_t) == sizeof(wchar_t), "Size mismatch between char16_t and wchar_t"); -#define NAPI_WIDE_TEXT(x) reinterpret_cast(L ## x) -#else -#define NAPI_WIDE_TEXT(x) u ## x -#endif - -// If C++ exceptions are not explicitly enabled or disabled, enable them -// if exceptions were enabled in the compiler settings. -#if !defined(NAPI_CPP_EXCEPTIONS) && !defined(NAPI_DISABLE_CPP_EXCEPTIONS) - #if defined(_CPPUNWIND) || defined (__EXCEPTIONS) - #define NAPI_CPP_EXCEPTIONS - #else - #error Exception support not detected. \ - Define either NAPI_CPP_EXCEPTIONS or NAPI_DISABLE_CPP_EXCEPTIONS. - #endif -#endif - -// If C++ NAPI_CPP_EXCEPTIONS are enabled, NODE_ADDON_API_ENABLE_MAYBE should -// not be set -#if defined(NAPI_CPP_EXCEPTIONS) && defined(NODE_ADDON_API_ENABLE_MAYBE) -#error NODE_ADDON_API_ENABLE_MAYBE should not be set when \ - NAPI_CPP_EXCEPTIONS is defined. -#endif - -#ifdef _NOEXCEPT - #define NAPI_NOEXCEPT _NOEXCEPT -#else - #define NAPI_NOEXCEPT noexcept -#endif - -#ifdef NAPI_CPP_EXCEPTIONS - -// When C++ exceptions are enabled, Errors are thrown directly. There is no need -// to return anything after the throw statements. The variadic parameter is an -// optional return value that is ignored. -// We need _VOID versions of the macros to avoid warnings resulting from -// leaving the NAPI_THROW_* `...` argument empty. - -#define NAPI_THROW(e, ...) throw e -#define NAPI_THROW_VOID(e) throw e - -#define NAPI_THROW_IF_FAILED(env, status, ...) \ - if ((status) != napi_ok) throw Napi::Error::New(env); - -#define NAPI_THROW_IF_FAILED_VOID(env, status) \ - if ((status) != napi_ok) throw Napi::Error::New(env); - -#else // NAPI_CPP_EXCEPTIONS - -// When C++ exceptions are disabled, Errors are thrown as JavaScript exceptions, -// which are pending until the callback returns to JS. The variadic parameter -// is an optional return value; usually it is an empty result. -// We need _VOID versions of the macros to avoid warnings resulting from -// leaving the NAPI_THROW_* `...` argument empty. - -#define NAPI_THROW(e, ...) \ - do { \ - (e).ThrowAsJavaScriptException(); \ - return __VA_ARGS__; \ - } while (0) - -#define NAPI_THROW_VOID(e) \ - do { \ - (e).ThrowAsJavaScriptException(); \ - return; \ - } while (0) - -#define NAPI_THROW_IF_FAILED(env, status, ...) \ - if ((status) != napi_ok) { \ - Napi::Error::New(env).ThrowAsJavaScriptException(); \ - return __VA_ARGS__; \ - } - -#define NAPI_THROW_IF_FAILED_VOID(env, status) \ - if ((status) != napi_ok) { \ - Napi::Error::New(env).ThrowAsJavaScriptException(); \ - return; \ - } - -#endif // NAPI_CPP_EXCEPTIONS - -#ifdef NODE_ADDON_API_ENABLE_MAYBE -#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ - NAPI_THROW_IF_FAILED(env, status, Napi::Nothing()) - -#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ - NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ - return Napi::Just(result); -#else -#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ - NAPI_THROW_IF_FAILED(env, status, type()) - -#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ - NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ - return result; -#endif - -# define NAPI_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; -# define NAPI_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; - -#define NAPI_DISALLOW_ASSIGN_COPY(CLASS) \ - NAPI_DISALLOW_ASSIGN(CLASS) \ - NAPI_DISALLOW_COPY(CLASS) - -#define NAPI_CHECK(condition, location, message) \ - do { \ - if (!(condition)) { \ - Napi::Error::Fatal((location), (message)); \ - } \ - } while (0) - -#define NAPI_FATAL_IF_FAILED(status, location, message) \ - NAPI_CHECK((status) == napi_ok, location, message) - -//////////////////////////////////////////////////////////////////////////////// -/// Node-API C++ Wrapper Classes -/// -/// These classes wrap the "Node-API" ABI-stable C APIs for Node.js, providing a -/// C++ object model and C++ exception-handling semantics with low overhead. -/// The wrappers are all header-only so that they do not affect the ABI. -//////////////////////////////////////////////////////////////////////////////// -namespace Napi { - - // Forward declarations - class Env; - class Value; - class Boolean; - class Number; -#if NAPI_VERSION > 5 - class BigInt; -#endif // NAPI_VERSION > 5 -#if (NAPI_VERSION > 4) - class Date; -#endif - class String; - class Object; - class Array; - class ArrayBuffer; - class Function; - class Error; - class PropertyDescriptor; - class CallbackInfo; - class TypedArray; - template class TypedArrayOf; - - using Int8Array = - TypedArrayOf; ///< Typed-array of signed 8-bit integers - using Uint8Array = - TypedArrayOf; ///< Typed-array of unsigned 8-bit integers - using Int16Array = - TypedArrayOf; ///< Typed-array of signed 16-bit integers - using Uint16Array = - TypedArrayOf; ///< Typed-array of unsigned 16-bit integers - using Int32Array = - TypedArrayOf; ///< Typed-array of signed 32-bit integers - using Uint32Array = - TypedArrayOf; ///< Typed-array of unsigned 32-bit integers - using Float32Array = - TypedArrayOf; ///< Typed-array of 32-bit floating-point values - using Float64Array = - TypedArrayOf; ///< Typed-array of 64-bit floating-point values -#if NAPI_VERSION > 5 - using BigInt64Array = - TypedArrayOf; ///< Typed array of signed 64-bit integers - using BigUint64Array = - TypedArrayOf; ///< Typed array of unsigned 64-bit integers -#endif // NAPI_VERSION > 5 - - /// Defines the signature of a Node-API C++ module's registration callback - /// (init) function. - using ModuleRegisterCallback = Object (*)(Env env, Object exports); - - class MemoryManagement; - - /// A simple Maybe type, representing an object which may or may not have a - /// value. - /// - /// If an API method returns a Maybe<>, the API method can potentially fail - /// either because an exception is thrown, or because an exception is pending, - /// e.g. because a previous API call threw an exception that hasn't been - /// caught yet. In that case, a "Nothing" value is returned. - template - class Maybe { - public: - bool IsNothing() const; - bool IsJust() const; - - /// Short-hand for Unwrap(), which doesn't return a value. Could be used - /// where the actual value of the Maybe is not needed like Object::Set. - /// If this Maybe is nothing (empty), node-addon-api will crash the - /// process. - void Check() const; - - /// Return the value of type T contained in the Maybe. If this Maybe is - /// nothing (empty), node-addon-api will crash the process. - T Unwrap() const; - - /// Return the value of type T contained in the Maybe, or using a default - /// value if this Maybe is nothing (empty). - T UnwrapOr(const T& default_value) const; - - /// Converts this Maybe to a value of type T in the out. If this Maybe is - /// nothing (empty), `false` is returned and `out` is left untouched. - bool UnwrapTo(T* out) const; - - bool operator==(const Maybe& other) const; - bool operator!=(const Maybe& other) const; - - private: - Maybe(); - explicit Maybe(const T& t); - - bool _has_value; - T _value; - - template - friend Maybe Nothing(); - template - friend Maybe Just(const U& u); - }; - - template - inline Maybe Nothing(); - - template - inline Maybe Just(const T& t); - -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - template - using MaybeOrValue = Maybe; -#else - template - using MaybeOrValue = T; -#endif - - /// Environment for Node-API values and operations. - /// - /// All Node-API values and operations must be associated with an environment. - /// An environment instance is always provided to callback functions; that - /// environment must then be used for any creation of Node-API values or other - /// Node-API operations within the callback. (Many methods infer the - /// environment from the `this` instance that the method is called on.) - /// - /// In the future, multiple environments per process may be supported, - /// although current implementations only support one environment per process. - /// - /// In the V8 JavaScript engine, a Node-API environment approximately - /// corresponds to an Isolate. - class Env { - private: -#if NAPI_VERSION > 2 - template - class CleanupHook; -#endif // NAPI_VERSION > 2 -#if NAPI_VERSION > 5 - template static void DefaultFini(Env, T* data); - template - static void DefaultFiniWithHint(Env, DataType* data, HintType* hint); -#endif // NAPI_VERSION > 5 - public: - Env(napi_env env); - - operator napi_env() const; - - Object Global() const; - Value Undefined() const; - Value Null() const; - - bool IsExceptionPending() const; - Error GetAndClearPendingException(); - - MaybeOrValue RunScript(const char* utf8script); - MaybeOrValue RunScript(const std::string& utf8script); - MaybeOrValue RunScript(String script); - -#if NAPI_VERSION > 2 - template - CleanupHook AddCleanupHook(Hook hook); - - template - CleanupHook AddCleanupHook(Hook hook, Arg* arg); -#endif // NAPI_VERSION > 2 - -#if NAPI_VERSION > 5 - template T* GetInstanceData(); - - template using Finalizer = void (*)(Env, T*); - template fini = Env::DefaultFini> - void SetInstanceData(T* data); - - template - using FinalizerWithHint = void (*)(Env, DataType*, HintType*); - template fini = - Env::DefaultFiniWithHint> - void SetInstanceData(DataType* data, HintType* hint); -#endif // NAPI_VERSION > 5 - - private: - napi_env _env; - -#if NAPI_VERSION > 2 - template - class CleanupHook { - public: - CleanupHook(Env env, Hook hook, Arg* arg); - CleanupHook(Env env, Hook hook); - bool Remove(Env env); - bool IsEmpty() const; - - private: - static inline void Wrapper(void* data) NAPI_NOEXCEPT; - static inline void WrapperWithArg(void* data) NAPI_NOEXCEPT; - - void (*wrapper)(void* arg); - struct CleanupData { - Hook hook; - Arg* arg; - } * data; - }; - }; -#endif // NAPI_VERSION > 2 - - /// A JavaScript value of unknown type. - /// - /// For type-specific operations, convert to one of the Value subclasses using a `To*` or `As()` - /// method. The `To*` methods do type coercion; the `As()` method does not. - /// - /// Napi::Value value = ... - /// if (!value.IsString()) throw Napi::TypeError::New(env, "Invalid arg..."); - /// Napi::String str = value.As(); // Cast to a string value - /// - /// Napi::Value anotherValue = ... - /// bool isTruthy = anotherValue.ToBoolean(); // Coerce to a boolean value - class Value { - public: - Value(); ///< Creates a new _empty_ Value instance. - Value(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - /// Creates a JS value from a C++ primitive. - /// - /// `value` may be any of: - /// - bool - /// - Any integer type - /// - Any floating point type - /// - const char* (encoded using UTF-8, null-terminated) - /// - const char16_t* (encoded using UTF-16-LE, null-terminated) - /// - std::string (encoded using UTF-8) - /// - std::u16string - /// - napi::Value - /// - napi_value - template - static Value From(napi_env env, const T& value); - - /// Converts to a Node-API value primitive. - /// - /// If the instance is _empty_, this returns `nullptr`. - operator napi_value() const; - - /// Tests if this value strictly equals another value. - bool operator ==(const Value& other) const; - - /// Tests if this value does not strictly equal another value. - bool operator !=(const Value& other) const; - - /// Tests if this value strictly equals another value. - bool StrictEquals(const Value& other) const; - - /// Gets the environment the value is associated with. - Napi::Env Env() const; - - /// Checks if the value is empty (uninitialized). - /// - /// An empty value is invalid, and most attempts to perform an operation on an empty value - /// will result in an exception. Note an empty value is distinct from JavaScript `null` or - /// `undefined`, which are valid values. - /// - /// When C++ exceptions are disabled at compile time, a method with a `Value` return type may - /// return an empty value to indicate a pending exception. So when not using C++ exceptions, - /// callers should check whether the value is empty before attempting to use it. - bool IsEmpty() const; - - napi_valuetype Type() const; ///< Gets the type of the value. - - bool IsUndefined() const; ///< Tests if a value is an undefined JavaScript value. - bool IsNull() const; ///< Tests if a value is a null JavaScript value. - bool IsBoolean() const; ///< Tests if a value is a JavaScript boolean. - bool IsNumber() const; ///< Tests if a value is a JavaScript number. -#if NAPI_VERSION > 5 - bool IsBigInt() const; ///< Tests if a value is a JavaScript bigint. -#endif // NAPI_VERSION > 5 -#if (NAPI_VERSION > 4) - bool IsDate() const; ///< Tests if a value is a JavaScript date. -#endif - bool IsString() const; ///< Tests if a value is a JavaScript string. - bool IsSymbol() const; ///< Tests if a value is a JavaScript symbol. - bool IsArray() const; ///< Tests if a value is a JavaScript array. - bool IsArrayBuffer() const; ///< Tests if a value is a JavaScript array buffer. - bool IsTypedArray() const; ///< Tests if a value is a JavaScript typed array. - bool IsObject() const; ///< Tests if a value is a JavaScript object. - bool IsFunction() const; ///< Tests if a value is a JavaScript function. - bool IsPromise() const; ///< Tests if a value is a JavaScript promise. - bool IsDataView() const; ///< Tests if a value is a JavaScript data view. - bool IsBuffer() const; ///< Tests if a value is a Node buffer. - bool IsExternal() const; ///< Tests if a value is a pointer to external data. - - /// Casts to another type of `Napi::Value`, when the actual type is known or assumed. - /// - /// This conversion does NOT coerce the type. Calling any methods inappropriate for the actual - /// value type will throw `Napi::Error`. - template T As() const; - - MaybeOrValue ToBoolean() - const; ///< Coerces a value to a JavaScript boolean. - MaybeOrValue ToNumber() - const; ///< Coerces a value to a JavaScript number. - MaybeOrValue ToString() - const; ///< Coerces a value to a JavaScript string. - MaybeOrValue ToObject() - const; ///< Coerces a value to a JavaScript object. - - protected: - /// !cond INTERNAL - napi_env _env; - napi_value _value; - /// !endcond - }; - - /// A JavaScript boolean value. - class Boolean : public Value { - public: - static Boolean New(napi_env env, ///< Node-API environment - bool value ///< Boolean value - ); - - Boolean(); ///< Creates a new _empty_ Boolean instance. - Boolean(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - operator bool() const; ///< Converts a Boolean value to a boolean primitive. - bool Value() const; ///< Converts a Boolean value to a boolean primitive. - }; - - /// A JavaScript number value. - class Number : public Value { - public: - static Number New(napi_env env, ///< Node-API environment - double value ///< Number value - ); - - Number(); ///< Creates a new _empty_ Number instance. - Number(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - operator int32_t() - const; ///< Converts a Number value to a 32-bit signed integer value. - operator uint32_t() - const; ///< Converts a Number value to a 32-bit unsigned integer value. - operator int64_t() - const; ///< Converts a Number value to a 64-bit signed integer value. - operator float() - const; ///< Converts a Number value to a 32-bit floating-point value. - operator double() - const; ///< Converts a Number value to a 64-bit floating-point value. - - int32_t Int32Value() - const; ///< Converts a Number value to a 32-bit signed integer value. - uint32_t Uint32Value() - const; ///< Converts a Number value to a 32-bit unsigned integer value. - int64_t Int64Value() - const; ///< Converts a Number value to a 64-bit signed integer value. - float FloatValue() - const; ///< Converts a Number value to a 32-bit floating-point value. - double DoubleValue() - const; ///< Converts a Number value to a 64-bit floating-point value. - }; - -#if NAPI_VERSION > 5 - /// A JavaScript bigint value. - class BigInt : public Value { - public: - static BigInt New(napi_env env, ///< Node-API environment - int64_t value ///< Number value - ); - static BigInt New(napi_env env, ///< Node-API environment - uint64_t value ///< Number value - ); - - /// Creates a new BigInt object using a specified sign bit and a - /// specified list of digits/words. - /// The resulting number is calculated as: - /// (-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...) - static BigInt New(napi_env env, ///< Node-API environment - int sign_bit, ///< Sign bit. 1 if negative. - size_t word_count, ///< Number of words in array - const uint64_t* words ///< Array of words - ); - - BigInt(); ///< Creates a new _empty_ BigInt instance. - BigInt(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - int64_t Int64Value(bool* lossless) - const; ///< Converts a BigInt value to a 64-bit signed integer value. - uint64_t Uint64Value(bool* lossless) - const; ///< Converts a BigInt value to a 64-bit unsigned integer value. - - size_t WordCount() const; ///< The number of 64-bit words needed to store - ///< the result of ToWords(). - - /// Writes the contents of this BigInt to a specified memory location. - /// `sign_bit` must be provided and will be set to 1 if this BigInt is - /// negative. - /// `*word_count` has to be initialized to the length of the `words` array. - /// Upon return, it will be set to the actual number of words that would - /// be needed to store this BigInt (i.e. the return value of `WordCount()`). - void ToWords(int* sign_bit, size_t* word_count, uint64_t* words); - }; -#endif // NAPI_VERSION > 5 - -#if (NAPI_VERSION > 4) - /// A JavaScript date value. - class Date : public Value { - public: - /// Creates a new Date value from a double primitive. - static Date New(napi_env env, ///< Node-API environment - double value ///< Number value - ); - - Date(); ///< Creates a new _empty_ Date instance. - Date(napi_env env, napi_value value); ///< Wraps a Node-API value primitive. - operator double() const; ///< Converts a Date value to double primitive - - double ValueOf() const; ///< Converts a Date value to a double primitive. - }; - #endif - - /// A JavaScript string or symbol value (that can be used as a property name). - class Name : public Value { - public: - Name(); ///< Creates a new _empty_ Name instance. - Name(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - }; - - /// A JavaScript string value. - class String : public Name { - public: - /// Creates a new String value from a UTF-8 encoded C++ string. - static String New(napi_env env, ///< Node-API environment - const std::string& value ///< UTF-8 encoded C++ string - ); - - /// Creates a new String value from a UTF-16 encoded C++ string. - static String New(napi_env env, ///< Node-API environment - const std::u16string& value ///< UTF-16 encoded C++ string - ); - - /// Creates a new String value from a UTF-8 encoded C string. - static String New( - napi_env env, ///< Node-API environment - const char* value ///< UTF-8 encoded null-terminated C string - ); - - /// Creates a new String value from a UTF-16 encoded C string. - static String New( - napi_env env, ///< Node-API environment - const char16_t* value ///< UTF-16 encoded null-terminated C string - ); - - /// Creates a new String value from a UTF-8 encoded C string with specified - /// length. - static String New(napi_env env, ///< Node-API environment - const char* value, ///< UTF-8 encoded C string (not - ///< necessarily null-terminated) - size_t length ///< length of the string in bytes - ); - - /// Creates a new String value from a UTF-16 encoded C string with specified - /// length. - static String New( - napi_env env, ///< Node-API environment - const char16_t* value, ///< UTF-16 encoded C string (not necessarily - ///< null-terminated) - size_t length ///< Length of the string in 2-byte code units - ); - - /// Creates a new String based on the original object's type. - /// - /// `value` may be any of: - /// - const char* (encoded using UTF-8, null-terminated) - /// - const char16_t* (encoded using UTF-16-LE, null-terminated) - /// - std::string (encoded using UTF-8) - /// - std::u16string - template - static String From(napi_env env, const T& value); - - String(); ///< Creates a new _empty_ String instance. - String(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - operator std::string() - const; ///< Converts a String value to a UTF-8 encoded C++ string. - operator std::u16string() - const; ///< Converts a String value to a UTF-16 encoded C++ string. - std::string Utf8Value() - const; ///< Converts a String value to a UTF-8 encoded C++ string. - std::u16string Utf16Value() - const; ///< Converts a String value to a UTF-16 encoded C++ string. - }; - - /// A JavaScript symbol value. - class Symbol : public Name { - public: - /// Creates a new Symbol value with an optional description. - static Symbol New( - napi_env env, ///< Node-API environment - const char* description = - nullptr ///< Optional UTF-8 encoded null-terminated C string - /// describing the symbol - ); - - /// Creates a new Symbol value with a description. - static Symbol New( - napi_env env, ///< Node-API environment - const std::string& - description ///< UTF-8 encoded C++ string describing the symbol - ); - - /// Creates a new Symbol value with a description. - static Symbol New(napi_env env, ///< Node-API environment - String description ///< String value describing the symbol - ); - - /// Creates a new Symbol value with a description. - static Symbol New( - napi_env env, ///< Node-API environment - napi_value description ///< String value describing the symbol - ); - - /// Get a public Symbol (e.g. Symbol.iterator). - static MaybeOrValue WellKnown(napi_env, const std::string& name); - - // Create a symbol in the global registry, UTF-8 Encoded cpp string - static MaybeOrValue For(napi_env env, - const std::string& description); - - // Create a symbol in the global registry, C style string (null terminated) - static MaybeOrValue For(napi_env env, const char* description); - - // Create a symbol in the global registry, String value describing the symbol - static MaybeOrValue For(napi_env env, String description); - - // Create a symbol in the global registry, napi_value describing the symbol - static MaybeOrValue For(napi_env env, napi_value description); - - Symbol(); ///< Creates a new _empty_ Symbol instance. - Symbol(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - }; - - /// A JavaScript object value. - class Object : public Value { - public: - /// Enables property and element assignments using indexing syntax. - /// - /// This is a convenient helper to get and set object properties. As - /// getting and setting object properties may throw with JavaScript - /// exceptions, it is notable that these operations may fail. - /// When NODE_ADDON_API_ENABLE_MAYBE is defined, the process will abort - /// on JavaScript exceptions. - /// - /// Example: - /// - /// Napi::Value propertyValue = object1['A']; - /// object2['A'] = propertyValue; - /// Napi::Value elementValue = array[0]; - /// array[1] = elementValue; - template - class PropertyLValue { - public: - /// Converts an L-value to a value. - operator Value() const; - - /// Assigns a value to the property. The type of value can be - /// anything supported by `Object::Set`. - template - PropertyLValue& operator =(ValueType value); - - private: - PropertyLValue() = delete; - PropertyLValue(Object object, Key key); - napi_env _env; - napi_value _object; - Key _key; - - friend class Napi::Object; - }; - - /// Creates a new Object value. - static Object New(napi_env env ///< Node-API environment - ); - - Object(); ///< Creates a new _empty_ Object instance. - Object(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - /// Gets or sets a named property. - PropertyLValue operator []( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ); - - /// Gets or sets a named property. - PropertyLValue operator []( - const std::string& utf8name ///< UTF-8 encoded property name - ); - - /// Gets or sets an indexed property or array element. - PropertyLValue operator []( - uint32_t index /// Property / element index - ); - - /// Gets or sets an indexed property or array element. - PropertyLValue operator[](Value index /// Property / element index - ); - - /// Gets or sets an indexed property or array element. - PropertyLValue operator[](Value index /// Property / element index - ) const; - - /// Gets a named property. - MaybeOrValue operator[]( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Gets a named property. - MaybeOrValue operator[]( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Gets an indexed property or array element. - MaybeOrValue operator[](uint32_t index ///< Property / element index - ) const; - - /// Checks whether a property is present. - MaybeOrValue Has(napi_value key ///< Property key primitive - ) const; - - /// Checks whether a property is present. - MaybeOrValue Has(Value key ///< Property key - ) const; - - /// Checks whether a named property is present. - MaybeOrValue Has( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Checks whether a named property is present. - MaybeOrValue Has( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty( - napi_value key ///< Property key primitive - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty(Value key ///< Property key - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Gets a property. - MaybeOrValue Get(napi_value key ///< Property key primitive - ) const; - - /// Gets a property. - MaybeOrValue Get(Value key ///< Property key - ) const; - - /// Gets a named property. - MaybeOrValue Get( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Gets a named property. - MaybeOrValue Get( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Sets a property. - template - MaybeOrValue Set(napi_value key, ///< Property key primitive - const ValueType& value ///< Property value primitive - ); - - /// Sets a property. - template - MaybeOrValue Set(Value key, ///< Property key - const ValueType& value ///< Property value - ); - - /// Sets a named property. - template - MaybeOrValue Set( - const char* utf8name, ///< UTF-8 encoded null-terminated property name - const ValueType& value); - - /// Sets a named property. - template - MaybeOrValue Set( - const std::string& utf8name, ///< UTF-8 encoded property name - const ValueType& value ///< Property value primitive - ); - - /// Delete property. - MaybeOrValue Delete(napi_value key ///< Property key primitive - ); - - /// Delete property. - MaybeOrValue Delete(Value key ///< Property key - ); - - /// Delete property. - MaybeOrValue Delete( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ); - - /// Delete property. - MaybeOrValue Delete( - const std::string& utf8name ///< UTF-8 encoded property name - ); - - /// Checks whether an indexed property is present. - MaybeOrValue Has(uint32_t index ///< Property / element index - ) const; - - /// Gets an indexed property or array element. - MaybeOrValue Get(uint32_t index ///< Property / element index - ) const; - - /// Sets an indexed property or array element. - template - MaybeOrValue Set(uint32_t index, ///< Property / element index - const ValueType& value ///< Property value primitive - ); - - /// Deletes an indexed property or array element. - MaybeOrValue Delete(uint32_t index ///< Property / element index - ); - - /// This operation can fail in case of Proxy.[[OwnPropertyKeys]] and - /// Proxy.[[GetOwnProperty]] calling into JavaScript. See: - /// - - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys - /// - - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p - MaybeOrValue GetPropertyNames() const; ///< Get all property names - - /// Defines a property on the object. - /// - /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling - /// into JavaScript. See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc - MaybeOrValue DefineProperty( - const PropertyDescriptor& - property ///< Descriptor for the property to be defined - ); - - /// Defines properties on the object. - /// - /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling - /// into JavaScript. See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc - MaybeOrValue DefineProperties( - const std::initializer_list& properties - ///< List of descriptors for the properties to be defined - ); - - /// Defines properties on the object. - /// - /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling - /// into JavaScript. See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc - MaybeOrValue DefineProperties( - const std::vector& properties - ///< Vector of descriptors for the properties to be defined - ); - - /// Checks if an object is an instance created by a constructor function. - /// - /// This is equivalent to the JavaScript `instanceof` operator. - /// - /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into - /// JavaScript. - /// See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof - MaybeOrValue InstanceOf( - const Function& constructor ///< Constructor function - ) const; - - template - inline void AddFinalizer(Finalizer finalizeCallback, T* data); - - template - inline void AddFinalizer(Finalizer finalizeCallback, - T* data, - Hint* finalizeHint); - -#ifdef NAPI_CPP_EXCEPTIONS - class const_iterator; - - inline const_iterator begin() const; - - inline const_iterator end() const; - - class iterator; - - inline iterator begin(); - - inline iterator end(); -#endif // NAPI_CPP_EXCEPTIONS - -#if NAPI_VERSION >= 8 - /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into - /// JavaScript. - /// See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof - MaybeOrValue Freeze(); - /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into - /// JavaScript. - /// See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof - MaybeOrValue Seal(); -#endif // NAPI_VERSION >= 8 - }; - - template - class External : public Value { - public: - static External New(napi_env env, T* data); - - // Finalizer must implement `void operator()(Env env, T* data)`. - template - static External New(napi_env env, - T* data, - Finalizer finalizeCallback); - // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. - template - static External New(napi_env env, - T* data, - Finalizer finalizeCallback, - Hint* finalizeHint); - - External(); - External(napi_env env, napi_value value); - - T* Data() const; - }; - - class Array : public Object { - public: - static Array New(napi_env env); - static Array New(napi_env env, size_t length); - - Array(); - Array(napi_env env, napi_value value); - - uint32_t Length() const; - }; - -#ifdef NAPI_CPP_EXCEPTIONS - class Object::const_iterator { - private: - enum class Type { BEGIN, END }; - - inline const_iterator(const Object* object, const Type type); - - public: - inline const_iterator& operator++(); - - inline bool operator==(const const_iterator& other) const; - - inline bool operator!=(const const_iterator& other) const; - - inline const std::pair> operator*() - const; - - private: - const Napi::Object* _object; - Array _keys; - uint32_t _index; - - friend class Object; - }; - - class Object::iterator { - private: - enum class Type { BEGIN, END }; - - inline iterator(Object* object, const Type type); - - public: - inline iterator& operator++(); - - inline bool operator==(const iterator& other) const; - - inline bool operator!=(const iterator& other) const; - - inline std::pair> operator*(); - - private: - Napi::Object* _object; - Array _keys; - uint32_t _index; - - friend class Object; - }; -#endif // NAPI_CPP_EXCEPTIONS - - /// A JavaScript array buffer value. - class ArrayBuffer : public Object { - public: - /// Creates a new ArrayBuffer instance over a new automatically-allocated buffer. - static ArrayBuffer New( - napi_env env, ///< Node-API environment - size_t byteLength ///< Length of the buffer to be allocated, in bytes - ); - - /// Creates a new ArrayBuffer instance, using an external buffer with - /// specified byte length. - static ArrayBuffer New( - napi_env env, ///< Node-API environment - void* externalData, ///< Pointer to the external buffer to be used by - ///< the array - size_t byteLength ///< Length of the external buffer to be used by the - ///< array, in bytes - ); - - /// Creates a new ArrayBuffer instance, using an external buffer with - /// specified byte length. - template - static ArrayBuffer New( - napi_env env, ///< Node-API environment - void* externalData, ///< Pointer to the external buffer to be used by - ///< the array - size_t byteLength, ///< Length of the external buffer to be used by the - ///< array, - /// in bytes - Finalizer finalizeCallback ///< Function to be called when the array - ///< buffer is destroyed; - /// must implement `void operator()(Env env, - /// void* externalData)` - ); - - /// Creates a new ArrayBuffer instance, using an external buffer with - /// specified byte length. - template - static ArrayBuffer New( - napi_env env, ///< Node-API environment - void* externalData, ///< Pointer to the external buffer to be used by - ///< the array - size_t byteLength, ///< Length of the external buffer to be used by the - ///< array, - /// in bytes - Finalizer finalizeCallback, ///< Function to be called when the array - ///< buffer is destroyed; - /// must implement `void operator()(Env - /// env, void* externalData, Hint* hint)` - Hint* finalizeHint ///< Hint (second parameter) to be passed to the - ///< finalize callback - ); - - ArrayBuffer(); ///< Creates a new _empty_ ArrayBuffer instance. - ArrayBuffer(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - void* Data(); ///< Gets a pointer to the data buffer. - size_t ByteLength(); ///< Gets the length of the array buffer in bytes. - -#if NAPI_VERSION >= 7 - bool IsDetached() const; - void Detach(); -#endif // NAPI_VERSION >= 7 - }; - - /// A JavaScript typed-array value with unknown array type. - /// - /// For type-specific operations, cast to a `TypedArrayOf` instance using the `As()` - /// method: - /// - /// Napi::TypedArray array = ... - /// if (t.TypedArrayType() == napi_int32_array) { - /// Napi::Int32Array int32Array = t.As(); - /// } - class TypedArray : public Object { - public: - TypedArray(); ///< Creates a new _empty_ TypedArray instance. - TypedArray(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - napi_typedarray_type TypedArrayType() const; ///< Gets the type of this typed-array. - Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. - - uint8_t ElementSize() const; ///< Gets the size in bytes of one element in the array. - size_t ElementLength() const; ///< Gets the number of elements in the array. - size_t ByteOffset() const; ///< Gets the offset into the buffer where the array starts. - size_t ByteLength() const; ///< Gets the length of the array in bytes. - - protected: - /// !cond INTERNAL - napi_typedarray_type _type; - size_t _length; - - TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length); - - static const napi_typedarray_type unknown_array_type = static_cast(-1); - - template - static -#if defined(NAPI_HAS_CONSTEXPR) - constexpr -#endif - napi_typedarray_type TypedArrayTypeForPrimitiveType() { - return std::is_same::value ? napi_int8_array - : std::is_same::value ? napi_uint8_array - : std::is_same::value ? napi_int16_array - : std::is_same::value ? napi_uint16_array - : std::is_same::value ? napi_int32_array - : std::is_same::value ? napi_uint32_array - : std::is_same::value ? napi_float32_array - : std::is_same::value ? napi_float64_array -#if NAPI_VERSION > 5 - : std::is_same::value ? napi_bigint64_array - : std::is_same::value ? napi_biguint64_array -#endif // NAPI_VERSION > 5 - : unknown_array_type; - } - /// !endcond - }; - - /// A JavaScript typed-array value with known array type. - /// - /// Note while it is possible to create and access Uint8 "clamped" arrays using this class, - /// the _clamping_ behavior is only applied in JavaScript. - template - class TypedArrayOf : public TypedArray { - public: - /// Creates a new TypedArray instance over a new automatically-allocated array buffer. - /// - /// The array type parameter can normally be omitted (because it is inferred from the template - /// parameter T), except when creating a "clamped" array: - /// - /// Uint8Array::New(env, length, napi_uint8_clamped_array) - static TypedArrayOf New( - napi_env env, ///< Node-API environment - size_t elementLength, ///< Length of the created array, as a number of - ///< elements -#if defined(NAPI_HAS_CONSTEXPR) - napi_typedarray_type type = - TypedArray::TypedArrayTypeForPrimitiveType() -#else - napi_typedarray_type type -#endif - ///< Type of array, if different from the default array type for the - ///< template parameter T. - ); - - /// Creates a new TypedArray instance over a provided array buffer. - /// - /// The array type parameter can normally be omitted (because it is inferred from the template - /// parameter T), except when creating a "clamped" array: - /// - /// Uint8Array::New(env, length, buffer, 0, napi_uint8_clamped_array) - static TypedArrayOf New( - napi_env env, ///< Node-API environment - size_t elementLength, ///< Length of the created array, as a number of - ///< elements - Napi::ArrayBuffer arrayBuffer, ///< Backing array buffer instance to use - size_t bufferOffset, ///< Offset into the array buffer where the - ///< typed-array starts -#if defined(NAPI_HAS_CONSTEXPR) - napi_typedarray_type type = - TypedArray::TypedArrayTypeForPrimitiveType() -#else - napi_typedarray_type type -#endif - ///< Type of array, if different from the default array type for the - ///< template parameter T. - ); - - TypedArrayOf(); ///< Creates a new _empty_ TypedArrayOf instance. - TypedArrayOf(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - T& operator [](size_t index); ///< Gets or sets an element in the array. - const T& operator [](size_t index) const; ///< Gets an element in the array. - - /// Gets a pointer to the array's backing buffer. - /// - /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, because the - /// typed-array may have a non-zero `ByteOffset()` into the `ArrayBuffer`. - T* Data(); - - /// Gets a pointer to the array's backing buffer. - /// - /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, because the - /// typed-array may have a non-zero `ByteOffset()` into the `ArrayBuffer`. - const T* Data() const; - - private: - T* _data; - - TypedArrayOf(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length, - T* data); - }; - - /// The DataView provides a low-level interface for reading/writing multiple - /// number types in an ArrayBuffer irrespective of the platform's endianness. - class DataView : public Object { - public: - static DataView New(napi_env env, - Napi::ArrayBuffer arrayBuffer); - static DataView New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset); - static DataView New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset, - size_t byteLength); - - DataView(); ///< Creates a new _empty_ DataView instance. - DataView(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. - size_t ByteOffset() const; ///< Gets the offset into the buffer where the array starts. - size_t ByteLength() const; ///< Gets the length of the array in bytes. - - void* Data() const; - - float GetFloat32(size_t byteOffset) const; - double GetFloat64(size_t byteOffset) const; - int8_t GetInt8(size_t byteOffset) const; - int16_t GetInt16(size_t byteOffset) const; - int32_t GetInt32(size_t byteOffset) const; - uint8_t GetUint8(size_t byteOffset) const; - uint16_t GetUint16(size_t byteOffset) const; - uint32_t GetUint32(size_t byteOffset) const; - - void SetFloat32(size_t byteOffset, float value) const; - void SetFloat64(size_t byteOffset, double value) const; - void SetInt8(size_t byteOffset, int8_t value) const; - void SetInt16(size_t byteOffset, int16_t value) const; - void SetInt32(size_t byteOffset, int32_t value) const; - void SetUint8(size_t byteOffset, uint8_t value) const; - void SetUint16(size_t byteOffset, uint16_t value) const; - void SetUint32(size_t byteOffset, uint32_t value) const; - - private: - template - T ReadData(size_t byteOffset) const; - - template - void WriteData(size_t byteOffset, T value) const; - - void* _data; - size_t _length; - }; - - class Function : public Object { - public: - using VoidCallback = void (*)(const CallbackInfo& info); - using Callback = Value (*)(const CallbackInfo& info); - - template - static Function New(napi_env env, - const char* utf8name = nullptr, - void* data = nullptr); - - template - static Function New(napi_env env, - const char* utf8name = nullptr, - void* data = nullptr); - - template - static Function New(napi_env env, - const std::string& utf8name, - void* data = nullptr); - - template - static Function New(napi_env env, - const std::string& utf8name, - void* data = nullptr); - - /// Callable must implement operator() accepting a const CallbackInfo& - /// and return either void or Value. - template - static Function New(napi_env env, - Callable cb, - const char* utf8name = nullptr, - void* data = nullptr); - /// Callable must implement operator() accepting a const CallbackInfo& - /// and return either void or Value. - template - static Function New(napi_env env, - Callable cb, - const std::string& utf8name, - void* data = nullptr); - - Function(); - Function(napi_env env, napi_value value); - - MaybeOrValue operator()( - const std::initializer_list& args) const; - - MaybeOrValue Call( - const std::initializer_list& args) const; - MaybeOrValue Call(const std::vector& args) const; - MaybeOrValue Call(size_t argc, const napi_value* args) const; - MaybeOrValue Call( - napi_value recv, const std::initializer_list& args) const; - MaybeOrValue Call(napi_value recv, - const std::vector& args) const; - MaybeOrValue Call(napi_value recv, - size_t argc, - const napi_value* args) const; - - MaybeOrValue MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback(napi_value recv, - const std::vector& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback(napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context = nullptr) const; - - MaybeOrValue New( - const std::initializer_list& args) const; - MaybeOrValue New(const std::vector& args) const; - MaybeOrValue New(size_t argc, const napi_value* args) const; - }; - - class Promise : public Object { - public: - class Deferred { - public: - static Deferred New(napi_env env); - Deferred(napi_env env); - - Napi::Promise Promise() const; - Napi::Env Env() const; - - void Resolve(napi_value value) const; - void Reject(napi_value value) const; - - private: - napi_env _env; - napi_deferred _deferred; - napi_value _promise; - }; - - Promise(napi_env env, napi_value value); - }; - - template - class Buffer : public Uint8Array { - public: - static Buffer New(napi_env env, size_t length); - static Buffer New(napi_env env, T* data, size_t length); - - // Finalizer must implement `void operator()(Env env, T* data)`. - template - static Buffer New(napi_env env, T* data, - size_t length, - Finalizer finalizeCallback); - // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. - template - static Buffer New(napi_env env, T* data, - size_t length, - Finalizer finalizeCallback, - Hint* finalizeHint); - - static Buffer Copy(napi_env env, const T* data, size_t length); - - Buffer(); - Buffer(napi_env env, napi_value value); - size_t Length() const; - T* Data() const; - - private: - mutable size_t _length; - mutable T* _data; - - Buffer(napi_env env, napi_value value, size_t length, T* data); - void EnsureInfo() const; - }; - - /// Holds a counted reference to a value; initially a weak reference unless otherwise specified, - /// may be changed to/from a strong reference by adjusting the refcount. - /// - /// The referenced value is not immediately destroyed when the reference count is zero; it is - /// merely then eligible for garbage-collection if there are no other references to the value. - template - class Reference { - public: - static Reference New(const T& value, uint32_t initialRefcount = 0); - - Reference(); - Reference(napi_env env, napi_ref ref); - ~Reference(); - - // A reference can be moved but cannot be copied. - Reference(Reference&& other); - Reference& operator =(Reference&& other); - NAPI_DISALLOW_ASSIGN(Reference) - - operator napi_ref() const; - bool operator ==(const Reference &other) const; - bool operator !=(const Reference &other) const; - - Napi::Env Env() const; - bool IsEmpty() const; - - // Note when getting the value of a Reference it is usually correct to do so - // within a HandleScope so that the value handle gets cleaned up efficiently. - T Value() const; - - uint32_t Ref(); - uint32_t Unref(); - void Reset(); - void Reset(const T& value, uint32_t refcount = 0); - - // Call this on a reference that is declared as static data, to prevent its - // destructor from running at program shutdown time, which would attempt to - // reset the reference when the environment is no longer valid. Avoid using - // this if at all possible. If you do need to use static data, MAKE SURE to - // warn your users that your addon is NOT threadsafe. - void SuppressDestruct(); - - protected: - Reference(const Reference&); - - /// !cond INTERNAL - napi_env _env; - napi_ref _ref; - /// !endcond - - private: - bool _suppressDestruct; - }; - - class ObjectReference: public Reference { - public: - ObjectReference(); - ObjectReference(napi_env env, napi_ref ref); - - // A reference can be moved but cannot be copied. - ObjectReference(Reference&& other); - ObjectReference& operator =(Reference&& other); - ObjectReference(ObjectReference&& other); - ObjectReference& operator =(ObjectReference&& other); - NAPI_DISALLOW_ASSIGN(ObjectReference) - - MaybeOrValue Get(const char* utf8name) const; - MaybeOrValue Get(const std::string& utf8name) const; - MaybeOrValue Set(const char* utf8name, napi_value value); - MaybeOrValue Set(const char* utf8name, Napi::Value value); - MaybeOrValue Set(const char* utf8name, const char* utf8value); - MaybeOrValue Set(const char* utf8name, bool boolValue); - MaybeOrValue Set(const char* utf8name, double numberValue); - MaybeOrValue Set(const std::string& utf8name, napi_value value); - MaybeOrValue Set(const std::string& utf8name, Napi::Value value); - MaybeOrValue Set(const std::string& utf8name, std::string& utf8value); - MaybeOrValue Set(const std::string& utf8name, bool boolValue); - MaybeOrValue Set(const std::string& utf8name, double numberValue); - - MaybeOrValue Get(uint32_t index) const; - MaybeOrValue Set(uint32_t index, const napi_value value); - MaybeOrValue Set(uint32_t index, const Napi::Value value); - MaybeOrValue Set(uint32_t index, const char* utf8value); - MaybeOrValue Set(uint32_t index, const std::string& utf8value); - MaybeOrValue Set(uint32_t index, bool boolValue); - MaybeOrValue Set(uint32_t index, double numberValue); - - protected: - ObjectReference(const ObjectReference&); - }; - - class FunctionReference: public Reference { - public: - FunctionReference(); - FunctionReference(napi_env env, napi_ref ref); - - // A reference can be moved but cannot be copied. - FunctionReference(Reference&& other); - FunctionReference& operator =(Reference&& other); - FunctionReference(FunctionReference&& other); - FunctionReference& operator =(FunctionReference&& other); - NAPI_DISALLOW_ASSIGN_COPY(FunctionReference) - - MaybeOrValue operator()( - const std::initializer_list& args) const; - - MaybeOrValue Call( - const std::initializer_list& args) const; - MaybeOrValue Call(const std::vector& args) const; - MaybeOrValue Call( - napi_value recv, const std::initializer_list& args) const; - MaybeOrValue Call(napi_value recv, - const std::vector& args) const; - MaybeOrValue Call(napi_value recv, - size_t argc, - const napi_value* args) const; - - MaybeOrValue MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback( - napi_value recv, - const std::vector& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback( - napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context = nullptr) const; - - MaybeOrValue New( - const std::initializer_list& args) const; - MaybeOrValue New(const std::vector& args) const; - }; - - // Shortcuts to creating a new reference with inferred type and refcount = 0. - template Reference Weak(T value); - ObjectReference Weak(Object value); - FunctionReference Weak(Function value); - - // Shortcuts to creating a new reference with inferred type and refcount = 1. - template Reference Persistent(T value); - ObjectReference Persistent(Object value); - FunctionReference Persistent(Function value); - - /// A persistent reference to a JavaScript error object. Use of this class - /// depends somewhat on whether C++ exceptions are enabled at compile time. - /// - /// ### Handling Errors With C++ Exceptions - /// - /// If C++ exceptions are enabled, then the `Error` class extends - /// `std::exception` and enables integrated error-handling for C++ exceptions - /// and JavaScript exceptions. - /// - /// If a Node-API call fails without executing any JavaScript code (for - /// example due to an invalid argument), then the Node-API wrapper - /// automatically converts and throws the error as a C++ exception of type - /// `Napi::Error`. Or if a JavaScript function called by C++ code via Node-API - /// throws a JavaScript exception, then the Node-API wrapper automatically - /// converts and throws it as a C++ exception of type `Napi::Error`. - /// - /// If a C++ exception of type `Napi::Error` escapes from a Node-API C++ - /// callback, then the Node-API wrapper automatically converts and throws it - /// as a JavaScript exception. Therefore, catching a C++ exception of type - /// `Napi::Error` prevents a JavaScript exception from being thrown. - /// - /// #### Example 1A - Throwing a C++ exception: - /// - /// Napi::Env env = ... - /// throw Napi::Error::New(env, "Example exception"); - /// - /// Following C++ statements will not be executed. The exception will bubble - /// up as a C++ exception of type `Napi::Error`, until it is either caught - /// while still in C++, or else automatically propataged as a JavaScript - /// exception when the callback returns to JavaScript. - /// - /// #### Example 2A - Propagating a Node-API C++ exception: - /// - /// Napi::Function jsFunctionThatThrows = someObj.As(); - /// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); - /// - /// Following C++ statements will not be executed. The exception will bubble - /// up as a C++ exception of type `Napi::Error`, until it is either caught - /// while still in C++, or else automatically propagated as a JavaScript - /// exception when the callback returns to JavaScript. - /// - /// #### Example 3A - Handling a Node-API C++ exception: - /// - /// Napi::Function jsFunctionThatThrows = someObj.As(); - /// Napi::Value result; - /// try { - /// result = jsFunctionThatThrows({ arg1, arg2 }); - /// } catch (const Napi::Error& e) { - /// cerr << "Caught JavaScript exception: " + e.what(); - /// } - /// - /// Since the exception was caught here, it will not be propagated as a - /// JavaScript exception. - /// - /// ### Handling Errors Without C++ Exceptions - /// - /// If C++ exceptions are disabled (by defining `NAPI_DISABLE_CPP_EXCEPTIONS`) - /// then this class does not extend `std::exception`, and APIs in the `Napi` - /// namespace do not throw C++ exceptions when they fail. Instead, they raise - /// _pending_ JavaScript exceptions and return _empty_ `Value`s. Calling code - /// should check `Value::IsEmpty()` before attempting to use a returned value, - /// and may use methods on the `Env` class to check for, get, and clear a - /// pending JavaScript exception. If the pending exception is not cleared, it - /// will be thrown when the native callback returns to JavaScript. - /// - /// #### Example 1B - Throwing a JS exception - /// - /// Napi::Env env = ... - /// Napi::Error::New(env, "Example - /// exception").ThrowAsJavaScriptException(); return; - /// - /// After throwing a JS exception, the code should generally return - /// immediately from the native callback, after performing any necessary - /// cleanup. - /// - /// #### Example 2B - Propagating a Node-API JS exception: - /// - /// Napi::Function jsFunctionThatThrows = someObj.As(); - /// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); - /// if (result.IsEmpty()) return; - /// - /// An empty value result from a Node-API call indicates an error occurred, - /// and a JavaScript exception is pending. To let the exception propagate, the - /// code should generally return immediately from the native callback, after - /// performing any necessary cleanup. - /// - /// #### Example 3B - Handling a Node-API JS exception: - /// - /// Napi::Function jsFunctionThatThrows = someObj.As(); - /// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); - /// if (result.IsEmpty()) { - /// Napi::Error e = env.GetAndClearPendingException(); - /// cerr << "Caught JavaScript exception: " + e.Message(); - /// } - /// - /// Since the exception was cleared here, it will not be propagated as a - /// JavaScript exception after the native callback returns. - class Error : public ObjectReference -#ifdef NAPI_CPP_EXCEPTIONS - , public std::exception -#endif // NAPI_CPP_EXCEPTIONS - { - public: - static Error New(napi_env env); - static Error New(napi_env env, const char* message); - static Error New(napi_env env, const std::string& message); - - static NAPI_NO_RETURN void Fatal(const char* location, const char* message); - - Error(); - Error(napi_env env, napi_value value); - - // An error can be moved or copied. - Error(Error&& other); - Error& operator =(Error&& other); - Error(const Error&); - Error& operator =(const Error&); - - const std::string& Message() const NAPI_NOEXCEPT; - void ThrowAsJavaScriptException() const; - - Object Value() const; - -#ifdef NAPI_CPP_EXCEPTIONS - const char* what() const NAPI_NOEXCEPT override; -#endif // NAPI_CPP_EXCEPTIONS - - protected: - /// !cond INTERNAL - using create_error_fn = napi_status (*)(napi_env envb, - napi_value code, - napi_value msg, - napi_value* result); - - template - static TError New(napi_env env, - const char* message, - size_t length, - create_error_fn create_error); - /// !endcond - - private: - const char* ERROR_WRAP_VALUE = - "4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal"; - mutable std::string _message; - }; - - class TypeError : public Error { - public: - static TypeError New(napi_env env, const char* message); - static TypeError New(napi_env env, const std::string& message); - - TypeError(); - TypeError(napi_env env, napi_value value); - }; - - class RangeError : public Error { - public: - static RangeError New(napi_env env, const char* message); - static RangeError New(napi_env env, const std::string& message); - - RangeError(); - RangeError(napi_env env, napi_value value); - }; - - class CallbackInfo { - public: - CallbackInfo(napi_env env, napi_callback_info info); - ~CallbackInfo(); - - // Disallow copying to prevent multiple free of _dynamicArgs - NAPI_DISALLOW_ASSIGN_COPY(CallbackInfo) - - Napi::Env Env() const; - Value NewTarget() const; - bool IsConstructCall() const; - size_t Length() const; - const Value operator [](size_t index) const; - Value This() const; - void* Data() const; - void SetData(void* data); - - private: - const size_t _staticArgCount = 6; - napi_env _env; - napi_callback_info _info; - napi_value _this; - size_t _argc; - napi_value* _argv; - napi_value _staticArgs[6]; - napi_value* _dynamicArgs; - void* _data; - }; - - class PropertyDescriptor { - public: - using GetterCallback = Napi::Value (*)(const Napi::CallbackInfo& info); - using SetterCallback = void (*)(const Napi::CallbackInfo& info); - -#ifndef NODE_ADDON_API_DISABLE_DEPRECATED - template - static PropertyDescriptor Accessor(const char* utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(const std::string& utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(napi_value name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Name name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(napi_value name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(const char* utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(const std::string& utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(napi_value name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(Name name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); -#endif // !NODE_ADDON_API_DISABLE_DEPRECATED - - template - static PropertyDescriptor Accessor(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor(const std::string& utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor(Name name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor(const std::string& utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor(Name name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor(Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor(Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(Napi::Env env, - Napi::Object object, - const char* utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function(Napi::Env env, - Napi::Object object, - Name name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor Value(const char* utf8name, - napi_value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor Value(const std::string& utf8name, - napi_value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor Value(napi_value name, - napi_value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor Value(Name name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - - PropertyDescriptor(napi_property_descriptor desc); - - operator napi_property_descriptor&(); - operator const napi_property_descriptor&() const; - - private: - napi_property_descriptor _desc; - }; - - /// Property descriptor for use with `ObjectWrap::DefineClass()`. - /// - /// This is different from the standalone `PropertyDescriptor` because it is specific to each - /// `ObjectWrap` subclass. This prevents using descriptors from a different class when - /// defining a new class (preventing the callbacks from having incorrect `this` pointers). - template - class ClassPropertyDescriptor { - public: - ClassPropertyDescriptor(napi_property_descriptor desc) : _desc(desc) {} - - operator napi_property_descriptor&() { return _desc; } - operator const napi_property_descriptor&() const { return _desc; } - - private: - napi_property_descriptor _desc; - }; - - template - struct MethodCallbackData { - TCallback callback; - void* data; - }; - - template - struct AccessorCallbackData { - TGetterCallback getterCallback; - TSetterCallback setterCallback; - void* data; - }; - - template - class InstanceWrap { - public: - using InstanceVoidMethodCallback = void (T::*)(const CallbackInfo& info); - using InstanceMethodCallback = Napi::Value (T::*)(const CallbackInfo& info); - using InstanceGetterCallback = Napi::Value (T::*)(const CallbackInfo& info); - using InstanceSetterCallback = void (T::*)(const CallbackInfo& info, - const Napi::Value& value); - - using PropertyDescriptor = ClassPropertyDescriptor; - - static PropertyDescriptor InstanceMethod(const char* utf8name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceMethod(const char* utf8name, - InstanceMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceMethod(Symbol name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceMethod(Symbol name, - InstanceMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod(Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod(Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceAccessor(const char* utf8name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceAccessor(Symbol name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceAccessor(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceAccessor(Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceValue(const char* utf8name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor InstanceValue(Symbol name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - - protected: - static void AttachPropData(napi_env env, napi_value value, const napi_property_descriptor* prop); - - private: - using This = InstanceWrap; - - using InstanceVoidMethodCallbackData = - MethodCallbackData; - using InstanceMethodCallbackData = - MethodCallbackData; - using InstanceAccessorCallbackData = - AccessorCallbackData; - - static napi_value InstanceVoidMethodCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value InstanceMethodCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value InstanceGetterCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value InstanceSetterCallbackWrapper(napi_env env, napi_callback_info info); - - template - static napi_value WrappedMethod(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT; - - template struct SetterTag {}; - - template - static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { - return &This::WrappedMethod; - } - static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { - return nullptr; - } - }; - - /// Base class to be extended by C++ classes exposed to JavaScript; each C++ class instance gets - /// "wrapped" by a JavaScript object that is managed by this class. - /// - /// At initialization time, the `DefineClass()` method must be used to - /// hook up the accessor and method callbacks. It takes a list of - /// property descriptors, which can be constructed via the various - /// static methods on the base class. - /// - /// #### Example: - /// - /// class Example: public Napi::ObjectWrap { - /// public: - /// static void Initialize(Napi::Env& env, Napi::Object& target) { - /// Napi::Function constructor = DefineClass(env, "Example", { - /// InstanceAccessor<&Example::GetSomething, &Example::SetSomething>("value"), - /// InstanceMethod<&Example::DoSomething>("doSomething"), - /// }); - /// target.Set("Example", constructor); - /// } - /// - /// Example(const Napi::CallbackInfo& info); // Constructor - /// Napi::Value GetSomething(const Napi::CallbackInfo& info); - /// void SetSomething(const Napi::CallbackInfo& info, const Napi::Value& value); - /// Napi::Value DoSomething(const Napi::CallbackInfo& info); - /// } - template - class ObjectWrap : public InstanceWrap, public Reference { - public: - ObjectWrap(const CallbackInfo& callbackInfo); - virtual ~ObjectWrap(); - - static T* Unwrap(Object wrapper); - - // Methods exposed to JavaScript must conform to one of these callback signatures. - using StaticVoidMethodCallback = void (*)(const CallbackInfo& info); - using StaticMethodCallback = Napi::Value (*)(const CallbackInfo& info); - using StaticGetterCallback = Napi::Value (*)(const CallbackInfo& info); - using StaticSetterCallback = void (*)(const CallbackInfo& info, - const Napi::Value& value); - - using PropertyDescriptor = ClassPropertyDescriptor; - - static Function DefineClass(Napi::Env env, - const char* utf8name, - const std::initializer_list& properties, - void* data = nullptr); - static Function DefineClass(Napi::Env env, - const char* utf8name, - const std::vector& properties, - void* data = nullptr); - static PropertyDescriptor StaticMethod(const char* utf8name, - StaticVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticMethod(const char* utf8name, - StaticMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticMethod(Symbol name, - StaticVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticMethod(Symbol name, - StaticMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod(Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod(Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticAccessor(const char* utf8name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticAccessor(Symbol name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticAccessor(const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticAccessor(Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticValue(const char* utf8name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor StaticValue(Symbol name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - virtual void Finalize(Napi::Env env); - - private: - using This = ObjectWrap; - - static napi_value ConstructorCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value StaticVoidMethodCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value StaticMethodCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value StaticGetterCallbackWrapper(napi_env env, napi_callback_info info); - static napi_value StaticSetterCallbackWrapper(napi_env env, napi_callback_info info); - static void FinalizeCallback(napi_env env, void* data, void* hint); - static Function DefineClass(Napi::Env env, - const char* utf8name, - const size_t props_count, - const napi_property_descriptor* props, - void* data = nullptr); - - using StaticVoidMethodCallbackData = - MethodCallbackData; - using StaticMethodCallbackData = - MethodCallbackData; - - using StaticAccessorCallbackData = - AccessorCallbackData; - - template - static napi_value WrappedMethod(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT; - - template struct StaticSetterTag {}; - - template - static napi_callback WrapStaticSetter(StaticSetterTag) - NAPI_NOEXCEPT { - return &This::WrappedMethod; - } - static napi_callback WrapStaticSetter(StaticSetterTag) - NAPI_NOEXCEPT { - return nullptr; - } - - bool _construction_failed = true; - }; - - class HandleScope { - public: - HandleScope(napi_env env, napi_handle_scope scope); - explicit HandleScope(Napi::Env env); - ~HandleScope(); - - // Disallow copying to prevent double close of napi_handle_scope - NAPI_DISALLOW_ASSIGN_COPY(HandleScope) - - operator napi_handle_scope() const; - - Napi::Env Env() const; - - private: - napi_env _env; - napi_handle_scope _scope; - }; - - class EscapableHandleScope { - public: - EscapableHandleScope(napi_env env, napi_escapable_handle_scope scope); - explicit EscapableHandleScope(Napi::Env env); - ~EscapableHandleScope(); - - // Disallow copying to prevent double close of napi_escapable_handle_scope - NAPI_DISALLOW_ASSIGN_COPY(EscapableHandleScope) - - operator napi_escapable_handle_scope() const; - - Napi::Env Env() const; - Value Escape(napi_value escapee); - - private: - napi_env _env; - napi_escapable_handle_scope _scope; - }; - -#if (NAPI_VERSION > 2) - class CallbackScope { - public: - CallbackScope(napi_env env, napi_callback_scope scope); - CallbackScope(napi_env env, napi_async_context context); - virtual ~CallbackScope(); - - // Disallow copying to prevent double close of napi_callback_scope - NAPI_DISALLOW_ASSIGN_COPY(CallbackScope) - - operator napi_callback_scope() const; - - Napi::Env Env() const; - - private: - napi_env _env; - napi_callback_scope _scope; - }; -#endif - - class AsyncContext { - public: - explicit AsyncContext(napi_env env, const char* resource_name); - explicit AsyncContext(napi_env env, const char* resource_name, const Object& resource); - virtual ~AsyncContext(); - - AsyncContext(AsyncContext&& other); - AsyncContext& operator =(AsyncContext&& other); - NAPI_DISALLOW_ASSIGN_COPY(AsyncContext) - - operator napi_async_context() const; - - Napi::Env Env() const; - - private: - napi_env _env; - napi_async_context _context; - }; - - class AsyncWorker { - public: - virtual ~AsyncWorker(); - - // An async worker can be moved but cannot be copied. - AsyncWorker(AsyncWorker&& other); - AsyncWorker& operator =(AsyncWorker&& other); - NAPI_DISALLOW_ASSIGN_COPY(AsyncWorker) - - operator napi_async_work() const; - - Napi::Env Env() const; - - void Queue(); - void Cancel(); - void SuppressDestruct(); - - ObjectReference& Receiver(); - FunctionReference& Callback(); - - virtual void OnExecute(Napi::Env env); - virtual void OnWorkComplete(Napi::Env env, - napi_status status); - - protected: - explicit AsyncWorker(const Function& callback); - explicit AsyncWorker(const Function& callback, - const char* resource_name); - explicit AsyncWorker(const Function& callback, - const char* resource_name, - const Object& resource); - explicit AsyncWorker(const Object& receiver, - const Function& callback); - explicit AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name); - explicit AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource); - - explicit AsyncWorker(Napi::Env env); - explicit AsyncWorker(Napi::Env env, - const char* resource_name); - explicit AsyncWorker(Napi::Env env, - const char* resource_name, - const Object& resource); - - virtual void Execute() = 0; - virtual void OnOK(); - virtual void OnError(const Error& e); - virtual void Destroy(); - virtual std::vector GetResult(Napi::Env env); - - void SetError(const std::string& error); - - private: - static inline void OnAsyncWorkExecute(napi_env env, void* asyncworker); - static inline void OnAsyncWorkComplete(napi_env env, - napi_status status, - void* asyncworker); - - napi_env _env; - napi_async_work _work; - ObjectReference _receiver; - FunctionReference _callback; - std::string _error; - bool _suppress_destruct; - }; - - #if (NAPI_VERSION > 3 && !defined(__wasm32__)) - class ThreadSafeFunction { - public: - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data); - - ThreadSafeFunction(); - ThreadSafeFunction(napi_threadsafe_function tsFunctionValue); - - operator napi_threadsafe_function() const; - - // This API may be called from any thread. - napi_status BlockingCall() const; - - // This API may be called from any thread. - template - napi_status BlockingCall(Callback callback) const; - - // This API may be called from any thread. - template - napi_status BlockingCall(DataType* data, Callback callback) const; - - // This API may be called from any thread. - napi_status NonBlockingCall() const; - - // This API may be called from any thread. - template - napi_status NonBlockingCall(Callback callback) const; - - // This API may be called from any thread. - template - napi_status NonBlockingCall(DataType* data, Callback callback) const; - - // This API may only be called from the main thread. - void Ref(napi_env env) const; - - // This API may only be called from the main thread. - void Unref(napi_env env) const; - - // This API may be called from any thread. - napi_status Acquire() const; - - // This API may be called from any thread. - napi_status Release(); - - // This API may be called from any thread. - napi_status Abort(); - - struct ConvertibleContext - { - template - operator T*() { return static_cast(context); } - void* context; - }; - - // This API may be called from any thread. - ConvertibleContext GetContext() const; - - private: - using CallbackWrapper = std::function; - - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data, - napi_finalize wrapper); - - napi_status CallInternal(CallbackWrapper* callbackWrapper, - napi_threadsafe_function_call_mode mode) const; - - static void CallJS(napi_env env, - napi_value jsCallback, - void* context, - void* data); - - napi_threadsafe_function _tsfn; - }; - - // A TypedThreadSafeFunction by default has no context (nullptr) and can - // accept any type (void) to its CallJs. - template - class TypedThreadSafeFunction { - public: - // This API may only be called from the main thread. - // Helper function that returns nullptr if running Node-API 5+, otherwise a - // non-empty, no-op Function. This provides the ability to specify at - // compile-time a callback parameter to `New` that safely does no action - // when targeting _any_ Node-API version. -#if NAPI_VERSION > 4 - static std::nullptr_t EmptyFunctionFactory(Napi::Env env); -#else - static Napi::Function EmptyFunctionFactory(Napi::Env env); -#endif - static Napi::Function FunctionOrEmpty(Napi::Env env, - Napi::Function& callback); - -#if NAPI_VERSION > 4 - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [missing] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [passed] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [missing] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [passed] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); -#endif - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [missing] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [passed] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [missing] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [passed] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - CallbackType callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); - - TypedThreadSafeFunction(); - TypedThreadSafeFunction(napi_threadsafe_function tsFunctionValue); - - operator napi_threadsafe_function() const; - - // This API may be called from any thread. - napi_status BlockingCall(DataType* data = nullptr) const; - - // This API may be called from any thread. - napi_status NonBlockingCall(DataType* data = nullptr) const; - - // This API may only be called from the main thread. - void Ref(napi_env env) const; - - // This API may only be called from the main thread. - void Unref(napi_env env) const; - - // This API may be called from any thread. - napi_status Acquire() const; - - // This API may be called from any thread. - napi_status Release(); - - // This API may be called from any thread. - napi_status Abort(); - - // This API may be called from any thread. - ContextType* GetContext() const; - - private: - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data, - napi_finalize wrapper); - - static void CallJsInternal(napi_env env, - napi_value jsCallback, - void* context, - void* data); - - protected: - napi_threadsafe_function _tsfn; - }; - template - class AsyncProgressWorkerBase : public AsyncWorker { - public: - virtual void OnWorkProgress(DataType* data) = 0; - class ThreadSafeData { - public: - ThreadSafeData(AsyncProgressWorkerBase* asyncprogressworker, DataType* data) - : _asyncprogressworker(asyncprogressworker), _data(data) {} - - AsyncProgressWorkerBase* asyncprogressworker() { return _asyncprogressworker; }; - DataType* data() { return _data; }; - - private: - AsyncProgressWorkerBase* _asyncprogressworker; - DataType* _data; - }; - void OnWorkComplete(Napi::Env env, napi_status status) override; - protected: - explicit AsyncProgressWorkerBase(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource, - size_t queue_size = 1); - virtual ~AsyncProgressWorkerBase(); - -// Optional callback of Napi::ThreadSafeFunction only available after NAPI_VERSION 4. -// Refs: https://github.com/nodejs/node/pull/27791 -#if NAPI_VERSION > 4 - explicit AsyncProgressWorkerBase(Napi::Env env, - const char* resource_name, - const Object& resource, - size_t queue_size = 1); -#endif - - static inline void OnAsyncWorkProgress(Napi::Env env, - Napi::Function jsCallback, - void* data); - - napi_status NonBlockingCall(DataType* data); - - private: - ThreadSafeFunction _tsfn; - bool _work_completed = false; - napi_status _complete_status; - static inline void OnThreadSafeFunctionFinalize(Napi::Env env, void* data, AsyncProgressWorkerBase* context); - }; - - template - class AsyncProgressWorker : public AsyncProgressWorkerBase { - public: - virtual ~AsyncProgressWorker(); - - class ExecutionProgress { - friend class AsyncProgressWorker; - public: - void Signal() const; - void Send(const T* data, size_t count) const; - private: - explicit ExecutionProgress(AsyncProgressWorker* worker) : _worker(worker) {} - AsyncProgressWorker* const _worker; - }; - - void OnWorkProgress(void*) override; - - protected: - explicit AsyncProgressWorker(const Function& callback); - explicit AsyncProgressWorker(const Function& callback, - const char* resource_name); - explicit AsyncProgressWorker(const Function& callback, - const char* resource_name, - const Object& resource); - explicit AsyncProgressWorker(const Object& receiver, - const Function& callback); - explicit AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name); - explicit AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource); - -// Optional callback of Napi::ThreadSafeFunction only available after NAPI_VERSION 4. -// Refs: https://github.com/nodejs/node/pull/27791 -#if NAPI_VERSION > 4 - explicit AsyncProgressWorker(Napi::Env env); - explicit AsyncProgressWorker(Napi::Env env, - const char* resource_name); - explicit AsyncProgressWorker(Napi::Env env, - const char* resource_name, - const Object& resource); -#endif - virtual void Execute(const ExecutionProgress& progress) = 0; - virtual void OnProgress(const T* data, size_t count) = 0; - - private: - void Execute() override; - void Signal() const; - void SendProgress_(const T* data, size_t count); - - std::mutex _mutex; - T* _asyncdata; - size_t _asyncsize; - }; - - template - class AsyncProgressQueueWorker : public AsyncProgressWorkerBase> { - public: - virtual ~AsyncProgressQueueWorker() {}; - - class ExecutionProgress { - friend class AsyncProgressQueueWorker; - public: - void Signal() const; - void Send(const T* data, size_t count) const; - private: - explicit ExecutionProgress(AsyncProgressQueueWorker* worker) : _worker(worker) {} - AsyncProgressQueueWorker* const _worker; - }; - - void OnWorkComplete(Napi::Env env, napi_status status) override; - void OnWorkProgress(std::pair*) override; - - protected: - explicit AsyncProgressQueueWorker(const Function& callback); - explicit AsyncProgressQueueWorker(const Function& callback, - const char* resource_name); - explicit AsyncProgressQueueWorker(const Function& callback, - const char* resource_name, - const Object& resource); - explicit AsyncProgressQueueWorker(const Object& receiver, - const Function& callback); - explicit AsyncProgressQueueWorker(const Object& receiver, - const Function& callback, - const char* resource_name); - explicit AsyncProgressQueueWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource); - -// Optional callback of Napi::ThreadSafeFunction only available after NAPI_VERSION 4. -// Refs: https://github.com/nodejs/node/pull/27791 -#if NAPI_VERSION > 4 - explicit AsyncProgressQueueWorker(Napi::Env env); - explicit AsyncProgressQueueWorker(Napi::Env env, - const char* resource_name); - explicit AsyncProgressQueueWorker(Napi::Env env, - const char* resource_name, - const Object& resource); -#endif - virtual void Execute(const ExecutionProgress& progress) = 0; - virtual void OnProgress(const T* data, size_t count) = 0; - - private: - void Execute() override; - void Signal() const; - void SendProgress_(const T* data, size_t count); - }; - #endif // NAPI_VERSION > 3 && !defined(__wasm32__) - - // Memory management. - class MemoryManagement { - public: - static int64_t AdjustExternalMemory(Env env, int64_t change_in_bytes); - }; - - // Version management - class VersionManagement { - public: - static uint32_t GetNapiVersion(Env env); - static const napi_node_version* GetNodeVersion(Env env); - }; - -#if NAPI_VERSION > 5 - template - class Addon : public InstanceWrap { - public: - static inline Object Init(Env env, Object exports); - static T* Unwrap(Object wrapper); - - protected: - using AddonProp = ClassPropertyDescriptor; - void DefineAddon(Object exports, - const std::initializer_list& props); - Napi::Object DefineProperties(Object object, - const std::initializer_list& props); - - private: - Object entry_point_; - }; -#endif // NAPI_VERSION > 5 - -} // namespace Napi - -// Inline implementations of all the above class methods are included here. -#include "napi-inl.h" - -#endif // SRC_NAPI_H_ diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/node_api.gyp b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/node_api.gyp deleted file mode 100644 index 4ff0ae7df..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/node_api.gyp +++ /dev/null @@ -1,9 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'nothing', - 'type': 'static_library', - 'sources': [ 'nothing.c' ] - } - ] -} diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/noexcept.gypi b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/noexcept.gypi deleted file mode 100644 index 404a05f30..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/noexcept.gypi +++ /dev/null @@ -1,26 +0,0 @@ -{ - 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ], - 'cflags': [ '-fno-exceptions' ], - 'cflags_cc': [ '-fno-exceptions' ], - 'conditions': [ - ["OS=='win'", { - # _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi - #"defines": [ - # "_HAS_EXCEPTIONS=0" - #], - "msvs_settings": { - "VCCLCompilerTool": { - 'ExceptionHandling': 0, - 'EnablePREfast': 'true', - }, - }, - }], - ["OS=='mac'", { - 'xcode_settings': { - 'CLANG_CXX_LIBRARY': 'libc++', - 'MACOSX_DEPLOYMENT_TARGET': '10.7', - 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', - }, - }], - ], -} diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/nothing.c b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/nothing.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/package-support.json b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/package-support.json deleted file mode 100644 index 10d3607ac..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/package-support.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "versions": [ - { - "version": "*", - "target": { - "node": "active" - }, - "response": { - "type": "time-permitting", - "paid": false, - "contact": { - "name": "node-addon-api team", - "url": "https://github.com/nodejs/node-addon-api/issues" - } - }, - "backing": [ { "project": "https://github.com/nodejs" }, - { "foundation": "https://openjsf.org/" } - ] - } - ] -} diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/package.json b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/package.json deleted file mode 100644 index fb74a1c0f..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/package.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/nodejs/node-addon-api/issues" - }, - "contributors": [ - { - "name": "Abhishek Kumar Singh", - "url": "https://github.com/abhi11210646" - }, - { - "name": "Alba Mendez", - "url": "https://github.com/jmendeth" - }, - { - "name": "Alexander Floh", - "url": "https://github.com/alexanderfloh" - }, - { - "name": "András Timár, Dr", - "url": "https://github.com/timarandras" - }, - { - "name": "Andrew Petersen", - "url": "https://github.com/kirbysayshi" - }, - { - "name": "Anisha Rohra", - "url": "https://github.com/anisha-rohra" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax" - }, - { - "name": "Arnaud Botella", - "url": "https://github.com/BotellaA" - }, - { - "name": "Arunesh Chandra", - "url": "https://github.com/aruneshchandra" - }, - { - "name": "Azlan Mukhtar", - "url": "https://github.com/azlan" - }, - { - "name": "Ben Berman", - "url": "https://github.com/rivertam" - }, - { - "name": "Benjamin Byholm", - "url": "https://github.com/kkoopa" - }, - { - "name": "Bill Gallafent", - "url": "https://github.com/gallafent" - }, - { - "name": "blagoev", - "url": "https://github.com/blagoev" - }, - { - "name": "Bruce A. MacNaughton", - "url": "https://github.com/bmacnaughton" - }, - { - "name": "Cory Mickelson", - "url": "https://github.com/corymickelson" - }, - { - "name": "Daniel Bevenius", - "url": "https://github.com/danbev" - }, - { - "name": "Darshan Sen", - "url": "https://github.com/RaisinTen" - }, - { - "name": "David Halls", - "url": "https://github.com/davedoesdev" - }, - { - "name": "Deepak Rajamohan", - "url": "https://github.com/deepakrkris" - }, - { - "name": "Dmitry Ashkadov", - "url": "https://github.com/dmitryash" - }, - { - "name": "Dongjin Na", - "url": "https://github.com/nadongguri" - }, - { - "name": "Doni Rubiagatra", - "url": "https://github.com/rubiagatra" - }, - { - "name": "Ferdinand Holzer", - "url": "https://github.com/fholzer" - }, - { - "name": "Eric Bickle", - "url": "https://github.com/ebickle" - }, - { - "name": "Gabriel Schulhof", - "url": "https://github.com/gabrielschulhof" - }, - { - "name": "Guenter Sandner", - "url": "https://github.com/gms1" - }, - { - "name": "Gus Caplan", - "url": "https://github.com/devsnek" - }, - { - "name": "Helio Frota", - "url": "https://github.com/helio-frota" - }, - { - "name": "Hitesh Kanwathirtha", - "url": "https://github.com/digitalinfinity" - }, - { - "name": "ikokostya", - "url": "https://github.com/ikokostya" - }, - { - "name": "Jack Xia", - "url": "https://github.com/JckXia" - }, - { - "name": "Jake Barnes", - "url": "https://github.com/DuBistKomisch" - }, - { - "name": "Jake Yoon", - "url": "https://github.com/yjaeseok" - }, - { - "name": "Jason Ginchereau", - "url": "https://github.com/jasongin" - }, - { - "name": "Jeroen Janssen", - "url": "https://github.com/japj" - }, - { - "name": "Jim Schlight", - "url": "https://github.com/jschlight" - }, - { - "name": "Jinho Bang", - "url": "https://github.com/romandev" - }, - { - "name": "José Expósito", - "url": "https://github.com/JoseExposito" - }, - { - "name": "joshgarde", - "url": "https://github.com/joshgarde" - }, - { - "name": "Kasumi Hanazuki", - "url": "https://github.com/hanazuki" - }, - { - "name": "Kelvin", - "url": "https://github.com/kelvinhammond" - }, - { - "name": "Kevin Eady", - "url": "https://github.com/KevinEady" - }, - { - "name": "Kévin VOYER", - "url": "https://github.com/kecsou" - }, - { - "name": "kidneysolo", - "url": "https://github.com/kidneysolo" - }, - { - "name": "Koki Nishihara", - "url": "https://github.com/Nishikoh" - }, - { - "name": "Konstantin Tarkus", - "url": "https://github.com/koistya" - }, - { - "name": "Kyle Farnung", - "url": "https://github.com/kfarnung" - }, - { - "name": "legendecas", - "url": "https://github.com/legendecas" - }, - { - "name": "LongYinan", - "url": "https://github.com/Brooooooklyn" - }, - { - "name": "Lovell Fuller", - "url": "https://github.com/lovell" - }, - { - "name": "Luciano Martorella", - "url": "https://github.com/lmartorella" - }, - { - "name": "mastergberry", - "url": "https://github.com/mastergberry" - }, - { - "name": "Mathias Küsel", - "url": "https://github.com/mathiask88" - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina" - }, - { - "name": "Michael Dawson", - "url": "https://github.com/mhdawson" - }, - { - "name": "Michael Price", - "url": "https://github.com/mikepricedev" - }, - { - "name": "Michele Campus", - "url": "https://github.com/kYroL01" - }, - { - "name": "Mikhail Cheshkov", - "url": "https://github.com/mcheshkov" - }, - { - "name": "nempoBu4", - "url": "https://github.com/nempoBu4" - }, - { - "name": "Nicola Del Gobbo", - "url": "https://github.com/NickNaso" - }, - { - "name": "Nick Soggin", - "url": "https://github.com/iSkore" - }, - { - "name": "Nikolai Vavilov", - "url": "https://github.com/seishun" - }, - { - "name": "Nurbol Alpysbayev", - "url": "https://github.com/anurbol" - }, - { - "name": "pacop", - "url": "https://github.com/pacop" - }, - { - "name": "Philipp Renoth", - "url": "https://github.com/DaAitch" - }, - { - "name": "Rolf Timmermans", - "url": "https://github.com/rolftimmermans" - }, - { - "name": "Ross Weir", - "url": "https://github.com/ross-weir" - }, - { - "name": "Ryuichi Okumura", - "url": "https://github.com/okuryu" - }, - { - "name": "Sampson Gao", - "url": "https://github.com/sampsongao" - }, - { - "name": "Sam Roberts", - "url": "https://github.com/sam-github" - }, - { - "name": "strager", - "url": "https://github.com/strager" - }, - { - "name": "Taylor Woll", - "url": "https://github.com/boingoing" - }, - { - "name": "Thomas Gentilhomme", - "url": "https://github.com/fraxken" - }, - { - "name": "Tim Rach", - "url": "https://github.com/timrach" - }, - { - "name": "Tobias Nießen", - "url": "https://github.com/tniessen" - }, - { - "name": "todoroff", - "url": "https://github.com/todoroff" - }, - { - "name": "Tux3", - "url": "https://github.com/tux3" - }, - { - "name": "Vlad Velmisov", - "url": "https://github.com/Velmisov" - }, - { - "name": "WenheLI", - "url": "https://github.com/WenheLI" - }, - - { - "name": "Yohei Kishimoto", - "url": "https://github.com/morokosi" - }, - { - "name": "Yulong Wang", - "url": "https://github.com/fs-eire" - }, - { - "name": "Ziqiu Zhao", - "url": "https://github.com/ZzqiZQute" - } - ], - "description": "Node.js API (Node-API)", - "devDependencies": { - "benchmark": "^2.1.4", - "bindings": "^1.5.0", - "clang-format": "^1.4.0", - "eslint": "^7.32.0", - "eslint-config-semistandard": "^16.0.0", - "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.24.2", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.1.0", - "fs-extra": "^9.0.1", - "path": "^0.12.7", - "pre-commit": "^1.2.2", - "safe-buffer": "^5.1.1" - }, - "directories": {}, - "gypfile": false, - "homepage": "https://github.com/nodejs/node-addon-api", - "keywords": [ - "n-api", - "napi", - "addon", - "native", - "bindings", - "c", - "c++", - "nan", - "node-addon-api" - ], - "license": "MIT", - "main": "index.js", - "name": "node-addon-api", - "readme": "README.md", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/node-addon-api.git" - }, - "files": [ - "*.{c,h,gyp,gypi}", - "package-support.json", - "tools/" - ], - "scripts": { - "prebenchmark": "node-gyp rebuild -C benchmark", - "benchmark": "node benchmark", - "pretest": "node-gyp rebuild -C test", - "test": "node test", - "predev": "node-gyp rebuild -C test --debug", - "dev": "node test", - "predev:incremental": "node-gyp configure build -C test --debug", - "dev:incremental": "node test", - "doc": "doxygen doc/Doxyfile", - "lint": "node tools/eslint-format && node tools/clang-format", - "lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix" - }, - "pre-commit": "lint", - "version": "4.3.0", - "support": true -} diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/README.md b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/README.md deleted file mode 100644 index 6b80e94f5..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Tools - -## clang-format - -The clang-format checking tools is designed to check changed lines of code compared to given git-refs. - -## Migration Script - -The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required. - -### How To Use - -To run the conversion script, first make sure you have the latest `node-addon-api` in your `node_modules` directory. -``` -npm install node-addon-api -``` - -Then run the script passing your project directory -``` -node ./node_modules/node-addon-api/tools/conversion.js ./ -``` - -After finish, recompile and debug things that are missed by the script. - - -### Quick Fixes -Here is the list of things that can be fixed easily. - 1. Change your methods' return value to void if it doesn't return value to JavaScript. - 2. Use `.` to access attribute or to invoke member function in Napi::Object instead of `->`. - 3. `Napi::New(env, value);` to `Napi::[Type]::New(env, value); - - -### Major Reconstructions -The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN. - -So if you use Nan::ObjectWrap in your module, you will need to execute the following steps. - - 1. Convert your [ClassName]::New function to a constructor function that takes a `Napi::CallbackInfo`. Declare it as -``` -[ClassName](const Napi::CallbackInfo& info); -``` -and define it as -``` -[ClassName]::[ClassName](const Napi::CallbackInfo& info) : Napi::ObjectWrap<[ClassName]>(info){ - ... -} -``` -This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object. - - 2. Move your original constructor code into the new constructor. Delete your original constructor. - 3. In your class initialization function, associate native methods in the following way. -``` -Napi::FunctionReference constructor; - -void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) { - Napi::HandleScope scope(env); - Napi::Function ctor = DefineClass(env, "Canvas", { - InstanceMethod<&[ClassName]::Func1>("Func1"), - InstanceMethod<&[ClassName]::Func2>("Func2"), - InstanceAccessor<&[ClassName]::ValueGetter>("Value"), - StaticMethod<&[ClassName]::StaticMethod>("MethodName"), - InstanceValue("Value", Napi::[Type]::New(env, value)), - }); - - constructor = Napi::Persistent(ctor); - constructor .SuppressDestruct(); - exports.Set("[ClassName]", ctor); -} -``` - 4. In function where you need to Unwrap the ObjectWrap in NAN like `[ClassName]* native = Nan::ObjectWrap::Unwrap<[ClassName]>(info.This());`, use `this` pointer directly as the unwrapped object as each ObjectWrap instance is associated with a unique object instance. - - -If you still find issues after following this guide, please leave us an issue describing your problem and we will try to resolve it. diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/check-napi.js b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/check-napi.js deleted file mode 100644 index 48fdfc077..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/check-napi.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; -// Descend into a directory structure and, for each file matching *.node, output -// based on the imports found in the file whether it's an N-API module or not. - -const fs = require('fs'); -const path = require('path'); -const child_process = require('child_process'); - -// Read the output of the command, break it into lines, and use the reducer to -// decide whether the file is an N-API module or not. -function checkFile(file, command, argv, reducer) { - const child = child_process.spawn(command, argv, { - stdio: ['inherit', 'pipe', 'inherit'] - }); - let leftover = ''; - let isNapi = undefined; - child.stdout.on('data', (chunk) => { - if (isNapi === undefined) { - chunk = (leftover + chunk.toString()).split(/[\r\n]+/); - leftover = chunk.pop(); - isNapi = chunk.reduce(reducer, isNapi); - if (isNapi !== undefined) { - child.kill(); - } - } - }); - child.on('close', (code, signal) => { - if ((code === null && signal !== null) || (code !== 0)) { - console.log( - command + ' exited with code: ' + code + ' and signal: ' + signal); - } else { - // Green if it's a N-API module, red otherwise. - console.log( - '\x1b[' + (isNapi ? '42' : '41') + 'm' + - (isNapi ? ' N-API' : 'Not N-API') + - '\x1b[0m: ' + file); - } - }); -} - -// Use nm -a to list symbols. -function checkFileUNIX(file) { - checkFile(file, 'nm', ['-a', file], (soFar, line) => { - if (soFar === undefined) { - line = line.match(/([0-9a-f]*)? ([a-zA-Z]) (.*$)/); - if (line[2] === 'U') { - if (/^napi/.test(line[3])) { - soFar = true; - } - } - } - return soFar; - }); -} - -// Use dumpbin /imports to list symbols. -function checkFileWin32(file) { - checkFile(file, 'dumpbin', ['/imports', file], (soFar, line) => { - if (soFar === undefined) { - line = line.match(/([0-9a-f]*)? +([a-zA-Z0-9]) (.*$)/); - if (line && /^napi/.test(line[line.length - 1])) { - soFar = true; - } - } - return soFar; - }); -} - -// Descend into a directory structure and pass each file ending in '.node' to -// one of the above checks, depending on the OS. -function recurse(top) { - fs.readdir(top, (error, items) => { - if (error) { - throw ("error reading directory " + top + ": " + error); - } - items.forEach((item) => { - item = path.join(top, item); - fs.stat(item, ((item) => (error, stats) => { - if (error) { - throw ("error about " + item + ": " + error); - } - if (stats.isDirectory()) { - recurse(item); - } else if (/[.]node$/.test(item) && - // Explicitly ignore files called 'nothing.node' because they are - // artefacts of node-addon-api having identified a version of - // Node.js that ships with a correct implementation of N-API. - path.basename(item) !== 'nothing.node') { - process.platform === 'win32' ? - checkFileWin32(item) : - checkFileUNIX(item); - } - })(item)); - }); - }); -} - -// Start with the directory given on the command line or the current directory -// if nothing was given. -recurse(process.argv.length > 3 ? process.argv[2] : '.'); diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/clang-format.js b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/clang-format.js deleted file mode 100644 index b76d89bda..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/clang-format.js +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -const spawn = require('child_process').spawnSync; -const path = require('path'); - -const filesToCheck = ['*.h', '*.cc']; -const FORMAT_START = process.env.FORMAT_START || 'main'; - -function main (args) { - let fix = false; - while (args.length > 0) { - switch (args[0]) { - case '-f': - case '--fix': - fix = true; - break; - default: - } - args.shift(); - } - - const clangFormatPath = path.dirname(require.resolve('clang-format')); - const options = ['--binary=node_modules/.bin/clang-format', '--style=file']; - if (fix) { - options.push(FORMAT_START); - } else { - options.push('--diff', FORMAT_START); - } - - const gitClangFormatPath = path.join(clangFormatPath, 'bin/git-clang-format'); - const result = spawn( - 'python', - [gitClangFormatPath, ...options, '--', ...filesToCheck], - { encoding: 'utf-8' } - ); - - if (result.stderr) { - console.error('Error running git-clang-format:', result.stderr); - return 2; - } - - const clangFormatOutput = result.stdout.trim(); - // Bail fast if in fix mode. - if (fix) { - console.log(clangFormatOutput); - return 0; - } - // Detect if there is any complains from clang-format - if ( - clangFormatOutput !== '' && - clangFormatOutput !== 'no modified files to format' && - clangFormatOutput !== 'clang-format did not modify any files' - ) { - console.error(clangFormatOutput); - const fixCmd = 'npm run lint:fix'; - console.error(` - ERROR: please run "${fixCmd}" to format changes in your commit - Note that when running the command locally, please keep your local - main branch and working branch up to date with nodejs/node-addon-api - to exclude un-related complains. - Or you can run "env FORMAT_START=upstream/main ${fixCmd}".`); - return 1; - } -} - -if (require.main === module) { - process.exitCode = main(process.argv.slice(2)); -} diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/conversion.js b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/conversion.js deleted file mode 100755 index 5aef2c3ff..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/conversion.js +++ /dev/null @@ -1,309 +0,0 @@ -#! /usr/bin/env node - -'use strict' - -const fs = require('fs'); -const path = require('path'); - -const args = process.argv.slice(2); -const dir = args[0]; -if (!dir) { - console.log('Usage: node ' + path.basename(__filename) + ' '); - process.exit(1); -} - -const NodeApiVersion = require('../package.json').version; - -const disable = args[1]; -if (disable != "--disable" && dir != "--disable") { - var ConfigFileOperations = { - 'package.json': [ - [ /([ ]*)"dependencies": {/g, '$1"dependencies": {\n$1 "node-addon-api": "' + NodeApiVersion + '",'], - [ /[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, '' ] - ], - 'binding.gyp': [ - [ /([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {' ], - [ /Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);\s+(\w+)\.Reset\((\1)\);\s+\1->SetClassName\((Nan::String::New|Nan::New<(v8::)*String>)\("(.+?)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$6", {'], - [ /Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {' ], - [ /Nan::New\(([\w\d:]+)\)->GetFunction\(\)/g, 'Napi::Function::New(env, $1)' ], - [ /Nan::New\(([\w\d:]+)\)->GetFunction()/g, 'Napi::Function::New(env, $1);' ], - [ /Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)' ], - [ /Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)' ], - - // FunctionTemplate to FunctionReference - [ /Nan::Persistent<(v8::)*FunctionTemplate>/g, 'Napi::FunctionReference' ], - [ /Nan::Persistent<(v8::)*Function>/g, 'Napi::FunctionReference' ], - [ /v8::Local/g, 'Napi::FunctionReference' ], - [ /Local/g, 'Napi::FunctionReference' ], - [ /v8::FunctionTemplate/g, 'Napi::FunctionReference' ], - [ /FunctionTemplate/g, 'Napi::FunctionReference' ], - - - [ /([ ]*)Nan::SetPrototypeMethod\(\w+, "(\w+)", (\w+)\);/g, '$1InstanceMethod("$2", &$3),' ], - [ /([ ]*)(?:\w+\.Reset\(\w+\);\s+)?\(target\)\.Set\("(\w+)",\s*Nan::GetFunction\((\w+)\)\);/gm, - '});\n\n' + - '$1constructor = Napi::Persistent($3);\n' + - '$1constructor.SuppressDestruct();\n' + - '$1target.Set("$2", $3);' ], - - - // TODO: Other attribute combinations - [ /static_cast\(ReadOnly\s*\|\s*DontDelete\)/gm, - 'static_cast(napi_enumerable | napi_configurable)' ], - - [ /([\w\d:<>]+?)::Cast\((.+?)\)/g, '$2.As<$1>()' ], - - [ /\*Nan::Utf8String\(([^)]+)\)/g, '$1->As().Utf8Value().c_str()' ], - [ /Nan::Utf8String +(\w+)\(([^)]+)\)/g, 'std::string $1 = $2.As()' ], - [ /Nan::Utf8String/g, 'std::string' ], - - [ /v8::String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)' ], - [ /String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)' ], - [ /\.length\(\)/g, '.Length()' ], - - [ /Nan::MakeCallback\(([^,]+),[\s\\]+([^,]+),/gm, '$2.MakeCallback($1,' ], - - [ /class\s+(\w+)\s*:\s*public\s+Nan::ObjectWrap/g, 'class $1 : public Napi::ObjectWrap<$1>' ], - [ /(\w+)\(([^\)]*)\)\s*:\s*Nan::ObjectWrap\(\)\s*(,)?/gm, '$1($2) : Napi::ObjectWrap<$1>()$3' ], - - // HandleOKCallback to OnOK - [ /HandleOKCallback/g, 'OnOK' ], - // HandleErrorCallback to OnError - [ /HandleErrorCallback/g, 'OnError' ], - - // ex. .As() to .As() - [ /\.As\(\)/g, '.As()' ], - [ /\.As<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>\(\)/g, '.As()' ], - - // ex. Nan::New(info[0]) to Napi::Number::New(info[0]) - [ /Nan::New<(v8::)*Integer>\((.+?)\)/g, 'Napi::Number::New(env, $2)' ], - [ /Nan::New\(([0-9\.]+)\)/g, 'Napi::Number::New(env, $1)' ], - [ /Nan::New<(v8::)*String>\("(.+?)"\)/g, 'Napi::String::New(env, "$2")' ], - [ /Nan::New\("(.+?)"\)/g, 'Napi::String::New(env, "$1")' ], - [ /Nan::New<(v8::)*(.+?)>\(\)/g, 'Napi::$2::New(env)' ], - [ /Nan::New<(.+?)>\(\)/g, 'Napi::$1::New(env)' ], - [ /Nan::New<(v8::)*(.+?)>\(/g, 'Napi::$2::New(env, ' ], - [ /Nan::New<(.+?)>\(/g, 'Napi::$1::New(env, ' ], - [ /Nan::NewBuffer\(/g, 'Napi::Buffer::New(env, ' ], - // TODO: Properly handle this - [ /Nan::New\(/g, 'Napi::New(env, ' ], - - [ /\.IsInt32\(\)/g, '.IsNumber()' ], - [ /->IsInt32\(\)/g, '.IsNumber()' ], - - - [ /(.+?)->BooleanValue\(\)/g, '$1.As().Value()' ], - [ /(.+?)->Int32Value\(\)/g, '$1.As().Int32Value()' ], - [ /(.+?)->Uint32Value\(\)/g, '$1.As().Uint32Value()' ], - [ /(.+?)->IntegerValue\(\)/g, '$1.As().Int64Value()' ], - [ /(.+?)->NumberValue\(\)/g, '$1.As().DoubleValue()' ], - - // ex. Nan::To(info[0]) to info[0].Value() - [ /Nan::To\((.+?)\)/g, '$2.To()' ], - [ /Nan::To<(Boolean|String|Number|Object|Array|Symbol|Function)>\((.+?)\)/g, '$2.To()' ], - // ex. Nan::To(info[0]) to info[0].As().Value() - [ /Nan::To\((.+?)\)/g, '$1.As().Value()' ], - // ex. Nan::To(info[0]) to info[0].As().Int32Value() - [ /Nan::To\((.+?)\)/g, '$1.As().Int32Value()' ], - // ex. Nan::To(info[0]) to info[0].As().Int32Value() - [ /Nan::To\((.+?)\)/g, '$1.As().Int32Value()' ], - // ex. Nan::To(info[0]) to info[0].As().Uint32Value() - [ /Nan::To\((.+?)\)/g, '$1.As().Uint32Value()' ], - // ex. Nan::To(info[0]) to info[0].As().Int64Value() - [ /Nan::To\((.+?)\)/g, '$1.As().Int64Value()' ], - // ex. Nan::To(info[0]) to info[0].As().FloatValue() - [ /Nan::To\((.+?)\)/g, '$1.As().FloatValue()' ], - // ex. Nan::To(info[0]) to info[0].As().DoubleValue() - [ /Nan::To\((.+?)\)/g, '$1.As().DoubleValue()' ], - - [ /Nan::New\((\w+)\)->HasInstance\((\w+)\)/g, '$2.InstanceOf($1.Value())' ], - - [ /Nan::Has\(([^,]+),\s*/gm, '($1).Has(' ], - [ /\.Has\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Has($1)' ], - [ /\.Has\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Has($1)' ], - - [ /Nan::Get\(([^,]+),\s*/gm, '($1).Get(' ], - [ /\.Get\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Get($1)' ], - [ /\.Get\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Get($1)' ], - - [ /Nan::Set\(([^,]+),\s*/gm, '($1).Set(' ], - [ /\.Set\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\s*,/gm, '.Set($1,' ], - [ /\.Set\([\s|\\]*Nan::New\(([^)]+)\)\s*,/gm, '.Set($1,' ], - - - // ex. node::Buffer::HasInstance(info[0]) to info[0].IsBuffer() - [ /node::Buffer::HasInstance\((.+?)\)/g, '$1.IsBuffer()' ], - // ex. node::Buffer::Length(info[0]) to info[0].Length() - [ /node::Buffer::Length\((.+?)\)/g, '$1.As>().Length()' ], - // ex. node::Buffer::Data(info[0]) to info[0].Data() - [ /node::Buffer::Data\((.+?)\)/g, '$1.As>().Data()' ], - [ /Nan::CopyBuffer\(/g, 'Napi::Buffer::Copy(env, ' ], - - // Nan::AsyncQueueWorker(worker) - [ /Nan::AsyncQueueWorker\((.+)\);/g, '$1.Queue();' ], - [ /Nan::(Undefined|Null|True|False)\(\)/g, 'env.$1()' ], - - // Nan::ThrowError(error) to Napi::Error::New(env, error).ThrowAsJavaScriptException() - [ /([ ]*)return Nan::Throw(\w*?)Error\((.+?)\);/g, '$1Napi::$2Error::New(env, $3).ThrowAsJavaScriptException();\n$1return env.Null();' ], - [ /Nan::Throw(\w*?)Error\((.+?)\);\n(\s*)return;/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n$3return env.Null();' ], - [ /Nan::Throw(\w*?)Error\((.+?)\);/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n' ], - // Nan::RangeError(error) to Napi::RangeError::New(env, error) - [ /Nan::(\w*?)Error\((.+)\)/g, 'Napi::$1Error::New(env, $2)' ], - - [ /Nan::Set\((.+?),\n* *(.+?),\n* *(.+?),\n* *(.+?)\)/g, '$1.Set($2, $3, $4)' ], - - [ /Nan::(Escapable)?HandleScope\s+(\w+)\s*;/g, 'Napi::$1HandleScope $2(env);' ], - [ /Nan::(Escapable)?HandleScope/g, 'Napi::$1HandleScope' ], - [ /Nan::ForceSet\(([^,]+), ?/g, '$1->DefineProperty(' ], - [ /\.ForceSet\(Napi::String::New\(env, "(\w+)"\),\s*?/g, '.DefineProperty("$1", ' ], - // [ /Nan::GetPropertyNames\(([^,]+)\)/, '$1->GetPropertyNames()' ], - [ /Nan::Equals\(([^,]+),/g, '$1.StrictEquals(' ], - - - [ /(.+)->Set\(/g, '$1.Set\(' ], - - - [ /Nan::Callback/g, 'Napi::FunctionReference' ], - - - [ /Nan::Persistent/g, 'Napi::ObjectReference' ], - [ /Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target/g, 'Napi::Env& env, Napi::Object& target' ], - - [ /(\w+)\*\s+(\w+)\s*=\s*Nan::ObjectWrap::Unwrap<\w+>\(info\.This\(\)\);/g, '$1* $2 = this;' ], - [ /Nan::ObjectWrap::Unwrap<(\w+)>\((.*)\);/g, '$2.Unwrap<$1>();' ], - - [ /Nan::NAN_METHOD_RETURN_TYPE/g, 'void' ], - [ /NAN_INLINE/g, 'inline' ], - - [ /Nan::NAN_METHOD_ARGS_TYPE/g, 'const Napi::CallbackInfo&' ], - [ /NAN_METHOD\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], - [ /static\s*NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)' ], - [ /NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)' ], - [ /static\s*NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)' ], - [ /NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)' ], - [ /void Init\((v8::)*Local<(v8::)*Object> exports\)/g, 'Napi::Object Init(Napi::Env env, Napi::Object exports)' ], - [ /NAN_MODULE_INIT\(([\w\d:]+?)\);/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports);' ], - [ /NAN_MODULE_INIT\(([\w\d:]+?)\)/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports)' ], - - - [ /::(Init(?:ialize)?)\(target\)/g, '::$1(env, target, module)' ], - [ /constructor_template/g, 'constructor' ], - - [ /Nan::FunctionCallbackInfo<(v8::)?Value>[ ]*& [ ]*info\)[ ]*{\n*([ ]*)/gm, 'Napi::CallbackInfo& info) {\n$2Napi::Env env = info.Env();\n$2' ], - [ /Nan::FunctionCallbackInfo<(v8::)*Value>\s*&\s*info\);/g, 'Napi::CallbackInfo& info);' ], - [ /Nan::FunctionCallbackInfo<(v8::)*Value>\s*&/g, 'Napi::CallbackInfo&' ], - - [ /Buffer::HasInstance\(([^)]+)\)/g, '$1.IsBuffer()' ], - - [ /info\[(\d+)\]->/g, 'info[$1].' ], - [ /info\[([\w\d]+)\]->/g, 'info[$1].' ], - [ /info\.This\(\)->/g, 'info.This().' ], - [ /->Is(Object|String|Int32|Number)\(\)/g, '.Is$1()' ], - [ /info.GetReturnValue\(\).SetUndefined\(\)/g, 'return env.Undefined()' ], - [ /info\.GetReturnValue\(\)\.Set\(((\n|.)+?)\);/g, 'return $1;' ], - - - // ex. Local to Napi::Value - [ /v8::Local/g, 'Napi::$1' ], - [ /Local<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>/g, 'Napi::$1' ], - - // Declare an env in helper functions that take a Napi::Value - [ /(\w+)\(Napi::Value (\w+)(,\s*[^\()]+)?\)\s*{\n*([ ]*)/gm, '$1(Napi::Value $2$3) {\n$4Napi::Env env = $2.Env();\n$4' ], - - // delete #include and/or - [ /#include +(<|")(?:node|nan).h("|>)/g, "#include $1napi.h$2\n#include $1uv.h$2" ], - // NODE_MODULE to NODE_API_MODULE - [ /NODE_MODULE/g, 'NODE_API_MODULE' ], - [ /Nan::/g, 'Napi::' ], - [ /nan.h/g, 'napi.h' ], - - // delete .FromJust() - [ /\.FromJust\(\)/g, '' ], - // delete .ToLocalCheck() - [ /\.ToLocalChecked\(\)/g, '' ], - [ /^.*->SetInternalFieldCount\(.*$/gm, '' ], - - // replace using node; and/or using v8; to using Napi; - [ /using (node|v8);/g, 'using Napi;' ], - [ /using namespace (node|Nan|v8);/g, 'using namespace Napi;' ], - // delete using v8::Local; - [ /using v8::Local;\n/g, '' ], - // replace using v8::XXX; with using Napi::XXX - [ /using v8::([A-Za-z]+);/g, 'using Napi::$1;' ], - -]; - -var paths = listFiles(dir); -paths.forEach(function(dirEntry) { - var filename = dirEntry.split('\\').pop().split('/').pop(); - - // Check whether the file is a source file or a config file - // then execute function accordingly - var sourcePattern = /.+\.h|.+\.cc|.+\.cpp/; - if (sourcePattern.test(filename)) { - convertFile(dirEntry, SourceFileOperations); - } else if (ConfigFileOperations[filename] != null) { - convertFile(dirEntry, ConfigFileOperations[filename]); - } -}); - -function listFiles(dir, filelist) { - var files = fs.readdirSync(dir); - filelist = filelist || []; - files.forEach(function(file) { - if (file === 'node_modules') { - return - } - - if (fs.statSync(path.join(dir, file)).isDirectory()) { - filelist = listFiles(path.join(dir, file), filelist); - } else { - filelist.push(path.join(dir, file)); - } - }); - return filelist; -} - -function convert(content, operations) { - for (let i = 0; i < operations.length; i ++) { - let operation = operations[i]; - content = content.replace(operation[0], operation[1]); - } - return content; -} - -function convertFile(fileName, operations) { - fs.readFile(fileName, "utf-8", function (err, file) { - if (err) throw err; - - file = convert(file, operations); - - fs.writeFile(fileName, file, function(err){ - if (err) throw err; - }); - }); -} diff --git a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/eslint-format.js b/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/eslint-format.js deleted file mode 100644 index 5938835d8..000000000 --- a/.yarn/unplugged/node-addon-api-npm-4.3.0-a07a1232df/node_modules/node-addon-api/tools/eslint-format.js +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env node - -const spawn = require('child_process').spawnSync; - -const filesToCheck = '*.js'; -const FORMAT_START = process.env.FORMAT_START || 'main'; - -function main (args) { - let fix = false; - while (args.length > 0) { - switch (args[0]) { - case '-f': - case '--fix': - fix = true; - break; - default: - } - args.shift(); - } - - // Check js files that change on unstaged file - const fileUnStaged = spawn( - 'git', - ['diff', '--name-only', FORMAT_START, filesToCheck], - { - encoding: 'utf-8' - } - ); - - // Check js files that change on staged file - const fileStaged = spawn( - 'git', - ['diff', '--name-only', '--cached', FORMAT_START, filesToCheck], - { - encoding: 'utf-8' - } - ); - - const options = [ - ...fileStaged.stdout.split('\n').filter((f) => f !== ''), - ...fileUnStaged.stdout.split('\n').filter((f) => f !== '') - ]; - - if (fix) { - options.push('--fix'); - } - const result = spawn('node_modules/.bin/eslint', [...options], { - encoding: 'utf-8' - }); - - if (result.status === 1) { - console.error('Eslint error:', result.stdout); - const fixCmd = 'npm run lint:fix'; - console.error(`ERROR: please run "${fixCmd}" to format changes in your commit - Note that when running the command locally, please keep your local - main branch and working branch up to date with nodejs/node-addon-api - to exclude un-related complains. - Or you can run "env FORMAT_START=upstream/main ${fixCmd}". - Also fix JS files by yourself if necessary.`); - return 1; - } - - if (result.stderr) { - console.error('Error running eslint:', result.stderr); - return 2; - } -} - -if (require.main === module) { - process.exitCode = main(process.argv.slice(2)); -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/.ready b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/LICENSE.md b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/LICENSE.md deleted file mode 100644 index e2fad6667..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2017 Node.js API collaborators ------------------------------------ - -*Node.js API collaborators listed at * - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/README.md b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/README.md deleted file mode 100644 index 6a79c917e..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/README.md +++ /dev/null @@ -1,317 +0,0 @@ -NOTE: The default branch has been renamed! -master is now named main - -If you have a local clone, you can update it by running: - -```shell -git branch -m master main -git fetch origin -git branch -u origin/main main -``` - -# **node-addon-api module** -This module contains **header-only C++ wrapper classes** which simplify -the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) -provided by Node.js when using C++. It provides a C++ object model -and exception handling semantics with low overhead. - -There are three options for implementing addons: Node-API, nan, or direct -use of internal V8, libuv, and Node.js libraries. Unless there is a need for -direct access to functionality that is not exposed by Node-API as outlined -in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html) -in Node.js core, use Node-API. Refer to -[C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html) -for more information on Node-API. - -Node-API is an ABI stable C interface provided by Node.js for building native -addons. It is independent of the underlying JavaScript runtime (e.g. V8 or ChakraCore) -and is maintained as part of Node.js itself. It is intended to insulate -native addons from changes in the underlying JavaScript engine and allow -modules compiled for one version to run on later versions of Node.js without -recompilation. - -The `node-addon-api` module, which is not part of Node.js, preserves the benefits -of the Node-API as it consists only of inline code that depends only on the stable API -provided by Node-API. As such, modules built against one version of Node.js -using node-addon-api should run without having to be rebuilt with newer versions -of Node.js. - -It is important to remember that *other* Node.js interfaces such as -`libuv` (included in a project via `#include `) are not ABI-stable across -Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api` -exclusively and build against a version of Node.js that includes an -implementation of Node-API (meaning an active LTS version of Node.js) in -order to benefit from ABI stability across Node.js major versions. Node.js -provides an [ABI stability guide][] containing a detailed explanation of ABI -stability in general, and the Node-API ABI stability guarantee in particular. - -As new APIs are added to Node-API, node-addon-api must be updated to provide -wrappers for those new APIs. For this reason, node-addon-api provides -methods that allow callers to obtain the underlying Node-API handles so -direct calls to Node-API and the use of the objects/methods provided by -node-addon-api can be used together. For example, in order to be able -to use an API for which the node-addon-api does not yet provide a wrapper. - -APIs exposed by node-addon-api are generally used to create and -manipulate JavaScript values. Concepts and operations generally map -to ideas specified in the **ECMA262 Language Specification**. - -The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an -excellent orientation and tips for developers just getting started with Node-API -and node-addon-api. - -- **[Setup](#setup)** -- **[API Documentation](#api)** -- **[Examples](#examples)** -- **[Tests](#tests)** -- **[More resource and info about native Addons](#resources)** -- **[Badges](#badges)** -- **[Code of Conduct](CODE_OF_CONDUCT.md)** -- **[Contributors](#contributors)** -- **[License](#license)** - -## **Current version: 5.1.0** - -(See [CHANGELOG.md](CHANGELOG.md) for complete Changelog) - -[![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/) - - - -node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions. -This allows addons built with it to run with Node.js versions which support the targeted Node-API version. -**However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that -every year there will be a new major which drops support for the Node.js LTS version which has gone out of service. - -The oldest Node.js version supported by the current version of node-addon-api is Node.js 14.x. - -## Setup - - [Installation and usage](doc/setup.md) - - [node-gyp](doc/node-gyp.md) - - [cmake-js](doc/cmake-js.md) - - [Conversion tool](doc/conversion-tool.md) - - [Checker tool](doc/checker-tool.md) - - [Generator](doc/generator.md) - - [Prebuild tools](doc/prebuild_tools.md) - - - -### **API Documentation** - -The following is the documentation for node-addon-api. - - - [Full Class Hierarchy](doc/hierarchy.md) - - [Addon Structure](doc/addon.md) - - Data Types: - - [Env](doc/env.md) - - [CallbackInfo](doc/callbackinfo.md) - - [Reference](doc/reference.md) - - [Value](doc/value.md) - - [Name](doc/name.md) - - [Symbol](doc/symbol.md) - - [String](doc/string.md) - - [Number](doc/number.md) - - [Date](doc/date.md) - - [BigInt](doc/bigint.md) - - [Boolean](doc/boolean.md) - - [External](doc/external.md) - - [Object](doc/object.md) - - [Array](doc/array.md) - - [ObjectReference](doc/object_reference.md) - - [PropertyDescriptor](doc/property_descriptor.md) - - [Function](doc/function.md) - - [FunctionReference](doc/function_reference.md) - - [ObjectWrap](doc/object_wrap.md) - - [ClassPropertyDescriptor](doc/class_property_descriptor.md) - - [Buffer](doc/buffer.md) - - [ArrayBuffer](doc/array_buffer.md) - - [TypedArray](doc/typed_array.md) - - [TypedArrayOf](doc/typed_array_of.md) - - [DataView](doc/dataview.md) - - [Error Handling](doc/error_handling.md) - - [Error](doc/error.md) - - [TypeError](doc/type_error.md) - - [RangeError](doc/range_error.md) - - [Object Lifetime Management](doc/object_lifetime_management.md) - - [HandleScope](doc/handle_scope.md) - - [EscapableHandleScope](doc/escapable_handle_scope.md) - - [Memory Management](doc/memory_management.md) - - [Async Operations](doc/async_operations.md) - - [AsyncWorker](doc/async_worker.md) - - [AsyncContext](doc/async_context.md) - - [AsyncWorker Variants](doc/async_worker_variants.md) - - [Thread-safe Functions](doc/threadsafe.md) - - [ThreadSafeFunction](doc/threadsafe_function.md) - - [TypedThreadSafeFunction](doc/typed_threadsafe_function.md) - - [Promises](doc/promises.md) - - [Version management](doc/version_management.md) - - - -### **Examples** - -Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)** - -- **[Hello World](https://github.com/nodejs/node-addon-examples/tree/HEAD/1_hello_world/node-addon-api)** -- **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/HEAD/2_function_arguments/node-addon-api)** -- **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/HEAD/3_callbacks/node-addon-api)** -- **[Object factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/4_object_factory/node-addon-api)** -- **[Function factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/5_function_factory/node-addon-api)** -- **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/HEAD/6_object_wrap/node-addon-api)** -- **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/HEAD/7_factory_wrap/node-addon-api)** -- **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/HEAD/8_passing_wrapped/node-addon-api)** - - - -### **Tests** - -To run the **node-addon-api** tests do: - -``` -npm install -npm test -``` - -To avoid testing the deprecated portions of the API run -``` -npm install -npm test --disable-deprecated -``` - -To run the tests targeting a specific version of Node-API run -``` -npm install -export NAPI_VERSION=X -npm test --NAPI_VERSION=X -``` - -where X is the version of Node-API you want to target. - -To run a specific unit test, filter conditions are available - -**Example:** - compile and run only tests on objectwrap.cc and objectwrap.js - ``` - npm run unit --filter=objectwrap - ``` - -Multiple unit tests cane be selected with wildcards - -**Example:** -compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc - ``` - npm run unit --filter=*reference - ``` - -Multiple filter conditions can be joined to broaden the test selection - -**Example:** - compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file - npm run unit --filter='*function objectwrap' - -### **Debug** - -To run the **node-addon-api** tests with `--debug` option: - -``` -npm run-script dev -``` - -If you want a faster build, you might use the following option: - -``` -npm run-script dev:incremental -``` - -Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)** - -### **Benchmarks** - -You can run the available benchmarks using the following command: - -``` -npm run-script benchmark -``` - -See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks. - - - -### **More resource and info about native Addons** -- **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)** -- **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)** -- **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)** -- **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)** - -As node-addon-api's core mission is to expose the plain C Node-API as C++ -wrappers, tools that facilitate n-api/node-addon-api providing more -convenient patterns for developing a Node.js add-on with n-api/node-addon-api -can be published to NPM as standalone packages. It is also recommended to tag -such packages with `node-addon-api` to provide more visibility to the community. - -Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api). - - - -### **Other bindings** - -- **[napi-rs](https://napi.rs)** - (`Rust`) - - - -### **Badges** - -The use of badges is recommended to indicate the minimum version of Node-API -required for the module. This helps to determine which Node.js major versions are -supported. Addon maintainers can consult the [Node-API support matrix][] to determine -which Node.js versions provide a given Node-API version. The following badges are -available: - -![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg) -![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg) -![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg) -![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg) -![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg) -![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg) -![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg) -![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg) -![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg) - -## **Contributing** - -We love contributions from the community to **node-addon-api**! -See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module. - - - -## Team members - -### Active -| Name | GitHub Link | -| ------------------- | ----------------------------------------------------- | -| Anna Henningsen | [addaleax](https://github.com/addaleax) | -| Chengzhong Wu | [legendecas](https://github.com/legendecas) | -| Jack Xia | [JckXia](https://github.com/JckXia) | -| Kevin Eady | [KevinEady](https://github.com/KevinEady) | -| Michael Dawson | [mhdawson](https://github.com/mhdawson) | -| Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) | -| Vladimir Morozov | [vmoroz](https://github.com/vmoroz) | - -### Emeritus -| Name | GitHub Link | -| ------------------- | ----------------------------------------------------- | -| Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) | -| Benjamin Byholm | [kkoopa](https://github.com/kkoopa) | -| Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) | -| Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) | -| Jason Ginchereau | [jasongin](https://github.com/jasongin) | -| Jim Schlight | [jschlight](https://github.com/jschlight) | -| Sampson Gao | [sampsongao](https://github.com/sampsongao) | -| Taylor Woll | [boingoing](https://github.com/boingoing) | - - - -Licensed under [MIT](./LICENSE.md) - -[ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/ -[Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/common.gypi b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/common.gypi deleted file mode 100644 index 9be254f0b..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/common.gypi +++ /dev/null @@ -1,21 +0,0 @@ -{ - 'variables': { - 'NAPI_VERSION%': " -inline PropertyDescriptor PropertyDescriptor::Accessor( - const char* utf8name, - Getter getter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({getter, nullptr}); - - return PropertyDescriptor({utf8name, - nullptr, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - const std::string& utf8name, - Getter getter, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), getter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - napi_value name, - Getter getter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({getter, nullptr}); - - return PropertyDescriptor({nullptr, - name, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Name name, Getter getter, napi_property_attributes attributes, void* data) { - napi_value nameValue = name; - return PropertyDescriptor::Accessor(nameValue, getter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::AccessorCallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({getter, setter, nullptr}); - - return PropertyDescriptor({utf8name, - nullptr, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), getter, setter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - napi_value name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* /*data*/) { - using CbData = details::AccessorCallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({getter, setter, nullptr}); - - return PropertyDescriptor({nullptr, - name, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - napi_value nameValue = name; - return PropertyDescriptor::Accessor( - nameValue, getter, setter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - const char* utf8name, - Callable cb, - napi_property_attributes attributes, - void* /*data*/) { - using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({cb, nullptr}); - - return PropertyDescriptor({utf8name, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - const std::string& utf8name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return Function(utf8name.c_str(), cb, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - napi_value name, - Callable cb, - napi_property_attributes attributes, - void* /*data*/) { - using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); - using CbData = details::CallbackData; - // TODO: Delete when the function is destroyed - auto callbackData = new CbData({cb, nullptr}); - - return PropertyDescriptor({nullptr, - name, - CbData::Wrapper, - nullptr, - nullptr, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - Name name, Callable cb, napi_property_attributes attributes, void* data) { - napi_value nameValue = name; - return PropertyDescriptor::Function(nameValue, cb, attributes, data); -} - -#endif // !SRC_NAPI_INL_DEPRECATED_H_ diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/napi-inl.h b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/napi-inl.h deleted file mode 100644 index 3ddc1baa8..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/napi-inl.h +++ /dev/null @@ -1,6303 +0,0 @@ -#ifndef SRC_NAPI_INL_H_ -#define SRC_NAPI_INL_H_ - -//////////////////////////////////////////////////////////////////////////////// -// Node-API C++ Wrapper Classes -// -// Inline header-only implementations for "Node-API" ABI-stable C APIs for -// Node.js. -//////////////////////////////////////////////////////////////////////////////// - -// Note: Do not include this file directly! Include "napi.h" instead. - -#include -#include -#include -#include -#include - -namespace Napi { - -#ifdef NAPI_CPP_CUSTOM_NAMESPACE -namespace NAPI_CPP_CUSTOM_NAMESPACE { -#endif - -// Helpers to handle functions exposed from C++. -namespace details { - -// Attach a data item to an object and delete it when the object gets -// garbage-collected. -// TODO: Replace this code with `napi_add_finalizer()` whenever it becomes -// available on all supported versions of Node.js. -template -inline napi_status AttachData(napi_env env, - napi_value obj, - FreeType* data, - napi_finalize finalizer = nullptr, - void* hint = nullptr) { - napi_status status; - if (finalizer == nullptr) { - finalizer = [](napi_env /*env*/, void* data, void* /*hint*/) { - delete static_cast(data); - }; - } -#if (NAPI_VERSION < 5) - napi_value symbol, external; - status = napi_create_symbol(env, nullptr, &symbol); - if (status == napi_ok) { - status = napi_create_external(env, data, finalizer, hint, &external); - if (status == napi_ok) { - napi_property_descriptor desc = {nullptr, - symbol, - nullptr, - nullptr, - nullptr, - external, - napi_default, - nullptr}; - status = napi_define_properties(env, obj, 1, &desc); - } - } -#else // NAPI_VERSION >= 5 - status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr); -#endif - return status; -} - -// For use in JS to C++ callback wrappers to catch any Napi::Error exceptions -// and rethrow them as JavaScript exceptions before returning from the callback. -template -inline napi_value WrapCallback(Callable callback) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - return callback(); - } catch (const Error& e) { - e.ThrowAsJavaScriptException(); - return nullptr; - } -#else // NAPI_CPP_EXCEPTIONS - // When C++ exceptions are disabled, errors are immediately thrown as JS - // exceptions, so there is no need to catch and rethrow them here. - return callback(); -#endif // NAPI_CPP_EXCEPTIONS -} - -// For use in JS to C++ void callback wrappers to catch any Napi::Error -// exceptions and rethrow them as JavaScript exceptions before returning from -// the callback. -template -inline void WrapVoidCallback(Callable callback) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - callback(); - } catch (const Error& e) { - e.ThrowAsJavaScriptException(); - } -#else // NAPI_CPP_EXCEPTIONS - // When C++ exceptions are disabled, errors are immediately thrown as JS - // exceptions, so there is no need to catch and rethrow them here. - callback(); -#endif // NAPI_CPP_EXCEPTIONS -} - -template -struct CallbackData { - static inline napi_value Wrapper(napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - CallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->callback(callbackInfo); - }); - } - - Callable callback; - void* data; -}; - -template -struct CallbackData { - static inline napi_value Wrapper(napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - CallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->callback(callbackInfo); - return nullptr; - }); - } - - Callable callback; - void* data; -}; - -template -napi_value TemplatedVoidCallback(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - Callback(cbInfo); - return nullptr; - }); -} - -template -napi_value TemplatedCallback(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - return Callback(cbInfo); - }); -} - -template -napi_value TemplatedInstanceCallback(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - T* instance = T::Unwrap(cbInfo.This().As()); - return (instance->*UnwrapCallback)(cbInfo); - }); -} - -template -napi_value TemplatedInstanceVoidCallback(napi_env env, napi_callback_info info) - NAPI_NOEXCEPT { - return details::WrapCallback([&] { - CallbackInfo cbInfo(env, info); - T* instance = T::Unwrap(cbInfo.This().As()); - (instance->*UnwrapCallback)(cbInfo); - return nullptr; - }); -} - -template -struct FinalizeData { - static inline void Wrapper(napi_env env, - void* data, - void* finalizeHint) NAPI_NOEXCEPT { - WrapVoidCallback([&] { - FinalizeData* finalizeData = static_cast(finalizeHint); - finalizeData->callback(Env(env), static_cast(data)); - delete finalizeData; - }); - } - - static inline void WrapperWithHint(napi_env env, - void* data, - void* finalizeHint) NAPI_NOEXCEPT { - WrapVoidCallback([&] { - FinalizeData* finalizeData = static_cast(finalizeHint); - finalizeData->callback( - Env(env), static_cast(data), finalizeData->hint); - delete finalizeData; - }); - } - - Finalizer callback; - Hint* hint; -}; - -#if (NAPI_VERSION > 3 && !defined(__wasm32__)) -template , - typename FinalizerDataType = void> -struct ThreadSafeFinalize { - static inline void Wrapper(napi_env env, - void* rawFinalizeData, - void* /* rawContext */) { - if (rawFinalizeData == nullptr) return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env)); - delete finalizeData; - } - - static inline void FinalizeWrapperWithData(napi_env env, - void* rawFinalizeData, - void* /* rawContext */) { - if (rawFinalizeData == nullptr) return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env), finalizeData->data); - delete finalizeData; - } - - static inline void FinalizeWrapperWithContext(napi_env env, - void* rawFinalizeData, - void* rawContext) { - if (rawFinalizeData == nullptr) return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback(Env(env), static_cast(rawContext)); - delete finalizeData; - } - - static inline void FinalizeFinalizeWrapperWithDataAndContext( - napi_env env, void* rawFinalizeData, void* rawContext) { - if (rawFinalizeData == nullptr) return; - - ThreadSafeFinalize* finalizeData = - static_cast(rawFinalizeData); - finalizeData->callback( - Env(env), finalizeData->data, static_cast(rawContext)); - delete finalizeData; - } - - FinalizerDataType* data; - Finalizer callback; -}; - -template -inline typename std::enable_if(nullptr)>::type -CallJsWrapper(napi_env env, napi_value jsCallback, void* context, void* data) { - call(env, - Function(env, jsCallback), - static_cast(context), - static_cast(data)); -} - -template -inline typename std::enable_if(nullptr)>::type -CallJsWrapper(napi_env env, - napi_value jsCallback, - void* /*context*/, - void* /*data*/) { - if (jsCallback != nullptr) { - Function(env, jsCallback).Call(0, nullptr); - } -} - -#if NAPI_VERSION > 4 - -template -napi_value DefaultCallbackWrapper(napi_env /*env*/, std::nullptr_t /*cb*/) { - return nullptr; -} - -template -napi_value DefaultCallbackWrapper(napi_env /*env*/, Napi::Function cb) { - return cb; -} - -#else -template -napi_value DefaultCallbackWrapper(napi_env env, Napi::Function cb) { - if (cb.IsEmpty()) { - return TSFN::EmptyFunctionFactory(env); - } - return cb; -} -#endif // NAPI_VERSION > 4 -#endif // NAPI_VERSION > 3 && !defined(__wasm32__) - -template -struct AccessorCallbackData { - static inline napi_value GetterWrapper(napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - AccessorCallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->getterCallback(callbackInfo); - }); - } - - static inline napi_value SetterWrapper(napi_env env, - napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - AccessorCallbackData* callbackData = - static_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->setterCallback(callbackInfo); - return nullptr; - }); - } - - Getter getterCallback; - Setter setterCallback; - void* data; -}; - -} // namespace details - -#ifndef NODE_ADDON_API_DISABLE_DEPRECATED -#include "napi-inl.deprecated.h" -#endif // !NODE_ADDON_API_DISABLE_DEPRECATED - -//////////////////////////////////////////////////////////////////////////////// -// Module registration -//////////////////////////////////////////////////////////////////////////////// - -// Register an add-on based on an initializer function. -#define NODE_API_MODULE(modname, regfunc) \ - static napi_value __napi_##regfunc(napi_env env, napi_value exports) { \ - return Napi::RegisterModule(env, exports, regfunc); \ - } \ - NAPI_MODULE(modname, __napi_##regfunc) - -// Register an add-on based on a subclass of `Addon` with a custom Node.js -// module name. -#define NODE_API_NAMED_ADDON(modname, classname) \ - static napi_value __napi_##classname(napi_env env, napi_value exports) { \ - return Napi::RegisterModule(env, exports, &classname::Init); \ - } \ - NAPI_MODULE(modname, __napi_##classname) - -// Register an add-on based on a subclass of `Addon` with the Node.js module -// name given by node-gyp from the `target_name` in binding.gyp. -#define NODE_API_ADDON(classname) \ - NODE_API_NAMED_ADDON(NODE_GYP_MODULE_NAME, classname) - -// Adapt the NAPI_MODULE registration function: -// - Wrap the arguments in NAPI wrappers. -// - Catch any NAPI errors and rethrow as JS exceptions. -inline napi_value RegisterModule(napi_env env, - napi_value exports, - ModuleRegisterCallback registerCallback) { - return details::WrapCallback([&] { - return napi_value( - registerCallback(Napi::Env(env), Napi::Object(env, exports))); - }); -} - -//////////////////////////////////////////////////////////////////////////////// -// Maybe class -//////////////////////////////////////////////////////////////////////////////// - -template -bool Maybe::IsNothing() const { - return !_has_value; -} - -template -bool Maybe::IsJust() const { - return _has_value; -} - -template -void Maybe::Check() const { - NAPI_CHECK(IsJust(), "Napi::Maybe::Check", "Maybe value is Nothing."); -} - -template -T Maybe::Unwrap() const { - NAPI_CHECK(IsJust(), "Napi::Maybe::Unwrap", "Maybe value is Nothing."); - return _value; -} - -template -T Maybe::UnwrapOr(const T& default_value) const { - return _has_value ? _value : default_value; -} - -template -bool Maybe::UnwrapTo(T* out) const { - if (IsJust()) { - *out = _value; - return true; - }; - return false; -} - -template -bool Maybe::operator==(const Maybe& other) const { - return (IsJust() == other.IsJust()) && - (!IsJust() || Unwrap() == other.Unwrap()); -} - -template -bool Maybe::operator!=(const Maybe& other) const { - return !operator==(other); -} - -template -Maybe::Maybe() : _has_value(false) {} - -template -Maybe::Maybe(const T& t) : _has_value(true), _value(t) {} - -template -inline Maybe Nothing() { - return Maybe(); -} - -template -inline Maybe Just(const T& t) { - return Maybe(t); -} - -//////////////////////////////////////////////////////////////////////////////// -// Env class -//////////////////////////////////////////////////////////////////////////////// - -inline Env::Env(napi_env env) : _env(env) {} - -inline Env::operator napi_env() const { - return _env; -} - -inline Object Env::Global() const { - napi_value value; - napi_status status = napi_get_global(*this, &value); - NAPI_THROW_IF_FAILED(*this, status, Object()); - return Object(*this, value); -} - -inline Value Env::Undefined() const { - napi_value value; - napi_status status = napi_get_undefined(*this, &value); - NAPI_THROW_IF_FAILED(*this, status, Value()); - return Value(*this, value); -} - -inline Value Env::Null() const { - napi_value value; - napi_status status = napi_get_null(*this, &value); - NAPI_THROW_IF_FAILED(*this, status, Value()); - return Value(*this, value); -} - -inline bool Env::IsExceptionPending() const { - bool result; - napi_status status = napi_is_exception_pending(_env, &result); - if (status != napi_ok) - result = false; // Checking for a pending exception shouldn't throw. - return result; -} - -inline Error Env::GetAndClearPendingException() const { - napi_value value; - napi_status status = napi_get_and_clear_last_exception(_env, &value); - if (status != napi_ok) { - // Don't throw another exception when failing to get the exception! - return Error(); - } - return Error(_env, value); -} - -inline MaybeOrValue Env::RunScript(const char* utf8script) const { - String script = String::New(_env, utf8script); - return RunScript(script); -} - -inline MaybeOrValue Env::RunScript(const std::string& utf8script) const { - return RunScript(utf8script.c_str()); -} - -inline MaybeOrValue Env::RunScript(String script) const { - napi_value result; - napi_status status = napi_run_script(_env, script, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Value(_env, result), Napi::Value); -} - -#if NAPI_VERSION > 2 -template -void Env::CleanupHook::Wrapper(void* data) NAPI_NOEXCEPT { - auto* cleanupData = - static_cast::CleanupData*>( - data); - cleanupData->hook(); - delete cleanupData; -} - -template -void Env::CleanupHook::WrapperWithArg(void* data) NAPI_NOEXCEPT { - auto* cleanupData = - static_cast::CleanupData*>( - data); - cleanupData->hook(static_cast(cleanupData->arg)); - delete cleanupData; -} -#endif // NAPI_VERSION > 2 - -#if NAPI_VERSION > 5 -template fini> -inline void Env::SetInstanceData(T* data) const { - napi_status status = napi_set_instance_data( - _env, - data, - [](napi_env env, void* data, void*) { fini(env, static_cast(data)); }, - nullptr); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -template fini> -inline void Env::SetInstanceData(DataType* data, HintType* hint) const { - napi_status status = napi_set_instance_data( - _env, - data, - [](napi_env env, void* data, void* hint) { - fini(env, static_cast(data), static_cast(hint)); - }, - hint); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -template -inline T* Env::GetInstanceData() const { - void* data = nullptr; - - napi_status status = napi_get_instance_data(_env, &data); - NAPI_THROW_IF_FAILED(_env, status, nullptr); - - return static_cast(data); -} - -template -void Env::DefaultFini(Env, T* data) { - delete data; -} - -template -void Env::DefaultFiniWithHint(Env, DataType* data, HintType*) { - delete data; -} -#endif // NAPI_VERSION > 5 - -//////////////////////////////////////////////////////////////////////////////// -// Value class -//////////////////////////////////////////////////////////////////////////////// - -inline Value::Value() : _env(nullptr), _value(nullptr) {} - -inline Value::Value(napi_env env, napi_value value) - : _env(env), _value(value) {} - -inline Value::operator napi_value() const { - return _value; -} - -inline bool Value::operator==(const Value& other) const { - return StrictEquals(other); -} - -inline bool Value::operator!=(const Value& other) const { - return !this->operator==(other); -} - -inline bool Value::StrictEquals(const Value& other) const { - bool result; - napi_status status = napi_strict_equals(_env, *this, other, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline Napi::Env Value::Env() const { - return Napi::Env(_env); -} - -inline bool Value::IsEmpty() const { - return _value == nullptr; -} - -inline napi_valuetype Value::Type() const { - if (IsEmpty()) { - return napi_undefined; - } - - napi_valuetype type; - napi_status status = napi_typeof(_env, _value, &type); - NAPI_THROW_IF_FAILED(_env, status, napi_undefined); - return type; -} - -inline bool Value::IsUndefined() const { - return Type() == napi_undefined; -} - -inline bool Value::IsNull() const { - return Type() == napi_null; -} - -inline bool Value::IsBoolean() const { - return Type() == napi_boolean; -} - -inline bool Value::IsNumber() const { - return Type() == napi_number; -} - -#if NAPI_VERSION > 5 -inline bool Value::IsBigInt() const { - return Type() == napi_bigint; -} -#endif // NAPI_VERSION > 5 - -#if (NAPI_VERSION > 4) -inline bool Value::IsDate() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_date(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} -#endif - -inline bool Value::IsString() const { - return Type() == napi_string; -} - -inline bool Value::IsSymbol() const { - return Type() == napi_symbol; -} - -inline bool Value::IsArray() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_array(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsArrayBuffer() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_arraybuffer(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsTypedArray() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_typedarray(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsObject() const { - return Type() == napi_object || IsFunction(); -} - -inline bool Value::IsFunction() const { - return Type() == napi_function; -} - -inline bool Value::IsPromise() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_promise(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsDataView() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_dataview(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsBuffer() const { - if (IsEmpty()) { - return false; - } - - bool result; - napi_status status = napi_is_buffer(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -inline bool Value::IsExternal() const { - return Type() == napi_external; -} - -template -inline T Value::As() const { - return T(_env, _value); -} - -inline MaybeOrValue Value::ToBoolean() const { - napi_value result; - napi_status status = napi_coerce_to_bool(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Boolean(_env, result), Napi::Boolean); -} - -inline MaybeOrValue Value::ToNumber() const { - napi_value result; - napi_status status = napi_coerce_to_number(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Number(_env, result), Napi::Number); -} - -inline MaybeOrValue Value::ToString() const { - napi_value result; - napi_status status = napi_coerce_to_string(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::String(_env, result), Napi::String); -} - -inline MaybeOrValue Value::ToObject() const { - napi_value result; - napi_status status = napi_coerce_to_object(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Object(_env, result), Napi::Object); -} - -//////////////////////////////////////////////////////////////////////////////// -// Boolean class -//////////////////////////////////////////////////////////////////////////////// - -inline Boolean Boolean::New(napi_env env, bool val) { - napi_value value; - napi_status status = napi_get_boolean(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, Boolean()); - return Boolean(env, value); -} - -inline Boolean::Boolean() : Napi::Value() {} - -inline Boolean::Boolean(napi_env env, napi_value value) - : Napi::Value(env, value) {} - -inline Boolean::operator bool() const { - return Value(); -} - -inline bool Boolean::Value() const { - bool result; - napi_status status = napi_get_value_bool(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, false); - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -// Number class -//////////////////////////////////////////////////////////////////////////////// - -inline Number Number::New(napi_env env, double val) { - napi_value value; - napi_status status = napi_create_double(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, Number()); - return Number(env, value); -} - -inline Number::Number() : Value() {} - -inline Number::Number(napi_env env, napi_value value) : Value(env, value) {} - -inline Number::operator int32_t() const { - return Int32Value(); -} - -inline Number::operator uint32_t() const { - return Uint32Value(); -} - -inline Number::operator int64_t() const { - return Int64Value(); -} - -inline Number::operator float() const { - return FloatValue(); -} - -inline Number::operator double() const { - return DoubleValue(); -} - -inline int32_t Number::Int32Value() const { - int32_t result; - napi_status status = napi_get_value_int32(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline uint32_t Number::Uint32Value() const { - uint32_t result; - napi_status status = napi_get_value_uint32(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline int64_t Number::Int64Value() const { - int64_t result; - napi_status status = napi_get_value_int64(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline float Number::FloatValue() const { - return static_cast(DoubleValue()); -} - -inline double Number::DoubleValue() const { - double result; - napi_status status = napi_get_value_double(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -#if NAPI_VERSION > 5 -//////////////////////////////////////////////////////////////////////////////// -// BigInt Class -//////////////////////////////////////////////////////////////////////////////// - -inline BigInt BigInt::New(napi_env env, int64_t val) { - napi_value value; - napi_status status = napi_create_bigint_int64(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, BigInt()); - return BigInt(env, value); -} - -inline BigInt BigInt::New(napi_env env, uint64_t val) { - napi_value value; - napi_status status = napi_create_bigint_uint64(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, BigInt()); - return BigInt(env, value); -} - -inline BigInt BigInt::New(napi_env env, - int sign_bit, - size_t word_count, - const uint64_t* words) { - napi_value value; - napi_status status = - napi_create_bigint_words(env, sign_bit, word_count, words, &value); - NAPI_THROW_IF_FAILED(env, status, BigInt()); - return BigInt(env, value); -} - -inline BigInt::BigInt() : Value() {} - -inline BigInt::BigInt(napi_env env, napi_value value) : Value(env, value) {} - -inline int64_t BigInt::Int64Value(bool* lossless) const { - int64_t result; - napi_status status = - napi_get_value_bigint_int64(_env, _value, &result, lossless); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline uint64_t BigInt::Uint64Value(bool* lossless) const { - uint64_t result; - napi_status status = - napi_get_value_bigint_uint64(_env, _value, &result, lossless); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -inline size_t BigInt::WordCount() const { - size_t word_count; - napi_status status = - napi_get_value_bigint_words(_env, _value, nullptr, &word_count, nullptr); - NAPI_THROW_IF_FAILED(_env, status, 0); - return word_count; -} - -inline void BigInt::ToWords(int* sign_bit, - size_t* word_count, - uint64_t* words) { - napi_status status = - napi_get_value_bigint_words(_env, _value, sign_bit, word_count, words); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} -#endif // NAPI_VERSION > 5 - -#if (NAPI_VERSION > 4) -//////////////////////////////////////////////////////////////////////////////// -// Date Class -//////////////////////////////////////////////////////////////////////////////// - -inline Date Date::New(napi_env env, double val) { - napi_value value; - napi_status status = napi_create_date(env, val, &value); - NAPI_THROW_IF_FAILED(env, status, Date()); - return Date(env, value); -} - -inline Date::Date() : Value() {} - -inline Date::Date(napi_env env, napi_value value) : Value(env, value) {} - -inline Date::operator double() const { - return ValueOf(); -} - -inline double Date::ValueOf() const { - double result; - napi_status status = napi_get_date_value(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Name class -//////////////////////////////////////////////////////////////////////////////// - -inline Name::Name() : Value() {} - -inline Name::Name(napi_env env, napi_value value) : Value(env, value) {} - -//////////////////////////////////////////////////////////////////////////////// -// String class -//////////////////////////////////////////////////////////////////////////////// - -inline String String::New(napi_env env, const std::string& val) { - return String::New(env, val.c_str(), val.size()); -} - -inline String String::New(napi_env env, const std::u16string& val) { - return String::New(env, val.c_str(), val.size()); -} - -inline String String::New(napi_env env, const char* val) { - // TODO(@gabrielschulhof) Remove if-statement when core's error handling is - // available in all supported versions. - if (val == nullptr) { - // Throw an error that looks like it came from core. - NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); - } - napi_value value; - napi_status status = - napi_create_string_utf8(env, val, std::strlen(val), &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String String::New(napi_env env, const char16_t* val) { - napi_value value; - // TODO(@gabrielschulhof) Remove if-statement when core's error handling is - // available in all supported versions. - if (val == nullptr) { - // Throw an error that looks like it came from core. - NAPI_THROW_IF_FAILED(env, napi_invalid_arg, String()); - } - napi_status status = - napi_create_string_utf16(env, val, std::u16string(val).size(), &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String String::New(napi_env env, const char* val, size_t length) { - napi_value value; - napi_status status = napi_create_string_utf8(env, val, length, &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String String::New(napi_env env, const char16_t* val, size_t length) { - napi_value value; - napi_status status = napi_create_string_utf16(env, val, length, &value); - NAPI_THROW_IF_FAILED(env, status, String()); - return String(env, value); -} - -inline String::String() : Name() {} - -inline String::String(napi_env env, napi_value value) : Name(env, value) {} - -inline String::operator std::string() const { - return Utf8Value(); -} - -inline String::operator std::u16string() const { - return Utf16Value(); -} - -inline std::string String::Utf8Value() const { - size_t length; - napi_status status = - napi_get_value_string_utf8(_env, _value, nullptr, 0, &length); - NAPI_THROW_IF_FAILED(_env, status, ""); - - std::string value; - value.reserve(length + 1); - value.resize(length); - status = napi_get_value_string_utf8( - _env, _value, &value[0], value.capacity(), nullptr); - NAPI_THROW_IF_FAILED(_env, status, ""); - return value; -} - -inline std::u16string String::Utf16Value() const { - size_t length; - napi_status status = - napi_get_value_string_utf16(_env, _value, nullptr, 0, &length); - NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); - - std::u16string value; - value.reserve(length + 1); - value.resize(length); - status = napi_get_value_string_utf16( - _env, _value, &value[0], value.capacity(), nullptr); - NAPI_THROW_IF_FAILED(_env, status, NAPI_WIDE_TEXT("")); - return value; -} - -//////////////////////////////////////////////////////////////////////////////// -// Symbol class -//////////////////////////////////////////////////////////////////////////////// - -inline Symbol Symbol::New(napi_env env, const char* description) { - napi_value descriptionValue = description != nullptr - ? String::New(env, description) - : static_cast(nullptr); - return Symbol::New(env, descriptionValue); -} - -inline Symbol Symbol::New(napi_env env, const std::string& description) { - napi_value descriptionValue = String::New(env, description); - return Symbol::New(env, descriptionValue); -} - -inline Symbol Symbol::New(napi_env env, String description) { - napi_value descriptionValue = description; - return Symbol::New(env, descriptionValue); -} - -inline Symbol Symbol::New(napi_env env, napi_value description) { - napi_value value; - napi_status status = napi_create_symbol(env, description, &value); - NAPI_THROW_IF_FAILED(env, status, Symbol()); - return Symbol(env, value); -} - -inline MaybeOrValue Symbol::WellKnown(napi_env env, - const std::string& name) { -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - Value symbol_obj; - Value symbol_value; - if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && - symbol_obj.As().Get(name).UnwrapTo(&symbol_value)) { - return Just(symbol_value.As()); - } - return Nothing(); -#else - return Napi::Env(env) - .Global() - .Get("Symbol") - .As() - .Get(name) - .As(); -#endif -} - -inline MaybeOrValue Symbol::For(napi_env env, - const std::string& description) { - napi_value descriptionValue = String::New(env, description); - return Symbol::For(env, descriptionValue); -} - -inline MaybeOrValue Symbol::For(napi_env env, const char* description) { - napi_value descriptionValue = String::New(env, description); - return Symbol::For(env, descriptionValue); -} - -inline MaybeOrValue Symbol::For(napi_env env, String description) { - return Symbol::For(env, static_cast(description)); -} - -inline MaybeOrValue Symbol::For(napi_env env, napi_value description) { -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - Value symbol_obj; - Value symbol_for_value; - Value symbol_value; - if (Napi::Env(env).Global().Get("Symbol").UnwrapTo(&symbol_obj) && - symbol_obj.As().Get("for").UnwrapTo(&symbol_for_value) && - symbol_for_value.As() - .Call(symbol_obj, {description}) - .UnwrapTo(&symbol_value)) { - return Just(symbol_value.As()); - } - return Nothing(); -#else - Object symbol_obj = Napi::Env(env).Global().Get("Symbol").As(); - return symbol_obj.Get("for") - .As() - .Call(symbol_obj, {description}) - .As(); -#endif -} - -inline Symbol::Symbol() : Name() {} - -inline Symbol::Symbol(napi_env env, napi_value value) : Name(env, value) {} - -//////////////////////////////////////////////////////////////////////////////// -// Automagic value creation -//////////////////////////////////////////////////////////////////////////////// - -namespace details { -template -struct vf_number { - static Number From(napi_env env, T value) { - return Number::New(env, static_cast(value)); - } -}; - -template <> -struct vf_number { - static Boolean From(napi_env env, bool value) { - return Boolean::New(env, value); - } -}; - -struct vf_utf8_charp { - static String From(napi_env env, const char* value) { - return String::New(env, value); - } -}; - -struct vf_utf16_charp { - static String From(napi_env env, const char16_t* value) { - return String::New(env, value); - } -}; -struct vf_utf8_string { - static String From(napi_env env, const std::string& value) { - return String::New(env, value); - } -}; - -struct vf_utf16_string { - static String From(napi_env env, const std::u16string& value) { - return String::New(env, value); - } -}; - -template -struct vf_fallback { - static Value From(napi_env env, const T& value) { return Value(env, value); } -}; - -template -struct disjunction : std::false_type {}; -template -struct disjunction : B {}; -template -struct disjunction - : std::conditional>::type {}; - -template -struct can_make_string - : disjunction::type, - typename std::is_convertible::type, - typename std::is_convertible::type, - typename std::is_convertible::type> {}; -} // namespace details - -template -Value Value::From(napi_env env, const T& value) { - using Helper = typename std::conditional< - std::is_integral::value || std::is_floating_point::value, - details::vf_number, - typename std::conditional::value, - String, - details::vf_fallback>::type>::type; - return Helper::From(env, value); -} - -template -String String::From(napi_env env, const T& value) { - struct Dummy {}; - using Helper = typename std::conditional< - std::is_convertible::value, - details::vf_utf8_charp, - typename std::conditional< - std::is_convertible::value, - details::vf_utf16_charp, - typename std::conditional< - std::is_convertible::value, - details::vf_utf8_string, - typename std::conditional< - std::is_convertible::value, - details::vf_utf16_string, - Dummy>::type>::type>::type>::type; - return Helper::From(env, value); -} - -//////////////////////////////////////////////////////////////////////////////// -// Object class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Object::PropertyLValue::operator Value() const { - MaybeOrValue val = Object(_env, _object).Get(_key); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - return val.Unwrap(); -#else - return val; -#endif -} - -template -template -inline Object::PropertyLValue& Object::PropertyLValue::operator=( - ValueType value) { -#ifdef NODE_ADDON_API_ENABLE_MAYBE - MaybeOrValue result = -#endif - Object(_env, _object).Set(_key, value); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - result.Unwrap(); -#endif - return *this; -} - -template -inline Object::PropertyLValue::PropertyLValue(Object object, Key key) - : _env(object.Env()), _object(object), _key(key) {} - -inline Object Object::New(napi_env env) { - napi_value value; - napi_status status = napi_create_object(env, &value); - NAPI_THROW_IF_FAILED(env, status, Object()); - return Object(env, value); -} - -inline Object::Object() : Value() {} - -inline Object::Object(napi_env env, napi_value value) : Value(env, value) {} - -inline Object::PropertyLValue Object::operator[]( - const char* utf8name) { - return PropertyLValue(*this, utf8name); -} - -inline Object::PropertyLValue Object::operator[]( - const std::string& utf8name) { - return PropertyLValue(*this, utf8name); -} - -inline Object::PropertyLValue Object::operator[](uint32_t index) { - return PropertyLValue(*this, index); -} - -inline Object::PropertyLValue Object::operator[](Value index) const { - return PropertyLValue(*this, index); -} - -inline MaybeOrValue Object::operator[](const char* utf8name) const { - return Get(utf8name); -} - -inline MaybeOrValue Object::operator[]( - const std::string& utf8name) const { - return Get(utf8name); -} - -inline MaybeOrValue Object::operator[](uint32_t index) const { - return Get(index); -} - -inline MaybeOrValue Object::Has(napi_value key) const { - bool result; - napi_status status = napi_has_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Has(Value key) const { - bool result; - napi_status status = napi_has_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Has(const char* utf8name) const { - bool result; - napi_status status = napi_has_named_property(_env, _value, utf8name, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Has(const std::string& utf8name) const { - return Has(utf8name.c_str()); -} - -inline MaybeOrValue Object::HasOwnProperty(napi_value key) const { - bool result; - napi_status status = napi_has_own_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::HasOwnProperty(Value key) const { - bool result; - napi_status status = napi_has_own_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::HasOwnProperty(const char* utf8name) const { - napi_value key; - napi_status status = - napi_create_string_utf8(_env, utf8name, std::strlen(utf8name), &key); - NAPI_MAYBE_THROW_IF_FAILED(_env, status, bool); - return HasOwnProperty(key); -} - -inline MaybeOrValue Object::HasOwnProperty( - const std::string& utf8name) const { - return HasOwnProperty(utf8name.c_str()); -} - -inline MaybeOrValue Object::Get(napi_value key) const { - napi_value result; - napi_status status = napi_get_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); -} - -inline MaybeOrValue Object::Get(Value key) const { - napi_value result; - napi_status status = napi_get_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); -} - -inline MaybeOrValue Object::Get(const char* utf8name) const { - napi_value result; - napi_status status = napi_get_named_property(_env, _value, utf8name, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, result), Value); -} - -inline MaybeOrValue Object::Get(const std::string& utf8name) const { - return Get(utf8name.c_str()); -} - -template -inline MaybeOrValue Object::Set(napi_value key, - const ValueType& value) const { - napi_status status = - napi_set_property(_env, _value, key, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -template -inline MaybeOrValue Object::Set(Value key, const ValueType& value) const { - napi_status status = - napi_set_property(_env, _value, key, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -template -inline MaybeOrValue Object::Set(const char* utf8name, - const ValueType& value) const { - napi_status status = - napi_set_named_property(_env, _value, utf8name, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -template -inline MaybeOrValue Object::Set(const std::string& utf8name, - const ValueType& value) const { - return Set(utf8name.c_str(), value); -} - -inline MaybeOrValue Object::Delete(napi_value key) const { - bool result; - napi_status status = napi_delete_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Delete(Value key) const { - bool result; - napi_status status = napi_delete_property(_env, _value, key, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Delete(const char* utf8name) const { - return Delete(String::New(_env, utf8name)); -} - -inline MaybeOrValue Object::Delete(const std::string& utf8name) const { - return Delete(String::New(_env, utf8name)); -} - -inline MaybeOrValue Object::Has(uint32_t index) const { - bool result; - napi_status status = napi_has_element(_env, _value, index, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::Get(uint32_t index) const { - napi_value value; - napi_status status = napi_get_element(_env, _value, index, &value); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Value(_env, value), Value); -} - -template -inline MaybeOrValue Object::Set(uint32_t index, - const ValueType& value) const { - napi_status status = - napi_set_element(_env, _value, index, Value::From(_env, value)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::Delete(uint32_t index) const { - bool result; - napi_status status = napi_delete_element(_env, _value, index, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -inline MaybeOrValue Object::GetPropertyNames() const { - napi_value result; - napi_status status = napi_get_property_names(_env, _value, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, Array(_env, result), Array); -} - -inline MaybeOrValue Object::DefineProperty( - const PropertyDescriptor& property) const { - napi_status status = napi_define_properties( - _env, - _value, - 1, - reinterpret_cast(&property)); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::DefineProperties( - const std::initializer_list& properties) const { - napi_status status = napi_define_properties( - _env, - _value, - properties.size(), - reinterpret_cast(properties.begin())); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::DefineProperties( - const std::vector& properties) const { - napi_status status = napi_define_properties( - _env, - _value, - properties.size(), - reinterpret_cast(properties.data())); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::InstanceOf( - const Function& constructor) const { - bool result; - napi_status status = napi_instanceof(_env, _value, constructor, &result); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, result, bool); -} - -template -inline void Object::AddFinalizer(Finalizer finalizeCallback, T* data) const { - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = - details::AttachData(_env, - *this, - data, - details::FinalizeData::Wrapper, - finalizeData); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -template -inline void Object::AddFinalizer(Finalizer finalizeCallback, - T* data, - Hint* finalizeHint) const { - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = details::AttachData( - _env, - *this, - data, - details::FinalizeData::WrapperWithHint, - finalizeData); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -#ifdef NAPI_CPP_EXCEPTIONS -inline Object::const_iterator::const_iterator(const Object* object, - const Type type) { - _object = object; - _keys = object->GetPropertyNames(); - _index = type == Type::BEGIN ? 0 : _keys.Length(); -} - -inline Object::const_iterator Napi::Object::begin() const { - const_iterator it(this, Object::const_iterator::Type::BEGIN); - return it; -} - -inline Object::const_iterator Napi::Object::end() const { - const_iterator it(this, Object::const_iterator::Type::END); - return it; -} - -inline Object::const_iterator& Object::const_iterator::operator++() { - ++_index; - return *this; -} - -inline bool Object::const_iterator::operator==( - const const_iterator& other) const { - return _index == other._index; -} - -inline bool Object::const_iterator::operator!=( - const const_iterator& other) const { - return _index != other._index; -} - -inline const std::pair> -Object::const_iterator::operator*() const { - const Value key = _keys[_index]; - const PropertyLValue value = (*_object)[key]; - return {key, value}; -} - -inline Object::iterator::iterator(Object* object, const Type type) { - _object = object; - _keys = object->GetPropertyNames(); - _index = type == Type::BEGIN ? 0 : _keys.Length(); -} - -inline Object::iterator Napi::Object::begin() { - iterator it(this, Object::iterator::Type::BEGIN); - return it; -} - -inline Object::iterator Napi::Object::end() { - iterator it(this, Object::iterator::Type::END); - return it; -} - -inline Object::iterator& Object::iterator::operator++() { - ++_index; - return *this; -} - -inline bool Object::iterator::operator==(const iterator& other) const { - return _index == other._index; -} - -inline bool Object::iterator::operator!=(const iterator& other) const { - return _index != other._index; -} - -inline std::pair> -Object::iterator::operator*() { - Value key = _keys[_index]; - PropertyLValue value = (*_object)[key]; - return {key, value}; -} -#endif // NAPI_CPP_EXCEPTIONS - -#if NAPI_VERSION >= 8 -inline MaybeOrValue Object::Freeze() const { - napi_status status = napi_object_freeze(_env, _value); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} - -inline MaybeOrValue Object::Seal() const { - napi_status status = napi_object_seal(_env, _value); - NAPI_RETURN_OR_THROW_IF_FAILED(_env, status, status == napi_ok, bool); -} -#endif // NAPI_VERSION >= 8 - -//////////////////////////////////////////////////////////////////////////////// -// External class -//////////////////////////////////////////////////////////////////////////////// - -template -inline External External::New(napi_env env, T* data) { - napi_value value; - napi_status status = - napi_create_external(env, data, nullptr, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, External()); - return External(env, value); -} - -template -template -inline External External::New(napi_env env, - T* data, - Finalizer finalizeCallback) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = - napi_create_external(env, - data, - details::FinalizeData::Wrapper, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, External()); - } - return External(env, value); -} - -template -template -inline External External::New(napi_env env, - T* data, - Finalizer finalizeCallback, - Hint* finalizeHint) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = napi_create_external( - env, - data, - details::FinalizeData::WrapperWithHint, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, External()); - } - return External(env, value); -} - -template -inline External::External() : Value() {} - -template -inline External::External(napi_env env, napi_value value) - : Value(env, value) {} - -template -inline T* External::Data() const { - void* data; - napi_status status = napi_get_value_external(_env, _value, &data); - NAPI_THROW_IF_FAILED(_env, status, nullptr); - return reinterpret_cast(data); -} - -//////////////////////////////////////////////////////////////////////////////// -// Array class -//////////////////////////////////////////////////////////////////////////////// - -inline Array Array::New(napi_env env) { - napi_value value; - napi_status status = napi_create_array(env, &value); - NAPI_THROW_IF_FAILED(env, status, Array()); - return Array(env, value); -} - -inline Array Array::New(napi_env env, size_t length) { - napi_value value; - napi_status status = napi_create_array_with_length(env, length, &value); - NAPI_THROW_IF_FAILED(env, status, Array()); - return Array(env, value); -} - -inline Array::Array() : Object() {} - -inline Array::Array(napi_env env, napi_value value) : Object(env, value) {} - -inline uint32_t Array::Length() const { - uint32_t result; - napi_status status = napi_get_array_length(_env, _value, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -// ArrayBuffer class -//////////////////////////////////////////////////////////////////////////////// - -inline ArrayBuffer ArrayBuffer::New(napi_env env, size_t byteLength) { - napi_value value; - void* data; - napi_status status = napi_create_arraybuffer(env, byteLength, &data, &value); - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - - return ArrayBuffer(env, value); -} - -inline ArrayBuffer ArrayBuffer::New(napi_env env, - void* externalData, - size_t byteLength) { - napi_value value; - napi_status status = napi_create_external_arraybuffer( - env, externalData, byteLength, nullptr, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - - return ArrayBuffer(env, value); -} - -template -inline ArrayBuffer ArrayBuffer::New(napi_env env, - void* externalData, - size_t byteLength, - Finalizer finalizeCallback) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = napi_create_external_arraybuffer( - env, - externalData, - byteLength, - details::FinalizeData::Wrapper, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - } - - return ArrayBuffer(env, value); -} - -template -inline ArrayBuffer ArrayBuffer::New(napi_env env, - void* externalData, - size_t byteLength, - Finalizer finalizeCallback, - Hint* finalizeHint) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = napi_create_external_arraybuffer( - env, - externalData, - byteLength, - details::FinalizeData::WrapperWithHint, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, ArrayBuffer()); - } - - return ArrayBuffer(env, value); -} - -inline ArrayBuffer::ArrayBuffer() : Object() {} - -inline ArrayBuffer::ArrayBuffer(napi_env env, napi_value value) - : Object(env, value) {} - -inline void* ArrayBuffer::Data() { - void* data; - napi_status status = napi_get_arraybuffer_info(_env, _value, &data, nullptr); - NAPI_THROW_IF_FAILED(_env, status, nullptr); - return data; -} - -inline size_t ArrayBuffer::ByteLength() { - size_t length; - napi_status status = - napi_get_arraybuffer_info(_env, _value, nullptr, &length); - NAPI_THROW_IF_FAILED(_env, status, 0); - return length; -} - -#if NAPI_VERSION >= 7 -inline bool ArrayBuffer::IsDetached() const { - bool detached; - napi_status status = napi_is_detached_arraybuffer(_env, _value, &detached); - NAPI_THROW_IF_FAILED(_env, status, false); - return detached; -} - -inline void ArrayBuffer::Detach() { - napi_status status = napi_detach_arraybuffer(_env, _value); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} -#endif // NAPI_VERSION >= 7 - -//////////////////////////////////////////////////////////////////////////////// -// DataView class -//////////////////////////////////////////////////////////////////////////////// -inline DataView DataView::New(napi_env env, Napi::ArrayBuffer arrayBuffer) { - return New(env, arrayBuffer, 0, arrayBuffer.ByteLength()); -} - -inline DataView DataView::New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset) { - if (byteOffset > arrayBuffer.ByteLength()) { - NAPI_THROW(RangeError::New( - env, "Start offset is outside the bounds of the buffer"), - DataView()); - } - return New( - env, arrayBuffer, byteOffset, arrayBuffer.ByteLength() - byteOffset); -} - -inline DataView DataView::New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset, - size_t byteLength) { - if (byteOffset + byteLength > arrayBuffer.ByteLength()) { - NAPI_THROW(RangeError::New(env, "Invalid DataView length"), DataView()); - } - napi_value value; - napi_status status = - napi_create_dataview(env, byteLength, arrayBuffer, byteOffset, &value); - NAPI_THROW_IF_FAILED(env, status, DataView()); - return DataView(env, value); -} - -inline DataView::DataView() : Object() {} - -inline DataView::DataView(napi_env env, napi_value value) : Object(env, value) { - napi_status status = napi_get_dataview_info(_env, - _value /* dataView */, - &_length /* byteLength */, - &_data /* data */, - nullptr /* arrayBuffer */, - nullptr /* byteOffset */); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline Napi::ArrayBuffer DataView::ArrayBuffer() const { - napi_value arrayBuffer; - napi_status status = napi_get_dataview_info(_env, - _value /* dataView */, - nullptr /* byteLength */, - nullptr /* data */, - &arrayBuffer /* arrayBuffer */, - nullptr /* byteOffset */); - NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); - return Napi::ArrayBuffer(_env, arrayBuffer); -} - -inline size_t DataView::ByteOffset() const { - size_t byteOffset; - napi_status status = napi_get_dataview_info(_env, - _value /* dataView */, - nullptr /* byteLength */, - nullptr /* data */, - nullptr /* arrayBuffer */, - &byteOffset /* byteOffset */); - NAPI_THROW_IF_FAILED(_env, status, 0); - return byteOffset; -} - -inline size_t DataView::ByteLength() const { - return _length; -} - -inline void* DataView::Data() const { - return _data; -} - -inline float DataView::GetFloat32(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline double DataView::GetFloat64(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline int8_t DataView::GetInt8(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline int16_t DataView::GetInt16(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline int32_t DataView::GetInt32(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline uint8_t DataView::GetUint8(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline uint16_t DataView::GetUint16(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline uint32_t DataView::GetUint32(size_t byteOffset) const { - return ReadData(byteOffset); -} - -inline void DataView::SetFloat32(size_t byteOffset, float value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetFloat64(size_t byteOffset, double value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetInt8(size_t byteOffset, int8_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetInt16(size_t byteOffset, int16_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetInt32(size_t byteOffset, int32_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetUint8(size_t byteOffset, uint8_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetUint16(size_t byteOffset, uint16_t value) const { - WriteData(byteOffset, value); -} - -inline void DataView::SetUint32(size_t byteOffset, uint32_t value) const { - WriteData(byteOffset, value); -} - -template -inline T DataView::ReadData(size_t byteOffset) const { - if (byteOffset + sizeof(T) > _length || - byteOffset + sizeof(T) < byteOffset) { // overflow - NAPI_THROW( - RangeError::New(_env, "Offset is outside the bounds of the DataView"), - 0); - } - - return *reinterpret_cast(static_cast(_data) + byteOffset); -} - -template -inline void DataView::WriteData(size_t byteOffset, T value) const { - if (byteOffset + sizeof(T) > _length || - byteOffset + sizeof(T) < byteOffset) { // overflow - NAPI_THROW_VOID( - RangeError::New(_env, "Offset is outside the bounds of the DataView")); - } - - *reinterpret_cast(static_cast(_data) + byteOffset) = value; -} - -//////////////////////////////////////////////////////////////////////////////// -// TypedArray class -//////////////////////////////////////////////////////////////////////////////// - -inline TypedArray::TypedArray() - : Object(), _type(napi_typedarray_type::napi_int8_array), _length(0) {} - -inline TypedArray::TypedArray(napi_env env, napi_value value) - : Object(env, value), - _type(napi_typedarray_type::napi_int8_array), - _length(0) { - if (value != nullptr) { - napi_status status = - napi_get_typedarray_info(_env, - _value, - &const_cast(this)->_type, - &const_cast(this)->_length, - nullptr, - nullptr, - nullptr); - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -inline TypedArray::TypedArray(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length) - : Object(env, value), _type(type), _length(length) {} - -inline napi_typedarray_type TypedArray::TypedArrayType() const { - return _type; -} - -inline uint8_t TypedArray::ElementSize() const { - switch (_type) { - case napi_int8_array: - case napi_uint8_array: - case napi_uint8_clamped_array: - return 1; - case napi_int16_array: - case napi_uint16_array: - return 2; - case napi_int32_array: - case napi_uint32_array: - case napi_float32_array: - return 4; - case napi_float64_array: -#if (NAPI_VERSION > 5) - case napi_bigint64_array: - case napi_biguint64_array: -#endif // (NAPI_VERSION > 5) - return 8; - default: - return 0; - } -} - -inline size_t TypedArray::ElementLength() const { - return _length; -} - -inline size_t TypedArray::ByteOffset() const { - size_t byteOffset; - napi_status status = napi_get_typedarray_info( - _env, _value, nullptr, nullptr, nullptr, nullptr, &byteOffset); - NAPI_THROW_IF_FAILED(_env, status, 0); - return byteOffset; -} - -inline size_t TypedArray::ByteLength() const { - return ElementSize() * ElementLength(); -} - -inline Napi::ArrayBuffer TypedArray::ArrayBuffer() const { - napi_value arrayBuffer; - napi_status status = napi_get_typedarray_info( - _env, _value, nullptr, nullptr, nullptr, &arrayBuffer, nullptr); - NAPI_THROW_IF_FAILED(_env, status, Napi::ArrayBuffer()); - return Napi::ArrayBuffer(_env, arrayBuffer); -} - -//////////////////////////////////////////////////////////////////////////////// -// TypedArrayOf class -//////////////////////////////////////////////////////////////////////////////// - -template -inline TypedArrayOf TypedArrayOf::New(napi_env env, - size_t elementLength, - napi_typedarray_type type) { - Napi::ArrayBuffer arrayBuffer = - Napi::ArrayBuffer::New(env, elementLength * sizeof(T)); - return New(env, elementLength, arrayBuffer, 0, type); -} - -template -inline TypedArrayOf TypedArrayOf::New(napi_env env, - size_t elementLength, - Napi::ArrayBuffer arrayBuffer, - size_t bufferOffset, - napi_typedarray_type type) { - napi_value value; - napi_status status = napi_create_typedarray( - env, type, elementLength, arrayBuffer, bufferOffset, &value); - NAPI_THROW_IF_FAILED(env, status, TypedArrayOf()); - - return TypedArrayOf( - env, - value, - type, - elementLength, - reinterpret_cast(reinterpret_cast(arrayBuffer.Data()) + - bufferOffset)); -} - -template -inline TypedArrayOf::TypedArrayOf() : TypedArray(), _data(nullptr) {} - -template -inline TypedArrayOf::TypedArrayOf(napi_env env, napi_value value) - : TypedArray(env, value), _data(nullptr) { - napi_status status = napi_ok; - if (value != nullptr) { - void* data = nullptr; - status = napi_get_typedarray_info( - _env, _value, &_type, &_length, &data, nullptr, nullptr); - _data = static_cast(data); - } else { - _type = TypedArrayTypeForPrimitiveType(); - _length = 0; - } - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -template -inline TypedArrayOf::TypedArrayOf(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length, - T* data) - : TypedArray(env, value, type, length), _data(data) { - if (!(type == TypedArrayTypeForPrimitiveType() || - (type == napi_uint8_clamped_array && - std::is_same::value))) { - NAPI_THROW_VOID(TypeError::New( - env, - "Array type must match the template parameter. " - "(Uint8 arrays may optionally have the \"clamped\" array type.)")); - } -} - -template -inline T& TypedArrayOf::operator[](size_t index) { - return _data[index]; -} - -template -inline const T& TypedArrayOf::operator[](size_t index) const { - return _data[index]; -} - -template -inline T* TypedArrayOf::Data() { - return _data; -} - -template -inline const T* TypedArrayOf::Data() const { - return _data; -} - -//////////////////////////////////////////////////////////////////////////////// -// Function class -//////////////////////////////////////////////////////////////////////////////// - -template -inline napi_status CreateFunction(napi_env env, - const char* utf8name, - napi_callback cb, - CbData* data, - napi_value* result) { - napi_status status = - napi_create_function(env, utf8name, NAPI_AUTO_LENGTH, cb, data, result); - if (status == napi_ok) { - status = Napi::details::AttachData(env, *result, data); - } - - return status; -} - -template -inline Function Function::New(napi_env env, const char* utf8name, void* data) { - napi_value result = nullptr; - napi_status status = napi_create_function(env, - utf8name, - NAPI_AUTO_LENGTH, - details::TemplatedVoidCallback, - data, - &result); - NAPI_THROW_IF_FAILED(env, status, Function()); - return Function(env, result); -} - -template -inline Function Function::New(napi_env env, const char* utf8name, void* data) { - napi_value result = nullptr; - napi_status status = napi_create_function(env, - utf8name, - NAPI_AUTO_LENGTH, - details::TemplatedCallback, - data, - &result); - NAPI_THROW_IF_FAILED(env, status, Function()); - return Function(env, result); -} - -template -inline Function Function::New(napi_env env, - const std::string& utf8name, - void* data) { - return Function::New(env, utf8name.c_str(), data); -} - -template -inline Function Function::New(napi_env env, - const std::string& utf8name, - void* data) { - return Function::New(env, utf8name.c_str(), data); -} - -template -inline Function Function::New(napi_env env, - Callable cb, - const char* utf8name, - void* data) { - using ReturnType = decltype(cb(CallbackInfo(nullptr, nullptr))); - using CbData = details::CallbackData; - auto callbackData = new CbData{std::move(cb), data}; - - napi_value value; - napi_status status = - CreateFunction(env, utf8name, CbData::Wrapper, callbackData, &value); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, Function()); - } - - return Function(env, value); -} - -template -inline Function Function::New(napi_env env, - Callable cb, - const std::string& utf8name, - void* data) { - return New(env, cb, utf8name.c_str(), data); -} - -inline Function::Function() : Object() {} - -inline Function::Function(napi_env env, napi_value value) - : Object(env, value) {} - -inline MaybeOrValue Function::operator()( - const std::initializer_list& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call( - const std::initializer_list& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call( - const std::vector& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call( - const std::vector& args) const { - return Call(Env().Undefined(), args); -} - -inline MaybeOrValue Function::Call(size_t argc, - const napi_value* args) const { - return Call(Env().Undefined(), argc, args); -} - -inline MaybeOrValue Function::Call( - napi_value recv, const std::initializer_list& args) const { - return Call(recv, args.size(), args.begin()); -} - -inline MaybeOrValue Function::Call( - napi_value recv, const std::vector& args) const { - return Call(recv, args.size(), args.data()); -} - -inline MaybeOrValue Function::Call( - napi_value recv, const std::vector& args) const { - const size_t argc = args.size(); - const size_t stackArgsCount = 6; - napi_value stackArgs[stackArgsCount]; - std::vector heapArgs; - napi_value* argv; - if (argc <= stackArgsCount) { - argv = stackArgs; - } else { - heapArgs.resize(argc); - argv = heapArgs.data(); - } - - for (size_t index = 0; index < argc; index++) { - argv[index] = static_cast(args[index]); - } - - return Call(recv, argc, argv); -} - -inline MaybeOrValue Function::Call(napi_value recv, - size_t argc, - const napi_value* args) const { - napi_value result; - napi_status status = - napi_call_function(_env, recv, _value, argc, args, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Value(_env, result), Napi::Value); -} - -inline MaybeOrValue Function::MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context) const { - return MakeCallback(recv, args.size(), args.begin(), context); -} - -inline MaybeOrValue Function::MakeCallback( - napi_value recv, - const std::vector& args, - napi_async_context context) const { - return MakeCallback(recv, args.size(), args.data(), context); -} - -inline MaybeOrValue Function::MakeCallback( - napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context) const { - napi_value result; - napi_status status = - napi_make_callback(_env, context, recv, _value, argc, args, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Value(_env, result), Napi::Value); -} - -inline MaybeOrValue Function::New( - const std::initializer_list& args) const { - return New(args.size(), args.begin()); -} - -inline MaybeOrValue Function::New( - const std::vector& args) const { - return New(args.size(), args.data()); -} - -inline MaybeOrValue Function::New(size_t argc, - const napi_value* args) const { - napi_value result; - napi_status status = napi_new_instance(_env, _value, argc, args, &result); - NAPI_RETURN_OR_THROW_IF_FAILED( - _env, status, Napi::Object(_env, result), Napi::Object); -} - -//////////////////////////////////////////////////////////////////////////////// -// Promise class -//////////////////////////////////////////////////////////////////////////////// - -inline Promise::Deferred Promise::Deferred::New(napi_env env) { - return Promise::Deferred(env); -} - -inline Promise::Deferred::Deferred(napi_env env) : _env(env) { - napi_status status = napi_create_promise(_env, &_deferred, &_promise); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline Promise Promise::Deferred::Promise() const { - return Napi::Promise(_env, _promise); -} - -inline Napi::Env Promise::Deferred::Env() const { - return Napi::Env(_env); -} - -inline void Promise::Deferred::Resolve(napi_value value) const { - napi_status status = napi_resolve_deferred(_env, _deferred, value); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline void Promise::Deferred::Reject(napi_value value) const { - napi_status status = napi_reject_deferred(_env, _deferred, value); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline Promise::Promise(napi_env env, napi_value value) : Object(env, value) {} - -//////////////////////////////////////////////////////////////////////////////// -// Buffer class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Buffer Buffer::New(napi_env env, size_t length) { - napi_value value; - void* data; - napi_status status = - napi_create_buffer(env, length * sizeof(T), &data, &value); - NAPI_THROW_IF_FAILED(env, status, Buffer()); - return Buffer(env, value, length, static_cast(data)); -} - -template -inline Buffer Buffer::New(napi_env env, T* data, size_t length) { - napi_value value; - napi_status status = napi_create_external_buffer( - env, length * sizeof(T), data, nullptr, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, Buffer()); - return Buffer(env, value, length, data); -} - -template -template -inline Buffer Buffer::New(napi_env env, - T* data, - size_t length, - Finalizer finalizeCallback) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), nullptr}); - napi_status status = - napi_create_external_buffer(env, - length * sizeof(T), - data, - details::FinalizeData::Wrapper, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, Buffer()); - } - return Buffer(env, value, length, data); -} - -template -template -inline Buffer Buffer::New(napi_env env, - T* data, - size_t length, - Finalizer finalizeCallback, - Hint* finalizeHint) { - napi_value value; - details::FinalizeData* finalizeData = - new details::FinalizeData( - {std::move(finalizeCallback), finalizeHint}); - napi_status status = napi_create_external_buffer( - env, - length * sizeof(T), - data, - details::FinalizeData::WrapperWithHint, - finalizeData, - &value); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, Buffer()); - } - return Buffer(env, value, length, data); -} - -template -inline Buffer Buffer::Copy(napi_env env, const T* data, size_t length) { - napi_value value; - napi_status status = - napi_create_buffer_copy(env, length * sizeof(T), data, nullptr, &value); - NAPI_THROW_IF_FAILED(env, status, Buffer()); - return Buffer(env, value); -} - -template -inline Buffer::Buffer() : Uint8Array(), _length(0), _data(nullptr) {} - -template -inline Buffer::Buffer(napi_env env, napi_value value) - : Uint8Array(env, value), _length(0), _data(nullptr) {} - -template -inline Buffer::Buffer(napi_env env, napi_value value, size_t length, T* data) - : Uint8Array(env, value), _length(length), _data(data) {} - -template -inline size_t Buffer::Length() const { - EnsureInfo(); - return _length; -} - -template -inline T* Buffer::Data() const { - EnsureInfo(); - return _data; -} - -template -inline void Buffer::EnsureInfo() const { - // The Buffer instance may have been constructed from a napi_value whose - // length/data are not yet known. Fetch and cache these values just once, - // since they can never change during the lifetime of the Buffer. - if (_data == nullptr) { - size_t byteLength; - void* voidData; - napi_status status = - napi_get_buffer_info(_env, _value, &voidData, &byteLength); - NAPI_THROW_IF_FAILED_VOID(_env, status); - _length = byteLength / sizeof(T); - _data = static_cast(voidData); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Error class -//////////////////////////////////////////////////////////////////////////////// - -inline Error Error::New(napi_env env) { - napi_status status; - napi_value error = nullptr; - bool is_exception_pending; - napi_extended_error_info last_error_info_copy; - - { - // We must retrieve the last error info before doing anything else because - // doing anything else will replace the last error info. - const napi_extended_error_info* last_error_info; - status = napi_get_last_error_info(env, &last_error_info); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_get_last_error_info"); - - // All fields of the `napi_extended_error_info` structure gets reset in - // subsequent Node-API function calls on the same `env`. This includes a - // call to `napi_is_exception_pending()`. So here it is necessary to make a - // copy of the information as the `error_code` field is used later on. - memcpy(&last_error_info_copy, - last_error_info, - sizeof(napi_extended_error_info)); - } - - status = napi_is_exception_pending(env, &is_exception_pending); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_is_exception_pending"); - - // A pending exception takes precedence over any internal error status. - if (is_exception_pending) { - status = napi_get_and_clear_last_exception(env, &error); - NAPI_FATAL_IF_FAILED( - status, "Error::New", "napi_get_and_clear_last_exception"); - } else { - const char* error_message = last_error_info_copy.error_message != nullptr - ? last_error_info_copy.error_message - : "Error in native callback"; - - napi_value message; - status = napi_create_string_utf8( - env, error_message, std::strlen(error_message), &message); - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_string_utf8"); - - switch (last_error_info_copy.error_code) { - case napi_object_expected: - case napi_string_expected: - case napi_boolean_expected: - case napi_number_expected: - status = napi_create_type_error(env, nullptr, message, &error); - break; - default: - status = napi_create_error(env, nullptr, message, &error); - break; - } - NAPI_FATAL_IF_FAILED(status, "Error::New", "napi_create_error"); - } - - return Error(env, error); -} - -inline Error Error::New(napi_env env, const char* message) { - return Error::New( - env, message, std::strlen(message), napi_create_error); -} - -inline Error Error::New(napi_env env, const std::string& message) { - return Error::New( - env, message.c_str(), message.size(), napi_create_error); -} - -inline NAPI_NO_RETURN void Error::Fatal(const char* location, - const char* message) { - napi_fatal_error(location, NAPI_AUTO_LENGTH, message, NAPI_AUTO_LENGTH); -} - -inline Error::Error() : ObjectReference() {} - -inline Error::Error(napi_env env, napi_value value) - : ObjectReference(env, nullptr) { - if (value != nullptr) { - // Attempting to create a reference on the error object. - // If it's not a Object/Function/Symbol, this call will return an error - // status. - napi_status status = napi_create_reference(env, value, 1, &_ref); - - if (status != napi_ok) { - napi_value wrappedErrorObj; - - // Create an error object - status = napi_create_object(env, &wrappedErrorObj); - NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_object"); - - // property flag that we attach to show the error object is wrapped - napi_property_descriptor wrapObjFlag = { - ERROR_WRAP_VALUE(), // Unique GUID identifier since Symbol isn't a - // viable option - nullptr, - nullptr, - nullptr, - nullptr, - Value::From(env, value), - napi_enumerable, - nullptr}; - - status = napi_define_properties(env, wrappedErrorObj, 1, &wrapObjFlag); - NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_define_properties"); - - // Create a reference on the newly wrapped object - status = napi_create_reference(env, wrappedErrorObj, 1, &_ref); - } - - // Avoid infinite recursion in the failure case. - NAPI_FATAL_IF_FAILED(status, "Error::Error", "napi_create_reference"); - } -} - -inline Object Error::Value() const { - if (_ref == nullptr) { - return Object(_env, nullptr); - } - - napi_value refValue; - napi_status status = napi_get_reference_value(_env, _ref, &refValue); - NAPI_THROW_IF_FAILED(_env, status, Object()); - - napi_valuetype type; - status = napi_typeof(_env, refValue, &type); - NAPI_THROW_IF_FAILED(_env, status, Object()); - - // If refValue isn't a symbol, then we proceed to whether the refValue has the - // wrapped error flag - if (type != napi_symbol) { - // We are checking if the object is wrapped - bool isWrappedObject = false; - - status = napi_has_property(_env, - refValue, - String::From(_env, ERROR_WRAP_VALUE()), - &isWrappedObject); - - // Don't care about status - if (isWrappedObject) { - napi_value unwrappedValue; - status = napi_get_property(_env, - refValue, - String::From(_env, ERROR_WRAP_VALUE()), - &unwrappedValue); - NAPI_THROW_IF_FAILED(_env, status, Object()); - - return Object(_env, unwrappedValue); - } - } - - return Object(_env, refValue); -} - -inline Error::Error(Error&& other) : ObjectReference(std::move(other)) {} - -inline Error& Error::operator=(Error&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline Error::Error(const Error& other) : ObjectReference(other) {} - -inline Error& Error::operator=(const Error& other) { - Reset(); - - _env = other.Env(); - HandleScope scope(_env); - - napi_value value = other.Value(); - if (value != nullptr) { - napi_status status = napi_create_reference(_env, value, 1, &_ref); - NAPI_THROW_IF_FAILED(_env, status, *this); - } - - return *this; -} - -inline const std::string& Error::Message() const NAPI_NOEXCEPT { - if (_message.size() == 0 && _env != nullptr) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - _message = Get("message").As(); - } catch (...) { - // Catch all errors here, to include e.g. a std::bad_alloc from - // the std::string::operator=, because this method may not throw. - } -#else // NAPI_CPP_EXCEPTIONS -#if defined(NODE_ADDON_API_ENABLE_MAYBE) - Napi::Value message_val; - if (Get("message").UnwrapTo(&message_val)) { - _message = message_val.As(); - } -#else - _message = Get("message").As(); -#endif -#endif // NAPI_CPP_EXCEPTIONS - } - return _message; -} - -// we created an object on the &_ref -inline void Error::ThrowAsJavaScriptException() const { - HandleScope scope(_env); - if (!IsEmpty()) { -#ifdef NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS - bool pendingException = false; - - // check if there is already a pending exception. If so don't try to throw a - // new one as that is not allowed/possible - napi_status status = napi_is_exception_pending(_env, &pendingException); - - if ((status != napi_ok) || - ((status == napi_ok) && (pendingException == false))) { - // We intentionally don't use `NAPI_THROW_*` macros here to ensure - // that there is no possible recursion as `ThrowAsJavaScriptException` - // is part of `NAPI_THROW_*` macro definition for noexcept. - - status = napi_throw(_env, Value()); - - if (status == napi_pending_exception) { - // The environment must be terminating as we checked earlier and there - // was no pending exception. In this case continuing will result - // in a fatal error and there is nothing the author has done incorrectly - // in their code that is worth flagging through a fatal error - return; - } - } else { - status = napi_pending_exception; - } -#else - // We intentionally don't use `NAPI_THROW_*` macros here to ensure - // that there is no possible recursion as `ThrowAsJavaScriptException` - // is part of `NAPI_THROW_*` macro definition for noexcept. - - napi_status status = napi_throw(_env, Value()); -#endif - -#ifdef NAPI_CPP_EXCEPTIONS - if (status != napi_ok) { - throw Error::New(_env); - } -#else // NAPI_CPP_EXCEPTIONS - NAPI_FATAL_IF_FAILED( - status, "Error::ThrowAsJavaScriptException", "napi_throw"); -#endif // NAPI_CPP_EXCEPTIONS - } -} - -#ifdef NAPI_CPP_EXCEPTIONS - -inline const char* Error::what() const NAPI_NOEXCEPT { - return Message().c_str(); -} - -#endif // NAPI_CPP_EXCEPTIONS - -inline const char* Error::ERROR_WRAP_VALUE() NAPI_NOEXCEPT { - return "4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal"; -} - -template -inline TError Error::New(napi_env env, - const char* message, - size_t length, - create_error_fn create_error) { - napi_value str; - napi_status status = napi_create_string_utf8(env, message, length, &str); - NAPI_THROW_IF_FAILED(env, status, TError()); - - napi_value error; - status = create_error(env, nullptr, str, &error); - NAPI_THROW_IF_FAILED(env, status, TError()); - - return TError(env, error); -} - -inline TypeError TypeError::New(napi_env env, const char* message) { - return Error::New( - env, message, std::strlen(message), napi_create_type_error); -} - -inline TypeError TypeError::New(napi_env env, const std::string& message) { - return Error::New( - env, message.c_str(), message.size(), napi_create_type_error); -} - -inline TypeError::TypeError() : Error() {} - -inline TypeError::TypeError(napi_env env, napi_value value) - : Error(env, value) {} - -inline RangeError RangeError::New(napi_env env, const char* message) { - return Error::New( - env, message, std::strlen(message), napi_create_range_error); -} - -inline RangeError RangeError::New(napi_env env, const std::string& message) { - return Error::New( - env, message.c_str(), message.size(), napi_create_range_error); -} - -inline RangeError::RangeError() : Error() {} - -inline RangeError::RangeError(napi_env env, napi_value value) - : Error(env, value) {} - -//////////////////////////////////////////////////////////////////////////////// -// Reference class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Reference Reference::New(const T& value, - uint32_t initialRefcount) { - napi_env env = value.Env(); - napi_value val = value; - - if (val == nullptr) { - return Reference(env, nullptr); - } - - napi_ref ref; - napi_status status = napi_create_reference(env, value, initialRefcount, &ref); - NAPI_THROW_IF_FAILED(env, status, Reference()); - - return Reference(env, ref); -} - -template -inline Reference::Reference() - : _env(nullptr), _ref(nullptr), _suppressDestruct(false) {} - -template -inline Reference::Reference(napi_env env, napi_ref ref) - : _env(env), _ref(ref), _suppressDestruct(false) {} - -template -inline Reference::~Reference() { - if (_ref != nullptr) { - if (!_suppressDestruct) { - napi_delete_reference(_env, _ref); - } - - _ref = nullptr; - } -} - -template -inline Reference::Reference(Reference&& other) - : _env(other._env), - _ref(other._ref), - _suppressDestruct(other._suppressDestruct) { - other._env = nullptr; - other._ref = nullptr; - other._suppressDestruct = false; -} - -template -inline Reference& Reference::operator=(Reference&& other) { - Reset(); - _env = other._env; - _ref = other._ref; - _suppressDestruct = other._suppressDestruct; - other._env = nullptr; - other._ref = nullptr; - other._suppressDestruct = false; - return *this; -} - -template -inline Reference::Reference(const Reference& other) - : _env(other._env), _ref(nullptr), _suppressDestruct(false) { - HandleScope scope(_env); - - napi_value value = other.Value(); - if (value != nullptr) { - // Copying is a limited scenario (currently only used for Error object) and - // always creates a strong reference to the given value even if the incoming - // reference is weak. - napi_status status = napi_create_reference(_env, value, 1, &_ref); - NAPI_FATAL_IF_FAILED( - status, "Reference::Reference", "napi_create_reference"); - } -} - -template -inline Reference::operator napi_ref() const { - return _ref; -} - -template -inline bool Reference::operator==(const Reference& other) const { - HandleScope scope(_env); - return this->Value().StrictEquals(other.Value()); -} - -template -inline bool Reference::operator!=(const Reference& other) const { - return !this->operator==(other); -} - -template -inline Napi::Env Reference::Env() const { - return Napi::Env(_env); -} - -template -inline bool Reference::IsEmpty() const { - return _ref == nullptr; -} - -template -inline T Reference::Value() const { - if (_ref == nullptr) { - return T(_env, nullptr); - } - - napi_value value; - napi_status status = napi_get_reference_value(_env, _ref, &value); - NAPI_THROW_IF_FAILED(_env, status, T()); - return T(_env, value); -} - -template -inline uint32_t Reference::Ref() const { - uint32_t result; - napi_status status = napi_reference_ref(_env, _ref, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -template -inline uint32_t Reference::Unref() const { - uint32_t result; - napi_status status = napi_reference_unref(_env, _ref, &result); - NAPI_THROW_IF_FAILED(_env, status, 0); - return result; -} - -template -inline void Reference::Reset() { - if (_ref != nullptr) { - napi_status status = napi_delete_reference(_env, _ref); - NAPI_THROW_IF_FAILED_VOID(_env, status); - _ref = nullptr; - } -} - -template -inline void Reference::Reset(const T& value, uint32_t refcount) { - Reset(); - _env = value.Env(); - - napi_value val = value; - if (val != nullptr) { - napi_status status = napi_create_reference(_env, value, refcount, &_ref); - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -template -inline void Reference::SuppressDestruct() { - _suppressDestruct = true; -} - -template -inline Reference Weak(T value) { - return Reference::New(value, 0); -} - -inline ObjectReference Weak(Object value) { - return Reference::New(value, 0); -} - -inline FunctionReference Weak(Function value) { - return Reference::New(value, 0); -} - -template -inline Reference Persistent(T value) { - return Reference::New(value, 1); -} - -inline ObjectReference Persistent(Object value) { - return Reference::New(value, 1); -} - -inline FunctionReference Persistent(Function value) { - return Reference::New(value, 1); -} - -//////////////////////////////////////////////////////////////////////////////// -// ObjectReference class -//////////////////////////////////////////////////////////////////////////////// - -inline ObjectReference::ObjectReference() : Reference() {} - -inline ObjectReference::ObjectReference(napi_env env, napi_ref ref) - : Reference(env, ref) {} - -inline ObjectReference::ObjectReference(Reference&& other) - : Reference(std::move(other)) {} - -inline ObjectReference& ObjectReference::operator=(Reference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline ObjectReference::ObjectReference(ObjectReference&& other) - : Reference(std::move(other)) {} - -inline ObjectReference& ObjectReference::operator=(ObjectReference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline ObjectReference::ObjectReference(const ObjectReference& other) - : Reference(other) {} - -inline MaybeOrValue ObjectReference::Get( - const char* utf8name) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Get(utf8name); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue ObjectReference::Get( - const std::string& utf8name) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Get(utf8name); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - napi_value value) const { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - Napi::Value value) const { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - const char* utf8value) const { - HandleScope scope(_env); - return Value().Set(utf8name, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - bool boolValue) const { - HandleScope scope(_env); - return Value().Set(utf8name, boolValue); -} - -inline MaybeOrValue ObjectReference::Set(const char* utf8name, - double numberValue) const { - HandleScope scope(_env); - return Value().Set(utf8name, numberValue); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - napi_value value) const { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - Napi::Value value) const { - HandleScope scope(_env); - return Value().Set(utf8name, value); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - std::string& utf8value) const { - HandleScope scope(_env); - return Value().Set(utf8name, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - bool boolValue) const { - HandleScope scope(_env); - return Value().Set(utf8name, boolValue); -} - -inline MaybeOrValue ObjectReference::Set(const std::string& utf8name, - double numberValue) const { - HandleScope scope(_env); - return Value().Set(utf8name, numberValue); -} - -inline MaybeOrValue ObjectReference::Get(uint32_t index) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Get(index); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - napi_value value) const { - HandleScope scope(_env); - return Value().Set(index, value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - Napi::Value value) const { - HandleScope scope(_env); - return Value().Set(index, value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - const char* utf8value) const { - HandleScope scope(_env); - return Value().Set(index, utf8value); -} - -inline MaybeOrValue ObjectReference::Set( - uint32_t index, const std::string& utf8value) const { - HandleScope scope(_env); - return Value().Set(index, utf8value); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - bool boolValue) const { - HandleScope scope(_env); - return Value().Set(index, boolValue); -} - -inline MaybeOrValue ObjectReference::Set(uint32_t index, - double numberValue) const { - HandleScope scope(_env); - return Value().Set(index, numberValue); -} - -//////////////////////////////////////////////////////////////////////////////// -// FunctionReference class -//////////////////////////////////////////////////////////////////////////////// - -inline FunctionReference::FunctionReference() : Reference() {} - -inline FunctionReference::FunctionReference(napi_env env, napi_ref ref) - : Reference(env, ref) {} - -inline FunctionReference::FunctionReference(Reference&& other) - : Reference(std::move(other)) {} - -inline FunctionReference& FunctionReference::operator=( - Reference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline FunctionReference::FunctionReference(FunctionReference&& other) - : Reference(std::move(other)) {} - -inline FunctionReference& FunctionReference::operator=( - FunctionReference&& other) { - static_cast*>(this)->operator=(std::move(other)); - return *this; -} - -inline MaybeOrValue FunctionReference::operator()( - const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value()(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - const std::vector& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - napi_value recv, const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(recv, args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - napi_value recv, const std::vector& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(recv, args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::Call( - napi_value recv, size_t argc, const napi_value* args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().Call(recv, argc, args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().MakeCallback(recv, args, context); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::MakeCallback( - napi_value recv, - const std::vector& args, - napi_async_context context) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().MakeCallback(recv, args, context); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::MakeCallback( - napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = - Value().MakeCallback(recv, argc, args, context); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap())); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Value(); - } - return scope.Escape(result); -#endif -} - -inline MaybeOrValue FunctionReference::New( - const std::initializer_list& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().New(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap()).As()); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Object(); - } - return scope.Escape(result).As(); -#endif -} - -inline MaybeOrValue FunctionReference::New( - const std::vector& args) const { - EscapableHandleScope scope(_env); - MaybeOrValue result = Value().New(args); -#ifdef NODE_ADDON_API_ENABLE_MAYBE - if (result.IsJust()) { - return Just(scope.Escape(result.Unwrap()).As()); - } - return result; -#else - if (scope.Env().IsExceptionPending()) { - return Object(); - } - return scope.Escape(result).As(); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -// CallbackInfo class -//////////////////////////////////////////////////////////////////////////////// - -inline CallbackInfo::CallbackInfo(napi_env env, napi_callback_info info) - : _env(env), - _info(info), - _this(nullptr), - _dynamicArgs(nullptr), - _data(nullptr) { - _argc = _staticArgCount; - _argv = _staticArgs; - napi_status status = - napi_get_cb_info(env, info, &_argc, _argv, &_this, &_data); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - if (_argc > _staticArgCount) { - // Use either a fixed-size array (on the stack) or a dynamically-allocated - // array (on the heap) depending on the number of args. - _dynamicArgs = new napi_value[_argc]; - _argv = _dynamicArgs; - - status = napi_get_cb_info(env, info, &_argc, _argv, nullptr, nullptr); - NAPI_THROW_IF_FAILED_VOID(_env, status); - } -} - -inline CallbackInfo::~CallbackInfo() { - if (_dynamicArgs != nullptr) { - delete[] _dynamicArgs; - } -} - -inline CallbackInfo::operator napi_callback_info() const { - return _info; -} - -inline Value CallbackInfo::NewTarget() const { - napi_value newTarget; - napi_status status = napi_get_new_target(_env, _info, &newTarget); - NAPI_THROW_IF_FAILED(_env, status, Value()); - return Value(_env, newTarget); -} - -inline bool CallbackInfo::IsConstructCall() const { - return !NewTarget().IsEmpty(); -} - -inline Napi::Env CallbackInfo::Env() const { - return Napi::Env(_env); -} - -inline size_t CallbackInfo::Length() const { - return _argc; -} - -inline const Value CallbackInfo::operator[](size_t index) const { - return index < _argc ? Value(_env, _argv[index]) : Env().Undefined(); -} - -inline Value CallbackInfo::This() const { - if (_this == nullptr) { - return Env().Undefined(); - } - return Object(_env, _this); -} - -inline void* CallbackInfo::Data() const { - return _data; -} - -inline void CallbackInfo::SetData(void* data) { - _data = data; -} - -//////////////////////////////////////////////////////////////////////////////// -// PropertyDescriptor class -//////////////////////////////////////////////////////////////////////////////// - -template -PropertyDescriptor PropertyDescriptor::Accessor( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.utf8name = utf8name; - desc.getter = details::TemplatedCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template -PropertyDescriptor PropertyDescriptor::Accessor( - const std::string& utf8name, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), attributes, data); -} - -template -PropertyDescriptor PropertyDescriptor::Accessor( - Name name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.name = name; - desc.getter = details::TemplatedCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template -PropertyDescriptor PropertyDescriptor::Accessor( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.utf8name = utf8name; - desc.getter = details::TemplatedCallback; - desc.setter = details::TemplatedVoidCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template -PropertyDescriptor PropertyDescriptor::Accessor( - const std::string& utf8name, - napi_property_attributes attributes, - void* data) { - return Accessor(utf8name.c_str(), attributes, data); -} - -template -PropertyDescriptor PropertyDescriptor::Accessor( - Name name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - - desc.name = name; - desc.getter = details::TemplatedCallback; - desc.setter = details::TemplatedVoidCallback; - desc.attributes = attributes; - desc.data = data; - - return desc; -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - napi_property_attributes attributes, - void* data) { - using CbData = details::CallbackData; - auto callbackData = new CbData({getter, data}); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({utf8name, - nullptr, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - napi_property_attributes attributes, - void* data) { - return Accessor(env, object, utf8name.c_str(), getter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - napi_property_attributes attributes, - void* data) { - using CbData = details::CallbackData; - auto callbackData = new CbData({getter, data}); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({nullptr, - name, - nullptr, - CbData::Wrapper, - nullptr, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - using CbData = details::AccessorCallbackData; - auto callbackData = new CbData({getter, setter, data}); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({utf8name, - nullptr, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - return Accessor( - env, object, utf8name.c_str(), getter, setter, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Accessor( - Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes, - void* data) { - using CbData = details::AccessorCallbackData; - auto callbackData = new CbData({getter, setter, data}); - - napi_status status = AttachData(env, object, callbackData); - if (status != napi_ok) { - delete callbackData; - NAPI_THROW_IF_FAILED(env, status, napi_property_descriptor()); - } - - return PropertyDescriptor({nullptr, - name, - nullptr, - CbData::GetterWrapper, - CbData::SetterWrapper, - nullptr, - attributes, - callbackData}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - Napi::Env env, - Napi::Object /*object*/, - const char* utf8name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return PropertyDescriptor({utf8name, - nullptr, - nullptr, - nullptr, - nullptr, - Napi::Function::New(env, cb, utf8name, data), - attributes, - nullptr}); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return Function(env, object, utf8name.c_str(), cb, attributes, data); -} - -template -inline PropertyDescriptor PropertyDescriptor::Function( - Napi::Env env, - Napi::Object /*object*/, - Name name, - Callable cb, - napi_property_attributes attributes, - void* data) { - return PropertyDescriptor({nullptr, - name, - nullptr, - nullptr, - nullptr, - Napi::Function::New(env, cb, nullptr, data), - attributes, - nullptr}); -} - -inline PropertyDescriptor PropertyDescriptor::Value( - const char* utf8name, - napi_value value, - napi_property_attributes attributes) { - return PropertyDescriptor({utf8name, - nullptr, - nullptr, - nullptr, - nullptr, - value, - attributes, - nullptr}); -} - -inline PropertyDescriptor PropertyDescriptor::Value( - const std::string& utf8name, - napi_value value, - napi_property_attributes attributes) { - return Value(utf8name.c_str(), value, attributes); -} - -inline PropertyDescriptor PropertyDescriptor::Value( - napi_value name, napi_value value, napi_property_attributes attributes) { - return PropertyDescriptor( - {nullptr, name, nullptr, nullptr, nullptr, value, attributes, nullptr}); -} - -inline PropertyDescriptor PropertyDescriptor::Value( - Name name, Napi::Value value, napi_property_attributes attributes) { - napi_value nameValue = name; - napi_value valueValue = value; - return PropertyDescriptor::Value(nameValue, valueValue, attributes); -} - -inline PropertyDescriptor::PropertyDescriptor(napi_property_descriptor desc) - : _desc(desc) {} - -inline PropertyDescriptor::operator napi_property_descriptor&() { - return _desc; -} - -inline PropertyDescriptor::operator const napi_property_descriptor&() const { - return _desc; -} - -//////////////////////////////////////////////////////////////////////////////// -// InstanceWrap class -//////////////////////////////////////////////////////////////////////////////// - -template -inline void InstanceWrap::AttachPropData( - napi_env env, napi_value value, const napi_property_descriptor* prop) { - napi_status status; - if (!(prop->attributes & napi_static)) { - if (prop->method == T::InstanceVoidMethodCallbackWrapper) { - status = Napi::details::AttachData( - env, value, static_cast(prop->data)); - NAPI_THROW_IF_FAILED_VOID(env, status); - } else if (prop->method == T::InstanceMethodCallbackWrapper) { - status = Napi::details::AttachData( - env, value, static_cast(prop->data)); - NAPI_THROW_IF_FAILED_VOID(env, status); - } else if (prop->getter == T::InstanceGetterCallbackWrapper || - prop->setter == T::InstanceSetterCallbackWrapper) { - status = Napi::details::AttachData( - env, value, static_cast(prop->data)); - NAPI_THROW_IF_FAILED_VOID(env, status); - } - } -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceVoidMethodCallbackData* callbackData = - new InstanceVoidMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::InstanceVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, - InstanceMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceMethodCallbackData* callbackData = - new InstanceMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::InstanceMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceVoidMethodCallbackData* callbackData = - new InstanceVoidMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::InstanceVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, - InstanceMethodCallback method, - napi_property_attributes attributes, - void* data) { - InstanceMethodCallbackData* callbackData = - new InstanceMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::InstanceMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceVoidMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedInstanceVoidCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedInstanceCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceVoidMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedInstanceVoidCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceMethodCallback method> -inline ClassPropertyDescriptor InstanceWrap::InstanceMethod( - Symbol name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedInstanceCallback; - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - const char* utf8name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes, - void* data) { - InstanceAccessorCallbackData* callbackData = - new InstanceAccessorCallbackData({getter, setter, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - Symbol name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes, - void* data) { - InstanceAccessorCallbackData* callbackData = - new InstanceAccessorCallbackData({getter, setter, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = getter != nullptr ? T::InstanceGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::InstanceSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceGetterCallback getter, - typename InstanceWrap::InstanceSetterCallback setter> -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = details::TemplatedInstanceCallback; - desc.setter = This::WrapSetter(This::SetterTag()); - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -template ::InstanceGetterCallback getter, - typename InstanceWrap::InstanceSetterCallback setter> -inline ClassPropertyDescriptor InstanceWrap::InstanceAccessor( - Symbol name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = details::TemplatedInstanceCallback; - desc.setter = This::WrapSetter(This::SetterTag()); - desc.data = data; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceValue( - const char* utf8name, - Napi::Value value, - napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.value = value; - desc.attributes = attributes; - return desc; -} - -template -inline ClassPropertyDescriptor InstanceWrap::InstanceValue( - Symbol name, Napi::Value value, napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.value = value; - desc.attributes = attributes; - return desc; -} - -template -inline napi_value InstanceWrap::InstanceVoidMethodCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceVoidMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->callback; - (instance->*cb)(callbackInfo); - return nullptr; - }); -} - -template -inline napi_value InstanceWrap::InstanceMethodCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->callback; - return (instance->*cb)(callbackInfo); - }); -} - -template -inline napi_value InstanceWrap::InstanceGetterCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->getterCallback; - return (instance->*cb)(callbackInfo); - }); -} - -template -inline napi_value InstanceWrap::InstanceSetterCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - InstanceAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - T* instance = T::Unwrap(callbackInfo.This().As()); - auto cb = callbackData->setterCallback; - (instance->*cb)(callbackInfo, callbackInfo[0]); - return nullptr; - }); -} - -template -template ::InstanceSetterCallback method> -inline napi_value InstanceWrap::WrappedMethod( - napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - const CallbackInfo cbInfo(env, info); - T* instance = T::Unwrap(cbInfo.This().As()); - (instance->*method)(cbInfo, cbInfo[0]); - return nullptr; - }); -} - -//////////////////////////////////////////////////////////////////////////////// -// ObjectWrap class -//////////////////////////////////////////////////////////////////////////////// - -template -inline ObjectWrap::ObjectWrap(const Napi::CallbackInfo& callbackInfo) { - napi_env env = callbackInfo.Env(); - napi_value wrapper = callbackInfo.This(); - napi_status status; - napi_ref ref; - T* instance = static_cast(this); - status = napi_wrap(env, wrapper, instance, FinalizeCallback, nullptr, &ref); - NAPI_THROW_IF_FAILED_VOID(env, status); - - Reference* instanceRef = instance; - *instanceRef = Reference(env, ref); -} - -template -inline ObjectWrap::~ObjectWrap() { - // If the JS object still exists at this point, remove the finalizer added - // through `napi_wrap()`. - if (!IsEmpty()) { - Object object = Value(); - // It is not valid to call `napi_remove_wrap()` with an empty `object`. - // This happens e.g. during garbage collection. - if (!object.IsEmpty() && _construction_failed) { - napi_remove_wrap(Env(), object, nullptr); - } - } -} - -template -inline T* ObjectWrap::Unwrap(Object wrapper) { - void* unwrapped; - napi_status status = napi_unwrap(wrapper.Env(), wrapper, &unwrapped); - NAPI_THROW_IF_FAILED(wrapper.Env(), status, nullptr); - return static_cast(unwrapped); -} - -template -inline Function ObjectWrap::DefineClass( - Napi::Env env, - const char* utf8name, - const size_t props_count, - const napi_property_descriptor* descriptors, - void* data) { - napi_status status; - std::vector props(props_count); - - // We copy the descriptors to a local array because before defining the class - // we must replace static method property descriptors with value property - // descriptors such that the value is a function-valued `napi_value` created - // with `CreateFunction()`. - // - // This replacement could be made for instance methods as well, but V8 aborts - // if we do that, because it expects methods defined on the prototype template - // to have `FunctionTemplate`s. - for (size_t index = 0; index < props_count; index++) { - props[index] = descriptors[index]; - napi_property_descriptor* prop = &props[index]; - if (prop->method == T::StaticMethodCallbackWrapper) { - status = - CreateFunction(env, - utf8name, - prop->method, - static_cast(prop->data), - &(prop->value)); - NAPI_THROW_IF_FAILED(env, status, Function()); - prop->method = nullptr; - prop->data = nullptr; - } else if (prop->method == T::StaticVoidMethodCallbackWrapper) { - status = - CreateFunction(env, - utf8name, - prop->method, - static_cast(prop->data), - &(prop->value)); - NAPI_THROW_IF_FAILED(env, status, Function()); - prop->method = nullptr; - prop->data = nullptr; - } - } - - napi_value value; - status = napi_define_class(env, - utf8name, - NAPI_AUTO_LENGTH, - T::ConstructorCallbackWrapper, - data, - props_count, - props.data(), - &value); - NAPI_THROW_IF_FAILED(env, status, Function()); - - // After defining the class we iterate once more over the property descriptors - // and attach the data associated with accessors and instance methods to the - // newly created JavaScript class. - for (size_t idx = 0; idx < props_count; idx++) { - const napi_property_descriptor* prop = &props[idx]; - - if (prop->getter == T::StaticGetterCallbackWrapper || - prop->setter == T::StaticSetterCallbackWrapper) { - status = Napi::details::AttachData( - env, value, static_cast(prop->data)); - NAPI_THROW_IF_FAILED(env, status, Function()); - } else { - // InstanceWrap::AttachPropData is responsible for attaching the data - // of instance methods and accessors. - T::AttachPropData(env, value, prop); - } - } - - return Function(env, value); -} - -template -inline Function ObjectWrap::DefineClass( - Napi::Env env, - const char* utf8name, - const std::initializer_list>& properties, - void* data) { - return DefineClass( - env, - utf8name, - properties.size(), - reinterpret_cast(properties.begin()), - data); -} - -template -inline Function ObjectWrap::DefineClass( - Napi::Env env, - const char* utf8name, - const std::vector>& properties, - void* data) { - return DefineClass( - env, - utf8name, - properties.size(), - reinterpret_cast(properties.data()), - data); -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, - StaticVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticVoidMethodCallbackData* callbackData = - new StaticVoidMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::StaticVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, - StaticMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticMethodCallbackData* callbackData = - new StaticMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = T::StaticMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, - StaticVoidMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticVoidMethodCallbackData* callbackData = - new StaticVoidMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::StaticVoidMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, - StaticMethodCallback method, - napi_property_attributes attributes, - void* data) { - StaticMethodCallbackData* callbackData = - new StaticMethodCallbackData({method, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = T::StaticMethodCallbackWrapper; - desc.data = callbackData; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticVoidMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedVoidCallback; - desc.data = data; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticVoidMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedVoidCallback; - desc.data = data; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.method = details::TemplatedCallback; - desc.data = data; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticMethodCallback method> -inline ClassPropertyDescriptor ObjectWrap::StaticMethod( - Symbol name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.method = details::TemplatedCallback; - desc.data = data; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - const char* utf8name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes, - void* data) { - StaticAccessorCallbackData* callbackData = - new StaticAccessorCallbackData({getter, setter, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - Symbol name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes, - void* data) { - StaticAccessorCallbackData* callbackData = - new StaticAccessorCallbackData({getter, setter, data}); - - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = getter != nullptr ? T::StaticGetterCallbackWrapper : nullptr; - desc.setter = setter != nullptr ? T::StaticSetterCallbackWrapper : nullptr; - desc.data = callbackData; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticGetterCallback getter, - typename ObjectWrap::StaticSetterCallback setter> -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - const char* utf8name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.getter = details::TemplatedCallback; - desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); - desc.data = data; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -template ::StaticGetterCallback getter, - typename ObjectWrap::StaticSetterCallback setter> -inline ClassPropertyDescriptor ObjectWrap::StaticAccessor( - Symbol name, napi_property_attributes attributes, void* data) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.getter = details::TemplatedCallback; - desc.setter = This::WrapStaticSetter(This::StaticSetterTag()); - desc.data = data; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticValue( - const char* utf8name, - Napi::Value value, - napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.utf8name = utf8name; - desc.value = value; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline ClassPropertyDescriptor ObjectWrap::StaticValue( - Symbol name, Napi::Value value, napi_property_attributes attributes) { - napi_property_descriptor desc = napi_property_descriptor(); - desc.name = name; - desc.value = value; - desc.attributes = - static_cast(attributes | napi_static); - return desc; -} - -template -inline Value ObjectWrap::OnCalledAsFunction( - const Napi::CallbackInfo& callbackInfo) { - NAPI_THROW( - TypeError::New(callbackInfo.Env(), - "Class constructors cannot be invoked without 'new'"), - Napi::Value()); -} - -template -inline void ObjectWrap::Finalize(Napi::Env /*env*/) {} - -template -inline napi_value ObjectWrap::ConstructorCallbackWrapper( - napi_env env, napi_callback_info info) { - napi_value new_target; - napi_status status = napi_get_new_target(env, info, &new_target); - if (status != napi_ok) return nullptr; - - bool isConstructCall = (new_target != nullptr); - if (!isConstructCall) { - return details::WrapCallback( - [&] { return T::OnCalledAsFunction(CallbackInfo(env, info)); }); - } - - napi_value wrapper = details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - T* instance = new T(callbackInfo); -#ifdef NAPI_CPP_EXCEPTIONS - instance->_construction_failed = false; -#else - if (callbackInfo.Env().IsExceptionPending()) { - // We need to clear the exception so that removing the wrap might work. - Error e = callbackInfo.Env().GetAndClearPendingException(); - delete instance; - e.ThrowAsJavaScriptException(); - } else { - instance->_construction_failed = false; - } -#endif // NAPI_CPP_EXCEPTIONS - return callbackInfo.This(); - }); - - return wrapper; -} - -template -inline napi_value ObjectWrap::StaticVoidMethodCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticVoidMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->callback(callbackInfo); - return nullptr; - }); -} - -template -inline napi_value ObjectWrap::StaticMethodCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticMethodCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->callback(callbackInfo); - }); -} - -template -inline napi_value ObjectWrap::StaticGetterCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - return callbackData->getterCallback(callbackInfo); - }); -} - -template -inline napi_value ObjectWrap::StaticSetterCallbackWrapper( - napi_env env, napi_callback_info info) { - return details::WrapCallback([&] { - CallbackInfo callbackInfo(env, info); - StaticAccessorCallbackData* callbackData = - reinterpret_cast(callbackInfo.Data()); - callbackInfo.SetData(callbackData->data); - callbackData->setterCallback(callbackInfo, callbackInfo[0]); - return nullptr; - }); -} - -template -inline void ObjectWrap::FinalizeCallback(napi_env env, - void* data, - void* /*hint*/) { - HandleScope scope(env); - T* instance = static_cast(data); - instance->Finalize(Napi::Env(env)); - delete instance; -} - -template -template ::StaticSetterCallback method> -inline napi_value ObjectWrap::WrappedMethod( - napi_env env, napi_callback_info info) NAPI_NOEXCEPT { - return details::WrapCallback([&] { - const CallbackInfo cbInfo(env, info); - method(cbInfo, cbInfo[0]); - return nullptr; - }); -} - -//////////////////////////////////////////////////////////////////////////////// -// HandleScope class -//////////////////////////////////////////////////////////////////////////////// - -inline HandleScope::HandleScope(napi_env env, napi_handle_scope scope) - : _env(env), _scope(scope) {} - -inline HandleScope::HandleScope(Napi::Env env) : _env(env) { - napi_status status = napi_open_handle_scope(_env, &_scope); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline HandleScope::~HandleScope() { - napi_status status = napi_close_handle_scope(_env, _scope); - NAPI_FATAL_IF_FAILED( - status, "HandleScope::~HandleScope", "napi_close_handle_scope"); -} - -inline HandleScope::operator napi_handle_scope() const { - return _scope; -} - -inline Napi::Env HandleScope::Env() const { - return Napi::Env(_env); -} - -//////////////////////////////////////////////////////////////////////////////// -// EscapableHandleScope class -//////////////////////////////////////////////////////////////////////////////// - -inline EscapableHandleScope::EscapableHandleScope( - napi_env env, napi_escapable_handle_scope scope) - : _env(env), _scope(scope) {} - -inline EscapableHandleScope::EscapableHandleScope(Napi::Env env) : _env(env) { - napi_status status = napi_open_escapable_handle_scope(_env, &_scope); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline EscapableHandleScope::~EscapableHandleScope() { - napi_status status = napi_close_escapable_handle_scope(_env, _scope); - NAPI_FATAL_IF_FAILED(status, - "EscapableHandleScope::~EscapableHandleScope", - "napi_close_escapable_handle_scope"); -} - -inline EscapableHandleScope::operator napi_escapable_handle_scope() const { - return _scope; -} - -inline Napi::Env EscapableHandleScope::Env() const { - return Napi::Env(_env); -} - -inline Value EscapableHandleScope::Escape(napi_value escapee) { - napi_value result; - napi_status status = napi_escape_handle(_env, _scope, escapee, &result); - NAPI_THROW_IF_FAILED(_env, status, Value()); - return Value(_env, result); -} - -#if (NAPI_VERSION > 2) -//////////////////////////////////////////////////////////////////////////////// -// CallbackScope class -//////////////////////////////////////////////////////////////////////////////// - -inline CallbackScope::CallbackScope(napi_env env, napi_callback_scope scope) - : _env(env), _scope(scope) {} - -inline CallbackScope::CallbackScope(napi_env env, napi_async_context context) - : _env(env) { - napi_status status = - napi_open_callback_scope(_env, Object::New(env), context, &_scope); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline CallbackScope::~CallbackScope() { - napi_status status = napi_close_callback_scope(_env, _scope); - NAPI_FATAL_IF_FAILED( - status, "CallbackScope::~CallbackScope", "napi_close_callback_scope"); -} - -inline CallbackScope::operator napi_callback_scope() const { - return _scope; -} - -inline Napi::Env CallbackScope::Env() const { - return Napi::Env(_env); -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -// AsyncContext class -//////////////////////////////////////////////////////////////////////////////// - -inline AsyncContext::AsyncContext(napi_env env, const char* resource_name) - : AsyncContext(env, resource_name, Object::New(env)) {} - -inline AsyncContext::AsyncContext(napi_env env, - const char* resource_name, - const Object& resource) - : _env(env), _context(nullptr) { - napi_value resource_id; - napi_status status = napi_create_string_utf8( - _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - status = napi_async_init(_env, resource, resource_id, &_context); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline AsyncContext::~AsyncContext() { - if (_context != nullptr) { - napi_async_destroy(_env, _context); - _context = nullptr; - } -} - -inline AsyncContext::AsyncContext(AsyncContext&& other) { - _env = other._env; - other._env = nullptr; - _context = other._context; - other._context = nullptr; -} - -inline AsyncContext& AsyncContext::operator=(AsyncContext&& other) { - _env = other._env; - other._env = nullptr; - _context = other._context; - other._context = nullptr; - return *this; -} - -inline AsyncContext::operator napi_async_context() const { - return _context; -} - -inline Napi::Env AsyncContext::Env() const { - return Napi::Env(_env); -} - -//////////////////////////////////////////////////////////////////////////////// -// AsyncWorker class -//////////////////////////////////////////////////////////////////////////////// - -inline AsyncWorker::AsyncWorker(const Function& callback) - : AsyncWorker(callback, "generic") {} - -inline AsyncWorker::AsyncWorker(const Function& callback, - const char* resource_name) - : AsyncWorker(callback, resource_name, Object::New(callback.Env())) {} - -inline AsyncWorker::AsyncWorker(const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncWorker( - Object::New(callback.Env()), callback, resource_name, resource) {} - -inline AsyncWorker::AsyncWorker(const Object& receiver, - const Function& callback) - : AsyncWorker(receiver, callback, "generic") {} - -inline AsyncWorker::AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name) - : AsyncWorker( - receiver, callback, resource_name, Object::New(callback.Env())) {} - -inline AsyncWorker::AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource) - : _env(callback.Env()), - _receiver(Napi::Persistent(receiver)), - _callback(Napi::Persistent(callback)), - _suppress_destruct(false) { - napi_value resource_id; - napi_status status = napi_create_string_latin1( - _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - status = napi_create_async_work(_env, - resource, - resource_id, - OnAsyncWorkExecute, - OnAsyncWorkComplete, - this, - &_work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline AsyncWorker::AsyncWorker(Napi::Env env) : AsyncWorker(env, "generic") {} - -inline AsyncWorker::AsyncWorker(Napi::Env env, const char* resource_name) - : AsyncWorker(env, resource_name, Object::New(env)) {} - -inline AsyncWorker::AsyncWorker(Napi::Env env, - const char* resource_name, - const Object& resource) - : _env(env), _receiver(), _callback(), _suppress_destruct(false) { - napi_value resource_id; - napi_status status = napi_create_string_latin1( - _env, resource_name, NAPI_AUTO_LENGTH, &resource_id); - NAPI_THROW_IF_FAILED_VOID(_env, status); - - status = napi_create_async_work(_env, - resource, - resource_id, - OnAsyncWorkExecute, - OnAsyncWorkComplete, - this, - &_work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline AsyncWorker::~AsyncWorker() { - if (_work != nullptr) { - napi_delete_async_work(_env, _work); - _work = nullptr; - } -} - -inline void AsyncWorker::Destroy() { - delete this; -} - -inline AsyncWorker::AsyncWorker(AsyncWorker&& other) { - _env = other._env; - other._env = nullptr; - _work = other._work; - other._work = nullptr; - _receiver = std::move(other._receiver); - _callback = std::move(other._callback); - _error = std::move(other._error); - _suppress_destruct = other._suppress_destruct; -} - -inline AsyncWorker& AsyncWorker::operator=(AsyncWorker&& other) { - _env = other._env; - other._env = nullptr; - _work = other._work; - other._work = nullptr; - _receiver = std::move(other._receiver); - _callback = std::move(other._callback); - _error = std::move(other._error); - _suppress_destruct = other._suppress_destruct; - return *this; -} - -inline AsyncWorker::operator napi_async_work() const { - return _work; -} - -inline Napi::Env AsyncWorker::Env() const { - return Napi::Env(_env); -} - -inline void AsyncWorker::Queue() { - napi_status status = napi_queue_async_work(_env, _work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline void AsyncWorker::Cancel() { - napi_status status = napi_cancel_async_work(_env, _work); - NAPI_THROW_IF_FAILED_VOID(_env, status); -} - -inline ObjectReference& AsyncWorker::Receiver() { - return _receiver; -} - -inline FunctionReference& AsyncWorker::Callback() { - return _callback; -} - -inline void AsyncWorker::SuppressDestruct() { - _suppress_destruct = true; -} - -inline void AsyncWorker::OnOK() { - if (!_callback.IsEmpty()) { - _callback.Call(_receiver.Value(), GetResult(_callback.Env())); - } -} - -inline void AsyncWorker::OnError(const Error& e) { - if (!_callback.IsEmpty()) { - _callback.Call(_receiver.Value(), - std::initializer_list{e.Value()}); - } -} - -inline void AsyncWorker::SetError(const std::string& error) { - _error = error; -} - -inline std::vector AsyncWorker::GetResult(Napi::Env /*env*/) { - return {}; -} -// The OnAsyncWorkExecute method receives an napi_env argument. However, do NOT -// use it within this method, as it does not run on the JavaScript thread and -// must not run any method that would cause JavaScript to run. In practice, -// this means that almost any use of napi_env will be incorrect. -inline void AsyncWorker::OnAsyncWorkExecute(napi_env env, void* asyncworker) { - AsyncWorker* self = static_cast(asyncworker); - self->OnExecute(env); -} -// The OnExecute method receives an napi_env argument. However, do NOT -// use it within this method, as it does not run on the JavaScript thread and -// must not run any method that would cause JavaScript to run. In practice, -// this means that almost any use of napi_env will be incorrect. -inline void AsyncWorker::OnExecute(Napi::Env /*DO_NOT_USE*/) { -#ifdef NAPI_CPP_EXCEPTIONS - try { - Execute(); - } catch (const std::exception& e) { - SetError(e.what()); - } -#else // NAPI_CPP_EXCEPTIONS - Execute(); -#endif // NAPI_CPP_EXCEPTIONS -} - -inline void AsyncWorker::OnAsyncWorkComplete(napi_env env, - napi_status status, - void* asyncworker) { - AsyncWorker* self = static_cast(asyncworker); - self->OnWorkComplete(env, status); -} -inline void AsyncWorker::OnWorkComplete(Napi::Env /*env*/, napi_status status) { - if (status != napi_cancelled) { - HandleScope scope(_env); - details::WrapCallback([&] { - if (_error.size() == 0) { - OnOK(); - } else { - OnError(Error::New(_env, _error)); - } - return nullptr; - }); - } - if (!_suppress_destruct) { - Destroy(); - } -} - -#if (NAPI_VERSION > 3 && !defined(__wasm32__)) -//////////////////////////////////////////////////////////////////////////////// -// TypedThreadSafeFunction class -//////////////////////////////////////////////////////////////////////////////// - -// Starting with NAPI 5, the JavaScript function `func` parameter of -// `napi_create_threadsafe_function` is optional. -#if NAPI_VERSION > 4 -// static, with Callback [missing] Resource [missing] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - nullptr, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [missing] Resource [passed] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - nullptr, - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [missing] Resource [missing] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - nullptr, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [missing] Resource [passed] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - nullptr, - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} -#endif - -// static, with Callback [passed] Resource [missing] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - callback, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [passed] Resource [passed] Finalizer [missing] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - TypedThreadSafeFunction tsfn; - - napi_status status = - napi_create_threadsafe_function(env, - callback, - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - nullptr, - nullptr, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with Callback [passed] Resource [missing] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - callback, - nullptr, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -// static, with: Callback [passed] Resource [passed] Finalizer [passed] -template -template -inline TypedThreadSafeFunction -TypedThreadSafeFunction::New( - napi_env env, - CallbackType callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - TypedThreadSafeFunction tsfn; - - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = napi_create_threadsafe_function( - env, - details::DefaultCallbackWrapper< - CallbackType, - TypedThreadSafeFunction>(env, - callback), - resource, - String::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext, - context, - CallJsInternal, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED( - env, status, TypedThreadSafeFunction()); - } - - return tsfn; -} - -template -inline TypedThreadSafeFunction:: - TypedThreadSafeFunction() - : _tsfn() {} - -template -inline TypedThreadSafeFunction:: - TypedThreadSafeFunction(napi_threadsafe_function tsfn) - : _tsfn(tsfn) {} - -template -inline TypedThreadSafeFunction:: -operator napi_threadsafe_function() const { - return _tsfn; -} - -template -inline napi_status -TypedThreadSafeFunction::BlockingCall( - DataType* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); -} - -template -inline napi_status -TypedThreadSafeFunction::NonBlockingCall( - DataType* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); -} - -template -inline void TypedThreadSafeFunction::Ref( - napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_ref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -template -inline void TypedThreadSafeFunction::Unref( - napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_unref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -template -inline napi_status -TypedThreadSafeFunction::Acquire() const { - return napi_acquire_threadsafe_function(_tsfn); -} - -template -inline napi_status -TypedThreadSafeFunction::Release() const { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); -} - -template -inline napi_status -TypedThreadSafeFunction::Abort() const { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); -} - -template -inline ContextType* -TypedThreadSafeFunction::GetContext() const { - void* context; - napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); - NAPI_FATAL_IF_FAILED(status, - "TypedThreadSafeFunction::GetContext", - "napi_get_threadsafe_function_context"); - return static_cast(context); -} - -// static -template -void TypedThreadSafeFunction::CallJsInternal( - napi_env env, napi_value jsCallback, void* context, void* data) { - details::CallJsWrapper( - env, jsCallback, context, data); -} - -#if NAPI_VERSION == 4 -// static -template -Napi::Function -TypedThreadSafeFunction::EmptyFunctionFactory( - Napi::Env env) { - return Napi::Function::New(env, [](const CallbackInfo& cb) {}); -} - -// static -template -Napi::Function -TypedThreadSafeFunction::FunctionOrEmpty( - Napi::Env env, Napi::Function& callback) { - if (callback.IsEmpty()) { - return EmptyFunctionFactory(env); - } - return callback; -} - -#else -// static -template -std::nullptr_t -TypedThreadSafeFunction::EmptyFunctionFactory( - Napi::Env /*env*/) { - return nullptr; -} - -// static -template -Napi::Function -TypedThreadSafeFunction::FunctionOrEmpty( - Napi::Env /*env*/, Napi::Function& callback) { - return callback; -} - -#endif - -//////////////////////////////////////////////////////////////////////////////// -// ThreadSafeFunction class -//////////////////////////////////////////////////////////////////////////////// - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount) { - return New( - env, callback, Object(), resourceName, maxQueueSize, initialThreadCount); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - return New(env, - callback, - Object(), - resourceName, - maxQueueSize, - initialThreadCount, - context); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback) { - return New(env, - callback, - Object(), - resourceName, - maxQueueSize, - initialThreadCount, - finalizeCallback); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, - callback, - Object(), - resourceName, - maxQueueSize, - initialThreadCount, - finalizeCallback, - data); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback) { - return New(env, - callback, - Object(), - resourceName, - maxQueueSize, - initialThreadCount, - context, - finalizeCallback); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, - callback, - Object(), - resourceName, - maxQueueSize, - initialThreadCount, - context, - finalizeCallback, - data); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount) { - return New(env, - callback, - resource, - resourceName, - maxQueueSize, - initialThreadCount, - static_cast(nullptr) /* context */); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context) { - return New(env, - callback, - resource, - resourceName, - maxQueueSize, - initialThreadCount, - context, - [](Env, ContextType*) {} /* empty finalizer */); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback) { - return New(env, - callback, - resource, - resourceName, - maxQueueSize, - initialThreadCount, - static_cast(nullptr) /* context */, - finalizeCallback, - static_cast(nullptr) /* data */, - details::ThreadSafeFinalize::Wrapper); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New(env, - callback, - resource, - resourceName, - maxQueueSize, - initialThreadCount, - static_cast(nullptr) /* context */, - finalizeCallback, - data, - details::ThreadSafeFinalize:: - FinalizeWrapperWithData); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback) { - return New( - env, - callback, - resource, - resourceName, - maxQueueSize, - initialThreadCount, - context, - finalizeCallback, - static_cast(nullptr) /* data */, - details::ThreadSafeFinalize::FinalizeWrapperWithContext); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data) { - return New( - env, - callback, - resource, - resourceName, - maxQueueSize, - initialThreadCount, - context, - finalizeCallback, - data, - details::ThreadSafeFinalize:: - FinalizeFinalizeWrapperWithDataAndContext); -} - -inline ThreadSafeFunction::ThreadSafeFunction() : _tsfn() {} - -inline ThreadSafeFunction::ThreadSafeFunction(napi_threadsafe_function tsfn) - : _tsfn(tsfn) {} - -inline ThreadSafeFunction::operator napi_threadsafe_function() const { - return _tsfn; -} - -inline napi_status ThreadSafeFunction::BlockingCall() const { - return CallInternal(nullptr, napi_tsfn_blocking); -} - -template <> -inline napi_status ThreadSafeFunction::BlockingCall(void* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_blocking); -} - -template -inline napi_status ThreadSafeFunction::BlockingCall(Callback callback) const { - return CallInternal(new CallbackWrapper(callback), napi_tsfn_blocking); -} - -template -inline napi_status ThreadSafeFunction::BlockingCall(DataType* data, - Callback callback) const { - auto wrapper = [data, callback](Env env, Function jsCallback) { - callback(env, jsCallback, data); - }; - return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_blocking); -} - -inline napi_status ThreadSafeFunction::NonBlockingCall() const { - return CallInternal(nullptr, napi_tsfn_nonblocking); -} - -template <> -inline napi_status ThreadSafeFunction::NonBlockingCall(void* data) const { - return napi_call_threadsafe_function(_tsfn, data, napi_tsfn_nonblocking); -} - -template -inline napi_status ThreadSafeFunction::NonBlockingCall( - Callback callback) const { - return CallInternal(new CallbackWrapper(callback), napi_tsfn_nonblocking); -} - -template -inline napi_status ThreadSafeFunction::NonBlockingCall( - DataType* data, Callback callback) const { - auto wrapper = [data, callback](Env env, Function jsCallback) { - callback(env, jsCallback, data); - }; - return CallInternal(new CallbackWrapper(wrapper), napi_tsfn_nonblocking); -} - -inline void ThreadSafeFunction::Ref(napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_ref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -inline void ThreadSafeFunction::Unref(napi_env env) const { - if (_tsfn != nullptr) { - napi_status status = napi_unref_threadsafe_function(env, _tsfn); - NAPI_THROW_IF_FAILED_VOID(env, status); - } -} - -inline napi_status ThreadSafeFunction::Acquire() const { - return napi_acquire_threadsafe_function(_tsfn); -} - -inline napi_status ThreadSafeFunction::Release() const { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_release); -} - -inline napi_status ThreadSafeFunction::Abort() const { - return napi_release_threadsafe_function(_tsfn, napi_tsfn_abort); -} - -inline ThreadSafeFunction::ConvertibleContext ThreadSafeFunction::GetContext() - const { - void* context; - napi_status status = napi_get_threadsafe_function_context(_tsfn, &context); - NAPI_FATAL_IF_FAILED(status, - "ThreadSafeFunction::GetContext", - "napi_get_threadsafe_function_context"); - return ConvertibleContext({context}); -} - -// static -template -inline ThreadSafeFunction ThreadSafeFunction::New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data, - napi_finalize wrapper) { - static_assert(details::can_make_string::value || - std::is_convertible::value, - "Resource name should be convertible to the string type"); - - ThreadSafeFunction tsfn; - auto* finalizeData = new details:: - ThreadSafeFinalize( - {data, finalizeCallback}); - napi_status status = - napi_create_threadsafe_function(env, - callback, - resource, - Value::From(env, resourceName), - maxQueueSize, - initialThreadCount, - finalizeData, - wrapper, - context, - CallJS, - &tsfn._tsfn); - if (status != napi_ok) { - delete finalizeData; - NAPI_THROW_IF_FAILED(env, status, ThreadSafeFunction()); - } - - return tsfn; -} - -inline napi_status ThreadSafeFunction::CallInternal( - CallbackWrapper* callbackWrapper, - napi_threadsafe_function_call_mode mode) const { - napi_status status = - napi_call_threadsafe_function(_tsfn, callbackWrapper, mode); - if (status != napi_ok && callbackWrapper != nullptr) { - delete callbackWrapper; - } - - return status; -} - -// static -inline void ThreadSafeFunction::CallJS(napi_env env, - napi_value jsCallback, - void* /* context */, - void* data) { - if (env == nullptr && jsCallback == nullptr) { - return; - } - - if (data != nullptr) { - auto* callbackWrapper = static_cast(data); - (*callbackWrapper)(env, Function(env, jsCallback)); - delete callbackWrapper; - } else if (jsCallback != nullptr) { - Function(env, jsCallback).Call({}); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Async Progress Worker Base class -//////////////////////////////////////////////////////////////////////////////// -template -inline AsyncProgressWorkerBase::AsyncProgressWorkerBase( - const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource, - size_t queue_size) - : AsyncWorker(receiver, callback, resource_name, resource) { - // Fill all possible arguments to work around ambiguous - // ThreadSafeFunction::New signatures. - _tsfn = ThreadSafeFunction::New(callback.Env(), - callback, - resource, - resource_name, - queue_size, - /** initialThreadCount */ 1, - /** context */ this, - OnThreadSafeFunctionFinalize, - /** finalizeData */ this); -} - -#if NAPI_VERSION > 4 -template -inline AsyncProgressWorkerBase::AsyncProgressWorkerBase( - Napi::Env env, - const char* resource_name, - const Object& resource, - size_t queue_size) - : AsyncWorker(env, resource_name, resource) { - // TODO: Once the changes to make the callback optional for threadsafe - // functions are available on all versions we can remove the dummy Function - // here. - Function callback; - // Fill all possible arguments to work around ambiguous - // ThreadSafeFunction::New signatures. - _tsfn = ThreadSafeFunction::New(env, - callback, - resource, - resource_name, - queue_size, - /** initialThreadCount */ 1, - /** context */ this, - OnThreadSafeFunctionFinalize, - /** finalizeData */ this); -} -#endif - -template -inline AsyncProgressWorkerBase::~AsyncProgressWorkerBase() { - // Abort pending tsfn call. - // Don't send progress events after we've already completed. - // It's ok to call ThreadSafeFunction::Abort and ThreadSafeFunction::Release - // duplicated. - _tsfn.Abort(); -} - -template -inline void AsyncProgressWorkerBase::OnAsyncWorkProgress( - Napi::Env /* env */, Napi::Function /* jsCallback */, void* data) { - ThreadSafeData* tsd = static_cast(data); - tsd->asyncprogressworker()->OnWorkProgress(tsd->data()); - delete tsd; -} - -template -inline napi_status AsyncProgressWorkerBase::NonBlockingCall( - DataType* data) { - auto tsd = new AsyncProgressWorkerBase::ThreadSafeData(this, data); - auto ret = _tsfn.NonBlockingCall(tsd, OnAsyncWorkProgress); - if (ret != napi_ok) { - delete tsd; - } - return ret; -} - -template -inline void AsyncProgressWorkerBase::OnWorkComplete( - Napi::Env /* env */, napi_status status) { - _work_completed = true; - _complete_status = status; - _tsfn.Release(); -} - -template -inline void AsyncProgressWorkerBase::OnThreadSafeFunctionFinalize( - Napi::Env env, void* /* data */, AsyncProgressWorkerBase* context) { - if (context->_work_completed) { - context->AsyncWorker::OnWorkComplete(env, context->_complete_status); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Async Progress Worker class -//////////////////////////////////////////////////////////////////////////////// -template -inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback) - : AsyncProgressWorker(callback, "generic") {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, - const char* resource_name) - : AsyncProgressWorker( - callback, resource_name, Object::New(callback.Env())) {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressWorker( - Object::New(callback.Env()), callback, resource_name, resource) {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, - const Function& callback) - : AsyncProgressWorker(receiver, callback, "generic") {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name) - : AsyncProgressWorker( - receiver, callback, resource_name, Object::New(callback.Env())) {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase(receiver, callback, resource_name, resource), - _asyncdata(nullptr), - _asyncsize(0), - _signaled(false) {} - -#if NAPI_VERSION > 4 -template -inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env) - : AsyncProgressWorker(env, "generic") {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, - const char* resource_name) - : AsyncProgressWorker(env, resource_name, Object::New(env)) {} - -template -inline AsyncProgressWorker::AsyncProgressWorker(Napi::Env env, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase(env, resource_name, resource), - _asyncdata(nullptr), - _asyncsize(0) {} -#endif - -template -inline AsyncProgressWorker::~AsyncProgressWorker() { - { - std::lock_guard lock(this->_mutex); - _asyncdata = nullptr; - _asyncsize = 0; - } -} - -template -inline void AsyncProgressWorker::Execute() { - ExecutionProgress progress(this); - Execute(progress); -} - -template -inline void AsyncProgressWorker::OnWorkProgress(void*) { - T* data; - size_t size; - bool signaled; - { - std::lock_guard lock(this->_mutex); - data = this->_asyncdata; - size = this->_asyncsize; - signaled = this->_signaled; - this->_asyncdata = nullptr; - this->_asyncsize = 0; - this->_signaled = false; - } - - /** - * The callback of ThreadSafeFunction is not been invoked immediately on the - * callback of uv_async_t (uv io poll), rather the callback of TSFN is - * invoked on the right next uv idle callback. There are chances that during - * the deferring the signal of uv_async_t is been sent again, i.e. potential - * not coalesced two calls of the TSFN callback. - */ - if (data == nullptr && !signaled) { - return; - } - - this->OnProgress(data, size); - delete[] data; -} - -template -inline void AsyncProgressWorker::SendProgress_(const T* data, size_t count) { - T* new_data = new T[count]; - std::copy(data, data + count, new_data); - - T* old_data; - { - std::lock_guard lock(this->_mutex); - old_data = _asyncdata; - _asyncdata = new_data; - _asyncsize = count; - _signaled = false; - } - this->NonBlockingCall(nullptr); - - delete[] old_data; -} - -template -inline void AsyncProgressWorker::Signal() { - { - std::lock_guard lock(this->_mutex); - _signaled = true; - } - this->NonBlockingCall(static_cast(nullptr)); -} - -template -inline void AsyncProgressWorker::ExecutionProgress::Signal() const { - this->_worker->Signal(); -} - -template -inline void AsyncProgressWorker::ExecutionProgress::Send( - const T* data, size_t count) const { - _worker->SendProgress_(data, count); -} - -//////////////////////////////////////////////////////////////////////////////// -// Async Progress Queue Worker class -//////////////////////////////////////////////////////////////////////////////// -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - const Function& callback) - : AsyncProgressQueueWorker(callback, "generic") {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - const Function& callback, const char* resource_name) - : AsyncProgressQueueWorker( - callback, resource_name, Object::New(callback.Env())) {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - const Function& callback, const char* resource_name, const Object& resource) - : AsyncProgressQueueWorker( - Object::New(callback.Env()), callback, resource_name, resource) {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - const Object& receiver, const Function& callback) - : AsyncProgressQueueWorker(receiver, callback, "generic") {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - const Object& receiver, const Function& callback, const char* resource_name) - : AsyncProgressQueueWorker( - receiver, callback, resource_name, Object::New(callback.Env())) {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource) - : AsyncProgressWorkerBase>( - receiver, - callback, - resource_name, - resource, - /** unlimited queue size */ 0) {} - -#if NAPI_VERSION > 4 -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker(Napi::Env env) - : AsyncProgressQueueWorker(env, "generic") {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - Napi::Env env, const char* resource_name) - : AsyncProgressQueueWorker(env, resource_name, Object::New(env)) {} - -template -inline AsyncProgressQueueWorker::AsyncProgressQueueWorker( - Napi::Env env, const char* resource_name, const Object& resource) - : AsyncProgressWorkerBase>( - env, resource_name, resource, /** unlimited queue size */ 0) {} -#endif - -template -inline void AsyncProgressQueueWorker::Execute() { - ExecutionProgress progress(this); - Execute(progress); -} - -template -inline void AsyncProgressQueueWorker::OnWorkProgress( - std::pair* datapair) { - if (datapair == nullptr) { - return; - } - - T* data = datapair->first; - size_t size = datapair->second; - - this->OnProgress(data, size); - delete datapair; - delete[] data; -} - -template -inline void AsyncProgressQueueWorker::SendProgress_(const T* data, - size_t count) { - T* new_data = new T[count]; - std::copy(data, data + count, new_data); - - auto pair = new std::pair(new_data, count); - this->NonBlockingCall(pair); -} - -template -inline void AsyncProgressQueueWorker::Signal() const { - this->SendProgress_(static_cast(nullptr), 0); -} - -template -inline void AsyncProgressQueueWorker::OnWorkComplete(Napi::Env env, - napi_status status) { - // Draining queued items in TSFN. - AsyncProgressWorkerBase>::OnWorkComplete(env, status); -} - -template -inline void AsyncProgressQueueWorker::ExecutionProgress::Signal() const { - _worker->SendProgress_(static_cast(nullptr), 0); -} - -template -inline void AsyncProgressQueueWorker::ExecutionProgress::Send( - const T* data, size_t count) const { - _worker->SendProgress_(data, count); -} -#endif // NAPI_VERSION > 3 && !defined(__wasm32__) - -//////////////////////////////////////////////////////////////////////////////// -// Memory Management class -//////////////////////////////////////////////////////////////////////////////// - -inline int64_t MemoryManagement::AdjustExternalMemory(Env env, - int64_t change_in_bytes) { - int64_t result; - napi_status status = - napi_adjust_external_memory(env, change_in_bytes, &result); - NAPI_THROW_IF_FAILED(env, status, 0); - return result; -} - -//////////////////////////////////////////////////////////////////////////////// -// Version Management class -//////////////////////////////////////////////////////////////////////////////// - -inline uint32_t VersionManagement::GetNapiVersion(Env env) { - uint32_t result; - napi_status status = napi_get_version(env, &result); - NAPI_THROW_IF_FAILED(env, status, 0); - return result; -} - -inline const napi_node_version* VersionManagement::GetNodeVersion(Env env) { - const napi_node_version* result; - napi_status status = napi_get_node_version(env, &result); - NAPI_THROW_IF_FAILED(env, status, 0); - return result; -} - -#if NAPI_VERSION > 5 -//////////////////////////////////////////////////////////////////////////////// -// Addon class -//////////////////////////////////////////////////////////////////////////////// - -template -inline Object Addon::Init(Env env, Object exports) { - T* addon = new T(env, exports); - env.SetInstanceData(addon); - return addon->entry_point_; -} - -template -inline T* Addon::Unwrap(Object wrapper) { - return wrapper.Env().GetInstanceData(); -} - -template -inline void Addon::DefineAddon( - Object exports, const std::initializer_list& props) { - DefineProperties(exports, props); - entry_point_ = exports; -} - -template -inline Napi::Object Addon::DefineProperties( - Object object, const std::initializer_list& props) { - const napi_property_descriptor* properties = - reinterpret_cast(props.begin()); - size_t size = props.size(); - napi_status status = - napi_define_properties(object.Env(), object, size, properties); - NAPI_THROW_IF_FAILED(object.Env(), status, object); - for (size_t idx = 0; idx < size; idx++) - T::AttachPropData(object.Env(), object, &properties[idx]); - return object; -} -#endif // NAPI_VERSION > 5 - -#if NAPI_VERSION > 2 -template -Env::CleanupHook Env::AddCleanupHook(Hook hook, Arg* arg) { - return CleanupHook(*this, hook, arg); -} - -template -Env::CleanupHook Env::AddCleanupHook(Hook hook) { - return CleanupHook(*this, hook); -} - -template -Env::CleanupHook::CleanupHook() { - data = nullptr; -} - -template -Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook) - : wrapper(Env::CleanupHook::Wrapper) { - data = new CleanupData{std::move(hook), nullptr}; - napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); - if (status != napi_ok) { - delete data; - data = nullptr; - } -} - -template -Env::CleanupHook::CleanupHook(Napi::Env env, Hook hook, Arg* arg) - : wrapper(Env::CleanupHook::WrapperWithArg) { - data = new CleanupData{std::move(hook), arg}; - napi_status status = napi_add_env_cleanup_hook(env, wrapper, data); - if (status != napi_ok) { - delete data; - data = nullptr; - } -} - -template -bool Env::CleanupHook::Remove(Env env) { - napi_status status = napi_remove_env_cleanup_hook(env, wrapper, data); - delete data; - data = nullptr; - return status == napi_ok; -} - -template -bool Env::CleanupHook::IsEmpty() const { - return data == nullptr; -} -#endif // NAPI_VERSION > 2 - -#ifdef NAPI_CPP_CUSTOM_NAMESPACE -} // namespace NAPI_CPP_CUSTOM_NAMESPACE -#endif - -} // namespace Napi - -#endif // SRC_NAPI_INL_H_ diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/napi.h b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/napi.h deleted file mode 100644 index 831b3b6df..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/napi.h +++ /dev/null @@ -1,3114 +0,0 @@ -#ifndef SRC_NAPI_H_ -#define SRC_NAPI_H_ - -#include -#include -#include -#include -#include -#include -#include - -// VS2015 RTM has bugs with constexpr, so require min of VS2015 Update 3 (known -// good version) -#if !defined(_MSC_VER) || _MSC_FULL_VER >= 190024210 -#define NAPI_HAS_CONSTEXPR 1 -#endif - -// VS2013 does not support char16_t literal strings, so we'll work around it -// using wchar_t strings and casting them. This is safe as long as the character -// sizes are the same. -#if defined(_MSC_VER) && _MSC_VER <= 1800 -static_assert(sizeof(char16_t) == sizeof(wchar_t), - "Size mismatch between char16_t and wchar_t"); -#define NAPI_WIDE_TEXT(x) reinterpret_cast(L##x) -#else -#define NAPI_WIDE_TEXT(x) u##x -#endif - -// If C++ exceptions are not explicitly enabled or disabled, enable them -// if exceptions were enabled in the compiler settings. -#if !defined(NAPI_CPP_EXCEPTIONS) && !defined(NAPI_DISABLE_CPP_EXCEPTIONS) -#if defined(_CPPUNWIND) || defined(__EXCEPTIONS) -#define NAPI_CPP_EXCEPTIONS -#else -#error Exception support not detected. \ - Define either NAPI_CPP_EXCEPTIONS or NAPI_DISABLE_CPP_EXCEPTIONS. -#endif -#endif - -// If C++ NAPI_CPP_EXCEPTIONS are enabled, NODE_ADDON_API_ENABLE_MAYBE should -// not be set -#if defined(NAPI_CPP_EXCEPTIONS) && defined(NODE_ADDON_API_ENABLE_MAYBE) -#error NODE_ADDON_API_ENABLE_MAYBE should not be set when \ - NAPI_CPP_EXCEPTIONS is defined. -#endif - -#ifdef _NOEXCEPT -#define NAPI_NOEXCEPT _NOEXCEPT -#else -#define NAPI_NOEXCEPT noexcept -#endif - -#ifdef NAPI_CPP_EXCEPTIONS - -// When C++ exceptions are enabled, Errors are thrown directly. There is no need -// to return anything after the throw statements. The variadic parameter is an -// optional return value that is ignored. -// We need _VOID versions of the macros to avoid warnings resulting from -// leaving the NAPI_THROW_* `...` argument empty. - -#define NAPI_THROW(e, ...) throw e -#define NAPI_THROW_VOID(e) throw e - -#define NAPI_THROW_IF_FAILED(env, status, ...) \ - if ((status) != napi_ok) throw Napi::Error::New(env); - -#define NAPI_THROW_IF_FAILED_VOID(env, status) \ - if ((status) != napi_ok) throw Napi::Error::New(env); - -#else // NAPI_CPP_EXCEPTIONS - -// When C++ exceptions are disabled, Errors are thrown as JavaScript exceptions, -// which are pending until the callback returns to JS. The variadic parameter -// is an optional return value; usually it is an empty result. -// We need _VOID versions of the macros to avoid warnings resulting from -// leaving the NAPI_THROW_* `...` argument empty. - -#define NAPI_THROW(e, ...) \ - do { \ - (e).ThrowAsJavaScriptException(); \ - return __VA_ARGS__; \ - } while (0) - -#define NAPI_THROW_VOID(e) \ - do { \ - (e).ThrowAsJavaScriptException(); \ - return; \ - } while (0) - -#define NAPI_THROW_IF_FAILED(env, status, ...) \ - if ((status) != napi_ok) { \ - Napi::Error::New(env).ThrowAsJavaScriptException(); \ - return __VA_ARGS__; \ - } - -#define NAPI_THROW_IF_FAILED_VOID(env, status) \ - if ((status) != napi_ok) { \ - Napi::Error::New(env).ThrowAsJavaScriptException(); \ - return; \ - } - -#endif // NAPI_CPP_EXCEPTIONS - -#ifdef NODE_ADDON_API_ENABLE_MAYBE -#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ - NAPI_THROW_IF_FAILED(env, status, Napi::Nothing()) - -#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ - NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ - return Napi::Just(result); -#else -#define NAPI_MAYBE_THROW_IF_FAILED(env, status, type) \ - NAPI_THROW_IF_FAILED(env, status, type()) - -#define NAPI_RETURN_OR_THROW_IF_FAILED(env, status, result, type) \ - NAPI_MAYBE_THROW_IF_FAILED(env, status, type); \ - return result; -#endif - -#define NAPI_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; -#define NAPI_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; - -#define NAPI_DISALLOW_ASSIGN_COPY(CLASS) \ - NAPI_DISALLOW_ASSIGN(CLASS) \ - NAPI_DISALLOW_COPY(CLASS) - -#define NAPI_CHECK(condition, location, message) \ - do { \ - if (!(condition)) { \ - Napi::Error::Fatal((location), (message)); \ - } \ - } while (0) - -#define NAPI_FATAL_IF_FAILED(status, location, message) \ - NAPI_CHECK((status) == napi_ok, location, message) - -//////////////////////////////////////////////////////////////////////////////// -/// Node-API C++ Wrapper Classes -/// -/// These classes wrap the "Node-API" ABI-stable C APIs for Node.js, providing a -/// C++ object model and C++ exception-handling semantics with low overhead. -/// The wrappers are all header-only so that they do not affect the ABI. -//////////////////////////////////////////////////////////////////////////////// -namespace Napi { - -#ifdef NAPI_CPP_CUSTOM_NAMESPACE -// NAPI_CPP_CUSTOM_NAMESPACE can be #define'd per-addon to avoid symbol -// conflicts between different instances of node-addon-api - -// First dummy definition of the namespace to make sure that Napi::(name) still -// refers to the right things inside this file. -namespace NAPI_CPP_CUSTOM_NAMESPACE {} -using namespace NAPI_CPP_CUSTOM_NAMESPACE; - -namespace NAPI_CPP_CUSTOM_NAMESPACE { -#endif - -// Forward declarations -class Env; -class Value; -class Boolean; -class Number; -#if NAPI_VERSION > 5 -class BigInt; -#endif // NAPI_VERSION > 5 -#if (NAPI_VERSION > 4) -class Date; -#endif -class String; -class Object; -class Array; -class ArrayBuffer; -class Function; -class Error; -class PropertyDescriptor; -class CallbackInfo; -class TypedArray; -template -class TypedArrayOf; - -using Int8Array = - TypedArrayOf; ///< Typed-array of signed 8-bit integers -using Uint8Array = - TypedArrayOf; ///< Typed-array of unsigned 8-bit integers -using Int16Array = - TypedArrayOf; ///< Typed-array of signed 16-bit integers -using Uint16Array = - TypedArrayOf; ///< Typed-array of unsigned 16-bit integers -using Int32Array = - TypedArrayOf; ///< Typed-array of signed 32-bit integers -using Uint32Array = - TypedArrayOf; ///< Typed-array of unsigned 32-bit integers -using Float32Array = - TypedArrayOf; ///< Typed-array of 32-bit floating-point values -using Float64Array = - TypedArrayOf; ///< Typed-array of 64-bit floating-point values -#if NAPI_VERSION > 5 -using BigInt64Array = - TypedArrayOf; ///< Typed array of signed 64-bit integers -using BigUint64Array = - TypedArrayOf; ///< Typed array of unsigned 64-bit integers -#endif // NAPI_VERSION > 5 - -/// Defines the signature of a Node-API C++ module's registration callback -/// (init) function. -using ModuleRegisterCallback = Object (*)(Env env, Object exports); - -class MemoryManagement; - -/// A simple Maybe type, representing an object which may or may not have a -/// value. -/// -/// If an API method returns a Maybe<>, the API method can potentially fail -/// either because an exception is thrown, or because an exception is pending, -/// e.g. because a previous API call threw an exception that hasn't been -/// caught yet. In that case, a "Nothing" value is returned. -template -class Maybe { - public: - bool IsNothing() const; - bool IsJust() const; - - /// Short-hand for Unwrap(), which doesn't return a value. Could be used - /// where the actual value of the Maybe is not needed like Object::Set. - /// If this Maybe is nothing (empty), node-addon-api will crash the - /// process. - void Check() const; - - /// Return the value of type T contained in the Maybe. If this Maybe is - /// nothing (empty), node-addon-api will crash the process. - T Unwrap() const; - - /// Return the value of type T contained in the Maybe, or using a default - /// value if this Maybe is nothing (empty). - T UnwrapOr(const T& default_value) const; - - /// Converts this Maybe to a value of type T in the out. If this Maybe is - /// nothing (empty), `false` is returned and `out` is left untouched. - bool UnwrapTo(T* out) const; - - bool operator==(const Maybe& other) const; - bool operator!=(const Maybe& other) const; - - private: - Maybe(); - explicit Maybe(const T& t); - - bool _has_value; - T _value; - - template - friend Maybe Nothing(); - template - friend Maybe Just(const U& u); -}; - -template -inline Maybe Nothing(); - -template -inline Maybe Just(const T& t); - -#if defined(NODE_ADDON_API_ENABLE_MAYBE) -template -using MaybeOrValue = Maybe; -#else -template -using MaybeOrValue = T; -#endif - -/// Environment for Node-API values and operations. -/// -/// All Node-API values and operations must be associated with an environment. -/// An environment instance is always provided to callback functions; that -/// environment must then be used for any creation of Node-API values or other -/// Node-API operations within the callback. (Many methods infer the -/// environment from the `this` instance that the method is called on.) -/// -/// In the future, multiple environments per process may be supported, -/// although current implementations only support one environment per process. -/// -/// In the V8 JavaScript engine, a Node-API environment approximately -/// corresponds to an Isolate. -class Env { - private: - napi_env _env; -#if NAPI_VERSION > 5 - template - static void DefaultFini(Env, T* data); - template - static void DefaultFiniWithHint(Env, DataType* data, HintType* hint); -#endif // NAPI_VERSION > 5 - public: - Env(napi_env env); - - operator napi_env() const; - - Object Global() const; - Value Undefined() const; - Value Null() const; - - bool IsExceptionPending() const; - Error GetAndClearPendingException() const; - - MaybeOrValue RunScript(const char* utf8script) const; - MaybeOrValue RunScript(const std::string& utf8script) const; - MaybeOrValue RunScript(String script) const; - -#if NAPI_VERSION > 2 - template - class CleanupHook; - - template - CleanupHook AddCleanupHook(Hook hook); - - template - CleanupHook AddCleanupHook(Hook hook, Arg* arg); -#endif // NAPI_VERSION > 2 - -#if NAPI_VERSION > 5 - template - T* GetInstanceData() const; - - template - using Finalizer = void (*)(Env, T*); - template fini = Env::DefaultFini> - void SetInstanceData(T* data) const; - - template - using FinalizerWithHint = void (*)(Env, DataType*, HintType*); - template fini = - Env::DefaultFiniWithHint> - void SetInstanceData(DataType* data, HintType* hint) const; -#endif // NAPI_VERSION > 5 - -#if NAPI_VERSION > 2 - template - class CleanupHook { - public: - CleanupHook(); - CleanupHook(Env env, Hook hook, Arg* arg); - CleanupHook(Env env, Hook hook); - bool Remove(Env env); - bool IsEmpty() const; - - private: - static inline void Wrapper(void* data) NAPI_NOEXCEPT; - static inline void WrapperWithArg(void* data) NAPI_NOEXCEPT; - - void (*wrapper)(void* arg); - struct CleanupData { - Hook hook; - Arg* arg; - } * data; - }; -#endif // NAPI_VERSION > 2 -}; - -/// A JavaScript value of unknown type. -/// -/// For type-specific operations, convert to one of the Value subclasses using a -/// `To*` or `As()` method. The `To*` methods do type coercion; the `As()` -/// method does not. -/// -/// Napi::Value value = ... -/// if (!value.IsString()) throw Napi::TypeError::New(env, "Invalid -/// arg..."); Napi::String str = value.As(); // Cast to a -/// string value -/// -/// Napi::Value anotherValue = ... -/// bool isTruthy = anotherValue.ToBoolean(); // Coerce to a boolean value -class Value { - public: - Value(); ///< Creates a new _empty_ Value instance. - Value(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - /// Creates a JS value from a C++ primitive. - /// - /// `value` may be any of: - /// - bool - /// - Any integer type - /// - Any floating point type - /// - const char* (encoded using UTF-8, null-terminated) - /// - const char16_t* (encoded using UTF-16-LE, null-terminated) - /// - std::string (encoded using UTF-8) - /// - std::u16string - /// - napi::Value - /// - napi_value - template - static Value From(napi_env env, const T& value); - - /// Converts to a Node-API value primitive. - /// - /// If the instance is _empty_, this returns `nullptr`. - operator napi_value() const; - - /// Tests if this value strictly equals another value. - bool operator==(const Value& other) const; - - /// Tests if this value does not strictly equal another value. - bool operator!=(const Value& other) const; - - /// Tests if this value strictly equals another value. - bool StrictEquals(const Value& other) const; - - /// Gets the environment the value is associated with. - Napi::Env Env() const; - - /// Checks if the value is empty (uninitialized). - /// - /// An empty value is invalid, and most attempts to perform an operation on an - /// empty value will result in an exception. Note an empty value is distinct - /// from JavaScript `null` or `undefined`, which are valid values. - /// - /// When C++ exceptions are disabled at compile time, a method with a `Value` - /// return type may return an empty value to indicate a pending exception. So - /// when not using C++ exceptions, callers should check whether the value is - /// empty before attempting to use it. - bool IsEmpty() const; - - napi_valuetype Type() const; ///< Gets the type of the value. - - bool IsUndefined() - const; ///< Tests if a value is an undefined JavaScript value. - bool IsNull() const; ///< Tests if a value is a null JavaScript value. - bool IsBoolean() const; ///< Tests if a value is a JavaScript boolean. - bool IsNumber() const; ///< Tests if a value is a JavaScript number. -#if NAPI_VERSION > 5 - bool IsBigInt() const; ///< Tests if a value is a JavaScript bigint. -#endif // NAPI_VERSION > 5 -#if (NAPI_VERSION > 4) - bool IsDate() const; ///< Tests if a value is a JavaScript date. -#endif - bool IsString() const; ///< Tests if a value is a JavaScript string. - bool IsSymbol() const; ///< Tests if a value is a JavaScript symbol. - bool IsArray() const; ///< Tests if a value is a JavaScript array. - bool IsArrayBuffer() - const; ///< Tests if a value is a JavaScript array buffer. - bool IsTypedArray() const; ///< Tests if a value is a JavaScript typed array. - bool IsObject() const; ///< Tests if a value is a JavaScript object. - bool IsFunction() const; ///< Tests if a value is a JavaScript function. - bool IsPromise() const; ///< Tests if a value is a JavaScript promise. - bool IsDataView() const; ///< Tests if a value is a JavaScript data view. - bool IsBuffer() const; ///< Tests if a value is a Node buffer. - bool IsExternal() const; ///< Tests if a value is a pointer to external data. - - /// Casts to another type of `Napi::Value`, when the actual type is known or - /// assumed. - /// - /// This conversion does NOT coerce the type. Calling any methods - /// inappropriate for the actual value type will throw `Napi::Error`. - template - T As() const; - - MaybeOrValue ToBoolean() - const; ///< Coerces a value to a JavaScript boolean. - MaybeOrValue ToNumber() - const; ///< Coerces a value to a JavaScript number. - MaybeOrValue ToString() - const; ///< Coerces a value to a JavaScript string. - MaybeOrValue ToObject() - const; ///< Coerces a value to a JavaScript object. - - protected: - /// !cond INTERNAL - napi_env _env; - napi_value _value; - /// !endcond -}; - -/// A JavaScript boolean value. -class Boolean : public Value { - public: - static Boolean New(napi_env env, ///< Node-API environment - bool value ///< Boolean value - ); - - Boolean(); ///< Creates a new _empty_ Boolean instance. - Boolean(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - operator bool() const; ///< Converts a Boolean value to a boolean primitive. - bool Value() const; ///< Converts a Boolean value to a boolean primitive. -}; - -/// A JavaScript number value. -class Number : public Value { - public: - static Number New(napi_env env, ///< Node-API environment - double value ///< Number value - ); - - Number(); ///< Creates a new _empty_ Number instance. - Number(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - operator int32_t() - const; ///< Converts a Number value to a 32-bit signed integer value. - operator uint32_t() - const; ///< Converts a Number value to a 32-bit unsigned integer value. - operator int64_t() - const; ///< Converts a Number value to a 64-bit signed integer value. - operator float() - const; ///< Converts a Number value to a 32-bit floating-point value. - operator double() - const; ///< Converts a Number value to a 64-bit floating-point value. - - int32_t Int32Value() - const; ///< Converts a Number value to a 32-bit signed integer value. - uint32_t Uint32Value() - const; ///< Converts a Number value to a 32-bit unsigned integer value. - int64_t Int64Value() - const; ///< Converts a Number value to a 64-bit signed integer value. - float FloatValue() - const; ///< Converts a Number value to a 32-bit floating-point value. - double DoubleValue() - const; ///< Converts a Number value to a 64-bit floating-point value. -}; - -#if NAPI_VERSION > 5 -/// A JavaScript bigint value. -class BigInt : public Value { - public: - static BigInt New(napi_env env, ///< Node-API environment - int64_t value ///< Number value - ); - static BigInt New(napi_env env, ///< Node-API environment - uint64_t value ///< Number value - ); - - /// Creates a new BigInt object using a specified sign bit and a - /// specified list of digits/words. - /// The resulting number is calculated as: - /// (-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...) - static BigInt New(napi_env env, ///< Node-API environment - int sign_bit, ///< Sign bit. 1 if negative. - size_t word_count, ///< Number of words in array - const uint64_t* words ///< Array of words - ); - - BigInt(); ///< Creates a new _empty_ BigInt instance. - BigInt(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - int64_t Int64Value(bool* lossless) - const; ///< Converts a BigInt value to a 64-bit signed integer value. - uint64_t Uint64Value(bool* lossless) - const; ///< Converts a BigInt value to a 64-bit unsigned integer value. - - size_t WordCount() const; ///< The number of 64-bit words needed to store - ///< the result of ToWords(). - - /// Writes the contents of this BigInt to a specified memory location. - /// `sign_bit` must be provided and will be set to 1 if this BigInt is - /// negative. - /// `*word_count` has to be initialized to the length of the `words` array. - /// Upon return, it will be set to the actual number of words that would - /// be needed to store this BigInt (i.e. the return value of `WordCount()`). - void ToWords(int* sign_bit, size_t* word_count, uint64_t* words); -}; -#endif // NAPI_VERSION > 5 - -#if (NAPI_VERSION > 4) -/// A JavaScript date value. -class Date : public Value { - public: - /// Creates a new Date value from a double primitive. - static Date New(napi_env env, ///< Node-API environment - double value ///< Number value - ); - - Date(); ///< Creates a new _empty_ Date instance. - Date(napi_env env, napi_value value); ///< Wraps a Node-API value primitive. - operator double() const; ///< Converts a Date value to double primitive - - double ValueOf() const; ///< Converts a Date value to a double primitive. -}; -#endif - -/// A JavaScript string or symbol value (that can be used as a property name). -class Name : public Value { - public: - Name(); ///< Creates a new _empty_ Name instance. - Name(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. -}; - -/// A JavaScript string value. -class String : public Name { - public: - /// Creates a new String value from a UTF-8 encoded C++ string. - static String New(napi_env env, ///< Node-API environment - const std::string& value ///< UTF-8 encoded C++ string - ); - - /// Creates a new String value from a UTF-16 encoded C++ string. - static String New(napi_env env, ///< Node-API environment - const std::u16string& value ///< UTF-16 encoded C++ string - ); - - /// Creates a new String value from a UTF-8 encoded C string. - static String New( - napi_env env, ///< Node-API environment - const char* value ///< UTF-8 encoded null-terminated C string - ); - - /// Creates a new String value from a UTF-16 encoded C string. - static String New( - napi_env env, ///< Node-API environment - const char16_t* value ///< UTF-16 encoded null-terminated C string - ); - - /// Creates a new String value from a UTF-8 encoded C string with specified - /// length. - static String New(napi_env env, ///< Node-API environment - const char* value, ///< UTF-8 encoded C string (not - ///< necessarily null-terminated) - size_t length ///< length of the string in bytes - ); - - /// Creates a new String value from a UTF-16 encoded C string with specified - /// length. - static String New( - napi_env env, ///< Node-API environment - const char16_t* value, ///< UTF-16 encoded C string (not necessarily - ///< null-terminated) - size_t length ///< Length of the string in 2-byte code units - ); - - /// Creates a new String based on the original object's type. - /// - /// `value` may be any of: - /// - const char* (encoded using UTF-8, null-terminated) - /// - const char16_t* (encoded using UTF-16-LE, null-terminated) - /// - std::string (encoded using UTF-8) - /// - std::u16string - template - static String From(napi_env env, const T& value); - - String(); ///< Creates a new _empty_ String instance. - String(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - operator std::string() - const; ///< Converts a String value to a UTF-8 encoded C++ string. - operator std::u16string() - const; ///< Converts a String value to a UTF-16 encoded C++ string. - std::string Utf8Value() - const; ///< Converts a String value to a UTF-8 encoded C++ string. - std::u16string Utf16Value() - const; ///< Converts a String value to a UTF-16 encoded C++ string. -}; - -/// A JavaScript symbol value. -class Symbol : public Name { - public: - /// Creates a new Symbol value with an optional description. - static Symbol New( - napi_env env, ///< Node-API environment - const char* description = - nullptr ///< Optional UTF-8 encoded null-terminated C string - /// describing the symbol - ); - - /// Creates a new Symbol value with a description. - static Symbol New( - napi_env env, ///< Node-API environment - const std::string& - description ///< UTF-8 encoded C++ string describing the symbol - ); - - /// Creates a new Symbol value with a description. - static Symbol New(napi_env env, ///< Node-API environment - String description ///< String value describing the symbol - ); - - /// Creates a new Symbol value with a description. - static Symbol New( - napi_env env, ///< Node-API environment - napi_value description ///< String value describing the symbol - ); - - /// Get a public Symbol (e.g. Symbol.iterator). - static MaybeOrValue WellKnown(napi_env, const std::string& name); - - // Create a symbol in the global registry, UTF-8 Encoded cpp string - static MaybeOrValue For(napi_env env, const std::string& description); - - // Create a symbol in the global registry, C style string (null terminated) - static MaybeOrValue For(napi_env env, const char* description); - - // Create a symbol in the global registry, String value describing the symbol - static MaybeOrValue For(napi_env env, String description); - - // Create a symbol in the global registry, napi_value describing the symbol - static MaybeOrValue For(napi_env env, napi_value description); - - Symbol(); ///< Creates a new _empty_ Symbol instance. - Symbol(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. -}; - -/// A JavaScript object value. -class Object : public Value { - public: - /// Enables property and element assignments using indexing syntax. - /// - /// This is a convenient helper to get and set object properties. As - /// getting and setting object properties may throw with JavaScript - /// exceptions, it is notable that these operations may fail. - /// When NODE_ADDON_API_ENABLE_MAYBE is defined, the process will abort - /// on JavaScript exceptions. - /// - /// Example: - /// - /// Napi::Value propertyValue = object1['A']; - /// object2['A'] = propertyValue; - /// Napi::Value elementValue = array[0]; - /// array[1] = elementValue; - template - class PropertyLValue { - public: - /// Converts an L-value to a value. - operator Value() const; - - /// Assigns a value to the property. The type of value can be - /// anything supported by `Object::Set`. - template - PropertyLValue& operator=(ValueType value); - - private: - PropertyLValue() = delete; - PropertyLValue(Object object, Key key); - napi_env _env; - napi_value _object; - Key _key; - - friend class Napi::Object; - }; - - /// Creates a new Object value. - static Object New(napi_env env ///< Node-API environment - ); - - Object(); ///< Creates a new _empty_ Object instance. - Object(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - /// Gets or sets a named property. - PropertyLValue operator[]( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ); - - /// Gets or sets a named property. - PropertyLValue operator[]( - const std::string& utf8name ///< UTF-8 encoded property name - ); - - /// Gets or sets an indexed property or array element. - PropertyLValue operator[]( - uint32_t index /// Property / element index - ); - - /// Gets or sets an indexed property or array element. - PropertyLValue operator[](Value index /// Property / element index - ) const; - - /// Gets a named property. - MaybeOrValue operator[]( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Gets a named property. - MaybeOrValue operator[]( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Gets an indexed property or array element. - MaybeOrValue operator[](uint32_t index ///< Property / element index - ) const; - - /// Checks whether a property is present. - MaybeOrValue Has(napi_value key ///< Property key primitive - ) const; - - /// Checks whether a property is present. - MaybeOrValue Has(Value key ///< Property key - ) const; - - /// Checks whether a named property is present. - MaybeOrValue Has( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Checks whether a named property is present. - MaybeOrValue Has( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty(napi_value key ///< Property key primitive - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty(Value key ///< Property key - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Checks whether a own property is present. - MaybeOrValue HasOwnProperty( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Gets a property. - MaybeOrValue Get(napi_value key ///< Property key primitive - ) const; - - /// Gets a property. - MaybeOrValue Get(Value key ///< Property key - ) const; - - /// Gets a named property. - MaybeOrValue Get( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Gets a named property. - MaybeOrValue Get( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Sets a property. - template - MaybeOrValue Set(napi_value key, ///< Property key primitive - const ValueType& value ///< Property value primitive - ) const; - - /// Sets a property. - template - MaybeOrValue Set(Value key, ///< Property key - const ValueType& value ///< Property value - ) const; - - /// Sets a named property. - template - MaybeOrValue Set( - const char* utf8name, ///< UTF-8 encoded null-terminated property name - const ValueType& value) const; - - /// Sets a named property. - template - MaybeOrValue Set( - const std::string& utf8name, ///< UTF-8 encoded property name - const ValueType& value ///< Property value primitive - ) const; - - /// Delete property. - MaybeOrValue Delete(napi_value key ///< Property key primitive - ) const; - - /// Delete property. - MaybeOrValue Delete(Value key ///< Property key - ) const; - - /// Delete property. - MaybeOrValue Delete( - const char* utf8name ///< UTF-8 encoded null-terminated property name - ) const; - - /// Delete property. - MaybeOrValue Delete( - const std::string& utf8name ///< UTF-8 encoded property name - ) const; - - /// Checks whether an indexed property is present. - MaybeOrValue Has(uint32_t index ///< Property / element index - ) const; - - /// Gets an indexed property or array element. - MaybeOrValue Get(uint32_t index ///< Property / element index - ) const; - - /// Sets an indexed property or array element. - template - MaybeOrValue Set(uint32_t index, ///< Property / element index - const ValueType& value ///< Property value primitive - ) const; - - /// Deletes an indexed property or array element. - MaybeOrValue Delete(uint32_t index ///< Property / element index - ) const; - - /// This operation can fail in case of Proxy.[[OwnPropertyKeys]] and - /// Proxy.[[GetOwnProperty]] calling into JavaScript. See: - /// - - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys - /// - - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p - MaybeOrValue GetPropertyNames() const; ///< Get all property names - - /// Defines a property on the object. - /// - /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling - /// into JavaScript. See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc - MaybeOrValue DefineProperty( - const PropertyDescriptor& - property ///< Descriptor for the property to be defined - ) const; - - /// Defines properties on the object. - /// - /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling - /// into JavaScript. See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc - MaybeOrValue DefineProperties( - const std::initializer_list& properties - ///< List of descriptors for the properties to be defined - ) const; - - /// Defines properties on the object. - /// - /// This operation can fail in case of Proxy.[[DefineOwnProperty]] calling - /// into JavaScript. See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc - MaybeOrValue DefineProperties( - const std::vector& properties - ///< Vector of descriptors for the properties to be defined - ) const; - - /// Checks if an object is an instance created by a constructor function. - /// - /// This is equivalent to the JavaScript `instanceof` operator. - /// - /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into - /// JavaScript. - /// See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof - MaybeOrValue InstanceOf( - const Function& constructor ///< Constructor function - ) const; - - template - inline void AddFinalizer(Finalizer finalizeCallback, T* data) const; - - template - inline void AddFinalizer(Finalizer finalizeCallback, - T* data, - Hint* finalizeHint) const; - -#ifdef NAPI_CPP_EXCEPTIONS - class const_iterator; - - inline const_iterator begin() const; - - inline const_iterator end() const; - - class iterator; - - inline iterator begin(); - - inline iterator end(); -#endif // NAPI_CPP_EXCEPTIONS - -#if NAPI_VERSION >= 8 - /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into - /// JavaScript. - /// See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof - MaybeOrValue Freeze() const; - /// This operation can fail in case of Proxy.[[GetPrototypeOf]] calling into - /// JavaScript. - /// See - /// https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof - MaybeOrValue Seal() const; -#endif // NAPI_VERSION >= 8 -}; - -template -class External : public Value { - public: - static External New(napi_env env, T* data); - - // Finalizer must implement `void operator()(Env env, T* data)`. - template - static External New(napi_env env, T* data, Finalizer finalizeCallback); - // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. - template - static External New(napi_env env, - T* data, - Finalizer finalizeCallback, - Hint* finalizeHint); - - External(); - External(napi_env env, napi_value value); - - T* Data() const; -}; - -class Array : public Object { - public: - static Array New(napi_env env); - static Array New(napi_env env, size_t length); - - Array(); - Array(napi_env env, napi_value value); - - uint32_t Length() const; -}; - -#ifdef NAPI_CPP_EXCEPTIONS -class Object::const_iterator { - private: - enum class Type { BEGIN, END }; - - inline const_iterator(const Object* object, const Type type); - - public: - inline const_iterator& operator++(); - - inline bool operator==(const const_iterator& other) const; - - inline bool operator!=(const const_iterator& other) const; - - inline const std::pair> operator*() - const; - - private: - const Napi::Object* _object; - Array _keys; - uint32_t _index; - - friend class Object; -}; - -class Object::iterator { - private: - enum class Type { BEGIN, END }; - - inline iterator(Object* object, const Type type); - - public: - inline iterator& operator++(); - - inline bool operator==(const iterator& other) const; - - inline bool operator!=(const iterator& other) const; - - inline std::pair> operator*(); - - private: - Napi::Object* _object; - Array _keys; - uint32_t _index; - - friend class Object; -}; -#endif // NAPI_CPP_EXCEPTIONS - -/// A JavaScript array buffer value. -class ArrayBuffer : public Object { - public: - /// Creates a new ArrayBuffer instance over a new automatically-allocated - /// buffer. - static ArrayBuffer New( - napi_env env, ///< Node-API environment - size_t byteLength ///< Length of the buffer to be allocated, in bytes - ); - - /// Creates a new ArrayBuffer instance, using an external buffer with - /// specified byte length. - static ArrayBuffer New( - napi_env env, ///< Node-API environment - void* externalData, ///< Pointer to the external buffer to be used by - ///< the array - size_t byteLength ///< Length of the external buffer to be used by the - ///< array, in bytes - ); - - /// Creates a new ArrayBuffer instance, using an external buffer with - /// specified byte length. - template - static ArrayBuffer New( - napi_env env, ///< Node-API environment - void* externalData, ///< Pointer to the external buffer to be used by - ///< the array - size_t byteLength, ///< Length of the external buffer to be used by the - ///< array, - /// in bytes - Finalizer finalizeCallback ///< Function to be called when the array - ///< buffer is destroyed; - /// must implement `void operator()(Env env, - /// void* externalData)` - ); - - /// Creates a new ArrayBuffer instance, using an external buffer with - /// specified byte length. - template - static ArrayBuffer New( - napi_env env, ///< Node-API environment - void* externalData, ///< Pointer to the external buffer to be used by - ///< the array - size_t byteLength, ///< Length of the external buffer to be used by the - ///< array, - /// in bytes - Finalizer finalizeCallback, ///< Function to be called when the array - ///< buffer is destroyed; - /// must implement `void operator()(Env - /// env, void* externalData, Hint* hint)` - Hint* finalizeHint ///< Hint (second parameter) to be passed to the - ///< finalize callback - ); - - ArrayBuffer(); ///< Creates a new _empty_ ArrayBuffer instance. - ArrayBuffer(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - void* Data(); ///< Gets a pointer to the data buffer. - size_t ByteLength(); ///< Gets the length of the array buffer in bytes. - -#if NAPI_VERSION >= 7 - bool IsDetached() const; - void Detach(); -#endif // NAPI_VERSION >= 7 -}; - -/// A JavaScript typed-array value with unknown array type. -/// -/// For type-specific operations, cast to a `TypedArrayOf` instance using the -/// `As()` method: -/// -/// Napi::TypedArray array = ... -/// if (t.TypedArrayType() == napi_int32_array) { -/// Napi::Int32Array int32Array = t.As(); -/// } -class TypedArray : public Object { - public: - TypedArray(); ///< Creates a new _empty_ TypedArray instance. - TypedArray(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - napi_typedarray_type TypedArrayType() - const; ///< Gets the type of this typed-array. - Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. - - uint8_t ElementSize() - const; ///< Gets the size in bytes of one element in the array. - size_t ElementLength() const; ///< Gets the number of elements in the array. - size_t ByteOffset() - const; ///< Gets the offset into the buffer where the array starts. - size_t ByteLength() const; ///< Gets the length of the array in bytes. - - protected: - /// !cond INTERNAL - napi_typedarray_type _type; - size_t _length; - - TypedArray(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length); - - template - static -#if defined(NAPI_HAS_CONSTEXPR) - constexpr -#endif - napi_typedarray_type - TypedArrayTypeForPrimitiveType() { - return std::is_same::value ? napi_int8_array - : std::is_same::value ? napi_uint8_array - : std::is_same::value ? napi_int16_array - : std::is_same::value ? napi_uint16_array - : std::is_same::value ? napi_int32_array - : std::is_same::value ? napi_uint32_array - : std::is_same::value ? napi_float32_array - : std::is_same::value ? napi_float64_array -#if NAPI_VERSION > 5 - : std::is_same::value ? napi_bigint64_array - : std::is_same::value ? napi_biguint64_array -#endif // NAPI_VERSION > 5 - : napi_int8_array; - } - /// !endcond -}; - -/// A JavaScript typed-array value with known array type. -/// -/// Note while it is possible to create and access Uint8 "clamped" arrays using -/// this class, the _clamping_ behavior is only applied in JavaScript. -template -class TypedArrayOf : public TypedArray { - public: - /// Creates a new TypedArray instance over a new automatically-allocated array - /// buffer. - /// - /// The array type parameter can normally be omitted (because it is inferred - /// from the template parameter T), except when creating a "clamped" array: - /// - /// Uint8Array::New(env, length, napi_uint8_clamped_array) - static TypedArrayOf New( - napi_env env, ///< Node-API environment - size_t elementLength, ///< Length of the created array, as a number of - ///< elements -#if defined(NAPI_HAS_CONSTEXPR) - napi_typedarray_type type = - TypedArray::TypedArrayTypeForPrimitiveType() -#else - napi_typedarray_type type -#endif - ///< Type of array, if different from the default array type for the - ///< template parameter T. - ); - - /// Creates a new TypedArray instance over a provided array buffer. - /// - /// The array type parameter can normally be omitted (because it is inferred - /// from the template parameter T), except when creating a "clamped" array: - /// - /// Uint8Array::New(env, length, buffer, 0, napi_uint8_clamped_array) - static TypedArrayOf New( - napi_env env, ///< Node-API environment - size_t elementLength, ///< Length of the created array, as a number of - ///< elements - Napi::ArrayBuffer arrayBuffer, ///< Backing array buffer instance to use - size_t bufferOffset, ///< Offset into the array buffer where the - ///< typed-array starts -#if defined(NAPI_HAS_CONSTEXPR) - napi_typedarray_type type = - TypedArray::TypedArrayTypeForPrimitiveType() -#else - napi_typedarray_type type -#endif - ///< Type of array, if different from the default array type for the - ///< template parameter T. - ); - - TypedArrayOf(); ///< Creates a new _empty_ TypedArrayOf instance. - TypedArrayOf(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - T& operator[](size_t index); ///< Gets or sets an element in the array. - const T& operator[](size_t index) const; ///< Gets an element in the array. - - /// Gets a pointer to the array's backing buffer. - /// - /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, - /// because the typed-array may have a non-zero `ByteOffset()` into the - /// `ArrayBuffer`. - T* Data(); - - /// Gets a pointer to the array's backing buffer. - /// - /// This is not necessarily the same as the `ArrayBuffer::Data()` pointer, - /// because the typed-array may have a non-zero `ByteOffset()` into the - /// `ArrayBuffer`. - const T* Data() const; - - private: - T* _data; - - TypedArrayOf(napi_env env, - napi_value value, - napi_typedarray_type type, - size_t length, - T* data); -}; - -/// The DataView provides a low-level interface for reading/writing multiple -/// number types in an ArrayBuffer irrespective of the platform's endianness. -class DataView : public Object { - public: - static DataView New(napi_env env, Napi::ArrayBuffer arrayBuffer); - static DataView New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset); - static DataView New(napi_env env, - Napi::ArrayBuffer arrayBuffer, - size_t byteOffset, - size_t byteLength); - - DataView(); ///< Creates a new _empty_ DataView instance. - DataView(napi_env env, - napi_value value); ///< Wraps a Node-API value primitive. - - Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. - size_t ByteOffset() - const; ///< Gets the offset into the buffer where the array starts. - size_t ByteLength() const; ///< Gets the length of the array in bytes. - - void* Data() const; - - float GetFloat32(size_t byteOffset) const; - double GetFloat64(size_t byteOffset) const; - int8_t GetInt8(size_t byteOffset) const; - int16_t GetInt16(size_t byteOffset) const; - int32_t GetInt32(size_t byteOffset) const; - uint8_t GetUint8(size_t byteOffset) const; - uint16_t GetUint16(size_t byteOffset) const; - uint32_t GetUint32(size_t byteOffset) const; - - void SetFloat32(size_t byteOffset, float value) const; - void SetFloat64(size_t byteOffset, double value) const; - void SetInt8(size_t byteOffset, int8_t value) const; - void SetInt16(size_t byteOffset, int16_t value) const; - void SetInt32(size_t byteOffset, int32_t value) const; - void SetUint8(size_t byteOffset, uint8_t value) const; - void SetUint16(size_t byteOffset, uint16_t value) const; - void SetUint32(size_t byteOffset, uint32_t value) const; - - private: - template - T ReadData(size_t byteOffset) const; - - template - void WriteData(size_t byteOffset, T value) const; - - void* _data; - size_t _length; -}; - -class Function : public Object { - public: - using VoidCallback = void (*)(const CallbackInfo& info); - using Callback = Value (*)(const CallbackInfo& info); - - template - static Function New(napi_env env, - const char* utf8name = nullptr, - void* data = nullptr); - - template - static Function New(napi_env env, - const char* utf8name = nullptr, - void* data = nullptr); - - template - static Function New(napi_env env, - const std::string& utf8name, - void* data = nullptr); - - template - static Function New(napi_env env, - const std::string& utf8name, - void* data = nullptr); - - /// Callable must implement operator() accepting a const CallbackInfo& - /// and return either void or Value. - template - static Function New(napi_env env, - Callable cb, - const char* utf8name = nullptr, - void* data = nullptr); - /// Callable must implement operator() accepting a const CallbackInfo& - /// and return either void or Value. - template - static Function New(napi_env env, - Callable cb, - const std::string& utf8name, - void* data = nullptr); - - Function(); - Function(napi_env env, napi_value value); - - MaybeOrValue operator()( - const std::initializer_list& args) const; - - MaybeOrValue Call(const std::initializer_list& args) const; - MaybeOrValue Call(const std::vector& args) const; - MaybeOrValue Call(const std::vector& args) const; - MaybeOrValue Call(size_t argc, const napi_value* args) const; - MaybeOrValue Call(napi_value recv, - const std::initializer_list& args) const; - MaybeOrValue Call(napi_value recv, - const std::vector& args) const; - MaybeOrValue Call(napi_value recv, - const std::vector& args) const; - MaybeOrValue Call(napi_value recv, - size_t argc, - const napi_value* args) const; - - MaybeOrValue MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback(napi_value recv, - const std::vector& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback(napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context = nullptr) const; - - MaybeOrValue New(const std::initializer_list& args) const; - MaybeOrValue New(const std::vector& args) const; - MaybeOrValue New(size_t argc, const napi_value* args) const; -}; - -class Promise : public Object { - public: - class Deferred { - public: - static Deferred New(napi_env env); - Deferred(napi_env env); - - Napi::Promise Promise() const; - Napi::Env Env() const; - - void Resolve(napi_value value) const; - void Reject(napi_value value) const; - - private: - napi_env _env; - napi_deferred _deferred; - napi_value _promise; - }; - - Promise(napi_env env, napi_value value); -}; - -template -class Buffer : public Uint8Array { - public: - static Buffer New(napi_env env, size_t length); - static Buffer New(napi_env env, T* data, size_t length); - - // Finalizer must implement `void operator()(Env env, T* data)`. - template - static Buffer New(napi_env env, - T* data, - size_t length, - Finalizer finalizeCallback); - // Finalizer must implement `void operator()(Env env, T* data, Hint* hint)`. - template - static Buffer New(napi_env env, - T* data, - size_t length, - Finalizer finalizeCallback, - Hint* finalizeHint); - - static Buffer Copy(napi_env env, const T* data, size_t length); - - Buffer(); - Buffer(napi_env env, napi_value value); - size_t Length() const; - T* Data() const; - - private: - mutable size_t _length; - mutable T* _data; - - Buffer(napi_env env, napi_value value, size_t length, T* data); - void EnsureInfo() const; -}; - -/// Holds a counted reference to a value; initially a weak reference unless -/// otherwise specified, may be changed to/from a strong reference by adjusting -/// the refcount. -/// -/// The referenced value is not immediately destroyed when the reference count -/// is zero; it is merely then eligible for garbage-collection if there are no -/// other references to the value. -template -class Reference { - public: - static Reference New(const T& value, uint32_t initialRefcount = 0); - - Reference(); - Reference(napi_env env, napi_ref ref); - ~Reference(); - - // A reference can be moved but cannot be copied. - Reference(Reference&& other); - Reference& operator=(Reference&& other); - NAPI_DISALLOW_ASSIGN(Reference) - - operator napi_ref() const; - bool operator==(const Reference& other) const; - bool operator!=(const Reference& other) const; - - Napi::Env Env() const; - bool IsEmpty() const; - - // Note when getting the value of a Reference it is usually correct to do so - // within a HandleScope so that the value handle gets cleaned up efficiently. - T Value() const; - - uint32_t Ref() const; - uint32_t Unref() const; - void Reset(); - void Reset(const T& value, uint32_t refcount = 0); - - // Call this on a reference that is declared as static data, to prevent its - // destructor from running at program shutdown time, which would attempt to - // reset the reference when the environment is no longer valid. Avoid using - // this if at all possible. If you do need to use static data, MAKE SURE to - // warn your users that your addon is NOT threadsafe. - void SuppressDestruct(); - - protected: - Reference(const Reference&); - - /// !cond INTERNAL - napi_env _env; - napi_ref _ref; - /// !endcond - - private: - bool _suppressDestruct; -}; - -class ObjectReference : public Reference { - public: - ObjectReference(); - ObjectReference(napi_env env, napi_ref ref); - - // A reference can be moved but cannot be copied. - ObjectReference(Reference&& other); - ObjectReference& operator=(Reference&& other); - ObjectReference(ObjectReference&& other); - ObjectReference& operator=(ObjectReference&& other); - NAPI_DISALLOW_ASSIGN(ObjectReference) - - MaybeOrValue Get(const char* utf8name) const; - MaybeOrValue Get(const std::string& utf8name) const; - MaybeOrValue Set(const char* utf8name, napi_value value) const; - MaybeOrValue Set(const char* utf8name, Napi::Value value) const; - MaybeOrValue Set(const char* utf8name, const char* utf8value) const; - MaybeOrValue Set(const char* utf8name, bool boolValue) const; - MaybeOrValue Set(const char* utf8name, double numberValue) const; - MaybeOrValue Set(const std::string& utf8name, napi_value value) const; - MaybeOrValue Set(const std::string& utf8name, Napi::Value value) const; - MaybeOrValue Set(const std::string& utf8name, - std::string& utf8value) const; - MaybeOrValue Set(const std::string& utf8name, bool boolValue) const; - MaybeOrValue Set(const std::string& utf8name, double numberValue) const; - - MaybeOrValue Get(uint32_t index) const; - MaybeOrValue Set(uint32_t index, const napi_value value) const; - MaybeOrValue Set(uint32_t index, const Napi::Value value) const; - MaybeOrValue Set(uint32_t index, const char* utf8value) const; - MaybeOrValue Set(uint32_t index, const std::string& utf8value) const; - MaybeOrValue Set(uint32_t index, bool boolValue) const; - MaybeOrValue Set(uint32_t index, double numberValue) const; - - protected: - ObjectReference(const ObjectReference&); -}; - -class FunctionReference : public Reference { - public: - FunctionReference(); - FunctionReference(napi_env env, napi_ref ref); - - // A reference can be moved but cannot be copied. - FunctionReference(Reference&& other); - FunctionReference& operator=(Reference&& other); - FunctionReference(FunctionReference&& other); - FunctionReference& operator=(FunctionReference&& other); - NAPI_DISALLOW_ASSIGN_COPY(FunctionReference) - - MaybeOrValue operator()( - const std::initializer_list& args) const; - - MaybeOrValue Call( - const std::initializer_list& args) const; - MaybeOrValue Call(const std::vector& args) const; - MaybeOrValue Call( - napi_value recv, const std::initializer_list& args) const; - MaybeOrValue Call(napi_value recv, - const std::vector& args) const; - MaybeOrValue Call(napi_value recv, - size_t argc, - const napi_value* args) const; - - MaybeOrValue MakeCallback( - napi_value recv, - const std::initializer_list& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback( - napi_value recv, - const std::vector& args, - napi_async_context context = nullptr) const; - MaybeOrValue MakeCallback( - napi_value recv, - size_t argc, - const napi_value* args, - napi_async_context context = nullptr) const; - - MaybeOrValue New(const std::initializer_list& args) const; - MaybeOrValue New(const std::vector& args) const; -}; - -// Shortcuts to creating a new reference with inferred type and refcount = 0. -template -Reference Weak(T value); -ObjectReference Weak(Object value); -FunctionReference Weak(Function value); - -// Shortcuts to creating a new reference with inferred type and refcount = 1. -template -Reference Persistent(T value); -ObjectReference Persistent(Object value); -FunctionReference Persistent(Function value); - -/// A persistent reference to a JavaScript error object. Use of this class -/// depends somewhat on whether C++ exceptions are enabled at compile time. -/// -/// ### Handling Errors With C++ Exceptions -/// -/// If C++ exceptions are enabled, then the `Error` class extends -/// `std::exception` and enables integrated error-handling for C++ exceptions -/// and JavaScript exceptions. -/// -/// If a Node-API call fails without executing any JavaScript code (for -/// example due to an invalid argument), then the Node-API wrapper -/// automatically converts and throws the error as a C++ exception of type -/// `Napi::Error`. Or if a JavaScript function called by C++ code via Node-API -/// throws a JavaScript exception, then the Node-API wrapper automatically -/// converts and throws it as a C++ exception of type `Napi::Error`. -/// -/// If a C++ exception of type `Napi::Error` escapes from a Node-API C++ -/// callback, then the Node-API wrapper automatically converts and throws it -/// as a JavaScript exception. Therefore, catching a C++ exception of type -/// `Napi::Error` prevents a JavaScript exception from being thrown. -/// -/// #### Example 1A - Throwing a C++ exception: -/// -/// Napi::Env env = ... -/// throw Napi::Error::New(env, "Example exception"); -/// -/// Following C++ statements will not be executed. The exception will bubble -/// up as a C++ exception of type `Napi::Error`, until it is either caught -/// while still in C++, or else automatically propataged as a JavaScript -/// exception when the callback returns to JavaScript. -/// -/// #### Example 2A - Propagating a Node-API C++ exception: -/// -/// Napi::Function jsFunctionThatThrows = someObj.As(); -/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); -/// -/// Following C++ statements will not be executed. The exception will bubble -/// up as a C++ exception of type `Napi::Error`, until it is either caught -/// while still in C++, or else automatically propagated as a JavaScript -/// exception when the callback returns to JavaScript. -/// -/// #### Example 3A - Handling a Node-API C++ exception: -/// -/// Napi::Function jsFunctionThatThrows = someObj.As(); -/// Napi::Value result; -/// try { -/// result = jsFunctionThatThrows({ arg1, arg2 }); -/// } catch (const Napi::Error& e) { -/// cerr << "Caught JavaScript exception: " + e.what(); -/// } -/// -/// Since the exception was caught here, it will not be propagated as a -/// JavaScript exception. -/// -/// ### Handling Errors Without C++ Exceptions -/// -/// If C++ exceptions are disabled (by defining `NAPI_DISABLE_CPP_EXCEPTIONS`) -/// then this class does not extend `std::exception`, and APIs in the `Napi` -/// namespace do not throw C++ exceptions when they fail. Instead, they raise -/// _pending_ JavaScript exceptions and return _empty_ `Value`s. Calling code -/// should check `Value::IsEmpty()` before attempting to use a returned value, -/// and may use methods on the `Env` class to check for, get, and clear a -/// pending JavaScript exception. If the pending exception is not cleared, it -/// will be thrown when the native callback returns to JavaScript. -/// -/// #### Example 1B - Throwing a JS exception -/// -/// Napi::Env env = ... -/// Napi::Error::New(env, "Example -/// exception").ThrowAsJavaScriptException(); return; -/// -/// After throwing a JS exception, the code should generally return -/// immediately from the native callback, after performing any necessary -/// cleanup. -/// -/// #### Example 2B - Propagating a Node-API JS exception: -/// -/// Napi::Function jsFunctionThatThrows = someObj.As(); -/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); -/// if (result.IsEmpty()) return; -/// -/// An empty value result from a Node-API call indicates an error occurred, -/// and a JavaScript exception is pending. To let the exception propagate, the -/// code should generally return immediately from the native callback, after -/// performing any necessary cleanup. -/// -/// #### Example 3B - Handling a Node-API JS exception: -/// -/// Napi::Function jsFunctionThatThrows = someObj.As(); -/// Napi::Value result = jsFunctionThatThrows({ arg1, arg2 }); -/// if (result.IsEmpty()) { -/// Napi::Error e = env.GetAndClearPendingException(); -/// cerr << "Caught JavaScript exception: " + e.Message(); -/// } -/// -/// Since the exception was cleared here, it will not be propagated as a -/// JavaScript exception after the native callback returns. -class Error : public ObjectReference -#ifdef NAPI_CPP_EXCEPTIONS - , - public std::exception -#endif // NAPI_CPP_EXCEPTIONS -{ - public: - static Error New(napi_env env); - static Error New(napi_env env, const char* message); - static Error New(napi_env env, const std::string& message); - - static NAPI_NO_RETURN void Fatal(const char* location, const char* message); - - Error(); - Error(napi_env env, napi_value value); - - // An error can be moved or copied. - Error(Error&& other); - Error& operator=(Error&& other); - Error(const Error&); - Error& operator=(const Error&); - - const std::string& Message() const NAPI_NOEXCEPT; - void ThrowAsJavaScriptException() const; - - Object Value() const; - -#ifdef NAPI_CPP_EXCEPTIONS - const char* what() const NAPI_NOEXCEPT override; -#endif // NAPI_CPP_EXCEPTIONS - - protected: - /// !cond INTERNAL - using create_error_fn = napi_status (*)(napi_env envb, - napi_value code, - napi_value msg, - napi_value* result); - - template - static TError New(napi_env env, - const char* message, - size_t length, - create_error_fn create_error); - /// !endcond - - private: - static inline const char* ERROR_WRAP_VALUE() NAPI_NOEXCEPT; - mutable std::string _message; -}; - -class TypeError : public Error { - public: - static TypeError New(napi_env env, const char* message); - static TypeError New(napi_env env, const std::string& message); - - TypeError(); - TypeError(napi_env env, napi_value value); -}; - -class RangeError : public Error { - public: - static RangeError New(napi_env env, const char* message); - static RangeError New(napi_env env, const std::string& message); - - RangeError(); - RangeError(napi_env env, napi_value value); -}; - -class CallbackInfo { - public: - CallbackInfo(napi_env env, napi_callback_info info); - ~CallbackInfo(); - - // Disallow copying to prevent multiple free of _dynamicArgs - NAPI_DISALLOW_ASSIGN_COPY(CallbackInfo) - - Napi::Env Env() const; - Value NewTarget() const; - bool IsConstructCall() const; - size_t Length() const; - const Value operator[](size_t index) const; - Value This() const; - void* Data() const; - void SetData(void* data); - operator napi_callback_info() const; - - private: - const size_t _staticArgCount = 6; - napi_env _env; - napi_callback_info _info; - napi_value _this; - size_t _argc; - napi_value* _argv; - napi_value _staticArgs[6]; - napi_value* _dynamicArgs; - void* _data; -}; - -class PropertyDescriptor { - public: - using GetterCallback = Napi::Value (*)(const Napi::CallbackInfo& info); - using SetterCallback = void (*)(const Napi::CallbackInfo& info); - -#ifndef NODE_ADDON_API_DISABLE_DEPRECATED - template - static PropertyDescriptor Accessor( - const char* utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - const std::string& utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - napi_value name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Name name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - napi_value name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - const char* utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - const std::string& utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - napi_value name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - Name name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); -#endif // !NODE_ADDON_API_DISABLE_DEPRECATED - - template - static PropertyDescriptor Accessor( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor( - const std::string& utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor( - Name name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor( - const std::string& utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor( - Name name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - - template - static PropertyDescriptor Accessor( - Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Napi::Env env, - Napi::Object object, - const char* utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Accessor( - Napi::Env env, - Napi::Object object, - Name name, - Getter getter, - Setter setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - Napi::Env env, - Napi::Object object, - const char* utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - Napi::Env env, - Napi::Object object, - const std::string& utf8name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor Function( - Napi::Env env, - Napi::Object object, - Name name, - Callable cb, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor Value( - const char* utf8name, - napi_value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor Value( - const std::string& utf8name, - napi_value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor Value( - napi_value name, - napi_value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor Value( - Name name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - - PropertyDescriptor(napi_property_descriptor desc); - - operator napi_property_descriptor&(); - operator const napi_property_descriptor&() const; - - private: - napi_property_descriptor _desc; -}; - -/// Property descriptor for use with `ObjectWrap::DefineClass()`. -/// -/// This is different from the standalone `PropertyDescriptor` because it is -/// specific to each `ObjectWrap` subclass. This prevents using descriptors -/// from a different class when defining a new class (preventing the callbacks -/// from having incorrect `this` pointers). -template -class ClassPropertyDescriptor { - public: - ClassPropertyDescriptor(napi_property_descriptor desc) : _desc(desc) {} - - operator napi_property_descriptor&() { return _desc; } - operator const napi_property_descriptor&() const { return _desc; } - - private: - napi_property_descriptor _desc; -}; - -template -struct MethodCallbackData { - TCallback callback; - void* data; -}; - -template -struct AccessorCallbackData { - TGetterCallback getterCallback; - TSetterCallback setterCallback; - void* data; -}; - -template -class InstanceWrap { - public: - using InstanceVoidMethodCallback = void (T::*)(const CallbackInfo& info); - using InstanceMethodCallback = Napi::Value (T::*)(const CallbackInfo& info); - using InstanceGetterCallback = Napi::Value (T::*)(const CallbackInfo& info); - using InstanceSetterCallback = void (T::*)(const CallbackInfo& info, - const Napi::Value& value); - - using PropertyDescriptor = ClassPropertyDescriptor; - - static PropertyDescriptor InstanceMethod( - const char* utf8name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceMethod( - const char* utf8name, - InstanceMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceMethod( - Symbol name, - InstanceVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceMethod( - Symbol name, - InstanceMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod( - Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceMethod( - Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceAccessor( - const char* utf8name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceAccessor( - Symbol name, - InstanceGetterCallback getter, - InstanceSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceAccessor( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor InstanceAccessor( - Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor InstanceValue( - const char* utf8name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor InstanceValue( - Symbol name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - - protected: - static void AttachPropData(napi_env env, - napi_value value, - const napi_property_descriptor* prop); - - private: - using This = InstanceWrap; - - using InstanceVoidMethodCallbackData = - MethodCallbackData; - using InstanceMethodCallbackData = - MethodCallbackData; - using InstanceAccessorCallbackData = - AccessorCallbackData; - - static napi_value InstanceVoidMethodCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value InstanceMethodCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value InstanceGetterCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value InstanceSetterCallbackWrapper(napi_env env, - napi_callback_info info); - - template - static napi_value WrappedMethod(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT; - - template - struct SetterTag {}; - - template - static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { - return &This::WrappedMethod; - } - static napi_callback WrapSetter(SetterTag) NAPI_NOEXCEPT { - return nullptr; - } -}; - -/// Base class to be extended by C++ classes exposed to JavaScript; each C++ -/// class instance gets "wrapped" by a JavaScript object that is managed by this -/// class. -/// -/// At initialization time, the `DefineClass()` method must be used to -/// hook up the accessor and method callbacks. It takes a list of -/// property descriptors, which can be constructed via the various -/// static methods on the base class. -/// -/// #### Example: -/// -/// class Example: public Napi::ObjectWrap { -/// public: -/// static void Initialize(Napi::Env& env, Napi::Object& target) { -/// Napi::Function constructor = DefineClass(env, "Example", { -/// InstanceAccessor<&Example::GetSomething, -/// &Example::SetSomething>("value"), -/// InstanceMethod<&Example::DoSomething>("doSomething"), -/// }); -/// target.Set("Example", constructor); -/// } -/// -/// Example(const Napi::CallbackInfo& info); // Constructor -/// Napi::Value GetSomething(const Napi::CallbackInfo& info); -/// void SetSomething(const Napi::CallbackInfo& info, const Napi::Value& -/// value); Napi::Value DoSomething(const Napi::CallbackInfo& info); -/// } -template -class ObjectWrap : public InstanceWrap, public Reference { - public: - ObjectWrap(const CallbackInfo& callbackInfo); - virtual ~ObjectWrap(); - - static T* Unwrap(Object wrapper); - - // Methods exposed to JavaScript must conform to one of these callback - // signatures. - using StaticVoidMethodCallback = void (*)(const CallbackInfo& info); - using StaticMethodCallback = Napi::Value (*)(const CallbackInfo& info); - using StaticGetterCallback = Napi::Value (*)(const CallbackInfo& info); - using StaticSetterCallback = void (*)(const CallbackInfo& info, - const Napi::Value& value); - - using PropertyDescriptor = ClassPropertyDescriptor; - - static Function DefineClass( - Napi::Env env, - const char* utf8name, - const std::initializer_list& properties, - void* data = nullptr); - static Function DefineClass(Napi::Env env, - const char* utf8name, - const std::vector& properties, - void* data = nullptr); - static PropertyDescriptor StaticMethod( - const char* utf8name, - StaticVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticMethod( - const char* utf8name, - StaticMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticMethod( - Symbol name, - StaticVoidMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticMethod( - Symbol name, - StaticMethodCallback method, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod( - Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticMethod( - Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticAccessor( - const char* utf8name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticAccessor( - Symbol name, - StaticGetterCallback getter, - StaticSetterCallback setter, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticAccessor( - const char* utf8name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - template - static PropertyDescriptor StaticAccessor( - Symbol name, - napi_property_attributes attributes = napi_default, - void* data = nullptr); - static PropertyDescriptor StaticValue( - const char* utf8name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - static PropertyDescriptor StaticValue( - Symbol name, - Napi::Value value, - napi_property_attributes attributes = napi_default); - static Napi::Value OnCalledAsFunction(const Napi::CallbackInfo& callbackInfo); - virtual void Finalize(Napi::Env env); - - private: - using This = ObjectWrap; - - static napi_value ConstructorCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value StaticVoidMethodCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value StaticMethodCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value StaticGetterCallbackWrapper(napi_env env, - napi_callback_info info); - static napi_value StaticSetterCallbackWrapper(napi_env env, - napi_callback_info info); - static void FinalizeCallback(napi_env env, void* data, void* hint); - static Function DefineClass(Napi::Env env, - const char* utf8name, - const size_t props_count, - const napi_property_descriptor* props, - void* data = nullptr); - - using StaticVoidMethodCallbackData = - MethodCallbackData; - using StaticMethodCallbackData = MethodCallbackData; - - using StaticAccessorCallbackData = - AccessorCallbackData; - - template - static napi_value WrappedMethod(napi_env env, - napi_callback_info info) NAPI_NOEXCEPT; - - template - struct StaticSetterTag {}; - - template - static napi_callback WrapStaticSetter(StaticSetterTag) NAPI_NOEXCEPT { - return &This::WrappedMethod; - } - static napi_callback WrapStaticSetter(StaticSetterTag) - NAPI_NOEXCEPT { - return nullptr; - } - - bool _construction_failed = true; -}; - -class HandleScope { - public: - HandleScope(napi_env env, napi_handle_scope scope); - explicit HandleScope(Napi::Env env); - ~HandleScope(); - - // Disallow copying to prevent double close of napi_handle_scope - NAPI_DISALLOW_ASSIGN_COPY(HandleScope) - - operator napi_handle_scope() const; - - Napi::Env Env() const; - - private: - napi_env _env; - napi_handle_scope _scope; -}; - -class EscapableHandleScope { - public: - EscapableHandleScope(napi_env env, napi_escapable_handle_scope scope); - explicit EscapableHandleScope(Napi::Env env); - ~EscapableHandleScope(); - - // Disallow copying to prevent double close of napi_escapable_handle_scope - NAPI_DISALLOW_ASSIGN_COPY(EscapableHandleScope) - - operator napi_escapable_handle_scope() const; - - Napi::Env Env() const; - Value Escape(napi_value escapee); - - private: - napi_env _env; - napi_escapable_handle_scope _scope; -}; - -#if (NAPI_VERSION > 2) -class CallbackScope { - public: - CallbackScope(napi_env env, napi_callback_scope scope); - CallbackScope(napi_env env, napi_async_context context); - virtual ~CallbackScope(); - - // Disallow copying to prevent double close of napi_callback_scope - NAPI_DISALLOW_ASSIGN_COPY(CallbackScope) - - operator napi_callback_scope() const; - - Napi::Env Env() const; - - private: - napi_env _env; - napi_callback_scope _scope; -}; -#endif - -class AsyncContext { - public: - explicit AsyncContext(napi_env env, const char* resource_name); - explicit AsyncContext(napi_env env, - const char* resource_name, - const Object& resource); - virtual ~AsyncContext(); - - AsyncContext(AsyncContext&& other); - AsyncContext& operator=(AsyncContext&& other); - NAPI_DISALLOW_ASSIGN_COPY(AsyncContext) - - operator napi_async_context() const; - - Napi::Env Env() const; - - private: - napi_env _env; - napi_async_context _context; -}; - -class AsyncWorker { - public: - virtual ~AsyncWorker(); - - // An async worker can be moved but cannot be copied. - AsyncWorker(AsyncWorker&& other); - AsyncWorker& operator=(AsyncWorker&& other); - NAPI_DISALLOW_ASSIGN_COPY(AsyncWorker) - - operator napi_async_work() const; - - Napi::Env Env() const; - - void Queue(); - void Cancel(); - void SuppressDestruct(); - - ObjectReference& Receiver(); - FunctionReference& Callback(); - - virtual void OnExecute(Napi::Env env); - virtual void OnWorkComplete(Napi::Env env, napi_status status); - - protected: - explicit AsyncWorker(const Function& callback); - explicit AsyncWorker(const Function& callback, const char* resource_name); - explicit AsyncWorker(const Function& callback, - const char* resource_name, - const Object& resource); - explicit AsyncWorker(const Object& receiver, const Function& callback); - explicit AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name); - explicit AsyncWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource); - - explicit AsyncWorker(Napi::Env env); - explicit AsyncWorker(Napi::Env env, const char* resource_name); - explicit AsyncWorker(Napi::Env env, - const char* resource_name, - const Object& resource); - - virtual void Execute() = 0; - virtual void OnOK(); - virtual void OnError(const Error& e); - virtual void Destroy(); - virtual std::vector GetResult(Napi::Env env); - - void SetError(const std::string& error); - - private: - static inline void OnAsyncWorkExecute(napi_env env, void* asyncworker); - static inline void OnAsyncWorkComplete(napi_env env, - napi_status status, - void* asyncworker); - - napi_env _env; - napi_async_work _work; - ObjectReference _receiver; - FunctionReference _callback; - std::string _error; - bool _suppress_destruct; -}; - -#if (NAPI_VERSION > 3 && !defined(__wasm32__)) -class ThreadSafeFunction { - public: - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - Finalizer finalizeCallback, - FinalizerDataType* data); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback); - - // This API may only be called from the main thread. - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data); - - ThreadSafeFunction(); - ThreadSafeFunction(napi_threadsafe_function tsFunctionValue); - - operator napi_threadsafe_function() const; - - // This API may be called from any thread. - napi_status BlockingCall() const; - - // This API may be called from any thread. - template - napi_status BlockingCall(Callback callback) const; - - // This API may be called from any thread. - template - napi_status BlockingCall(DataType* data, Callback callback) const; - - // This API may be called from any thread. - napi_status NonBlockingCall() const; - - // This API may be called from any thread. - template - napi_status NonBlockingCall(Callback callback) const; - - // This API may be called from any thread. - template - napi_status NonBlockingCall(DataType* data, Callback callback) const; - - // This API may only be called from the main thread. - void Ref(napi_env env) const; - - // This API may only be called from the main thread. - void Unref(napi_env env) const; - - // This API may be called from any thread. - napi_status Acquire() const; - - // This API may be called from any thread. - napi_status Release() const; - - // This API may be called from any thread. - napi_status Abort() const; - - struct ConvertibleContext { - template - operator T*() { - return static_cast(context); - } - void* context; - }; - - // This API may be called from any thread. - ConvertibleContext GetContext() const; - - private: - using CallbackWrapper = std::function; - - template - static ThreadSafeFunction New(napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data, - napi_finalize wrapper); - - napi_status CallInternal(CallbackWrapper* callbackWrapper, - napi_threadsafe_function_call_mode mode) const; - - static void CallJS(napi_env env, - napi_value jsCallback, - void* context, - void* data); - - napi_threadsafe_function _tsfn; -}; - -// A TypedThreadSafeFunction by default has no context (nullptr) and can -// accept any type (void) to its CallJs. -template -class TypedThreadSafeFunction { - public: - // This API may only be called from the main thread. - // Helper function that returns nullptr if running Node-API 5+, otherwise a - // non-empty, no-op Function. This provides the ability to specify at - // compile-time a callback parameter to `New` that safely does no action - // when targeting _any_ Node-API version. -#if NAPI_VERSION > 4 - static std::nullptr_t EmptyFunctionFactory(Napi::Env env); -#else - static Napi::Function EmptyFunctionFactory(Napi::Env env); -#endif - static Napi::Function FunctionOrEmpty(Napi::Env env, - Napi::Function& callback); - -#if NAPI_VERSION > 4 - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [missing] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [passed] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [missing] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [missing] Resource [passed] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); -#endif - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [missing] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [passed] Finalizer [missing] - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [missing] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); - - // This API may only be called from the main thread. - // Creates a new threadsafe function with: - // Callback [passed] Resource [passed] Finalizer [passed] - template - static TypedThreadSafeFunction New( - napi_env env, - CallbackType callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data = nullptr); - - TypedThreadSafeFunction(); - TypedThreadSafeFunction(napi_threadsafe_function tsFunctionValue); - - operator napi_threadsafe_function() const; - - // This API may be called from any thread. - napi_status BlockingCall(DataType* data = nullptr) const; - - // This API may be called from any thread. - napi_status NonBlockingCall(DataType* data = nullptr) const; - - // This API may only be called from the main thread. - void Ref(napi_env env) const; - - // This API may only be called from the main thread. - void Unref(napi_env env) const; - - // This API may be called from any thread. - napi_status Acquire() const; - - // This API may be called from any thread. - napi_status Release() const; - - // This API may be called from any thread. - napi_status Abort() const; - - // This API may be called from any thread. - ContextType* GetContext() const; - - private: - template - static TypedThreadSafeFunction New( - napi_env env, - const Function& callback, - const Object& resource, - ResourceString resourceName, - size_t maxQueueSize, - size_t initialThreadCount, - ContextType* context, - Finalizer finalizeCallback, - FinalizerDataType* data, - napi_finalize wrapper); - - static void CallJsInternal(napi_env env, - napi_value jsCallback, - void* context, - void* data); - - protected: - napi_threadsafe_function _tsfn; -}; -template -class AsyncProgressWorkerBase : public AsyncWorker { - public: - virtual void OnWorkProgress(DataType* data) = 0; - class ThreadSafeData { - public: - ThreadSafeData(AsyncProgressWorkerBase* asyncprogressworker, DataType* data) - : _asyncprogressworker(asyncprogressworker), _data(data) {} - - AsyncProgressWorkerBase* asyncprogressworker() { - return _asyncprogressworker; - }; - DataType* data() { return _data; }; - - private: - AsyncProgressWorkerBase* _asyncprogressworker; - DataType* _data; - }; - void OnWorkComplete(Napi::Env env, napi_status status) override; - - protected: - explicit AsyncProgressWorkerBase(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource, - size_t queue_size = 1); - virtual ~AsyncProgressWorkerBase(); - -// Optional callback of Napi::ThreadSafeFunction only available after -// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 -#if NAPI_VERSION > 4 - explicit AsyncProgressWorkerBase(Napi::Env env, - const char* resource_name, - const Object& resource, - size_t queue_size = 1); -#endif - - static inline void OnAsyncWorkProgress(Napi::Env env, - Napi::Function jsCallback, - void* data); - - napi_status NonBlockingCall(DataType* data); - - private: - ThreadSafeFunction _tsfn; - bool _work_completed = false; - napi_status _complete_status; - static inline void OnThreadSafeFunctionFinalize( - Napi::Env env, void* data, AsyncProgressWorkerBase* context); -}; - -template -class AsyncProgressWorker : public AsyncProgressWorkerBase { - public: - virtual ~AsyncProgressWorker(); - - class ExecutionProgress { - friend class AsyncProgressWorker; - - public: - void Signal() const; - void Send(const T* data, size_t count) const; - - private: - explicit ExecutionProgress(AsyncProgressWorker* worker) : _worker(worker) {} - AsyncProgressWorker* const _worker; - }; - - void OnWorkProgress(void*) override; - - protected: - explicit AsyncProgressWorker(const Function& callback); - explicit AsyncProgressWorker(const Function& callback, - const char* resource_name); - explicit AsyncProgressWorker(const Function& callback, - const char* resource_name, - const Object& resource); - explicit AsyncProgressWorker(const Object& receiver, - const Function& callback); - explicit AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name); - explicit AsyncProgressWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource); - -// Optional callback of Napi::ThreadSafeFunction only available after -// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 -#if NAPI_VERSION > 4 - explicit AsyncProgressWorker(Napi::Env env); - explicit AsyncProgressWorker(Napi::Env env, const char* resource_name); - explicit AsyncProgressWorker(Napi::Env env, - const char* resource_name, - const Object& resource); -#endif - virtual void Execute(const ExecutionProgress& progress) = 0; - virtual void OnProgress(const T* data, size_t count) = 0; - - private: - void Execute() override; - void Signal(); - void SendProgress_(const T* data, size_t count); - - std::mutex _mutex; - T* _asyncdata; - size_t _asyncsize; - bool _signaled; -}; - -template -class AsyncProgressQueueWorker - : public AsyncProgressWorkerBase> { - public: - virtual ~AsyncProgressQueueWorker(){}; - - class ExecutionProgress { - friend class AsyncProgressQueueWorker; - - public: - void Signal() const; - void Send(const T* data, size_t count) const; - - private: - explicit ExecutionProgress(AsyncProgressQueueWorker* worker) - : _worker(worker) {} - AsyncProgressQueueWorker* const _worker; - }; - - void OnWorkComplete(Napi::Env env, napi_status status) override; - void OnWorkProgress(std::pair*) override; - - protected: - explicit AsyncProgressQueueWorker(const Function& callback); - explicit AsyncProgressQueueWorker(const Function& callback, - const char* resource_name); - explicit AsyncProgressQueueWorker(const Function& callback, - const char* resource_name, - const Object& resource); - explicit AsyncProgressQueueWorker(const Object& receiver, - const Function& callback); - explicit AsyncProgressQueueWorker(const Object& receiver, - const Function& callback, - const char* resource_name); - explicit AsyncProgressQueueWorker(const Object& receiver, - const Function& callback, - const char* resource_name, - const Object& resource); - -// Optional callback of Napi::ThreadSafeFunction only available after -// NAPI_VERSION 4. Refs: https://github.com/nodejs/node/pull/27791 -#if NAPI_VERSION > 4 - explicit AsyncProgressQueueWorker(Napi::Env env); - explicit AsyncProgressQueueWorker(Napi::Env env, const char* resource_name); - explicit AsyncProgressQueueWorker(Napi::Env env, - const char* resource_name, - const Object& resource); -#endif - virtual void Execute(const ExecutionProgress& progress) = 0; - virtual void OnProgress(const T* data, size_t count) = 0; - - private: - void Execute() override; - void Signal() const; - void SendProgress_(const T* data, size_t count); -}; -#endif // NAPI_VERSION > 3 && !defined(__wasm32__) - -// Memory management. -class MemoryManagement { - public: - static int64_t AdjustExternalMemory(Env env, int64_t change_in_bytes); -}; - -// Version management -class VersionManagement { - public: - static uint32_t GetNapiVersion(Env env); - static const napi_node_version* GetNodeVersion(Env env); -}; - -#if NAPI_VERSION > 5 -template -class Addon : public InstanceWrap { - public: - static inline Object Init(Env env, Object exports); - static T* Unwrap(Object wrapper); - - protected: - using AddonProp = ClassPropertyDescriptor; - void DefineAddon(Object exports, - const std::initializer_list& props); - Napi::Object DefineProperties(Object object, - const std::initializer_list& props); - - private: - Object entry_point_; -}; -#endif // NAPI_VERSION > 5 - -#ifdef NAPI_CPP_CUSTOM_NAMESPACE -} // namespace NAPI_CPP_CUSTOM_NAMESPACE -#endif - -} // namespace Napi - -// Inline implementations of all the above class methods are included here. -#include "napi-inl.h" - -#endif // SRC_NAPI_H_ diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/node_api.gyp b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/node_api.gyp deleted file mode 100644 index 4ff0ae7df..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/node_api.gyp +++ /dev/null @@ -1,9 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'nothing', - 'type': 'static_library', - 'sources': [ 'nothing.c' ] - } - ] -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/noexcept.gypi b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/noexcept.gypi deleted file mode 100644 index 404a05f30..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/noexcept.gypi +++ /dev/null @@ -1,26 +0,0 @@ -{ - 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ], - 'cflags': [ '-fno-exceptions' ], - 'cflags_cc': [ '-fno-exceptions' ], - 'conditions': [ - ["OS=='win'", { - # _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi - #"defines": [ - # "_HAS_EXCEPTIONS=0" - #], - "msvs_settings": { - "VCCLCompilerTool": { - 'ExceptionHandling': 0, - 'EnablePREfast': 'true', - }, - }, - }], - ["OS=='mac'", { - 'xcode_settings': { - 'CLANG_CXX_LIBRARY': 'libc++', - 'MACOSX_DEPLOYMENT_TARGET': '10.7', - 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', - }, - }], - ], -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/nothing.c b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/nothing.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/package-support.json b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/package-support.json deleted file mode 100644 index 10d3607ac..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/package-support.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "versions": [ - { - "version": "*", - "target": { - "node": "active" - }, - "response": { - "type": "time-permitting", - "paid": false, - "contact": { - "name": "node-addon-api team", - "url": "https://github.com/nodejs/node-addon-api/issues" - } - }, - "backing": [ { "project": "https://github.com/nodejs" }, - { "foundation": "https://openjsf.org/" } - ] - } - ] -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/package.json b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/package.json deleted file mode 100644 index 3ec3776e6..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/package.json +++ /dev/null @@ -1,456 +0,0 @@ -{ - "bugs": { - "url": "https://github.com/nodejs/node-addon-api/issues" - }, - "contributors": [ - { - "name": "Abhishek Kumar Singh", - "url": "https://github.com/abhi11210646" - }, - { - "name": "Alba Mendez", - "url": "https://github.com/jmendeth" - }, - { - "name": "Alexander Floh", - "url": "https://github.com/alexanderfloh" - }, - { - "name": "Ammar Faizi", - "url": "https://github.com/ammarfaizi2" - }, - { - "name": "András Timár, Dr", - "url": "https://github.com/timarandras" - }, - { - "name": "Andrew Petersen", - "url": "https://github.com/kirbysayshi" - }, - { - "name": "Anisha Rohra", - "url": "https://github.com/anisha-rohra" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax" - }, - { - "name": "Arnaud Botella", - "url": "https://github.com/BotellaA" - }, - { - "name": "Arunesh Chandra", - "url": "https://github.com/aruneshchandra" - }, - { - "name": "Azlan Mukhtar", - "url": "https://github.com/azlan" - }, - { - "name": "Ben Berman", - "url": "https://github.com/rivertam" - }, - { - "name": "Benjamin Byholm", - "url": "https://github.com/kkoopa" - }, - { - "name": "Bill Gallafent", - "url": "https://github.com/gallafent" - }, - { - "name": "blagoev", - "url": "https://github.com/blagoev" - }, - { - "name": "Bruce A. MacNaughton", - "url": "https://github.com/bmacnaughton" - }, - { - "name": "Cory Mickelson", - "url": "https://github.com/corymickelson" - }, - { - "name": "Daniel Bevenius", - "url": "https://github.com/danbev" - }, - { - "name": "Dante Calderón", - "url": "https://github.com/dantehemerson" - }, - { - "name": "Darshan Sen", - "url": "https://github.com/RaisinTen" - }, - { - "name": "David Halls", - "url": "https://github.com/davedoesdev" - }, - { - "name": "Deepak Rajamohan", - "url": "https://github.com/deepakrkris" - }, - { - "name": "Dmitry Ashkadov", - "url": "https://github.com/dmitryash" - }, - { - "name": "Dongjin Na", - "url": "https://github.com/nadongguri" - }, - { - "name": "Doni Rubiagatra", - "url": "https://github.com/rubiagatra" - }, - { - "name": "Eric Bickle", - "url": "https://github.com/ebickle" - }, - { - "name": "extremeheat", - "url": "https://github.com/extremeheat" - }, - { - "name": "Feng Yu", - "url": "https://github.com/F3n67u" - }, - { - "name": "Ferdinand Holzer", - "url": "https://github.com/fholzer" - }, - { - "name": "Gabriel Schulhof", - "url": "https://github.com/gabrielschulhof" - }, - { - "name": "Guenter Sandner", - "url": "https://github.com/gms1" - }, - { - "name": "Gus Caplan", - "url": "https://github.com/devsnek" - }, - { - "name": "Helio Frota", - "url": "https://github.com/helio-frota" - }, - { - "name": "Hitesh Kanwathirtha", - "url": "https://github.com/digitalinfinity" - }, - { - "name": "ikokostya", - "url": "https://github.com/ikokostya" - }, - { - "name": "Jack Xia", - "url": "https://github.com/JckXia" - }, - { - "name": "Jake Barnes", - "url": "https://github.com/DuBistKomisch" - }, - { - "name": "Jake Yoon", - "url": "https://github.com/yjaeseok" - }, - { - "name": "Jason Ginchereau", - "url": "https://github.com/jasongin" - }, - { - "name": "Jenny", - "url": "https://github.com/egg-bread" - }, - { - "name": "Jeroen Janssen", - "url": "https://github.com/japj" - }, - { - "name": "Jim Schlight", - "url": "https://github.com/jschlight" - }, - { - "name": "Jinho Bang", - "url": "https://github.com/romandev" - }, - { - "name": "José Expósito", - "url": "https://github.com/JoseExposito" - }, - { - "name": "joshgarde", - "url": "https://github.com/joshgarde" - }, - { - "name": "Julian Mesa", - "url": "https://github.com/julianmesa-gitkraken" - }, - { - "name": "Kasumi Hanazuki", - "url": "https://github.com/hanazuki" - }, - { - "name": "Kelvin", - "url": "https://github.com/kelvinhammond" - }, - { - "name": "Kevin Eady", - "url": "https://github.com/KevinEady" - }, - { - "name": "Kévin VOYER", - "url": "https://github.com/kecsou" - }, - { - "name": "kidneysolo", - "url": "https://github.com/kidneysolo" - }, - { - "name": "Koki Nishihara", - "url": "https://github.com/Nishikoh" - }, - { - "name": "Konstantin Tarkus", - "url": "https://github.com/koistya" - }, - { - "name": "Kyle Farnung", - "url": "https://github.com/kfarnung" - }, - { - "name": "Kyle Kovacs", - "url": "https://github.com/nullromo" - }, - { - "name": "legendecas", - "url": "https://github.com/legendecas" - }, - { - "name": "LongYinan", - "url": "https://github.com/Brooooooklyn" - }, - { - "name": "Lovell Fuller", - "url": "https://github.com/lovell" - }, - { - "name": "Luciano Martorella", - "url": "https://github.com/lmartorella" - }, - { - "name": "mastergberry", - "url": "https://github.com/mastergberry" - }, - { - "name": "Mathias Küsel", - "url": "https://github.com/mathiask88" - }, - { - "name": "Matteo Collina", - "url": "https://github.com/mcollina" - }, - { - "name": "Michael Dawson", - "url": "https://github.com/mhdawson" - }, - { - "name": "Michael Price", - "url": "https://github.com/mikepricedev" - }, - { - "name": "Michele Campus", - "url": "https://github.com/kYroL01" - }, - { - "name": "Mikhail Cheshkov", - "url": "https://github.com/mcheshkov" - }, - { - "name": "nempoBu4", - "url": "https://github.com/nempoBu4" - }, - { - "name": "Nicola Del Gobbo", - "url": "https://github.com/NickNaso" - }, - { - "name": "Nick Soggin", - "url": "https://github.com/iSkore" - }, - { - "name": "Nikolai Vavilov", - "url": "https://github.com/seishun" - }, - { - "name": "Nurbol Alpysbayev", - "url": "https://github.com/anurbol" - }, - { - "name": "pacop", - "url": "https://github.com/pacop" - }, - { - "name": "Peter Šándor", - "url": "https://github.com/petersandor" - }, - { - "name": "Philipp Renoth", - "url": "https://github.com/DaAitch" - }, - { - "name": "rgerd", - "url": "https://github.com/rgerd" - }, - { - "name": "Richard Lau", - "url": "https://github.com/richardlau" - }, - { - "name": "Rolf Timmermans", - "url": "https://github.com/rolftimmermans" - }, - { - "name": "Ross Weir", - "url": "https://github.com/ross-weir" - }, - { - "name": "Ryuichi Okumura", - "url": "https://github.com/okuryu" - }, - { - "name": "Saint Gabriel", - "url": "https://github.com/chineduG" - }, - { - "name": "Sampson Gao", - "url": "https://github.com/sampsongao" - }, - { - "name": "Sam Roberts", - "url": "https://github.com/sam-github" - }, - { - "name": "strager", - "url": "https://github.com/strager" - }, - { - "name": "Taylor Woll", - "url": "https://github.com/boingoing" - }, - { - "name": "Thomas Gentilhomme", - "url": "https://github.com/fraxken" - }, - { - "name": "Tim Rach", - "url": "https://github.com/timrach" - }, - { - "name": "Tobias Nießen", - "url": "https://github.com/tniessen" - }, - { - "name": "todoroff", - "url": "https://github.com/todoroff" - }, - { - "name": "Tux3", - "url": "https://github.com/tux3" - }, - { - "name": "Vlad Velmisov", - "url": "https://github.com/Velmisov" - }, - { - "name": "Vladimir Morozov", - "url": "https://github.com/vmoroz" - - }, - { - "name": "WenheLI", - "url": "https://github.com/WenheLI" - }, - { - "name": "Xuguang Mei", - "url": "https://github.com/meixg" - }, - { - "name": "Yohei Kishimoto", - "url": "https://github.com/morokosi" - }, - { - "name": "Yulong Wang", - "url": "https://github.com/fs-eire" - }, - { - "name": "Ziqiu Zhao", - "url": "https://github.com/ZzqiZQute" - }, - { - "name": "Feng Yu", - "url": "https://github.com/F3n67u" - } - ], - "description": "Node.js API (Node-API)", - "devDependencies": { - "benchmark": "^2.1.4", - "bindings": "^1.5.0", - "clang-format": "^1.4.0", - "eslint": "^7.32.0", - "eslint-config-semistandard": "^16.0.0", - "eslint-config-standard": "^16.0.3", - "eslint-plugin-import": "^2.24.2", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.1.0", - "fs-extra": "^9.0.1", - "path": "^0.12.7", - "pre-commit": "^1.2.2", - "safe-buffer": "^5.1.1" - }, - "directories": {}, - "gypfile": false, - "homepage": "https://github.com/nodejs/node-addon-api", - "keywords": [ - "n-api", - "napi", - "addon", - "native", - "bindings", - "c", - "c++", - "nan", - "node-addon-api" - ], - "license": "MIT", - "main": "index.js", - "name": "node-addon-api", - "readme": "README.md", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/node-addon-api.git" - }, - "files": [ - "*.{c,h,gyp,gypi}", - "package-support.json", - "tools/" - ], - "scripts": { - "prebenchmark": "node-gyp rebuild -C benchmark", - "benchmark": "node benchmark", - "pretest": "node-gyp rebuild -C test", - "test": "node test", - "test:debug": "node-gyp rebuild -C test --debug && NODE_API_BUILD_CONFIG=Debug node ./test/index.js", - "predev": "node-gyp rebuild -C test --debug", - "dev": "node test", - "predev:incremental": "node-gyp configure build -C test --debug", - "dev:incremental": "node test", - "doc": "doxygen doc/Doxyfile", - "lint": "node tools/eslint-format && node tools/clang-format", - "lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix" - }, - "pre-commit": "lint", - "version": "5.1.0", - "support": true -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/README.md b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/README.md deleted file mode 100644 index 6b80e94f5..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Tools - -## clang-format - -The clang-format checking tools is designed to check changed lines of code compared to given git-refs. - -## Migration Script - -The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required. - -### How To Use - -To run the conversion script, first make sure you have the latest `node-addon-api` in your `node_modules` directory. -``` -npm install node-addon-api -``` - -Then run the script passing your project directory -``` -node ./node_modules/node-addon-api/tools/conversion.js ./ -``` - -After finish, recompile and debug things that are missed by the script. - - -### Quick Fixes -Here is the list of things that can be fixed easily. - 1. Change your methods' return value to void if it doesn't return value to JavaScript. - 2. Use `.` to access attribute or to invoke member function in Napi::Object instead of `->`. - 3. `Napi::New(env, value);` to `Napi::[Type]::New(env, value); - - -### Major Reconstructions -The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN. - -So if you use Nan::ObjectWrap in your module, you will need to execute the following steps. - - 1. Convert your [ClassName]::New function to a constructor function that takes a `Napi::CallbackInfo`. Declare it as -``` -[ClassName](const Napi::CallbackInfo& info); -``` -and define it as -``` -[ClassName]::[ClassName](const Napi::CallbackInfo& info) : Napi::ObjectWrap<[ClassName]>(info){ - ... -} -``` -This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object. - - 2. Move your original constructor code into the new constructor. Delete your original constructor. - 3. In your class initialization function, associate native methods in the following way. -``` -Napi::FunctionReference constructor; - -void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) { - Napi::HandleScope scope(env); - Napi::Function ctor = DefineClass(env, "Canvas", { - InstanceMethod<&[ClassName]::Func1>("Func1"), - InstanceMethod<&[ClassName]::Func2>("Func2"), - InstanceAccessor<&[ClassName]::ValueGetter>("Value"), - StaticMethod<&[ClassName]::StaticMethod>("MethodName"), - InstanceValue("Value", Napi::[Type]::New(env, value)), - }); - - constructor = Napi::Persistent(ctor); - constructor .SuppressDestruct(); - exports.Set("[ClassName]", ctor); -} -``` - 4. In function where you need to Unwrap the ObjectWrap in NAN like `[ClassName]* native = Nan::ObjectWrap::Unwrap<[ClassName]>(info.This());`, use `this` pointer directly as the unwrapped object as each ObjectWrap instance is associated with a unique object instance. - - -If you still find issues after following this guide, please leave us an issue describing your problem and we will try to resolve it. diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/check-napi.js b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/check-napi.js deleted file mode 100644 index 9199af334..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/check-napi.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; -// Descend into a directory structure and, for each file matching *.node, output -// based on the imports found in the file whether it's an N-API module or not. - -const fs = require('fs'); -const path = require('path'); - -// Read the output of the command, break it into lines, and use the reducer to -// decide whether the file is an N-API module or not. -function checkFile (file, command, argv, reducer) { - const child = require('child_process').spawn(command, argv, { - stdio: ['inherit', 'pipe', 'inherit'] - }); - let leftover = ''; - let isNapi; - child.stdout.on('data', (chunk) => { - if (isNapi === undefined) { - chunk = (leftover + chunk.toString()).split(/[\r\n]+/); - leftover = chunk.pop(); - isNapi = chunk.reduce(reducer, isNapi); - if (isNapi !== undefined) { - child.kill(); - } - } - }); - child.on('close', (code, signal) => { - if ((code === null && signal !== null) || (code !== 0)) { - console.log( - command + ' exited with code: ' + code + ' and signal: ' + signal); - } else { - // Green if it's a N-API module, red otherwise. - console.log( - '\x1b[' + (isNapi ? '42' : '41') + 'm' + - (isNapi ? ' N-API' : 'Not N-API') + - '\x1b[0m: ' + file); - } - }); -} - -// Use nm -a to list symbols. -function checkFileUNIX (file) { - checkFile(file, 'nm', ['-a', file], (soFar, line) => { - if (soFar === undefined) { - line = line.match(/([0-9a-f]*)? ([a-zA-Z]) (.*$)/); - if (line[2] === 'U') { - if (/^napi/.test(line[3])) { - soFar = true; - } - } - } - return soFar; - }); -} - -// Use dumpbin /imports to list symbols. -function checkFileWin32 (file) { - checkFile(file, 'dumpbin', ['/imports', file], (soFar, line) => { - if (soFar === undefined) { - line = line.match(/([0-9a-f]*)? +([a-zA-Z0-9]) (.*$)/); - if (line && /^napi/.test(line[line.length - 1])) { - soFar = true; - } - } - return soFar; - }); -} - -// Descend into a directory structure and pass each file ending in '.node' to -// one of the above checks, depending on the OS. -function recurse (top) { - fs.readdir(top, (error, items) => { - if (error) { - throw new Error('error reading directory ' + top + ': ' + error); - } - items.forEach((item) => { - item = path.join(top, item); - fs.stat(item, ((item) => (error, stats) => { - if (error) { - throw new Error('error about ' + item + ': ' + error); - } - if (stats.isDirectory()) { - recurse(item); - } else if (/[.]node$/.test(item) && - // Explicitly ignore files called 'nothing.node' because they are - // artefacts of node-addon-api having identified a version of - // Node.js that ships with a correct implementation of N-API. - path.basename(item) !== 'nothing.node') { - process.platform === 'win32' - ? checkFileWin32(item) - : checkFileUNIX(item); - } - })(item)); - }); - }); -} - -// Start with the directory given on the command line or the current directory -// if nothing was given. -recurse(process.argv.length > 3 ? process.argv[2] : '.'); diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/clang-format.js b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/clang-format.js deleted file mode 100644 index e4bb4f52e..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/clang-format.js +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env node - -const spawn = require('child_process').spawnSync; -const path = require('path'); - -const filesToCheck = ['*.h', '*.cc']; -const FORMAT_START = process.env.FORMAT_START || 'main'; - -function main (args) { - let fix = false; - while (args.length > 0) { - switch (args[0]) { - case '-f': - case '--fix': - fix = true; - break; - default: - } - args.shift(); - } - - const clangFormatPath = path.dirname(require.resolve('clang-format')); - const binary = process.platform === 'win32' - ? 'node_modules\\.bin\\clang-format.cmd' - : 'node_modules/.bin/clang-format'; - const options = ['--binary=' + binary, '--style=file']; - if (fix) { - options.push(FORMAT_START); - } else { - options.push('--diff', FORMAT_START); - } - - const gitClangFormatPath = path.join(clangFormatPath, 'bin/git-clang-format'); - const result = spawn( - 'python', - [gitClangFormatPath, ...options, '--', ...filesToCheck], - { encoding: 'utf-8' } - ); - - if (result.stderr) { - console.error('Error running git-clang-format:', result.stderr); - return 2; - } - - const clangFormatOutput = result.stdout.trim(); - // Bail fast if in fix mode. - if (fix) { - console.log(clangFormatOutput); - return 0; - } - // Detect if there is any complains from clang-format - if ( - clangFormatOutput !== '' && - clangFormatOutput !== 'no modified files to format' && - clangFormatOutput !== 'clang-format did not modify any files' - ) { - console.error(clangFormatOutput); - const fixCmd = 'npm run lint:fix'; - console.error(` - ERROR: please run "${fixCmd}" to format changes in your commit - Note that when running the command locally, please keep your local - main branch and working branch up to date with nodejs/node-addon-api - to exclude un-related complains. - Or you can run "env FORMAT_START=upstream/main ${fixCmd}".`); - return 1; - } -} - -if (require.main === module) { - process.exitCode = main(process.argv.slice(2)); -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/conversion.js b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/conversion.js deleted file mode 100755 index f89245ac6..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/conversion.js +++ /dev/null @@ -1,301 +0,0 @@ -#! /usr/bin/env node - -'use strict'; - -const fs = require('fs'); -const path = require('path'); - -const args = process.argv.slice(2); -const dir = args[0]; -if (!dir) { - console.log('Usage: node ' + path.basename(__filename) + ' '); - process.exit(1); -} - -const NodeApiVersion = require('../package.json').version; - -const disable = args[1]; -let ConfigFileOperations; -if (disable !== '--disable' && dir !== '--disable') { - ConfigFileOperations = { - 'package.json': [ - [/([ ]*)"dependencies": {/g, '$1"dependencies": {\n$1 "node-addon-api": "' + NodeApiVersion + '",'], - [/[ ]*"nan": *"[^"]+"(,|)[\n\r]/g, ''] - ], - 'binding.gyp': [ - [/([ ]*)'include_dirs': \[/g, '$1\'include_dirs\': [\n$1 \'\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'], - [/Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);\s+(\w+)\.Reset\((\1)\);\s+\1->SetClassName\((Nan::String::New|Nan::New<(v8::)*String>)\("(.+?)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$6", {'], - [/Local\s+(\w+)\s*=\s*Nan::New\([\w\d:]+\);(?:\w+->Reset\(\1\))?\s+\1->SetClassName\(Nan::String::New\("(\w+)"\)\);/g, 'Napi::Function $1 = DefineClass(env, "$2", {'], - [/Nan::New\(([\w\d:]+)\)->GetFunction\(\)/g, 'Napi::Function::New(env, $1)'], - [/Nan::New\(([\w\d:]+)\)->GetFunction()/g, 'Napi::Function::New(env, $1);'], - [/Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'], - [/Nan::New\(([\w\d:]+)\)/g, 'Napi::Function::New(env, $1)'], - - // FunctionTemplate to FunctionReference - [/Nan::Persistent<(v8::)*FunctionTemplate>/g, 'Napi::FunctionReference'], - [/Nan::Persistent<(v8::)*Function>/g, 'Napi::FunctionReference'], - [/v8::Local/g, 'Napi::FunctionReference'], - [/Local/g, 'Napi::FunctionReference'], - [/v8::FunctionTemplate/g, 'Napi::FunctionReference'], - [/FunctionTemplate/g, 'Napi::FunctionReference'], - - [/([ ]*)Nan::SetPrototypeMethod\(\w+, "(\w+)", (\w+)\);/g, '$1InstanceMethod("$2", &$3),'], - [/([ ]*)(?:\w+\.Reset\(\w+\);\s+)?\(target\)\.Set\("(\w+)",\s*Nan::GetFunction\((\w+)\)\);/gm, - '});\n\n' + - '$1constructor = Napi::Persistent($3);\n' + - '$1constructor.SuppressDestruct();\n' + - '$1target.Set("$2", $3);'], - - // TODO: Other attribute combinations - [/static_cast\(ReadOnly\s*\|\s*DontDelete\)/gm, - 'static_cast(napi_enumerable | napi_configurable)'], - - [/([\w\d:<>]+?)::Cast\((.+?)\)/g, '$2.As<$1>()'], - - [/\*Nan::Utf8String\(([^)]+)\)/g, '$1->As().Utf8Value().c_str()'], - [/Nan::Utf8String +(\w+)\(([^)]+)\)/g, 'std::string $1 = $2.As()'], - [/Nan::Utf8String/g, 'std::string'], - - [/v8::String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'], - [/String::Utf8Value (.+?)\((.+?)\)/g, 'Napi::String $1(env, $2)'], - [/\.length\(\)/g, '.Length()'], - - [/Nan::MakeCallback\(([^,]+),[\s\\]+([^,]+),/gm, '$2.MakeCallback($1,'], - - [/class\s+(\w+)\s*:\s*public\s+Nan::ObjectWrap/g, 'class $1 : public Napi::ObjectWrap<$1>'], - [/(\w+)\(([^)]*)\)\s*:\s*Nan::ObjectWrap\(\)\s*(,)?/gm, '$1($2) : Napi::ObjectWrap<$1>()$3'], - - // HandleOKCallback to OnOK - [/HandleOKCallback/g, 'OnOK'], - // HandleErrorCallback to OnError - [/HandleErrorCallback/g, 'OnError'], - - // ex. .As() to .As() - [/\.As\(\)/g, '.As()'], - [/\.As<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>\(\)/g, '.As()'], - - // ex. Nan::New(info[0]) to Napi::Number::New(info[0]) - [/Nan::New<(v8::)*Integer>\((.+?)\)/g, 'Napi::Number::New(env, $2)'], - [/Nan::New\(([0-9.]+)\)/g, 'Napi::Number::New(env, $1)'], - [/Nan::New<(v8::)*String>\("(.+?)"\)/g, 'Napi::String::New(env, "$2")'], - [/Nan::New\("(.+?)"\)/g, 'Napi::String::New(env, "$1")'], - [/Nan::New<(v8::)*(.+?)>\(\)/g, 'Napi::$2::New(env)'], - [/Nan::New<(.+?)>\(\)/g, 'Napi::$1::New(env)'], - [/Nan::New<(v8::)*(.+?)>\(/g, 'Napi::$2::New(env, '], - [/Nan::New<(.+?)>\(/g, 'Napi::$1::New(env, '], - [/Nan::NewBuffer\(/g, 'Napi::Buffer::New(env, '], - // TODO: Properly handle this - [/Nan::New\(/g, 'Napi::New(env, '], - - [/\.IsInt32\(\)/g, '.IsNumber()'], - [/->IsInt32\(\)/g, '.IsNumber()'], - - [/(.+?)->BooleanValue\(\)/g, '$1.As().Value()'], - [/(.+?)->Int32Value\(\)/g, '$1.As().Int32Value()'], - [/(.+?)->Uint32Value\(\)/g, '$1.As().Uint32Value()'], - [/(.+?)->IntegerValue\(\)/g, '$1.As().Int64Value()'], - [/(.+?)->NumberValue\(\)/g, '$1.As().DoubleValue()'], - - // ex. Nan::To(info[0]) to info[0].Value() - [/Nan::To\((.+?)\)/g, '$2.To()'], - [/Nan::To<(Boolean|String|Number|Object|Array|Symbol|Function)>\((.+?)\)/g, '$2.To()'], - // ex. Nan::To(info[0]) to info[0].As().Value() - [/Nan::To\((.+?)\)/g, '$1.As().Value()'], - // ex. Nan::To(info[0]) to info[0].As().Int32Value() - [/Nan::To\((.+?)\)/g, '$1.As().Int32Value()'], - // ex. Nan::To(info[0]) to info[0].As().Int32Value() - [/Nan::To\((.+?)\)/g, '$1.As().Int32Value()'], - // ex. Nan::To(info[0]) to info[0].As().Uint32Value() - [/Nan::To\((.+?)\)/g, '$1.As().Uint32Value()'], - // ex. Nan::To(info[0]) to info[0].As().Int64Value() - [/Nan::To\((.+?)\)/g, '$1.As().Int64Value()'], - // ex. Nan::To(info[0]) to info[0].As().FloatValue() - [/Nan::To\((.+?)\)/g, '$1.As().FloatValue()'], - // ex. Nan::To(info[0]) to info[0].As().DoubleValue() - [/Nan::To\((.+?)\)/g, '$1.As().DoubleValue()'], - - [/Nan::New\((\w+)\)->HasInstance\((\w+)\)/g, '$2.InstanceOf($1.Value())'], - - [/Nan::Has\(([^,]+),\s*/gm, '($1).Has('], - [/\.Has\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Has($1)'], - [/\.Has\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Has($1)'], - - [/Nan::Get\(([^,]+),\s*/gm, '($1).Get('], - [/\.Get\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\)/gm, '.Get($1)'], - [/\.Get\([\s|\\]*Nan::New\(([^)]+)\)\)/gm, '.Get($1)'], - - [/Nan::Set\(([^,]+),\s*/gm, '($1).Set('], - [/\.Set\([\s|\\]*Nan::New<(v8::)*String>\(([^)]+)\)\s*,/gm, '.Set($1,'], - [/\.Set\([\s|\\]*Nan::New\(([^)]+)\)\s*,/gm, '.Set($1,'], - - // ex. node::Buffer::HasInstance(info[0]) to info[0].IsBuffer() - [/node::Buffer::HasInstance\((.+?)\)/g, '$1.IsBuffer()'], - // ex. node::Buffer::Length(info[0]) to info[0].Length() - [/node::Buffer::Length\((.+?)\)/g, '$1.As>().Length()'], - // ex. node::Buffer::Data(info[0]) to info[0].Data() - [/node::Buffer::Data\((.+?)\)/g, '$1.As>().Data()'], - [/Nan::CopyBuffer\(/g, 'Napi::Buffer::Copy(env, '], - - // Nan::AsyncQueueWorker(worker) - [/Nan::AsyncQueueWorker\((.+)\);/g, '$1.Queue();'], - [/Nan::(Undefined|Null|True|False)\(\)/g, 'env.$1()'], - - // Nan::ThrowError(error) to Napi::Error::New(env, error).ThrowAsJavaScriptException() - [/([ ]*)return Nan::Throw(\w*?)Error\((.+?)\);/g, '$1Napi::$2Error::New(env, $3).ThrowAsJavaScriptException();\n$1return env.Null();'], - [/Nan::Throw(\w*?)Error\((.+?)\);\n(\s*)return;/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n$3return env.Null();'], - [/Nan::Throw(\w*?)Error\((.+?)\);/g, 'Napi::$1Error::New(env, $2).ThrowAsJavaScriptException();\n'], - // Nan::RangeError(error) to Napi::RangeError::New(env, error) - [/Nan::(\w*?)Error\((.+)\)/g, 'Napi::$1Error::New(env, $2)'], - - [/Nan::Set\((.+?),\n* *(.+?),\n* *(.+?),\n* *(.+?)\)/g, '$1.Set($2, $3, $4)'], - - [/Nan::(Escapable)?HandleScope\s+(\w+)\s*;/g, 'Napi::$1HandleScope $2(env);'], - [/Nan::(Escapable)?HandleScope/g, 'Napi::$1HandleScope'], - [/Nan::ForceSet\(([^,]+), ?/g, '$1->DefineProperty('], - [/\.ForceSet\(Napi::String::New\(env, "(\w+)"\),\s*?/g, '.DefineProperty("$1", '], - // [ /Nan::GetPropertyNames\(([^,]+)\)/, '$1->GetPropertyNames()' ], - [/Nan::Equals\(([^,]+),/g, '$1.StrictEquals('], - - [/(.+)->Set\(/g, '$1.Set('], - - [/Nan::Callback/g, 'Napi::FunctionReference'], - - [/Nan::Persistent/g, 'Napi::ObjectReference'], - [/Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target/g, 'Napi::Env& env, Napi::Object& target'], - - [/(\w+)\*\s+(\w+)\s*=\s*Nan::ObjectWrap::Unwrap<\w+>\(info\.This\(\)\);/g, '$1* $2 = this;'], - [/Nan::ObjectWrap::Unwrap<(\w+)>\((.*)\);/g, '$2.Unwrap<$1>();'], - - [/Nan::NAN_METHOD_RETURN_TYPE/g, 'void'], - [/NAN_INLINE/g, 'inline'], - - [/Nan::NAN_METHOD_ARGS_TYPE/g, 'const Napi::CallbackInfo&'], - [/NAN_METHOD\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], - [/static\s*NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], - [/NAN_GETTER\(([\w\d:]+?)\)/g, 'Napi::Value $1(const Napi::CallbackInfo& info)'], - [/static\s*NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'], - [/NAN_SETTER\(([\w\d:]+?)\)/g, 'void $1(const Napi::CallbackInfo& info, const Napi::Value& value)'], - [/void Init\((v8::)*Local<(v8::)*Object> exports\)/g, 'Napi::Object Init(Napi::Env env, Napi::Object exports)'], - [/NAN_MODULE_INIT\(([\w\d:]+?)\);/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports);'], - [/NAN_MODULE_INIT\(([\w\d:]+?)\)/g, 'Napi::Object $1(Napi::Env env, Napi::Object exports)'], - - [/::(Init(?:ialize)?)\(target\)/g, '::$1(env, target, module)'], - [/constructor_template/g, 'constructor'], - - [/Nan::FunctionCallbackInfo<(v8::)?Value>[ ]*& [ ]*info\)[ ]*{\n*([ ]*)/gm, 'Napi::CallbackInfo& info) {\n$2Napi::Env env = info.Env();\n$2'], - [/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&\s*info\);/g, 'Napi::CallbackInfo& info);'], - [/Nan::FunctionCallbackInfo<(v8::)*Value>\s*&/g, 'Napi::CallbackInfo&'], - - [/Buffer::HasInstance\(([^)]+)\)/g, '$1.IsBuffer()'], - - [/info\[(\d+)\]->/g, 'info[$1].'], - [/info\[([\w\d]+)\]->/g, 'info[$1].'], - [/info\.This\(\)->/g, 'info.This().'], - [/->Is(Object|String|Int32|Number)\(\)/g, '.Is$1()'], - [/info.GetReturnValue\(\).SetUndefined\(\)/g, 'return env.Undefined()'], - [/info\.GetReturnValue\(\)\.Set\(((\n|.)+?)\);/g, 'return $1;'], - - // ex. Local to Napi::Value - [/v8::Local/g, 'Napi::$1'], - [/Local<(Value|Boolean|String|Number|Object|Array|Symbol|External|Function)>/g, 'Napi::$1'], - - // Declare an env in helper functions that take a Napi::Value - [/(\w+)\(Napi::Value (\w+)(,\s*[^()]+)?\)\s*{\n*([ ]*)/gm, '$1(Napi::Value $2$3) {\n$4Napi::Env env = $2.Env();\n$4'], - - // delete #include and/or - [/#include +(<|")(?:node|nan).h("|>)/g, '#include $1napi.h$2\n#include $1uv.h$2'], - // NODE_MODULE to NODE_API_MODULE - [/NODE_MODULE/g, 'NODE_API_MODULE'], - [/Nan::/g, 'Napi::'], - [/nan.h/g, 'napi.h'], - - // delete .FromJust() - [/\.FromJust\(\)/g, ''], - // delete .ToLocalCheck() - [/\.ToLocalChecked\(\)/g, ''], - [/^.*->SetInternalFieldCount\(.*$/gm, ''], - - // replace using node; and/or using v8; to using Napi; - [/using (node|v8);/g, 'using Napi;'], - [/using namespace (node|Nan|v8);/g, 'using namespace Napi;'], - // delete using v8::Local; - [/using v8::Local;\n/g, ''], - // replace using v8::XXX; with using Napi::XXX - [/using v8::([A-Za-z]+);/g, 'using Napi::$1;'] - -]; - -const paths = listFiles(dir); -paths.forEach(function (dirEntry) { - const filename = dirEntry.split('\\').pop().split('/').pop(); - - // Check whether the file is a source file or a config file - // then execute function accordingly - const sourcePattern = /.+\.h|.+\.cc|.+\.cpp/; - if (sourcePattern.test(filename)) { - convertFile(dirEntry, SourceFileOperations); - } else if (ConfigFileOperations[filename] != null) { - convertFile(dirEntry, ConfigFileOperations[filename]); - } -}); - -function listFiles (dir, filelist) { - const files = fs.readdirSync(dir); - filelist = filelist || []; - files.forEach(function (file) { - if (file === 'node_modules') { - return; - } - - if (fs.statSync(path.join(dir, file)).isDirectory()) { - filelist = listFiles(path.join(dir, file), filelist); - } else { - filelist.push(path.join(dir, file)); - } - }); - return filelist; -} - -function convert (content, operations) { - for (let i = 0; i < operations.length; i++) { - const operation = operations[i]; - content = content.replace(operation[0], operation[1]); - } - return content; -} - -function convertFile (fileName, operations) { - fs.readFile(fileName, 'utf-8', function (err, file) { - if (err) throw err; - - file = convert(file, operations); - - fs.writeFile(fileName, file, function (err) { - if (err) throw err; - }); - }); -} diff --git a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/eslint-format.js b/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/eslint-format.js deleted file mode 100644 index 1dda44495..000000000 --- a/.yarn/unplugged/node-addon-api-npm-5.1.0-b50d00f739/node_modules/node-addon-api/tools/eslint-format.js +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node - -const spawn = require('child_process').spawnSync; - -const filesToCheck = '*.js'; -const FORMAT_START = process.env.FORMAT_START || 'main'; -const IS_WIN = process.platform === 'win32'; -const ESLINT_PATH = IS_WIN ? 'node_modules\\.bin\\eslint.cmd' : 'node_modules/.bin/eslint'; - -function main (args) { - let fix = false; - while (args.length > 0) { - switch (args[0]) { - case '-f': - case '--fix': - fix = true; - break; - default: - } - args.shift(); - } - - // Check js files that change on unstaged file - const fileUnStaged = spawn( - 'git', - ['diff', '--name-only', FORMAT_START, filesToCheck], - { - encoding: 'utf-8' - } - ); - - // Check js files that change on staged file - const fileStaged = spawn( - 'git', - ['diff', '--name-only', '--cached', FORMAT_START, filesToCheck], - { - encoding: 'utf-8' - } - ); - - const options = [ - ...fileStaged.stdout.split('\n').filter((f) => f !== ''), - ...fileUnStaged.stdout.split('\n').filter((f) => f !== '') - ]; - - if (fix) { - options.push('--fix'); - } - - const result = spawn(ESLINT_PATH, [...options], { - encoding: 'utf-8' - }); - - if (result.error && result.error.errno === 'ENOENT') { - console.error('Eslint not found! Eslint is supposed to be found at ', ESLINT_PATH); - return 2; - } - - if (result.status === 1) { - console.error('Eslint error:', result.stdout); - const fixCmd = 'npm run lint:fix'; - console.error(`ERROR: please run "${fixCmd}" to format changes in your commit - Note that when running the command locally, please keep your local - main branch and working branch up to date with nodejs/node-addon-api - to exclude un-related complains. - Or you can run "env FORMAT_START=upstream/main ${fixCmd}". - Also fix JS files by yourself if necessary.`); - return 1; - } - - if (result.stderr) { - console.error('Error running eslint:', result.stderr); - return 2; - } -} - -if (require.main === module) { - process.exitCode = main(process.argv.slice(2)); -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index c6b213d7b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,52 +0,0 @@ - - -Please look thru your error log for the string `gyp info using node-gyp@` and if the version number is less than the [current release of node-gyp](https://github.com/nodejs/node-gyp/releases) then __please upgrade__ using the instructions at https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md and try your command again. - -Requests for help with [`node-sass` are very common](https://github.com/nodejs/node-gyp/issues?q=label%3A%22Node+Sass+--%3E+Dart+Sass%22). Please be aware that this package is deprecated, you should seek alternatives and avoid opening new issues about it here. - -* **Node Version**: -* **Platform**: -* **Compiler**: -* **Module**: - -
Verbose output (from npm or node-gyp): - -``` -Paste your log here, between the backticks. It can be: - - npm --verbose output, - - or contents of npm-debug.log, - - or output of node-gyp rebuild --verbose. -Include the command you were trying to run. - -This should look like this: - ->npm --verbose -npm info it worked if it ends with ok -npm verb cli [ -npm verb cli 'C:\\...\\node\\13.9.0\\x64\\node.exe', -npm verb cli 'C:\\...\\node\\13.9.0\\x64\\node_modules\\npm\\bin\\npm-cli.js', -npm verb cli '--verbose' -npm verb cli ] -npm info using npm@6.13.7 -npm info using node@v13.9.0 - -Usage: npm -(...) -``` - -
- - diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/PULL_REQUEST_TEMPLATE.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index bcc4bb1a0..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ - - -##### Checklist - - -- [ ] `npm install && npm test` passes -- [ ] tests are included -- [ ] documentation is changed or added -- [ ] commit message follows [commit guidelines](https://github.com/googleapis/release-please#how-should-i-write-my-commits) - -##### Description of change - - diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/release-please.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/release-please.yml deleted file mode 100644 index 7d3cf9dd4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/release-please.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: release-please - -on: - push: - branches: - - master - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v2 - id: release - with: - package-name: node-gyp - release-type: node - changelog-types: > - [{"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"bin","section":"Core","hidden":false}, - {"type":"gyp","section":"Core","hidden":false}, - {"type":"lib","section":"Core","hidden":false}, - {"type":"src","section":"Core","hidden":false}, - {"type":"test","section":"Tests","hidden":false}, - {"type":"build","section":"Core","hidden":false}, - {"type":"clean","section":"Core","hidden":false}, - {"type":"configure","section":"Core","hidden":false}, - {"type":"install","section":"Core","hidden":false}, - {"type":"list","section":"Core","hidden":false}, - {"type":"rebuild","section":"Core","hidden":false}, - {"type":"remove","section":"Core","hidden":false}, - {"type":"deps","section":"Core","hidden":false}, - {"type":"python","section":"Core","hidden":false}, - {"type":"lin","section":"Core","hidden":false}, - {"type":"linux","section":"Core","hidden":false}, - {"type":"mac","section":"Core","hidden":false}, - {"type":"macos","section":"Core","hidden":false}, - {"type":"win","section":"Core","hidden":false}, - {"type":"windows","section":"Core","hidden":false}, - {"type":"zos","section":"Core","hidden":false}, - {"type":"doc","section":"Doc","hidden":false}, - {"type":"docs","section":"Doc","hidden":false}, - {"type":"readme","section":"Doc","hidden":false}, - {"type":"chore","section":"Miscellaneous","hidden":false}, - {"type":"refactor","section":"Miscellaneous","hidden":false}, - {"type":"ci","section":"Miscellaneous","hidden":false}, - {"type":"meta","section":"Miscellaneous","hidden":false}] - - # Standard Conventional Commits: `feat` and `fix` - # node-gyp subdirectories: `bin`, `gyp`, `lib`, `src`, `test` - # node-gyp subcommands: `build`, `clean`, `configure`, `install`, `list`, `rebuild`, `remove` - # Core abstract category: `deps` - # Languages/platforms: `python`, `lin`, `linux`, `mac`, `macos`, `win`, `window`, `zos` - # Documentation: `doc`, `docs`, `readme` - # Standard Conventional Commits: `chore` (under "Miscellaneous") - # Miscellaneous abstract categories: `refactor`, `ci`, `meta` diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/tests.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/tests.yml deleted file mode 100644 index f7c9b979e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -# TODO: Line 43, enable pytest --doctest-modules - -name: Tests -on: [push, pull_request] -jobs: - Tests: - strategy: - fail-fast: false - max-parallel: 15 - matrix: - node: [12.x, 14.x, 16.x] - python: ["3.6", "3.8", "3.10"] - os: [macos-latest, ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - name: Use Python ${{ matrix.python }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - env: - PYTHON_VERSION: ${{ matrix.python }} - - name: Install Dependencies - run: | - npm install --no-progress - pip install flake8 pytest - - name: Set Windows environment - if: matrix.os == 'windows-latest' - run: | - echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV - echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV - - name: Lint Python - if: matrix.os == 'ubuntu-latest' - run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics - - name: Run Python tests - run: python -m pytest - # - name: Run doctests with pytest - # run: python -m pytest --doctest-modules - - name: Run Node tests - run: npm test diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/visual-studio.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/visual-studio.yml deleted file mode 100644 index 6bb4574d6..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.github/workflows/visual-studio.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Tests on Windows -on: [push, pull_request] -jobs: - Tests: - strategy: - fail-fast: false - max-parallel: 15 - matrix: - os: [windows-2022] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Install Dependencies - run: | - npm install --no-progress - - name: Set Windows environment - if: matrix.os == 'windows-latest' - run: | - echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV - echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV - - name: Environment Information - run: npx envinfo - - name: Run Node tests - run: npm test diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.ready b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/CHANGELOG.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/CHANGELOG.md deleted file mode 100644 index 1e54fd69a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/CHANGELOG.md +++ /dev/null @@ -1,687 +0,0 @@ -# Changelog - -### [8.4.1](https://www.github.com/nodejs/node-gyp/compare/v8.4.0...v8.4.1) (2021-11-19) - - -### Bug Fixes - -* windows command missing space ([#2553](https://www.github.com/nodejs/node-gyp/issues/2553)) ([cc37b88](https://www.github.com/nodejs/node-gyp/commit/cc37b880690706d3c5d04d5a68c76c392a0a23ed)) - - -### Doc - -* fix typo in powershell node-gyp update ([787cf7f](https://www.github.com/nodejs/node-gyp/commit/787cf7f8e5ddd5039e02b64ace6b7b15e06fe0a4)) - - -### Core - -* npmlog@6.0.0 ([8083f6b](https://www.github.com/nodejs/node-gyp/commit/8083f6b855bd7f3326af04c5f5269fc28d7f2508)) - -## [8.4.0](https://www.github.com/nodejs/node-gyp/compare/v8.3.0...v8.4.0) (2021-11-05) - - -### Features - -* build with config.gypi from node headers ([a27dc08](https://www.github.com/nodejs/node-gyp/commit/a27dc08696911c6d81e76cc228697243069103c1)) -* support vs2022 ([#2533](https://www.github.com/nodejs/node-gyp/issues/2533)) ([5a00387](https://www.github.com/nodejs/node-gyp/commit/5a00387e5f8018264a1822f6c4d5dbf425f21cf6)) - -## [8.3.0](https://www.github.com/nodejs/node-gyp/compare/v8.2.0...v8.3.0) (2021-10-11) - - -### Features - -* **gyp:** update gyp to v0.10.0 ([#2521](https://www.github.com/nodejs/node-gyp/issues/2521)) ([5585792](https://www.github.com/nodejs/node-gyp/commit/5585792922a97f0629f143c560efd74470eae87f)) - - -### Tests - -* Python 3.10 was release on Oct. 4th ([#2504](https://www.github.com/nodejs/node-gyp/issues/2504)) ([0a67dcd](https://www.github.com/nodejs/node-gyp/commit/0a67dcd1307f3560495219253241eafcbf4e2a69)) - - -### Miscellaneous - -* **deps:** bump make-fetch-happen from 8.0.14 to 9.1.0 ([b05b4fe](https://www.github.com/nodejs/node-gyp/commit/b05b4fe9891f718f40edf547e9b50e982826d48a)) -* refactor the creation of config.gypi file ([f2ad87f](https://www.github.com/nodejs/node-gyp/commit/f2ad87ff65f98ad66daa7225ad59d99b759a2b07)) - -## [8.2.0](https://www.github.com/nodejs/node-gyp/compare/v8.1.0...v8.2.0) (2021-08-23) - - -### Features - -* **gyp:** update gyp to v0.9.6 ([#2481](https://www.github.com/nodejs/node-gyp/issues/2481)) ([ed9a9ed](https://www.github.com/nodejs/node-gyp/commit/ed9a9ed653a17c84afa3c327161992d0da7d0cea)) - - -### Bug Fixes - -* add error arg back into catch block for older Node.js users ([5cde818](https://www.github.com/nodejs/node-gyp/commit/5cde818aac715477e9e9747966bb6b4c4ed070a8)) -* change default gyp update message ([#2420](https://www.github.com/nodejs/node-gyp/issues/2420)) ([cfd12ff](https://www.github.com/nodejs/node-gyp/commit/cfd12ff3bb0eb4525173413ef6a94b3cd8398cad)) -* doc how to update node-gyp independently from npm ([c8c0af7](https://www.github.com/nodejs/node-gyp/commit/c8c0af72e78141a02b5da4cd4d704838333a90bd)) -* missing spaces ([f0882b1](https://www.github.com/nodejs/node-gyp/commit/f0882b1264b2fa701adbc81a3be0b3cba80e333d)) - - -### Core - -* deep-copy process.config during configure ([#2368](https://www.github.com/nodejs/node-gyp/issues/2368)) ([5f1a06c](https://www.github.com/nodejs/node-gyp/commit/5f1a06c50f3b0c3d292f64948f85a004cfcc5c87)) - - -### Miscellaneous - -* **deps:** bump tar from 6.1.0 to 6.1.2 ([#2474](https://www.github.com/nodejs/node-gyp/issues/2474)) ([ec15a3e](https://www.github.com/nodejs/node-gyp/commit/ec15a3e5012004172713c11eebcc9d852d32d380)) -* fix typos discovered by codespell ([#2442](https://www.github.com/nodejs/node-gyp/issues/2442)) ([2d0ce55](https://www.github.com/nodejs/node-gyp/commit/2d0ce5595e232a3fc7c562cdf39efb77e2312cc1)) -* GitHub Actions Test on node: [12.x, 14.x, 16.x] ([#2439](https://www.github.com/nodejs/node-gyp/issues/2439)) ([b7bccdb](https://www.github.com/nodejs/node-gyp/commit/b7bccdb527d93b0bb0ce99713f083ce2985fe85c)) - - -### Doc - -* correct link to "binding.gyp files out in the wild" ([#2483](https://www.github.com/nodejs/node-gyp/issues/2483)) ([660dd7b](https://www.github.com/nodejs/node-gyp/commit/660dd7b2a822c184be8027b300e68be67b366772)) -* **wiki:** Add a link to the node-midi binding.gyp file. ([b354711](https://www.github.com/nodejs/node-gyp/commit/b3547115f6e356358138310e857c7f1ec627a8a7)) -* **wiki:** add bcrypt ([e199cfa](https://www.github.com/nodejs/node-gyp/commit/e199cfa8fc6161492d2a6ade2190510d0ebf7c0f)) -* **wiki:** Add helpful information ([4eda827](https://www.github.com/nodejs/node-gyp/commit/4eda8275c03dae6d2f5c40f3c1dbe930d84b0f2b)) -* **wiki:** Add node-canvas ([13a9553](https://www.github.com/nodejs/node-gyp/commit/13a955317b39caf98fd1f412d8d3f41599e979fd)) -* **wiki:** Add node-openvg-canvas and node-openvg. ([61f709e](https://www.github.com/nodejs/node-gyp/commit/61f709ec4d9f256a6467e9ff84430a48eeb629d1)) -* **wiki:** add one more example ([77f3632](https://www.github.com/nodejs/node-gyp/commit/77f363272930d3d4d24fd3973be22e6237128fcc)) -* **wiki:** add topcube, node-osmium, and node-osrm ([1a75d2b](https://www.github.com/nodejs/node-gyp/commit/1a75d2bf2f562ba50846893a516e111cfbb50885)) -* **wiki:** Added details for properly fixing ([3d4d9d5](https://www.github.com/nodejs/node-gyp/commit/3d4d9d52d6b5b49de06bb0bb5b68e2686d2b7ebd)) -* **wiki:** Added Ghostscript4JS ([bf4bed1](https://www.github.com/nodejs/node-gyp/commit/bf4bed1b96a7d22fba6f97f4552ad09f32ac3737)) -* **wiki:** added levelup ([1575bce](https://www.github.com/nodejs/node-gyp/commit/1575bce3a53db628bfb023fd6f3258fdf98c3195)) -* **wiki:** Added nk-mysql (nodamysql) ([5b4f2d0](https://www.github.com/nodejs/node-gyp/commit/5b4f2d0e1d5d3eadfd03aaf9c1668340f76c4bea)) -* **wiki:** Added nk-xrm-installer .gyp references, including .py scripts for providing complete reference to examples of fetching source via http, extracting, and moving files (as opposed to copying) ([ceb3088](https://www.github.com/nodejs/node-gyp/commit/ceb30885b74f6789374ef52267b84767be93ebe4)) -* **wiki:** Added tip about resolving frustrating LNK1181 error ([e64798d](https://www.github.com/nodejs/node-gyp/commit/e64798de8cac6031ad598a86d7599e81b4d20b17)) -* **wiki:** ADDED: Node.js binding to OpenCV ([e2dc777](https://www.github.com/nodejs/node-gyp/commit/e2dc77730b09d7ee8682d7713a7603a2d7aacabd)) -* **wiki:** Adding link to node-cryptopp's gyp file ([875adbe](https://www.github.com/nodejs/node-gyp/commit/875adbe2a4669fa5f2be0250ffbf98fb55e800fd)) -* **wiki:** Adding the sharp library to the list ([9dce0e4](https://www.github.com/nodejs/node-gyp/commit/9dce0e41650c3fa973e6135a79632d022c662a1d)) -* **wiki:** Adds node-fann ([23e3d48](https://www.github.com/nodejs/node-gyp/commit/23e3d485ed894ba7c631e9c062f5e366b50c416c)) -* **wiki:** Adds node-inotify and v8-profiler ([b6e542f](https://www.github.com/nodejs/node-gyp/commit/b6e542f644dbbfe22b88524ec500696e06ee4af7)) -* **wiki:** Bumping Python version from 2.3 to 2.7 as per the node-gyp readme ([55ebd6e](https://www.github.com/nodejs/node-gyp/commit/55ebd6ebacde975bf84f7bf4d8c66e64cc7cd0da)) -* **wiki:** C++ build tools version upgraded ([5b899b7](https://www.github.com/nodejs/node-gyp/commit/5b899b70db729c392ced7c98e8e17590c6499fc3)) -* **wiki:** change bcrypt url to binding.gyp file ([e11bdd8](https://www.github.com/nodejs/node-gyp/commit/e11bdd84de6144492d3eb327d67cbf2d62da1a76)) -* **wiki:** Clarification + direct link to VS2010 ([531c724](https://www.github.com/nodejs/node-gyp/commit/531c724561d947b5d870de8d52dd8c3c51c5ec2d)) -* **wiki:** Correcting the link to node-osmium ([fae7516](https://www.github.com/nodejs/node-gyp/commit/fae7516a1d2829b6e234eaded74fb112ebd79a05)) -* **wiki:** Created "binding.gyp" files out in the wild (markdown) ([d4fd143](https://www.github.com/nodejs/node-gyp/commit/d4fd14355bbe57f229f082f47bb2b3670868203f)) -* **wiki:** Created Common issues (markdown) ([a38299e](https://www.github.com/nodejs/node-gyp/commit/a38299ea340ceb0e732c6dc6a1b4760257644839)) -* **wiki:** Created Error: "pre" versions of node cannot be installed (markdown) ([98bc80d](https://www.github.com/nodejs/node-gyp/commit/98bc80d7a62ba70c881f3c39d94f804322e57852)) -* **wiki:** Created Linking to OpenSSL (markdown) ([c46d00d](https://www.github.com/nodejs/node-gyp/commit/c46d00d83bac5173dea8bbbb175a1a7de74fdaca)) -* **wiki:** Created Updating npm's bundled node gyp (markdown) ([e0ac8d1](https://www.github.com/nodejs/node-gyp/commit/e0ac8d15af46aadd1c220599e63199b154a514e6)) -* **wiki:** Created use of undeclared identifier 'TypedArray' (markdown) ([65ba711](https://www.github.com/nodejs/node-gyp/commit/65ba71139e9b7f64ac823e575ee9dbf17d937ce4)) -* **wiki:** Created Visual Studio 2010 Setup (markdown) ([5b80e83](https://www.github.com/nodejs/node-gyp/commit/5b80e834c8f79dda9fb2770a876ff3cf649c06f3)) -* **wiki:** Created Visual studio 2012 setup (markdown) ([becef31](https://www.github.com/nodejs/node-gyp/commit/becef316b6c46a33e783667720ee074a0141d1a5)) -* **wiki:** Destroyed Visual Studio 2010 Setup (markdown) ([93423b4](https://www.github.com/nodejs/node-gyp/commit/93423b43606de9664aeb79635825f5e9941ec9bc)) -* **wiki:** Destroyed Visual studio 2012 setup (markdown) ([3601508](https://www.github.com/nodejs/node-gyp/commit/3601508bb10fa05da0ddc7e70d57e4b4dd679657)) -* **wiki:** Different commands for Windows npm v6 vs. v7 ([0fce46b](https://www.github.com/nodejs/node-gyp/commit/0fce46b53340c85e8091cde347d5ed23a443c82f)) -* **wiki:** Drop in favor of ([9285ff6](https://www.github.com/nodejs/node-gyp/commit/9285ff6e451c52c070a05f05f0a9602621d91d53)) -* **wiki:** Explicit link to Visual C++ 2010 Express ([378c363](https://www.github.com/nodejs/node-gyp/commit/378c3632f02c096ed819ec8f2611c65bef0c0554)) -* **wiki:** fix link to gyp file used to build libsqlite3 ([54db8d7](https://www.github.com/nodejs/node-gyp/commit/54db8d7ac33e3f98220960b5d86cfa18a75b53cb)) -* **wiki:** Fix link to node-zipfile ([92e49a8](https://www.github.com/nodejs/node-gyp/commit/92e49a858ed69cb4847a26a5676ab56ef5e2de33)) -* **wiki:** fixed node-serialport link ([954ee53](https://www.github.com/nodejs/node-gyp/commit/954ee530b3972d1db591fce32368e4e31b5a25d8)) -* **wiki:** I highly missing it in common issue as every windows biggner face that issue ([d617fae](https://www.github.com/nodejs/node-gyp/commit/d617faee29c40871ca5c8f93efd0ce929a40d541)) -* **wiki:** if ouns that the -h did not help. I founs on github that there was support for visual studio 2015, while i couldn't install node-red beacuse it kept telling me the key 2015 was missing. looking in he gyp python code i found the local file was bot up t dat with the github repo. updating took several efforts before i tried to drop the -g option. ([408b72f](https://www.github.com/nodejs/node-gyp/commit/408b72f561329408daeb17834436e381406efcc8)) -* **wiki:** If permissions error, please try and then the command. ([ee8e1c1](https://www.github.com/nodejs/node-gyp/commit/ee8e1c1e5334096d58e0d6bca6c006f2ee9c88cb)) -* **wiki:** Improve Unix instructions ([c3e5487](https://www.github.com/nodejs/node-gyp/commit/c3e548736645b535ea5bce613d74ca3e98598243)) -* **wiki:** link to docs/ from README ([b52e487](https://www.github.com/nodejs/node-gyp/commit/b52e487eac1eb421573d1e67114a242eeff45a00)) -* **wiki:** Lower case L ([3aa2c6b](https://www.github.com/nodejs/node-gyp/commit/3aa2c6bdb07971b87505e32e32548d75264bd19f)) -* **wiki:** Make changes discussed in https://github.com/nodejs/node-gyp/issues/2416 ([1dcad87](https://www.github.com/nodejs/node-gyp/commit/1dcad873539027511a5f0243baf770ea90f6f4e2)) -* **wiki:** move wiki docs into doc/ ([f0a4835](https://www.github.com/nodejs/node-gyp/commit/f0a48355d86534ec3bdabcdb3ce3340fa2e17f39)) -* **wiki:** node-sass in the wild ([d310a73](https://www.github.com/nodejs/node-gyp/commit/d310a73d64d0065050377baac7047472f7424a1b)) -* **wiki:** node-srs was a 404 ([bbca21a](https://www.github.com/nodejs/node-gyp/commit/bbca21a1e1ede4c473aff365ca71989a5bda7b57)) -* **wiki:** Note: VS2010 seems to be no longer available! VS2013 or nothing! ([7b5dcaf](https://www.github.com/nodejs/node-gyp/commit/7b5dcafafccdceae4b8f2b53ac9081a694b6ade8)) -* **wiki:** safer doc names, remove unnecessary TypedArray doc ([161c235](https://www.github.com/nodejs/node-gyp/commit/161c2353ef5b562f4acfb2fd77608fcbd0800fc0)) -* **wiki:** sorry, forgot to mention a specific windows version. ([d69dffc](https://www.github.com/nodejs/node-gyp/commit/d69dffc16c2b1e3c60dcb5d1c35a49270ba22a35)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([7444b47](https://www.github.com/nodejs/node-gyp/commit/7444b47a7caac1e14d1da474a7fcfcf88d328017)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d766b74](https://www.github.com/nodejs/node-gyp/commit/d766b7427851e6c2edc02e2504a7be9be7e330c0)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d319b0e](https://www.github.com/nodejs/node-gyp/commit/d319b0e98c7085de8e51bc5595eba4264b99a7d5)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3c6692d](https://www.github.com/nodejs/node-gyp/commit/3c6692d538f0ce973869aa237118b7d2483feccd)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([93392d5](https://www.github.com/nodejs/node-gyp/commit/93392d559ce6f250b9c7fe8177e6c88603809dc1)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([8841158](https://www.github.com/nodejs/node-gyp/commit/88411588f300e9b7c00fe516ecd977a1feeeb15c)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([81bfa1f](https://www.github.com/nodejs/node-gyp/commit/81bfa1f1b63d522a9f8a9ae9ca0c7ae90fe75140)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d1cd237](https://www.github.com/nodejs/node-gyp/commit/d1cd237bad06fa507adb354b9e2181a14dc63d24)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3de9e17](https://www.github.com/nodejs/node-gyp/commit/3de9e17e0b8a387eafe7bd18d0ec1e3191d118e8)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([a9b7096](https://www.github.com/nodejs/node-gyp/commit/a9b70968fb956eab3b95672048b94350e1565ca3)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3236069](https://www.github.com/nodejs/node-gyp/commit/3236069689e7e0eb15b324fce74ab58158956f98)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([1462755](https://www.github.com/nodejs/node-gyp/commit/14627556966e5d513bdb8e5208f0e1300f68991f)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([7ab1337](https://www.github.com/nodejs/node-gyp/commit/7ab133752a6c402bb96dcd3d671d73e03e9487ad)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([640895d](https://www.github.com/nodejs/node-gyp/commit/640895d36b7448c646a3b850c1e159106f83c724)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([ced8c96](https://www.github.com/nodejs/node-gyp/commit/ced8c968457f285ab8989c291d28173d7730833c)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([27b883a](https://www.github.com/nodejs/node-gyp/commit/27b883a350ad0db6b9130d7b996f35855ec34c7a)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d29fb13](https://www.github.com/nodejs/node-gyp/commit/d29fb134f1c4b9dd729ba95f2979e69e0934809f)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([2765891](https://www.github.com/nodejs/node-gyp/commit/27658913e6220cf0371b4b73e25a0e4ab11108a1)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([dc97766](https://www.github.com/nodejs/node-gyp/commit/dc9776648d432bca6775c176641f16da14522d4c)) -* **wiki:** Updated Error: "pre" versions of node cannot be installed (markdown) ([e9f8b33](https://www.github.com/nodejs/node-gyp/commit/e9f8b33d1f87d04f22cb09a814d7c55d0fa38446)) -* **wiki:** Updated Home (markdown) ([3407109](https://www.github.com/nodejs/node-gyp/commit/3407109325cf7ba1e925656b9eb75feffab0557c)) -* **wiki:** Updated Home (markdown) ([6e392bc](https://www.github.com/nodejs/node-gyp/commit/6e392bcdd3dd1691773e6e16e1dffc35931b81e0)) -* **wiki:** Updated Home (markdown) ([65efe32](https://www.github.com/nodejs/node-gyp/commit/65efe32ccb8d446ce569453364f922dd9d27c945)) -* **wiki:** Updated Home (markdown) ([ea28f09](https://www.github.com/nodejs/node-gyp/commit/ea28f0947af91fa638be355143f5df89d2e431c8)) -* **wiki:** Updated Home (markdown) ([0e37ff4](https://www.github.com/nodejs/node-gyp/commit/0e37ff48b306c12149661b375895741d3d710da7)) -* **wiki:** Updated Home (markdown) ([b398ef4](https://www.github.com/nodejs/node-gyp/commit/b398ef46f660d2b1506508550dadfb4c35639e4b)) -* **wiki:** Updated Linking to OpenSSL (markdown) ([8919028](https://www.github.com/nodejs/node-gyp/commit/8919028921fd304f08044098434f0dc6071fb7cf)) -* **wiki:** Updated Linking to OpenSSL (markdown) ([c00eb77](https://www.github.com/nodejs/node-gyp/commit/c00eb778fc7dc27e4dab3a9219035ea20458b33b)) -* **wiki:** Updated node-levelup to node-leveldown (broken links) ([59668bb](https://www.github.com/nodejs/node-gyp/commit/59668bb0b904feccf3c09afa2fd37378c77af967)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([d314854](https://www.github.com/nodejs/node-gyp/commit/d31485415ef69d46effa6090c95698341965de1b)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([11858b0](https://www.github.com/nodejs/node-gyp/commit/11858b0655d1eee00c62ad628e719d4378803d14)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([33561e9](https://www.github.com/nodejs/node-gyp/commit/33561e9cbf5f4eb46111318503c77df2c6eb484a)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([4a7f2d0](https://www.github.com/nodejs/node-gyp/commit/4a7f2d0d869a65c99a78504976567017edadf657)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([979a706](https://www.github.com/nodejs/node-gyp/commit/979a7063b950c088a7f4896fc3a48e1d00dfd231)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([e50e04d](https://www.github.com/nodejs/node-gyp/commit/e50e04d7b6a3754ea0aa11fe8cef491b3bc5bdd4)) - -## [8.1.0](https://www.github.com/nodejs/node-gyp/compare/v8.0.0...v8.1.0) (2021-05-28) - - -### Features - -* **gyp:** update gyp to v0.9.1 ([#2402](https://www.github.com/nodejs/node-gyp/issues/2402)) ([814b1b0](https://www.github.com/nodejs/node-gyp/commit/814b1b0eda102afb9fc87e81638a9cf5b650bb10)) - - -### Miscellaneous - -* add `release-please-action` for automated releases ([#2395](https://www.github.com/nodejs/node-gyp/issues/2395)) ([07e9d7c](https://www.github.com/nodejs/node-gyp/commit/07e9d7c7ee80ba119ea760c635f72fd8e7efe198)) - - -### Core - -* fail gracefully if we can't find the username ([#2375](https://www.github.com/nodejs/node-gyp/issues/2375)) ([fca4795](https://www.github.com/nodejs/node-gyp/commit/fca4795512c67dc8420aaa0d913b5b89a4b147f3)) -* log as yes/no whether build dir was created ([#2370](https://www.github.com/nodejs/node-gyp/issues/2370)) ([245dee5](https://www.github.com/nodejs/node-gyp/commit/245dee5b62581309946872ae253226ea3a42c0e3)) - - -### Doc - -* fix v8.0.0 release date ([4b83c3d](https://www.github.com/nodejs/node-gyp/commit/4b83c3de7300457919d53f26d96ea9ad6f6bedd8)) -* remove redundant version info ([#2403](https://www.github.com/nodejs/node-gyp/issues/2403)) ([1423670](https://www.github.com/nodejs/node-gyp/commit/14236709de64b100a424396b91a5115639daa0ef)) -* Update README.md Visual Studio Community page polski to auto ([#2371](https://www.github.com/nodejs/node-gyp/issues/2371)) ([1b4697a](https://www.github.com/nodejs/node-gyp/commit/1b4697abf69ef574a48faf832a7098f4c6c224a5)) - -## v8.0.0 2021-04-03 - -* [[`0d8a6f1b19`](https://github.com/nodejs/node-gyp/commit/0d8a6f1b19)] - **ci**: update actions/setup-node to v2 (#2302) (Sora Morimoto) [#2302](https://github.com/nodejs/node-gyp/pull/2302) -* [[`15a5c7d45b`](https://github.com/nodejs/node-gyp/commit/15a5c7d45b)] - **ci**: migrate deprecated grammar (#2285) (Jiawen Geng) [#2285](https://github.com/nodejs/node-gyp/pull/2285) -* [[`06ddde27f9`](https://github.com/nodejs/node-gyp/commit/06ddde27f9)] - **deps**: sync mutual dependencies with npm (DeeDeeG) [#2348](https://github.com/nodejs/node-gyp/pull/2348) -* [[`a5fd1f41e3`](https://github.com/nodejs/node-gyp/commit/a5fd1f41e3)] - **doc**: add downloads badge (#2352) (Jiawen Geng) [#2352](https://github.com/nodejs/node-gyp/pull/2352) -* [[`cc1cbce056`](https://github.com/nodejs/node-gyp/commit/cc1cbce056)] - **doc**: update macOS\_Catalina.md (#2293) (iMrLopez) [#2293](https://github.com/nodejs/node-gyp/pull/2293) -* [[`6287118fc4`](https://github.com/nodejs/node-gyp/commit/6287118fc4)] - **doc**: updated README.md to copy easily (#2281) (மனோஜ்குமார் பழனிச்சாமி) [#2281](https://github.com/nodejs/node-gyp/pull/2281) -* [[`66c0f04467`](https://github.com/nodejs/node-gyp/commit/66c0f04467)] - **doc**: add missing `sudo` to Catalina doc (Karl Horky) [#2244](https://github.com/nodejs/node-gyp/pull/2244) -* [[`0da2e0140d`](https://github.com/nodejs/node-gyp/commit/0da2e0140d)] - **gyp**: update gyp to v0.8.1 (#2355) (DeeDeeG) [#2355](https://github.com/nodejs/node-gyp/pull/2355) -* [[`0093ec8646`](https://github.com/nodejs/node-gyp/commit/0093ec8646)] - **gyp**: Improve our flake8 linting tests (Christian Clauss) [#2356](https://github.com/nodejs/node-gyp/pull/2356) -* [[`a78b584236`](https://github.com/nodejs/node-gyp/commit/a78b584236)] - **(SEMVER-MAJOR)** **gyp**: remove support for Python 2 (#2300) (Christian Clauss) [#2300](https://github.com/nodejs/node-gyp/pull/2300) -* [[`c3c510d89e`](https://github.com/nodejs/node-gyp/commit/c3c510d89e)] - **gyp**: update gyp to v0.8.0 (#2318) (Christian Clauss) [#2318](https://github.com/nodejs/node-gyp/pull/2318) -* [[`9e1397c52e`](https://github.com/nodejs/node-gyp/commit/9e1397c52e)] - **(SEMVER-MAJOR)** **gyp**: update gyp to v0.7.0 (#2284) (Jiawen Geng) [#2284](https://github.com/nodejs/node-gyp/pull/2284) -* [[`1bd18f3e77`](https://github.com/nodejs/node-gyp/commit/1bd18f3e77)] - **(SEMVER-MAJOR)** **lib**: drop Python 2 support in find-python.js (#2333) (DeeDeeG) [#2333](https://github.com/nodejs/node-gyp/pull/2333) -* [[`e81602ef55`](https://github.com/nodejs/node-gyp/commit/e81602ef55)] - **(SEMVER-MAJOR)** **lib**: migrate requests to fetch (#2220) (Matias Lopez) [#2220](https://github.com/nodejs/node-gyp/pull/2220) -* [[`392b7760b4`](https://github.com/nodejs/node-gyp/commit/392b7760b4)] - **lib**: avoid changing process.config (#2322) (Michaël Zasso) [#2322](https://github.com/nodejs/node-gyp/pull/2322) - -## v7.1.2 2020-10-17 - -* [[`096e3aded5`](https://github.com/nodejs/node-gyp/commit/096e3aded5)] - **gyp**: update gyp to 0.6.2 (Myles Borins) [#2241](https://github.com/nodejs/node-gyp/pull/2241) -* [[`54f97cd243`](https://github.com/nodejs/node-gyp/commit/54f97cd243)] - **doc**: add cmd to reset `xcode-select` to initial state (Valera Rozuvan) [#2235](https://github.com/nodejs/node-gyp/pull/2235) - -## v7.1.1 2020-10-15 - -This release restores the location of shared library builds to the pre-v7 -location. In v7.0.0 until this release, shared library outputs were placed -in a lib.target subdirectory inside the build/{Release,Debug} directory for -builds using `make` (Linux, etc.). This is inconsistent with macOS (Xcode) -behavior and previous node-gyp behavior so has been reverted. -We consider this a bug-fix rather than semver-major change. - -* [[`18bf2d1d38`](https://github.com/nodejs/node-gyp/commit/18bf2d1d38)] - **deps**: update deps to match npm@7 (Rod Vagg) [#2240](https://github.com/nodejs/node-gyp/pull/2240) -* [[`ee6a837cb7`](https://github.com/nodejs/node-gyp/commit/ee6a837cb7)] - **gyp**: update gyp to 0.6.1 (Rod Vagg) [#2238](https://github.com/nodejs/node-gyp/pull/2238) -* [[`3e7f8ccafc`](https://github.com/nodejs/node-gyp/commit/3e7f8ccafc)] - **lib**: better log message when ps fails (Martin Midtgaard) [#2229](https://github.com/nodejs/node-gyp/pull/2229) -* [[`7fb314339f`](https://github.com/nodejs/node-gyp/commit/7fb314339f)] - **test**: GitHub Actions: Test on Python 3.9 (Christian Clauss) [#2230](https://github.com/nodejs/node-gyp/pull/2230) -* [[`754996b9ec`](https://github.com/nodejs/node-gyp/commit/754996b9ec)] - **doc**: replace status badges with new Actions badge (Rod Vagg) [#2218](https://github.com/nodejs/node-gyp/pull/2218) -* [[`2317dc400c`](https://github.com/nodejs/node-gyp/commit/2317dc400c)] - **ci**: switch to GitHub Actions (Shelley Vohr) [#2210](https://github.com/nodejs/node-gyp/pull/2210) -* [[`2cca9b74f7`](https://github.com/nodejs/node-gyp/commit/2cca9b74f7)] - **doc**: drop the --production flag for installing windows-build-tools (DeeDeeG) [#2206](https://github.com/nodejs/node-gyp/pull/2206) - -## v7.1.0 2020-08-12 - -* [[`aaf33c3029`](https://github.com/nodejs/node-gyp/commit/aaf33c3029)] - **build**: add update-gyp script (Samuel Attard) [#2167](https://github.com/nodejs/node-gyp/pull/2167) -* * [[`3baa4e4172`](https://github.com/nodejs/node-gyp/commit/3baa4e4172)] - **(SEMVER-MINOR)** **gyp**: update gyp to 0.4.0 (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) -* * [[`f461d56c53`](https://github.com/nodejs/node-gyp/commit/f461d56c53)] - **(SEMVER-MINOR)** **build**: support apple silicon (arm64 darwin) builds (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) -* * [[`ee6fa7d3bc`](https://github.com/nodejs/node-gyp/commit/ee6fa7d3bc)] - **docs**: note that node-gyp@7 should solve Catalina CLT issues (Rod Vagg) [#2156](https://github.com/nodejs/node-gyp/pull/2156) -* * [[`4fc8ff179d`](https://github.com/nodejs/node-gyp/commit/4fc8ff179d)] - **doc**: silence curl for macOS Catalina acid test (Chia Wei Ong) [#2150](https://github.com/nodejs/node-gyp/pull/2150) -* * [[`7857cb2eb1`](https://github.com/nodejs/node-gyp/commit/7857cb2eb1)] - **deps**: increase "engines" to "node" : "\>= 10.12.0" (DeeDeeG) [#2153](https://github.com/nodejs/node-gyp/pull/2153) - -## v7.0.0 2020-06-03 - -* [[`e18a61afc1`](https://github.com/nodejs/node-gyp/commit/e18a61afc1)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) -* [[`4937722cf5`](https://github.com/nodejs/node-gyp/commit/4937722cf5)] - **(SEMVER-MAJOR)** **deps**: replace mkdirp with {recursive} mkdir (Rod Vagg) [#2123](https://github.com/nodejs/node-gyp/pull/2123) -* [[`d45438a047`](https://github.com/nodejs/node-gyp/commit/d45438a047)] - **(SEMVER-MAJOR)** **deps**: update deps, match to npm@7 (Rod Vagg) [#2126](https://github.com/nodejs/node-gyp/pull/2126) -* [[`ba4f34b7d6`](https://github.com/nodejs/node-gyp/commit/ba4f34b7d6)] - **doc**: update catalina xcode clt download link (Dario Vladovic) [#2133](https://github.com/nodejs/node-gyp/pull/2133) -* [[`f7bfce96ed`](https://github.com/nodejs/node-gyp/commit/f7bfce96ed)] - **doc**: update acid test and introduce curl|bash test script (Dario Vladovic) [#2105](https://github.com/nodejs/node-gyp/pull/2105) -* [[`e529f3309d`](https://github.com/nodejs/node-gyp/commit/e529f3309d)] - **doc**: update README to reflect upgrade to gyp-next (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) -* [[`9aed6286a3`](https://github.com/nodejs/node-gyp/commit/9aed6286a3)] - **doc**: give more attention to Catalina issues doc (Matheus Marchini) [#2134](https://github.com/nodejs/node-gyp/pull/2134) -* [[`963f2a7b48`](https://github.com/nodejs/node-gyp/commit/963f2a7b48)] - **doc**: improve Catalina discoverability for search engines (Matheus Marchini) [#2135](https://github.com/nodejs/node-gyp/pull/2135) -* [[`7b75af349b`](https://github.com/nodejs/node-gyp/commit/7b75af349b)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) -* [[`4f23c7bee2`](https://github.com/nodejs/node-gyp/commit/4f23c7bee2)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) -* [[`473cfa283f`](https://github.com/nodejs/node-gyp/commit/473cfa283f)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) -* [[`e7402b4a7c`](https://github.com/nodejs/node-gyp/commit/e7402b4a7c)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) -* [[`35de45984f`](https://github.com/nodejs/node-gyp/commit/35de45984f)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) -* [[`48642191f5`](https://github.com/nodejs/node-gyp/commit/48642191f5)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) -* [[`ae5b150051`](https://github.com/nodejs/node-gyp/commit/ae5b150051)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) -* [[`d1dea13fe4`](https://github.com/nodejs/node-gyp/commit/d1dea13fe4)] - **doc**: fix changelog 6.1.0 release year to be 2020 (Quentin Vernot) [#2021](https://github.com/nodejs/node-gyp/pull/2021) -* [[`6356117b08`](https://github.com/nodejs/node-gyp/commit/6356117b08)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) -* [[`a6b76a8b48`](https://github.com/nodejs/node-gyp/commit/a6b76a8b48)] - **gyp**: update gyp to 0.2.1 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) -* [[`ebc34ec823`](https://github.com/nodejs/node-gyp/commit/ebc34ec823)] - **gyp**: update gyp to 0.2.0 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) -* [[`972780bde7`](https://github.com/nodejs/node-gyp/commit/972780bde7)] - **(SEMVER-MAJOR)** **gyp**: sync code base with nodejs repo (#1975) (Michaël Zasso) [#1975](https://github.com/nodejs/node-gyp/pull/1975) -* [[`c255ffbf6a`](https://github.com/nodejs/node-gyp/commit/c255ffbf6a)] - **lib**: drop "-2" flag for "py.exe" launcher (DeeDeeG) [#2131](https://github.com/nodejs/node-gyp/pull/2131) -* [[`1f7e1e93b5`](https://github.com/nodejs/node-gyp/commit/1f7e1e93b5)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) -* [[`741ab096d5`](https://github.com/nodejs/node-gyp/commit/741ab096d5)] - **test**: remove support for EOL versions of Node.js (Shelley Vohr) -* [[`ca86ef2539`](https://github.com/nodejs/node-gyp/commit/ca86ef2539)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) - -## v6.1.0 2020-01-08 - -* [[`9a7dd16b76`](https://github.com/nodejs/node-gyp/commit/9a7dd16b76)] - **doc**: remove backticks from Python version list (Rod Vagg) [#2011](https://github.com/nodejs/node-gyp/pull/2011) -* [[`26cd6eaea6`](https://github.com/nodejs/node-gyp/commit/26cd6eaea6)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) -* [[`312c12ef4f`](https://github.com/nodejs/node-gyp/commit/312c12ef4f)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) -* [[`f7b6b6b77b`](https://github.com/nodejs/node-gyp/commit/f7b6b6b77b)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) -* [[`6b8f2652dd`](https://github.com/nodejs/node-gyp/commit/6b8f2652dd)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) -* [[`20aa0b44f7`](https://github.com/nodejs/node-gyp/commit/20aa0b44f7)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) -* [[`14f2a07a39`](https://github.com/nodejs/node-gyp/commit/14f2a07a39)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) -* [[`f242ce4d2c`](https://github.com/nodejs/node-gyp/commit/f242ce4d2c)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) -* [[`3bcba2a01a`](https://github.com/nodejs/node-gyp/commit/3bcba2a01a)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) -* [[`470cc2178e`](https://github.com/nodejs/node-gyp/commit/470cc2178e)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) -* [[`31ecc8421d`](https://github.com/nodejs/node-gyp/commit/31ecc8421d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) -* [[`5a729e86ee`](https://github.com/nodejs/node-gyp/commit/5a729e86ee)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) -* [[`345c70e56d`](https://github.com/nodejs/node-gyp/commit/345c70e56d)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`d6a7e0e1fb`](https://github.com/nodejs/node-gyp/commit/d6a7e0e1fb)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`5a64e9bd32`](https://github.com/nodejs/node-gyp/commit/5a64e9bd32)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) -* [[`04da736d38`](https://github.com/nodejs/node-gyp/commit/04da736d38)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) -* [[`0670e5189d`](https://github.com/nodejs/node-gyp/commit/0670e5189d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) -* [[`c506a6a150`](https://github.com/nodejs/node-gyp/commit/c506a6a150)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) - -## v6.0.1 2019-11-01 - -* [[`8ec2e681d5`](https://github.com/nodejs/node-gyp/commit/8ec2e681d5)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) -* [[`1b11be63cc`](https://github.com/nodejs/node-gyp/commit/1b11be63cc)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) -* [[`c0282daa48`](https://github.com/nodejs/node-gyp/commit/c0282daa48)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) -* [[`d8e09a1b6a`](https://github.com/nodejs/node-gyp/commit/d8e09a1b6a)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) -* [[`9c0f3404f0`](https://github.com/nodejs/node-gyp/commit/9c0f3404f0)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) -* [[`bb2eb72a3f`](https://github.com/nodejs/node-gyp/commit/bb2eb72a3f)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) -* [[`f0693413d9`](https://github.com/nodejs/node-gyp/commit/f0693413d9)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) -* [[`c60c22de58`](https://github.com/nodejs/node-gyp/commit/c60c22de58)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) -* [[`b91718eefc`](https://github.com/nodejs/node-gyp/commit/b91718eefc)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) -* [[`3538a317b6`](https://github.com/nodejs/node-gyp/commit/3538a317b6)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) -* [[`4fff8458c0`](https://github.com/nodejs/node-gyp/commit/4fff8458c0)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`60e4488f08`](https://github.com/nodejs/node-gyp/commit/60e4488f08)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`032db2a2d0`](https://github.com/nodejs/node-gyp/commit/032db2a2d0)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) -* [[`5a83630c33`](https://github.com/nodejs/node-gyp/commit/5a83630c33)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) - -## v6.0.0 2019-10-04 - -* [[`dd0e97ef0b`](https://github.com/nodejs/node-gyp/commit/dd0e97ef0b)] - **(SEMVER-MAJOR)** **lib**: try to find `python` after `python3` (Sam Roberts) [#1907](https://github.com/nodejs/node-gyp/pull/1907) -* [[`f60ed47d14`](https://github.com/nodejs/node-gyp/commit/f60ed47d14)] - **travis**: add Python 3.5 and 3.6 tests on Linux (Christian Clauss) [#1903](https://github.com/nodejs/node-gyp/pull/1903) -* [[`c763ca1838`](https://github.com/nodejs/node-gyp/commit/c763ca1838)] - **(SEMVER-MAJOR)** **doc**: Declare that node-gyp is Python 3 compatible (cclauss) [#1811](https://github.com/nodejs/node-gyp/pull/1811) -* [[`3d1c60ab81`](https://github.com/nodejs/node-gyp/commit/3d1c60ab81)] - **(SEMVER-MAJOR)** **lib**: accept Python 3 by default (João Reis) [#1844](https://github.com/nodejs/node-gyp/pull/1844) -* [[`c6e3b65a23`](https://github.com/nodejs/node-gyp/commit/c6e3b65a23)] - **(SEMVER-MAJOR)** **lib**: raise the minimum Python version from 2.6 to 2.7 (cclauss) [#1818](https://github.com/nodejs/node-gyp/pull/1818) - -## v5.1.1 2020-05-25 - -* [[`bdd3a79abe`](https://github.com/nodejs/node-gyp/commit/bdd3a79abe)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) -* [[`1f2ba75bc0`](https://github.com/nodejs/node-gyp/commit/1f2ba75bc0)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) -* [[`c106d915f5`](https://github.com/nodejs/node-gyp/commit/c106d915f5)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) -* [[`9a6fea92e2`](https://github.com/nodejs/node-gyp/commit/9a6fea92e2)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) -* [[`59b0b1add8`](https://github.com/nodejs/node-gyp/commit/59b0b1add8)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) -* [[`bb8d0e7b10`](https://github.com/nodejs/node-gyp/commit/bb8d0e7b10)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) -* [[`fb2e80d4e3`](https://github.com/nodejs/node-gyp/commit/fb2e80d4e3)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) -* [[`251d9c885c`](https://github.com/nodejs/node-gyp/commit/251d9c885c)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) -* [[`2b6fc3c8d6`](https://github.com/nodejs/node-gyp/commit/2b6fc3c8d6)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) -* [[`a876ae58ad`](https://github.com/nodejs/node-gyp/commit/a876ae58ad)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) - -## v5.1.0 2020-02-05 - -* [[`f37a8b40d0`](https://github.com/nodejs/node-gyp/commit/f37a8b40d0)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) -* [[`cb3f6aae5e`](https://github.com/nodejs/node-gyp/commit/cb3f6aae5e)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) -* [[`0607596a4c`](https://github.com/nodejs/node-gyp/commit/0607596a4c)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) -* [[`0d5a415a14`](https://github.com/nodejs/node-gyp/commit/0d5a415a14)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) -* [[`103740cd95`](https://github.com/nodejs/node-gyp/commit/103740cd95)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) -* [[`278dcddbdd`](https://github.com/nodejs/node-gyp/commit/278dcddbdd)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) -* [[`1694907bbf`](https://github.com/nodejs/node-gyp/commit/1694907bbf)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) -* [[`a3f1143514`](https://github.com/nodejs/node-gyp/commit/a3f1143514)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) -* [[`52365819c7`](https://github.com/nodejs/node-gyp/commit/52365819c7)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) -* [[`bc509c511d`](https://github.com/nodejs/node-gyp/commit/bc509c511d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) -* [[`91ee26dd48`](https://github.com/nodejs/node-gyp/commit/91ee26dd48)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) -* [[`0923f344c9`](https://github.com/nodejs/node-gyp/commit/0923f344c9)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`32c8744b34`](https://github.com/nodejs/node-gyp/commit/32c8744b34)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`fd4b1351e4`](https://github.com/nodejs/node-gyp/commit/fd4b1351e4)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) - -## v5.0.7 2019-12-16 - -Republish of v5.0.6 with unnecessary tarball removed from pack file. - -## v5.0.6 2019-12-16 - -* [[`cdec00286f`](https://github.com/nodejs/node-gyp/commit/cdec00286f)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) -* [[`b7c8233ef2`](https://github.com/nodejs/node-gyp/commit/b7c8233ef2)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) -* [[`e12b00ab0a`](https://github.com/nodejs/node-gyp/commit/e12b00ab0a)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) -* [[`70b9890c0d`](https://github.com/nodejs/node-gyp/commit/70b9890c0d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) -* [[`4029fa8629`](https://github.com/nodejs/node-gyp/commit/4029fa8629)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) -* [[`fe8b02cc8b`](https://github.com/nodejs/node-gyp/commit/fe8b02cc8b)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) -* [[`8ea47ce365`](https://github.com/nodejs/node-gyp/commit/8ea47ce365)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) -* [[`c7229716ba`](https://github.com/nodejs/node-gyp/commit/c7229716ba)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) -* [[`2a18b2a0f8`](https://github.com/nodejs/node-gyp/commit/2a18b2a0f8)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) -* [[`70f391e844`](https://github.com/nodejs/node-gyp/commit/70f391e844)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) -* [[`9f4f0fa34e`](https://github.com/nodejs/node-gyp/commit/9f4f0fa34e)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) -* [[`7cf507906d`](https://github.com/nodejs/node-gyp/commit/7cf507906d)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) -* [[`ad0d182c01`](https://github.com/nodejs/node-gyp/commit/ad0d182c01)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) -* [[`1553081ed6`](https://github.com/nodejs/node-gyp/commit/1553081ed6)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) -* [[`0705cae9aa`](https://github.com/nodejs/node-gyp/commit/0705cae9aa)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`7bfdb6f5bf`](https://github.com/nodejs/node-gyp/commit/7bfdb6f5bf)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`7edf7658fa`](https://github.com/nodejs/node-gyp/commit/7edf7658fa)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) -* [[`69056d04fe`](https://github.com/nodejs/node-gyp/commit/69056d04fe)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) - -## v5.0.5 2019-10-04 - -* [[`3891391746`](https://github.com/nodejs/node-gyp/commit/3891391746)] - **doc**: reconcile README with Python 3 compat changes (Rod Vagg) [#1911](https://github.com/nodejs/node-gyp/pull/1911) -* [[`07f81f1920`](https://github.com/nodejs/node-gyp/commit/07f81f1920)] - **lib**: accept Python 3 after Python 2 (Sam Roberts) [#1910](https://github.com/nodejs/node-gyp/pull/1910) -* [[`04ce59f4a2`](https://github.com/nodejs/node-gyp/commit/04ce59f4a2)] - **doc**: clarify Python configuration, etc (Sam Roberts) [#1908](https://github.com/nodejs/node-gyp/pull/1908) -* [[`01c46ee3df`](https://github.com/nodejs/node-gyp/commit/01c46ee3df)] - **gyp**: add \_\_lt\_\_ to MSVSSolutionEntry (João Reis) [#1904](https://github.com/nodejs/node-gyp/pull/1904) -* [[`735d961b99`](https://github.com/nodejs/node-gyp/commit/735d961b99)] - **win**: support VS 2017 Desktop Express (João Reis) [#1902](https://github.com/nodejs/node-gyp/pull/1902) -* [[`3834156a92`](https://github.com/nodejs/node-gyp/commit/3834156a92)] - **test**: add Python 3.5 and 3.6 tests on Linux (cclauss) [#1909](https://github.com/nodejs/node-gyp/pull/1909) -* [[`1196e990d8`](https://github.com/nodejs/node-gyp/commit/1196e990d8)] - **src**: update to standard@14 (Rod Vagg) [#1899](https://github.com/nodejs/node-gyp/pull/1899) -* [[`53ee7dfe89`](https://github.com/nodejs/node-gyp/commit/53ee7dfe89)] - **gyp**: fix undefined name: cflags --\> ldflags (Christian Clauss) [#1901](https://github.com/nodejs/node-gyp/pull/1901) -* [[`5871dcf6c9`](https://github.com/nodejs/node-gyp/commit/5871dcf6c9)] - **src,win**: add support for fetching arm64 node.lib (Richard Townsend) [#1875](https://github.com/nodejs/node-gyp/pull/1875) - -## v5.0.4 2019-09-27 - -* [[`1236869ffc`](https://github.com/nodejs/node-gyp/commit/1236869ffc)] - **gyp**: modify XcodeVersion() to convert "4.2" to "0420" and "10.0" to "1000" (Christian Clauss) [#1895](https://github.com/nodejs/node-gyp/pull/1895) -* [[`36638afe48`](https://github.com/nodejs/node-gyp/commit/36638afe48)] - **gyp**: more decode stdout on Python 3 (cclauss) [#1894](https://github.com/nodejs/node-gyp/pull/1894) -* [[`f753c167c5`](https://github.com/nodejs/node-gyp/commit/f753c167c5)] - **gyp**: decode stdout on Python 3 (cclauss) [#1890](https://github.com/nodejs/node-gyp/pull/1890) -* [[`60a4083523`](https://github.com/nodejs/node-gyp/commit/60a4083523)] - **doc**: update xcode install instructions to match Node's BUILDING (Nhan Khong) [#1884](https://github.com/nodejs/node-gyp/pull/1884) -* [[`19dbc9ac32`](https://github.com/nodejs/node-gyp/commit/19dbc9ac32)] - **deps**: update tar to 4.4.12 (Matheus Marchini) [#1889](https://github.com/nodejs/node-gyp/pull/1889) -* [[`5f3ed92181`](https://github.com/nodejs/node-gyp/commit/5f3ed92181)] - **bin**: fix the usage instructions (Halit Ogunc) [#1888](https://github.com/nodejs/node-gyp/pull/1888) -* [[`aab118edf1`](https://github.com/nodejs/node-gyp/commit/aab118edf1)] - **lib**: adding keep-alive header to download requests (Milad Farazmand) [#1863](https://github.com/nodejs/node-gyp/pull/1863) -* [[`1186e89326`](https://github.com/nodejs/node-gyp/commit/1186e89326)] - **lib**: ignore non-critical os.userInfo() failures (Rod Vagg) [#1835](https://github.com/nodejs/node-gyp/pull/1835) -* [[`785e527c3d`](https://github.com/nodejs/node-gyp/commit/785e527c3d)] - **doc**: fix missing argument for setting python path (lagorsse) [#1802](https://github.com/nodejs/node-gyp/pull/1802) -* [[`a97615196c`](https://github.com/nodejs/node-gyp/commit/a97615196c)] - **gyp**: rm semicolons (Python != JavaScript) (MattIPv4) [#1858](https://github.com/nodejs/node-gyp/pull/1858) -* [[`06019bac24`](https://github.com/nodejs/node-gyp/commit/06019bac24)] - **gyp**: assorted typo fixes (XhmikosR) [#1853](https://github.com/nodejs/node-gyp/pull/1853) -* [[`3f4972c1ca`](https://github.com/nodejs/node-gyp/commit/3f4972c1ca)] - **gyp**: use "is" when comparing to None (Vladyslav Burzakovskyy) [#1860](https://github.com/nodejs/node-gyp/pull/1860) -* [[`1cb4708073`](https://github.com/nodejs/node-gyp/commit/1cb4708073)] - **src,win**: improve unmanaged handling (Peter Sabath) [#1852](https://github.com/nodejs/node-gyp/pull/1852) -* [[`5553cd910e`](https://github.com/nodejs/node-gyp/commit/5553cd910e)] - **gyp**: improve Windows+Cygwin compatibility (Jose Quijada) [#1817](https://github.com/nodejs/node-gyp/pull/1817) -* [[`8bcb1fbb43`](https://github.com/nodejs/node-gyp/commit/8bcb1fbb43)] - **gyp**: Python 3 Windows fixes (João Reis) [#1843](https://github.com/nodejs/node-gyp/pull/1843) -* [[`2e24d0a326`](https://github.com/nodejs/node-gyp/commit/2e24d0a326)] - **test**: accept Python 3 in test-find-python.js (João Reis) [#1843](https://github.com/nodejs/node-gyp/pull/1843) -* [[`1267b4dc1c`](https://github.com/nodejs/node-gyp/commit/1267b4dc1c)] - **build**: add test run Python 3.7 on macOS (Christian Clauss) [#1843](https://github.com/nodejs/node-gyp/pull/1843) -* [[`da1b031aa3`](https://github.com/nodejs/node-gyp/commit/da1b031aa3)] - **build**: import StringIO on Python 2 and Python 3 (Christian Clauss) [#1836](https://github.com/nodejs/node-gyp/pull/1836) -* [[`fa0ed4aa42`](https://github.com/nodejs/node-gyp/commit/fa0ed4aa42)] - **build**: more Python 3 compat, replace compile with ast (cclauss) [#1820](https://github.com/nodejs/node-gyp/pull/1820) -* [[`18d5c7c9d0`](https://github.com/nodejs/node-gyp/commit/18d5c7c9d0)] - **win,src**: update win\_delay\_load\_hook.cc to work with /clr (Ivan Petrovic) [#1819](https://github.com/nodejs/node-gyp/pull/1819) - -## v5.0.3 2019-07-17 - -* [[`66ad305775`](https://github.com/nodejs/node-gyp/commit/66ad305775)] - **python**: accept Python 3 conditionally (João Reis) [#1815](https://github.com/nodejs/node-gyp/pull/1815) -* [[`7e7fce3fed`](https://github.com/nodejs/node-gyp/commit/7e7fce3fed)] - **python**: move Python detection to its own file (João Reis) [#1815](https://github.com/nodejs/node-gyp/pull/1815) -* [[`e40c99e283`](https://github.com/nodejs/node-gyp/commit/e40c99e283)] - **src**: implement standard.js linting (Rod Vagg) [#1794](https://github.com/nodejs/node-gyp/pull/1794) -* [[`bb92c761a9`](https://github.com/nodejs/node-gyp/commit/bb92c761a9)] - **test**: add Node.js 6 on Windows to Travis CI (João Reis) [#1812](https://github.com/nodejs/node-gyp/pull/1812) -* [[`7fd924079f`](https://github.com/nodejs/node-gyp/commit/7fd924079f)] - **test**: increase tap timeout (João Reis) [#1812](https://github.com/nodejs/node-gyp/pull/1812) -* [[`7e8127068f`](https://github.com/nodejs/node-gyp/commit/7e8127068f)] - **test**: cover supported node versions with travis (Rod Vagg) [#1809](https://github.com/nodejs/node-gyp/pull/1809) -* [[`24109148df`](https://github.com/nodejs/node-gyp/commit/24109148df)] - **test**: downgrade to tap@^12 for continued Node 6 support (Rod Vagg) [#1808](https://github.com/nodejs/node-gyp/pull/1808) -* [[`656117cc4a`](https://github.com/nodejs/node-gyp/commit/656117cc4a)] - **win**: make VS path match case-insensitive (João Reis) [#1806](https://github.com/nodejs/node-gyp/pull/1806) - -## v5.0.2 2019-06-27 - -* [[`2761afbf73`](https://github.com/nodejs/node-gyp/commit/2761afbf73)] - **build,test**: add duplicate symbol test (Gabriel Schulhof) [#1689](https://github.com/nodejs/node-gyp/pull/1689) -* [[`82f129d6de`](https://github.com/nodejs/node-gyp/commit/82f129d6de)] - **gyp**: replace optparse to argparse (KiYugadgeter) [#1591](https://github.com/nodejs/node-gyp/pull/1591) -* [[`afaaa29c61`](https://github.com/nodejs/node-gyp/commit/afaaa29c61)] - **gyp**: remove from \_\_future\_\_ import with\_statement (cclauss) [#1799](https://github.com/nodejs/node-gyp/pull/1799) -* [[`a991f633d6`](https://github.com/nodejs/node-gyp/commit/a991f633d6)] - **gyp**: fix the remaining Python 3 issues (cclauss) [#1793](https://github.com/nodejs/node-gyp/pull/1793) -* [[`f952b08f84`](https://github.com/nodejs/node-gyp/commit/f952b08f84)] - **gyp**: move from \_\_future\_\_ import to the top of the file (cclauss) [#1789](https://github.com/nodejs/node-gyp/pull/1789) -* [[`4f4a677dfa`](https://github.com/nodejs/node-gyp/commit/4f4a677dfa)] - **gyp**: use different default compiler for z/OS (Shuowang (Wayne) Zhang) [#1768](https://github.com/nodejs/node-gyp/pull/1768) -* [[`03683f09d6`](https://github.com/nodejs/node-gyp/commit/03683f09d6)] - **lib**: code de-duplication (Pavel Medvedev) [#965](https://github.com/nodejs/node-gyp/pull/965) -* [[`611bc3c89f`](https://github.com/nodejs/node-gyp/commit/611bc3c89f)] - **lib**: add .json suffix for explicit require (Rod Vagg) [#1787](https://github.com/nodejs/node-gyp/pull/1787) -* [[`d3478d7b0b`](https://github.com/nodejs/node-gyp/commit/d3478d7b0b)] - **meta**: add to .gitignore (Refael Ackermann) [#1573](https://github.com/nodejs/node-gyp/pull/1573) -* [[`7a9a038e9e`](https://github.com/nodejs/node-gyp/commit/7a9a038e9e)] - **test**: add parallel test runs on macOS and Windows (cclauss) [#1800](https://github.com/nodejs/node-gyp/pull/1800) -* [[`7dd7f2b2a2`](https://github.com/nodejs/node-gyp/commit/7dd7f2b2a2)] - **test**: fix Python syntax error in test-adding.js (cclauss) [#1793](https://github.com/nodejs/node-gyp/pull/1793) -* [[`395f843de0`](https://github.com/nodejs/node-gyp/commit/395f843de0)] - **test**: replace self-signed cert with 'localhost' (Rod Vagg) [#1795](https://github.com/nodejs/node-gyp/pull/1795) -* [[`a52c6eb9e8`](https://github.com/nodejs/node-gyp/commit/a52c6eb9e8)] - **test**: migrate from tape to tap (Rod Vagg) [#1795](https://github.com/nodejs/node-gyp/pull/1795) -* [[`ec2eb44a30`](https://github.com/nodejs/node-gyp/commit/ec2eb44a30)] - **test**: use Nan in duplicate\_symbols (Gabriel Schulhof) [#1689](https://github.com/nodejs/node-gyp/pull/1689) -* [[`1597c84aad`](https://github.com/nodejs/node-gyp/commit/1597c84aad)] - **test**: use Travis CI to run tests on every pull request (cclauss) [#1752](https://github.com/nodejs/node-gyp/pull/1752) -* [[`dd9bf929ac`](https://github.com/nodejs/node-gyp/commit/dd9bf929ac)] - **zos**: update compiler options (Shuowang (Wayne) Zhang) [#1768](https://github.com/nodejs/node-gyp/pull/1768) - -## v5.0.1 2019-06-20 - -* [[`e3861722ed`](https://github.com/nodejs/node-gyp/commit/e3861722ed)] - **doc**: document --jobs max (David Sanders) [#1770](https://github.com/nodejs/node-gyp/pull/1770) -* [[`1cfdb28886`](https://github.com/nodejs/node-gyp/commit/1cfdb28886)] - **lib**: reintroduce support for iojs file naming for releases \>= 1 && \< 4 (Samuel Attard) [#1777](https://github.com/nodejs/node-gyp/pull/1777) - -## v5.0.0 2019-06-13 - -* [[`8a83972743`](https://github.com/nodejs/node-gyp/commit/8a83972743)] - **(SEMVER-MAJOR)** **bin**: follow XDG OS conventions for storing data (Selwyn) [#1570](https://github.com/nodejs/node-gyp/pull/1570) -* [[`9e46872ea3`](https://github.com/nodejs/node-gyp/commit/9e46872ea3)] - **bin,lib**: remove extra comments/lines/spaces (Jon Moss) [#1508](https://github.com/nodejs/node-gyp/pull/1508) -* [[`8098ebdeb4`](https://github.com/nodejs/node-gyp/commit/8098ebdeb4)] - **deps**: replace `osenv` dependency with native `os` (Selwyn) -* [[`f83b457e03`](https://github.com/nodejs/node-gyp/commit/f83b457e03)] - **deps**: bump request to 2.8.7, fixes heok/hawk issues (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) -* [[`323cee7323`](https://github.com/nodejs/node-gyp/commit/323cee7323)] - **deps**: pin `request` version range (Refael Ackermann) [#1300](https://github.com/nodejs/node-gyp/pull/1300) -* [[`c515912d08`](https://github.com/nodejs/node-gyp/commit/c515912d08)] - **doc**: improve issue template (Bartosz Sosnowski) [#1618](https://github.com/nodejs/node-gyp/pull/1618) -* [[`cca2d66727`](https://github.com/nodejs/node-gyp/commit/cca2d66727)] - **doc**: python info needs own header (Taylor D. Lee) [#1245](https://github.com/nodejs/node-gyp/pull/1245) -* [[`3e64c780f5`](https://github.com/nodejs/node-gyp/commit/3e64c780f5)] - **doc**: lint README.md (Jon Moss) [#1498](https://github.com/nodejs/node-gyp/pull/1498) -* [[`a20faedc91`](https://github.com/nodejs/node-gyp/commit/a20faedc91)] - **(SEMVER-MAJOR)** **gyp**: enable MARMASM items only on new VS versions (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`721eb691cf`](https://github.com/nodejs/node-gyp/commit/721eb691cf)] - **gyp**: teach MSVS generator about MARMASM Items (Jon Kunkee) [#1679](https://github.com/nodejs/node-gyp/pull/1679) -* [[`91744bfecc`](https://github.com/nodejs/node-gyp/commit/91744bfecc)] - **gyp**: add support for Windows on Arm (Richard Townsend) [#1739](https://github.com/nodejs/node-gyp/pull/1739) -* [[`a6e0a6c7ed`](https://github.com/nodejs/node-gyp/commit/a6e0a6c7ed)] - **gyp**: move compile\_commands\_json (Paul Maréchal) [#1661](https://github.com/nodejs/node-gyp/pull/1661) -* [[`92e8b52cee`](https://github.com/nodejs/node-gyp/commit/92e8b52cee)] - **gyp**: fix target --\> self.target (cclauss) -* [[`febdfa2137`](https://github.com/nodejs/node-gyp/commit/febdfa2137)] - **gyp**: fix sntex error (cclauss) [#1333](https://github.com/nodejs/node-gyp/pull/1333) -* [[`588d333c14`](https://github.com/nodejs/node-gyp/commit/588d333c14)] - **gyp**: \_winreg module was renamed to winreg in Python 3. (Craig Rodrigues) -* [[`98226d198c`](https://github.com/nodejs/node-gyp/commit/98226d198c)] - **gyp**: replace basestring with str, but only on Python 3. (Craig Rodrigues) -* [[`7535e4478e`](https://github.com/nodejs/node-gyp/commit/7535e4478e)] - **gyp**: replace deprecated functions (Craig Rodrigues) -* [[`2040cd21cc`](https://github.com/nodejs/node-gyp/commit/2040cd21cc)] - **gyp**: use print as a function, as specified in PEP 3105. (Craig Rodrigues) -* [[`abef93ded5`](https://github.com/nodejs/node-gyp/commit/abef93ded5)] - **gyp**: get ready for python 3 (cclauss) -* [[`43031fadcb`](https://github.com/nodejs/node-gyp/commit/43031fadcb)] - **python**: clean-up detection (João Reis) [#1582](https://github.com/nodejs/node-gyp/pull/1582) -* [[`49ab79d221`](https://github.com/nodejs/node-gyp/commit/49ab79d221)] - **python**: more informative error (Refael Ackermann) [#1269](https://github.com/nodejs/node-gyp/pull/1269) -* [[`997bc3c748`](https://github.com/nodejs/node-gyp/commit/997bc3c748)] - **readme**: add ARM64 info to MSVC setup instructions (Jon Kunkee) [#1655](https://github.com/nodejs/node-gyp/pull/1655) -* [[`788e767179`](https://github.com/nodejs/node-gyp/commit/788e767179)] - **test**: remove unused variable (João Reis) -* [[`6f5a408934`](https://github.com/nodejs/node-gyp/commit/6f5a408934)] - **tools**: fix usage of inherited -fPIC and -fPIE (Jens) [#1340](https://github.com/nodejs/node-gyp/pull/1340) -* [[`0efb8fb34b`](https://github.com/nodejs/node-gyp/commit/0efb8fb34b)] - **(SEMVER-MAJOR)** **win**: support running in VS Command Prompt (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`360ddbdf3a`](https://github.com/nodejs/node-gyp/commit/360ddbdf3a)] - **(SEMVER-MAJOR)** **win**: add support for Visual Studio 2019 (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`8f43f68275`](https://github.com/nodejs/node-gyp/commit/8f43f68275)] - **(SEMVER-MAJOR)** **win**: detect all VS versions in node-gyp (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`7fe4095974`](https://github.com/nodejs/node-gyp/commit/7fe4095974)] - **(SEMVER-MAJOR)** **win**: generic Visual Studio 2017 detection (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`7a71d68bce`](https://github.com/nodejs/node-gyp/commit/7a71d68bce)] - **win**: use msbuild from the configure stage (Bartosz Sosnowski) [#1654](https://github.com/nodejs/node-gyp/pull/1654) -* [[`d3b21220a0`](https://github.com/nodejs/node-gyp/commit/d3b21220a0)] - **win**: fix delay-load hook for electron 4 (Andy Dill) -* [[`81f3a92338`](https://github.com/nodejs/node-gyp/commit/81f3a92338)] - Update list of Node.js versions to test against. (Ben Noordhuis) [#1670](https://github.com/nodejs/node-gyp/pull/1670) -* [[`4748f6ab75`](https://github.com/nodejs/node-gyp/commit/4748f6ab75)] - Remove deprecated compatibility code. (Ben Noordhuis) [#1670](https://github.com/nodejs/node-gyp/pull/1670) -* [[`45e3221fd4`](https://github.com/nodejs/node-gyp/commit/45e3221fd4)] - Remove an outdated workaround for Python 2.4 (cclauss) [#1650](https://github.com/nodejs/node-gyp/pull/1650) -* [[`721dc7d314`](https://github.com/nodejs/node-gyp/commit/721dc7d314)] - Add ARM64 to MSBuild /Platform logic (Jon Kunkee) [#1655](https://github.com/nodejs/node-gyp/pull/1655) -* [[`a5b7410497`](https://github.com/nodejs/node-gyp/commit/a5b7410497)] - Add ESLint no-unused-vars rule (Jon Moss) [#1497](https://github.com/nodejs/node-gyp/pull/1497) - -## v4.0.0 2019-04-24 - -* [[`ceed5cbe10`](https://github.com/nodejs/node-gyp/commit/ceed5cbe10)] - **deps**: updated tar package version to 4.4.8 (Pobegaylo Maksim) [#1713](https://github.com/nodejs/node-gyp/pull/1713) -* [[`374519e066`](https://github.com/nodejs/node-gyp/commit/374519e066)] - **(SEMVER-MAJOR)** Upgrade to tar v3 (isaacs) [#1212](https://github.com/nodejs/node-gyp/pull/1212) -* [[`e6699d13cd`](https://github.com/nodejs/node-gyp/commit/e6699d13cd)] - **test**: fix addon test for Node.js 12 and V8 7.4 (Richard Lau) [#1705](https://github.com/nodejs/node-gyp/pull/1705) -* [[`0c6bf530a0`](https://github.com/nodejs/node-gyp/commit/0c6bf530a0)] - **lib**: use print() for python version detection (GreenAddress) [#1534](https://github.com/nodejs/node-gyp/pull/1534) - -## v3.8.0 2018-08-09 - -* [[`c5929cb4fe`](https://github.com/nodejs/node-gyp/commit/c5929cb4fe)] - **doc**: update Xcode preferences tab name. (Ivan Daniluk) [#1330](https://github.com/nodejs/node-gyp/pull/1330) -* [[`8b488da8b9`](https://github.com/nodejs/node-gyp/commit/8b488da8b9)] - **doc**: update link to commit guidelines (Jonas Hermsmeier) [#1456](https://github.com/nodejs/node-gyp/pull/1456) -* [[`b4fe8c16f9`](https://github.com/nodejs/node-gyp/commit/b4fe8c16f9)] - **doc**: fix visual studio links (Bartosz Sosnowski) [#1490](https://github.com/nodejs/node-gyp/pull/1490) -* [[`536759c7e9`](https://github.com/nodejs/node-gyp/commit/536759c7e9)] - **configure**: use sys.version\_info to get python version (Yang Guo) [#1504](https://github.com/nodejs/node-gyp/pull/1504) -* [[`94c39c604e`](https://github.com/nodejs/node-gyp/commit/94c39c604e)] - **gyp**: fix ninja build failure (GYP patch) (Daniel Bevenius) [nodejs/node#12484](https://github.com/nodejs/node/pull/12484) -* [[`e8ea74e0fa`](https://github.com/nodejs/node-gyp/commit/e8ea74e0fa)] - **tools**: patch gyp to avoid xcrun errors (Ujjwal Sharma) [nodejs/node#21520](https://github.com/nodejs/node/pull/21520) -* [[`ea9aff44f2`](https://github.com/nodejs/node-gyp/commit/ea9aff44f2)] - **tools**: fix "the the" typos in comments (Masashi Hirano) [nodejs/node#20716](https://github.com/nodejs/node/pull/20716) -* [[`207e5aa4fd`](https://github.com/nodejs/node-gyp/commit/207e5aa4fd)] - **gyp**: implement LD/LDXX for ninja and FIPS (Sam Roberts) -* [[`b416c5f4b7`](https://github.com/nodejs/node-gyp/commit/b416c5f4b7)] - **gyp**: enable cctest to use objects (gyp part) (Daniel Bevenius) [nodejs/node#12450](https://github.com/nodejs/node/pull/12450) -* [[`40692d016b`](https://github.com/nodejs/node-gyp/commit/40692d016b)] - **gyp**: add compile\_commands.json gyp generator (Ben Noordhuis) [nodejs/node#12450](https://github.com/nodejs/node/pull/12450) -* [[`fc3c4e2b10`](https://github.com/nodejs/node-gyp/commit/fc3c4e2b10)] - **gyp**: float gyp patch for long filenames (Anna Henningsen) [nodejs/node#7963](https://github.com/nodejs/node/pull/7963) -* [[`8aedbfdef6`](https://github.com/nodejs/node-gyp/commit/8aedbfdef6)] - **gyp**: backport GYP fix to fix AIX shared suffix (Stewart Addison) -* [[`6cd84b84fc`](https://github.com/nodejs/node-gyp/commit/6cd84b84fc)] - **test**: formatting and minor fixes for execFileSync replacement (Rod Vagg) [#1521](https://github.com/nodejs/node-gyp/pull/1521) -* [[`60e421363f`](https://github.com/nodejs/node-gyp/commit/60e421363f)] - **test**: added test/processExecSync.js for when execFileSync is not available. (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) -* [[`969447c5bd`](https://github.com/nodejs/node-gyp/commit/969447c5bd)] - **deps**: bump request to 2.8.7, fixes heok/hawk issues (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) -* [[`340403ccfe`](https://github.com/nodejs/node-gyp/commit/340403ccfe)] - **win**: improve parsing of SDK version (Alessandro Vergani) [#1516](https://github.com/nodejs/node-gyp/pull/1516) - -## v3.7.0 2018-06-08 - -* [[`84cea7b30d`](https://github.com/nodejs/node-gyp/commit/84cea7b30d)] - Remove unused gyp test scripts. (Ben Noordhuis) [#1458](https://github.com/nodejs/node-gyp/pull/1458) -* [[`0540e4ec63`](https://github.com/nodejs/node-gyp/commit/0540e4ec63)] - **gyp**: escape spaces in filenames in make generator (Jeff Senn) [#1436](https://github.com/nodejs/node-gyp/pull/1436) -* [[`88fc6fa0ec`](https://github.com/nodejs/node-gyp/commit/88fc6fa0ec)] - Drop dependency on minimatch. (Brian Woodward) [#1158](https://github.com/nodejs/node-gyp/pull/1158) -* [[`1e203c5148`](https://github.com/nodejs/node-gyp/commit/1e203c5148)] - Fix include path when pointing to Node.js source (Richard Lau) [#1055](https://github.com/nodejs/node-gyp/pull/1055) -* [[`53d8cb967c`](https://github.com/nodejs/node-gyp/commit/53d8cb967c)] - Prefix build targets with /t: on Windows (Natalie Wolfe) [#1164](https://github.com/nodejs/node-gyp/pull/1164) -* [[`53a5f8ff38`](https://github.com/nodejs/node-gyp/commit/53a5f8ff38)] - **gyp**: add support for .mm files to msvs generator (Julien Racle) [#1167](https://github.com/nodejs/node-gyp/pull/1167) -* [[`dd8561e528`](https://github.com/nodejs/node-gyp/commit/dd8561e528)] - **zos**: don't use universal-new-lines mode (John Barboza) [#1451](https://github.com/nodejs/node-gyp/pull/1451) -* [[`e5a69010ed`](https://github.com/nodejs/node-gyp/commit/e5a69010ed)] - **zos**: add search locations for libnode.x (John Barboza) [#1451](https://github.com/nodejs/node-gyp/pull/1451) -* [[`79febace53`](https://github.com/nodejs/node-gyp/commit/79febace53)] - **doc**: update macOS information in README (Josh Parnham) [#1323](https://github.com/nodejs/node-gyp/pull/1323) -* [[`9425448945`](https://github.com/nodejs/node-gyp/commit/9425448945)] - **gyp**: don't print xcodebuild not found errors (Gibson Fahnestock) [#1370](https://github.com/nodejs/node-gyp/pull/1370) -* [[`6f1286f5b2`](https://github.com/nodejs/node-gyp/commit/6f1286f5b2)] - Fix infinite install loop. (Ben Noordhuis) [#1384](https://github.com/nodejs/node-gyp/pull/1384) -* [[`2580b9139e`](https://github.com/nodejs/node-gyp/commit/2580b9139e)] - Update `--nodedir` description in README. (Ben Noordhuis) [#1372](https://github.com/nodejs/node-gyp/pull/1372) -* [[`a61360391a`](https://github.com/nodejs/node-gyp/commit/a61360391a)] - Update README with another way to install on windows (JeffAtDeere) [#1352](https://github.com/nodejs/node-gyp/pull/1352) -* [[`47496bf6dc`](https://github.com/nodejs/node-gyp/commit/47496bf6dc)] - Fix IndexError when parsing GYP files. (Ben Noordhuis) [#1267](https://github.com/nodejs/node-gyp/pull/1267) -* [[`b2024dee7b`](https://github.com/nodejs/node-gyp/commit/b2024dee7b)] - **zos**: support platform (John Barboza) [#1276](https://github.com/nodejs/node-gyp/pull/1276) -* [[`90d86512f4`](https://github.com/nodejs/node-gyp/commit/90d86512f4)] - **win**: run PS with `-NoProfile` (Refael Ackermann) [#1292](https://github.com/nodejs/node-gyp/pull/1292) -* [[`2da5f86ef7`](https://github.com/nodejs/node-gyp/commit/2da5f86ef7)] - **doc**: add github PR and Issue templates (Gibson Fahnestock) [#1228](https://github.com/nodejs/node-gyp/pull/1228) -* [[`a46a770d68`](https://github.com/nodejs/node-gyp/commit/a46a770d68)] - **doc**: update proposed DCO and CoC (Mikeal Rogers) [#1229](https://github.com/nodejs/node-gyp/pull/1229) -* [[`7e803d58e0`](https://github.com/nodejs/node-gyp/commit/7e803d58e0)] - **doc**: headerify the Install instructions (Nick Schonning) [#1225](https://github.com/nodejs/node-gyp/pull/1225) -* [[`f27599193a`](https://github.com/nodejs/node-gyp/commit/f27599193a)] - **gyp**: update xml string encoding conversion (Liu Chao) [#1203](https://github.com/nodejs/node-gyp/pull/1203) -* [[`0a07e481f7`](https://github.com/nodejs/node-gyp/commit/0a07e481f7)] - **configure**: don't set ensure if tarball is set (Gibson Fahnestock) [#1220](https://github.com/nodejs/node-gyp/pull/1220) - -## v3.6.3 2018-06-08 - -* [[`90cd2e8da9`](https://github.com/nodejs/node-gyp/commit/90cd2e8da9)] - **gyp**: fix regex to match multi-digit versions (Jonas Hermsmeier) [#1455](https://github.com/nodejs/node-gyp/pull/1455) -* [[`7900122337`](https://github.com/nodejs/node-gyp/commit/7900122337)] - deps: pin `request` version range (Refael Ackerman) [#1300](https://github.com/nodejs/node-gyp/pull/1300) - -## v3.6.2 2017-06-01 - -* [[`72afdd62cd`](https://github.com/nodejs/node-gyp/commit/72afdd62cd)] - **build**: rename copyNodeLib() to doBuild() (Liu Chao) [#1206](https://github.com/nodejs/node-gyp/pull/1206) -* [[`bad903ac70`](https://github.com/nodejs/node-gyp/commit/bad903ac70)] - **win**: more robust parsing of SDK version (Refael Ackermann) [#1198](https://github.com/nodejs/node-gyp/pull/1198) -* [[`241752f381`](https://github.com/nodejs/node-gyp/commit/241752f381)] - Log dist-url. (Ben Noordhuis) [#1170](https://github.com/nodejs/node-gyp/pull/1170) -* [[`386746c7d1`](https://github.com/nodejs/node-gyp/commit/386746c7d1)] - **configure**: use full path in node_lib_file GYP var (Pavel Medvedev) [#964](https://github.com/nodejs/node-gyp/pull/964) -* [[`0913b2dd99`](https://github.com/nodejs/node-gyp/commit/0913b2dd99)] - **build, win**: use target_arch to link with node.lib (Pavel Medvedev) [#964](https://github.com/nodejs/node-gyp/pull/964) -* [[`c307b302f7`](https://github.com/nodejs/node-gyp/commit/c307b302f7)] - **doc**: blorb about setting `npm_config_OPTION_NAME` (Refael Ackermann) [#1185](https://github.com/nodejs/node-gyp/pull/1185) - -## v3.6.1 2017-04-30 - -* [[`49801716c2`](https://github.com/nodejs/node-gyp/commit/49801716c2)] - **test**: fix test-find-python on v0.10.x buildbot. (Ben Noordhuis) [#1172](https://github.com/nodejs/node-gyp/pull/1172) -* [[`a83a3801fc`](https://github.com/nodejs/node-gyp/commit/a83a3801fc)] - **test**: fix test/test-configure-python on AIX (Richard Lau) [#1131](https://github.com/nodejs/node-gyp/pull/1131) -* [[`8a767145c9`](https://github.com/nodejs/node-gyp/commit/8a767145c9)] - **gyp**: Revert quote_cmd workaround (Kunal Pathak) [#1153](https://github.com/nodejs/node-gyp/pull/1153) -* [[`c09cf7671e`](https://github.com/nodejs/node-gyp/commit/c09cf7671e)] - **doc**: add a note for using `configure` on Windows (Vse Mozhet Byt) [#1152](https://github.com/nodejs/node-gyp/pull/1152) -* [[`da9cb5f411`](https://github.com/nodejs/node-gyp/commit/da9cb5f411)] - Delete superfluous .patch files. (Ben Noordhuis) [#1122](https://github.com/nodejs/node-gyp/pull/1122) - -## v3.6.0 2017-03-16 - -* [[`ae141e1906`](https://github.com/nodejs/node-gyp/commit/ae141e1906)] - **win**: find and setup for VS2017 (Refael Ackermann) [#1130](https://github.com/nodejs/node-gyp/pull/1130) -* [[`ec5fc36a80`](https://github.com/nodejs/node-gyp/commit/ec5fc36a80)] - Add support to build node.js with chakracore for ARM. (Kunal Pathak) [#873](https://github.com/nodejs/node-gyp/pull/873) -* [[`a04ea3051a`](https://github.com/nodejs/node-gyp/commit/a04ea3051a)] - Add support to build node.js with chakracore. (Kunal Pathak) [#873](https://github.com/nodejs/node-gyp/pull/873) -* [[`93d7fa83c8`](https://github.com/nodejs/node-gyp/commit/93d7fa83c8)] - Upgrade semver dependency. (Ben Noordhuis) [#1107](https://github.com/nodejs/node-gyp/pull/1107) -* [[`ff9a6fadfd`](https://github.com/nodejs/node-gyp/commit/ff9a6fadfd)] - Update link of gyp as Google code is shutting down (Peter Dave Hello) [#1061](https://github.com/nodejs/node-gyp/pull/1061) - -## v3.5.0 2017-01-10 - -* [[`762d19a39e`](https://github.com/nodejs/node-gyp/commit/762d19a39e)] - \[doc\] merge History.md and CHANGELOG.md (Rod Vagg) -* [[`80fc5c3d31`](https://github.com/nodejs/node-gyp/commit/80fc5c3d31)] - Fix deprecated dependency warning (Simone Primarosa) [#1069](https://github.com/nodejs/node-gyp/pull/1069) -* [[`05c44944fd`](https://github.com/nodejs/node-gyp/commit/05c44944fd)] - Open the build file with universal-newlines mode (Guy Margalit) [#1053](https://github.com/nodejs/node-gyp/pull/1053) -* [[`37ae7be114`](https://github.com/nodejs/node-gyp/commit/37ae7be114)] - Try python launcher when stock python is python 3. (Ben Noordhuis) [#992](https://github.com/nodejs/node-gyp/pull/992) -* [[`e3778d9907`](https://github.com/nodejs/node-gyp/commit/e3778d9907)] - Add lots of findPython() tests. (Ben Noordhuis) [#992](https://github.com/nodejs/node-gyp/pull/992) -* [[`afc766adf6`](https://github.com/nodejs/node-gyp/commit/afc766adf6)] - Unset executable bit for .bat files (Pavel Medvedev) [#969](https://github.com/nodejs/node-gyp/pull/969) -* [[`ddac348991`](https://github.com/nodejs/node-gyp/commit/ddac348991)] - Use push on PYTHONPATH and add tests (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) -* [[`b182a19042`](https://github.com/nodejs/node-gyp/commit/b182a19042)] - ***Revert*** "add "path-array" dep" (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) -* [[`7c08b85c5a`](https://github.com/nodejs/node-gyp/commit/7c08b85c5a)] - ***Revert*** "**configure**: use "path-array" for PYTHONPATH" (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) -* [[`9c8d275526`](https://github.com/nodejs/node-gyp/commit/9c8d275526)] - Add --devdir flag. (Ben Noordhuis) [#916](https://github.com/nodejs/node-gyp/pull/916) -* [[`f6eab1f9e4`](https://github.com/nodejs/node-gyp/commit/f6eab1f9e4)] - **doc**: add windows-build-tools to readme (Felix Rieseberg) [#970](https://github.com/nodejs/node-gyp/pull/970) - -## v3.4.0 2016-06-28 - -* [[`ce5fd04e94`](https://github.com/nodejs/node-gyp/commit/ce5fd04e94)] - **deps**: update minimatch version (delphiactual) [#961](https://github.com/nodejs/node-gyp/pull/961) -* [[`77383ddd85`](https://github.com/nodejs/node-gyp/commit/77383ddd85)] - Replace fs.accessSync call to fs.statSync (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) -* [[`0dba4bda57`](https://github.com/nodejs/node-gyp/commit/0dba4bda57)] - **test**: add simple addon test (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) -* [[`c4344b3889`](https://github.com/nodejs/node-gyp/commit/c4344b3889)] - **doc**: add --target option to README (Gibson Fahnestock) [#958](https://github.com/nodejs/node-gyp/pull/958) -* [[`cc778e9215`](https://github.com/nodejs/node-gyp/commit/cc778e9215)] - Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. (Ben Noordhuis) [#915](https://github.com/nodejs/node-gyp/pull/915) -* [[`af35b2ad32`](https://github.com/nodejs/node-gyp/commit/af35b2ad32)] - Move VC++ Build Tools to Build Tools landing page. (Andrew Pardoe) [#953](https://github.com/nodejs/node-gyp/pull/953) -* [[`f31482e226`](https://github.com/nodejs/node-gyp/commit/f31482e226)] - **win**: work around __pfnDliNotifyHook2 type change (Alexis Campailla) [#952](https://github.com/nodejs/node-gyp/pull/952) -* [[`3df8222fa5`](https://github.com/nodejs/node-gyp/commit/3df8222fa5)] - Allow for npmlog@3.x (Rebecca Turner) [#950](https://github.com/nodejs/node-gyp/pull/950) -* [[`a4fa07b390`](https://github.com/nodejs/node-gyp/commit/a4fa07b390)] - More verbose error on locating msbuild.exe failure. (Mateusz Jaworski) [#930](https://github.com/nodejs/node-gyp/pull/930) -* [[`4ee31329e0`](https://github.com/nodejs/node-gyp/commit/4ee31329e0)] - **doc**: add command options to README.md (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) -* [[`c8c7ca86b9`](https://github.com/nodejs/node-gyp/commit/c8c7ca86b9)] - Add --silent option for zero output. (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) -* [[`ac29d23a7c`](https://github.com/nodejs/node-gyp/commit/ac29d23a7c)] - Upgrade to glob@7.0.3. (Ben Noordhuis) [#943](https://github.com/nodejs/node-gyp/pull/943) -* [[`15fd56be3d`](https://github.com/nodejs/node-gyp/commit/15fd56be3d)] - Enable V8 deprecation warnings for native modules (Matt Loring) [#920](https://github.com/nodejs/node-gyp/pull/920) -* [[`7f1c1b960c`](https://github.com/nodejs/node-gyp/commit/7f1c1b960c)] - **gyp**: improvements for android generator (Robert Chiras) [#935](https://github.com/nodejs/node-gyp/pull/935) -* [[`088082766c`](https://github.com/nodejs/node-gyp/commit/088082766c)] - Update Windows install instructions (Sara Itani) [#867](https://github.com/nodejs/node-gyp/pull/867) -* [[`625c1515f9`](https://github.com/nodejs/node-gyp/commit/625c1515f9)] - **gyp**: inherit CC/CXX for CC/CXX.host (Johan Bergström) [#908](https://github.com/nodejs/node-gyp/pull/908) -* [[`3bcb1720e4`](https://github.com/nodejs/node-gyp/commit/3bcb1720e4)] - Add support for the Python launcher on Windows (Patrick Westerhoff) [#894](https://github.com/nodejs/node-gyp/pull/894 - -## v3.3.1 2016-03-04 - -* [[`a981ef847a`](https://github.com/nodejs/node-gyp/commit/a981ef847a)] - **gyp**: fix android generator (Robert Chiras) [#889](https://github.com/nodejs/node-gyp/pull/889) - -## v3.3.0 2016-02-16 - -* [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) -* [[`d1e4cc4b62`](https://github.com/nodejs/node-gyp/commit/d1e4cc4b62)] - **(SEMVER-MINOR)** Download headers tarball for ~0.12.10 || ~0.10.42 (Rod Vagg) [#877](https://github.com/nodejs/node-gyp/pull/877) -* [[`6e28ad1bea`](https://github.com/nodejs/node-gyp/commit/6e28ad1bea)] - Allow for npmlog@2.x (Rebecca Turner) [#861](https://github.com/nodejs/node-gyp/pull/861) -* [[`07371e5812`](https://github.com/nodejs/node-gyp/commit/07371e5812)] - Use -fPIC for NetBSD. (Marcin Cieślak) [#856](https://github.com/nodejs/node-gyp/pull/856) -* [[`8c4b0ffa50`](https://github.com/nodejs/node-gyp/commit/8c4b0ffa50)] - **(SEMVER-MINOR)** Add --cafile command line option. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) -* [[`b3ad43498e`](https://github.com/nodejs/node-gyp/commit/b3ad43498e)] - **(SEMVER-MINOR)** Make download() function testable. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) - -## v3.2.1 2015-12-03 - -* [[`ab89b477c4`](https://github.com/nodejs/node-gyp/commit/ab89b477c4)] - Upgrade gyp to b3cef02. (Ben Noordhuis) [#831](https://github.com/nodejs/node-gyp/pull/831) -* [[`90078ecb17`](https://github.com/nodejs/node-gyp/commit/90078ecb17)] - Define WIN32_LEAN_AND_MEAN conditionally. (Ben Noordhuis) [#824](https://github.com/nodejs/node-gyp/pull/824) - -## v3.2.0 2015-11-25 - -* [[`268f1ca4c7`](https://github.com/nodejs/node-gyp/commit/268f1ca4c7)] - Use result of `which` when searching for python. (Refael Ackermann) [#668](https://github.com/nodejs/node-gyp/pull/668) -* [[`817ed9bd78`](https://github.com/nodejs/node-gyp/commit/817ed9bd78)] - Add test for python executable search logic. (Ben Noordhuis) [#756](https://github.com/nodejs/node-gyp/pull/756) -* [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) -* [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) -* [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) -* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) - -## v3.1.0 2015-11-14 - -* [[`9049241f91`](https://github.com/nodejs/node-gyp/commit/9049241f91)] - **gyp**: don't use links at all, just copy the files instead (Nathan Zadoks) -* [[`8ef90348d1`](https://github.com/nodejs/node-gyp/commit/8ef90348d1)] - **gyp**: apply https://codereview.chromium.org/11361103/ (Nathan Rajlich) -* [[`a2ed0df84e`](https://github.com/nodejs/node-gyp/commit/a2ed0df84e)] - **gyp**: always install into $PRODUCT_DIR (Nathan Rajlich) -* [[`cc8b2fa83e`](https://github.com/nodejs/node-gyp/commit/cc8b2fa83e)] - Update gyp to b3cef02. (Imran Iqbal) [#781](https://github.com/nodejs/node-gyp/pull/781) -* [[`f5d86eb84e`](https://github.com/nodejs/node-gyp/commit/f5d86eb84e)] - Update to tar@2.0.0. (Edgar Muentes) [#797](https://github.com/nodejs/node-gyp/pull/797) -* [[`2ac7de02c4`](https://github.com/nodejs/node-gyp/commit/2ac7de02c4)] - Fix infinite loop with zero-length options. (Ben Noordhuis) [#745](https://github.com/nodejs/node-gyp/pull/745) -* [[`101bed639b`](https://github.com/nodejs/node-gyp/commit/101bed639b)] - This platform value came from debian package, and now the value (Jérémy Lal) [#738](https://github.com/nodejs/node-gyp/pull/738) - -## v3.0.3 2015-09-14 - -* [[`ad827cda30`](https://github.com/nodejs/node-gyp/commit/ad827cda30)] - tarballUrl global and && when checking for iojs (Lars-Magnus Skog) [#729](https://github.com/nodejs/node-gyp/pull/729) - -## v3.0.2 2015-09-12 - -* [[`6e8c3bf3c6`](https://github.com/nodejs/node-gyp/commit/6e8c3bf3c6)] - add back support for passing additional cmdline args (Rod Vagg) [#723](https://github.com/nodejs/node-gyp/pull/723) -* [[`ff82f2f3b9`](https://github.com/nodejs/node-gyp/commit/ff82f2f3b9)] - fixed broken link in docs to Visual Studio 2013 download (simon-p-r) [#722](https://github.com/nodejs/node-gyp/pull/722) - -## v3.0.1 2015-09-08 - -* [[`846337e36b`](https://github.com/nodejs/node-gyp/commit/846337e36b)] - normalise versions for target == this comparison (Rod Vagg) [#716](https://github.com/nodejs/node-gyp/pull/716) - -## v3.0.0 2015-09-08 - -* [[`9720d0373c`](https://github.com/nodejs/node-gyp/commit/9720d0373c)] - remove node_modules from tree (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`6dcf220db7`](https://github.com/nodejs/node-gyp/commit/6dcf220db7)] - test version major directly, don't use semver.satisfies() (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`938dd18d1c`](https://github.com/nodejs/node-gyp/commit/938dd18d1c)] - refactor for clarity, fix dist-url, add env var dist-url functionality (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`9e9df66a06`](https://github.com/nodejs/node-gyp/commit/9e9df66a06)] - use process.release, make aware of io.js & node v4 differences (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`1ea7ed01f4`](https://github.com/nodejs/node-gyp/commit/1ea7ed01f4)] - **deps**: update graceful-fs dependency to the latest (Sakthipriyan Vairamani) [#714](https://github.com/nodejs/node-gyp/pull/714) -* [[`0fbc387b35`](https://github.com/nodejs/node-gyp/commit/0fbc387b35)] - Update repository URLs. (Ben Noordhuis) [#715](https://github.com/nodejs/node-gyp/pull/715) -* [[`bbedb8868b`](https://github.com/nodejs/node-gyp/commit/bbedb8868b)] - **(SEMVER-MAJOR)** **win**: enable delay-load hook by default (Jeremiah Senkpiel) [#708](https://github.com/nodejs/node-gyp/pull/708) -* [[`85ed107565`](https://github.com/nodejs/node-gyp/commit/85ed107565)] - Merge pull request #664 from othiym23/othiym23/allow-semver-5 (Nathan Rajlich) -* [[`0c720d234c`](https://github.com/nodejs/node-gyp/commit/0c720d234c)] - allow semver@5 (Forrest L Norvell) - -## 2.0.2 / 2015-07-14 - - * Use HTTPS for dist url (#656, @SonicHedgehog) - * Merge pull request #648 from nevosegal/master - * Merge pull request #650 from magic890/patch-1 - * Updated Installation section on README - * Updated link to gyp user documentation - * Fix download error message spelling (#643, @tomxtobin) - * Merge pull request #637 from lygstate/master - * Set NODE_GYP_DIR for addon.gypi to setting absolute path for - src/win_delay_load_hook.c, and fixes of the long relative path issue on Win32. - Fixes #636 (#637, @lygstate). - -## 2.0.1 / 2015-05-28 - - * configure: try/catch the semver range.test() call - * README: update for visual studio 2013 (#510, @samccone) - -## 2.0.0 / 2015-05-24 - - * configure: check for python2 executable by default, fallback to python - * configure: don't clobber existing $PYTHONPATH - * configure: use "path-array" for PYTHONPATH - * gyp: fix for non-acsii userprofile name on Windows - * gyp: always install into $PRODUCT_DIR - * gyp: apply https://codereview.chromium.org/11361103/ - * gyp: don't use links at all, just copy the files instead - * gyp: update gyp to e1c8fcf7 - * Updated README.md with updated Windows build info - * Show URL when a download fails - * package: add a "license" field - * move HMODULE m declaration to top - * Only add "-undefined dynamic_lookup" to loadable_module targets - * win: optionally allow node.exe/iojs.exe to be renamed - * Avoid downloading shasums if using tarPath - * Add target name preprocessor define: `NODE_GYP_MODULE_NAME` - * Show better error message in case of bad network settings diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/CONTRIBUTING.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/CONTRIBUTING.md deleted file mode 100644 index c1c50eab4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/CONTRIBUTING.md +++ /dev/null @@ -1,34 +0,0 @@ -# Contributing to node-gyp - -## Code of Conduct - -Please read the -[Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) -which explains the minimum behavior expectations for node-gyp contributors. - - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/LICENSE b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/LICENSE deleted file mode 100644 index 2ea4dc5ef..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/README.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/README.md deleted file mode 100644 index 71eea0a94..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/README.md +++ /dev/null @@ -1,256 +0,0 @@ -# `node-gyp` - Node.js native addon build tool - -[![Build Status](https://github.com/nodejs/node-gyp/workflows/Tests/badge.svg?branch=master)](https://github.com/nodejs/node-gyp/actions?query=workflow%3ATests+branch%3Amaster) -![npm](https://img.shields.io/npm/dm/node-gyp) - -`node-gyp` is a cross-platform command-line tool written in Node.js for -compiling native addon modules for Node.js. It contains a vendored copy of the -[gyp-next](https://github.com/nodejs/gyp-next) project that was previously used -by the Chromium team, extended to support the development of Node.js native addons. - -Note that `node-gyp` is _not_ used to build Node.js itself. - -Multiple target versions of Node.js are supported (i.e. `0.8`, ..., `4`, `5`, `6`, -etc.), regardless of what version of Node.js is actually installed on your system -(`node-gyp` downloads the necessary development files or headers for the target version). - -## Features - - * The same build commands work on any of the supported platforms - * Supports the targeting of different versions of Node.js - -## Installation - -You can install `node-gyp` using `npm`: - -``` bash -npm install -g node-gyp -``` - -Depending on your operating system, you will need to install: - -### On Unix - - * Python v3.6, v3.7, v3.8, or v3.9 - * `make` - * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org) - -### On macOS - -**ATTENTION**: If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [macOS_Catalina.md](macOS_Catalina.md). - - * Python v3.6, v3.7, v3.8, or v3.9 - * [Xcode](https://developer.apple.com/xcode/download/) - * You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`. - -### On Windows - -Install the current version of Python from the [Microsoft Store package](https://docs.python.org/3/using/windows.html#the-microsoft-store-package). - -Install tools and configuration manually: - * Install Visual C++ Build Environment: [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools) - (using "Visual C++ build tools" workload) or [Visual Studio Community](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) - (using the "Desktop development with C++" workload) - * Launch cmd, `npm config set msvs_version 2017` - - If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips. - - To target native ARM64 Node.js on Windows 10 on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64". - -### Configuring Python Dependency - -`node-gyp` requires that you have installed a compatible version of Python, one of: v3.6, v3.7, -v3.8, or v3.9. If you have multiple Python versions installed, you can identify which Python -version `node-gyp` should use in one of the following ways: - -1. by setting the `--python` command-line option, e.g.: - -``` bash -node-gyp --python /path/to/executable/python -``` - -2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of -Python installed, then you can set `npm`'s 'python' config key to the appropriate -value: - -``` bash -npm config set python /path/to/executable/python -``` - -3. If the `PYTHON` environment variable is set to the path of a Python executable, -then that version will be used, if it is a compatible version. - -4. If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a -Python executable, it will be used instead of any of the other configured or -builtin Python search paths. If it's not a compatible version, no further -searching will be done. - -### Build for Third Party Node.js Runtimes - -When building modules for thid party Node.js runtimes like Electron, which have -different build configurations from the official Node.js distribution, you -should use `--dist-url` or `--nodedir` flags to specify the headers of the -runtime to build for. - -Also when `--dist-url` or `--nodedir` flags are passed, node-gyp will use the -`config.gypi` shipped in the headers distribution to generate build -configurations, which is different from the default mode that would use the -`process.config` object of the running Node.js instance. - -Some old versions of Electron shipped malformed `config.gypi` in their headers -distributions, and you might need to pass `--force-process-config` to node-gyp -to work around configuration errors. - -## How to Use - -To compile your native addon, first go to its root directory: - -``` bash -cd my_node_addon -``` - -The next step is to generate the appropriate project build files for the current -platform. Use `configure` for that: - -``` bash -node-gyp configure -``` - -Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015` -needs to be added (not needed when run by npm as configured above): -``` bash -node-gyp configure --msvs_version=2015 -``` - -__Note__: The `configure` step looks for a `binding.gyp` file in the current -directory to process. See below for instructions on creating a `binding.gyp` file. - -Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file -(on Windows) in the `build/` directory. Next, invoke the `build` command: - -``` bash -node-gyp build -``` - -Now you have your compiled `.node` bindings file! The compiled bindings end up -in `build/Debug/` or `build/Release/`, depending on the build mode. At this point, -you can require the `.node` file with Node.js and run your tests! - -__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or -`-d`) switch when running either the `configure`, `build` or `rebuild` commands. - -## The `binding.gyp` file - -A `binding.gyp` file describes the configuration to build your module, in a -JSON-like format. This file gets placed in the root of your package, alongside -`package.json`. - -A barebones `gyp` file appropriate for building a Node.js addon could look like: - -```python -{ - "targets": [ - { - "target_name": "binding", - "sources": [ "src/binding.cc" ] - } - ] -} -``` - -## Further reading - -The **[docs](./docs/)** directory contains additional documentation on specific node-gyp topics that may be useful if you are experiencing problems installing or building addons using node-gyp. - -Some additional resources for Node.js native addons and writing `gyp` configuration files: - - * ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative) - * ["Hello World" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world) - * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md) - * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md) - * [*"binding.gyp" files out in the wild* wiki page](./docs/binding.gyp-files-in-the-wild.md) - -## Commands - -`node-gyp` responds to the following commands: - -| **Command** | **Description** -|:--------------|:--------------------------------------------------------------- -| `help` | Shows the help dialog -| `build` | Invokes `make`/`msbuild.exe` and builds the native addon -| `clean` | Removes the `build` directory if it exists -| `configure` | Generates project build files for the current platform -| `rebuild` | Runs `clean`, `configure` and `build` all in a row -| `install` | Installs Node.js header files for the given version -| `list` | Lists the currently installed Node.js header versions -| `remove` | Removes the Node.js header files for the given version - - -## Command Options - -`node-gyp` accepts the following command options: - -| **Command** | **Description** -|:----------------------------------|:------------------------------------------ -| `-j n`, `--jobs n` | Run `make` in parallel. The value `max` will use all available CPU cores -| `--target=v6.2.1` | Node.js version to build for (default is `process.version`) -| `--silly`, `--loglevel=silly` | Log all progress to console -| `--verbose`, `--loglevel=verbose` | Log most progress to console -| `--silent`, `--loglevel=silent` | Don't log anything to console -| `debug`, `--debug` | Make Debug build (default is `Release`) -| `--release`, `--no-debug` | Make Release build -| `-C $dir`, `--directory=$dir` | Run command in different directory -| `--make=$make` | Override `make` command (e.g. `gmake`) -| `--thin=yes` | Enable thin static libraries -| `--arch=$arch` | Set target architecture (e.g. ia32) -| `--tarball=$path` | Get headers from a local tarball -| `--devdir=$path` | SDK download directory (default is OS cache directory) -| `--ensure` | Don't reinstall headers if already present -| `--dist-url=$url` | Download header tarball from custom URL -| `--proxy=$url` | Set HTTP(S) proxy for downloading header tarball -| `--noproxy=$urls` | Set urls to ignore proxies when downloading header tarball -| `--cafile=$cafile` | Override default CA chain (to download tarball) -| `--nodedir=$path` | Set the path to the node source code -| `--python=$path` | Set path to the Python binary -| `--msvs_version=$version` | Set Visual Studio version (Windows only) -| `--solution=$solution` | Set Visual Studio Solution version (Windows only) -| `--force-process-config` | Force using runtime's `process.config` object to generate `config.gypi` file - -## Configuration - -### Environment variables - -Use the form `npm_config_OPTION_NAME` for any of the command options listed -above (dashes in option names should be replaced by underscores). - -For example, to set `devdir` equal to `/tmp/.gyp`, you would: - -Run this on Unix: - -```bash -export npm_config_devdir=/tmp/.gyp -``` - -Or this on Windows: - -```console -set npm_config_devdir=c:\temp\.gyp -``` - -### `npm` configuration - -Use the form `OPTION_NAME` for any of the command options listed above. - -For example, to set `devdir` equal to `/tmp/.gyp`, you would run: - -```bash -npm config set [--global] devdir /tmp/.gyp -``` - -**Note:** Configuration set via `npm` will only be used when `node-gyp` -is run via `npm`, not when `node-gyp` is run directly. - -## License - -`node-gyp` is available under the MIT license. See the [LICENSE -file](LICENSE) for details. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/addon.gypi b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/addon.gypi deleted file mode 100644 index 9327b0d72..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/addon.gypi +++ /dev/null @@ -1,185 +0,0 @@ -{ - 'variables' : { - 'node_engine_include_dir%': 'deps/v8/include', - 'node_host_binary%': 'node', - 'node_with_ltcg%': 'true', - }, - 'target_defaults': { - 'type': 'loadable_module', - 'win_delay_load_hook': 'true', - 'product_prefix': '', - - 'conditions': [ - [ 'node_engine=="chakracore"', { - 'variables': { - 'node_engine_include_dir%': 'deps/chakrashim/include' - }, - }] - ], - - 'include_dirs': [ - '<(node_root_dir)/include/node', - '<(node_root_dir)/src', - '<(node_root_dir)/deps/openssl/config', - '<(node_root_dir)/deps/openssl/openssl/include', - '<(node_root_dir)/deps/uv/include', - '<(node_root_dir)/deps/zlib', - '<(node_root_dir)/<(node_engine_include_dir)' - ], - 'defines!': [ - 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. - 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. - ], - 'defines': [ - 'NODE_GYP_MODULE_NAME=>(_target_name)', - 'USING_UV_SHARED=1', - 'USING_V8_SHARED=1', - # Warn when using deprecated V8 APIs. - 'V8_DEPRECATION_WARNINGS=1' - ], - - 'target_conditions': [ - ['_type=="loadable_module"', { - 'product_extension': 'node', - 'defines': [ - 'BUILDING_NODE_EXTENSION' - ], - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-undefined dynamic_lookup' - ], - }, - }], - - ['_type=="static_library"', { - # set to `1` to *disable* the -T thin archive 'ld' flag. - # older linkers don't support this flag. - 'standalone_static_library': '<(standalone_static_library)' - }], - - ['_type!="executable"', { - 'conditions': [ - [ 'OS=="android"', { - 'cflags!': [ '-fPIE' ], - }] - ] - }], - - ['_win_delay_load_hook=="true"', { - # If the addon specifies `'win_delay_load_hook': 'true'` in its - # binding.gyp, link a delay-load hook into the DLL. This hook ensures - # that the addon will work regardless of whether the node/iojs binary - # is named node.exe, iojs.exe, or something else. - 'conditions': [ - [ 'OS=="win"', { - 'defines': [ 'HOST_BINARY=\"<(node_host_binary)<(EXECUTABLE_SUFFIX)\"', ], - 'sources': [ - '<(node_gyp_dir)/src/win_delay_load_hook.cc', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'DelayLoadDLLs': [ '<(node_host_binary)<(EXECUTABLE_SUFFIX)' ], - # Don't print a linker warning when no imports from either .exe - # are used. - 'AdditionalOptions': [ '/ignore:4199' ], - }, - }, - }], - ], - }], - ], - - 'conditions': [ - [ 'OS=="mac"', { - 'defines': [ - '_DARWIN_USE_64_BIT_INODE=1' - ], - 'xcode_settings': { - 'DYLIB_INSTALL_NAME_BASE': '@rpath' - }, - }], - [ 'OS=="aix"', { - 'ldflags': [ - '-Wl,-bimport:<(node_exp_file)' - ], - }], - [ 'OS=="zos"', { - 'cflags': [ - '-q64', - '-Wc,DLL', - '-qlonglong', - '-qenum=int', - '-qxclang=-fexec-charset=ISO8859-1' - ], - 'defines': [ - '_ALL_SOURCE=1', - 'MAP_FAILED=-1', - '_UNIX03_SOURCE=1' - ], - 'ldflags': [ - '-q64', - '<(node_exp_file)' - ], - }], - [ 'OS=="win"', { - 'conditions': [ - ['node_engine=="chakracore"', { - 'library_dirs': [ '<(node_root_dir)/$(ConfigurationName)' ], - 'libraries': [ '<@(node_engine_libs)' ], - }], - ['node_with_ltcg=="true"', { - 'msvs_settings': { - 'VCCLCompilerTool': { - 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG - }, - 'VCLibrarianTool': { - 'AdditionalOptions': [ - '/LTCG:INCREMENTAL', # incremental link-time code generation - ] - }, - 'VCLinkerTool': { - 'OptimizeReferences': 2, # /OPT:REF - 'EnableCOMDATFolding': 2, # /OPT:ICF - 'LinkIncremental': 1, # disable incremental linking - 'AdditionalOptions': [ - '/LTCG:INCREMENTAL', # incremental link-time code generation - ] - } - } - }] - ], - 'libraries': [ - '-lkernel32.lib', - '-luser32.lib', - '-lgdi32.lib', - '-lwinspool.lib', - '-lcomdlg32.lib', - '-ladvapi32.lib', - '-lshell32.lib', - '-lole32.lib', - '-loleaut32.lib', - '-luuid.lib', - '-lodbc32.lib', - '-lDelayImp.lib', - '-l"<(node_lib_file)"' - ], - 'msvs_disabled_warnings': [ - # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' - # needs to have dll-interface to be used by - # clients of class 'node::ObjectWrap' - 4251 - ], - }, { - # OS!="win" - 'defines': [ - '_LARGEFILE_SOURCE', - '_FILE_OFFSET_BITS=64' - ], - }], - [ 'OS in "freebsd openbsd netbsd solaris android" or \ - (OS=="linux" and target_arch!="ia32")', { - 'cflags': [ '-fPIC' ], - }], - ] - } -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/bin/node-gyp.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/bin/node-gyp.js deleted file mode 100755 index 8652ea21e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/bin/node-gyp.js +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -process.title = 'node-gyp' - -const envPaths = require('env-paths') -const gyp = require('../') -const log = require('npmlog') -const os = require('os') - -/** - * Process and execute the selected commands. - */ - -const prog = gyp() -var completed = false -prog.parseArgv(process.argv) -prog.devDir = prog.opts.devdir - -var homeDir = os.homedir() -if (prog.devDir) { - prog.devDir = prog.devDir.replace(/^~/, homeDir) -} else if (homeDir) { - prog.devDir = envPaths('node-gyp', { suffix: '' }).cache -} else { - throw new Error( - "node-gyp requires that the user's home directory is specified " + - 'in either of the environmental variables HOME or USERPROFILE. ' + - 'Overide with: --devdir /path/to/.node-gyp') -} - -if (prog.todo.length === 0) { - if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) { - console.log('v%s', prog.version) - } else { - console.log('%s', prog.usage()) - } - process.exit(0) -} - -log.info('it worked if it ends with', 'ok') -log.verbose('cli', process.argv) -log.info('using', 'node-gyp@%s', prog.version) -log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch) - -/** - * Change dir if -C/--directory was passed. - */ - -var dir = prog.opts.directory -if (dir) { - var fs = require('fs') - try { - var stat = fs.statSync(dir) - if (stat.isDirectory()) { - log.info('chdir', dir) - process.chdir(dir) - } else { - log.warn('chdir', dir + ' is not a directory') - } - } catch (e) { - if (e.code === 'ENOENT') { - log.warn('chdir', dir + ' is not a directory') - } else { - log.warn('chdir', 'error during chdir() "%s"', e.message) - } - } -} - -function run () { - var command = prog.todo.shift() - if (!command) { - // done! - completed = true - log.info('ok') - return - } - - prog.commands[command.name](command.args, function (err) { - if (err) { - log.error(command.name + ' error') - log.error('stack', err.stack) - errorMessage() - log.error('not ok') - return process.exit(1) - } - if (command.name === 'list') { - var versions = arguments[1] - if (versions.length > 0) { - versions.forEach(function (version) { - console.log(version) - }) - } else { - console.log('No node development files installed. Use `node-gyp install` to install a version.') - } - } else if (arguments.length >= 2) { - console.log.apply(console, [].slice.call(arguments, 1)) - } - - // now run the next command in the queue - process.nextTick(run) - }) -} - -process.on('exit', function (code) { - if (!completed && !code) { - log.error('Completion callback never invoked!') - issueMessage() - process.exit(6) - } -}) - -process.on('uncaughtException', function (err) { - log.error('UNCAUGHT EXCEPTION') - log.error('stack', err.stack) - issueMessage() - process.exit(7) -}) - -function errorMessage () { - // copied from npm's lib/utils/error-handler.js - var os = require('os') - log.error('System', os.type() + ' ' + os.release()) - log.error('command', process.argv - .map(JSON.stringify).join(' ')) - log.error('cwd', process.cwd()) - log.error('node -v', process.version) - log.error('node-gyp -v', 'v' + prog.package.version) -} - -function issueMessage () { - errorMessage() - log.error('', ['Node-gyp failed to build your package.', - 'Try to update npm and/or node-gyp and if it does not help file an issue with the package author.' - ].join('\n')) -} - -// start running the given commands! -run() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Common-issues.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Common-issues.md deleted file mode 100644 index ae05fe326..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Common-issues.md +++ /dev/null @@ -1,14 +0,0 @@ -## Python Issues OSX - -Make sure you are using the native Python version in OSX. If you use a MacPorts of HomeBrew version, you may run into problems. - -If you have issues with `execvp`, be sure to check your `$PYTHON` environment variable. If it is not set to the native version, unset it and try again. - -Notes: https://gist.github.com/erichocean/5177582 - -## npm ERR! `node-gyp rebuild`(Windows) -* just install the build tools from [here](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools) -Please note the version as is required in below command e.g **2017** -* Launch cmd, run `npm config set msvs_version 2017` -* close and open new CMD/terminal and all is well :100: - diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Error-pre-versions-of-node-cannot-be-installed.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Error-pre-versions-of-node-cannot-be-installed.md deleted file mode 100644 index c1e1158d7..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Error-pre-versions-of-node-cannot-be-installed.md +++ /dev/null @@ -1,94 +0,0 @@ -When using `node-gyp` you might see an error like this when attempting to compile/install a node.js native addon: - -``` -$ npm install bcrypt -npm http GET https://registry.npmjs.org/bcrypt/0.7.5 -npm http 304 https://registry.npmjs.org/bcrypt/0.7.5 -npm http GET https://registry.npmjs.org/bindings/1.0.0 -npm http 304 https://registry.npmjs.org/bindings/1.0.0 - -> bcrypt@0.7.5 install /home/ubuntu/public/song-swap/node_modules/bcrypt -> node-gyp rebuild - -gyp ERR! configure error -gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead -gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:69:16) -gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:56:37) -gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:219:20) -gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:105:9 -gyp ERR! stack at ChildProcess.exithandler (child_process.js:630:7) -gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17) -gyp ERR! stack at maybeClose (child_process.js:730:16) -gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:5) -gyp ERR! System Linux 3.5.0-21-generic -gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" -gyp ERR! cwd /home/ubuntu/public/song-swap/node_modules/bcrypt -gyp ERR! node -v v0.11.2-pre -gyp ERR! node-gyp -v v0.9.5 -gyp ERR! not ok -npm ERR! bcrypt@0.7.5 install: `node-gyp rebuild` -npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1 -npm ERR! -npm ERR! Failed at the bcrypt@0.7.5 install script. -npm ERR! This is most likely a problem with the bcrypt package, -npm ERR! not with npm itself. -npm ERR! Tell the author that this fails on your system: -npm ERR! node-gyp rebuild -npm ERR! You can get their info via: -npm ERR! npm owner ls bcrypt -npm ERR! There is likely additional logging output above. - -npm ERR! System Linux 3.5.0-21-generic -npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "bcrypt" -npm ERR! cwd /home/ubuntu/public/song-swap -npm ERR! node -v v0.11.2-pre -npm ERR! npm -v 1.2.18 -npm ERR! code ELIFECYCLE -npm ERR! -npm ERR! Additional logging details can be found in: -npm ERR! /home/ubuntu/public/song-swap/npm-debug.log -npm ERR! not ok code 0 -``` - -The main error here is: - -``` -Error: "pre" versions of node cannot be installed, use the --nodedir flag instead -``` - -This error is caused when you attempt to compile a native addon using a version of node.js with `-pre` at the end of the version number: - -``` bash -$ node -v -v0.10.4-pre -``` - -## How to avoid (the short answer) - -To avoid this error completely just use a stable release of node.js. i.e. `v0.10.4`, and __not__ `v0.10.4-pre`. - -## How to fix (the long answer) - -This error happens because `node-gyp` does not know what header files were used to compile your "pre" version of node, and therefore it needs you to specify the node source code directory path using the `--nodedir` flag. - -For example, if I compiled my development ("pre") version of node.js using the source code in `/Users/nrajlich/node`, then I could invoke `node-gyp` like: - -``` bash -$ node-gyp rebuild --nodedir=/Users/nrajlich/node -``` - -Or install an native addon through `npm` like: - -``` bash -$ npm install bcrypt --nodedir=/Users/nrajlich/node -``` - -### Always use `--nodedir` - -__Note:__ This is for advanced users who use `-pre` versions of node more often than tagged releases. - -If you're invoking `node-gyp` through `npm`, then you can leverage `npm`'s configuration system and not have to specify the `--nodedir` flag all the time: - -``` bash -$ npm config set nodedir /Users/nrajlich/node -``` \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Home.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Home.md deleted file mode 100644 index fe099868b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Home.md +++ /dev/null @@ -1,7 +0,0 @@ -Welcome to the node-gyp wiki! - - * [["binding.gyp" files out in the wild]] - * [[Linking to OpenSSL]] - * [[Common Issues]] - * [[Updating npm's bundled node-gyp]] - * [[Error: "pre" versions of node cannot be installed]] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Linking-to-OpenSSL.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Linking-to-OpenSSL.md deleted file mode 100644 index ec8092999..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Linking-to-OpenSSL.md +++ /dev/null @@ -1,86 +0,0 @@ -A handful of native addons require linking to OpenSSL in one way or another. This introduces a small challenge since node will sometimes bundle OpenSSL statically (the default for node >= v0.8.x), or sometimes dynamically link to the system OpenSSL (default for node <= v0.6.x). - -Good native addons should account for both scenarios. It's recommended that you use the `binding.gyp` file provided below as a starting-point for any addon that needs to use OpenSSL: - -``` python -{ - 'variables': { - # node v0.6.x doesn't give us its build variables, - # but on Unix it was only possible to use the system OpenSSL library, - # so default the variable to "true", v0.8.x node and up will overwrite it. - 'node_shared_openssl%': 'true' - }, - 'targets': [ - { - 'target_name': 'binding', - 'sources': [ - 'src/binding.cc' - ], - 'conditions': [ - ['node_shared_openssl=="false"', { - # so when "node_shared_openssl" is "false", then OpenSSL has been - # bundled into the node executable. So we need to include the same - # header files that were used when building node. - 'include_dirs': [ - '<(node_root_dir)/deps/openssl/openssl/include' - ], - "conditions" : [ - ["target_arch=='ia32'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] - }], - ["target_arch=='x64'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] - }], - ["target_arch=='arm'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] - }] - ] - }] - ] - } - ] -} -``` - -This ensures that when OpenSSL is statically linked into `node` then, the bundled OpenSSL headers are included, but when the system OpenSSL is in use, then only those headers will be used. - -## Windows? - -As you can see this baseline `binding.gyp` file only accounts for the Unix scenario. Currently on Windows the situation is a little less ideal. On Windows, OpenSSL is _always_ statically compiled into the `node` executable, so ideally it would be possible to use that copy of OpenSSL when building native addons. - -Unfortunately it doesn't seem like that is possible at the moment, as there would need to be tweaks made to the generated `node.lib` file to include the openssl glue functions, or a new `openssl.lib` file would need to be created during the node build. I'm not sure which is the easiest/most feasible. - -In the meantime, one possible solution is using another copy of OpenSSL, which is what [`node-bcrypt`](https://github.com/ncb000gt/node.bcrypt.js) currently does. Adding something like this to your `binding.gyp` file's `"conditions"` block would enable this: - -``` python - [ 'OS=="win"', { - 'conditions': [ - # "openssl_root" is the directory on Windows of the OpenSSL files. - # Check the "target_arch" variable to set good default values for - # both 64-bit and 32-bit builds of the module. - ['target_arch=="x64"', { - 'variables': { - 'openssl_root%': 'C:/OpenSSL-Win64' - }, - }, { - 'variables': { - 'openssl_root%': 'C:/OpenSSL-Win32' - }, - }], - ], - 'libraries': [ - '-l<(openssl_root)/lib/libeay32.lib', - ], - 'include_dirs': [ - '<(openssl_root)/include', - ], - }] -``` - -Now you can direct your users to install OpenSSL on Windows from here (be sure to tell them to install the 64-bit version if they're compiling against a 64-bit version of node): http://slproweb.com/products/Win32OpenSSL.html - -Also note that both `node-gyp` and `npm` allow you to overwrite that default `openssl_root` variable on the command line: - -``` bash -$ node-gyp rebuild --openssl-root="C:\Users\Nathan\Desktop\openssl" -``` \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md deleted file mode 100644 index 0777687c2..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md +++ /dev/null @@ -1,45 +0,0 @@ -# Updating the npm-bundled version of node-gyp - -[Many issues](https://github.com/nodejs/node-gyp/labels/ERR%21%20node-gyp%20-v%20%3C%3D%20v5.1.0) are opened by users who are -not running a [current version of node-gyp](https://github.com/nodejs/node-gyp/releases). - -`npm` bundles its own, internal, copy of `node-gyp`. This internal copy is independent of any globally installed copy of node-gyp that -may have been installed via `npm install -g node-gyp`. - -Generally, npm's library files are installed inside your global "node_modules", where npm is installed (run `npm prefix` and add `lib/node_modules`, or just `node_modules` for Windows). There are some exceptions to this. Inside this global `node_modules/` there will be an `npm/` directory and inside this you'll find a `node_modules/node-gyp/` directory. So it may look something like `/usr/local/lib/node_modules/npm/node_modules/node-gyp/`. This is the version of node-gyp that ships with npm. - -When you install a _new_ version of node-gyp outside of npm, it'll go into your global node_modules, but not under the `npm/node_modules`. So that may look like `/usr/local/lib/node_modules/node-gyp/`. It'll have the `node-gyp` executable linked into your `PATH` so running `node-gyp` will use this version. - -The catch is that npm won't use this version unless you tell it to, it'll keep on using the one you have installed. You need to instruct it to by setting the `node_gyp` config variable (which goes into your `~/.npmrc`). You do this by running the `npm config set` command as below. Then npm will use the command in the path you supply whenever it needs to build a native addon. - -**Important**: You also need to remember to unset this when you upgrade npm with a newer version of node-gyp, or you have to manually keep your globally installed node-gyp to date. See "Undo" below. - -## Linux and macOS -``` -npm install --global node-gyp@latest -npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js -``` - -`sudo` may be required for the first command if you get a permission error. - -## Windows - -### Windows Command Prompt -``` -npm install --global node-gyp@latest -for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js" -``` - -### Powershell -``` -npm install --global node-gyp@latest -npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"} -``` - -## Undo -**Beware** if you don't unset the `node_gyp` config option, npm will continue to use the globally installed version of node-gyp rather than the one it ships with, which may end up being newer. - -``` -npm config delete node_gyp -npm uninstall --global node-gyp -``` diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/binding.gyp-files-in-the-wild.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/binding.gyp-files-in-the-wild.md deleted file mode 100644 index c4603dd3d..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/docs/binding.gyp-files-in-the-wild.md +++ /dev/null @@ -1,48 +0,0 @@ -This page contains links to some examples of existing `binding.gyp` files that other node modules are using. Take a look at them for inspiration. - -To add to this page, just add the link to the project's `binding.gyp` file below: - - * [ons](https://github.com/XadillaX/aliyun-ons/blob/master/binding.gyp) - * [thmclrx](https://github.com/XadillaX/thmclrx/blob/master/binding.gyp) - * [libxmljs](https://github.com/polotek/libxmljs/blob/master/binding.gyp) - * [node-buffertools](https://github.com/bnoordhuis/node-buffertools/blob/master/binding.gyp) - * [node-canvas](https://github.com/LearnBoost/node-canvas/blob/master/binding.gyp) - * [node-ffi](https://github.com/rbranson/node-ffi/blob/master/binding.gyp) + [libffi](https://github.com/rbranson/node-ffi/blob/master/deps/libffi/libffi.gyp) - * [node-time](https://github.com/TooTallNate/node-time/blob/master/binding.gyp) - * [node-sass](https://github.com/sass/node-sass/blob/master/binding.gyp) + [libsass](https://github.com/sass/node-sass/blob/master/src/libsass.gyp) - * [node-serialport](https://github.com/voodootikigod/node-serialport/blob/master/binding.gyp) - * [node-weak](https://github.com/TooTallNate/node-weak/blob/master/binding.gyp) - * [pty.js](https://github.com/chjj/pty.js/blob/master/binding.gyp) - * [ref](https://github.com/TooTallNate/ref/blob/master/binding.gyp) - * [appjs](https://github.com/milani/appjs/blob/master/binding.gyp) - * [nwm](https://github.com/mixu/nwm/blob/master/binding.gyp) - * [bcrypt](https://github.com/ncb000gt/node.bcrypt.js/blob/master/binding.gyp) - * [nk-mysql](https://github.com/mmod/nodamysql/blob/master/binding.gyp) - * [nk-xrm-installer](https://github.com/mmod/nk-xrm-installer/blob/master/binding.gyp) + [includable.gypi](https://github.com/mmod/nk-xrm-installer/blob/master/includable.gypi) + [unpack.py](https://github.com/mmod/nk-xrm-installer/blob/master/unpack.py) + [disburse.py](https://github.com/mmod/nk-xrm-installer/blob/master/disburse.py) - .py files above provide complete reference for examples of fetching source via http, extracting, and moving files. - * [node-memwatch](https://github.com/lloyd/node-memwatch/blob/master/binding.gyp) - * [node-ip2location](https://github.com/bolgovr/node-ip2location/blob/master/binding.gyp) - * [node-midi](https://github.com/justinlatimer/node-midi/blob/master/binding.gyp) - * [node-sqlite3](https://github.com/developmentseed/node-sqlite3/blob/master/binding.gyp) + [libsqlite3](https://github.com/developmentseed/node-sqlite3/blob/master/deps/sqlite3.gyp) - * [node-zipfile](https://github.com/mapbox/node-zipfile/blob/master/binding.gyp) - * [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/binding.gyp) - * [node-inotify](https://github.com/c4milo/node-inotify/blob/master/binding.gyp) - * [v8-profiler](https://github.com/c4milo/v8-profiler/blob/master/binding.gyp) - * [airtunes](https://github.com/radioline/node_airtunes/blob/master/binding.gyp) - * [node-fann](https://github.com/c4milo/node-fann/blob/master/binding.gyp) - * [node-talib](https://github.com/oransel/node-talib/blob/master/binding.gyp) - * [node-leveldown](https://github.com/rvagg/node-leveldown/blob/master/binding.gyp) + [leveldb.gyp](https://github.com/rvagg/node-leveldown/blob/master/deps/leveldb/leveldb.gyp) + [snappy.gyp](https://github.com/rvagg/node-leveldown/blob/master/deps/snappy/snappy.gyp) - * [node-expat](https://github.com/astro/node-expat/blob/master/binding.gyp) + [libexpat](https://github.com/astro/node-expat/blob/master/deps/libexpat/libexpat.gyp) - * [node-openvg-canvas](https://github.com/luismreis/node-openvg-canvas/blob/master/binding.gyp) + [node-openvg](https://github.com/luismreis/node-openvg/blob/master/binding.gyp) - * [node-cryptopp](https://github.com/BatikhSouri/node-cryptopp/blob/master/binding.gyp) - * [topcube](https://github.com/creationix/topcube/blob/master/binding.gyp) - * [node-osmium](https://github.com/osmcode/node-osmium/blob/master/binding.gyp) - * [node-osrm](https://github.com/DennisOSRM/node-osrm) - * [node-oracle](https://github.com/joeferner/node-oracle/blob/master/binding.gyp) - * [node-process-list](https://github.com/ReklatsMasters/node-process-list/blob/master/binding.gyp) - * [node-nanomsg](https://github.com/nickdesaulniers/node-nanomsg/blob/master/binding.gyp) - * [Ghostscript4JS](https://github.com/NickNaso/ghostscript4js/blob/master/binding.gyp) - * [nodecv](https://github.com/xudafeng/nodecv/blob/master/binding.gyp) - * [magick-cli](https://github.com/NickNaso/magick-cli/blob/master/binding.gyp) - * [sharp](https://github.com/lovell/sharp/blob/master/binding.gyp) - * [krb5](https://github.com/adaltas/node-krb5/blob/master/binding.gyp) \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.flake8 b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.flake8 deleted file mode 100644 index ea0c7680e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.flake8 +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -max-complexity = 101 -max-line-length = 88 -extend-ignore = E203 # whitespace before ':' to agree with psf/black diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml deleted file mode 100644 index 92303b635..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml +++ /dev/null @@ -1,30 +0,0 @@ -# TODO: Enable os: windows-latest -# TODO: Enable pytest --doctest-modules - -name: Python_tests -on: [push, pull_request] -jobs: - Python_tests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - max-parallel: 8 - matrix: - os: [macos-latest, ubuntu-latest] # , windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements_dev.txt - - name: Lint with flake8 - run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics - - name: Test with pytest - run: pytest - # - name: Run doctests with pytest - # run: pytest --doctest-modules diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml deleted file mode 100644 index bd7c85ffd..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: node-gyp integration - -on: [push, pull_request] - -jobs: - test: - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - python: [3.6, 3.9] - - runs-on: ${{ matrix.os }} - steps: - - name: Clone gyp-next - uses: actions/checkout@v2 - with: - path: gyp-next - - name: Clone nodejs/node-gyp - uses: actions/checkout@v2 - with: - repository: nodejs/node-gyp - path: node-gyp - - uses: actions/setup-node@v2 - with: - node-version: 14.x - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - cd node-gyp - npm install --no-progress - - name: Replace gyp in node-gyp - shell: bash - run: | - rm -rf node-gyp/gyp - cp -r gyp-next node-gyp/gyp - - name: Run tests - run: | - cd node-gyp - npm test diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml deleted file mode 100644 index fffe96e33..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Node.js Windows integration - -on: [push, pull_request] - -jobs: - build-windows: - runs-on: windows-latest - steps: - - name: Clone gyp-next - uses: actions/checkout@v2 - with: - path: gyp-next - - name: Clone nodejs/node - uses: actions/checkout@v2 - with: - repository: nodejs/node - path: node - - name: Install deps - run: choco install nasm - - name: Replace gyp in Node.js - run: | - rm -Recurse node/tools/gyp - cp -Recurse gyp-next node/tools/gyp - - name: Build Node.js - run: | - cd node - ./vcbuild.bat diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/release-please.yml b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/release-please.yml deleted file mode 100644 index 288afdb3b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/.github/workflows/release-please.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - push: - branches: - - main - -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: GoogleCloudPlatform/release-please-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - release-type: python - package-name: gyp-next - bump-minor-pre-major: Yes diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/AUTHORS b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/AUTHORS deleted file mode 100644 index f49a357b9..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/AUTHORS +++ /dev/null @@ -1,16 +0,0 @@ -# Names should be added to this file like so: -# Name or Organization - -Google Inc. <*@google.com> -Bloomberg Finance L.P. <*@bloomberg.net> -IBM Inc. <*@*.ibm.com> -Yandex LLC <*@yandex-team.ru> - -Steven Knight -Ryan Norton -David J. Sankel -Eric N. Vander Weele -Tom Freudenberg -Julien Brianceau -Refael Ackermann -Ujjwal Sharma diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CHANGELOG.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CHANGELOG.md deleted file mode 100644 index b7d55ed65..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CHANGELOG.md +++ /dev/null @@ -1,177 +0,0 @@ -# Changelog - -## [0.10.0](https://www.github.com/nodejs/gyp-next/compare/v0.9.6...v0.10.0) (2021-08-26) - - -### Features - -* **msvs:** add support for Visual Studio 2022 ([#124](https://www.github.com/nodejs/gyp-next/issues/124)) ([4bd9215](https://www.github.com/nodejs/gyp-next/commit/4bd9215c44d300f06e916aec1d6327c22b78272d)) - -### [0.9.6](https://www.github.com/nodejs/gyp-next/compare/v0.9.5...v0.9.6) (2021-08-23) - - -### Bug Fixes - -* align flake8 test ([#122](https://www.github.com/nodejs/gyp-next/issues/122)) ([f1faa8d](https://www.github.com/nodejs/gyp-next/commit/f1faa8d3081e1a47e917ff910892f00dff16cf8a)) -* **msvs:** fix paths again in action command arguments ([#121](https://www.github.com/nodejs/gyp-next/issues/121)) ([7159dfb](https://www.github.com/nodejs/gyp-next/commit/7159dfbc5758c9ec717e215f2c36daf482c846a1)) - -### [0.9.5](https://www.github.com/nodejs/gyp-next/compare/v0.9.4...v0.9.5) (2021-08-18) - - -### Bug Fixes - -* add python 3.6 to node-gyp integration test ([3462d4c](https://www.github.com/nodejs/gyp-next/commit/3462d4ce3c31cce747513dc7ca9760c81d57c60e)) -* revert for windows compatibility ([d078e7d](https://www.github.com/nodejs/gyp-next/commit/d078e7d7ae080ddae243188f6415f940376a7368)) -* support msvs_quote_cmd in ninja generator ([#117](https://www.github.com/nodejs/gyp-next/issues/117)) ([46486ac](https://www.github.com/nodejs/gyp-next/commit/46486ac6e9329529d51061e006a5b39631e46729)) - -### [0.9.4](https://www.github.com/nodejs/gyp-next/compare/v0.9.3...v0.9.4) (2021-08-09) - - -### Bug Fixes - -* .S is an extension for asm file on Windows ([#115](https://www.github.com/nodejs/gyp-next/issues/115)) ([d2fad44](https://www.github.com/nodejs/gyp-next/commit/d2fad44ef3a79ca8900f1307060153ded57053fc)) - -### [0.9.3](https://www.github.com/nodejs/gyp-next/compare/v0.9.2...v0.9.3) (2021-07-07) - - -### Bug Fixes - -* build failure with ninja and Python 3 on Windows ([#113](https://www.github.com/nodejs/gyp-next/issues/113)) ([c172d10](https://www.github.com/nodejs/gyp-next/commit/c172d105deff5db4244e583942215918fa80dd3c)) - -### [0.9.2](https://www.github.com/nodejs/gyp-next/compare/v0.9.1...v0.9.2) (2021-05-21) - - -### Bug Fixes - -* add support of utf8 encoding ([#105](https://www.github.com/nodejs/gyp-next/issues/105)) ([4d0f93c](https://www.github.com/nodejs/gyp-next/commit/4d0f93c249286d1f0c0f665f5fe7346119f98cf1)) - -### [0.9.1](https://www.github.com/nodejs/gyp-next/compare/v0.9.0...v0.9.1) (2021-05-14) - - -### Bug Fixes - -* py lint ([3b6a8ee](https://www.github.com/nodejs/gyp-next/commit/3b6a8ee7a66193a8a6867eba9e1d2b70bdf04402)) - -## [0.9.0](https://www.github.com/nodejs/gyp-next/compare/v0.8.1...v0.9.0) (2021-05-13) - - -### Features - -* use LDFLAGS_host for host toolset ([#98](https://www.github.com/nodejs/gyp-next/issues/98)) ([bea5c7b](https://www.github.com/nodejs/gyp-next/commit/bea5c7bd67d6ad32acbdce79767a5481c70675a2)) - - -### Bug Fixes - -* msvs.py: remove overindentation ([#102](https://www.github.com/nodejs/gyp-next/issues/102)) ([3f83e99](https://www.github.com/nodejs/gyp-next/commit/3f83e99056d004d9579ceb786e06b624ddc36529)) -* update gyp.el to change case to cl-case ([#93](https://www.github.com/nodejs/gyp-next/issues/93)) ([13d5b66](https://www.github.com/nodejs/gyp-next/commit/13d5b66aab35985af9c2fb1174fdc6e1c1407ecc)) - -### [0.8.1](https://www.github.com/nodejs/gyp-next/compare/v0.8.0...v0.8.1) (2021-02-18) - - -### Bug Fixes - -* update shebang lines from python to python3 ([#94](https://www.github.com/nodejs/gyp-next/issues/94)) ([a1b0d41](https://www.github.com/nodejs/gyp-next/commit/a1b0d4171a8049a4ab7a614202063dec332f2df4)) - -## [0.8.0](https://www.github.com/nodejs/gyp-next/compare/v0.7.0...v0.8.0) (2021-01-15) - - -### ⚠ BREAKING CHANGES - -* remove support for Python 2 - -### Bug Fixes - -* revert posix build job ([#86](https://www.github.com/nodejs/gyp-next/issues/86)) ([39dc34f](https://www.github.com/nodejs/gyp-next/commit/39dc34f0799c074624005fb9bbccf6e028607f9d)) - - -### gyp - -* Remove support for Python 2 ([#88](https://www.github.com/nodejs/gyp-next/issues/88)) ([22e4654](https://www.github.com/nodejs/gyp-next/commit/22e465426fd892403c95534229af819a99c3f8dc)) - -## [0.7.0](https://www.github.com/nodejs/gyp-next/compare/v0.6.2...v0.7.0) (2020-12-17) - - -### ⚠ BREAKING CHANGES - -* **msvs:** On Windows, arguments passed to the "action" commands are no longer transformed to replace slashes with backslashes. - -### Features - -* **xcode:** --cross-compiling overrides arch-specific settings ([973bae0](https://www.github.com/nodejs/gyp-next/commit/973bae0b7b08be7b680ecae9565fbd04b3e0787d)) - - -### Bug Fixes - -* **msvs:** do not fix paths in action command arguments ([fc22f83](https://www.github.com/nodejs/gyp-next/commit/fc22f8335e2016da4aae4f4233074bd651d2faea)) -* cmake on python 3 ([fd61f5f](https://www.github.com/nodejs/gyp-next/commit/fd61f5faa5275ec8fc98e3c7868c0dd46f109540)) -* ValueError: invalid mode: 'rU' while trying to load binding.gyp ([d0504e6](https://www.github.com/nodejs/gyp-next/commit/d0504e6700ce48f44957a4d5891b142a60be946f)) -* xcode cmake parsing ([eefe8d1](https://www.github.com/nodejs/gyp-next/commit/eefe8d10e99863bc4ac7e2ed32facd608d400d4b)) - -### [0.6.2](https://www.github.com/nodejs/gyp-next/compare/v0.6.1...v0.6.2) (2020-10-16) - - -### Bug Fixes - -* do not rewrite absolute paths to avoid long paths ([#74](https://www.github.com/nodejs/gyp-next/issues/74)) ([c2ccc1a](https://www.github.com/nodejs/gyp-next/commit/c2ccc1a81f7f94433a94f4d01a2e820db4c4331a)) -* only include MARMASM when toolset is target ([5a2794a](https://www.github.com/nodejs/gyp-next/commit/5a2794aefb58f0c00404ff042b61740bc8b8d5cd)) - -### [0.6.1](https://github.com/nodejs/gyp-next/compare/v0.6.0...v0.6.1) (2020-10-14) - - -### Bug Fixes - -* Correctly rename object files for absolute paths in MSVS generator. - -## [0.6.0](https://github.com/nodejs/gyp-next/compare/v0.5.0...v0.6.0) (2020-10-13) - - -### Features - -* The Makefile generator will now output shared libraries directly to the product directory on all platforms (previously only macOS). - -## [0.5.0](https://github.com/nodejs/gyp-next/compare/v0.4.0...v0.5.0) (2020-09-30) - - -### Features - -* Extended compile_commands_json generator to consider more file extensions than just `c` and `cc`. `cpp` and `cxx` are now supported. -* Source files with duplicate basenames are now supported. - -### Removed - -* The `--no-duplicate-basename-check` option was removed. -* The `msvs_enable_marmasm` configuration option was removed in favor of auto-inclusion of the "marmasm" sections for Windows on ARM. - -## [0.4.0](https://github.com/nodejs/gyp-next/compare/v0.3.0...v0.4.0) (2020-07-14) - - -### Features - -* Added support for passing arbitrary architectures to Xcode builds, enables `arm64` builds. - -### Bug Fixes - -* Fixed a bug on Solaris where copying archives failed. - -## [0.3.0](https://github.com/nodejs/gyp-next/compare/v0.2.1...v0.3.0) (2020-06-06) - - -### Features - -* Added support for MSVC cross-compilation. This allows compilation on x64 for a Windows ARM target. - -### Bug Fixes - -* Fixed XCode CLT version detection on macOS Catalina. - -### [0.2.1](https://github.com/nodejs/gyp-next/compare/v0.2.0...v0.2.1) (2020-05-05) - - -### Bug Fixes - -* Relicensed to Node.js contributors. -* Fixed Windows bug introduced in v0.2.0. - -## [0.2.0](https://github.com/nodejs/gyp-next/releases/tag/v0.2.0) (2020-04-06) - -This is the first release of this project, based on https://chromium.googlesource.com/external/gyp with changes made over the years in Node.js and node-gyp. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md deleted file mode 100644 index d724027fd..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,4 +0,0 @@ -# Code of Conduct - -* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md) -* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/HEAD/Moderation-Policy.md) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CONTRIBUTING.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CONTRIBUTING.md deleted file mode 100644 index 1a0bcde2b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/CONTRIBUTING.md +++ /dev/null @@ -1,32 +0,0 @@ -# Contributing to gyp-next - -## Code of Conduct - -This project is bound to the [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md). - - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/LICENSE b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/LICENSE deleted file mode 100644 index c6944c5e4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2020 Node.js contributors. All rights reserved. -Copyright (c) 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/README.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/README.md deleted file mode 100644 index 9ffc2b21e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/README.md +++ /dev/null @@ -1,7 +0,0 @@ -GYP can Generate Your Projects. -=================================== - -Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline. - -__gyp-next__ is [released](https://github.com/nodejs/gyp-next/releases) to the [__Python Packaging Index__](https://pypi.org/project/gyp-next) (PyPI) and can be installed with the command: -* `python3 -m pip install gyp-next` diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc deleted file mode 100644 index 8bca51081..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2013 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is used to generate an empty .pdb -- with a 4KB pagesize -- that is -// then used during the final link for modules that have large PDBs. Otherwise, -// the linker will generate a pdb with a page size of 1KB, which imposes a limit -// of 1GB on the .pdb. By generating an initial empty .pdb with the compiler -// (rather than the linker), this limit is avoided. With this in place PDBs may -// grow to 2GB. -// -// This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py. diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp deleted file mode 100755 index 1b8b9bdfb..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Copyright 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -set -e -base=$(dirname "$0") -exec python "${base}/gyp_main.py" "$@" diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp.bat b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp.bat deleted file mode 100755 index c0b4ca24e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp.bat +++ /dev/null @@ -1,5 +0,0 @@ -@rem Copyright (c) 2009 Google Inc. All rights reserved. -@rem Use of this source code is governed by a BSD-style license that can be -@rem found in the LICENSE file. - -@python "%~dp0gyp_main.py" %* diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp_main.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp_main.py deleted file mode 100755 index f23dcdf88..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/gyp_main.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2009 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import sys -import subprocess - - -def IsCygwin(): - # Function copied from pylib/gyp/common.py - try: - out = subprocess.Popen( - "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - stdout, _ = out.communicate() - return "CYGWIN" in stdout.decode("utf-8") - except Exception: - return False - - -def UnixifyPath(path): - try: - if not IsCygwin(): - return path - out = subprocess.Popen( - ["cygpath", "-u", path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - stdout, _ = out.communicate() - return stdout.decode("utf-8") - except Exception: - return path - - -# Make sure we're using the version of pylib in this repo, not one installed -# elsewhere on the system. Also convert to Unix style path on Cygwin systems, -# else the 'gyp' library will not be found -path = UnixifyPath(sys.argv[0]) -sys.path.insert(0, os.path.join(os.path.dirname(path), "pylib")) -import gyp # noqa: E402 - -if __name__ == "__main__": - sys.exit(gyp.script_main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py deleted file mode 100644 index d6b189760..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +++ /dev/null @@ -1,367 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""New implementation of Visual Studio project generation.""" - -import hashlib -import os -import random -from operator import attrgetter - -import gyp.common - - -def cmp(x, y): - return (x > y) - (x < y) - - -# Initialize random number generator -random.seed() - -# GUIDs for project types -ENTRY_TYPE_GUIDS = { - "project": "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", - "folder": "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", -} - -# ------------------------------------------------------------------------------ -# Helper functions - - -def MakeGuid(name, seed="msvs_new"): - """Returns a GUID for the specified target name. - - Args: - name: Target name. - seed: Seed for MD5 hash. - Returns: - A GUID-line string calculated from the name and seed. - - This generates something which looks like a GUID, but depends only on the - name and seed. This means the same name/seed will always generate the same - GUID, so that projects and solutions which refer to each other can explicitly - determine the GUID to refer to explicitly. It also means that the GUID will - not change when the project for a target is rebuilt. - """ - # Calculate a MD5 signature for the seed and name. - d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper() - # Convert most of the signature to GUID form (discard the rest) - guid = ( - "{" - + d[:8] - + "-" - + d[8:12] - + "-" - + d[12:16] - + "-" - + d[16:20] - + "-" - + d[20:32] - + "}" - ) - return guid - - -# ------------------------------------------------------------------------------ - - -class MSVSSolutionEntry: - def __cmp__(self, other): - # Sort by name then guid (so things are in order on vs2008). - return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) - - -class MSVSFolder(MSVSSolutionEntry): - """Folder in a Visual Studio project or solution.""" - - def __init__(self, path, name=None, entries=None, guid=None, items=None): - """Initializes the folder. - - Args: - path: Full path to the folder. - name: Name of the folder. - entries: List of folder entries to nest inside this folder. May contain - Folder or Project objects. May be None, if the folder is empty. - guid: GUID to use for folder, if not None. - items: List of solution items to include in the folder project. May be - None, if the folder does not directly contain items. - """ - if name: - self.name = name - else: - # Use last layer. - self.name = os.path.basename(path) - - self.path = path - self.guid = guid - - # Copy passed lists (or set to empty lists) - self.entries = sorted(entries or [], key=attrgetter("path")) - self.items = list(items or []) - - self.entry_type_guid = ENTRY_TYPE_GUIDS["folder"] - - def get_guid(self): - if self.guid is None: - # Use consistent guids for folders (so things don't regenerate). - self.guid = MakeGuid(self.path, seed="msvs_folder") - return self.guid - - -# ------------------------------------------------------------------------------ - - -class MSVSProject(MSVSSolutionEntry): - """Visual Studio project.""" - - def __init__( - self, - path, - name=None, - dependencies=None, - guid=None, - spec=None, - build_file=None, - config_platform_overrides=None, - fixpath_prefix=None, - ): - """Initializes the project. - - Args: - path: Absolute path to the project file. - name: Name of project. If None, the name will be the same as the base - name of the project file. - dependencies: List of other Project objects this project is dependent - upon, if not None. - guid: GUID to use for project, if not None. - spec: Dictionary specifying how to build this project. - build_file: Filename of the .gyp file that the vcproj file comes from. - config_platform_overrides: optional dict of configuration platforms to - used in place of the default for this target. - fixpath_prefix: the path used to adjust the behavior of _fixpath - """ - self.path = path - self.guid = guid - self.spec = spec - self.build_file = build_file - # Use project filename if name not specified - self.name = name or os.path.splitext(os.path.basename(path))[0] - - # Copy passed lists (or set to empty lists) - self.dependencies = list(dependencies or []) - - self.entry_type_guid = ENTRY_TYPE_GUIDS["project"] - - if config_platform_overrides: - self.config_platform_overrides = config_platform_overrides - else: - self.config_platform_overrides = {} - self.fixpath_prefix = fixpath_prefix - self.msbuild_toolset = None - - def set_dependencies(self, dependencies): - self.dependencies = list(dependencies or []) - - def get_guid(self): - if self.guid is None: - # Set GUID from path - # TODO(rspangler): This is fragile. - # 1. We can't just use the project filename sans path, since there could - # be multiple projects with the same base name (for example, - # foo/unittest.vcproj and bar/unittest.vcproj). - # 2. The path needs to be relative to $SOURCE_ROOT, so that the project - # GUID is the same whether it's included from base/base.sln or - # foo/bar/baz/baz.sln. - # 3. The GUID needs to be the same each time this builder is invoked, so - # that we don't need to rebuild the solution when the project changes. - # 4. We should be able to handle pre-built project files by reading the - # GUID from the files. - self.guid = MakeGuid(self.name) - return self.guid - - def set_msbuild_toolset(self, msbuild_toolset): - self.msbuild_toolset = msbuild_toolset - - -# ------------------------------------------------------------------------------ - - -class MSVSSolution: - """Visual Studio solution.""" - - def __init__( - self, path, version, entries=None, variants=None, websiteProperties=True - ): - """Initializes the solution. - - Args: - path: Path to solution file. - version: Format version to emit. - entries: List of entries in solution. May contain Folder or Project - objects. May be None, if the folder is empty. - variants: List of build variant strings. If none, a default list will - be used. - websiteProperties: Flag to decide if the website properties section - is generated. - """ - self.path = path - self.websiteProperties = websiteProperties - self.version = version - - # Copy passed lists (or set to empty lists) - self.entries = list(entries or []) - - if variants: - # Copy passed list - self.variants = variants[:] - else: - # Use default - self.variants = ["Debug|Win32", "Release|Win32"] - # TODO(rspangler): Need to be able to handle a mapping of solution config - # to project config. Should we be able to handle variants being a dict, - # or add a separate variant_map variable? If it's a dict, we can't - # guarantee the order of variants since dict keys aren't ordered. - - # TODO(rspangler): Automatically write to disk for now; should delay until - # node-evaluation time. - self.Write() - - def Write(self, writer=gyp.common.WriteOnDiff): - """Writes the solution file to disk. - - Raises: - IndexError: An entry appears multiple times. - """ - # Walk the entry tree and collect all the folders and projects. - all_entries = set() - entries_to_check = self.entries[:] - while entries_to_check: - e = entries_to_check.pop(0) - - # If this entry has been visited, nothing to do. - if e in all_entries: - continue - - all_entries.add(e) - - # If this is a folder, check its entries too. - if isinstance(e, MSVSFolder): - entries_to_check += e.entries - - all_entries = sorted(all_entries, key=attrgetter("path")) - - # Open file and print header - f = writer(self.path) - f.write( - "Microsoft Visual Studio Solution File, " - "Format Version %s\r\n" % self.version.SolutionVersion() - ) - f.write("# %s\r\n" % self.version.Description()) - - # Project entries - sln_root = os.path.split(self.path)[0] - for e in all_entries: - relative_path = gyp.common.RelativePath(e.path, sln_root) - # msbuild does not accept an empty folder_name. - # use '.' in case relative_path is empty. - folder_name = relative_path.replace("/", "\\") or "." - f.write( - 'Project("%s") = "%s", "%s", "%s"\r\n' - % ( - e.entry_type_guid, # Entry type GUID - e.name, # Folder name - folder_name, # Folder name (again) - e.get_guid(), # Entry GUID - ) - ) - - # TODO(rspangler): Need a way to configure this stuff - if self.websiteProperties: - f.write( - "\tProjectSection(WebsiteProperties) = preProject\r\n" - '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' - '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' - "\tEndProjectSection\r\n" - ) - - if isinstance(e, MSVSFolder): - if e.items: - f.write("\tProjectSection(SolutionItems) = preProject\r\n") - for i in e.items: - f.write(f"\t\t{i} = {i}\r\n") - f.write("\tEndProjectSection\r\n") - - if isinstance(e, MSVSProject): - if e.dependencies: - f.write("\tProjectSection(ProjectDependencies) = postProject\r\n") - for d in e.dependencies: - f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n") - f.write("\tEndProjectSection\r\n") - - f.write("EndProject\r\n") - - # Global section - f.write("Global\r\n") - - # Configurations (variants) - f.write("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n") - for v in self.variants: - f.write(f"\t\t{v} = {v}\r\n") - f.write("\tEndGlobalSection\r\n") - - # Sort config guids for easier diffing of solution changes. - config_guids = [] - config_guids_overrides = {} - for e in all_entries: - if isinstance(e, MSVSProject): - config_guids.append(e.get_guid()) - config_guids_overrides[e.get_guid()] = e.config_platform_overrides - config_guids.sort() - - f.write("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n") - for g in config_guids: - for v in self.variants: - nv = config_guids_overrides[g].get(v, v) - # Pick which project configuration to build for this solution - # configuration. - f.write( - "\t\t%s.%s.ActiveCfg = %s\r\n" - % ( - g, # Project GUID - v, # Solution build configuration - nv, # Project build config for that solution config - ) - ) - - # Enable project in this solution configuration. - f.write( - "\t\t%s.%s.Build.0 = %s\r\n" - % ( - g, # Project GUID - v, # Solution build configuration - nv, # Project build config for that solution config - ) - ) - f.write("\tEndGlobalSection\r\n") - - # TODO(rspangler): Should be able to configure this stuff too (though I've - # never seen this be any different) - f.write("\tGlobalSection(SolutionProperties) = preSolution\r\n") - f.write("\t\tHideSolutionNode = FALSE\r\n") - f.write("\tEndGlobalSection\r\n") - - # Folder mappings - # Omit this section if there are no folders - if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): - f.write("\tGlobalSection(NestedProjects) = preSolution\r\n") - for e in all_entries: - if not isinstance(e, MSVSFolder): - continue # Does not apply to projects, only folders - for subentry in e.entries: - f.write(f"\t\t{subentry.get_guid()} = {e.get_guid()}\r\n") - f.write("\tEndGlobalSection\r\n") - - f.write("EndGlobal\r\n") - - f.close() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py deleted file mode 100644 index f0cfabe83..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Visual Studio project reader/writer.""" - -import gyp.easy_xml as easy_xml - -# ------------------------------------------------------------------------------ - - -class Tool: - """Visual Studio tool.""" - - def __init__(self, name, attrs=None): - """Initializes the tool. - - Args: - name: Tool name. - attrs: Dict of tool attributes; may be None. - """ - self._attrs = attrs or {} - self._attrs["Name"] = name - - def _GetSpecification(self): - """Creates an element for the tool. - - Returns: - A new xml.dom.Element for the tool. - """ - return ["Tool", self._attrs] - - -class Filter: - """Visual Studio filter - that is, a virtual folder.""" - - def __init__(self, name, contents=None): - """Initializes the folder. - - Args: - name: Filter (folder) name. - contents: List of filenames and/or Filter objects contained. - """ - self.name = name - self.contents = list(contents or []) - - -# ------------------------------------------------------------------------------ - - -class Writer: - """Visual Studio XML project writer.""" - - def __init__(self, project_path, version, name, guid=None, platforms=None): - """Initializes the project. - - Args: - project_path: Path to the project file. - version: Format version to emit. - name: Name of the project. - guid: GUID to use for project, if not None. - platforms: Array of string, the supported platforms. If null, ['Win32'] - """ - self.project_path = project_path - self.version = version - self.name = name - self.guid = guid - - # Default to Win32 for platforms. - if not platforms: - platforms = ["Win32"] - - # Initialize the specifications of the various sections. - self.platform_section = ["Platforms"] - for platform in platforms: - self.platform_section.append(["Platform", {"Name": platform}]) - self.tool_files_section = ["ToolFiles"] - self.configurations_section = ["Configurations"] - self.files_section = ["Files"] - - # Keep a dict keyed on filename to speed up access. - self.files_dict = dict() - - def AddToolFile(self, path): - """Adds a tool file to the project. - - Args: - path: Relative path from project to tool file. - """ - self.tool_files_section.append(["ToolFile", {"RelativePath": path}]) - - def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): - """Returns the specification for a configuration. - - Args: - config_type: Type of configuration node. - config_name: Configuration name. - attrs: Dict of configuration attributes; may be None. - tools: List of tools (strings or Tool objects); may be None. - Returns: - """ - # Handle defaults - if not attrs: - attrs = {} - if not tools: - tools = [] - - # Add configuration node and its attributes - node_attrs = attrs.copy() - node_attrs["Name"] = config_name - specification = [config_type, node_attrs] - - # Add tool nodes and their attributes - if tools: - for t in tools: - if isinstance(t, Tool): - specification.append(t._GetSpecification()) - else: - specification.append(Tool(t)._GetSpecification()) - return specification - - def AddConfig(self, name, attrs=None, tools=None): - """Adds a configuration to the project. - - Args: - name: Configuration name. - attrs: Dict of configuration attributes; may be None. - tools: List of tools (strings or Tool objects); may be None. - """ - spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools) - self.configurations_section.append(spec) - - def _AddFilesToNode(self, parent, files): - """Adds files and/or filters to the parent node. - - Args: - parent: Destination node - files: A list of Filter objects and/or relative paths to files. - - Will call itself recursively, if the files list contains Filter objects. - """ - for f in files: - if isinstance(f, Filter): - node = ["Filter", {"Name": f.name}] - self._AddFilesToNode(node, f.contents) - else: - node = ["File", {"RelativePath": f}] - self.files_dict[f] = node - parent.append(node) - - def AddFiles(self, files): - """Adds files to the project. - - Args: - files: A list of Filter objects and/or relative paths to files. - - This makes a copy of the file/filter tree at the time of this call. If you - later add files to a Filter object which was passed into a previous call - to AddFiles(), it will not be reflected in this project. - """ - self._AddFilesToNode(self.files_section, files) - # TODO(rspangler) This also doesn't handle adding files to an existing - # filter. That is, it doesn't merge the trees. - - def AddFileConfig(self, path, config, attrs=None, tools=None): - """Adds a configuration to a file. - - Args: - path: Relative path to the file. - config: Name of configuration to add. - attrs: Dict of configuration attributes; may be None. - tools: List of tools (strings or Tool objects); may be None. - - Raises: - ValueError: Relative path does not match any file added via AddFiles(). - """ - # Find the file node with the right relative path - parent = self.files_dict.get(path) - if not parent: - raise ValueError('AddFileConfig: file "%s" not in project.' % path) - - # Add the config to the file node - spec = self._GetSpecForConfiguration("FileConfiguration", config, attrs, tools) - parent.append(spec) - - def WriteIfChanged(self): - """Writes the project file.""" - # First create XML content definition - content = [ - "VisualStudioProject", - { - "ProjectType": "Visual C++", - "Version": self.version.ProjectVersion(), - "Name": self.name, - "ProjectGUID": self.guid, - "RootNamespace": self.name, - "Keyword": "Win32Proj", - }, - self.platform_section, - self.tool_files_section, - self.configurations_section, - ["References"], # empty section - self.files_section, - ["Globals"], # empty section - ] - easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252") diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py deleted file mode 100644 index e89a971a3..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +++ /dev/null @@ -1,1270 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -r"""Code to validate and convert settings of the Microsoft build tools. - -This file contains code to validate and convert settings of the Microsoft -build tools. The function ConvertToMSBuildSettings(), ValidateMSVSSettings(), -and ValidateMSBuildSettings() are the entry points. - -This file was created by comparing the projects created by Visual Studio 2008 -and Visual Studio 2010 for all available settings through the user interface. -The MSBuild schemas were also considered. They are typically found in the -MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild -""" - -import re -import sys - -# Dictionaries of settings validators. The key is the tool name, the value is -# a dictionary mapping setting names to validation functions. -_msvs_validators = {} -_msbuild_validators = {} - - -# A dictionary of settings converters. The key is the tool name, the value is -# a dictionary mapping setting names to conversion functions. -_msvs_to_msbuild_converters = {} - - -# Tool name mapping from MSVS to MSBuild. -_msbuild_name_of_tool = {} - - -class _Tool: - """Represents a tool used by MSVS or MSBuild. - - Attributes: - msvs_name: The name of the tool in MSVS. - msbuild_name: The name of the tool in MSBuild. - """ - - def __init__(self, msvs_name, msbuild_name): - self.msvs_name = msvs_name - self.msbuild_name = msbuild_name - - -def _AddTool(tool): - """Adds a tool to the four dictionaries used to process settings. - - This only defines the tool. Each setting also needs to be added. - - Args: - tool: The _Tool object to be added. - """ - _msvs_validators[tool.msvs_name] = {} - _msbuild_validators[tool.msbuild_name] = {} - _msvs_to_msbuild_converters[tool.msvs_name] = {} - _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name - - -def _GetMSBuildToolSettings(msbuild_settings, tool): - """Returns an MSBuild tool dictionary. Creates it if needed.""" - return msbuild_settings.setdefault(tool.msbuild_name, {}) - - -class _Type: - """Type of settings (Base class).""" - - def ValidateMSVS(self, value): - """Verifies that the value is legal for MSVS. - - Args: - value: the value to check for this type. - - Raises: - ValueError if value is not valid for MSVS. - """ - - def ValidateMSBuild(self, value): - """Verifies that the value is legal for MSBuild. - - Args: - value: the value to check for this type. - - Raises: - ValueError if value is not valid for MSBuild. - """ - - def ConvertToMSBuild(self, value): - """Returns the MSBuild equivalent of the MSVS value given. - - Args: - value: the MSVS value to convert. - - Returns: - the MSBuild equivalent. - - Raises: - ValueError if value is not valid. - """ - return value - - -class _String(_Type): - """A setting that's just a string.""" - - def ValidateMSVS(self, value): - if not isinstance(value, str): - raise ValueError("expected string; got %r" % value) - - def ValidateMSBuild(self, value): - if not isinstance(value, str): - raise ValueError("expected string; got %r" % value) - - def ConvertToMSBuild(self, value): - # Convert the macros - return ConvertVCMacrosToMSBuild(value) - - -class _StringList(_Type): - """A settings that's a list of strings.""" - - def ValidateMSVS(self, value): - if not isinstance(value, (list, str)): - raise ValueError("expected string list; got %r" % value) - - def ValidateMSBuild(self, value): - if not isinstance(value, (list, str)): - raise ValueError("expected string list; got %r" % value) - - def ConvertToMSBuild(self, value): - # Convert the macros - if isinstance(value, list): - return [ConvertVCMacrosToMSBuild(i) for i in value] - else: - return ConvertVCMacrosToMSBuild(value) - - -class _Boolean(_Type): - """Boolean settings, can have the values 'false' or 'true'.""" - - def _Validate(self, value): - if value != "true" and value != "false": - raise ValueError("expected bool; got %r" % value) - - def ValidateMSVS(self, value): - self._Validate(value) - - def ValidateMSBuild(self, value): - self._Validate(value) - - def ConvertToMSBuild(self, value): - self._Validate(value) - return value - - -class _Integer(_Type): - """Integer settings.""" - - def __init__(self, msbuild_base=10): - _Type.__init__(self) - self._msbuild_base = msbuild_base - - def ValidateMSVS(self, value): - # Try to convert, this will raise ValueError if invalid. - self.ConvertToMSBuild(value) - - def ValidateMSBuild(self, value): - # Try to convert, this will raise ValueError if invalid. - int(value, self._msbuild_base) - - def ConvertToMSBuild(self, value): - msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x" - return msbuild_format % int(value) - - -class _Enumeration(_Type): - """Type of settings that is an enumeration. - - In MSVS, the values are indexes like '0', '1', and '2'. - MSBuild uses text labels that are more representative, like 'Win32'. - - Constructor args: - label_list: an array of MSBuild labels that correspond to the MSVS index. - In the rare cases where MSVS has skipped an index value, None is - used in the array to indicate the unused spot. - new: an array of labels that are new to MSBuild. - """ - - def __init__(self, label_list, new=None): - _Type.__init__(self) - self._label_list = label_list - self._msbuild_values = {value for value in label_list if value is not None} - if new is not None: - self._msbuild_values.update(new) - - def ValidateMSVS(self, value): - # Try to convert. It will raise an exception if not valid. - self.ConvertToMSBuild(value) - - def ValidateMSBuild(self, value): - if value not in self._msbuild_values: - raise ValueError("unrecognized enumerated value %s" % value) - - def ConvertToMSBuild(self, value): - index = int(value) - if index < 0 or index >= len(self._label_list): - raise ValueError( - "index value (%d) not in expected range [0, %d)" - % (index, len(self._label_list)) - ) - label = self._label_list[index] - if label is None: - raise ValueError("converted value for %s not specified." % value) - return label - - -# Instantiate the various generic types. -_boolean = _Boolean() -_integer = _Integer() -# For now, we don't do any special validation on these types: -_string = _String() -_file_name = _String() -_folder_name = _String() -_file_list = _StringList() -_folder_list = _StringList() -_string_list = _StringList() -# Some boolean settings went from numerical values to boolean. The -# mapping is 0: default, 1: false, 2: true. -_newly_boolean = _Enumeration(["", "false", "true"]) - - -def _Same(tool, name, setting_type): - """Defines a setting that has the same name in MSVS and MSBuild. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - name: the name of the setting. - setting_type: the type of this setting. - """ - _Renamed(tool, name, name, setting_type) - - -def _Renamed(tool, msvs_name, msbuild_name, setting_type): - """Defines a setting for which the name has changed. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - msvs_name: the name of the MSVS setting. - msbuild_name: the name of the MSBuild setting. - setting_type: the type of this setting. - """ - - def _Translate(value, msbuild_settings): - msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value) - - _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS - _msbuild_validators[tool.msbuild_name][msbuild_name] = setting_type.ValidateMSBuild - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -def _Moved(tool, settings_name, msbuild_tool_name, setting_type): - _MovedAndRenamed( - tool, settings_name, msbuild_tool_name, settings_name, setting_type - ) - - -def _MovedAndRenamed( - tool, msvs_settings_name, msbuild_tool_name, msbuild_settings_name, setting_type -): - """Defines a setting that may have moved to a new section. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - msvs_settings_name: the MSVS name of the setting. - msbuild_tool_name: the name of the MSBuild tool to place the setting under. - msbuild_settings_name: the MSBuild name of the setting. - setting_type: the type of this setting. - """ - - def _Translate(value, msbuild_settings): - tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {}) - tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value) - - _msvs_validators[tool.msvs_name][msvs_settings_name] = setting_type.ValidateMSVS - validator = setting_type.ValidateMSBuild - _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator - _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate - - -def _MSVSOnly(tool, name, setting_type): - """Defines a setting that is only found in MSVS. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - name: the name of the setting. - setting_type: the type of this setting. - """ - - def _Translate(unused_value, unused_msbuild_settings): - # Since this is for MSVS only settings, no translation will happen. - pass - - _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS - _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate - - -def _MSBuildOnly(tool, name, setting_type): - """Defines a setting that is only found in MSBuild. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - name: the name of the setting. - setting_type: the type of this setting. - """ - - def _Translate(value, msbuild_settings): - # Let msbuild-only properties get translated as-is from msvs_settings. - tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {}) - tool_settings[name] = value - - _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild - _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate - - -def _ConvertedToAdditionalOption(tool, msvs_name, flag): - """Defines a setting that's handled via a command line option in MSBuild. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - msvs_name: the name of the MSVS setting that if 'true' becomes a flag - flag: the flag to insert at the end of the AdditionalOptions - """ - - def _Translate(value, msbuild_settings): - if value == "true": - tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - if "AdditionalOptions" in tool_settings: - new_flags = "{} {}".format(tool_settings["AdditionalOptions"], flag) - else: - new_flags = flag - tool_settings["AdditionalOptions"] = new_flags - - _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -def _CustomGeneratePreprocessedFile(tool, msvs_name): - def _Translate(value, msbuild_settings): - tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - if value == "0": - tool_settings["PreprocessToFile"] = "false" - tool_settings["PreprocessSuppressLineNumbers"] = "false" - elif value == "1": # /P - tool_settings["PreprocessToFile"] = "true" - tool_settings["PreprocessSuppressLineNumbers"] = "false" - elif value == "2": # /EP /P - tool_settings["PreprocessToFile"] = "true" - tool_settings["PreprocessSuppressLineNumbers"] = "true" - else: - raise ValueError("value must be one of [0, 1, 2]; got %s" % value) - - # Create a bogus validator that looks for '0', '1', or '2' - msvs_validator = _Enumeration(["a", "b", "c"]).ValidateMSVS - _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator - msbuild_validator = _boolean.ValidateMSBuild - msbuild_tool_validators = _msbuild_validators[tool.msbuild_name] - msbuild_tool_validators["PreprocessToFile"] = msbuild_validator - msbuild_tool_validators["PreprocessSuppressLineNumbers"] = msbuild_validator - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -fix_vc_macro_slashes_regex_list = ("IntDir", "OutDir") -fix_vc_macro_slashes_regex = re.compile( - r"(\$\((?:%s)\))(?:[\\/]+)" % "|".join(fix_vc_macro_slashes_regex_list) -) - -# Regular expression to detect keys that were generated by exclusion lists -_EXCLUDED_SUFFIX_RE = re.compile("^(.*)_excluded$") - - -def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr): - """Verify that 'setting' is valid if it is generated from an exclusion list. - - If the setting appears to be generated from an exclusion list, the root name - is checked. - - Args: - setting: A string that is the setting name to validate - settings: A dictionary where the keys are valid settings - error_msg: The message to emit in the event of error - stderr: The stream receiving the error messages. - """ - # This may be unrecognized because it's an exclusion list. If the - # setting name has the _excluded suffix, then check the root name. - unrecognized = True - m = re.match(_EXCLUDED_SUFFIX_RE, setting) - if m: - root_setting = m.group(1) - unrecognized = root_setting not in settings - - if unrecognized: - # We don't know this setting. Give a warning. - print(error_msg, file=stderr) - - -def FixVCMacroSlashes(s): - """Replace macros which have excessive following slashes. - - These macros are known to have a built-in trailing slash. Furthermore, many - scripts hiccup on processing paths with extra slashes in the middle. - - This list is probably not exhaustive. Add as needed. - """ - if "$" in s: - s = fix_vc_macro_slashes_regex.sub(r"\1", s) - return s - - -def ConvertVCMacrosToMSBuild(s): - """Convert the MSVS macros found in the string to the MSBuild equivalent. - - This list is probably not exhaustive. Add as needed. - """ - if "$" in s: - replace_map = { - "$(ConfigurationName)": "$(Configuration)", - "$(InputDir)": "%(RelativeDir)", - "$(InputExt)": "%(Extension)", - "$(InputFileName)": "%(Filename)%(Extension)", - "$(InputName)": "%(Filename)", - "$(InputPath)": "%(Identity)", - "$(ParentName)": "$(ProjectFileName)", - "$(PlatformName)": "$(Platform)", - "$(SafeInputName)": "%(Filename)", - } - for old, new in replace_map.items(): - s = s.replace(old, new) - s = FixVCMacroSlashes(s) - return s - - -def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr): - """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). - - Args: - msvs_settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - - Returns: - A dictionary of MSBuild settings. The key is either the MSBuild tool name - or the empty string (for the global settings). The values are themselves - dictionaries of settings and their values. - """ - msbuild_settings = {} - for msvs_tool_name, msvs_tool_settings in msvs_settings.items(): - if msvs_tool_name in _msvs_to_msbuild_converters: - msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name] - for msvs_setting, msvs_value in msvs_tool_settings.items(): - if msvs_setting in msvs_tool: - # Invoke the translation function. - try: - msvs_tool[msvs_setting](msvs_value, msbuild_settings) - except ValueError as e: - print( - "Warning: while converting %s/%s to MSBuild, " - "%s" % (msvs_tool_name, msvs_setting, e), - file=stderr, - ) - else: - _ValidateExclusionSetting( - msvs_setting, - msvs_tool, - ( - "Warning: unrecognized setting %s/%s " - "while converting to MSBuild." - % (msvs_tool_name, msvs_setting) - ), - stderr, - ) - else: - print( - "Warning: unrecognized tool %s while converting to " - "MSBuild." % msvs_tool_name, - file=stderr, - ) - return msbuild_settings - - -def ValidateMSVSSettings(settings, stderr=sys.stderr): - """Validates that the names of the settings are valid for MSVS. - - Args: - settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - """ - _ValidateSettings(_msvs_validators, settings, stderr) - - -def ValidateMSBuildSettings(settings, stderr=sys.stderr): - """Validates that the names of the settings are valid for MSBuild. - - Args: - settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - """ - _ValidateSettings(_msbuild_validators, settings, stderr) - - -def _ValidateSettings(validators, settings, stderr): - """Validates that the settings are valid for MSBuild or MSVS. - - We currently only validate the names of the settings, not their values. - - Args: - validators: A dictionary of tools and their validators. - settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - """ - for tool_name in settings: - if tool_name in validators: - tool_validators = validators[tool_name] - for setting, value in settings[tool_name].items(): - if setting in tool_validators: - try: - tool_validators[setting](value) - except ValueError as e: - print( - f"Warning: for {tool_name}/{setting}, {e}", - file=stderr, - ) - else: - _ValidateExclusionSetting( - setting, - tool_validators, - (f"Warning: unrecognized setting {tool_name}/{setting}"), - stderr, - ) - - else: - print("Warning: unrecognized tool %s" % (tool_name), file=stderr) - - -# MSVS and MBuild names of the tools. -_compile = _Tool("VCCLCompilerTool", "ClCompile") -_link = _Tool("VCLinkerTool", "Link") -_midl = _Tool("VCMIDLTool", "Midl") -_rc = _Tool("VCResourceCompilerTool", "ResourceCompile") -_lib = _Tool("VCLibrarianTool", "Lib") -_manifest = _Tool("VCManifestTool", "Manifest") -_masm = _Tool("MASM", "MASM") -_armasm = _Tool("ARMASM", "ARMASM") - - -_AddTool(_compile) -_AddTool(_link) -_AddTool(_midl) -_AddTool(_rc) -_AddTool(_lib) -_AddTool(_manifest) -_AddTool(_masm) -_AddTool(_armasm) -# Add sections only found in the MSBuild settings. -_msbuild_validators[""] = {} -_msbuild_validators["ProjectReference"] = {} -_msbuild_validators["ManifestResourceCompile"] = {} - -# Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and -# ClCompile in MSBuild. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\cl.xml" for -# the schema of the MSBuild ClCompile settings. - -# Options that have the same name in MSVS and MSBuild -_Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I -_Same(_compile, "AdditionalOptions", _string_list) -_Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI -_Same(_compile, "AssemblerListingLocation", _file_name) # /Fa -_Same(_compile, "BrowseInformationFile", _file_name) -_Same(_compile, "BufferSecurityCheck", _boolean) # /GS -_Same(_compile, "DisableLanguageExtensions", _boolean) # /Za -_Same(_compile, "DisableSpecificWarnings", _string_list) # /wd -_Same(_compile, "EnableFiberSafeOptimizations", _boolean) # /GT -_Same(_compile, "EnablePREfast", _boolean) # /analyze Visible='false' -_Same(_compile, "ExpandAttributedSource", _boolean) # /Fx -_Same(_compile, "FloatingPointExceptions", _boolean) # /fp:except -_Same(_compile, "ForceConformanceInForLoopScope", _boolean) # /Zc:forScope -_Same(_compile, "ForcedIncludeFiles", _file_list) # /FI -_Same(_compile, "ForcedUsingFiles", _file_list) # /FU -_Same(_compile, "GenerateXMLDocumentationFiles", _boolean) # /doc -_Same(_compile, "IgnoreStandardIncludePath", _boolean) # /X -_Same(_compile, "MinimalRebuild", _boolean) # /Gm -_Same(_compile, "OmitDefaultLibName", _boolean) # /Zl -_Same(_compile, "OmitFramePointers", _boolean) # /Oy -_Same(_compile, "PreprocessorDefinitions", _string_list) # /D -_Same(_compile, "ProgramDataBaseFileName", _file_name) # /Fd -_Same(_compile, "RuntimeTypeInfo", _boolean) # /GR -_Same(_compile, "ShowIncludes", _boolean) # /showIncludes -_Same(_compile, "SmallerTypeCheck", _boolean) # /RTCc -_Same(_compile, "StringPooling", _boolean) # /GF -_Same(_compile, "SuppressStartupBanner", _boolean) # /nologo -_Same(_compile, "TreatWChar_tAsBuiltInType", _boolean) # /Zc:wchar_t -_Same(_compile, "UndefineAllPreprocessorDefinitions", _boolean) # /u -_Same(_compile, "UndefinePreprocessorDefinitions", _string_list) # /U -_Same(_compile, "UseFullPaths", _boolean) # /FC -_Same(_compile, "WholeProgramOptimization", _boolean) # /GL -_Same(_compile, "XMLDocumentationFileName", _file_name) -_Same(_compile, "CompileAsWinRT", _boolean) # /ZW - -_Same( - _compile, - "AssemblerOutput", - _Enumeration( - [ - "NoListing", - "AssemblyCode", # /FA - "All", # /FAcs - "AssemblyAndMachineCode", # /FAc - "AssemblyAndSourceCode", - ] - ), -) # /FAs -_Same( - _compile, - "BasicRuntimeChecks", - _Enumeration( - [ - "Default", - "StackFrameRuntimeCheck", # /RTCs - "UninitializedLocalUsageCheck", # /RTCu - "EnableFastChecks", - ] - ), -) # /RTC1 -_Same( - _compile, "BrowseInformation", _Enumeration(["false", "true", "true"]) # /FR -) # /Fr -_Same( - _compile, - "CallingConvention", - _Enumeration(["Cdecl", "FastCall", "StdCall", "VectorCall"]), # /Gd # /Gr # /Gz -) # /Gv -_Same( - _compile, - "CompileAs", - _Enumeration(["Default", "CompileAsC", "CompileAsCpp"]), # /TC -) # /TP -_Same( - _compile, - "DebugInformationFormat", - _Enumeration( - [ - "", # Disabled - "OldStyle", # /Z7 - None, - "ProgramDatabase", # /Zi - "EditAndContinue", - ] - ), -) # /ZI -_Same( - _compile, - "EnableEnhancedInstructionSet", - _Enumeration( - [ - "NotSet", - "StreamingSIMDExtensions", # /arch:SSE - "StreamingSIMDExtensions2", # /arch:SSE2 - "AdvancedVectorExtensions", # /arch:AVX (vs2012+) - "NoExtensions", # /arch:IA32 (vs2012+) - # This one only exists in the new msbuild format. - "AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+) - ] - ), -) -_Same( - _compile, - "ErrorReporting", - _Enumeration( - [ - "None", # /errorReport:none - "Prompt", # /errorReport:prompt - "Queue", - ], # /errorReport:queue - new=["Send"], - ), -) # /errorReport:send" -_Same( - _compile, - "ExceptionHandling", - _Enumeration(["false", "Sync", "Async"], new=["SyncCThrow"]), # /EHsc # /EHa -) # /EHs -_Same( - _compile, "FavorSizeOrSpeed", _Enumeration(["Neither", "Speed", "Size"]) # /Ot -) # /Os -_Same( - _compile, - "FloatingPointModel", - _Enumeration(["Precise", "Strict", "Fast"]), # /fp:precise # /fp:strict -) # /fp:fast -_Same( - _compile, - "InlineFunctionExpansion", - _Enumeration( - ["Default", "OnlyExplicitInline", "AnySuitable"], # /Ob1 # /Ob2 - new=["Disabled"], - ), -) # /Ob0 -_Same( - _compile, - "Optimization", - _Enumeration(["Disabled", "MinSpace", "MaxSpeed", "Full"]), # /Od # /O1 # /O2 -) # /Ox -_Same( - _compile, - "RuntimeLibrary", - _Enumeration( - [ - "MultiThreaded", # /MT - "MultiThreadedDebug", # /MTd - "MultiThreadedDLL", # /MD - "MultiThreadedDebugDLL", - ] - ), -) # /MDd -_Same( - _compile, - "StructMemberAlignment", - _Enumeration( - [ - "Default", - "1Byte", # /Zp1 - "2Bytes", # /Zp2 - "4Bytes", # /Zp4 - "8Bytes", # /Zp8 - "16Bytes", - ] - ), -) # /Zp16 -_Same( - _compile, - "WarningLevel", - _Enumeration( - [ - "TurnOffAllWarnings", # /W0 - "Level1", # /W1 - "Level2", # /W2 - "Level3", # /W3 - "Level4", - ], # /W4 - new=["EnableAllWarnings"], - ), -) # /Wall - -# Options found in MSVS that have been renamed in MSBuild. -_Renamed( - _compile, "EnableFunctionLevelLinking", "FunctionLevelLinking", _boolean -) # /Gy -_Renamed(_compile, "EnableIntrinsicFunctions", "IntrinsicFunctions", _boolean) # /Oi -_Renamed(_compile, "KeepComments", "PreprocessKeepComments", _boolean) # /C -_Renamed(_compile, "ObjectFile", "ObjectFileName", _file_name) # /Fo -_Renamed(_compile, "OpenMP", "OpenMPSupport", _boolean) # /openmp -_Renamed( - _compile, "PrecompiledHeaderThrough", "PrecompiledHeaderFile", _file_name -) # Used with /Yc and /Yu -_Renamed( - _compile, "PrecompiledHeaderFile", "PrecompiledHeaderOutputFile", _file_name -) # /Fp -_Renamed( - _compile, - "UsePrecompiledHeader", - "PrecompiledHeader", - _Enumeration( - ["NotUsing", "Create", "Use"] # VS recognized '' for this value too. # /Yc - ), -) # /Yu -_Renamed(_compile, "WarnAsError", "TreatWarningAsError", _boolean) # /WX - -_ConvertedToAdditionalOption(_compile, "DefaultCharIsUnsigned", "/J") - -# MSVS options not found in MSBuild. -_MSVSOnly(_compile, "Detect64BitPortabilityProblems", _boolean) -_MSVSOnly(_compile, "UseUnicodeResponseFiles", _boolean) - -# MSBuild options not found in MSVS. -_MSBuildOnly(_compile, "BuildingInIDE", _boolean) -_MSBuildOnly( - _compile, "CompileAsManaged", _Enumeration([], new=["false", "true"]) -) # /clr -_MSBuildOnly(_compile, "CreateHotpatchableImage", _boolean) # /hotpatch -_MSBuildOnly(_compile, "MultiProcessorCompilation", _boolean) # /MP -_MSBuildOnly(_compile, "PreprocessOutputPath", _string) # /Fi -_MSBuildOnly(_compile, "ProcessorNumber", _integer) # the number of processors -_MSBuildOnly(_compile, "TrackerLogDirectory", _folder_name) -_MSBuildOnly(_compile, "TreatSpecificWarningsAsErrors", _string_list) # /we -_MSBuildOnly(_compile, "UseUnicodeForAssemblerListing", _boolean) # /FAu - -# Defines a setting that needs very customized processing -_CustomGeneratePreprocessedFile(_compile, "GeneratePreprocessedFile") - - -# Directives for converting MSVS VCLinkerTool to MSBuild Link. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\link.xml" for -# the schema of the MSBuild Link settings. - -# Options that have the same name in MSVS and MSBuild -_Same(_link, "AdditionalDependencies", _file_list) -_Same(_link, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH -# /MANIFESTDEPENDENCY: -_Same(_link, "AdditionalManifestDependencies", _file_list) -_Same(_link, "AdditionalOptions", _string_list) -_Same(_link, "AddModuleNamesToAssembly", _file_list) # /ASSEMBLYMODULE -_Same(_link, "AllowIsolation", _boolean) # /ALLOWISOLATION -_Same(_link, "AssemblyLinkResource", _file_list) # /ASSEMBLYLINKRESOURCE -_Same(_link, "BaseAddress", _string) # /BASE -_Same(_link, "CLRUnmanagedCodeCheck", _boolean) # /CLRUNMANAGEDCODECHECK -_Same(_link, "DelayLoadDLLs", _file_list) # /DELAYLOAD -_Same(_link, "DelaySign", _boolean) # /DELAYSIGN -_Same(_link, "EmbedManagedResourceFile", _file_list) # /ASSEMBLYRESOURCE -_Same(_link, "EnableUAC", _boolean) # /MANIFESTUAC -_Same(_link, "EntryPointSymbol", _string) # /ENTRY -_Same(_link, "ForceSymbolReferences", _file_list) # /INCLUDE -_Same(_link, "FunctionOrder", _file_name) # /ORDER -_Same(_link, "GenerateDebugInformation", _boolean) # /DEBUG -_Same(_link, "GenerateMapFile", _boolean) # /MAP -_Same(_link, "HeapCommitSize", _string) -_Same(_link, "HeapReserveSize", _string) # /HEAP -_Same(_link, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB -_Same(_link, "IgnoreEmbeddedIDL", _boolean) # /IGNOREIDL -_Same(_link, "ImportLibrary", _file_name) # /IMPLIB -_Same(_link, "KeyContainer", _file_name) # /KEYCONTAINER -_Same(_link, "KeyFile", _file_name) # /KEYFILE -_Same(_link, "ManifestFile", _file_name) # /ManifestFile -_Same(_link, "MapExports", _boolean) # /MAPINFO:EXPORTS -_Same(_link, "MapFileName", _file_name) -_Same(_link, "MergedIDLBaseFileName", _file_name) # /IDLOUT -_Same(_link, "MergeSections", _string) # /MERGE -_Same(_link, "MidlCommandFile", _file_name) # /MIDL -_Same(_link, "ModuleDefinitionFile", _file_name) # /DEF -_Same(_link, "OutputFile", _file_name) # /OUT -_Same(_link, "PerUserRedirection", _boolean) -_Same(_link, "Profile", _boolean) # /PROFILE -_Same(_link, "ProfileGuidedDatabase", _file_name) # /PGD -_Same(_link, "ProgramDatabaseFile", _file_name) # /PDB -_Same(_link, "RegisterOutput", _boolean) -_Same(_link, "SetChecksum", _boolean) # /RELEASE -_Same(_link, "StackCommitSize", _string) -_Same(_link, "StackReserveSize", _string) # /STACK -_Same(_link, "StripPrivateSymbols", _file_name) # /PDBSTRIPPED -_Same(_link, "SupportUnloadOfDelayLoadedDLL", _boolean) # /DELAY:UNLOAD -_Same(_link, "SuppressStartupBanner", _boolean) # /NOLOGO -_Same(_link, "SwapRunFromCD", _boolean) # /SWAPRUN:CD -_Same(_link, "TurnOffAssemblyGeneration", _boolean) # /NOASSEMBLY -_Same(_link, "TypeLibraryFile", _file_name) # /TLBOUT -_Same(_link, "TypeLibraryResourceID", _integer) # /TLBID -_Same(_link, "UACUIAccess", _boolean) # /uiAccess='true' -_Same(_link, "Version", _string) # /VERSION - -_Same(_link, "EnableCOMDATFolding", _newly_boolean) # /OPT:ICF -_Same(_link, "FixedBaseAddress", _newly_boolean) # /FIXED -_Same(_link, "LargeAddressAware", _newly_boolean) # /LARGEADDRESSAWARE -_Same(_link, "OptimizeReferences", _newly_boolean) # /OPT:REF -_Same(_link, "RandomizedBaseAddress", _newly_boolean) # /DYNAMICBASE -_Same(_link, "TerminalServerAware", _newly_boolean) # /TSAWARE - -_subsystem_enumeration = _Enumeration( - [ - "NotSet", - "Console", # /SUBSYSTEM:CONSOLE - "Windows", # /SUBSYSTEM:WINDOWS - "Native", # /SUBSYSTEM:NATIVE - "EFI Application", # /SUBSYSTEM:EFI_APPLICATION - "EFI Boot Service Driver", # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER - "EFI ROM", # /SUBSYSTEM:EFI_ROM - "EFI Runtime", # /SUBSYSTEM:EFI_RUNTIME_DRIVER - "WindowsCE", - ], # /SUBSYSTEM:WINDOWSCE - new=["POSIX"], -) # /SUBSYSTEM:POSIX - -_target_machine_enumeration = _Enumeration( - [ - "NotSet", - "MachineX86", # /MACHINE:X86 - None, - "MachineARM", # /MACHINE:ARM - "MachineEBC", # /MACHINE:EBC - "MachineIA64", # /MACHINE:IA64 - None, - "MachineMIPS", # /MACHINE:MIPS - "MachineMIPS16", # /MACHINE:MIPS16 - "MachineMIPSFPU", # /MACHINE:MIPSFPU - "MachineMIPSFPU16", # /MACHINE:MIPSFPU16 - None, - None, - None, - "MachineSH4", # /MACHINE:SH4 - None, - "MachineTHUMB", # /MACHINE:THUMB - "MachineX64", - ] -) # /MACHINE:X64 - -_Same( - _link, "AssemblyDebug", _Enumeration(["", "true", "false"]) # /ASSEMBLYDEBUG -) # /ASSEMBLYDEBUG:DISABLE -_Same( - _link, - "CLRImageType", - _Enumeration( - [ - "Default", - "ForceIJWImage", # /CLRIMAGETYPE:IJW - "ForcePureILImage", # /Switch="CLRIMAGETYPE:PURE - "ForceSafeILImage", - ] - ), -) # /Switch="CLRIMAGETYPE:SAFE -_Same( - _link, - "CLRThreadAttribute", - _Enumeration( - [ - "DefaultThreadingAttribute", # /CLRTHREADATTRIBUTE:NONE - "MTAThreadingAttribute", # /CLRTHREADATTRIBUTE:MTA - "STAThreadingAttribute", - ] - ), -) # /CLRTHREADATTRIBUTE:STA -_Same( - _link, - "DataExecutionPrevention", - _Enumeration(["", "false", "true"]), # /NXCOMPAT:NO -) # /NXCOMPAT -_Same( - _link, - "Driver", - _Enumeration(["NotSet", "Driver", "UpOnly", "WDM"]), # /Driver # /DRIVER:UPONLY -) # /DRIVER:WDM -_Same( - _link, - "LinkTimeCodeGeneration", - _Enumeration( - [ - "Default", - "UseLinkTimeCodeGeneration", # /LTCG - "PGInstrument", # /LTCG:PGInstrument - "PGOptimization", # /LTCG:PGOptimize - "PGUpdate", - ] - ), -) # /LTCG:PGUpdate -_Same( - _link, - "ShowProgress", - _Enumeration( - ["NotSet", "LinkVerbose", "LinkVerboseLib"], # /VERBOSE # /VERBOSE:Lib - new=[ - "LinkVerboseICF", # /VERBOSE:ICF - "LinkVerboseREF", # /VERBOSE:REF - "LinkVerboseSAFESEH", # /VERBOSE:SAFESEH - "LinkVerboseCLR", - ], - ), -) # /VERBOSE:CLR -_Same(_link, "SubSystem", _subsystem_enumeration) -_Same(_link, "TargetMachine", _target_machine_enumeration) -_Same( - _link, - "UACExecutionLevel", - _Enumeration( - [ - "AsInvoker", # /level='asInvoker' - "HighestAvailable", # /level='highestAvailable' - "RequireAdministrator", - ] - ), -) # /level='requireAdministrator' -_Same(_link, "MinimumRequiredVersion", _string) -_Same(_link, "TreatLinkerWarningAsErrors", _boolean) # /WX - - -# Options found in MSVS that have been renamed in MSBuild. -_Renamed( - _link, - "ErrorReporting", - "LinkErrorReporting", - _Enumeration( - [ - "NoErrorReport", # /ERRORREPORT:NONE - "PromptImmediately", # /ERRORREPORT:PROMPT - "QueueForNextLogin", - ], # /ERRORREPORT:QUEUE - new=["SendErrorReport"], - ), -) # /ERRORREPORT:SEND -_Renamed( - _link, "IgnoreDefaultLibraryNames", "IgnoreSpecificDefaultLibraries", _file_list -) # /NODEFAULTLIB -_Renamed(_link, "ResourceOnlyDLL", "NoEntryPoint", _boolean) # /NOENTRY -_Renamed(_link, "SwapRunFromNet", "SwapRunFromNET", _boolean) # /SWAPRUN:NET - -_Moved(_link, "GenerateManifest", "", _boolean) -_Moved(_link, "IgnoreImportLibrary", "", _boolean) -_Moved(_link, "LinkIncremental", "", _newly_boolean) -_Moved(_link, "LinkLibraryDependencies", "ProjectReference", _boolean) -_Moved(_link, "UseLibraryDependencyInputs", "ProjectReference", _boolean) - -# MSVS options not found in MSBuild. -_MSVSOnly(_link, "OptimizeForWindows98", _newly_boolean) -_MSVSOnly(_link, "UseUnicodeResponseFiles", _boolean) - -# MSBuild options not found in MSVS. -_MSBuildOnly(_link, "BuildingInIDE", _boolean) -_MSBuildOnly(_link, "ImageHasSafeExceptionHandlers", _boolean) # /SAFESEH -_MSBuildOnly(_link, "LinkDLL", _boolean) # /DLL Visible='false' -_MSBuildOnly(_link, "LinkStatus", _boolean) # /LTCG:STATUS -_MSBuildOnly(_link, "PreventDllBinding", _boolean) # /ALLOWBIND -_MSBuildOnly(_link, "SupportNobindOfDelayLoadedDLL", _boolean) # /DELAY:NOBIND -_MSBuildOnly(_link, "TrackerLogDirectory", _folder_name) -_MSBuildOnly(_link, "MSDOSStubFileName", _file_name) # /STUB Visible='false' -_MSBuildOnly(_link, "SectionAlignment", _integer) # /ALIGN -_MSBuildOnly(_link, "SpecifySectionAttributes", _string) # /SECTION -_MSBuildOnly( - _link, - "ForceFileOutput", - _Enumeration( - [], - new=[ - "Enabled", # /FORCE - # /FORCE:MULTIPLE - "MultiplyDefinedSymbolOnly", - "UndefinedSymbolOnly", - ], - ), -) # /FORCE:UNRESOLVED -_MSBuildOnly( - _link, - "CreateHotPatchableImage", - _Enumeration( - [], - new=[ - "Enabled", # /FUNCTIONPADMIN - "X86Image", # /FUNCTIONPADMIN:5 - "X64Image", # /FUNCTIONPADMIN:6 - "ItaniumImage", - ], - ), -) # /FUNCTIONPADMIN:16 -_MSBuildOnly( - _link, - "CLRSupportLastError", - _Enumeration( - [], - new=[ - "Enabled", # /CLRSupportLastError - "Disabled", # /CLRSupportLastError:NO - # /CLRSupportLastError:SYSTEMDLL - "SystemDlls", - ], - ), -) - - -# Directives for converting VCResourceCompilerTool to ResourceCompile. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\rc.xml" for -# the schema of the MSBuild ResourceCompile settings. - -_Same(_rc, "AdditionalOptions", _string_list) -_Same(_rc, "AdditionalIncludeDirectories", _folder_list) # /I -_Same(_rc, "Culture", _Integer(msbuild_base=16)) -_Same(_rc, "IgnoreStandardIncludePath", _boolean) # /X -_Same(_rc, "PreprocessorDefinitions", _string_list) # /D -_Same(_rc, "ResourceOutputFileName", _string) # /fo -_Same(_rc, "ShowProgress", _boolean) # /v -# There is no UI in VisualStudio 2008 to set the following properties. -# However they are found in CL and other tools. Include them here for -# completeness, as they are very likely to have the same usage pattern. -_Same(_rc, "SuppressStartupBanner", _boolean) # /nologo -_Same(_rc, "UndefinePreprocessorDefinitions", _string_list) # /u - -# MSBuild options not found in MSVS. -_MSBuildOnly(_rc, "NullTerminateStrings", _boolean) # /n -_MSBuildOnly(_rc, "TrackerLogDirectory", _folder_name) - - -# Directives for converting VCMIDLTool to Midl. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\midl.xml" for -# the schema of the MSBuild Midl settings. - -_Same(_midl, "AdditionalIncludeDirectories", _folder_list) # /I -_Same(_midl, "AdditionalOptions", _string_list) -_Same(_midl, "CPreprocessOptions", _string) # /cpp_opt -_Same(_midl, "ErrorCheckAllocations", _boolean) # /error allocation -_Same(_midl, "ErrorCheckBounds", _boolean) # /error bounds_check -_Same(_midl, "ErrorCheckEnumRange", _boolean) # /error enum -_Same(_midl, "ErrorCheckRefPointers", _boolean) # /error ref -_Same(_midl, "ErrorCheckStubData", _boolean) # /error stub_data -_Same(_midl, "GenerateStublessProxies", _boolean) # /Oicf -_Same(_midl, "GenerateTypeLibrary", _boolean) -_Same(_midl, "HeaderFileName", _file_name) # /h -_Same(_midl, "IgnoreStandardIncludePath", _boolean) # /no_def_idir -_Same(_midl, "InterfaceIdentifierFileName", _file_name) # /iid -_Same(_midl, "MkTypLibCompatible", _boolean) # /mktyplib203 -_Same(_midl, "OutputDirectory", _string) # /out -_Same(_midl, "PreprocessorDefinitions", _string_list) # /D -_Same(_midl, "ProxyFileName", _file_name) # /proxy -_Same(_midl, "RedirectOutputAndErrors", _file_name) # /o -_Same(_midl, "SuppressStartupBanner", _boolean) # /nologo -_Same(_midl, "TypeLibraryName", _file_name) # /tlb -_Same(_midl, "UndefinePreprocessorDefinitions", _string_list) # /U -_Same(_midl, "WarnAsError", _boolean) # /WX - -_Same( - _midl, - "DefaultCharType", - _Enumeration(["Unsigned", "Signed", "Ascii"]), # /char unsigned # /char signed -) # /char ascii7 -_Same( - _midl, - "TargetEnvironment", - _Enumeration( - [ - "NotSet", - "Win32", # /env win32 - "Itanium", # /env ia64 - "X64", # /env x64 - "ARM64", # /env arm64 - ] - ), -) -_Same( - _midl, - "EnableErrorChecks", - _Enumeration(["EnableCustom", "None", "All"]), # /error none -) # /error all -_Same( - _midl, - "StructMemberAlignment", - _Enumeration(["NotSet", "1", "2", "4", "8"]), # Zp1 # Zp2 # Zp4 -) # Zp8 -_Same( - _midl, - "WarningLevel", - _Enumeration(["0", "1", "2", "3", "4"]), # /W0 # /W1 # /W2 # /W3 -) # /W4 - -_Renamed(_midl, "DLLDataFileName", "DllDataFileName", _file_name) # /dlldata -_Renamed(_midl, "ValidateParameters", "ValidateAllParameters", _boolean) # /robust - -# MSBuild options not found in MSVS. -_MSBuildOnly(_midl, "ApplicationConfigurationMode", _boolean) # /app_config -_MSBuildOnly(_midl, "ClientStubFile", _file_name) # /cstub -_MSBuildOnly( - _midl, "GenerateClientFiles", _Enumeration([], new=["Stub", "None"]) # /client stub -) # /client none -_MSBuildOnly( - _midl, "GenerateServerFiles", _Enumeration([], new=["Stub", "None"]) # /client stub -) # /client none -_MSBuildOnly(_midl, "LocaleID", _integer) # /lcid DECIMAL -_MSBuildOnly(_midl, "ServerStubFile", _file_name) # /sstub -_MSBuildOnly(_midl, "SuppressCompilerWarnings", _boolean) # /no_warn -_MSBuildOnly(_midl, "TrackerLogDirectory", _folder_name) -_MSBuildOnly( - _midl, "TypeLibFormat", _Enumeration([], new=["NewFormat", "OldFormat"]) # /newtlb -) # /oldtlb - - -# Directives for converting VCLibrarianTool to Lib. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\lib.xml" for -# the schema of the MSBuild Lib settings. - -_Same(_lib, "AdditionalDependencies", _file_list) -_Same(_lib, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH -_Same(_lib, "AdditionalOptions", _string_list) -_Same(_lib, "ExportNamedFunctions", _string_list) # /EXPORT -_Same(_lib, "ForceSymbolReferences", _string) # /INCLUDE -_Same(_lib, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB -_Same(_lib, "IgnoreSpecificDefaultLibraries", _file_list) # /NODEFAULTLIB -_Same(_lib, "ModuleDefinitionFile", _file_name) # /DEF -_Same(_lib, "OutputFile", _file_name) # /OUT -_Same(_lib, "SuppressStartupBanner", _boolean) # /NOLOGO -_Same(_lib, "UseUnicodeResponseFiles", _boolean) -_Same(_lib, "LinkTimeCodeGeneration", _boolean) # /LTCG -_Same(_lib, "TargetMachine", _target_machine_enumeration) - -# TODO(jeanluc) _link defines the same value that gets moved to -# ProjectReference. We may want to validate that they are consistent. -_Moved(_lib, "LinkLibraryDependencies", "ProjectReference", _boolean) - -_MSBuildOnly(_lib, "DisplayLibrary", _string) # /LIST Visible='false' -_MSBuildOnly( - _lib, - "ErrorReporting", - _Enumeration( - [], - new=[ - "PromptImmediately", # /ERRORREPORT:PROMPT - "QueueForNextLogin", # /ERRORREPORT:QUEUE - "SendErrorReport", # /ERRORREPORT:SEND - "NoErrorReport", - ], - ), -) # /ERRORREPORT:NONE -_MSBuildOnly(_lib, "MinimumRequiredVersion", _string) -_MSBuildOnly(_lib, "Name", _file_name) # /NAME -_MSBuildOnly(_lib, "RemoveObjects", _file_list) # /REMOVE -_MSBuildOnly(_lib, "SubSystem", _subsystem_enumeration) -_MSBuildOnly(_lib, "TrackerLogDirectory", _folder_name) -_MSBuildOnly(_lib, "TreatLibWarningAsErrors", _boolean) # /WX -_MSBuildOnly(_lib, "Verbose", _boolean) - - -# Directives for converting VCManifestTool to Mt. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\mt.xml" for -# the schema of the MSBuild Lib settings. - -# Options that have the same name in MSVS and MSBuild -_Same(_manifest, "AdditionalManifestFiles", _file_list) # /manifest -_Same(_manifest, "AdditionalOptions", _string_list) -_Same(_manifest, "AssemblyIdentity", _string) # /identity: -_Same(_manifest, "ComponentFileName", _file_name) # /dll -_Same(_manifest, "GenerateCatalogFiles", _boolean) # /makecdfs -_Same(_manifest, "InputResourceManifests", _string) # /inputresource -_Same(_manifest, "OutputManifestFile", _file_name) # /out -_Same(_manifest, "RegistrarScriptFile", _file_name) # /rgs -_Same(_manifest, "ReplacementsFile", _file_name) # /replacements -_Same(_manifest, "SuppressStartupBanner", _boolean) # /nologo -_Same(_manifest, "TypeLibraryFile", _file_name) # /tlb: -_Same(_manifest, "UpdateFileHashes", _boolean) # /hashupdate -_Same(_manifest, "UpdateFileHashesSearchPath", _file_name) -_Same(_manifest, "VerboseOutput", _boolean) # /verbose - -# Options that have moved location. -_MovedAndRenamed( - _manifest, - "ManifestResourceFile", - "ManifestResourceCompile", - "ResourceOutputFileName", - _file_name, -) -_Moved(_manifest, "EmbedManifest", "", _boolean) - -# MSVS options not found in MSBuild. -_MSVSOnly(_manifest, "DependencyInformationFile", _file_name) -_MSVSOnly(_manifest, "UseFAT32Workaround", _boolean) -_MSVSOnly(_manifest, "UseUnicodeResponseFiles", _boolean) - -# MSBuild options not found in MSVS. -_MSBuildOnly(_manifest, "EnableDPIAwareness", _boolean) -_MSBuildOnly(_manifest, "GenerateCategoryTags", _boolean) # /category -_MSBuildOnly( - _manifest, "ManifestFromManagedAssembly", _file_name -) # /managedassemblyname -_MSBuildOnly(_manifest, "OutputResourceManifests", _string) # /outputresource -_MSBuildOnly(_manifest, "SuppressDependencyElement", _boolean) # /nodependency -_MSBuildOnly(_manifest, "TrackerLogDirectory", _folder_name) - - -# Directives for MASM. -# See "$(VCTargetsPath)\BuildCustomizations\masm.xml" for the schema of the -# MSBuild MASM settings. - -# Options that have the same name in MSVS and MSBuild. -_Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py deleted file mode 100755 index 6ca09687a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +++ /dev/null @@ -1,1547 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Unit tests for the MSVSSettings.py file.""" - -import unittest -import gyp.MSVSSettings as MSVSSettings - -from io import StringIO - - -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() - - def _ExpectedWarnings(self, expected): - """Compares recorded lines to expected warnings.""" - self.stderr.seek(0) - actual = self.stderr.read().split("\n") - actual = [line for line in actual if line] - self.assertEqual(sorted(expected), sorted(actual)) - - def testValidateMSVSSettings_tool_names(self): - """Tests that only MSVS tool names are allowed.""" - MSVSSettings.ValidateMSVSSettings( - { - "VCCLCompilerTool": {}, - "VCLinkerTool": {}, - "VCMIDLTool": {}, - "foo": {}, - "VCResourceCompilerTool": {}, - "VCLibrarianTool": {}, - "VCManifestTool": {}, - "ClCompile": {}, - }, - self.stderr, - ) - self._ExpectedWarnings( - ["Warning: unrecognized tool foo", "Warning: unrecognized tool ClCompile"] - ) - - def testValidateMSVSSettings_settings(self): - """Tests that for invalid MSVS settings.""" - MSVSSettings.ValidateMSVSSettings( - { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": ["string1", "string2"], - "AdditionalUsingDirectories": "folder1;folder2", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "0", - "BasicRuntimeChecks": "5", - "BrowseInformation": "fdkslj", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "CallingConvention": "-1", - "CompileAs": "1", - "DebugInformationFormat": "2", - "DefaultCharIsUnsigned": "true", - "Detect64BitPortabilityProblems": "true", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "string1;string2", - "EnableEnhancedInstructionSet": "1", - "EnableFiberSafeOptimizations": "true", - "EnableFunctionLevelLinking": "true", - "EnableIntrinsicFunctions": "true", - "EnablePREfast": "true", - "Enableprefast": "bogus", - "ErrorReporting": "1", - "ExceptionHandling": "1", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "1", - "FloatingPointExceptions": "true", - "FloatingPointModel": "1", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2", - "ForcedUsingFiles": "file1;file2", - "GeneratePreprocessedFile": "1", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "1", - "KeepComments": "true", - "MinimalRebuild": "true", - "ObjectFile": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMP": "true", - "Optimization": "1", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderThrough": "a_file_name", - "PreprocessorDefinitions": "string1;string2", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "1", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1", - "SuppressStartupBanner": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "string1;string2", - "UseFullPaths": "true", - "UsePrecompiledHeader": "1", - "UseUnicodeResponseFiles": "true", - "WarnAsError": "true", - "WarningLevel": "1", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - "ZZXYZ": "bogus", - }, - "VCLinkerTool": { - "AdditionalDependencies": "file1;file2", - "AdditionalDependencies_excluded": "file3", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalManifestDependencies": "file1;file2", - "AdditionalOptions": "a string1", - "AddModuleNamesToAssembly": "file1;file2", - "AllowIsolation": "true", - "AssemblyDebug": "2", - "AssemblyLinkResource": "file1;file2", - "BaseAddress": "a string1", - "CLRImageType": "2", - "CLRThreadAttribute": "2", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "2", - "DelayLoadDLLs": "file1;file2", - "DelaySign": "true", - "Driver": "2", - "EmbedManagedResourceFile": "file1;file2", - "EnableCOMDATFolding": "2", - "EnableUAC": "true", - "EntryPointSymbol": "a string1", - "ErrorReporting": "2", - "FixedBaseAddress": "2", - "ForceSymbolReferences": "file1;file2", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateManifest": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a string1", - "HeapReserveSize": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreDefaultLibraryNames": "file1;file2", - "IgnoreEmbeddedIDL": "true", - "IgnoreImportLibrary": "true", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "2", - "LinkIncremental": "2", - "LinkLibraryDependencies": "true", - "LinkTimeCodeGeneration": "2", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a string1", - "MidlCommandFile": "a_file_name", - "ModuleDefinitionFile": "a_file_name", - "OptimizeForWindows98": "1", - "OptimizeReferences": "2", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "2", - "RegisterOutput": "true", - "ResourceOnlyDLL": "true", - "SetChecksum": "true", - "ShowProgress": "2", - "StackCommitSize": "a string1", - "StackReserveSize": "a string1", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "2", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNet": "true", - "TargetMachine": "2", - "TerminalServerAware": "2", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "2", - "UACUIAccess": "true", - "UseLibraryDependencyInputs": "true", - "UseUnicodeResponseFiles": "true", - "Version": "a string1", - }, - "VCMIDLTool": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "CPreprocessOptions": "a string1", - "DefaultCharType": "1", - "DLLDataFileName": "a_file_name", - "EnableErrorChecks": "1", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "MkTypLibCompatible": "true", - "notgood": "bogus", - "OutputDirectory": "a string1", - "PreprocessorDefinitions": "string1;string2", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "StructMemberAlignment": "1", - "SuppressStartupBanner": "true", - "TargetEnvironment": "1", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "string1;string2", - "ValidateParameters": "true", - "WarnAsError": "true", - "WarningLevel": "1", - }, - "VCResourceCompilerTool": { - "AdditionalOptions": "a string1", - "AdditionalIncludeDirectories": "folder1;folder2", - "Culture": "1003", - "IgnoreStandardIncludePath": "true", - "notgood2": "bogus", - "PreprocessorDefinitions": "string1;string2", - "ResourceOutputFileName": "a string1", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "UndefinePreprocessorDefinitions": "string1;string2", - }, - "VCLibrarianTool": { - "AdditionalDependencies": "file1;file2", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "ExportNamedFunctions": "string1;string2", - "ForceSymbolReferences": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2", - "LinkLibraryDependencies": "true", - "ModuleDefinitionFile": "a_file_name", - "OutputFile": "a_file_name", - "SuppressStartupBanner": "true", - "UseUnicodeResponseFiles": "true", - }, - "VCManifestTool": { - "AdditionalManifestFiles": "file1;file2", - "AdditionalOptions": "a string1", - "AssemblyIdentity": "a string1", - "ComponentFileName": "a_file_name", - "DependencyInformationFile": "a_file_name", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "a string1", - "ManifestResourceFile": "a_file_name", - "OutputManifestFile": "a_file_name", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressStartupBanner": "true", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "truel", - "UpdateFileHashesSearchPath": "a_file_name", - "UseFAT32Workaround": "true", - "UseUnicodeResponseFiles": "true", - "VerboseOutput": "true", - }, - }, - self.stderr, - ) - self._ExpectedWarnings( - [ - "Warning: for VCCLCompilerTool/BasicRuntimeChecks, " - "index value (5) not in expected range [0, 4)", - "Warning: for VCCLCompilerTool/BrowseInformation, " - "invalid literal for int() with base 10: 'fdkslj'", - "Warning: for VCCLCompilerTool/CallingConvention, " - "index value (-1) not in expected range [0, 4)", - "Warning: for VCCLCompilerTool/DebugInformationFormat, " - "converted value for 2 not specified.", - "Warning: unrecognized setting VCCLCompilerTool/Enableprefast", - "Warning: unrecognized setting VCCLCompilerTool/ZZXYZ", - "Warning: for VCLinkerTool/TargetMachine, " - "converted value for 2 not specified.", - "Warning: unrecognized setting VCMIDLTool/notgood", - "Warning: unrecognized setting VCResourceCompilerTool/notgood2", - "Warning: for VCManifestTool/UpdateFileHashes, " - "expected bool; got 'truel'" - "", - ] - ) - - def testValidateMSBuildSettings_settings(self): - """Tests that for invalid MSBuild settings.""" - MSVSSettings.ValidateMSBuildSettings( - { - "ClCompile": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": ["string1", "string2"], - "AdditionalUsingDirectories": "folder1;folder2", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "NoListing", - "BasicRuntimeChecks": "StackFrameRuntimeCheck", - "BrowseInformation": "false", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "BuildingInIDE": "true", - "CallingConvention": "Cdecl", - "CompileAs": "CompileAsC", - "CompileAsManaged": "true", - "CreateHotpatchableImage": "true", - "DebugInformationFormat": "ProgramDatabase", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "string1;string2", - "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", - "EnableFiberSafeOptimizations": "true", - "EnablePREfast": "true", - "Enableprefast": "bogus", - "ErrorReporting": "Prompt", - "ExceptionHandling": "SyncCThrow", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "Neither", - "FloatingPointExceptions": "true", - "FloatingPointModel": "Precise", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2", - "ForcedUsingFiles": "file1;file2", - "FunctionLevelLinking": "false", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "OnlyExplicitInline", - "IntrinsicFunctions": "false", - "MinimalRebuild": "true", - "MultiProcessorCompilation": "true", - "ObjectFileName": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMPSupport": "true", - "Optimization": "Disabled", - "PrecompiledHeader": "NotUsing", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderOutputFile": "a_file_name", - "PreprocessKeepComments": "true", - "PreprocessorDefinitions": "string1;string2", - "PreprocessOutputPath": "a string1", - "PreprocessSuppressLineNumbers": "false", - "PreprocessToFile": "false", - "ProcessorNumber": "33", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "MultiThreaded", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1Byte", - "SuppressStartupBanner": "true", - "TrackerLogDirectory": "a_folder", - "TreatSpecificWarningsAsErrors": "string1;string2", - "TreatWarningAsError": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "string1;string2", - "UseFullPaths": "true", - "UseUnicodeForAssemblerListing": "true", - "WarningLevel": "TurnOffAllWarnings", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - "ZZXYZ": "bogus", - }, - "Link": { - "AdditionalDependencies": "file1;file2", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalManifestDependencies": "file1;file2", - "AdditionalOptions": "a string1", - "AddModuleNamesToAssembly": "file1;file2", - "AllowIsolation": "true", - "AssemblyDebug": "", - "AssemblyLinkResource": "file1;file2", - "BaseAddress": "a string1", - "BuildingInIDE": "true", - "CLRImageType": "ForceIJWImage", - "CLRSupportLastError": "Enabled", - "CLRThreadAttribute": "MTAThreadingAttribute", - "CLRUnmanagedCodeCheck": "true", - "CreateHotPatchableImage": "X86Image", - "DataExecutionPrevention": "false", - "DelayLoadDLLs": "file1;file2", - "DelaySign": "true", - "Driver": "NotSet", - "EmbedManagedResourceFile": "file1;file2", - "EnableCOMDATFolding": "false", - "EnableUAC": "true", - "EntryPointSymbol": "a string1", - "FixedBaseAddress": "false", - "ForceFileOutput": "Enabled", - "ForceSymbolReferences": "file1;file2", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a string1", - "HeapReserveSize": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreEmbeddedIDL": "true", - "IgnoreSpecificDefaultLibraries": "a_file_list", - "ImageHasSafeExceptionHandlers": "true", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "false", - "LinkDLL": "true", - "LinkErrorReporting": "SendErrorReport", - "LinkStatus": "true", - "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a string1", - "MidlCommandFile": "a_file_name", - "MinimumRequiredVersion": "a string1", - "ModuleDefinitionFile": "a_file_name", - "MSDOSStubFileName": "a_file_name", - "NoEntryPoint": "true", - "OptimizeReferences": "false", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "PreventDllBinding": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "false", - "RegisterOutput": "true", - "SectionAlignment": "33", - "SetChecksum": "true", - "ShowProgress": "LinkVerboseREF", - "SpecifySectionAttributes": "a string1", - "StackCommitSize": "a string1", - "StackReserveSize": "a string1", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "Console", - "SupportNobindOfDelayLoadedDLL": "true", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNET": "true", - "TargetMachine": "MachineX86", - "TerminalServerAware": "false", - "TrackerLogDirectory": "a_folder", - "TreatLinkerWarningAsErrors": "true", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "AsInvoker", - "UACUIAccess": "true", - "Version": "a string1", - }, - "ResourceCompile": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "Culture": "0x236", - "IgnoreStandardIncludePath": "true", - "NullTerminateStrings": "true", - "PreprocessorDefinitions": "string1;string2", - "ResourceOutputFileName": "a string1", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "TrackerLogDirectory": "a_folder", - "UndefinePreprocessorDefinitions": "string1;string2", - }, - "Midl": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "ApplicationConfigurationMode": "true", - "ClientStubFile": "a_file_name", - "CPreprocessOptions": "a string1", - "DefaultCharType": "Signed", - "DllDataFileName": "a_file_name", - "EnableErrorChecks": "EnableCustom", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateClientFiles": "Stub", - "GenerateServerFiles": "None", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "LocaleID": "33", - "MkTypLibCompatible": "true", - "OutputDirectory": "a string1", - "PreprocessorDefinitions": "string1;string2", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "ServerStubFile": "a_file_name", - "StructMemberAlignment": "NotSet", - "SuppressCompilerWarnings": "true", - "SuppressStartupBanner": "true", - "TargetEnvironment": "Itanium", - "TrackerLogDirectory": "a_folder", - "TypeLibFormat": "NewFormat", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "string1;string2", - "ValidateAllParameters": "true", - "WarnAsError": "true", - "WarningLevel": "1", - }, - "Lib": { - "AdditionalDependencies": "file1;file2", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "DisplayLibrary": "a string1", - "ErrorReporting": "PromptImmediately", - "ExportNamedFunctions": "string1;string2", - "ForceSymbolReferences": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2", - "LinkTimeCodeGeneration": "true", - "MinimumRequiredVersion": "a string1", - "ModuleDefinitionFile": "a_file_name", - "Name": "a_file_name", - "OutputFile": "a_file_name", - "RemoveObjects": "file1;file2", - "SubSystem": "Console", - "SuppressStartupBanner": "true", - "TargetMachine": "MachineX86i", - "TrackerLogDirectory": "a_folder", - "TreatLibWarningAsErrors": "true", - "UseUnicodeResponseFiles": "true", - "Verbose": "true", - }, - "Manifest": { - "AdditionalManifestFiles": "file1;file2", - "AdditionalOptions": "a string1", - "AssemblyIdentity": "a string1", - "ComponentFileName": "a_file_name", - "EnableDPIAwareness": "fal", - "GenerateCatalogFiles": "truel", - "GenerateCategoryTags": "true", - "InputResourceManifests": "a string1", - "ManifestFromManagedAssembly": "a_file_name", - "notgood3": "bogus", - "OutputManifestFile": "a_file_name", - "OutputResourceManifests": "a string1", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressDependencyElement": "true", - "SuppressStartupBanner": "true", - "TrackerLogDirectory": "a_folder", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "a_file_name", - "VerboseOutput": "true", - }, - "ProjectReference": { - "LinkLibraryDependencies": "true", - "UseLibraryDependencyInputs": "true", - }, - "ManifestResourceCompile": {"ResourceOutputFileName": "a_file_name"}, - "": { - "EmbedManifest": "true", - "GenerateManifest": "true", - "IgnoreImportLibrary": "true", - "LinkIncremental": "false", - }, - }, - self.stderr, - ) - self._ExpectedWarnings( - [ - "Warning: unrecognized setting ClCompile/Enableprefast", - "Warning: unrecognized setting ClCompile/ZZXYZ", - "Warning: unrecognized setting Manifest/notgood3", - "Warning: for Manifest/GenerateCatalogFiles, " - "expected bool; got 'truel'", - "Warning: for Lib/TargetMachine, unrecognized enumerated value " - "MachineX86i", - "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'", - ] - ) - - def testConvertToMSBuildSettings_empty(self): - """Tests an empty conversion.""" - msvs_settings = {} - expected_msbuild_settings = {} - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_minimal(self): - """Tests a minimal conversion.""" - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/foo", - "BasicRuntimeChecks": "0", - }, - "VCLinkerTool": { - "LinkTimeCodeGeneration": "1", - "ErrorReporting": "1", - "DataExecutionPrevention": "2", - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/foo", - "BasicRuntimeChecks": "Default", - }, - "Link": { - "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", - "LinkErrorReporting": "PromptImmediately", - "DataExecutionPrevention": "true", - }, - } - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_warnings(self): - """Tests conversion that generates warnings.""" - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "1", - "AdditionalOptions": "2", - # These are incorrect values: - "BasicRuntimeChecks": "12", - "BrowseInformation": "21", - "UsePrecompiledHeader": "13", - "GeneratePreprocessedFile": "14", - }, - "VCLinkerTool": { - # These are incorrect values: - "Driver": "10", - "LinkTimeCodeGeneration": "31", - "ErrorReporting": "21", - "FixedBaseAddress": "6", - }, - "VCResourceCompilerTool": { - # Custom - "Culture": "1003" - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "1", - "AdditionalOptions": "2", - }, - "Link": {}, - "ResourceCompile": { - # Custom - "Culture": "0x03eb" - }, - } - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings( - [ - "Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to " - "MSBuild, index value (12) not in expected range [0, 4)", - "Warning: while converting VCCLCompilerTool/BrowseInformation to " - "MSBuild, index value (21) not in expected range [0, 3)", - "Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to " - "MSBuild, index value (13) not in expected range [0, 3)", - "Warning: while converting " - "VCCLCompilerTool/GeneratePreprocessedFile to " - "MSBuild, value must be one of [0, 1, 2]; got 14", - "Warning: while converting VCLinkerTool/Driver to " - "MSBuild, index value (10) not in expected range [0, 4)", - "Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to " - "MSBuild, index value (31) not in expected range [0, 5)", - "Warning: while converting VCLinkerTool/ErrorReporting to " - "MSBuild, index value (21) not in expected range [0, 3)", - "Warning: while converting VCLinkerTool/FixedBaseAddress to " - "MSBuild, index value (6) not in expected range [0, 3)", - ] - ) - - def testConvertToMSBuildSettings_full_synthetic(self): - """Tests conversion of all the MSBuild settings.""" - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "AdditionalUsingDirectories": "folder1;folder2;folder3", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "0", - "BasicRuntimeChecks": "1", - "BrowseInformation": "2", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "CallingConvention": "0", - "CompileAs": "1", - "DebugInformationFormat": "4", - "DefaultCharIsUnsigned": "true", - "Detect64BitPortabilityProblems": "true", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "d1;d2;d3", - "EnableEnhancedInstructionSet": "0", - "EnableFiberSafeOptimizations": "true", - "EnableFunctionLevelLinking": "true", - "EnableIntrinsicFunctions": "true", - "EnablePREfast": "true", - "ErrorReporting": "1", - "ExceptionHandling": "2", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "0", - "FloatingPointExceptions": "true", - "FloatingPointModel": "1", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2;file3", - "ForcedUsingFiles": "file1;file2;file3", - "GeneratePreprocessedFile": "1", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "2", - "KeepComments": "true", - "MinimalRebuild": "true", - "ObjectFile": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMP": "true", - "Optimization": "3", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderThrough": "a_file_name", - "PreprocessorDefinitions": "d1;d2;d3", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "0", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1", - "SuppressStartupBanner": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "UseFullPaths": "true", - "UsePrecompiledHeader": "1", - "UseUnicodeResponseFiles": "true", - "WarnAsError": "true", - "WarningLevel": "2", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - }, - "VCLinkerTool": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", - "AdditionalManifestDependencies": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AddModuleNamesToAssembly": "file1;file2;file3", - "AllowIsolation": "true", - "AssemblyDebug": "0", - "AssemblyLinkResource": "file1;file2;file3", - "BaseAddress": "a_string", - "CLRImageType": "1", - "CLRThreadAttribute": "2", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "0", - "DelayLoadDLLs": "file1;file2;file3", - "DelaySign": "true", - "Driver": "1", - "EmbedManagedResourceFile": "file1;file2;file3", - "EnableCOMDATFolding": "0", - "EnableUAC": "true", - "EntryPointSymbol": "a_string", - "ErrorReporting": "0", - "FixedBaseAddress": "1", - "ForceSymbolReferences": "file1;file2;file3", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateManifest": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a_string", - "HeapReserveSize": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreDefaultLibraryNames": "file1;file2;file3", - "IgnoreEmbeddedIDL": "true", - "IgnoreImportLibrary": "true", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "2", - "LinkIncremental": "1", - "LinkLibraryDependencies": "true", - "LinkTimeCodeGeneration": "2", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a_string", - "MidlCommandFile": "a_file_name", - "ModuleDefinitionFile": "a_file_name", - "OptimizeForWindows98": "1", - "OptimizeReferences": "0", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "1", - "RegisterOutput": "true", - "ResourceOnlyDLL": "true", - "SetChecksum": "true", - "ShowProgress": "0", - "StackCommitSize": "a_string", - "StackReserveSize": "a_string", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "2", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNet": "true", - "TargetMachine": "3", - "TerminalServerAware": "2", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "1", - "UACUIAccess": "true", - "UseLibraryDependencyInputs": "false", - "UseUnicodeResponseFiles": "true", - "Version": "a_string", - }, - "VCResourceCompilerTool": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "Culture": "1003", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "d1;d2;d3", - "ResourceOutputFileName": "a_string", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - }, - "VCMIDLTool": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "CPreprocessOptions": "a_string", - "DefaultCharType": "0", - "DLLDataFileName": "a_file_name", - "EnableErrorChecks": "2", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "MkTypLibCompatible": "true", - "OutputDirectory": "a_string", - "PreprocessorDefinitions": "d1;d2;d3", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "StructMemberAlignment": "3", - "SuppressStartupBanner": "true", - "TargetEnvironment": "1", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "ValidateParameters": "true", - "WarnAsError": "true", - "WarningLevel": "4", - }, - "VCLibrarianTool": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "ExportNamedFunctions": "d1;d2;d3", - "ForceSymbolReferences": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2;file3", - "LinkLibraryDependencies": "true", - "ModuleDefinitionFile": "a_file_name", - "OutputFile": "a_file_name", - "SuppressStartupBanner": "true", - "UseUnicodeResponseFiles": "true", - }, - "VCManifestTool": { - "AdditionalManifestFiles": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AssemblyIdentity": "a_string", - "ComponentFileName": "a_file_name", - "DependencyInformationFile": "a_file_name", - "EmbedManifest": "true", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "a_string", - "ManifestResourceFile": "my_name", - "OutputManifestFile": "a_file_name", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressStartupBanner": "true", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "a_file_name", - "UseFAT32Workaround": "true", - "UseUnicodeResponseFiles": "true", - "VerboseOutput": "true", - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string /J", - "AdditionalUsingDirectories": "folder1;folder2;folder3", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "NoListing", - "BasicRuntimeChecks": "StackFrameRuntimeCheck", - "BrowseInformation": "true", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "CallingConvention": "Cdecl", - "CompileAs": "CompileAsC", - "DebugInformationFormat": "EditAndContinue", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "d1;d2;d3", - "EnableEnhancedInstructionSet": "NotSet", - "EnableFiberSafeOptimizations": "true", - "EnablePREfast": "true", - "ErrorReporting": "Prompt", - "ExceptionHandling": "Async", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "Neither", - "FloatingPointExceptions": "true", - "FloatingPointModel": "Strict", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2;file3", - "ForcedUsingFiles": "file1;file2;file3", - "FunctionLevelLinking": "true", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "AnySuitable", - "IntrinsicFunctions": "true", - "MinimalRebuild": "true", - "ObjectFileName": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMPSupport": "true", - "Optimization": "Full", - "PrecompiledHeader": "Create", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderOutputFile": "a_file_name", - "PreprocessKeepComments": "true", - "PreprocessorDefinitions": "d1;d2;d3", - "PreprocessSuppressLineNumbers": "false", - "PreprocessToFile": "true", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "MultiThreaded", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1Byte", - "SuppressStartupBanner": "true", - "TreatWarningAsError": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "UseFullPaths": "true", - "WarningLevel": "Level2", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - }, - "Link": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalManifestDependencies": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AddModuleNamesToAssembly": "file1;file2;file3", - "AllowIsolation": "true", - "AssemblyDebug": "", - "AssemblyLinkResource": "file1;file2;file3", - "BaseAddress": "a_string", - "CLRImageType": "ForceIJWImage", - "CLRThreadAttribute": "STAThreadingAttribute", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "", - "DelayLoadDLLs": "file1;file2;file3", - "DelaySign": "true", - "Driver": "Driver", - "EmbedManagedResourceFile": "file1;file2;file3", - "EnableCOMDATFolding": "", - "EnableUAC": "true", - "EntryPointSymbol": "a_string", - "FixedBaseAddress": "false", - "ForceSymbolReferences": "file1;file2;file3", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a_string", - "HeapReserveSize": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreEmbeddedIDL": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2;file3", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "true", - "LinkErrorReporting": "NoErrorReport", - "LinkTimeCodeGeneration": "PGInstrument", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a_string", - "MidlCommandFile": "a_file_name", - "ModuleDefinitionFile": "a_file_name", - "NoEntryPoint": "true", - "OptimizeReferences": "", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "false", - "RegisterOutput": "true", - "SetChecksum": "true", - "ShowProgress": "NotSet", - "StackCommitSize": "a_string", - "StackReserveSize": "a_string", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "Windows", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNET": "true", - "TargetMachine": "MachineARM", - "TerminalServerAware": "true", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "HighestAvailable", - "UACUIAccess": "true", - "Version": "a_string", - }, - "ResourceCompile": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "Culture": "0x03eb", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "d1;d2;d3", - "ResourceOutputFileName": "a_string", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - }, - "Midl": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "CPreprocessOptions": "a_string", - "DefaultCharType": "Unsigned", - "DllDataFileName": "a_file_name", - "EnableErrorChecks": "All", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "MkTypLibCompatible": "true", - "OutputDirectory": "a_string", - "PreprocessorDefinitions": "d1;d2;d3", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "StructMemberAlignment": "4", - "SuppressStartupBanner": "true", - "TargetEnvironment": "Win32", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "ValidateAllParameters": "true", - "WarnAsError": "true", - "WarningLevel": "4", - }, - "Lib": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "ExportNamedFunctions": "d1;d2;d3", - "ForceSymbolReferences": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2;file3", - "ModuleDefinitionFile": "a_file_name", - "OutputFile": "a_file_name", - "SuppressStartupBanner": "true", - "UseUnicodeResponseFiles": "true", - }, - "Manifest": { - "AdditionalManifestFiles": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AssemblyIdentity": "a_string", - "ComponentFileName": "a_file_name", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "a_string", - "OutputManifestFile": "a_file_name", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressStartupBanner": "true", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "a_file_name", - "VerboseOutput": "true", - }, - "ManifestResourceCompile": {"ResourceOutputFileName": "my_name"}, - "ProjectReference": { - "LinkLibraryDependencies": "true", - "UseLibraryDependencyInputs": "false", - }, - "": { - "EmbedManifest": "true", - "GenerateManifest": "true", - "IgnoreImportLibrary": "true", - "LinkIncremental": "false", - }, - } - self.maxDiff = 9999 # on failure display a long diff - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_actual(self): - """Tests the conversion of an actual project. - - A VS2008 project with most of the options defined was created through the - VS2008 IDE. It was then converted to VS2010. The tool settings found in - the .vcproj and .vcxproj files were converted to the two dictionaries - msvs_settings and expected_msbuild_settings. - - Note that for many settings, the VS2010 converter adds macros like - %(AdditionalIncludeDirectories) to make sure than inherited values are - included. Since the Gyp projects we generate do not use inheritance, - we removed these macros. They were: - ClCompile: - AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)' - AdditionalOptions: ' %(AdditionalOptions)' - AdditionalUsingDirectories: ';%(AdditionalUsingDirectories)' - DisableSpecificWarnings: ';%(DisableSpecificWarnings)', - ForcedIncludeFiles: ';%(ForcedIncludeFiles)', - ForcedUsingFiles: ';%(ForcedUsingFiles)', - PreprocessorDefinitions: ';%(PreprocessorDefinitions)', - UndefinePreprocessorDefinitions: - ';%(UndefinePreprocessorDefinitions)', - Link: - AdditionalDependencies: ';%(AdditionalDependencies)', - AdditionalLibraryDirectories: ';%(AdditionalLibraryDirectories)', - AdditionalManifestDependencies: - ';%(AdditionalManifestDependencies)', - AdditionalOptions: ' %(AdditionalOptions)', - AddModuleNamesToAssembly: ';%(AddModuleNamesToAssembly)', - AssemblyLinkResource: ';%(AssemblyLinkResource)', - DelayLoadDLLs: ';%(DelayLoadDLLs)', - EmbedManagedResourceFile: ';%(EmbedManagedResourceFile)', - ForceSymbolReferences: ';%(ForceSymbolReferences)', - IgnoreSpecificDefaultLibraries: - ';%(IgnoreSpecificDefaultLibraries)', - ResourceCompile: - AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)', - AdditionalOptions: ' %(AdditionalOptions)', - PreprocessorDefinitions: ';%(PreprocessorDefinitions)', - Manifest: - AdditionalManifestFiles: ';%(AdditionalManifestFiles)', - AdditionalOptions: ' %(AdditionalOptions)', - InputResourceManifests: ';%(InputResourceManifests)', - """ - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/more", - "AdditionalUsingDirectories": "test", - "AssemblerListingLocation": "$(IntDir)\\a", - "AssemblerOutput": "1", - "BasicRuntimeChecks": "3", - "BrowseInformation": "1", - "BrowseInformationFile": "$(IntDir)\\e", - "BufferSecurityCheck": "false", - "CallingConvention": "1", - "CompileAs": "1", - "DebugInformationFormat": "4", - "DefaultCharIsUnsigned": "true", - "Detect64BitPortabilityProblems": "true", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "abc", - "EnableEnhancedInstructionSet": "1", - "EnableFiberSafeOptimizations": "true", - "EnableFunctionLevelLinking": "true", - "EnableIntrinsicFunctions": "true", - "EnablePREfast": "true", - "ErrorReporting": "2", - "ExceptionHandling": "2", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "2", - "FloatingPointExceptions": "true", - "FloatingPointModel": "1", - "ForceConformanceInForLoopScope": "false", - "ForcedIncludeFiles": "def", - "ForcedUsingFiles": "ge", - "GeneratePreprocessedFile": "2", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "1", - "KeepComments": "true", - "MinimalRebuild": "true", - "ObjectFile": "$(IntDir)\\b", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMP": "true", - "Optimization": "3", - "PrecompiledHeaderFile": "$(IntDir)\\$(TargetName).pche", - "PrecompiledHeaderThrough": "StdAfx.hd", - "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", - "ProgramDataBaseFileName": "$(IntDir)\\vc90b.pdb", - "RuntimeLibrary": "3", - "RuntimeTypeInfo": "false", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "3", - "SuppressStartupBanner": "false", - "TreatWChar_tAsBuiltInType": "false", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "wer", - "UseFullPaths": "true", - "UsePrecompiledHeader": "0", - "UseUnicodeResponseFiles": "false", - "WarnAsError": "true", - "WarningLevel": "3", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "$(IntDir)\\c", - }, - "VCLinkerTool": { - "AdditionalDependencies": "zx", - "AdditionalLibraryDirectories": "asd", - "AdditionalManifestDependencies": "s2", - "AdditionalOptions": "/mor2", - "AddModuleNamesToAssembly": "d1", - "AllowIsolation": "false", - "AssemblyDebug": "1", - "AssemblyLinkResource": "d5", - "BaseAddress": "23423", - "CLRImageType": "3", - "CLRThreadAttribute": "1", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "0", - "DelayLoadDLLs": "d4", - "DelaySign": "true", - "Driver": "2", - "EmbedManagedResourceFile": "d2", - "EnableCOMDATFolding": "1", - "EnableUAC": "false", - "EntryPointSymbol": "f5", - "ErrorReporting": "2", - "FixedBaseAddress": "1", - "ForceSymbolReferences": "d3", - "FunctionOrder": "fssdfsd", - "GenerateDebugInformation": "true", - "GenerateManifest": "false", - "GenerateMapFile": "true", - "HeapCommitSize": "13", - "HeapReserveSize": "12", - "IgnoreAllDefaultLibraries": "true", - "IgnoreDefaultLibraryNames": "flob;flok", - "IgnoreEmbeddedIDL": "true", - "IgnoreImportLibrary": "true", - "ImportLibrary": "f4", - "KeyContainer": "f7", - "KeyFile": "f6", - "LargeAddressAware": "2", - "LinkIncremental": "0", - "LinkLibraryDependencies": "false", - "LinkTimeCodeGeneration": "1", - "ManifestFile": "$(IntDir)\\$(TargetFileName).2intermediate.manifest", - "MapExports": "true", - "MapFileName": "d5", - "MergedIDLBaseFileName": "f2", - "MergeSections": "f5", - "MidlCommandFile": "f1", - "ModuleDefinitionFile": "sdsd", - "OptimizeForWindows98": "2", - "OptimizeReferences": "2", - "OutputFile": "$(OutDir)\\$(ProjectName)2.exe", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", - "ProgramDatabaseFile": "Flob.pdb", - "RandomizedBaseAddress": "1", - "RegisterOutput": "true", - "ResourceOnlyDLL": "true", - "SetChecksum": "false", - "ShowProgress": "1", - "StackCommitSize": "15", - "StackReserveSize": "14", - "StripPrivateSymbols": "d3", - "SubSystem": "1", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "false", - "SwapRunFromCD": "true", - "SwapRunFromNet": "true", - "TargetMachine": "1", - "TerminalServerAware": "1", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "f3", - "TypeLibraryResourceID": "12", - "UACExecutionLevel": "2", - "UACUIAccess": "true", - "UseLibraryDependencyInputs": "true", - "UseUnicodeResponseFiles": "false", - "Version": "333", - }, - "VCResourceCompilerTool": { - "AdditionalIncludeDirectories": "f3", - "AdditionalOptions": "/more3", - "Culture": "3084", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "_UNICODE;UNICODE2", - "ResourceOutputFileName": "$(IntDir)/$(InputName)3.res", - "ShowProgress": "true", - }, - "VCManifestTool": { - "AdditionalManifestFiles": "sfsdfsd", - "AdditionalOptions": "afdsdafsd", - "AssemblyIdentity": "sddfdsadfsa", - "ComponentFileName": "fsdfds", - "DependencyInformationFile": "$(IntDir)\\mt.depdfd", - "EmbedManifest": "false", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "asfsfdafs", - "ManifestResourceFile": - "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf", - "OutputManifestFile": "$(TargetPath).manifestdfs", - "RegistrarScriptFile": "sdfsfd", - "ReplacementsFile": "sdffsd", - "SuppressStartupBanner": "false", - "TypeLibraryFile": "sfsd", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "sfsd", - "UseFAT32Workaround": "true", - "UseUnicodeResponseFiles": "false", - "VerboseOutput": "true", - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/more /J", - "AdditionalUsingDirectories": "test", - "AssemblerListingLocation": "$(IntDir)a", - "AssemblerOutput": "AssemblyCode", - "BasicRuntimeChecks": "EnableFastChecks", - "BrowseInformation": "true", - "BrowseInformationFile": "$(IntDir)e", - "BufferSecurityCheck": "false", - "CallingConvention": "FastCall", - "CompileAs": "CompileAsC", - "DebugInformationFormat": "EditAndContinue", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "abc", - "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", - "EnableFiberSafeOptimizations": "true", - "EnablePREfast": "true", - "ErrorReporting": "Queue", - "ExceptionHandling": "Async", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "Size", - "FloatingPointExceptions": "true", - "FloatingPointModel": "Strict", - "ForceConformanceInForLoopScope": "false", - "ForcedIncludeFiles": "def", - "ForcedUsingFiles": "ge", - "FunctionLevelLinking": "true", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "OnlyExplicitInline", - "IntrinsicFunctions": "true", - "MinimalRebuild": "true", - "ObjectFileName": "$(IntDir)b", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMPSupport": "true", - "Optimization": "Full", - "PrecompiledHeader": "NotUsing", # Actual conversion gives '' - "PrecompiledHeaderFile": "StdAfx.hd", - "PrecompiledHeaderOutputFile": "$(IntDir)$(TargetName).pche", - "PreprocessKeepComments": "true", - "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", - "PreprocessSuppressLineNumbers": "true", - "PreprocessToFile": "true", - "ProgramDataBaseFileName": "$(IntDir)vc90b.pdb", - "RuntimeLibrary": "MultiThreadedDebugDLL", - "RuntimeTypeInfo": "false", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "4Bytes", - "SuppressStartupBanner": "false", - "TreatWarningAsError": "true", - "TreatWChar_tAsBuiltInType": "false", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "wer", - "UseFullPaths": "true", - "WarningLevel": "Level3", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "$(IntDir)c", - }, - "Link": { - "AdditionalDependencies": "zx", - "AdditionalLibraryDirectories": "asd", - "AdditionalManifestDependencies": "s2", - "AdditionalOptions": "/mor2", - "AddModuleNamesToAssembly": "d1", - "AllowIsolation": "false", - "AssemblyDebug": "true", - "AssemblyLinkResource": "d5", - "BaseAddress": "23423", - "CLRImageType": "ForceSafeILImage", - "CLRThreadAttribute": "MTAThreadingAttribute", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "", - "DelayLoadDLLs": "d4", - "DelaySign": "true", - "Driver": "UpOnly", - "EmbedManagedResourceFile": "d2", - "EnableCOMDATFolding": "false", - "EnableUAC": "false", - "EntryPointSymbol": "f5", - "FixedBaseAddress": "false", - "ForceSymbolReferences": "d3", - "FunctionOrder": "fssdfsd", - "GenerateDebugInformation": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "13", - "HeapReserveSize": "12", - "IgnoreAllDefaultLibraries": "true", - "IgnoreEmbeddedIDL": "true", - "IgnoreSpecificDefaultLibraries": "flob;flok", - "ImportLibrary": "f4", - "KeyContainer": "f7", - "KeyFile": "f6", - "LargeAddressAware": "true", - "LinkErrorReporting": "QueueForNextLogin", - "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", - "ManifestFile": "$(IntDir)$(TargetFileName).2intermediate.manifest", - "MapExports": "true", - "MapFileName": "d5", - "MergedIDLBaseFileName": "f2", - "MergeSections": "f5", - "MidlCommandFile": "f1", - "ModuleDefinitionFile": "sdsd", - "NoEntryPoint": "true", - "OptimizeReferences": "true", - "OutputFile": "$(OutDir)$(ProjectName)2.exe", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", - "ProgramDatabaseFile": "Flob.pdb", - "RandomizedBaseAddress": "false", - "RegisterOutput": "true", - "SetChecksum": "false", - "ShowProgress": "LinkVerbose", - "StackCommitSize": "15", - "StackReserveSize": "14", - "StripPrivateSymbols": "d3", - "SubSystem": "Console", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "false", - "SwapRunFromCD": "true", - "SwapRunFromNET": "true", - "TargetMachine": "MachineX86", - "TerminalServerAware": "false", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "f3", - "TypeLibraryResourceID": "12", - "UACExecutionLevel": "RequireAdministrator", - "UACUIAccess": "true", - "Version": "333", - }, - "ResourceCompile": { - "AdditionalIncludeDirectories": "f3", - "AdditionalOptions": "/more3", - "Culture": "0x0c0c", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "_UNICODE;UNICODE2", - "ResourceOutputFileName": "$(IntDir)%(Filename)3.res", - "ShowProgress": "true", - }, - "Manifest": { - "AdditionalManifestFiles": "sfsdfsd", - "AdditionalOptions": "afdsdafsd", - "AssemblyIdentity": "sddfdsadfsa", - "ComponentFileName": "fsdfds", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "asfsfdafs", - "OutputManifestFile": "$(TargetPath).manifestdfs", - "RegistrarScriptFile": "sdfsfd", - "ReplacementsFile": "sdffsd", - "SuppressStartupBanner": "false", - "TypeLibraryFile": "sfsd", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "sfsd", - "VerboseOutput": "true", - }, - "ProjectReference": { - "LinkLibraryDependencies": "false", - "UseLibraryDependencyInputs": "true", - }, - "": { - "EmbedManifest": "false", - "GenerateManifest": "false", - "IgnoreImportLibrary": "true", - "LinkIncremental": "", - }, - "ManifestResourceCompile": { - "ResourceOutputFileName": - "$(IntDir)$(TargetFileName).embed.manifest.resfdsf" - }, - } - self.maxDiff = 9999 # on failure display a long diff - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py deleted file mode 100644 index 2e5c811bd..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Visual Studio project reader/writer.""" - -import gyp.easy_xml as easy_xml - - -class Writer: - """Visual Studio XML tool file writer.""" - - def __init__(self, tool_file_path, name): - """Initializes the tool file. - - Args: - tool_file_path: Path to the tool file. - name: Name of the tool file. - """ - self.tool_file_path = tool_file_path - self.name = name - self.rules_section = ["Rules"] - - def AddCustomBuildRule( - self, name, cmd, description, additional_dependencies, outputs, extensions - ): - """Adds a rule to the tool file. - - Args: - name: Name of the rule. - description: Description of the rule. - cmd: Command line of the rule. - additional_dependencies: other files which may trigger the rule. - outputs: outputs of the rule. - extensions: extensions handled by the rule. - """ - rule = [ - "CustomBuildRule", - { - "Name": name, - "ExecutionDescription": description, - "CommandLine": cmd, - "Outputs": ";".join(outputs), - "FileExtensions": ";".join(extensions), - "AdditionalDependencies": ";".join(additional_dependencies), - }, - ] - self.rules_section.append(rule) - - def WriteIfChanged(self): - """Writes the tool file.""" - content = [ - "VisualStudioToolFile", - {"Version": "8.00", "Name": self.name}, - self.rules_section, - ] - easy_xml.WriteXmlIfChanged( - content, self.tool_file_path, encoding="Windows-1252" - ) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py deleted file mode 100644 index e580c00fb..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Visual Studio user preferences file writer.""" - -import os -import re -import socket # for gethostname - -import gyp.easy_xml as easy_xml - - -# ------------------------------------------------------------------------------ - - -def _FindCommandInPath(command): - """If there are no slashes in the command given, this function - searches the PATH env to find the given command, and converts it - to an absolute path. We have to do this because MSVS is looking - for an actual file to launch a debugger on, not just a command - line. Note that this happens at GYP time, so anything needing to - be built needs to have a full path.""" - if "/" in command or "\\" in command: - # If the command already has path elements (either relative or - # absolute), then assume it is constructed properly. - return command - else: - # Search through the path list and find an existing file that - # we can access. - paths = os.environ.get("PATH", "").split(os.pathsep) - for path in paths: - item = os.path.join(path, command) - if os.path.isfile(item) and os.access(item, os.X_OK): - return item - return command - - -def _QuoteWin32CommandLineArgs(args): - new_args = [] - for arg in args: - # Replace all double-quotes with double-double-quotes to escape - # them for cmd shell, and then quote the whole thing if there - # are any. - if arg.find('"') != -1: - arg = '""'.join(arg.split('"')) - arg = '"%s"' % arg - - # Otherwise, if there are any spaces, quote the whole arg. - elif re.search(r"[ \t\n]", arg): - arg = '"%s"' % arg - new_args.append(arg) - return new_args - - -class Writer: - """Visual Studio XML user user file writer.""" - - def __init__(self, user_file_path, version, name): - """Initializes the user file. - - Args: - user_file_path: Path to the user file. - version: Version info. - name: Name of the user file. - """ - self.user_file_path = user_file_path - self.version = version - self.name = name - self.configurations = {} - - def AddConfig(self, name): - """Adds a configuration to the project. - - Args: - name: Configuration name. - """ - self.configurations[name] = ["Configuration", {"Name": name}] - - def AddDebugSettings( - self, config_name, command, environment={}, working_directory="" - ): - """Adds a DebugSettings node to the user file for a particular config. - - Args: - command: command line to run. First element in the list is the - executable. All elements of the command will be quoted if - necessary. - working_directory: other files which may trigger the rule. (optional) - """ - command = _QuoteWin32CommandLineArgs(command) - - abs_command = _FindCommandInPath(command[0]) - - if environment and isinstance(environment, dict): - env_list = [f'{key}="{val}"' for (key, val) in environment.items()] - environment = " ".join(env_list) - else: - environment = "" - - n_cmd = [ - "DebugSettings", - { - "Command": abs_command, - "WorkingDirectory": working_directory, - "CommandArguments": " ".join(command[1:]), - "RemoteMachine": socket.gethostname(), - "Environment": environment, - "EnvironmentMerge": "true", - # Currently these are all "dummy" values that we're just setting - # in the default manner that MSVS does it. We could use some of - # these to add additional capabilities, I suppose, but they might - # not have parity with other platforms then. - "Attach": "false", - "DebuggerType": "3", # 'auto' debugger - "Remote": "1", - "RemoteCommand": "", - "HttpUrl": "", - "PDBPath": "", - "SQLDebugging": "", - "DebuggerFlavor": "0", - "MPIRunCommand": "", - "MPIRunArguments": "", - "MPIRunWorkingDirectory": "", - "ApplicationCommand": "", - "ApplicationArguments": "", - "ShimCommand": "", - "MPIAcceptMode": "", - "MPIAcceptFilter": "", - }, - ] - - # Find the config, and add it if it doesn't exist. - if config_name not in self.configurations: - self.AddConfig(config_name) - - # Add the DebugSettings onto the appropriate config. - self.configurations[config_name].append(n_cmd) - - def WriteIfChanged(self): - """Writes the user file.""" - configs = ["Configurations"] - for config, spec in sorted(self.configurations.items()): - configs.append(spec) - - content = [ - "VisualStudioUserFile", - {"Version": self.version.ProjectVersion(), "Name": self.name}, - configs, - ] - easy_xml.WriteXmlIfChanged( - content, self.user_file_path, encoding="Windows-1252" - ) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py deleted file mode 100644 index 36bb782bd..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +++ /dev/null @@ -1,271 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions shared amongst the Windows generators.""" - -import copy -import os - - -# A dictionary mapping supported target types to extensions. -TARGET_TYPE_EXT = { - "executable": "exe", - "loadable_module": "dll", - "shared_library": "dll", - "static_library": "lib", - "windows_driver": "sys", -} - - -def _GetLargePdbShimCcPath(): - """Returns the path of the large_pdb_shim.cc file.""" - this_dir = os.path.abspath(os.path.dirname(__file__)) - src_dir = os.path.abspath(os.path.join(this_dir, "..", "..")) - win_data_dir = os.path.join(src_dir, "data", "win") - large_pdb_shim_cc = os.path.join(win_data_dir, "large-pdb-shim.cc") - return large_pdb_shim_cc - - -def _DeepCopySomeKeys(in_dict, keys): - """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. - - Arguments: - in_dict: The dictionary to copy. - keys: The keys to be copied. If a key is in this list and doesn't exist in - |in_dict| this is not an error. - Returns: - The partially deep-copied dictionary. - """ - d = {} - for key in keys: - if key not in in_dict: - continue - d[key] = copy.deepcopy(in_dict[key]) - return d - - -def _SuffixName(name, suffix): - """Add a suffix to the end of a target. - - Arguments: - name: name of the target (foo#target) - suffix: the suffix to be added - Returns: - Target name with suffix added (foo_suffix#target) - """ - parts = name.rsplit("#", 1) - parts[0] = f"{parts[0]}_{suffix}" - return "#".join(parts) - - -def _ShardName(name, number): - """Add a shard number to the end of a target. - - Arguments: - name: name of the target (foo#target) - number: shard number - Returns: - Target name with shard added (foo_1#target) - """ - return _SuffixName(name, str(number)) - - -def ShardTargets(target_list, target_dicts): - """Shard some targets apart to work around the linkers limits. - - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - Returns: - Tuple of the new sharded versions of the inputs. - """ - # Gather the targets to shard, and how many pieces. - targets_to_shard = {} - for t in target_dicts: - shards = int(target_dicts[t].get("msvs_shard", 0)) - if shards: - targets_to_shard[t] = shards - # Shard target_list. - new_target_list = [] - for t in target_list: - if t in targets_to_shard: - for i in range(targets_to_shard[t]): - new_target_list.append(_ShardName(t, i)) - else: - new_target_list.append(t) - # Shard target_dict. - new_target_dicts = {} - for t in target_dicts: - if t in targets_to_shard: - for i in range(targets_to_shard[t]): - name = _ShardName(t, i) - new_target_dicts[name] = copy.copy(target_dicts[t]) - new_target_dicts[name]["target_name"] = _ShardName( - new_target_dicts[name]["target_name"], i - ) - sources = new_target_dicts[name].get("sources", []) - new_sources = [] - for pos in range(i, len(sources), targets_to_shard[t]): - new_sources.append(sources[pos]) - new_target_dicts[name]["sources"] = new_sources - else: - new_target_dicts[t] = target_dicts[t] - # Shard dependencies. - for t in sorted(new_target_dicts): - for deptype in ("dependencies", "dependencies_original"): - dependencies = copy.copy(new_target_dicts[t].get(deptype, [])) - new_dependencies = [] - for d in dependencies: - if d in targets_to_shard: - for i in range(targets_to_shard[d]): - new_dependencies.append(_ShardName(d, i)) - else: - new_dependencies.append(d) - new_target_dicts[t][deptype] = new_dependencies - - return (new_target_list, new_target_dicts) - - -def _GetPdbPath(target_dict, config_name, vars): - """Returns the path to the PDB file that will be generated by a given - configuration. - - The lookup proceeds as follows: - - Look for an explicit path in the VCLinkerTool configuration block. - - Look for an 'msvs_large_pdb_path' variable. - - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is - specified. - - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'. - - Arguments: - target_dict: The target dictionary to be searched. - config_name: The name of the configuration of interest. - vars: A dictionary of common GYP variables with generator-specific values. - Returns: - The path of the corresponding PDB file. - """ - config = target_dict["configurations"][config_name] - msvs = config.setdefault("msvs_settings", {}) - - linker = msvs.get("VCLinkerTool", {}) - - pdb_path = linker.get("ProgramDatabaseFile") - if pdb_path: - return pdb_path - - variables = target_dict.get("variables", {}) - pdb_path = variables.get("msvs_large_pdb_path", None) - if pdb_path: - return pdb_path - - pdb_base = target_dict.get("product_name", target_dict["target_name"]) - pdb_base = "{}.{}.pdb".format(pdb_base, TARGET_TYPE_EXT[target_dict["type"]]) - pdb_path = vars["PRODUCT_DIR"] + "/" + pdb_base - - return pdb_path - - -def InsertLargePdbShims(target_list, target_dicts, vars): - """Insert a shim target that forces the linker to use 4KB pagesize PDBs. - - This is a workaround for targets with PDBs greater than 1GB in size, the - limit for the 1KB pagesize PDBs created by the linker by default. - - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - vars: A dictionary of common GYP variables with generator-specific values. - Returns: - Tuple of the shimmed version of the inputs. - """ - # Determine which targets need shimming. - targets_to_shim = [] - for t in target_dicts: - target_dict = target_dicts[t] - - # We only want to shim targets that have msvs_large_pdb enabled. - if not int(target_dict.get("msvs_large_pdb", 0)): - continue - # This is intended for executable, shared_library and loadable_module - # targets where every configuration is set up to produce a PDB output. - # If any of these conditions is not true then the shim logic will fail - # below. - targets_to_shim.append(t) - - large_pdb_shim_cc = _GetLargePdbShimCcPath() - - for t in targets_to_shim: - target_dict = target_dicts[t] - target_name = target_dict.get("target_name") - - base_dict = _DeepCopySomeKeys( - target_dict, ["configurations", "default_configuration", "toolset"] - ) - - # This is the dict for copying the source file (part of the GYP tree) - # to the intermediate directory of the project. This is necessary because - # we can't always build a relative path to the shim source file (on Windows - # GYP and the project may be on different drives), and Ninja hates absolute - # paths (it ends up generating the .obj and .obj.d alongside the source - # file, polluting GYPs tree). - copy_suffix = "large_pdb_copy" - copy_target_name = target_name + "_" + copy_suffix - full_copy_target_name = _SuffixName(t, copy_suffix) - shim_cc_basename = os.path.basename(large_pdb_shim_cc) - shim_cc_dir = vars["SHARED_INTERMEDIATE_DIR"] + "/" + copy_target_name - shim_cc_path = shim_cc_dir + "/" + shim_cc_basename - copy_dict = copy.deepcopy(base_dict) - copy_dict["target_name"] = copy_target_name - copy_dict["type"] = "none" - copy_dict["sources"] = [large_pdb_shim_cc] - copy_dict["copies"] = [ - {"destination": shim_cc_dir, "files": [large_pdb_shim_cc]} - ] - - # This is the dict for the PDB generating shim target. It depends on the - # copy target. - shim_suffix = "large_pdb_shim" - shim_target_name = target_name + "_" + shim_suffix - full_shim_target_name = _SuffixName(t, shim_suffix) - shim_dict = copy.deepcopy(base_dict) - shim_dict["target_name"] = shim_target_name - shim_dict["type"] = "static_library" - shim_dict["sources"] = [shim_cc_path] - shim_dict["dependencies"] = [full_copy_target_name] - - # Set up the shim to output its PDB to the same location as the final linker - # target. - for config_name, config in shim_dict.get("configurations").items(): - pdb_path = _GetPdbPath(target_dict, config_name, vars) - - # A few keys that we don't want to propagate. - for key in ["msvs_precompiled_header", "msvs_precompiled_source", "test"]: - config.pop(key, None) - - msvs = config.setdefault("msvs_settings", {}) - - # Update the compiler directives in the shim target. - compiler = msvs.setdefault("VCCLCompilerTool", {}) - compiler["DebugInformationFormat"] = "3" - compiler["ProgramDataBaseFileName"] = pdb_path - - # Set the explicit PDB path in the appropriate configuration of the - # original target. - config = target_dict["configurations"][config_name] - msvs = config.setdefault("msvs_settings", {}) - linker = msvs.setdefault("VCLinkerTool", {}) - linker["GenerateDebugInformation"] = "true" - linker["ProgramDatabaseFile"] = pdb_path - - # Add the new targets. They must go to the beginning of the list so that - # the dependency generation works as expected in ninja. - target_list.insert(0, full_copy_target_name) - target_list.insert(0, full_shim_target_name) - target_dicts[full_copy_target_name] = copy_dict - target_dicts[full_shim_target_name] = shim_dict - - # Update the original target to depend on the shim target. - target_dict.setdefault("dependencies", []).append(full_shim_target_name) - - return (target_list, target_dicts) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py deleted file mode 100644 index 8d7f21e82..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +++ /dev/null @@ -1,574 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Handle version information related to Visual Stuio.""" - -import errno -import os -import re -import subprocess -import sys -import glob - - -def JoinPath(*args): - return os.path.normpath(os.path.join(*args)) - - -class VisualStudioVersion: - """Information regarding a version of Visual Studio.""" - - def __init__( - self, - short_name, - description, - solution_version, - project_version, - flat_sln, - uses_vcxproj, - path, - sdk_based, - default_toolset=None, - compatible_sdks=None, - ): - self.short_name = short_name - self.description = description - self.solution_version = solution_version - self.project_version = project_version - self.flat_sln = flat_sln - self.uses_vcxproj = uses_vcxproj - self.path = path - self.sdk_based = sdk_based - self.default_toolset = default_toolset - compatible_sdks = compatible_sdks or [] - compatible_sdks.sort(key=lambda v: float(v.replace("v", "")), reverse=True) - self.compatible_sdks = compatible_sdks - - def ShortName(self): - return self.short_name - - def Description(self): - """Get the full description of the version.""" - return self.description - - def SolutionVersion(self): - """Get the version number of the sln files.""" - return self.solution_version - - def ProjectVersion(self): - """Get the version number of the vcproj or vcxproj files.""" - return self.project_version - - def FlatSolution(self): - return self.flat_sln - - def UsesVcxproj(self): - """Returns true if this version uses a vcxproj file.""" - return self.uses_vcxproj - - def ProjectExtension(self): - """Returns the file extension for the project.""" - return self.uses_vcxproj and ".vcxproj" or ".vcproj" - - def Path(self): - """Returns the path to Visual Studio installation.""" - return self.path - - def ToolPath(self, tool): - """Returns the path to a given compiler tool. """ - return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) - - def DefaultToolset(self): - """Returns the msbuild toolset version that will be used in the absence - of a user override.""" - return self.default_toolset - - def _SetupScriptInternal(self, target_arch): - """Returns a command (with arguments) to be used to set up the - environment.""" - assert target_arch in ("x86", "x64"), "target_arch not supported" - # If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the - # depot_tools build tools and should run SetEnv.Cmd to set up the - # environment. The check for WindowsSDKDir alone is not sufficient because - # this is set by running vcvarsall.bat. - sdk_dir = os.environ.get("WindowsSDKDir", "") - setup_path = JoinPath(sdk_dir, "Bin", "SetEnv.Cmd") - if self.sdk_based and sdk_dir and os.path.exists(setup_path): - return [setup_path, "/" + target_arch] - - is_host_arch_x64 = ( - os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" - or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" - ) - - # For VS2017 (and newer) it's fairly easy - if self.short_name >= "2017": - script_path = JoinPath( - self.path, "VC", "Auxiliary", "Build", "vcvarsall.bat" - ) - - # Always use a native executable, cross-compiling if necessary. - host_arch = "amd64" if is_host_arch_x64 else "x86" - msvc_target_arch = "amd64" if target_arch == "x64" else "x86" - arg = host_arch - if host_arch != msvc_target_arch: - arg += "_" + msvc_target_arch - - return [script_path, arg] - - # We try to find the best version of the env setup batch. - vcvarsall = JoinPath(self.path, "VC", "vcvarsall.bat") - if target_arch == "x86": - if ( - self.short_name >= "2013" - and self.short_name[-1] != "e" - and is_host_arch_x64 - ): - # VS2013 and later, non-Express have a x64-x86 cross that we want - # to prefer. - return [vcvarsall, "amd64_x86"] - else: - # Otherwise, the standard x86 compiler. We don't use VC/vcvarsall.bat - # for x86 because vcvarsall calls vcvars32, which it can only find if - # VS??COMNTOOLS is set, which isn't guaranteed. - return [JoinPath(self.path, "Common7", "Tools", "vsvars32.bat")] - elif target_arch == "x64": - arg = "x86_amd64" - # Use the 64-on-64 compiler if we're not using an express edition and - # we're running on a 64bit OS. - if self.short_name[-1] != "e" and is_host_arch_x64: - arg = "amd64" - return [vcvarsall, arg] - - def SetupScript(self, target_arch): - script_data = self._SetupScriptInternal(target_arch) - script_path = script_data[0] - if not os.path.exists(script_path): - raise Exception( - "%s is missing - make sure VC++ tools are installed." % script_path - ) - return script_data - - -def _RegistryQueryBase(sysdir, key, value): - """Use reg.exe to read a particular key. - - While ideally we might use the win32 module, we would like gyp to be - python neutral, so for instance cygwin python lacks this module. - - Arguments: - sysdir: The system subdirectory to attempt to launch reg.exe from. - key: The registry key to read from. - value: The particular value to read. - Return: - stdout from reg.exe, or None for failure. - """ - # Skip if not on Windows or Python Win32 setup issue - if sys.platform not in ("win32", "cygwin"): - return None - # Setup params to pass to and attempt to launch reg.exe - cmd = [os.path.join(os.environ.get("WINDIR", ""), sysdir, "reg.exe"), "query", key] - if value: - cmd.extend(["/v", value]) - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid - # Note that the error text may be in [1] in some cases - text = p.communicate()[0].decode("utf-8") - # Check return code from reg.exe; officially 0==success and 1==error - if p.returncode: - return None - return text - - -def _RegistryQuery(key, value=None): - r"""Use reg.exe to read a particular key through _RegistryQueryBase. - - First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If - that fails, it falls back to System32. Sysnative is available on Vista and - up and available on Windows Server 2003 and XP through KB patch 942589. Note - that Sysnative will always fail if using 64-bit python due to it being a - virtual directory and System32 will work correctly in the first place. - - KB 942589 - http://support.microsoft.com/kb/942589/en-us. - - Arguments: - key: The registry key. - value: The particular registry value to read (optional). - Return: - stdout from reg.exe, or None for failure. - """ - text = None - try: - text = _RegistryQueryBase("Sysnative", key, value) - except OSError as e: - if e.errno == errno.ENOENT: - text = _RegistryQueryBase("System32", key, value) - else: - raise - return text - - -def _RegistryGetValueUsingWinReg(key, value): - """Use the _winreg module to obtain the value of a registry key. - - Args: - key: The registry key. - value: The particular registry value to read. - Return: - contents of the registry key's value, or None on failure. Throws - ImportError if winreg is unavailable. - """ - from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx - try: - root, subkey = key.split("\\", 1) - assert root == "HKLM" # Only need HKLM for now. - with OpenKey(HKEY_LOCAL_MACHINE, subkey) as hkey: - return QueryValueEx(hkey, value)[0] - except OSError: - return None - - -def _RegistryGetValue(key, value): - """Use _winreg or reg.exe to obtain the value of a registry key. - - Using _winreg is preferable because it solves an issue on some corporate - environments where access to reg.exe is locked down. However, we still need - to fallback to reg.exe for the case where the _winreg module is not available - (for example in cygwin python). - - Args: - key: The registry key. - value: The particular registry value to read. - Return: - contents of the registry key's value, or None on failure. - """ - try: - return _RegistryGetValueUsingWinReg(key, value) - except ImportError: - pass - - # Fallback to reg.exe if we fail to import _winreg. - text = _RegistryQuery(key, value) - if not text: - return None - # Extract value. - match = re.search(r"REG_\w+\s+([^\r]+)\r\n", text) - if not match: - return None - return match.group(1) - - -def _CreateVersion(name, path, sdk_based=False): - """Sets up MSVS project generation. - - Setup is based off the GYP_MSVS_VERSION environment variable or whatever is - autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is - passed in that doesn't match a value in versions python will throw a error. - """ - if path: - path = os.path.normpath(path) - versions = { - "2022": VisualStudioVersion( - "2022", - "Visual Studio 2022", - solution_version="12.00", - project_version="17.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v143", - compatible_sdks=["v8.1", "v10.0"], - ), - "2019": VisualStudioVersion( - "2019", - "Visual Studio 2019", - solution_version="12.00", - project_version="16.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v142", - compatible_sdks=["v8.1", "v10.0"], - ), - "2017": VisualStudioVersion( - "2017", - "Visual Studio 2017", - solution_version="12.00", - project_version="15.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v141", - compatible_sdks=["v8.1", "v10.0"], - ), - "2015": VisualStudioVersion( - "2015", - "Visual Studio 2015", - solution_version="12.00", - project_version="14.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v140", - ), - "2013": VisualStudioVersion( - "2013", - "Visual Studio 2013", - solution_version="13.00", - project_version="12.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v120", - ), - "2013e": VisualStudioVersion( - "2013e", - "Visual Studio 2013", - solution_version="13.00", - project_version="12.0", - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v120", - ), - "2012": VisualStudioVersion( - "2012", - "Visual Studio 2012", - solution_version="12.00", - project_version="4.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v110", - ), - "2012e": VisualStudioVersion( - "2012e", - "Visual Studio 2012", - solution_version="12.00", - project_version="4.0", - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v110", - ), - "2010": VisualStudioVersion( - "2010", - "Visual Studio 2010", - solution_version="11.00", - project_version="4.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - ), - "2010e": VisualStudioVersion( - "2010e", - "Visual C++ Express 2010", - solution_version="11.00", - project_version="4.0", - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - ), - "2008": VisualStudioVersion( - "2008", - "Visual Studio 2008", - solution_version="10.00", - project_version="9.00", - flat_sln=False, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - "2008e": VisualStudioVersion( - "2008e", - "Visual Studio 2008", - solution_version="10.00", - project_version="9.00", - flat_sln=True, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - "2005": VisualStudioVersion( - "2005", - "Visual Studio 2005", - solution_version="9.00", - project_version="8.00", - flat_sln=False, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - "2005e": VisualStudioVersion( - "2005e", - "Visual Studio 2005", - solution_version="9.00", - project_version="8.00", - flat_sln=True, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - } - return versions[str(name)] - - -def _ConvertToCygpath(path): - """Convert to cygwin path if we are using cygwin.""" - if sys.platform == "cygwin": - p = subprocess.Popen(["cygpath", path], stdout=subprocess.PIPE) - path = p.communicate()[0].decode("utf-8").strip() - return path - - -def _DetectVisualStudioVersions(versions_to_check, force_express): - """Collect the list of installed visual studio versions. - - Returns: - A list of visual studio versions installed in descending order of - usage preference. - Base this on the registry and a quick check if devenv.exe exists. - Possibilities are: - 2005(e) - Visual Studio 2005 (8) - 2008(e) - Visual Studio 2008 (9) - 2010(e) - Visual Studio 2010 (10) - 2012(e) - Visual Studio 2012 (11) - 2013(e) - Visual Studio 2013 (12) - 2015 - Visual Studio 2015 (14) - 2017 - Visual Studio 2017 (15) - 2019 - Visual Studio 2019 (16) - 2022 - Visual Studio 2022 (17) - Where (e) is e for express editions of MSVS and blank otherwise. - """ - version_to_year = { - "8.0": "2005", - "9.0": "2008", - "10.0": "2010", - "11.0": "2012", - "12.0": "2013", - "14.0": "2015", - "15.0": "2017", - "16.0": "2019", - "17.0": "2022", - } - versions = [] - for version in versions_to_check: - # Old method of searching for which VS version is installed - # We don't use the 2010-encouraged-way because we also want to get the - # path to the binaries, which it doesn't offer. - keys = [ - r"HKLM\Software\Microsoft\VisualStudio\%s" % version, - r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s" % version, - r"HKLM\Software\Microsoft\VCExpress\%s" % version, - r"HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s" % version, - ] - for index in range(len(keys)): - path = _RegistryGetValue(keys[index], "InstallDir") - if not path: - continue - path = _ConvertToCygpath(path) - # Check for full. - full_path = os.path.join(path, "devenv.exe") - express_path = os.path.join(path, "*express.exe") - if not force_express and os.path.exists(full_path): - # Add this one. - versions.append( - _CreateVersion( - version_to_year[version], os.path.join(path, "..", "..") - ) - ) - # Check for express. - elif glob.glob(express_path): - # Add this one. - versions.append( - _CreateVersion( - version_to_year[version] + "e", os.path.join(path, "..", "..") - ) - ) - - # The old method above does not work when only SDK is installed. - keys = [ - r"HKLM\Software\Microsoft\VisualStudio\SxS\VC7", - r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7", - r"HKLM\Software\Microsoft\VisualStudio\SxS\VS7", - r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7", - ] - for index in range(len(keys)): - path = _RegistryGetValue(keys[index], version) - if not path: - continue - path = _ConvertToCygpath(path) - if version == "15.0": - if os.path.exists(path): - versions.append(_CreateVersion("2017", path)) - elif version != "14.0": # There is no Express edition for 2015. - versions.append( - _CreateVersion( - version_to_year[version] + "e", - os.path.join(path, ".."), - sdk_based=True, - ) - ) - - return versions - - -def SelectVisualStudioVersion(version="auto", allow_fallback=True): - """Select which version of Visual Studio projects to generate. - - Arguments: - version: Hook to allow caller to force a particular version (vs auto). - Returns: - An object representing a visual studio project format version. - """ - # In auto mode, check environment variable for override. - if version == "auto": - version = os.environ.get("GYP_MSVS_VERSION", "auto") - version_map = { - "auto": ("17.0", "16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"), - "2005": ("8.0",), - "2005e": ("8.0",), - "2008": ("9.0",), - "2008e": ("9.0",), - "2010": ("10.0",), - "2010e": ("10.0",), - "2012": ("11.0",), - "2012e": ("11.0",), - "2013": ("12.0",), - "2013e": ("12.0",), - "2015": ("14.0",), - "2017": ("15.0",), - "2019": ("16.0",), - "2022": ("17.0",), - } - override_path = os.environ.get("GYP_MSVS_OVERRIDE_PATH") - if override_path: - msvs_version = os.environ.get("GYP_MSVS_VERSION") - if not msvs_version: - raise ValueError( - "GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be " - "set to a particular version (e.g. 2010e)." - ) - return _CreateVersion(msvs_version, override_path, sdk_based=True) - version = str(version) - versions = _DetectVisualStudioVersions(version_map[version], "e" in version) - if not versions: - if not allow_fallback: - raise ValueError("Could not locate Visual Studio installation.") - if version == "auto": - # Default to 2005 if we couldn't find anything - return _CreateVersion("2005", None) - else: - return _CreateVersion(version, None) - return versions[0] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/__init__.py deleted file mode 100755 index 6790ef96a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +++ /dev/null @@ -1,666 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import copy -import gyp.input -import argparse -import os.path -import re -import shlex -import sys -import traceback -from gyp.common import GypError - -# Default debug modes for GYP -debug = {} - -# List of "official" debug modes, but you can use anything you like. -DEBUG_GENERAL = "general" -DEBUG_VARIABLES = "variables" -DEBUG_INCLUDES = "includes" - - -def DebugOutput(mode, message, *args): - if "all" in gyp.debug or mode in gyp.debug: - ctx = ("unknown", 0, "unknown") - try: - f = traceback.extract_stack(limit=2) - if f: - ctx = f[0][:3] - except Exception: - pass - if args: - message %= args - print( - "%s:%s:%d:%s %s" - % (mode.upper(), os.path.basename(ctx[0]), ctx[1], ctx[2], message) - ) - - -def FindBuildFiles(): - extension = ".gyp" - files = os.listdir(os.getcwd()) - build_files = [] - for file in files: - if file.endswith(extension): - build_files.append(file) - return build_files - - -def Load( - build_files, - format, - default_variables={}, - includes=[], - depth=".", - params=None, - check=False, - circular_check=True, -): - """ - Loads one or more specified build files. - default_variables and includes will be copied before use. - Returns the generator for the specified format and the - data returned by loading the specified build files. - """ - if params is None: - params = {} - - if "-" in format: - format, params["flavor"] = format.split("-", 1) - - default_variables = copy.copy(default_variables) - - # Default variables provided by this program and its modules should be - # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, - # avoiding collisions with user and automatic variables. - default_variables["GENERATOR"] = format - default_variables["GENERATOR_FLAVOR"] = params.get("flavor", "") - - # Format can be a custom python file, or by default the name of a module - # within gyp.generator. - if format.endswith(".py"): - generator_name = os.path.splitext(format)[0] - path, generator_name = os.path.split(generator_name) - - # Make sure the path to the custom generator is in sys.path - # Don't worry about removing it once we are done. Keeping the path - # to each generator that is used in sys.path is likely harmless and - # arguably a good idea. - path = os.path.abspath(path) - if path not in sys.path: - sys.path.insert(0, path) - else: - generator_name = "gyp.generator." + format - - # These parameters are passed in order (as opposed to by key) - # because ActivePython cannot handle key parameters to __import__. - generator = __import__(generator_name, globals(), locals(), generator_name) - for (key, val) in generator.generator_default_variables.items(): - default_variables.setdefault(key, val) - - # Give the generator the opportunity to set additional variables based on - # the params it will receive in the output phase. - if getattr(generator, "CalculateVariables", None): - generator.CalculateVariables(default_variables, params) - - # Give the generator the opportunity to set generator_input_info based on - # the params it will receive in the output phase. - if getattr(generator, "CalculateGeneratorInputInfo", None): - generator.CalculateGeneratorInputInfo(params) - - # Fetch the generator specific info that gets fed to input, we use getattr - # so we can default things and the generators only have to provide what - # they need. - generator_input_info = { - "non_configuration_keys": getattr( - generator, "generator_additional_non_configuration_keys", [] - ), - "path_sections": getattr(generator, "generator_additional_path_sections", []), - "extra_sources_for_rules": getattr( - generator, "generator_extra_sources_for_rules", [] - ), - "generator_supports_multiple_toolsets": getattr( - generator, "generator_supports_multiple_toolsets", False - ), - "generator_wants_static_library_dependencies_adjusted": getattr( - generator, "generator_wants_static_library_dependencies_adjusted", True - ), - "generator_wants_sorted_dependencies": getattr( - generator, "generator_wants_sorted_dependencies", False - ), - "generator_filelist_paths": getattr( - generator, "generator_filelist_paths", None - ), - } - - # Process the input specific to this generator. - result = gyp.input.Load( - build_files, - default_variables, - includes[:], - depth, - generator_input_info, - check, - circular_check, - params["parallel"], - params["root_targets"], - ) - return [generator] + result - - -def NameValueListToDict(name_value_list): - """ - Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary - of the pairs. If a string is simply NAME, then the value in the dictionary - is set to True. If VALUE can be converted to an integer, it is. - """ - result = {} - for item in name_value_list: - tokens = item.split("=", 1) - if len(tokens) == 2: - # If we can make it an int, use that, otherwise, use the string. - try: - token_value = int(tokens[1]) - except ValueError: - token_value = tokens[1] - # Set the variable to the supplied value. - result[tokens[0]] = token_value - else: - # No value supplied, treat it as a boolean and set it. - result[tokens[0]] = True - return result - - -def ShlexEnv(env_name): - flags = os.environ.get(env_name, []) - if flags: - flags = shlex.split(flags) - return flags - - -def FormatOpt(opt, value): - if opt.startswith("--"): - return f"{opt}={value}" - return opt + value - - -def RegenerateAppendFlag(flag, values, predicate, env_name, options): - """Regenerate a list of command line flags, for an option of action='append'. - - The |env_name|, if given, is checked in the environment and used to generate - an initial list of options, then the options that were specified on the - command line (given in |values|) are appended. This matches the handling of - environment variables and command line flags where command line flags override - the environment, while not requiring the environment to be set when the flags - are used again. - """ - flags = [] - if options.use_environment and env_name: - for flag_value in ShlexEnv(env_name): - value = FormatOpt(flag, predicate(flag_value)) - if value in flags: - flags.remove(value) - flags.append(value) - if values: - for flag_value in values: - flags.append(FormatOpt(flag, predicate(flag_value))) - return flags - - -def RegenerateFlags(options): - """Given a parsed options object, and taking the environment variables into - account, returns a list of flags that should regenerate an equivalent options - object (even in the absence of the environment variables.) - - Any path options will be normalized relative to depth. - - The format flag is not included, as it is assumed the calling generator will - set that as appropriate. - """ - - def FixPath(path): - path = gyp.common.FixIfRelativePath(path, options.depth) - if not path: - return os.path.curdir - return path - - def Noop(value): - return value - - # We always want to ignore the environment when regenerating, to avoid - # duplicate or changed flags in the environment at the time of regeneration. - flags = ["--ignore-environment"] - for name, metadata in options._regeneration_metadata.items(): - opt = metadata["opt"] - value = getattr(options, name) - value_predicate = metadata["type"] == "path" and FixPath or Noop - action = metadata["action"] - env_name = metadata["env_name"] - if action == "append": - flags.extend( - RegenerateAppendFlag(opt, value, value_predicate, env_name, options) - ) - elif action in ("store", None): # None is a synonym for 'store'. - if value: - flags.append(FormatOpt(opt, value_predicate(value))) - elif options.use_environment and env_name and os.environ.get(env_name): - flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) - elif action in ("store_true", "store_false"): - if (action == "store_true" and value) or ( - action == "store_false" and not value - ): - flags.append(opt) - elif options.use_environment and env_name: - print( - "Warning: environment regeneration unimplemented " - "for %s flag %r env_name %r" % (action, opt, env_name), - file=sys.stderr, - ) - else: - print( - "Warning: regeneration unimplemented for action %r " - "flag %r" % (action, opt), - file=sys.stderr, - ) - - return flags - - -class RegeneratableOptionParser(argparse.ArgumentParser): - def __init__(self, usage): - self.__regeneratable_options = {} - argparse.ArgumentParser.__init__(self, usage=usage) - - def add_argument(self, *args, **kw): - """Add an option to the parser. - - This accepts the same arguments as ArgumentParser.add_argument, plus the - following: - regenerate: can be set to False to prevent this option from being included - in regeneration. - env_name: name of environment variable that additional values for this - option come from. - type: adds type='path', to tell the regenerator that the values of - this option need to be made relative to options.depth - """ - env_name = kw.pop("env_name", None) - if "dest" in kw and kw.pop("regenerate", True): - dest = kw["dest"] - - # The path type is needed for regenerating, for optparse we can just treat - # it as a string. - type = kw.get("type") - if type == "path": - kw["type"] = str - - self.__regeneratable_options[dest] = { - "action": kw.get("action"), - "type": type, - "env_name": env_name, - "opt": args[0], - } - - argparse.ArgumentParser.add_argument(self, *args, **kw) - - def parse_args(self, *args): - values, args = argparse.ArgumentParser.parse_known_args(self, *args) - values._regeneration_metadata = self.__regeneratable_options - return values, args - - -def gyp_main(args): - my_name = os.path.basename(sys.argv[0]) - usage = "usage: %(prog)s [options ...] [build_file ...]" - - parser = RegeneratableOptionParser(usage=usage.replace("%s", "%(prog)s")) - parser.add_argument( - "--build", - dest="configs", - action="append", - help="configuration for build after project generation", - ) - parser.add_argument( - "--check", dest="check", action="store_true", help="check format of gyp files" - ) - parser.add_argument( - "--config-dir", - dest="config_dir", - action="store", - env_name="GYP_CONFIG_DIR", - default=None, - help="The location for configuration files like " "include.gypi.", - ) - parser.add_argument( - "-d", - "--debug", - dest="debug", - metavar="DEBUGMODE", - action="append", - default=[], - help="turn on a debugging " - 'mode for debugging GYP. Supported modes are "variables", ' - '"includes" and "general" or "all" for all of them.', - ) - parser.add_argument( - "-D", - dest="defines", - action="append", - metavar="VAR=VAL", - env_name="GYP_DEFINES", - help="sets variable VAR to value VAL", - ) - parser.add_argument( - "--depth", - dest="depth", - metavar="PATH", - type="path", - help="set DEPTH gyp variable to a relative path to PATH", - ) - parser.add_argument( - "-f", - "--format", - dest="formats", - action="append", - env_name="GYP_GENERATORS", - regenerate=False, - help="output formats to generate", - ) - parser.add_argument( - "-G", - dest="generator_flags", - action="append", - default=[], - metavar="FLAG=VAL", - env_name="GYP_GENERATOR_FLAGS", - help="sets generator flag FLAG to VAL", - ) - parser.add_argument( - "--generator-output", - dest="generator_output", - action="store", - default=None, - metavar="DIR", - type="path", - env_name="GYP_GENERATOR_OUTPUT", - help="puts generated build files under DIR", - ) - parser.add_argument( - "--ignore-environment", - dest="use_environment", - action="store_false", - default=True, - regenerate=False, - help="do not read options from environment variables", - ) - parser.add_argument( - "-I", - "--include", - dest="includes", - action="append", - metavar="INCLUDE", - type="path", - help="files to include in all loaded .gyp files", - ) - # --no-circular-check disables the check for circular relationships between - # .gyp files. These relationships should not exist, but they've only been - # observed to be harmful with the Xcode generator. Chromium's .gyp files - # currently have some circular relationships on non-Mac platforms, so this - # option allows the strict behavior to be used on Macs and the lenient - # behavior to be used elsewhere. - # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. - parser.add_argument( - "--no-circular-check", - dest="circular_check", - action="store_false", - default=True, - regenerate=False, - help="don't check for circular relationships between files", - ) - parser.add_argument( - "--no-parallel", - action="store_true", - default=False, - help="Disable multiprocessing", - ) - parser.add_argument( - "-S", - "--suffix", - dest="suffix", - default="", - help="suffix to add to generated files", - ) - parser.add_argument( - "--toplevel-dir", - dest="toplevel_dir", - action="store", - default=None, - metavar="DIR", - type="path", - help="directory to use as the root of the source tree", - ) - parser.add_argument( - "-R", - "--root-target", - dest="root_targets", - action="append", - metavar="TARGET", - help="include only TARGET and its deep dependencies", - ) - - options, build_files_arg = parser.parse_args(args) - build_files = build_files_arg - - # Set up the configuration directory (defaults to ~/.gyp) - if not options.config_dir: - home = None - home_dot_gyp = None - if options.use_environment: - home_dot_gyp = os.environ.get("GYP_CONFIG_DIR", None) - if home_dot_gyp: - home_dot_gyp = os.path.expanduser(home_dot_gyp) - - if not home_dot_gyp: - home_vars = ["HOME"] - if sys.platform in ("cygwin", "win32"): - home_vars.append("USERPROFILE") - for home_var in home_vars: - home = os.getenv(home_var) - if home: - home_dot_gyp = os.path.join(home, ".gyp") - if not os.path.exists(home_dot_gyp): - home_dot_gyp = None - else: - break - else: - home_dot_gyp = os.path.expanduser(options.config_dir) - - if home_dot_gyp and not os.path.exists(home_dot_gyp): - home_dot_gyp = None - - if not options.formats: - # If no format was given on the command line, then check the env variable. - generate_formats = [] - if options.use_environment: - generate_formats = os.environ.get("GYP_GENERATORS", []) - if generate_formats: - generate_formats = re.split(r"[\s,]", generate_formats) - if generate_formats: - options.formats = generate_formats - else: - # Nothing in the variable, default based on platform. - if sys.platform == "darwin": - options.formats = ["xcode"] - elif sys.platform in ("win32", "cygwin"): - options.formats = ["msvs"] - else: - options.formats = ["make"] - - if not options.generator_output and options.use_environment: - g_o = os.environ.get("GYP_GENERATOR_OUTPUT") - if g_o: - options.generator_output = g_o - - options.parallel = not options.no_parallel - - for mode in options.debug: - gyp.debug[mode] = 1 - - # Do an extra check to avoid work when we're not debugging. - if DEBUG_GENERAL in gyp.debug: - DebugOutput(DEBUG_GENERAL, "running with these options:") - for option, value in sorted(options.__dict__.items()): - if option[0] == "_": - continue - if isinstance(value, str): - DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) - else: - DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) - - if not build_files: - build_files = FindBuildFiles() - if not build_files: - raise GypError((usage + "\n\n%s: error: no build_file") % (my_name, my_name)) - - # TODO(mark): Chromium-specific hack! - # For Chromium, the gyp "depth" variable should always be a relative path - # to Chromium's top-level "src" directory. If no depth variable was set - # on the command line, try to find a "src" directory by looking at the - # absolute path to each build file's directory. The first "src" component - # found will be treated as though it were the path used for --depth. - if not options.depth: - for build_file in build_files: - build_file_dir = os.path.abspath(os.path.dirname(build_file)) - build_file_dir_components = build_file_dir.split(os.path.sep) - components_len = len(build_file_dir_components) - for index in range(components_len - 1, -1, -1): - if build_file_dir_components[index] == "src": - options.depth = os.path.sep.join(build_file_dir_components) - break - del build_file_dir_components[index] - - # If the inner loop found something, break without advancing to another - # build file. - if options.depth: - break - - if not options.depth: - raise GypError( - "Could not automatically locate src directory. This is" - "a temporary Chromium feature that will be removed. Use" - "--depth as a workaround." - ) - - # If toplevel-dir is not set, we assume that depth is the root of our source - # tree. - if not options.toplevel_dir: - options.toplevel_dir = options.depth - - # -D on the command line sets variable defaults - D isn't just for define, - # it's for default. Perhaps there should be a way to force (-F?) a - # variable's value so that it can't be overridden by anything else. - cmdline_default_variables = {} - defines = [] - if options.use_environment: - defines += ShlexEnv("GYP_DEFINES") - if options.defines: - defines += options.defines - cmdline_default_variables = NameValueListToDict(defines) - if DEBUG_GENERAL in gyp.debug: - DebugOutput( - DEBUG_GENERAL, "cmdline_default_variables: %s", cmdline_default_variables - ) - - # Set up includes. - includes = [] - - # If ~/.gyp/include.gypi exists, it'll be forcibly included into every - # .gyp file that's loaded, before anything else is included. - if home_dot_gyp: - default_include = os.path.join(home_dot_gyp, "include.gypi") - if os.path.exists(default_include): - print("Using overrides found in " + default_include) - includes.append(default_include) - - # Command-line --include files come after the default include. - if options.includes: - includes.extend(options.includes) - - # Generator flags should be prefixed with the target generator since they - # are global across all generator runs. - gen_flags = [] - if options.use_environment: - gen_flags += ShlexEnv("GYP_GENERATOR_FLAGS") - if options.generator_flags: - gen_flags += options.generator_flags - generator_flags = NameValueListToDict(gen_flags) - if DEBUG_GENERAL in gyp.debug.keys(): - DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) - - # Generate all requested formats (use a set in case we got one format request - # twice) - for format in set(options.formats): - params = { - "options": options, - "build_files": build_files, - "generator_flags": generator_flags, - "cwd": os.getcwd(), - "build_files_arg": build_files_arg, - "gyp_binary": sys.argv[0], - "home_dot_gyp": home_dot_gyp, - "parallel": options.parallel, - "root_targets": options.root_targets, - "target_arch": cmdline_default_variables.get("target_arch", ""), - } - - # Start with the default variables from the command line. - [generator, flat_list, targets, data] = Load( - build_files, - format, - cmdline_default_variables, - includes, - options.depth, - params, - options.check, - options.circular_check, - ) - - # TODO(mark): Pass |data| for now because the generator needs a list of - # build files that came in. In the future, maybe it should just accept - # a list, and not the whole data dict. - # NOTE: flat_list is the flattened dependency graph specifying the order - # that targets may be built. Build systems that operate serially or that - # need to have dependencies defined before dependents reference them should - # generate targets in the order specified in flat_list. - generator.GenerateOutput(flat_list, targets, data, params) - - if options.configs: - valid_configs = targets[flat_list[0]]["configurations"] - for conf in options.configs: - if conf not in valid_configs: - raise GypError("Invalid config specified via --build: %s" % conf) - generator.PerformBuild(data, options.configs, params) - - # Done - return 0 - - -def main(args): - try: - return gyp_main(args) - except GypError as e: - sys.stderr.write("gyp: %s\n" % e) - return 1 - - -# NOTE: setuptools generated console_scripts calls function with no arguments -def script_main(): - return main(sys.argv[1:]) - - -if __name__ == "__main__": - sys.exit(script_main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/common.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/common.py deleted file mode 100644 index 9213fcc5e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/common.py +++ /dev/null @@ -1,654 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import errno -import filecmp -import os.path -import re -import tempfile -import sys -import subprocess - -from collections.abc import MutableSet - - -# A minimal memoizing decorator. It'll blow up if the args aren't immutable, -# among other "problems". -class memoize: - def __init__(self, func): - self.func = func - self.cache = {} - - def __call__(self, *args): - try: - return self.cache[args] - except KeyError: - result = self.func(*args) - self.cache[args] = result - return result - - -class GypError(Exception): - """Error class representing an error, which is to be presented - to the user. The main entry point will catch and display this. - """ - - pass - - -def ExceptionAppend(e, msg): - """Append a message to the given exception's message.""" - if not e.args: - e.args = (msg,) - elif len(e.args) == 1: - e.args = (str(e.args[0]) + " " + msg,) - else: - e.args = (str(e.args[0]) + " " + msg,) + e.args[1:] - - -def FindQualifiedTargets(target, qualified_list): - """ - Given a list of qualified targets, return the qualified targets for the - specified |target|. - """ - return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] - - -def ParseQualifiedTarget(target): - # Splits a qualified target into a build file, target name and toolset. - - # NOTE: rsplit is used to disambiguate the Windows drive letter separator. - target_split = target.rsplit(":", 1) - if len(target_split) == 2: - [build_file, target] = target_split - else: - build_file = None - - target_split = target.rsplit("#", 1) - if len(target_split) == 2: - [target, toolset] = target_split - else: - toolset = None - - return [build_file, target, toolset] - - -def ResolveTarget(build_file, target, toolset): - # This function resolves a target into a canonical form: - # - a fully defined build file, either absolute or relative to the current - # directory - # - a target name - # - a toolset - # - # build_file is the file relative to which 'target' is defined. - # target is the qualified target. - # toolset is the default toolset for that target. - [parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target) - - if parsed_build_file: - if build_file: - # If a relative path, parsed_build_file is relative to the directory - # containing build_file. If build_file is not in the current directory, - # parsed_build_file is not a usable path as-is. Resolve it by - # interpreting it as relative to build_file. If parsed_build_file is - # absolute, it is usable as a path regardless of the current directory, - # and os.path.join will return it as-is. - build_file = os.path.normpath( - os.path.join(os.path.dirname(build_file), parsed_build_file) - ) - # Further (to handle cases like ../cwd), make it relative to cwd) - if not os.path.isabs(build_file): - build_file = RelativePath(build_file, ".") - else: - build_file = parsed_build_file - - if parsed_toolset: - toolset = parsed_toolset - - return [build_file, target, toolset] - - -def BuildFile(fully_qualified_target): - # Extracts the build file from the fully qualified target. - return ParseQualifiedTarget(fully_qualified_target)[0] - - -def GetEnvironFallback(var_list, default): - """Look up a key in the environment, with fallback to secondary keys - and finally falling back to a default value.""" - for var in var_list: - if var in os.environ: - return os.environ[var] - return default - - -def QualifiedTarget(build_file, target, toolset): - # "Qualified" means the file that a target was defined in and the target - # name, separated by a colon, suffixed by a # and the toolset name: - # /path/to/file.gyp:target_name#toolset - fully_qualified = build_file + ":" + target - if toolset: - fully_qualified = fully_qualified + "#" + toolset - return fully_qualified - - -@memoize -def RelativePath(path, relative_to, follow_path_symlink=True): - # Assuming both |path| and |relative_to| are relative to the current - # directory, returns a relative path that identifies path relative to - # relative_to. - # If |follow_symlink_path| is true (default) and |path| is a symlink, then - # this method returns a path to the real file represented by |path|. If it is - # false, this method returns a path to the symlink. If |path| is not a - # symlink, this option has no effect. - - # Convert to normalized (and therefore absolute paths). - if follow_path_symlink: - path = os.path.realpath(path) - else: - path = os.path.abspath(path) - relative_to = os.path.realpath(relative_to) - - # On Windows, we can't create a relative path to a different drive, so just - # use the absolute path. - if sys.platform == "win32": - if ( - os.path.splitdrive(path)[0].lower() - != os.path.splitdrive(relative_to)[0].lower() - ): - return path - - # Split the paths into components. - path_split = path.split(os.path.sep) - relative_to_split = relative_to.split(os.path.sep) - - # Determine how much of the prefix the two paths share. - prefix_len = len(os.path.commonprefix([path_split, relative_to_split])) - - # Put enough ".." components to back up out of relative_to to the common - # prefix, and then append the part of path_split after the common prefix. - relative_split = [os.path.pardir] * ( - len(relative_to_split) - prefix_len - ) + path_split[prefix_len:] - - if len(relative_split) == 0: - # The paths were the same. - return "" - - # Turn it back into a string and we're done. - return os.path.join(*relative_split) - - -@memoize -def InvertRelativePath(path, toplevel_dir=None): - """Given a path like foo/bar that is relative to toplevel_dir, return - the inverse relative path back to the toplevel_dir. - - E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path))) - should always produce the empty string, unless the path contains symlinks. - """ - if not path: - return path - toplevel_dir = "." if toplevel_dir is None else toplevel_dir - return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) - - -def FixIfRelativePath(path, relative_to): - # Like RelativePath but returns |path| unchanged if it is absolute. - if os.path.isabs(path): - return path - return RelativePath(path, relative_to) - - -def UnrelativePath(path, relative_to): - # Assuming that |relative_to| is relative to the current directory, and |path| - # is a path relative to the dirname of |relative_to|, returns a path that - # identifies |path| relative to the current directory. - rel_dir = os.path.dirname(relative_to) - return os.path.normpath(os.path.join(rel_dir, path)) - - -# re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at -# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02 -# and the documentation for various shells. - -# _quote is a pattern that should match any argument that needs to be quoted -# with double-quotes by EncodePOSIXShellArgument. It matches the following -# characters appearing anywhere in an argument: -# \t, \n, space parameter separators -# # comments -# $ expansions (quoted to always expand within one argument) -# % called out by IEEE 1003.1 XCU.2.2 -# & job control -# ' quoting -# (, ) subshell execution -# *, ?, [ pathname expansion -# ; command delimiter -# <, >, | redirection -# = assignment -# {, } brace expansion (bash) -# ~ tilde expansion -# It also matches the empty string, because "" (or '') is the only way to -# represent an empty string literal argument to a POSIX shell. -# -# This does not match the characters in _escape, because those need to be -# backslash-escaped regardless of whether they appear in a double-quoted -# string. -_quote = re.compile("[\t\n #$%&'()*;<=>?[{|}~]|^$") - -# _escape is a pattern that should match any character that needs to be -# escaped with a backslash, whether or not the argument matched the _quote -# pattern. _escape is used with re.sub to backslash anything in _escape's -# first match group, hence the (parentheses) in the regular expression. -# -# _escape matches the following characters appearing anywhere in an argument: -# " to prevent POSIX shells from interpreting this character for quoting -# \ to prevent POSIX shells from interpreting this character for escaping -# ` to prevent POSIX shells from interpreting this character for command -# substitution -# Missing from this list is $, because the desired behavior of -# EncodePOSIXShellArgument is to permit parameter (variable) expansion. -# -# Also missing from this list is !, which bash will interpret as the history -# expansion character when history is enabled. bash does not enable history -# by default in non-interactive shells, so this is not thought to be a problem. -# ! was omitted from this list because bash interprets "\!" as a literal string -# including the backslash character (avoiding history expansion but retaining -# the backslash), which would not be correct for argument encoding. Handling -# this case properly would also be problematic because bash allows the history -# character to be changed with the histchars shell variable. Fortunately, -# as history is not enabled in non-interactive shells and -# EncodePOSIXShellArgument is only expected to encode for non-interactive -# shells, there is no room for error here by ignoring !. -_escape = re.compile(r'(["\\`])') - - -def EncodePOSIXShellArgument(argument): - """Encodes |argument| suitably for consumption by POSIX shells. - - argument may be quoted and escaped as necessary to ensure that POSIX shells - treat the returned value as a literal representing the argument passed to - this function. Parameter (variable) expansions beginning with $ are allowed - to remain intact without escaping the $, to allow the argument to contain - references to variables to be expanded by the shell. - """ - - if not isinstance(argument, str): - argument = str(argument) - - if _quote.search(argument): - quote = '"' - else: - quote = "" - - encoded = quote + re.sub(_escape, r"\\\1", argument) + quote - - return encoded - - -def EncodePOSIXShellList(list): - """Encodes |list| suitably for consumption by POSIX shells. - - Returns EncodePOSIXShellArgument for each item in list, and joins them - together using the space character as an argument separator. - """ - - encoded_arguments = [] - for argument in list: - encoded_arguments.append(EncodePOSIXShellArgument(argument)) - return " ".join(encoded_arguments) - - -def DeepDependencyTargets(target_dicts, roots): - """Returns the recursive list of target dependencies.""" - dependencies = set() - pending = set(roots) - while pending: - # Pluck out one. - r = pending.pop() - # Skip if visited already. - if r in dependencies: - continue - # Add it. - dependencies.add(r) - # Add its children. - spec = target_dicts[r] - pending.update(set(spec.get("dependencies", []))) - pending.update(set(spec.get("dependencies_original", []))) - return list(dependencies - set(roots)) - - -def BuildFileTargets(target_list, build_file): - """From a target_list, returns the subset from the specified build_file. - """ - return [p for p in target_list if BuildFile(p) == build_file] - - -def AllTargets(target_list, target_dicts, build_file): - """Returns all targets (direct and dependencies) for the specified build_file. - """ - bftargets = BuildFileTargets(target_list, build_file) - deptargets = DeepDependencyTargets(target_dicts, bftargets) - return bftargets + deptargets - - -def WriteOnDiff(filename): - """Write to a file only if the new contents differ. - - Arguments: - filename: name of the file to potentially write to. - Returns: - A file like object which will write to temporary file and only overwrite - the target if it differs (on close). - """ - - class Writer: - """Wrapper around file which only covers the target if it differs.""" - - def __init__(self): - # On Cygwin remove the "dir" argument - # `C:` prefixed paths are treated as relative, - # consequently ending up with current dir "/cygdrive/c/..." - # being prefixed to those, which was - # obviously a non-existent path, - # for example: "/cygdrive/c//C:\". - # For more details see: - # https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp - base_temp_dir = "" if IsCygwin() else os.path.dirname(filename) - # Pick temporary file. - tmp_fd, self.tmp_path = tempfile.mkstemp( - suffix=".tmp", - prefix=os.path.split(filename)[1] + ".gyp.", - dir=base_temp_dir, - ) - try: - self.tmp_file = os.fdopen(tmp_fd, "wb") - except Exception: - # Don't leave turds behind. - os.unlink(self.tmp_path) - raise - - def __getattr__(self, attrname): - # Delegate everything else to self.tmp_file - return getattr(self.tmp_file, attrname) - - def close(self): - try: - # Close tmp file. - self.tmp_file.close() - # Determine if different. - same = False - try: - same = filecmp.cmp(self.tmp_path, filename, False) - except OSError as e: - if e.errno != errno.ENOENT: - raise - - if same: - # The new file is identical to the old one, just get rid of the new - # one. - os.unlink(self.tmp_path) - else: - # The new file is different from the old one, - # or there is no old one. - # Rename the new file to the permanent name. - # - # tempfile.mkstemp uses an overly restrictive mode, resulting in a - # file that can only be read by the owner, regardless of the umask. - # There's no reason to not respect the umask here, - # which means that an extra hoop is required - # to fetch it and reset the new file's mode. - # - # No way to get the umask without setting a new one? Set a safe one - # and then set it back to the old value. - umask = os.umask(0o77) - os.umask(umask) - os.chmod(self.tmp_path, 0o666 & ~umask) - if sys.platform == "win32" and os.path.exists(filename): - # NOTE: on windows (but not cygwin) rename will not replace an - # existing file, so it must be preceded with a remove. - # Sadly there is no way to make the switch atomic. - os.remove(filename) - os.rename(self.tmp_path, filename) - except Exception: - # Don't leave turds behind. - os.unlink(self.tmp_path) - raise - - def write(self, s): - self.tmp_file.write(s.encode("utf-8")) - - return Writer() - - -def EnsureDirExists(path): - """Make sure the directory for |path| exists.""" - try: - os.makedirs(os.path.dirname(path)) - except OSError: - pass - - -def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" - flavors = { - "cygwin": "win", - "win32": "win", - "darwin": "mac", - } - - if "flavor" in params: - return params["flavor"] - if sys.platform in flavors: - return flavors[sys.platform] - if sys.platform.startswith("sunos"): - return "solaris" - if sys.platform.startswith(("dragonfly", "freebsd")): - return "freebsd" - if sys.platform.startswith("openbsd"): - return "openbsd" - if sys.platform.startswith("netbsd"): - return "netbsd" - if sys.platform.startswith("aix"): - return "aix" - if sys.platform.startswith(("os390", "zos")): - return "zos" - - return "linux" - - -def CopyTool(flavor, out_path, generator_flags={}): - """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it - to |out_path|.""" - # aix and solaris just need flock emulation. mac and win use more complicated - # support scripts. - prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get( - flavor, None - ) - if not prefix: - return - - # Slurp input file. - source_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "%s_tool.py" % prefix - ) - with open(source_path) as source_file: - source = source_file.readlines() - - # Set custom header flags. - header = "# Generated by gyp. Do not edit.\n" - mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) - if flavor == "mac" and mac_toolchain_dir: - header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" % mac_toolchain_dir - - # Add header and write it out. - tool_path = os.path.join(out_path, "gyp-%s-tool" % prefix) - with open(tool_path, "w") as tool_file: - tool_file.write("".join([source[0], header] + source[1:])) - - # Make file executable. - os.chmod(tool_path, 0o755) - - -# From Alex Martelli, -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 -# ASPN: Python Cookbook: Remove duplicates from a sequence -# First comment, dated 2001/10/13. -# (Also in the printed Python Cookbook.) - - -def uniquer(seq, idfun=lambda x: x): - seen = {} - result = [] - for item in seq: - marker = idfun(item) - if marker in seen: - continue - seen[marker] = 1 - result.append(item) - return result - - -# Based on http://code.activestate.com/recipes/576694/. -class OrderedSet(MutableSet): - def __init__(self, iterable=None): - self.end = end = [] - end += [None, end, end] # sentinel node for doubly linked list - self.map = {} # key --> [key, prev, next] - if iterable is not None: - self |= iterable - - def __len__(self): - return len(self.map) - - def __contains__(self, key): - return key in self.map - - def add(self, key): - if key not in self.map: - end = self.end - curr = end[1] - curr[2] = end[1] = self.map[key] = [key, curr, end] - - def discard(self, key): - if key in self.map: - key, prev_item, next_item = self.map.pop(key) - prev_item[2] = next_item - next_item[1] = prev_item - - def __iter__(self): - end = self.end - curr = end[2] - while curr is not end: - yield curr[0] - curr = curr[2] - - def __reversed__(self): - end = self.end - curr = end[1] - while curr is not end: - yield curr[0] - curr = curr[1] - - # The second argument is an addition that causes a pylint warning. - def pop(self, last=True): # pylint: disable=W0221 - if not self: - raise KeyError("set is empty") - key = self.end[1][0] if last else self.end[2][0] - self.discard(key) - return key - - def __repr__(self): - if not self: - return f"{self.__class__.__name__}()" - return f"{self.__class__.__name__}({list(self)!r})" - - def __eq__(self, other): - if isinstance(other, OrderedSet): - return len(self) == len(other) and list(self) == list(other) - return set(self) == set(other) - - # Extensions to the recipe. - def update(self, iterable): - for i in iterable: - if i not in self: - self.add(i) - - -class CycleError(Exception): - """An exception raised when an unexpected cycle is detected.""" - - def __init__(self, nodes): - self.nodes = nodes - - def __str__(self): - return "CycleError: cycle involving: " + str(self.nodes) - - -def TopologicallySorted(graph, get_edges): - r"""Topologically sort based on a user provided edge definition. - - Args: - graph: A list of node names. - get_edges: A function mapping from node name to a hashable collection - of node names which this node has outgoing edges to. - Returns: - A list containing all of the node in graph in topological order. - It is assumed that calling get_edges once for each node and caching is - cheaper than repeatedly calling get_edges. - Raises: - CycleError in the event of a cycle. - Example: - graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'} - def GetEdges(node): - return re.findall(r'\$\(([^))]\)', graph[node]) - print TopologicallySorted(graph.keys(), GetEdges) - ==> - ['a', 'c', b'] - """ - get_edges = memoize(get_edges) - visited = set() - visiting = set() - ordered_nodes = [] - - def Visit(node): - if node in visiting: - raise CycleError(visiting) - if node in visited: - return - visited.add(node) - visiting.add(node) - for neighbor in get_edges(node): - Visit(neighbor) - visiting.remove(node) - ordered_nodes.insert(0, node) - - for node in sorted(graph): - Visit(node) - return ordered_nodes - - -def CrossCompileRequested(): - # TODO: figure out how to not build extra host objects in the - # non-cross-compile case when this is enabled, and enable unconditionally. - return ( - os.environ.get("GYP_CROSSCOMPILE") - or os.environ.get("AR_host") - or os.environ.get("CC_host") - or os.environ.get("CXX_host") - or os.environ.get("AR_target") - or os.environ.get("CC_target") - or os.environ.get("CXX_target") - ) - - -def IsCygwin(): - try: - out = subprocess.Popen( - "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - stdout = out.communicate()[0].decode("utf-8") - return "CYGWIN" in str(stdout) - except Exception: - return False diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/common_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/common_test.py deleted file mode 100755 index 05344085a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Unit tests for the common.py file.""" - -import gyp.common -import unittest -import sys - - -class TestTopologicallySorted(unittest.TestCase): - def test_Valid(self): - """Test that sorting works on a valid graph with one possible order.""" - graph = { - "a": ["b", "c"], - "b": [], - "c": ["d"], - "d": ["b"], - } - - def GetEdge(node): - return tuple(graph[node]) - - self.assertEqual( - gyp.common.TopologicallySorted(graph.keys(), GetEdge), ["a", "c", "d", "b"] - ) - - def test_Cycle(self): - """Test that an exception is thrown on a cyclic graph.""" - graph = { - "a": ["b"], - "b": ["c"], - "c": ["d"], - "d": ["a"], - } - - def GetEdge(node): - return tuple(graph[node]) - - self.assertRaises( - gyp.common.CycleError, gyp.common.TopologicallySorted, graph.keys(), GetEdge - ) - - -class TestGetFlavor(unittest.TestCase): - """Test that gyp.common.GetFlavor works as intended""" - - original_platform = "" - - def setUp(self): - self.original_platform = sys.platform - - def tearDown(self): - sys.platform = self.original_platform - - def assertFlavor(self, expected, argument, param): - sys.platform = argument - self.assertEqual(expected, gyp.common.GetFlavor(param)) - - def test_platform_default(self): - self.assertFlavor("freebsd", "freebsd9", {}) - self.assertFlavor("freebsd", "freebsd10", {}) - self.assertFlavor("openbsd", "openbsd5", {}) - self.assertFlavor("solaris", "sunos5", {}) - self.assertFlavor("solaris", "sunos", {}) - self.assertFlavor("linux", "linux2", {}) - self.assertFlavor("linux", "linux3", {}) - self.assertFlavor("linux", "linux", {}) - - def test_param(self): - self.assertFlavor("foobar", "linux2", {"flavor": "foobar"}) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py deleted file mode 100644 index bda1a4746..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +++ /dev/null @@ -1,165 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import sys -import re -import os -import locale -from functools import reduce - - -def XmlToString(content, encoding="utf-8", pretty=False): - """ Writes the XML content to disk, touching the file only if it has changed. - - Visual Studio files have a lot of pre-defined structures. This function makes - it easy to represent these structures as Python data structures, instead of - having to create a lot of function calls. - - Each XML element of the content is represented as a list composed of: - 1. The name of the element, a string, - 2. The attributes of the element, a dictionary (optional), and - 3+. The content of the element, if any. Strings are simple text nodes and - lists are child elements. - - Example 1: - - becomes - ['test'] - - Example 2: - - This is - it! - - - becomes - ['myelement', {'a':'value1', 'b':'value2'}, - ['childtype', 'This is'], - ['childtype', 'it!'], - ] - - Args: - content: The structured content to be converted. - encoding: The encoding to report on the first XML line. - pretty: True if we want pretty printing with indents and new lines. - - Returns: - The XML content as a string. - """ - # We create a huge list of all the elements of the file. - xml_parts = ['' % encoding] - if pretty: - xml_parts.append("\n") - _ConstructContentList(xml_parts, content, pretty) - - # Convert it to a string - return "".join(xml_parts) - - -def _ConstructContentList(xml_parts, specification, pretty, level=0): - """ Appends the XML parts corresponding to the specification. - - Args: - xml_parts: A list of XML parts to be appended to. - specification: The specification of the element. See EasyXml docs. - pretty: True if we want pretty printing with indents and new lines. - level: Indentation level. - """ - # The first item in a specification is the name of the element. - if pretty: - indentation = " " * level - new_line = "\n" - else: - indentation = "" - new_line = "" - name = specification[0] - if not isinstance(name, str): - raise Exception( - "The first item of an EasyXml specification should be " - "a string. Specification was " + str(specification) - ) - xml_parts.append(indentation + "<" + name) - - # Optionally in second position is a dictionary of the attributes. - rest = specification[1:] - if rest and isinstance(rest[0], dict): - for at, val in sorted(rest[0].items()): - xml_parts.append(f' {at}="{_XmlEscape(val, attr=True)}"') - rest = rest[1:] - if rest: - xml_parts.append(">") - all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) - multi_line = not all_strings - if multi_line and new_line: - xml_parts.append(new_line) - for child_spec in rest: - # If it's a string, append a text node. - # Otherwise recurse over that child definition - if isinstance(child_spec, str): - xml_parts.append(_XmlEscape(child_spec)) - else: - _ConstructContentList(xml_parts, child_spec, pretty, level + 1) - if multi_line and indentation: - xml_parts.append(indentation) - xml_parts.append(f"{new_line}") - else: - xml_parts.append("/>%s" % new_line) - - -def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, - win32=(sys.platform == "win32")): - """ Writes the XML content to disk, touching the file only if it has changed. - - Args: - content: The structured content to be written. - path: Location of the file. - encoding: The encoding to report on the first line of the XML file. - pretty: True if we want pretty printing with indents and new lines. - """ - xml_string = XmlToString(content, encoding, pretty) - if win32 and os.linesep != "\r\n": - xml_string = xml_string.replace("\n", "\r\n") - - default_encoding = locale.getdefaultlocale()[1] - if default_encoding and default_encoding.upper() != encoding.upper(): - xml_string = xml_string.encode(encoding) - - # Get the old content - try: - with open(path) as file: - existing = file.read() - except OSError: - existing = None - - # It has changed, write it - if existing != xml_string: - with open(path, "wb") as file: - file.write(xml_string) - - -_xml_escape_map = { - '"': """, - "'": "'", - "<": "<", - ">": ">", - "&": "&", - "\n": " ", - "\r": " ", -} - - -_xml_escape_re = re.compile("(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) - - -def _XmlEscape(value, attr=False): - """ Escape a string for inclusion in XML.""" - - def replace(match): - m = match.string[match.start() : match.end()] - # don't replace single quotes in attrs - if attr and m == "'": - return m - return _xml_escape_map[m] - - return _xml_escape_re.sub(replace, value) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py deleted file mode 100755 index 342f693a3..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the easy_xml.py file. """ - -import gyp.easy_xml as easy_xml -import unittest - -from io import StringIO - - -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() - - def test_EasyXml_simple(self): - self.assertEqual( - easy_xml.XmlToString(["test"]), - '', - ) - - self.assertEqual( - easy_xml.XmlToString(["test"], encoding="Windows-1252"), - '', - ) - - def test_EasyXml_simple_with_attributes(self): - self.assertEqual( - easy_xml.XmlToString(["test2", {"a": "value1", "b": "value2"}]), - '', - ) - - def test_EasyXml_escaping(self): - original = "'\"\r&\nfoo" - converted = "<test>'" & foo" - converted_apos = converted.replace("'", "'") - self.assertEqual( - easy_xml.XmlToString(["test3", {"a": original}, original]), - '%s' - % (converted, converted_apos), - ) - - def test_EasyXml_pretty(self): - self.assertEqual( - easy_xml.XmlToString( - ["test3", ["GrandParent", ["Parent1", ["Child"]], ["Parent2"]]], - pretty=True, - ), - '\n' - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n", - ) - - def test_EasyXml_complex(self): - # We want to create: - target = ( - '' - "" - '' - "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}" - "Win32Proj" - "automated_ui_tests" - "" - '' - "' - "Application" - "Unicode" - "" - "" - ) - - xml = easy_xml.XmlToString( - [ - "Project", - [ - "PropertyGroup", - {"Label": "Globals"}, - ["ProjectGuid", "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}"], - ["Keyword", "Win32Proj"], - ["RootNamespace", "automated_ui_tests"], - ], - ["Import", {"Project": "$(VCTargetsPath)\\Microsoft.Cpp.props"}], - [ - "PropertyGroup", - { - "Condition": "'$(Configuration)|$(Platform)'=='Debug|Win32'", - "Label": "Configuration", - }, - ["ConfigurationType", "Application"], - ["CharacterSet", "Unicode"], - ], - ] - ) - self.assertEqual(xml, target) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py deleted file mode 100755 index 1cb981526..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""These functions are executed via gyp-flock-tool when using the Makefile -generator. Used on systems that don't have a built-in flock.""" - -import fcntl -import os -import struct -import subprocess -import sys - - -def main(args): - executor = FlockTool() - executor.Dispatch(args) - - -class FlockTool: - """This class emulates the 'flock' command.""" - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace("-", "") - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - # Note that the stock python on SunOS has a bug - # where fcntl.flock(fd, LOCK_EX) always fails - # with EBADF, that's why we use this F_SETLK - # hack instead. - fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - if sys.platform.startswith("aix"): - # Python on AIX is compiled with LARGEFILE support, which changes the - # struct size. - op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - else: - op = struct.pack("hhllhhl", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - fcntl.fcntl(fd, fcntl.F_SETLK, op) - return subprocess.call(cmd_list) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py deleted file mode 100644 index f15df00c3..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +++ /dev/null @@ -1,808 +0,0 @@ -# Copyright (c) 2014 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" -This script is intended for use as a GYP_GENERATOR. It takes as input (by way of -the generator flag config_path) the path of a json file that dictates the files -and targets to search for. The following keys are supported: -files: list of paths (relative) of the files to search for. -test_targets: unqualified target names to search for. Any target in this list -that depends upon a file in |files| is output regardless of the type of target -or chain of dependencies. -additional_compile_targets: Unqualified targets to search for in addition to -test_targets. Targets in the combined list that depend upon a file in |files| -are not necessarily output. For example, if the target is of type none then the -target is not output (but one of the descendants of the target will be). - -The following is output: -error: only supplied if there is an error. -compile_targets: minimal set of targets that directly or indirectly (for - targets of type none) depend on the files in |files| and is one of the - supplied targets or a target that one of the supplied targets depends on. - The expectation is this set of targets is passed into a build step. This list - always contains the output of test_targets as well. -test_targets: set of targets from the supplied |test_targets| that either - directly or indirectly depend upon a file in |files|. This list if useful - if additional processing needs to be done for certain targets after the - build, such as running tests. -status: outputs one of three values: none of the supplied files were found, - one of the include files changed so that it should be assumed everything - changed (in this case test_targets and compile_targets are not output) or at - least one file was found. -invalid_targets: list of supplied targets that were not found. - -Example: -Consider a graph like the following: - A D - / \ -B C -A depends upon both B and C, A is of type none and B and C are executables. -D is an executable, has no dependencies and nothing depends on it. -If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and -files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then -the following is output: -|compile_targets| = ["B"] B must built as it depends upon the changed file b.cc -and the supplied target A depends upon it. A is not output as a build_target -as it is of type none with no rules and actions. -|test_targets| = ["B"] B directly depends upon the change file b.cc. - -Even though the file d.cc, which D depends upon, has changed D is not output -as it was not supplied by way of |additional_compile_targets| or |test_targets|. - -If the generator flag analyzer_output_path is specified, output is written -there. Otherwise output is written to stdout. - -In Gyp the "all" target is shorthand for the root targets in the files passed -to gyp. For example, if file "a.gyp" contains targets "a1" and -"a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency -on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2". -Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not -directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp -then the "all" target includes "b1" and "b2". -""" - - -import gyp.common -import json -import os -import posixpath - -debug = False - -found_dependency_string = "Found dependency" -no_dependency_string = "No dependencies" -# Status when it should be assumed that everything has changed. -all_changed_string = "Found dependency (all)" - -# MatchStatus is used indicate if and how a target depends upon the supplied -# sources. -# The target's sources contain one of the supplied paths. -MATCH_STATUS_MATCHES = 1 -# The target has a dependency on another target that contains one of the -# supplied paths. -MATCH_STATUS_MATCHES_BY_DEPENDENCY = 2 -# The target's sources weren't in the supplied paths and none of the target's -# dependencies depend upon a target that matched. -MATCH_STATUS_DOESNT_MATCH = 3 -# The target doesn't contain the source, but the dependent targets have not yet -# been visited to determine a more specific status yet. -MATCH_STATUS_TBD = 4 - -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - -generator_wants_static_library_dependencies_adjusted = False - -generator_default_variables = {} -for dirname in [ - "INTERMEDIATE_DIR", - "SHARED_INTERMEDIATE_DIR", - "PRODUCT_DIR", - "LIB_DIR", - "SHARED_LIB_DIR", -]: - generator_default_variables[dirname] = "!!!" - -for unused in [ - "RULE_INPUT_PATH", - "RULE_INPUT_ROOT", - "RULE_INPUT_NAME", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "CONFIGURATION_NAME", -]: - generator_default_variables[unused] = "" - - -def _ToGypPath(path): - """Converts a path to the format used by gyp.""" - if os.sep == "\\" and os.altsep == "/": - return path.replace("\\", "/") - return path - - -def _ResolveParent(path, base_path_components): - """Resolves |path|, which starts with at least one '../'. Returns an empty - string if the path shouldn't be considered. See _AddSources() for a - description of |base_path_components|.""" - depth = 0 - while path.startswith("../"): - depth += 1 - path = path[3:] - # Relative includes may go outside the source tree. For example, an action may - # have inputs in /usr/include, which are not in the source tree. - if depth > len(base_path_components): - return "" - if depth == len(base_path_components): - return path - return ( - "/".join(base_path_components[0 : len(base_path_components) - depth]) - + "/" - + path - ) - - -def _AddSources(sources, base_path, base_path_components, result): - """Extracts valid sources from |sources| and adds them to |result|. Each - source file is relative to |base_path|, but may contain '..'. To make - resolving '..' easier |base_path_components| contains each of the - directories in |base_path|. Additionally each source may contain variables. - Such sources are ignored as it is assumed dependencies on them are expressed - and tracked in some other means.""" - # NOTE: gyp paths are always posix style. - for source in sources: - if not len(source) or source.startswith("!!!") or source.startswith("$"): - continue - # variable expansion may lead to //. - org_source = source - source = source[0] + source[1:].replace("//", "/") - if source.startswith("../"): - source = _ResolveParent(source, base_path_components) - if len(source): - result.append(source) - continue - result.append(base_path + source) - if debug: - print("AddSource", org_source, result[len(result) - 1]) - - -def _ExtractSourcesFromAction(action, base_path, base_path_components, results): - if "inputs" in action: - _AddSources(action["inputs"], base_path, base_path_components, results) - - -def _ToLocalPath(toplevel_dir, path): - """Converts |path| to a path relative to |toplevel_dir|.""" - if path == toplevel_dir: - return "" - if path.startswith(toplevel_dir + "/"): - return path[len(toplevel_dir) + len("/") :] - return path - - -def _ExtractSources(target, target_dict, toplevel_dir): - # |target| is either absolute or relative and in the format of the OS. Gyp - # source paths are always posix. Convert |target| to a posix path relative to - # |toplevel_dir_|. This is done to make it easy to build source paths. - base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target))) - base_path_components = base_path.split("/") - - # Add a trailing '/' so that _AddSources() can easily build paths. - if len(base_path): - base_path += "/" - - if debug: - print("ExtractSources", target, base_path) - - results = [] - if "sources" in target_dict: - _AddSources(target_dict["sources"], base_path, base_path_components, results) - # Include the inputs from any actions. Any changes to these affect the - # resulting output. - if "actions" in target_dict: - for action in target_dict["actions"]: - _ExtractSourcesFromAction(action, base_path, base_path_components, results) - if "rules" in target_dict: - for rule in target_dict["rules"]: - _ExtractSourcesFromAction(rule, base_path, base_path_components, results) - - return results - - -class Target: - """Holds information about a particular target: - deps: set of Targets this Target depends upon. This is not recursive, only the - direct dependent Targets. - match_status: one of the MatchStatus values. - back_deps: set of Targets that have a dependency on this Target. - visited: used during iteration to indicate whether we've visited this target. - This is used for two iterations, once in building the set of Targets and - again in _GetBuildTargets(). - name: fully qualified name of the target. - requires_build: True if the target type is such that it needs to be built. - See _DoesTargetTypeRequireBuild for details. - added_to_compile_targets: used when determining if the target was added to the - set of targets that needs to be built. - in_roots: true if this target is a descendant of one of the root nodes. - is_executable: true if the type of target is executable. - is_static_library: true if the type of target is static_library. - is_or_has_linked_ancestor: true if the target does a link (eg executable), or - if there is a target in back_deps that does a link.""" - - def __init__(self, name): - self.deps = set() - self.match_status = MATCH_STATUS_TBD - self.back_deps = set() - self.name = name - # TODO(sky): I don't like hanging this off Target. This state is specific - # to certain functions and should be isolated there. - self.visited = False - self.requires_build = False - self.added_to_compile_targets = False - self.in_roots = False - self.is_executable = False - self.is_static_library = False - self.is_or_has_linked_ancestor = False - - -class Config: - """Details what we're looking for - files: set of files to search for - targets: see file description for details.""" - - def __init__(self): - self.files = [] - self.targets = set() - self.additional_compile_target_names = set() - self.test_target_names = set() - - def Init(self, params): - """Initializes Config. This is a separate method as it raises an exception - if there is a parse error.""" - generator_flags = params.get("generator_flags", {}) - config_path = generator_flags.get("config_path", None) - if not config_path: - return - try: - f = open(config_path) - config = json.load(f) - f.close() - except OSError: - raise Exception("Unable to open file " + config_path) - except ValueError as e: - raise Exception("Unable to parse config file " + config_path + str(e)) - if not isinstance(config, dict): - raise Exception("config_path must be a JSON file containing a dictionary") - self.files = config.get("files", []) - self.additional_compile_target_names = set( - config.get("additional_compile_targets", []) - ) - self.test_target_names = set(config.get("test_targets", [])) - - -def _WasBuildFileModified(build_file, data, files, toplevel_dir): - """Returns true if the build file |build_file| is either in |files| or - one of the files included by |build_file| is in |files|. |toplevel_dir| is - the root of the source tree.""" - if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files: - if debug: - print("gyp file modified", build_file) - return True - - # First element of included_files is the file itself. - if len(data[build_file]["included_files"]) <= 1: - return False - - for include_file in data[build_file]["included_files"][1:]: - # |included_files| are relative to the directory of the |build_file|. - rel_include_file = _ToGypPath( - gyp.common.UnrelativePath(include_file, build_file) - ) - if _ToLocalPath(toplevel_dir, rel_include_file) in files: - if debug: - print( - "included gyp file modified, gyp_file=", - build_file, - "included file=", - rel_include_file, - ) - return True - return False - - -def _GetOrCreateTargetByName(targets, target_name): - """Creates or returns the Target at targets[target_name]. If there is no - Target for |target_name| one is created. Returns a tuple of whether a new - Target was created and the Target.""" - if target_name in targets: - return False, targets[target_name] - target = Target(target_name) - targets[target_name] = target - return True, target - - -def _DoesTargetTypeRequireBuild(target_dict): - """Returns true if the target type is such that it needs to be built.""" - # If a 'none' target has rules or actions we assume it requires a build. - return bool( - target_dict["type"] != "none" - or target_dict.get("actions") - or target_dict.get("rules") - ) - - -def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, build_files): - """Returns a tuple of the following: - . A dictionary mapping from fully qualified name to Target. - . A list of the targets that have a source file in |files|. - . Targets that constitute the 'all' target. See description at top of file - for details on the 'all' target. - This sets the |match_status| of the targets that contain any of the source - files in |files| to MATCH_STATUS_MATCHES. - |toplevel_dir| is the root of the source tree.""" - # Maps from target name to Target. - name_to_target = {} - - # Targets that matched. - matching_targets = [] - - # Queue of targets to visit. - targets_to_visit = target_list[:] - - # Maps from build file to a boolean indicating whether the build file is in - # |files|. - build_file_in_files = {} - - # Root targets across all files. - roots = set() - - # Set of Targets in |build_files|. - build_file_targets = set() - - while len(targets_to_visit) > 0: - target_name = targets_to_visit.pop() - created_target, target = _GetOrCreateTargetByName(name_to_target, target_name) - if created_target: - roots.add(target) - elif target.visited: - continue - - target.visited = True - target.requires_build = _DoesTargetTypeRequireBuild(target_dicts[target_name]) - target_type = target_dicts[target_name]["type"] - target.is_executable = target_type == "executable" - target.is_static_library = target_type == "static_library" - target.is_or_has_linked_ancestor = ( - target_type == "executable" or target_type == "shared_library" - ) - - build_file = gyp.common.ParseQualifiedTarget(target_name)[0] - if build_file not in build_file_in_files: - build_file_in_files[build_file] = _WasBuildFileModified( - build_file, data, files, toplevel_dir - ) - - if build_file in build_files: - build_file_targets.add(target) - - # If a build file (or any of its included files) is modified we assume all - # targets in the file are modified. - if build_file_in_files[build_file]: - print("matching target from modified build file", target_name) - target.match_status = MATCH_STATUS_MATCHES - matching_targets.append(target) - else: - sources = _ExtractSources( - target_name, target_dicts[target_name], toplevel_dir - ) - for source in sources: - if _ToGypPath(os.path.normpath(source)) in files: - print("target", target_name, "matches", source) - target.match_status = MATCH_STATUS_MATCHES - matching_targets.append(target) - break - - # Add dependencies to visit as well as updating back pointers for deps. - for dep in target_dicts[target_name].get("dependencies", []): - targets_to_visit.append(dep) - - created_dep_target, dep_target = _GetOrCreateTargetByName( - name_to_target, dep - ) - if not created_dep_target: - roots.discard(dep_target) - - target.deps.add(dep_target) - dep_target.back_deps.add(target) - - return name_to_target, matching_targets, roots & build_file_targets - - -def _GetUnqualifiedToTargetMapping(all_targets, to_find): - """Returns a tuple of the following: - . mapping (dictionary) from unqualified name to Target for all the - Targets in |to_find|. - . any target names not found. If this is empty all targets were found.""" - result = {} - if not to_find: - return {}, [] - to_find = set(to_find) - for target_name in all_targets.keys(): - extracted = gyp.common.ParseQualifiedTarget(target_name) - if len(extracted) > 1 and extracted[1] in to_find: - to_find.remove(extracted[1]) - result[extracted[1]] = all_targets[target_name] - if not to_find: - return result, [] - return result, [x for x in to_find] - - -def _DoesTargetDependOnMatchingTargets(target): - """Returns true if |target| or any of its dependencies is one of the - targets containing the files supplied as input to analyzer. This updates - |matches| of the Targets as it recurses. - target: the Target to look for.""" - if target.match_status == MATCH_STATUS_DOESNT_MATCH: - return False - if ( - target.match_status == MATCH_STATUS_MATCHES - or target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY - ): - return True - for dep in target.deps: - if _DoesTargetDependOnMatchingTargets(dep): - target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY - print("\t", target.name, "matches by dep", dep.name) - return True - target.match_status = MATCH_STATUS_DOESNT_MATCH - return False - - -def _GetTargetsDependingOnMatchingTargets(possible_targets): - """Returns the list of Targets in |possible_targets| that depend (either - directly on indirectly) on at least one of the targets containing the files - supplied as input to analyzer. - possible_targets: targets to search from.""" - found = [] - print("Targets that matched by dependency:") - for target in possible_targets: - if _DoesTargetDependOnMatchingTargets(target): - found.append(target) - return found - - -def _AddCompileTargets(target, roots, add_if_no_ancestor, result): - """Recurses through all targets that depend on |target|, adding all targets - that need to be built (and are in |roots|) to |result|. - roots: set of root targets. - add_if_no_ancestor: If true and there are no ancestors of |target| then add - |target| to |result|. |target| must still be in |roots|. - result: targets that need to be built are added here.""" - if target.visited: - return - - target.visited = True - target.in_roots = target in roots - - for back_dep_target in target.back_deps: - _AddCompileTargets(back_dep_target, roots, False, result) - target.added_to_compile_targets |= back_dep_target.added_to_compile_targets - target.in_roots |= back_dep_target.in_roots - target.is_or_has_linked_ancestor |= back_dep_target.is_or_has_linked_ancestor - - # Always add 'executable' targets. Even though they may be built by other - # targets that depend upon them it makes detection of what is going to be - # built easier. - # And always add static_libraries that have no dependencies on them from - # linkables. This is necessary as the other dependencies on them may be - # static libraries themselves, which are not compile time dependencies. - if target.in_roots and ( - target.is_executable - or ( - not target.added_to_compile_targets - and (add_if_no_ancestor or target.requires_build) - ) - or ( - target.is_static_library - and add_if_no_ancestor - and not target.is_or_has_linked_ancestor - ) - ): - print( - "\t\tadding to compile targets", - target.name, - "executable", - target.is_executable, - "added_to_compile_targets", - target.added_to_compile_targets, - "add_if_no_ancestor", - add_if_no_ancestor, - "requires_build", - target.requires_build, - "is_static_library", - target.is_static_library, - "is_or_has_linked_ancestor", - target.is_or_has_linked_ancestor, - ) - result.add(target) - target.added_to_compile_targets = True - - -def _GetCompileTargets(matching_targets, supplied_targets): - """Returns the set of Targets that require a build. - matching_targets: targets that changed and need to be built. - supplied_targets: set of targets supplied to analyzer to search from.""" - result = set() - for target in matching_targets: - print("finding compile targets for match", target.name) - _AddCompileTargets(target, supplied_targets, True, result) - return result - - -def _WriteOutput(params, **values): - """Writes the output, either to stdout or a file is specified.""" - if "error" in values: - print("Error:", values["error"]) - if "status" in values: - print(values["status"]) - if "targets" in values: - values["targets"].sort() - print("Supplied targets that depend on changed files:") - for target in values["targets"]: - print("\t", target) - if "invalid_targets" in values: - values["invalid_targets"].sort() - print("The following targets were not found:") - for target in values["invalid_targets"]: - print("\t", target) - if "build_targets" in values: - values["build_targets"].sort() - print("Targets that require a build:") - for target in values["build_targets"]: - print("\t", target) - if "compile_targets" in values: - values["compile_targets"].sort() - print("Targets that need to be built:") - for target in values["compile_targets"]: - print("\t", target) - if "test_targets" in values: - values["test_targets"].sort() - print("Test targets:") - for target in values["test_targets"]: - print("\t", target) - - output_path = params.get("generator_flags", {}).get("analyzer_output_path", None) - if not output_path: - print(json.dumps(values)) - return - try: - f = open(output_path, "w") - f.write(json.dumps(values) + "\n") - f.close() - except OSError as e: - print("Error writing to output file", output_path, str(e)) - - -def _WasGypIncludeFileModified(params, files): - """Returns true if one of the files in |files| is in the set of included - files.""" - if params["options"].includes: - for include in params["options"].includes: - if _ToGypPath(os.path.normpath(include)) in files: - print("Include file modified, assuming all changed", include) - return True - return False - - -def _NamesNotIn(names, mapping): - """Returns a list of the values in |names| that are not in |mapping|.""" - return [name for name in names if name not in mapping] - - -def _LookupTargets(names, mapping): - """Returns a list of the mapping[name] for each value in |names| that is in - |mapping|.""" - return [mapping[name] for name in names if name in mapping] - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - flavor = gyp.common.GetFlavor(params) - if flavor == "mac": - default_variables.setdefault("OS", "mac") - elif flavor == "win": - default_variables.setdefault("OS", "win") - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - else: - operating_system = flavor - if flavor == "android": - operating_system = "linux" # Keep this legacy behavior for now. - default_variables.setdefault("OS", operating_system) - - -class TargetCalculator: - """Calculates the matching test_targets and matching compile_targets.""" - - def __init__( - self, - files, - additional_compile_target_names, - test_target_names, - data, - target_list, - target_dicts, - toplevel_dir, - build_files, - ): - self._additional_compile_target_names = set(additional_compile_target_names) - self._test_target_names = set(test_target_names) - ( - self._name_to_target, - self._changed_targets, - self._root_targets, - ) = _GenerateTargets( - data, target_list, target_dicts, toplevel_dir, frozenset(files), build_files - ) - ( - self._unqualified_mapping, - self.invalid_targets, - ) = _GetUnqualifiedToTargetMapping( - self._name_to_target, self._supplied_target_names_no_all() - ) - - def _supplied_target_names(self): - return self._additional_compile_target_names | self._test_target_names - - def _supplied_target_names_no_all(self): - """Returns the supplied test targets without 'all'.""" - result = self._supplied_target_names() - result.discard("all") - return result - - def is_build_impacted(self): - """Returns true if the supplied files impact the build at all.""" - return self._changed_targets - - def find_matching_test_target_names(self): - """Returns the set of output test targets.""" - assert self.is_build_impacted() - # Find the test targets first. 'all' is special cased to mean all the - # root targets. To deal with all the supplied |test_targets| are expanded - # to include the root targets during lookup. If any of the root targets - # match, we remove it and replace it with 'all'. - test_target_names_no_all = set(self._test_target_names) - test_target_names_no_all.discard("all") - test_targets_no_all = _LookupTargets( - test_target_names_no_all, self._unqualified_mapping - ) - test_target_names_contains_all = "all" in self._test_target_names - if test_target_names_contains_all: - test_targets = [ - x for x in (set(test_targets_no_all) | set(self._root_targets)) - ] - else: - test_targets = [x for x in test_targets_no_all] - print("supplied test_targets") - for target_name in self._test_target_names: - print("\t", target_name) - print("found test_targets") - for target in test_targets: - print("\t", target.name) - print("searching for matching test targets") - matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) - matching_test_targets_contains_all = test_target_names_contains_all and set( - matching_test_targets - ) & set(self._root_targets) - if matching_test_targets_contains_all: - # Remove any of the targets for all that were not explicitly supplied, - # 'all' is subsequentely added to the matching names below. - matching_test_targets = [ - x for x in (set(matching_test_targets) & set(test_targets_no_all)) - ] - print("matched test_targets") - for target in matching_test_targets: - print("\t", target.name) - matching_target_names = [ - gyp.common.ParseQualifiedTarget(target.name)[1] - for target in matching_test_targets - ] - if matching_test_targets_contains_all: - matching_target_names.append("all") - print("\tall") - return matching_target_names - - def find_matching_compile_target_names(self): - """Returns the set of output compile targets.""" - assert self.is_build_impacted() - # Compile targets are found by searching up from changed targets. - # Reset the visited status for _GetBuildTargets. - for target in self._name_to_target.values(): - target.visited = False - - supplied_targets = _LookupTargets( - self._supplied_target_names_no_all(), self._unqualified_mapping - ) - if "all" in self._supplied_target_names(): - supplied_targets = [ - x for x in (set(supplied_targets) | set(self._root_targets)) - ] - print("Supplied test_targets & compile_targets") - for target in supplied_targets: - print("\t", target.name) - print("Finding compile targets") - compile_targets = _GetCompileTargets(self._changed_targets, supplied_targets) - return [ - gyp.common.ParseQualifiedTarget(target.name)[1] - for target in compile_targets - ] - - -def GenerateOutput(target_list, target_dicts, data, params): - """Called by gyp as the final stage. Outputs results.""" - config = Config() - try: - config.Init(params) - - if not config.files: - raise Exception( - "Must specify files to analyze via config_path generator " "flag" - ) - - toplevel_dir = _ToGypPath(os.path.abspath(params["options"].toplevel_dir)) - if debug: - print("toplevel_dir", toplevel_dir) - - if _WasGypIncludeFileModified(params, config.files): - result_dict = { - "status": all_changed_string, - "test_targets": list(config.test_target_names), - "compile_targets": list( - config.additional_compile_target_names | config.test_target_names - ), - } - _WriteOutput(params, **result_dict) - return - - calculator = TargetCalculator( - config.files, - config.additional_compile_target_names, - config.test_target_names, - data, - target_list, - target_dicts, - toplevel_dir, - params["build_files"], - ) - if not calculator.is_build_impacted(): - result_dict = { - "status": no_dependency_string, - "test_targets": [], - "compile_targets": [], - } - if calculator.invalid_targets: - result_dict["invalid_targets"] = calculator.invalid_targets - _WriteOutput(params, **result_dict) - return - - test_target_names = calculator.find_matching_test_target_names() - compile_target_names = calculator.find_matching_compile_target_names() - found_at_least_one_target = compile_target_names or test_target_names - result_dict = { - "test_targets": test_target_names, - "status": found_dependency_string - if found_at_least_one_target - else no_dependency_string, - "compile_targets": list(set(compile_target_names) | set(test_target_names)), - } - if calculator.invalid_targets: - result_dict["invalid_targets"] = calculator.invalid_targets - _WriteOutput(params, **result_dict) - - except Exception as e: - _WriteOutput(params, error=str(e)) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py deleted file mode 100644 index cdf1a4832..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +++ /dev/null @@ -1,1173 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Notes: -# -# This generates makefiles suitable for inclusion into the Android build system -# via an Android.mk file. It is based on make.py, the standard makefile -# generator. -# -# The code below generates a separate .mk file for each target, but -# all are sourced by the top-level GypAndroid.mk. This means that all -# variables in .mk-files clobber one another, and furthermore that any -# variables set potentially clash with other Android build system variables. -# Try to avoid setting global variables where possible. - - -import gyp -import gyp.common -import gyp.generator.make as make # Reuse global functions from make backend. -import os -import re -import subprocess - -generator_default_variables = { - "OS": "android", - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_SUFFIX": ".so", - "INTERMEDIATE_DIR": "$(gyp_intermediate_dir)", - "SHARED_INTERMEDIATE_DIR": "$(gyp_shared_intermediate_dir)", - "PRODUCT_DIR": "$(gyp_shared_intermediate_dir)", - "SHARED_LIB_DIR": "$(builddir)/lib.$(TOOLSET)", - "LIB_DIR": "$(obj).$(TOOLSET)", - "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. - "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. - "RULE_INPUT_PATH": "$(RULE_SOURCES)", - "RULE_INPUT_EXT": "$(suffix $<)", - "RULE_INPUT_NAME": "$(notdir $<)", - "CONFIGURATION_NAME": "$(GYP_CONFIGURATION)", -} - -# Make supports multiple toolsets -generator_supports_multiple_toolsets = True - - -# Generator-specific gyp specs. -generator_additional_non_configuration_keys = [ - # Boolean to declare that this target does not want its name mangled. - "android_unmangled_name", - # Map of android build system variables to set. - "aosp_build_settings", -] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] - - -ALL_MODULES_FOOTER = """\ -# "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from -# all the included sub-makefiles. This is just here to clarify. -gyp_all_modules: -""" - -header = """\ -# This file is generated by gyp; do not edit. - -""" - -# Map gyp target types to Android module classes. -MODULE_CLASSES = { - "static_library": "STATIC_LIBRARIES", - "shared_library": "SHARED_LIBRARIES", - "executable": "EXECUTABLES", -} - - -def IsCPPExtension(ext): - return make.COMPILABLE_EXTENSIONS.get(ext) == "cxx" - - -def Sourceify(path): - """Convert a path to its source directory form. The Android backend does not - support options.generator_output, so this function is a noop.""" - return path - - -# Map from qualified target to path to output. -# For Android, the target of these maps is a tuple ('static', 'modulename'), -# ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string, -# since we link by module. -target_outputs = {} -# Map from qualified target to any linkable output. A subset -# of target_outputs. E.g. when mybinary depends on liba, we want to -# include liba in the linker line; when otherbinary depends on -# mybinary, we just want to build mybinary first. -target_link_deps = {} - - -class AndroidMkWriter: - """AndroidMkWriter packages up the writing of one target-specific Android.mk. - - Its only real entry point is Write(), and is mostly used for namespacing. - """ - - def __init__(self, android_top_dir): - self.android_top_dir = android_top_dir - - def Write( - self, - qualified_target, - relative_target, - base_path, - output_filename, - spec, - configs, - part_of_all, - write_alias_target, - sdk_version, - ): - """The main entry point: writes a .mk file for a single target. - - Arguments: - qualified_target: target we're generating - relative_target: qualified target name relative to the root - base_path: path relative to source root we're building in, used to resolve - target-relative paths - output_filename: output .mk file name to write - spec, configs: gyp info - part_of_all: flag indicating this target is part of 'all' - write_alias_target: flag indicating whether to create short aliases for - this target - sdk_version: what to emit for LOCAL_SDK_VERSION in output - """ - gyp.common.EnsureDirExists(output_filename) - - self.fp = open(output_filename, "w") - - self.fp.write(header) - - self.qualified_target = qualified_target - self.relative_target = relative_target - self.path = base_path - self.target = spec["target_name"] - self.type = spec["type"] - self.toolset = spec["toolset"] - - deps, link_deps = self.ComputeDeps(spec) - - # Some of the generation below can add extra output, sources, or - # link dependencies. All of the out params of the functions that - # follow use names like extra_foo. - extra_outputs = [] - extra_sources = [] - - self.android_class = MODULE_CLASSES.get(self.type, "GYP") - self.android_module = self.ComputeAndroidModule(spec) - (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) - self.output = self.output_binary = self.ComputeOutput(spec) - - # Standard header. - self.WriteLn("include $(CLEAR_VARS)\n") - - # Module class and name. - self.WriteLn("LOCAL_MODULE_CLASS := " + self.android_class) - self.WriteLn("LOCAL_MODULE := " + self.android_module) - # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE. - # The library module classes fail if the stem is set. ComputeOutputParts - # makes sure that stem == modulename in these cases. - if self.android_stem != self.android_module: - self.WriteLn("LOCAL_MODULE_STEM := " + self.android_stem) - self.WriteLn("LOCAL_MODULE_SUFFIX := " + self.android_suffix) - if self.toolset == "host": - self.WriteLn("LOCAL_IS_HOST_MODULE := true") - self.WriteLn("LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)") - elif sdk_version > 0: - self.WriteLn( - "LOCAL_MODULE_TARGET_ARCH := " "$(TARGET_$(GYP_VAR_PREFIX)ARCH)" - ) - self.WriteLn("LOCAL_SDK_VERSION := %s" % sdk_version) - - # Grab output directories; needed for Actions and Rules. - if self.toolset == "host": - self.WriteLn( - "gyp_intermediate_dir := " - "$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))" - ) - else: - self.WriteLn( - "gyp_intermediate_dir := " - "$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))" - ) - self.WriteLn( - "gyp_shared_intermediate_dir := " - "$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))" - ) - self.WriteLn() - - # List files this target depends on so that actions/rules/copies/sources - # can depend on the list. - # TODO: doesn't pull in things through transitive link deps; needed? - target_dependencies = [x[1] for x in deps if x[0] == "path"] - self.WriteLn("# Make sure our deps are built first.") - self.WriteList( - target_dependencies, "GYP_TARGET_DEPENDENCIES", local_pathify=True - ) - - # Actions must come first, since they can generate more OBJs for use below. - if "actions" in spec: - self.WriteActions(spec["actions"], extra_sources, extra_outputs) - - # Rules must be early like actions. - if "rules" in spec: - self.WriteRules(spec["rules"], extra_sources, extra_outputs) - - if "copies" in spec: - self.WriteCopies(spec["copies"], extra_outputs) - - # GYP generated outputs. - self.WriteList(extra_outputs, "GYP_GENERATED_OUTPUTS", local_pathify=True) - - # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend - # on both our dependency targets and our generated files. - self.WriteLn("# Make sure our deps and generated files are built first.") - self.WriteLn( - "LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) " - "$(GYP_GENERATED_OUTPUTS)" - ) - self.WriteLn() - - # Sources. - if spec.get("sources", []) or extra_sources: - self.WriteSources(spec, configs, extra_sources) - - self.WriteTarget( - spec, configs, deps, link_deps, part_of_all, write_alias_target - ) - - # Update global list of target outputs, used in dependency tracking. - target_outputs[qualified_target] = ("path", self.output_binary) - - # Update global list of link dependencies. - if self.type == "static_library": - target_link_deps[qualified_target] = ("static", self.android_module) - elif self.type == "shared_library": - target_link_deps[qualified_target] = ("shared", self.android_module) - - self.fp.close() - return self.android_module - - def WriteActions(self, actions, extra_sources, extra_outputs): - """Write Makefile code for any 'actions' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - actions (used to make other pieces dependent on these - actions) - """ - for action in actions: - name = make.StringToMakefileVariable( - "{}_{}".format(self.relative_target, action["action_name"]) - ) - self.WriteLn('### Rules for action "%s":' % action["action_name"]) - inputs = action["inputs"] - outputs = action["outputs"] - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set() - for out in outputs: - if not out.startswith("$"): - print( - 'WARNING: Action for target "%s" writes output to local path ' - '"%s".' % (self.target, out) - ) - dir = os.path.split(out)[0] - if dir: - dirs.add(dir) - if int(action.get("process_outputs_as_sources", False)): - extra_sources += outputs - - # Prepare the actual command. - command = gyp.common.EncodePOSIXShellList(action["action"]) - if "message" in action: - quiet_cmd = "Gyp action: %s ($@)" % action["message"] - else: - quiet_cmd = "Gyp action: %s ($@)" % name - if len(dirs) > 0: - command = "mkdir -p %s" % " ".join(dirs) + "; " + command - - cd_action = "cd $(gyp_local_path)/%s; " % self.path - command = cd_action + command - - # The makefile rules are all relative to the top dir, but the gyp actions - # are defined relative to their containing dir. This replaces the gyp_* - # variables for the action rule with an absolute version so that the - # output goes in the right place. - # Only write the gyp_* rules for the "primary" output (:1); - # it's superfluous for the "extra outputs", and this avoids accidentally - # writing duplicate dummy rules for those outputs. - main_output = make.QuoteSpaces(self.LocalPathify(outputs[0])) - self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) - self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) - self.WriteLn( - "%s: gyp_intermediate_dir := " - "$(abspath $(gyp_intermediate_dir))" % main_output - ) - self.WriteLn( - "%s: gyp_shared_intermediate_dir := " - "$(abspath $(gyp_shared_intermediate_dir))" % main_output - ) - - # Android's envsetup.sh adds a number of directories to the path including - # the built host binary directory. This causes actions/rules invoked by - # gyp to sometimes use these instead of system versions, e.g. bison. - # The built host binaries may not be suitable, and can cause errors. - # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable - # set by envsetup. - self.WriteLn( - "%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))" - % main_output - ) - - # Don't allow spaces in input/output filenames, but make an exception for - # filenames which start with '$(' since it's okay for there to be spaces - # inside of make function/macro invocations. - for input in inputs: - if not input.startswith("$(") and " " in input: - raise gyp.common.GypError( - 'Action input filename "%s" in target %s contains a space' - % (input, self.target) - ) - for output in outputs: - if not output.startswith("$(") and " " in output: - raise gyp.common.GypError( - 'Action output filename "%s" in target %s contains a space' - % (output, self.target) - ) - - self.WriteLn( - "%s: %s $(GYP_TARGET_DEPENDENCIES)" - % (main_output, " ".join(map(self.LocalPathify, inputs))) - ) - self.WriteLn('\t@echo "%s"' % quiet_cmd) - self.WriteLn("\t$(hide)%s\n" % command) - for output in outputs[1:]: - # Make each output depend on the main output, with an empty command - # to force make to notice that the mtime has changed. - self.WriteLn(f"{self.LocalPathify(output)}: {main_output} ;") - - extra_outputs += outputs - self.WriteLn() - - self.WriteLn() - - def WriteRules(self, rules, extra_sources, extra_outputs): - """Write Makefile code for any 'rules' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - rules (used to make other pieces dependent on these rules) - """ - if len(rules) == 0: - return - - for rule in rules: - if len(rule.get("rule_sources", [])) == 0: - continue - name = make.StringToMakefileVariable( - "{}_{}".format(self.relative_target, rule["rule_name"]) - ) - self.WriteLn('\n### Generated for rule "%s":' % name) - self.WriteLn('# "%s":' % rule) - - inputs = rule.get("inputs") - for rule_source in rule.get("rule_sources", []): - (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = os.path.splitext( - rule_source_basename - ) - - outputs = [ - self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) - for out in rule["outputs"] - ] - - dirs = set() - for out in outputs: - if not out.startswith("$"): - print( - "WARNING: Rule for target %s writes output to local path %s" - % (self.target, out) - ) - dir = os.path.dirname(out) - if dir: - dirs.add(dir) - extra_outputs += outputs - if int(rule.get("process_outputs_as_sources", False)): - extra_sources.extend(outputs) - - components = [] - for component in rule["action"]: - component = self.ExpandInputRoot( - component, rule_source_root, rule_source_dirname - ) - if "$(RULE_SOURCES)" in component: - component = component.replace("$(RULE_SOURCES)", rule_source) - components.append(component) - - command = gyp.common.EncodePOSIXShellList(components) - cd_action = "cd $(gyp_local_path)/%s; " % self.path - command = cd_action + command - if dirs: - command = "mkdir -p %s" % " ".join(dirs) + "; " + command - - # We set up a rule to build the first output, and then set up - # a rule for each additional output to depend on the first. - outputs = map(self.LocalPathify, outputs) - main_output = outputs[0] - self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) - self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) - self.WriteLn( - "%s: gyp_intermediate_dir := " - "$(abspath $(gyp_intermediate_dir))" % main_output - ) - self.WriteLn( - "%s: gyp_shared_intermediate_dir := " - "$(abspath $(gyp_shared_intermediate_dir))" % main_output - ) - - # See explanation in WriteActions. - self.WriteLn( - "%s: export PATH := " - "$(subst $(ANDROID_BUILD_PATHS),,$(PATH))" % main_output - ) - - main_output_deps = self.LocalPathify(rule_source) - if inputs: - main_output_deps += " " - main_output_deps += " ".join([self.LocalPathify(f) for f in inputs]) - - self.WriteLn( - "%s: %s $(GYP_TARGET_DEPENDENCIES)" - % (main_output, main_output_deps) - ) - self.WriteLn("\t%s\n" % command) - for output in outputs[1:]: - # Make each output depend on the main output, with an empty command - # to force make to notice that the mtime has changed. - self.WriteLn(f"{output}: {main_output} ;") - self.WriteLn() - - self.WriteLn() - - def WriteCopies(self, copies, extra_outputs): - """Write Makefile code for any 'copies' from the gyp input. - - extra_outputs: a list that will be filled in with any outputs of this action - (used to make other pieces dependent on this action) - """ - self.WriteLn("### Generated for copy rule.") - - variable = make.StringToMakefileVariable(self.relative_target + "_copies") - outputs = [] - for copy in copies: - for path in copy["files"]: - # The Android build system does not allow generation of files into the - # source tree. The destination should start with a variable, which will - # typically be $(gyp_intermediate_dir) or - # $(gyp_shared_intermediate_dir). Note that we can't use an assertion - # because some of the gyp tests depend on this. - if not copy["destination"].startswith("$"): - print( - "WARNING: Copy rule for target %s writes output to " - "local path %s" % (self.target, copy["destination"]) - ) - - # LocalPathify() calls normpath, stripping trailing slashes. - path = Sourceify(self.LocalPathify(path)) - filename = os.path.split(path)[1] - output = Sourceify( - self.LocalPathify(os.path.join(copy["destination"], filename)) - ) - - self.WriteLn(f"{output}: {path} $(GYP_TARGET_DEPENDENCIES) | $(ACP)") - self.WriteLn("\t@echo Copying: $@") - self.WriteLn("\t$(hide) mkdir -p $(dir $@)") - self.WriteLn("\t$(hide) $(ACP) -rpf $< $@") - self.WriteLn() - outputs.append(output) - self.WriteLn( - "{} = {}".format(variable, " ".join(map(make.QuoteSpaces, outputs))) - ) - extra_outputs.append("$(%s)" % variable) - self.WriteLn() - - def WriteSourceFlags(self, spec, configs): - """Write out the flags and include paths used to compile source files for - the current target. - - Args: - spec, configs: input from gyp. - """ - for configname, config in sorted(configs.items()): - extracted_includes = [] - - self.WriteLn("\n# Flags passed to both C and C++ files.") - cflags, includes_from_cflags = self.ExtractIncludesFromCFlags( - config.get("cflags", []) + config.get("cflags_c", []) - ) - extracted_includes.extend(includes_from_cflags) - self.WriteList(cflags, "MY_CFLAGS_%s" % configname) - - self.WriteList( - config.get("defines"), - "MY_DEFS_%s" % configname, - prefix="-D", - quoter=make.EscapeCppDefine, - ) - - self.WriteLn("\n# Include paths placed before CFLAGS/CPPFLAGS") - includes = list(config.get("include_dirs", [])) - includes.extend(extracted_includes) - includes = map(Sourceify, map(self.LocalPathify, includes)) - includes = self.NormalizeIncludePaths(includes) - self.WriteList(includes, "LOCAL_C_INCLUDES_%s" % configname) - - self.WriteLn("\n# Flags passed to only C++ (and not C) files.") - self.WriteList(config.get("cflags_cc"), "LOCAL_CPPFLAGS_%s" % configname) - - self.WriteLn( - "\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) " - "$(MY_DEFS_$(GYP_CONFIGURATION))" - ) - # Undefine ANDROID for host modules - # TODO: the source code should not use macro ANDROID to tell if it's host - # or target module. - if self.toolset == "host": - self.WriteLn("# Undefine ANDROID for host modules") - self.WriteLn("LOCAL_CFLAGS += -UANDROID") - self.WriteLn( - "LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) " - "$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))" - ) - self.WriteLn("LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))") - # Android uses separate flags for assembly file invocations, but gyp expects - # the same CFLAGS to be applied: - self.WriteLn("LOCAL_ASFLAGS := $(LOCAL_CFLAGS)") - - def WriteSources(self, spec, configs, extra_sources): - """Write Makefile code for any 'sources' from the gyp input. - These are source files necessary to build the current target. - We need to handle shared_intermediate directory source files as - a special case by copying them to the intermediate directory and - treating them as a generated sources. Otherwise the Android build - rules won't pick them up. - - Args: - spec, configs: input from gyp. - extra_sources: Sources generated from Actions or Rules. - """ - sources = filter(make.Compilable, spec.get("sources", [])) - generated_not_sources = [x for x in extra_sources if not make.Compilable(x)] - extra_sources = filter(make.Compilable, extra_sources) - - # Determine and output the C++ extension used by these sources. - # We simply find the first C++ file and use that extension. - all_sources = sources + extra_sources - local_cpp_extension = ".cpp" - for source in all_sources: - (root, ext) = os.path.splitext(source) - if IsCPPExtension(ext): - local_cpp_extension = ext - break - if local_cpp_extension != ".cpp": - self.WriteLn("LOCAL_CPP_EXTENSION := %s" % local_cpp_extension) - - # We need to move any non-generated sources that are coming from the - # shared intermediate directory out of LOCAL_SRC_FILES and put them - # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files - # that don't match our local_cpp_extension, since Android will only - # generate Makefile rules for a single LOCAL_CPP_EXTENSION. - local_files = [] - for source in sources: - (root, ext) = os.path.splitext(source) - if "$(gyp_shared_intermediate_dir)" in source: - extra_sources.append(source) - elif "$(gyp_intermediate_dir)" in source: - extra_sources.append(source) - elif IsCPPExtension(ext) and ext != local_cpp_extension: - extra_sources.append(source) - else: - local_files.append(os.path.normpath(os.path.join(self.path, source))) - - # For any generated source, if it is coming from the shared intermediate - # directory then we add a Make rule to copy them to the local intermediate - # directory first. This is because the Android LOCAL_GENERATED_SOURCES - # must be in the local module intermediate directory for the compile rules - # to work properly. If the file has the wrong C++ extension, then we add - # a rule to copy that to intermediates and use the new version. - final_generated_sources = [] - # If a source file gets copied, we still need to add the original source - # directory as header search path, for GCC searches headers in the - # directory that contains the source file by default. - origin_src_dirs = [] - for source in extra_sources: - local_file = source - if "$(gyp_intermediate_dir)/" not in local_file: - basename = os.path.basename(local_file) - local_file = "$(gyp_intermediate_dir)/" + basename - (root, ext) = os.path.splitext(local_file) - if IsCPPExtension(ext) and ext != local_cpp_extension: - local_file = root + local_cpp_extension - if local_file != source: - self.WriteLn(f"{local_file}: {self.LocalPathify(source)}") - self.WriteLn("\tmkdir -p $(@D); cp $< $@") - origin_src_dirs.append(os.path.dirname(source)) - final_generated_sources.append(local_file) - - # We add back in all of the non-compilable stuff to make sure that the - # make rules have dependencies on them. - final_generated_sources.extend(generated_not_sources) - self.WriteList(final_generated_sources, "LOCAL_GENERATED_SOURCES") - - origin_src_dirs = gyp.common.uniquer(origin_src_dirs) - origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs)) - self.WriteList(origin_src_dirs, "GYP_COPIED_SOURCE_ORIGIN_DIRS") - - self.WriteList(local_files, "LOCAL_SRC_FILES") - - # Write out the flags used to compile the source; this must be done last - # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path. - self.WriteSourceFlags(spec, configs) - - def ComputeAndroidModule(self, spec): - """Return the Android module name used for a gyp spec. - - We use the complete qualified target name to avoid collisions between - duplicate targets in different directories. We also add a suffix to - distinguish gyp-generated module names. - """ - - if int(spec.get("android_unmangled_name", 0)): - assert self.type != "shared_library" or self.target.startswith("lib") - return self.target - - if self.type == "shared_library": - # For reasons of convention, the Android build system requires that all - # shared library modules are named 'libfoo' when generating -l flags. - prefix = "lib_" - else: - prefix = "" - - if spec["toolset"] == "host": - suffix = "_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp" - else: - suffix = "_gyp" - - if self.path: - middle = make.StringToMakefileVariable(f"{self.path}_{self.target}") - else: - middle = make.StringToMakefileVariable(self.target) - - return "".join([prefix, middle, suffix]) - - def ComputeOutputParts(self, spec): - """Return the 'output basename' of a gyp spec, split into filename + ext. - - Android libraries must be named the same thing as their module name, - otherwise the linker can't find them, so product_name and so on must be - ignored if we are building a library, and the "lib" prepending is - not done for Android. - """ - assert self.type != "loadable_module" # TODO: not supported? - - target = spec["target_name"] - target_prefix = "" - target_ext = "" - if self.type == "static_library": - target = self.ComputeAndroidModule(spec) - target_ext = ".a" - elif self.type == "shared_library": - target = self.ComputeAndroidModule(spec) - target_ext = ".so" - elif self.type == "none": - target_ext = ".stamp" - elif self.type != "executable": - print( - "ERROR: What output file should be generated?", - "type", - self.type, - "target", - target, - ) - - if self.type != "static_library" and self.type != "shared_library": - target_prefix = spec.get("product_prefix", target_prefix) - target = spec.get("product_name", target) - product_ext = spec.get("product_extension") - if product_ext: - target_ext = "." + product_ext - - target_stem = target_prefix + target - return (target_stem, target_ext) - - def ComputeOutputBasename(self, spec): - """Return the 'output basename' of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - 'libfoobar.so' - """ - return "".join(self.ComputeOutputParts(spec)) - - def ComputeOutput(self, spec): - """Return the 'output' (full output path) of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - '$(obj)/baz/libfoobar.so' - """ - if self.type == "executable": - # We install host executables into shared_intermediate_dir so they can be - # run by gyp rules that refer to PRODUCT_DIR. - path = "$(gyp_shared_intermediate_dir)" - elif self.type == "shared_library": - if self.toolset == "host": - path = "$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)" - else: - path = "$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)" - else: - # Other targets just get built into their intermediate dir. - if self.toolset == "host": - path = ( - "$(call intermediates-dir-for,%s,%s,true,," - "$(GYP_HOST_VAR_PREFIX))" - % (self.android_class, self.android_module) - ) - else: - path = "$(call intermediates-dir-for,{},{},,,$(GYP_VAR_PREFIX))".format( - self.android_class, - self.android_module, - ) - - assert spec.get("product_dir") is None # TODO: not supported? - return os.path.join(path, self.ComputeOutputBasename(spec)) - - def NormalizeIncludePaths(self, include_paths): - """Normalize include_paths. - Convert absolute paths to relative to the Android top directory. - - Args: - include_paths: A list of unprocessed include paths. - Returns: - A list of normalized include paths. - """ - normalized = [] - for path in include_paths: - if path[0] == "/": - path = gyp.common.RelativePath(path, self.android_top_dir) - normalized.append(path) - return normalized - - def ExtractIncludesFromCFlags(self, cflags): - """Extract includes "-I..." out from cflags - - Args: - cflags: A list of compiler flags, which may be mixed with "-I.." - Returns: - A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. - """ - clean_cflags = [] - include_paths = [] - for flag in cflags: - if flag.startswith("-I"): - include_paths.append(flag[2:]) - else: - clean_cflags.append(flag) - - return (clean_cflags, include_paths) - - def FilterLibraries(self, libraries): - """Filter the 'libraries' key to separate things that shouldn't be ldflags. - - Library entries that look like filenames should be converted to android - module names instead of being passed to the linker as flags. - - Args: - libraries: the value of spec.get('libraries') - Returns: - A tuple (static_lib_modules, dynamic_lib_modules, ldflags) - """ - static_lib_modules = [] - dynamic_lib_modules = [] - ldflags = [] - for libs in libraries: - # Libs can have multiple words. - for lib in libs.split(): - # Filter the system libraries, which are added by default by the Android - # build system. - if ( - lib == "-lc" - or lib == "-lstdc++" - or lib == "-lm" - or lib.endswith("libgcc.a") - ): - continue - match = re.search(r"([^/]+)\.a$", lib) - if match: - static_lib_modules.append(match.group(1)) - continue - match = re.search(r"([^/]+)\.so$", lib) - if match: - dynamic_lib_modules.append(match.group(1)) - continue - if lib.startswith("-l"): - ldflags.append(lib) - return (static_lib_modules, dynamic_lib_modules, ldflags) - - def ComputeDeps(self, spec): - """Compute the dependencies of a gyp spec. - - Returns a tuple (deps, link_deps), where each is a list of - filenames that will need to be put in front of make for either - building (deps) or linking (link_deps). - """ - deps = [] - link_deps = [] - if "dependencies" in spec: - deps.extend( - [ - target_outputs[dep] - for dep in spec["dependencies"] - if target_outputs[dep] - ] - ) - for dep in spec["dependencies"]: - if dep in target_link_deps: - link_deps.append(target_link_deps[dep]) - deps.extend(link_deps) - return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) - - def WriteTargetFlags(self, spec, configs, link_deps): - """Write Makefile code to specify the link flags and library dependencies. - - spec, configs: input from gyp. - link_deps: link dependency list; see ComputeDeps() - """ - # Libraries (i.e. -lfoo) - # These must be included even for static libraries as some of them provide - # implicit include paths through the build system. - libraries = gyp.common.uniquer(spec.get("libraries", [])) - static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries) - - if self.type != "static_library": - for configname, config in sorted(configs.items()): - ldflags = list(config.get("ldflags", [])) - self.WriteLn("") - self.WriteList(ldflags, "LOCAL_LDFLAGS_%s" % configname) - self.WriteList(ldflags_libs, "LOCAL_GYP_LIBS") - self.WriteLn( - "LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) " - "$(LOCAL_GYP_LIBS)" - ) - - # Link dependencies (i.e. other gyp targets this target depends on) - # These need not be included for static libraries as within the gyp build - # we do not use the implicit include path mechanism. - if self.type != "static_library": - static_link_deps = [x[1] for x in link_deps if x[0] == "static"] - shared_link_deps = [x[1] for x in link_deps if x[0] == "shared"] - else: - static_link_deps = [] - shared_link_deps = [] - - # Only write the lists if they are non-empty. - if static_libs or static_link_deps: - self.WriteLn("") - self.WriteList(static_libs + static_link_deps, "LOCAL_STATIC_LIBRARIES") - self.WriteLn("# Enable grouping to fix circular references") - self.WriteLn("LOCAL_GROUP_STATIC_LIBRARIES := true") - if dynamic_libs or shared_link_deps: - self.WriteLn("") - self.WriteList(dynamic_libs + shared_link_deps, "LOCAL_SHARED_LIBRARIES") - - def WriteTarget( - self, spec, configs, deps, link_deps, part_of_all, write_alias_target - ): - """Write Makefile code to produce the final target of the gyp spec. - - spec, configs: input from gyp. - deps, link_deps: dependency lists; see ComputeDeps() - part_of_all: flag indicating this target is part of 'all' - write_alias_target: flag indicating whether to create short aliases for this - target - """ - self.WriteLn("### Rules for final target.") - - if self.type != "none": - self.WriteTargetFlags(spec, configs, link_deps) - - settings = spec.get("aosp_build_settings", {}) - if settings: - self.WriteLn("### Set directly by aosp_build_settings.") - for k, v in settings.items(): - if isinstance(v, list): - self.WriteList(v, k) - else: - self.WriteLn(f"{k} := {make.QuoteIfNecessary(v)}") - self.WriteLn("") - - # Add to the set of targets which represent the gyp 'all' target. We use the - # name 'gyp_all_modules' as the Android build system doesn't allow the use - # of the Make target 'all' and because 'all_modules' is the equivalent of - # the Make target 'all' on Android. - if part_of_all and write_alias_target: - self.WriteLn('# Add target alias to "gyp_all_modules" target.') - self.WriteLn(".PHONY: gyp_all_modules") - self.WriteLn("gyp_all_modules: %s" % self.android_module) - self.WriteLn("") - - # Add an alias from the gyp target name to the Android module name. This - # simplifies manual builds of the target, and is required by the test - # framework. - if self.target != self.android_module and write_alias_target: - self.WriteLn("# Alias gyp target name.") - self.WriteLn(".PHONY: %s" % self.target) - self.WriteLn(f"{self.target}: {self.android_module}") - self.WriteLn("") - - # Add the command to trigger build of the target type depending - # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY - # NOTE: This has to come last! - modifier = "" - if self.toolset == "host": - modifier = "HOST_" - if self.type == "static_library": - self.WriteLn("include $(BUILD_%sSTATIC_LIBRARY)" % modifier) - elif self.type == "shared_library": - self.WriteLn("LOCAL_PRELINK_MODULE := false") - self.WriteLn("include $(BUILD_%sSHARED_LIBRARY)" % modifier) - elif self.type == "executable": - self.WriteLn("LOCAL_CXX_STL := libc++_static") - # Executables are for build and test purposes only, so they're installed - # to a directory that doesn't get included in the system image. - self.WriteLn("LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)") - self.WriteLn("include $(BUILD_%sEXECUTABLE)" % modifier) - else: - self.WriteLn("LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp") - self.WriteLn("LOCAL_UNINSTALLABLE_MODULE := true") - if self.toolset == "target": - self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)") - else: - self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)") - self.WriteLn() - self.WriteLn("include $(BUILD_SYSTEM)/base_rules.mk") - self.WriteLn() - self.WriteLn("$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)") - self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"') - self.WriteLn("\t$(hide) mkdir -p $(dir $@)") - self.WriteLn("\t$(hide) touch $@") - self.WriteLn() - self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX :=") - - def WriteList( - self, - value_list, - variable=None, - prefix="", - quoter=make.QuoteIfNecessary, - local_pathify=False, - ): - """Write a variable definition that is a list of values. - - E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out - foo = blaha blahb - but in a pretty-printed style. - """ - values = "" - if value_list: - value_list = [quoter(prefix + value) for value in value_list] - if local_pathify: - value_list = [self.LocalPathify(value) for value in value_list] - values = " \\\n\t" + " \\\n\t".join(value_list) - self.fp.write(f"{variable} :={values}\n\n") - - def WriteLn(self, text=""): - self.fp.write(text + "\n") - - def LocalPathify(self, path): - """Convert a subdirectory-relative path into a normalized path which starts - with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). - Absolute paths, or paths that contain variables, are just normalized.""" - if "$(" in path or os.path.isabs(path): - # path is not a file in the project tree in this case, but calling - # normpath is still important for trimming trailing slashes. - return os.path.normpath(path) - local_path = os.path.join("$(LOCAL_PATH)", self.path, path) - local_path = os.path.normpath(local_path) - # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) - # - i.e. that the resulting path is still inside the project tree. The - # path may legitimately have ended up containing just $(LOCAL_PATH), though, - # so we don't look for a slash. - assert local_path.startswith( - "$(LOCAL_PATH)" - ), f"Path {path} attempts to escape from gyp path {self.path} !)" - return local_path - - def ExpandInputRoot(self, template, expansion, dirname): - if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: - return template - path = template % { - "INPUT_ROOT": expansion, - "INPUT_DIRNAME": dirname, - } - return os.path.normpath(path) - - -def PerformBuild(data, configurations, params): - # The android backend only supports the default configuration. - options = params["options"] - makefile = os.path.abspath(os.path.join(options.toplevel_dir, "GypAndroid.mk")) - env = dict(os.environ) - env["ONE_SHOT_MAKEFILE"] = makefile - arguments = ["make", "-C", os.environ["ANDROID_BUILD_TOP"], "gyp_all_modules"] - print("Building: %s" % arguments) - subprocess.check_call(arguments, env=env) - - -def GenerateOutput(target_list, target_dicts, data, params): - options = params["options"] - generator_flags = params.get("generator_flags", {}) - limit_to_target_all = generator_flags.get("limit_to_target_all", False) - write_alias_targets = generator_flags.get("write_alias_targets", True) - sdk_version = generator_flags.get("aosp_sdk_version", 0) - android_top_dir = os.environ.get("ANDROID_BUILD_TOP") - assert android_top_dir, "$ANDROID_BUILD_TOP not set; you need to run lunch." - - def CalculateMakefilePath(build_file, base_name): - """Determine where to write a Makefile for a given gyp file.""" - # Paths in gyp files are relative to the .gyp file, but we want - # paths relative to the source root for the master makefile. Grab - # the path of the .gyp file as the base to relativize against. - # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". - base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) - # We write the file in the base_path directory. - output_file = os.path.join(options.depth, base_path, base_name) - assert ( - not options.generator_output - ), "The Android backend does not support options.generator_output." - base_path = gyp.common.RelativePath( - os.path.dirname(build_file), options.toplevel_dir - ) - return base_path, output_file - - # TODO: search for the first non-'Default' target. This can go - # away when we add verification that all targets have the - # necessary configurations. - default_configuration = None - for target in target_list: - spec = target_dicts[target] - if spec["default_configuration"] != "Default": - default_configuration = spec["default_configuration"] - break - if not default_configuration: - default_configuration = "Default" - - makefile_name = "GypAndroid" + options.suffix + ".mk" - makefile_path = os.path.join(options.toplevel_dir, makefile_name) - assert ( - not options.generator_output - ), "The Android backend does not support options.generator_output." - gyp.common.EnsureDirExists(makefile_path) - root_makefile = open(makefile_path, "w") - - root_makefile.write(header) - - # We set LOCAL_PATH just once, here, to the top of the project tree. This - # allows all the other paths we use to be relative to the Android.mk file, - # as the Android build system expects. - root_makefile.write("\nLOCAL_PATH := $(call my-dir)\n") - - # Find the list of targets that derive from the gyp file(s) being built. - needed_targets = set() - for build_file in params["build_files"]: - for target in gyp.common.AllTargets(target_list, target_dicts, build_file): - needed_targets.add(target) - - build_files = set() - include_list = set() - android_modules = {} - for qualified_target in target_list: - build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) - relative_build_file = gyp.common.RelativePath(build_file, options.toplevel_dir) - build_files.add(relative_build_file) - included_files = data[build_file]["included_files"] - for included_file in included_files: - # The included_files entries are relative to the dir of the build file - # that included them, so we have to undo that and then make them relative - # to the root dir. - relative_include_file = gyp.common.RelativePath( - gyp.common.UnrelativePath(included_file, build_file), - options.toplevel_dir, - ) - abs_include_file = os.path.abspath(relative_include_file) - # If the include file is from the ~/.gyp dir, we should use absolute path - # so that relocating the src dir doesn't break the path. - if params["home_dot_gyp"] and abs_include_file.startswith( - params["home_dot_gyp"] - ): - build_files.add(abs_include_file) - else: - build_files.add(relative_include_file) - - base_path, output_file = CalculateMakefilePath( - build_file, target + "." + toolset + options.suffix + ".mk" - ) - - spec = target_dicts[qualified_target] - configs = spec["configurations"] - - part_of_all = qualified_target in needed_targets - if limit_to_target_all and not part_of_all: - continue - - relative_target = gyp.common.QualifiedTarget( - relative_build_file, target, toolset - ) - writer = AndroidMkWriter(android_top_dir) - android_module = writer.Write( - qualified_target, - relative_target, - base_path, - output_file, - spec, - configs, - part_of_all=part_of_all, - write_alias_target=write_alias_targets, - sdk_version=sdk_version, - ) - if android_module in android_modules: - print( - "ERROR: Android module names must be unique. The following " - "targets both generate Android module name %s.\n %s\n %s" - % (android_module, android_modules[android_module], qualified_target) - ) - return - android_modules[android_module] = qualified_target - - # Our root_makefile lives at the source root. Compute the relative path - # from there to the output_file for including. - mkfile_rel_path = gyp.common.RelativePath( - output_file, os.path.dirname(makefile_path) - ) - include_list.add(mkfile_rel_path) - - root_makefile.write("GYP_CONFIGURATION ?= %s\n" % default_configuration) - root_makefile.write("GYP_VAR_PREFIX ?=\n") - root_makefile.write("GYP_HOST_VAR_PREFIX ?=\n") - root_makefile.write("GYP_HOST_MULTILIB ?= first\n") - - # Write out the sorted list of includes. - root_makefile.write("\n") - for include_file in sorted(include_list): - root_makefile.write("include $(LOCAL_PATH)/" + include_file + "\n") - root_makefile.write("\n") - - if write_alias_targets: - root_makefile.write(ALL_MODULES_FOOTER) - - root_makefile.close() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py deleted file mode 100644 index c95d18415..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +++ /dev/null @@ -1,1321 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""cmake output module - -This module is under development and should be considered experimental. - -This module produces cmake (2.8.8+) input as its output. One CMakeLists.txt is -created for each configuration. - -This module's original purpose was to support editing in IDEs like KDevelop -which use CMake for project management. It is also possible to use CMake to -generate projects for other IDEs such as eclipse cdt and code::blocks. QtCreator -will convert the CMakeLists.txt to a code::blocks cbp for the editor to read, -but build using CMake. As a result QtCreator editor is unaware of compiler -defines. The generated CMakeLists.txt can also be used to build on Linux. There -is currently no support for building on platforms other than Linux. - -The generated CMakeLists.txt should properly compile all projects. However, -there is a mismatch between gyp and cmake with regard to linking. All attempts -are made to work around this, but CMake sometimes sees -Wl,--start-group as a -library and incorrectly repeats it. As a result the output of this generator -should not be relied on for building. - -When using with kdevelop, use version 4.4+. Previous versions of kdevelop will -not be able to find the header file directories described in the generated -CMakeLists.txt file. -""" - - -import multiprocessing -import os -import signal -import subprocess -import gyp.common -import gyp.xcode_emulation - -_maketrans = str.maketrans - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_PREFIX": "lib", - "SHARED_LIB_SUFFIX": ".so", - "SHARED_LIB_DIR": "${builddir}/lib.${TOOLSET}", - "LIB_DIR": "${obj}.${TOOLSET}", - "INTERMEDIATE_DIR": "${obj}.${TOOLSET}/${TARGET}/geni", - "SHARED_INTERMEDIATE_DIR": "${obj}/gen", - "PRODUCT_DIR": "${builddir}", - "RULE_INPUT_PATH": "${RULE_INPUT_PATH}", - "RULE_INPUT_DIRNAME": "${RULE_INPUT_DIRNAME}", - "RULE_INPUT_NAME": "${RULE_INPUT_NAME}", - "RULE_INPUT_ROOT": "${RULE_INPUT_ROOT}", - "RULE_INPUT_EXT": "${RULE_INPUT_EXT}", - "CONFIGURATION_NAME": "${configuration}", -} - -FULL_PATH_VARS = ("${CMAKE_CURRENT_LIST_DIR}", "${builddir}", "${obj}") - -generator_supports_multiple_toolsets = True -generator_wants_static_library_dependencies_adjusted = True - -COMPILABLE_EXTENSIONS = { - ".c": "cc", - ".cc": "cxx", - ".cpp": "cxx", - ".cxx": "cxx", - ".s": "s", # cc - ".S": "s", # cc -} - - -def RemovePrefix(a, prefix): - """Returns 'a' without 'prefix' if it starts with 'prefix'.""" - return a[len(prefix) :] if a.startswith(prefix) else a - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - - -def Compilable(filename): - """Return true if the file is compilable (should be in OBJS).""" - return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS) - - -def Linkable(filename): - """Return true if the file is linkable (should be on the link line).""" - return filename.endswith(".o") - - -def NormjoinPathForceCMakeSource(base_path, rel_path): - """Resolves rel_path against base_path and returns the result. - - If rel_path is an absolute path it is returned unchanged. - Otherwise it is resolved against base_path and normalized. - If the result is a relative path, it is forced to be relative to the - CMakeLists.txt. - """ - if os.path.isabs(rel_path): - return rel_path - if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): - return rel_path - # TODO: do we need to check base_path for absolute variables as well? - return os.path.join( - "${CMAKE_CURRENT_LIST_DIR}", os.path.normpath(os.path.join(base_path, rel_path)) - ) - - -def NormjoinPath(base_path, rel_path): - """Resolves rel_path against base_path and returns the result. - TODO: what is this really used for? - If rel_path begins with '$' it is returned unchanged. - Otherwise it is resolved against base_path if relative, then normalized. - """ - if rel_path.startswith("$") and not rel_path.startswith("${configuration}"): - return rel_path - return os.path.normpath(os.path.join(base_path, rel_path)) - - -def CMakeStringEscape(a): - """Escapes the string 'a' for use inside a CMake string. - - This means escaping - '\' otherwise it may be seen as modifying the next character - '"' otherwise it will end the string - ';' otherwise the string becomes a list - - The following do not need to be escaped - '#' when the lexer is in string state, this does not start a comment - - The following are yet unknown - '$' generator variables (like ${obj}) must not be escaped, - but text $ should be escaped - what is wanted is to know which $ come from generator variables - """ - return a.replace("\\", "\\\\").replace(";", "\\;").replace('"', '\\"') - - -def SetFileProperty(output, source_name, property_name, values, sep): - """Given a set of source file, sets the given property on them.""" - output.write("set_source_files_properties(") - output.write(source_name) - output.write(" PROPERTIES ") - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetFilesProperty(output, variable, property_name, values, sep): - """Given a set of source files, sets the given property on them.""" - output.write("set_source_files_properties(") - WriteVariable(output, variable) - output.write(" PROPERTIES ") - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetTargetProperty(output, target_name, property_name, values, sep=""): - """Given a target, sets the given property.""" - output.write("set_target_properties(") - output.write(target_name) - output.write(" PROPERTIES ") - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetVariable(output, variable_name, value): - """Sets a CMake variable.""" - output.write("set(") - output.write(variable_name) - output.write(' "') - output.write(CMakeStringEscape(value)) - output.write('")\n') - - -def SetVariableList(output, variable_name, values): - """Sets a CMake variable to a list.""" - if not values: - return SetVariable(output, variable_name, "") - if len(values) == 1: - return SetVariable(output, variable_name, values[0]) - output.write("list(APPEND ") - output.write(variable_name) - output.write('\n "') - output.write('"\n "'.join([CMakeStringEscape(value) for value in values])) - output.write('")\n') - - -def UnsetVariable(output, variable_name): - """Unsets a CMake variable.""" - output.write("unset(") - output.write(variable_name) - output.write(")\n") - - -def WriteVariable(output, variable_name, prepend=None): - if prepend: - output.write(prepend) - output.write("${") - output.write(variable_name) - output.write("}") - - -class CMakeTargetType: - def __init__(self, command, modifier, property_modifier): - self.command = command - self.modifier = modifier - self.property_modifier = property_modifier - - -cmake_target_type_from_gyp_target_type = { - "executable": CMakeTargetType("add_executable", None, "RUNTIME"), - "static_library": CMakeTargetType("add_library", "STATIC", "ARCHIVE"), - "shared_library": CMakeTargetType("add_library", "SHARED", "LIBRARY"), - "loadable_module": CMakeTargetType("add_library", "MODULE", "LIBRARY"), - "none": CMakeTargetType("add_custom_target", "SOURCES", None), -} - - -def StringToCMakeTargetName(a): - """Converts the given string 'a' to a valid CMake target name. - - All invalid characters are replaced by '_'. - Invalid for cmake: ' ', '/', '(', ')', '"' - Invalid for make: ':' - Invalid for unknown reasons but cause failures: '.' - """ - return a.translate(_maketrans(' /():."', "_______")) - - -def WriteActions(target_name, actions, extra_sources, extra_deps, path_to_gyp, output): - """Write CMake for the 'actions' in the target. - - Args: - target_name: the name of the CMake target being generated. - actions: the Gyp 'actions' dict for this target. - extra_sources: [(, )] to append with generated source files. - extra_deps: [] to append with generated targets. - path_to_gyp: relative path from CMakeLists.txt being generated to - the Gyp file in which the target being generated is defined. - """ - for action in actions: - action_name = StringToCMakeTargetName(action["action_name"]) - action_target_name = f"{target_name}__{action_name}" - - inputs = action["inputs"] - inputs_name = action_target_name + "__input" - SetVariableList( - output, - inputs_name, - [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], - ) - - outputs = action["outputs"] - cmake_outputs = [ - NormjoinPathForceCMakeSource(path_to_gyp, out) for out in outputs - ] - outputs_name = action_target_name + "__output" - SetVariableList(output, outputs_name, cmake_outputs) - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = {dir for dir in (os.path.dirname(o) for o in outputs) if dir} - - if int(action.get("process_outputs_as_sources", False)): - extra_sources.extend(zip(cmake_outputs, outputs)) - - # add_custom_command - output.write("add_custom_command(OUTPUT ") - WriteVariable(output, outputs_name) - output.write("\n") - - if len(dirs) > 0: - for directory in dirs: - output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") - output.write(directory) - output.write("\n") - - output.write(" COMMAND ") - output.write(gyp.common.EncodePOSIXShellList(action["action"])) - output.write("\n") - - output.write(" DEPENDS ") - WriteVariable(output, inputs_name) - output.write("\n") - - output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") - output.write(path_to_gyp) - output.write("\n") - - output.write(" COMMENT ") - if "message" in action: - output.write(action["message"]) - else: - output.write(action_target_name) - output.write("\n") - - output.write(" VERBATIM\n") - output.write(")\n") - - # add_custom_target - output.write("add_custom_target(") - output.write(action_target_name) - output.write("\n DEPENDS ") - WriteVariable(output, outputs_name) - output.write("\n SOURCES ") - WriteVariable(output, inputs_name) - output.write("\n)\n") - - extra_deps.append(action_target_name) - - -def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source): - if rel_path.startswith(("${RULE_INPUT_PATH}", "${RULE_INPUT_DIRNAME}")): - if any([rule_source.startswith(var) for var in FULL_PATH_VARS]): - return rel_path - return NormjoinPathForceCMakeSource(base_path, rel_path) - - -def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp, output): - """Write CMake for the 'rules' in the target. - - Args: - target_name: the name of the CMake target being generated. - actions: the Gyp 'actions' dict for this target. - extra_sources: [(, )] to append with generated source files. - extra_deps: [] to append with generated targets. - path_to_gyp: relative path from CMakeLists.txt being generated to - the Gyp file in which the target being generated is defined. - """ - for rule in rules: - rule_name = StringToCMakeTargetName(target_name + "__" + rule["rule_name"]) - - inputs = rule.get("inputs", []) - inputs_name = rule_name + "__input" - SetVariableList( - output, - inputs_name, - [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], - ) - outputs = rule["outputs"] - var_outputs = [] - - for count, rule_source in enumerate(rule.get("rule_sources", [])): - action_name = rule_name + "_" + str(count) - - rule_source_dirname, rule_source_basename = os.path.split(rule_source) - rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename) - - SetVariable(output, "RULE_INPUT_PATH", rule_source) - SetVariable(output, "RULE_INPUT_DIRNAME", rule_source_dirname) - SetVariable(output, "RULE_INPUT_NAME", rule_source_basename) - SetVariable(output, "RULE_INPUT_ROOT", rule_source_root) - SetVariable(output, "RULE_INPUT_EXT", rule_source_ext) - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = {dir for dir in (os.path.dirname(o) for o in outputs) if dir} - - # Create variables for the output, as 'local' variable will be unset. - these_outputs = [] - for output_index, out in enumerate(outputs): - output_name = action_name + "_" + str(output_index) - SetVariable( - output, - output_name, - NormjoinRulePathForceCMakeSource(path_to_gyp, out, rule_source), - ) - if int(rule.get("process_outputs_as_sources", False)): - extra_sources.append(("${" + output_name + "}", out)) - these_outputs.append("${" + output_name + "}") - var_outputs.append("${" + output_name + "}") - - # add_custom_command - output.write("add_custom_command(OUTPUT\n") - for out in these_outputs: - output.write(" ") - output.write(out) - output.write("\n") - - for directory in dirs: - output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") - output.write(directory) - output.write("\n") - - output.write(" COMMAND ") - output.write(gyp.common.EncodePOSIXShellList(rule["action"])) - output.write("\n") - - output.write(" DEPENDS ") - WriteVariable(output, inputs_name) - output.write(" ") - output.write(NormjoinPath(path_to_gyp, rule_source)) - output.write("\n") - - # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. - # The cwd is the current build directory. - output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") - output.write(path_to_gyp) - output.write("\n") - - output.write(" COMMENT ") - if "message" in rule: - output.write(rule["message"]) - else: - output.write(action_name) - output.write("\n") - - output.write(" VERBATIM\n") - output.write(")\n") - - UnsetVariable(output, "RULE_INPUT_PATH") - UnsetVariable(output, "RULE_INPUT_DIRNAME") - UnsetVariable(output, "RULE_INPUT_NAME") - UnsetVariable(output, "RULE_INPUT_ROOT") - UnsetVariable(output, "RULE_INPUT_EXT") - - # add_custom_target - output.write("add_custom_target(") - output.write(rule_name) - output.write(" DEPENDS\n") - for out in var_outputs: - output.write(" ") - output.write(out) - output.write("\n") - output.write("SOURCES ") - WriteVariable(output, inputs_name) - output.write("\n") - for rule_source in rule.get("rule_sources", []): - output.write(" ") - output.write(NormjoinPath(path_to_gyp, rule_source)) - output.write("\n") - output.write(")\n") - - extra_deps.append(rule_name) - - -def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output): - """Write CMake for the 'copies' in the target. - - Args: - target_name: the name of the CMake target being generated. - actions: the Gyp 'actions' dict for this target. - extra_deps: [] to append with generated targets. - path_to_gyp: relative path from CMakeLists.txt being generated to - the Gyp file in which the target being generated is defined. - """ - copy_name = target_name + "__copies" - - # CMake gets upset with custom targets with OUTPUT which specify no output. - have_copies = any(copy["files"] for copy in copies) - if not have_copies: - output.write("add_custom_target(") - output.write(copy_name) - output.write(")\n") - extra_deps.append(copy_name) - return - - class Copy: - def __init__(self, ext, command): - self.cmake_inputs = [] - self.cmake_outputs = [] - self.gyp_inputs = [] - self.gyp_outputs = [] - self.ext = ext - self.inputs_name = None - self.outputs_name = None - self.command = command - - file_copy = Copy("", "copy") - dir_copy = Copy("_dirs", "copy_directory") - - for copy in copies: - files = copy["files"] - destination = copy["destination"] - for src in files: - path = os.path.normpath(src) - basename = os.path.split(path)[1] - dst = os.path.join(destination, basename) - - copy = file_copy if os.path.basename(src) else dir_copy - - copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) - copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) - copy.gyp_inputs.append(src) - copy.gyp_outputs.append(dst) - - for copy in (file_copy, dir_copy): - if copy.cmake_inputs: - copy.inputs_name = copy_name + "__input" + copy.ext - SetVariableList(output, copy.inputs_name, copy.cmake_inputs) - - copy.outputs_name = copy_name + "__output" + copy.ext - SetVariableList(output, copy.outputs_name, copy.cmake_outputs) - - # add_custom_command - output.write("add_custom_command(\n") - - output.write("OUTPUT") - for copy in (file_copy, dir_copy): - if copy.outputs_name: - WriteVariable(output, copy.outputs_name, " ") - output.write("\n") - - for copy in (file_copy, dir_copy): - for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs): - # 'cmake -E copy src dst' will create the 'dst' directory if needed. - output.write("COMMAND ${CMAKE_COMMAND} -E %s " % copy.command) - output.write(src) - output.write(" ") - output.write(dst) - output.write("\n") - - output.write("DEPENDS") - for copy in (file_copy, dir_copy): - if copy.inputs_name: - WriteVariable(output, copy.inputs_name, " ") - output.write("\n") - - output.write("WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") - output.write(path_to_gyp) - output.write("\n") - - output.write("COMMENT Copying for ") - output.write(target_name) - output.write("\n") - - output.write("VERBATIM\n") - output.write(")\n") - - # add_custom_target - output.write("add_custom_target(") - output.write(copy_name) - output.write("\n DEPENDS") - for copy in (file_copy, dir_copy): - if copy.outputs_name: - WriteVariable(output, copy.outputs_name, " ") - output.write("\n SOURCES") - if file_copy.inputs_name: - WriteVariable(output, file_copy.inputs_name, " ") - output.write("\n)\n") - - extra_deps.append(copy_name) - - -def CreateCMakeTargetBaseName(qualified_target): - """This is the name we would like the target to have.""" - _, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( - qualified_target - ) - cmake_target_base_name = gyp_target_name - if gyp_target_toolset and gyp_target_toolset != "target": - cmake_target_base_name += "_" + gyp_target_toolset - return StringToCMakeTargetName(cmake_target_base_name) - - -def CreateCMakeTargetFullName(qualified_target): - """An unambiguous name for the target.""" - gyp_file, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( - qualified_target - ) - cmake_target_full_name = gyp_file + ":" + gyp_target_name - if gyp_target_toolset and gyp_target_toolset != "target": - cmake_target_full_name += "_" + gyp_target_toolset - return StringToCMakeTargetName(cmake_target_full_name) - - -class CMakeNamer: - """Converts Gyp target names into CMake target names. - - CMake requires that target names be globally unique. One way to ensure - this is to fully qualify the names of the targets. Unfortunately, this - ends up with all targets looking like "chrome_chrome_gyp_chrome" instead - of just "chrome". If this generator were only interested in building, it - would be possible to fully qualify all target names, then create - unqualified target names which depend on all qualified targets which - should have had that name. This is more or less what the 'make' generator - does with aliases. However, one goal of this generator is to create CMake - files for use with IDEs, and fully qualified names are not as user - friendly. - - Since target name collision is rare, we do the above only when required. - - Toolset variants are always qualified from the base, as this is required for - building. However, it also makes sense for an IDE, as it is possible for - defines to be different. - """ - - def __init__(self, target_list): - self.cmake_target_base_names_conficting = set() - - cmake_target_base_names_seen = set() - for qualified_target in target_list: - cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target) - - if cmake_target_base_name not in cmake_target_base_names_seen: - cmake_target_base_names_seen.add(cmake_target_base_name) - else: - self.cmake_target_base_names_conficting.add(cmake_target_base_name) - - def CreateCMakeTargetName(self, qualified_target): - base_name = CreateCMakeTargetBaseName(qualified_target) - if base_name in self.cmake_target_base_names_conficting: - return CreateCMakeTargetFullName(qualified_target) - return base_name - - -def WriteTarget( - namer, - qualified_target, - target_dicts, - build_dir, - config_to_use, - options, - generator_flags, - all_qualified_targets, - flavor, - output, -): - # The make generator does this always. - # TODO: It would be nice to be able to tell CMake all dependencies. - circular_libs = generator_flags.get("circular", True) - - if not generator_flags.get("standalone", False): - output.write("\n#") - output.write(qualified_target) - output.write("\n") - - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir) - rel_gyp_dir = os.path.dirname(rel_gyp_file) - - # Relative path from build dir to top dir. - build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - # Relative path from build dir to gyp dir. - build_to_gyp = os.path.join(build_to_top, rel_gyp_dir) - - path_from_cmakelists_to_gyp = build_to_gyp - - spec = target_dicts.get(qualified_target, {}) - config = spec.get("configurations", {}).get(config_to_use, {}) - - xcode_settings = None - if flavor == "mac": - xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - - target_name = spec.get("target_name", "") - target_type = spec.get("type", "") - target_toolset = spec.get("toolset") - - cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) - if cmake_target_type is None: - print( - "Target %s has unknown target type %s, skipping." - % (target_name, target_type) - ) - return - - SetVariable(output, "TARGET", target_name) - SetVariable(output, "TOOLSET", target_toolset) - - cmake_target_name = namer.CreateCMakeTargetName(qualified_target) - - extra_sources = [] - extra_deps = [] - - # Actions must come first, since they can generate more OBJs for use below. - if "actions" in spec: - WriteActions( - cmake_target_name, - spec["actions"], - extra_sources, - extra_deps, - path_from_cmakelists_to_gyp, - output, - ) - - # Rules must be early like actions. - if "rules" in spec: - WriteRules( - cmake_target_name, - spec["rules"], - extra_sources, - extra_deps, - path_from_cmakelists_to_gyp, - output, - ) - - # Copies - if "copies" in spec: - WriteCopies( - cmake_target_name, - spec["copies"], - extra_deps, - path_from_cmakelists_to_gyp, - output, - ) - - # Target and sources - srcs = spec.get("sources", []) - - # Gyp separates the sheep from the goats based on file extensions. - # A full separation is done here because of flag handing (see below). - s_sources = [] - c_sources = [] - cxx_sources = [] - linkable_sources = [] - other_sources = [] - for src in srcs: - _, ext = os.path.splitext(src) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src) - - if src_type == "s": - s_sources.append(src_norm_path) - elif src_type == "cc": - c_sources.append(src_norm_path) - elif src_type == "cxx": - cxx_sources.append(src_norm_path) - elif Linkable(ext): - linkable_sources.append(src_norm_path) - else: - other_sources.append(src_norm_path) - - for extra_source in extra_sources: - src, real_source = extra_source - _, ext = os.path.splitext(real_source) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - - if src_type == "s": - s_sources.append(src) - elif src_type == "cc": - c_sources.append(src) - elif src_type == "cxx": - cxx_sources.append(src) - elif Linkable(ext): - linkable_sources.append(src) - else: - other_sources.append(src) - - s_sources_name = None - if s_sources: - s_sources_name = cmake_target_name + "__asm_srcs" - SetVariableList(output, s_sources_name, s_sources) - - c_sources_name = None - if c_sources: - c_sources_name = cmake_target_name + "__c_srcs" - SetVariableList(output, c_sources_name, c_sources) - - cxx_sources_name = None - if cxx_sources: - cxx_sources_name = cmake_target_name + "__cxx_srcs" - SetVariableList(output, cxx_sources_name, cxx_sources) - - linkable_sources_name = None - if linkable_sources: - linkable_sources_name = cmake_target_name + "__linkable_srcs" - SetVariableList(output, linkable_sources_name, linkable_sources) - - other_sources_name = None - if other_sources: - other_sources_name = cmake_target_name + "__other_srcs" - SetVariableList(output, other_sources_name, other_sources) - - # CMake gets upset when executable targets provide no sources. - # http://www.cmake.org/pipermail/cmake/2010-July/038461.html - dummy_sources_name = None - has_sources = ( - s_sources_name - or c_sources_name - or cxx_sources_name - or linkable_sources_name - or other_sources_name - ) - if target_type == "executable" and not has_sources: - dummy_sources_name = cmake_target_name + "__dummy_srcs" - SetVariable( - output, dummy_sources_name, "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c" - ) - output.write('if(NOT EXISTS "') - WriteVariable(output, dummy_sources_name) - output.write('")\n') - output.write(' file(WRITE "') - WriteVariable(output, dummy_sources_name) - output.write('" "")\n') - output.write("endif()\n") - - # CMake is opposed to setting linker directories and considers the practice - # of setting linker directories dangerous. Instead, it favors the use of - # find_library and passing absolute paths to target_link_libraries. - # However, CMake does provide the command link_directories, which adds - # link directories to targets defined after it is called. - # As a result, link_directories must come before the target definition. - # CMake unfortunately has no means of removing entries from LINK_DIRECTORIES. - library_dirs = config.get("library_dirs") - if library_dirs is not None: - output.write("link_directories(") - for library_dir in library_dirs: - output.write(" ") - output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir)) - output.write("\n") - output.write(")\n") - - output.write(cmake_target_type.command) - output.write("(") - output.write(cmake_target_name) - - if cmake_target_type.modifier is not None: - output.write(" ") - output.write(cmake_target_type.modifier) - - if s_sources_name: - WriteVariable(output, s_sources_name, " ") - if c_sources_name: - WriteVariable(output, c_sources_name, " ") - if cxx_sources_name: - WriteVariable(output, cxx_sources_name, " ") - if linkable_sources_name: - WriteVariable(output, linkable_sources_name, " ") - if other_sources_name: - WriteVariable(output, other_sources_name, " ") - if dummy_sources_name: - WriteVariable(output, dummy_sources_name, " ") - - output.write(")\n") - - # Let CMake know if the 'all' target should depend on this target. - exclude_from_all = ( - "TRUE" if qualified_target not in all_qualified_targets else "FALSE" - ) - SetTargetProperty(output, cmake_target_name, "EXCLUDE_FROM_ALL", exclude_from_all) - for extra_target_name in extra_deps: - SetTargetProperty( - output, extra_target_name, "EXCLUDE_FROM_ALL", exclude_from_all - ) - - # Output name and location. - if target_type != "none": - # Link as 'C' if there are no other files - if not c_sources and not cxx_sources: - SetTargetProperty(output, cmake_target_name, "LINKER_LANGUAGE", ["C"]) - - # Mark uncompiled sources as uncompiled. - if other_sources_name: - output.write("set_source_files_properties(") - WriteVariable(output, other_sources_name, "") - output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') - - # Mark object sources as linkable. - if linkable_sources_name: - output.write("set_source_files_properties(") - WriteVariable(output, other_sources_name, "") - output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') - - # Output directory - target_output_directory = spec.get("product_dir") - if target_output_directory is None: - if target_type in ("executable", "loadable_module"): - target_output_directory = generator_default_variables["PRODUCT_DIR"] - elif target_type == "shared_library": - target_output_directory = "${builddir}/lib.${TOOLSET}" - elif spec.get("standalone_static_library", False): - target_output_directory = generator_default_variables["PRODUCT_DIR"] - else: - base_path = gyp.common.RelativePath( - os.path.dirname(gyp_file), options.toplevel_dir - ) - target_output_directory = "${obj}.${TOOLSET}" - target_output_directory = os.path.join( - target_output_directory, base_path - ) - - cmake_target_output_directory = NormjoinPathForceCMakeSource( - path_from_cmakelists_to_gyp, target_output_directory - ) - SetTargetProperty( - output, - cmake_target_name, - cmake_target_type.property_modifier + "_OUTPUT_DIRECTORY", - cmake_target_output_directory, - ) - - # Output name - default_product_prefix = "" - default_product_name = target_name - default_product_ext = "" - if target_type == "static_library": - static_library_prefix = generator_default_variables["STATIC_LIB_PREFIX"] - default_product_name = RemovePrefix( - default_product_name, static_library_prefix - ) - default_product_prefix = static_library_prefix - default_product_ext = generator_default_variables["STATIC_LIB_SUFFIX"] - - elif target_type in ("loadable_module", "shared_library"): - shared_library_prefix = generator_default_variables["SHARED_LIB_PREFIX"] - default_product_name = RemovePrefix( - default_product_name, shared_library_prefix - ) - default_product_prefix = shared_library_prefix - default_product_ext = generator_default_variables["SHARED_LIB_SUFFIX"] - - elif target_type != "executable": - print( - "ERROR: What output file should be generated?", - "type", - target_type, - "target", - target_name, - ) - - product_prefix = spec.get("product_prefix", default_product_prefix) - product_name = spec.get("product_name", default_product_name) - product_ext = spec.get("product_extension") - if product_ext: - product_ext = "." + product_ext - else: - product_ext = default_product_ext - - SetTargetProperty(output, cmake_target_name, "PREFIX", product_prefix) - SetTargetProperty( - output, - cmake_target_name, - cmake_target_type.property_modifier + "_OUTPUT_NAME", - product_name, - ) - SetTargetProperty(output, cmake_target_name, "SUFFIX", product_ext) - - # Make the output of this target referenceable as a source. - cmake_target_output_basename = product_prefix + product_name + product_ext - cmake_target_output = os.path.join( - cmake_target_output_directory, cmake_target_output_basename - ) - SetFileProperty(output, cmake_target_output, "GENERATED", ["TRUE"], "") - - # Includes - includes = config.get("include_dirs") - if includes: - # This (target include directories) is what requires CMake 2.8.8 - includes_name = cmake_target_name + "__include_dirs" - SetVariableList( - output, - includes_name, - [ - NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) - for include in includes - ], - ) - output.write("set_property(TARGET ") - output.write(cmake_target_name) - output.write(" APPEND PROPERTY INCLUDE_DIRECTORIES ") - WriteVariable(output, includes_name, "") - output.write(")\n") - - # Defines - defines = config.get("defines") - if defines is not None: - SetTargetProperty( - output, cmake_target_name, "COMPILE_DEFINITIONS", defines, ";" - ) - - # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 - # CMake currently does not have target C and CXX flags. - # So, instead of doing... - - # cflags_c = config.get('cflags_c') - # if cflags_c is not None: - # SetTargetProperty(output, cmake_target_name, - # 'C_COMPILE_FLAGS', cflags_c, ' ') - - # cflags_cc = config.get('cflags_cc') - # if cflags_cc is not None: - # SetTargetProperty(output, cmake_target_name, - # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') - - # Instead we must... - cflags = config.get("cflags", []) - cflags_c = config.get("cflags_c", []) - cflags_cxx = config.get("cflags_cc", []) - if xcode_settings: - cflags = xcode_settings.GetCflags(config_to_use) - cflags_c = xcode_settings.GetCflagsC(config_to_use) - cflags_cxx = xcode_settings.GetCflagsCC(config_to_use) - # cflags_objc = xcode_settings.GetCflagsObjC(config_to_use) - # cflags_objcc = xcode_settings.GetCflagsObjCC(config_to_use) - - if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): - SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", cflags, " ") - - elif c_sources and not (s_sources or cxx_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") - - elif cxx_sources and not (s_sources or c_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") - - else: - # TODO: This is broken, one cannot generally set properties on files, - # as other targets may require different properties on the same files. - if s_sources and cflags: - SetFilesProperty(output, s_sources_name, "COMPILE_FLAGS", cflags, " ") - - if c_sources and (cflags or cflags_c): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetFilesProperty(output, c_sources_name, "COMPILE_FLAGS", flags, " ") - - if cxx_sources and (cflags or cflags_cxx): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetFilesProperty(output, cxx_sources_name, "COMPILE_FLAGS", flags, " ") - - # Linker flags - ldflags = config.get("ldflags") - if ldflags is not None: - SetTargetProperty(output, cmake_target_name, "LINK_FLAGS", ldflags, " ") - - # XCode settings - xcode_settings = config.get("xcode_settings", {}) - for xcode_setting, xcode_value in xcode_settings.items(): - SetTargetProperty( - output, - cmake_target_name, - "XCODE_ATTRIBUTE_%s" % xcode_setting, - xcode_value, - "" if isinstance(xcode_value, str) else " ", - ) - - # Note on Dependencies and Libraries: - # CMake wants to handle link order, resolving the link line up front. - # Gyp does not retain or enforce specifying enough information to do so. - # So do as other gyp generators and use --start-group and --end-group. - # Give CMake as little information as possible so that it doesn't mess it up. - - # Dependencies - rawDeps = spec.get("dependencies", []) - - static_deps = [] - shared_deps = [] - other_deps = [] - for rawDep in rawDeps: - dep_cmake_name = namer.CreateCMakeTargetName(rawDep) - dep_spec = target_dicts.get(rawDep, {}) - dep_target_type = dep_spec.get("type", None) - - if dep_target_type == "static_library": - static_deps.append(dep_cmake_name) - elif dep_target_type == "shared_library": - shared_deps.append(dep_cmake_name) - else: - other_deps.append(dep_cmake_name) - - # ensure all external dependencies are complete before internal dependencies - # extra_deps currently only depend on their own deps, so otherwise run early - if static_deps or shared_deps or other_deps: - for extra_dep in extra_deps: - output.write("add_dependencies(") - output.write(extra_dep) - output.write("\n") - for deps in (static_deps, shared_deps, other_deps): - for dep in gyp.common.uniquer(deps): - output.write(" ") - output.write(dep) - output.write("\n") - output.write(")\n") - - linkable = target_type in ("executable", "loadable_module", "shared_library") - other_deps.extend(extra_deps) - if other_deps or (not linkable and (static_deps or shared_deps)): - output.write("add_dependencies(") - output.write(cmake_target_name) - output.write("\n") - for dep in gyp.common.uniquer(other_deps): - output.write(" ") - output.write(dep) - output.write("\n") - if not linkable: - for deps in (static_deps, shared_deps): - for lib_dep in gyp.common.uniquer(deps): - output.write(" ") - output.write(lib_dep) - output.write("\n") - output.write(")\n") - - # Libraries - if linkable: - external_libs = [lib for lib in spec.get("libraries", []) if len(lib) > 0] - if external_libs or static_deps or shared_deps: - output.write("target_link_libraries(") - output.write(cmake_target_name) - output.write("\n") - if static_deps: - write_group = circular_libs and len(static_deps) > 1 and flavor != "mac" - if write_group: - output.write("-Wl,--start-group\n") - for dep in gyp.common.uniquer(static_deps): - output.write(" ") - output.write(dep) - output.write("\n") - if write_group: - output.write("-Wl,--end-group\n") - if shared_deps: - for dep in gyp.common.uniquer(shared_deps): - output.write(" ") - output.write(dep) - output.write("\n") - if external_libs: - for lib in gyp.common.uniquer(external_libs): - output.write(' "') - output.write(RemovePrefix(lib, "$(SDKROOT)")) - output.write('"\n') - - output.write(")\n") - - UnsetVariable(output, "TOOLSET") - UnsetVariable(output, "TARGET") - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, config_to_use): - options = params["options"] - generator_flags = params["generator_flags"] - flavor = gyp.common.GetFlavor(params) - - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to cmake easier, cmake doesn't put anything here. - # Each Gyp configuration creates a different CMakeLists.txt file - # to avoid incompatibilities between Gyp and CMake configurations. - generator_dir = os.path.relpath(options.generator_output or ".") - - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get("output_dir", "out") - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath(os.path.join(generator_dir, output_dir, config_to_use)) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - - output_file = os.path.join(toplevel_build, "CMakeLists.txt") - gyp.common.EnsureDirExists(output_file) - - output = open(output_file, "w") - output.write("cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n") - output.write("cmake_policy(VERSION 2.8.8)\n") - - gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) - output.write("project(") - output.write(project_target) - output.write(")\n") - - SetVariable(output, "configuration", config_to_use) - - ar = None - cc = None - cxx = None - - make_global_settings = data[gyp_file].get("make_global_settings", []) - build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - for key, value in make_global_settings: - if key == "AR": - ar = os.path.join(build_to_top, value) - if key == "CC": - cc = os.path.join(build_to_top, value) - if key == "CXX": - cxx = os.path.join(build_to_top, value) - - ar = gyp.common.GetEnvironFallback(["AR_target", "AR"], ar) - cc = gyp.common.GetEnvironFallback(["CC_target", "CC"], cc) - cxx = gyp.common.GetEnvironFallback(["CXX_target", "CXX"], cxx) - - if ar: - SetVariable(output, "CMAKE_AR", ar) - if cc: - SetVariable(output, "CMAKE_C_COMPILER", cc) - if cxx: - SetVariable(output, "CMAKE_CXX_COMPILER", cxx) - - # The following appears to be as-yet undocumented. - # http://public.kitware.com/Bug/view.php?id=8392 - output.write("enable_language(ASM)\n") - # ASM-ATT does not support .S files. - # output.write('enable_language(ASM-ATT)\n') - - if cc: - SetVariable(output, "CMAKE_ASM_COMPILER", cc) - - SetVariable(output, "builddir", "${CMAKE_CURRENT_BINARY_DIR}") - SetVariable(output, "obj", "${builddir}/obj") - output.write("\n") - - # TODO: Undocumented/unsupported (the CMake Java generator depends on it). - # CMake by default names the object resulting from foo.c to be foo.c.o. - # Gyp traditionally names the object resulting from foo.c foo.o. - # This should be irrelevant, but some targets extract .o files from .a - # and depend on the name of the extracted .o files. - output.write("set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n") - output.write("set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n") - output.write("\n") - - # Force ninja to use rsp files. Otherwise link and ar lines can get too long, - # resulting in 'Argument list too long' errors. - # However, rsp files don't work correctly on Mac. - if flavor != "mac": - output.write("set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n") - output.write("\n") - - namer = CMakeNamer(target_list) - - # The list of targets upon which the 'all' target should depend. - # CMake has it's own implicit 'all' target, one is not created explicitly. - all_qualified_targets = set() - for build_file in params["build_files"]: - for qualified_target in gyp.common.AllTargets( - target_list, target_dicts, os.path.normpath(build_file) - ): - all_qualified_targets.add(qualified_target) - - for qualified_target in target_list: - if flavor == "mac": - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - spec = target_dicts[qualified_target] - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[gyp_file], spec) - - WriteTarget( - namer, - qualified_target, - target_dicts, - build_dir, - config_to_use, - options, - generator_flags, - all_qualified_targets, - flavor, - output, - ) - - output.close() - - -def PerformBuild(data, configurations, params): - options = params["options"] - generator_flags = params["generator_flags"] - - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to cmake easier, cmake doesn't put anything here. - generator_dir = os.path.relpath(options.generator_output or ".") - - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get("output_dir", "out") - - for config_name in configurations: - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath( - os.path.join(generator_dir, output_dir, config_name) - ) - arguments = ["cmake", "-G", "Ninja"] - print(f"Generating [{config_name}]: {arguments}") - subprocess.check_call(arguments, cwd=build_dir) - - arguments = ["ninja", "-C", build_dir] - print(f"Building [{config_name}]: {arguments}") - subprocess.check_call(arguments) - - -def CallGenerateOutputForConfig(arglist): - # Ignore the interrupt signal so that the parent process catches it and - # kills all multiprocessing children. - signal.signal(signal.SIGINT, signal.SIG_IGN) - - target_list, target_dicts, data, params, config_name = arglist - GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) - - -def GenerateOutput(target_list, target_dicts, data, params): - user_config = params.get("generator_flags", {}).get("config", None) - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) - else: - config_names = target_dicts[target_list[0]]["configurations"] - if params["parallel"]: - try: - pool = multiprocessing.Pool(len(config_names)) - arglists = [] - for config_name in config_names: - arglists.append( - (target_list, target_dicts, data, params, config_name) - ) - pool.map(CallGenerateOutputForConfig, arglists) - except KeyboardInterrupt as e: - pool.terminate() - raise e - else: - for config_name in config_names: - GenerateOutputForConfig( - target_list, target_dicts, data, params, config_name - ) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py deleted file mode 100644 index f330a04de..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (c) 2016 Ben Noordhuis . All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import gyp.common -import gyp.xcode_emulation -import json -import os - -generator_additional_non_configuration_keys = [] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] -generator_filelist_paths = None -generator_supports_multiple_toolsets = True -generator_wants_sorted_dependencies = False - -# Lifted from make.py. The actual values don't matter much. -generator_default_variables = { - "CONFIGURATION_NAME": "$(BUILDTYPE)", - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", - "PRODUCT_DIR": "$(builddir)", - "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", - "RULE_INPUT_EXT": "$(suffix $<)", - "RULE_INPUT_NAME": "$(notdir $<)", - "RULE_INPUT_PATH": "$(abspath $<)", - "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", - "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", -} - - -def IsMac(params): - return "mac" == gyp.common.GetFlavor(params) - - -def CalculateVariables(default_variables, params): - default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - - -def AddCommandsForTarget(cwd, target, params, per_config_commands): - output_dir = params["generator_flags"].get("output_dir", "out") - for configuration_name, configuration in target["configurations"].items(): - if IsMac(params): - xcode_settings = gyp.xcode_emulation.XcodeSettings(target) - cflags = xcode_settings.GetCflags(configuration_name) - cflags_c = xcode_settings.GetCflagsC(configuration_name) - cflags_cc = xcode_settings.GetCflagsCC(configuration_name) - else: - cflags = configuration.get("cflags", []) - cflags_c = configuration.get("cflags_c", []) - cflags_cc = configuration.get("cflags_cc", []) - - cflags_c = cflags + cflags_c - cflags_cc = cflags + cflags_cc - - defines = configuration.get("defines", []) - defines = ["-D" + s for s in defines] - - # TODO(bnoordhuis) Handle generated source files. - extensions = (".c", ".cc", ".cpp", ".cxx") - sources = [s for s in target.get("sources", []) if s.endswith(extensions)] - - def resolve(filename): - return os.path.abspath(os.path.join(cwd, filename)) - - # TODO(bnoordhuis) Handle generated header files. - include_dirs = configuration.get("include_dirs", []) - include_dirs = [s for s in include_dirs if not s.startswith("$(obj)")] - includes = ["-I" + resolve(s) for s in include_dirs] - - defines = gyp.common.EncodePOSIXShellList(defines) - includes = gyp.common.EncodePOSIXShellList(includes) - cflags_c = gyp.common.EncodePOSIXShellList(cflags_c) - cflags_cc = gyp.common.EncodePOSIXShellList(cflags_cc) - - commands = per_config_commands.setdefault(configuration_name, []) - for source in sources: - file = resolve(source) - isc = source.endswith(".c") - cc = "cc" if isc else "c++" - cflags = cflags_c if isc else cflags_cc - command = " ".join( - ( - cc, - defines, - includes, - cflags, - "-c", - gyp.common.EncodePOSIXShellArgument(file), - ) - ) - commands.append(dict(command=command, directory=output_dir, file=file)) - - -def GenerateOutput(target_list, target_dicts, data, params): - per_config_commands = {} - for qualified_target, target in target_dicts.items(): - build_file, target_name, toolset = gyp.common.ParseQualifiedTarget( - qualified_target - ) - if IsMac(params): - settings = data[build_file] - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(settings, target) - cwd = os.path.dirname(build_file) - AddCommandsForTarget(cwd, target, params, per_config_commands) - - output_dir = params["generator_flags"].get("output_dir", "out") - for configuration_name, commands in per_config_commands.items(): - filename = os.path.join(output_dir, configuration_name, "compile_commands.json") - gyp.common.EnsureDirExists(filename) - fp = open(filename, "w") - json.dump(commands, fp=fp, indent=0, check_circular=False) - - -def PerformBuild(data, configurations, params): - pass diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py deleted file mode 100644 index 99d5c1fd6..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import os -import gyp -import gyp.common -import gyp.msvs_emulation -import json - -generator_supports_multiple_toolsets = True - -generator_wants_static_library_dependencies_adjusted = False - -generator_filelist_paths = {} - -generator_default_variables = {} -for dirname in [ - "INTERMEDIATE_DIR", - "SHARED_INTERMEDIATE_DIR", - "PRODUCT_DIR", - "LIB_DIR", - "SHARED_LIB_DIR", -]: - # Some gyp steps fail if these are empty(!). - generator_default_variables[dirname] = "dir" -for unused in [ - "RULE_INPUT_PATH", - "RULE_INPUT_ROOT", - "RULE_INPUT_NAME", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "CONFIGURATION_NAME", -]: - generator_default_variables[unused] = "" - - -def CalculateVariables(default_variables, params): - generator_flags = params.get("generator_flags", {}) - for key, val in generator_flags.items(): - default_variables.setdefault(key, val) - default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - - flavor = gyp.common.GetFlavor(params) - if flavor == "win": - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - - -def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get("generator_flags", {}) - if generator_flags.get("adjust_static_libraries", False): - global generator_wants_static_library_dependencies_adjusted - generator_wants_static_library_dependencies_adjusted = True - - toplevel = params["options"].toplevel_dir - generator_dir = os.path.relpath(params["options"].generator_output or ".") - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get("output_dir", "out") - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, generator_dir, output_dir, "gypfiles") - ) - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def GenerateOutput(target_list, target_dicts, data, params): - # Map of target -> list of targets it depends on. - edges = {} - - # Queue of targets to visit. - targets_to_visit = target_list[:] - - while len(targets_to_visit) > 0: - target = targets_to_visit.pop() - if target in edges: - continue - edges[target] = [] - - for dep in target_dicts[target].get("dependencies", []): - edges[target].append(dep) - targets_to_visit.append(dep) - - try: - filepath = params["generator_flags"]["output_dir"] - except KeyError: - filepath = "." - filename = os.path.join(filepath, "dump.json") - f = open(filename, "w") - json.dump(edges, f) - f.close() - print("Wrote json to %s." % filename) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py deleted file mode 100644 index 1ff0dc83a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +++ /dev/null @@ -1,464 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""GYP backend that generates Eclipse CDT settings files. - -This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML -files that can be imported into an Eclipse CDT project. The XML file contains a -list of include paths and symbols (i.e. defines). - -Because a full .cproject definition is not created by this generator, it's not -possible to properly define the include dirs and symbols for each file -individually. Instead, one set of includes/symbols is generated for the entire -project. This works fairly well (and is a vast improvement in general), but may -still result in a few indexer issues here and there. - -This generator has no automated tests, so expect it to be broken. -""" - -from xml.sax.saxutils import escape -import os.path -import subprocess -import gyp -import gyp.common -import gyp.msvs_emulation -import shlex -import xml.etree.cElementTree as ET - -generator_wants_static_library_dependencies_adjusted = False - -generator_default_variables = {} - -for dirname in ["INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR"]: - # Some gyp steps fail if these are empty(!), so we convert them to variables - generator_default_variables[dirname] = "$" + dirname - -for unused in [ - "RULE_INPUT_PATH", - "RULE_INPUT_ROOT", - "RULE_INPUT_NAME", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "CONFIGURATION_NAME", -]: - generator_default_variables[unused] = "" - -# Include dirs will occasionally use the SHARED_INTERMEDIATE_DIR variable as -# part of the path when dealing with generated headers. This value will be -# replaced dynamically for each configuration. -generator_default_variables["SHARED_INTERMEDIATE_DIR"] = "$SHARED_INTERMEDIATE_DIR" - - -def CalculateVariables(default_variables, params): - generator_flags = params.get("generator_flags", {}) - for key, val in generator_flags.items(): - default_variables.setdefault(key, val) - flavor = gyp.common.GetFlavor(params) - default_variables.setdefault("OS", flavor) - if flavor == "win": - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - - -def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get("generator_flags", {}) - if generator_flags.get("adjust_static_libraries", False): - global generator_wants_static_library_dependencies_adjusted - generator_wants_static_library_dependencies_adjusted = True - - -def GetAllIncludeDirectories( - target_list, - target_dicts, - shared_intermediate_dirs, - config_name, - params, - compiler_path, -): - """Calculate the set of include directories to be used. - - Returns: - A list including all the include_dir's specified for every target followed - by any include directories that were added as cflag compiler options. - """ - - gyp_includes_set = set() - compiler_includes_list = [] - - # Find compiler's default include dirs. - if compiler_path: - command = shlex.split(compiler_path) - command.extend(["-E", "-xc++", "-v", "-"]) - proc = subprocess.Popen( - args=command, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - output = proc.communicate()[1].decode("utf-8") - # Extract the list of include dirs from the output, which has this format: - # ... - # #include "..." search starts here: - # #include <...> search starts here: - # /usr/include/c++/4.6 - # /usr/local/include - # End of search list. - # ... - in_include_list = False - for line in output.splitlines(): - if line.startswith("#include"): - in_include_list = True - continue - if line.startswith("End of search list."): - break - if in_include_list: - include_dir = line.strip() - if include_dir not in compiler_includes_list: - compiler_includes_list.append(include_dir) - - flavor = gyp.common.GetFlavor(params) - if flavor == "win": - generator_flags = params.get("generator_flags", {}) - for target_name in target_list: - target = target_dicts[target_name] - if config_name in target["configurations"]: - config = target["configurations"][config_name] - - # Look for any include dirs that were explicitly added via cflags. This - # may be done in gyp files to force certain includes to come at the end. - # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and - # remove this. - if flavor == "win": - msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) - cflags = msvs_settings.GetCflags(config_name) - else: - cflags = config["cflags"] - for cflag in cflags: - if cflag.startswith("-I"): - include_dir = cflag[2:] - if include_dir not in compiler_includes_list: - compiler_includes_list.append(include_dir) - - # Find standard gyp include dirs. - if "include_dirs" in config: - include_dirs = config["include_dirs"] - for shared_intermediate_dir in shared_intermediate_dirs: - for include_dir in include_dirs: - include_dir = include_dir.replace( - "$SHARED_INTERMEDIATE_DIR", shared_intermediate_dir - ) - if not os.path.isabs(include_dir): - base_dir = os.path.dirname(target_name) - - include_dir = base_dir + "/" + include_dir - include_dir = os.path.abspath(include_dir) - - gyp_includes_set.add(include_dir) - - # Generate a list that has all the include dirs. - all_includes_list = list(gyp_includes_set) - all_includes_list.sort() - for compiler_include in compiler_includes_list: - if compiler_include not in gyp_includes_set: - all_includes_list.append(compiler_include) - - # All done. - return all_includes_list - - -def GetCompilerPath(target_list, data, options): - """Determine a command that can be used to invoke the compiler. - - Returns: - If this is a gyp project that has explicit make settings, try to determine - the compiler from that. Otherwise, see if a compiler was specified via the - CC_target environment variable. - """ - # First, see if the compiler is configured in make's settings. - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings_dict = data[build_file].get("make_global_settings", {}) - for key, value in make_global_settings_dict: - if key in ["CC", "CXX"]: - return os.path.join(options.toplevel_dir, value) - - # Check to see if the compiler was specified as an environment variable. - for key in ["CC_target", "CC", "CXX"]: - compiler = os.environ.get(key) - if compiler: - return compiler - - return "gcc" - - -def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path): - """Calculate the defines for a project. - - Returns: - A dict that includes explicit defines declared in gyp files along with all - of the default defines that the compiler uses. - """ - - # Get defines declared in the gyp files. - all_defines = {} - flavor = gyp.common.GetFlavor(params) - if flavor == "win": - generator_flags = params.get("generator_flags", {}) - for target_name in target_list: - target = target_dicts[target_name] - - if flavor == "win": - msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) - extra_defines = msvs_settings.GetComputedDefines(config_name) - else: - extra_defines = [] - if config_name in target["configurations"]: - config = target["configurations"][config_name] - target_defines = config["defines"] - else: - target_defines = [] - for define in target_defines + extra_defines: - split_define = define.split("=", 1) - if len(split_define) == 1: - split_define.append("1") - if split_define[0].strip() in all_defines: - # Already defined - continue - all_defines[split_define[0].strip()] = split_define[1].strip() - # Get default compiler defines (if possible). - if flavor == "win": - return all_defines # Default defines already processed in the loop above. - if compiler_path: - command = shlex.split(compiler_path) - command.extend(["-E", "-dM", "-"]) - cpp_proc = subprocess.Popen( - args=command, cwd=".", stdin=subprocess.PIPE, stdout=subprocess.PIPE - ) - cpp_output = cpp_proc.communicate()[0].decode("utf-8") - cpp_lines = cpp_output.split("\n") - for cpp_line in cpp_lines: - if not cpp_line.strip(): - continue - cpp_line_parts = cpp_line.split(" ", 2) - key = cpp_line_parts[1] - if len(cpp_line_parts) >= 3: - val = cpp_line_parts[2] - else: - val = "1" - all_defines[key] = val - - return all_defines - - -def WriteIncludePaths(out, eclipse_langs, include_dirs): - """Write the includes section of a CDT settings export file.""" - - out.write( - '
\n' - ) - out.write(' \n') - for lang in eclipse_langs: - out.write(' \n' % lang) - for include_dir in include_dirs: - out.write( - ' %s\n' - % include_dir - ) - out.write(" \n") - out.write("
\n") - - -def WriteMacros(out, eclipse_langs, defines): - """Write the macros section of a CDT settings export file.""" - - out.write( - '
\n' - ) - out.write(' \n') - for lang in eclipse_langs: - out.write(' \n' % lang) - for key in sorted(defines): - out.write( - " %s%s\n" - % (escape(key), escape(defines[key])) - ) - out.write(" \n") - out.write("
\n") - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): - options = params["options"] - generator_flags = params.get("generator_flags", {}) - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.join(generator_flags.get("output_dir", "out"), config_name) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the - # SHARED_INTERMEDIATE_DIR. Include both possible locations. - shared_intermediate_dirs = [ - os.path.join(toplevel_build, "obj", "gen"), - os.path.join(toplevel_build, "gen"), - ] - - GenerateCdtSettingsFile( - target_list, - target_dicts, - data, - params, - config_name, - os.path.join(toplevel_build, "eclipse-cdt-settings.xml"), - options, - shared_intermediate_dirs, - ) - GenerateClasspathFile( - target_list, - target_dicts, - options.toplevel_dir, - toplevel_build, - os.path.join(toplevel_build, "eclipse-classpath.xml"), - ) - - -def GenerateCdtSettingsFile( - target_list, - target_dicts, - data, - params, - config_name, - out_name, - options, - shared_intermediate_dirs, -): - gyp.common.EnsureDirExists(out_name) - with open(out_name, "w") as out: - out.write('\n') - out.write("\n") - - eclipse_langs = [ - "C++ Source File", - "C Source File", - "Assembly Source File", - "GNU C++", - "GNU C", - "Assembly", - ] - compiler_path = GetCompilerPath(target_list, data, options) - include_dirs = GetAllIncludeDirectories( - target_list, - target_dicts, - shared_intermediate_dirs, - config_name, - params, - compiler_path, - ) - WriteIncludePaths(out, eclipse_langs, include_dirs) - defines = GetAllDefines( - target_list, target_dicts, data, config_name, params, compiler_path - ) - WriteMacros(out, eclipse_langs, defines) - - out.write("\n") - - -def GenerateClasspathFile( - target_list, target_dicts, toplevel_dir, toplevel_build, out_name -): - """Generates a classpath file suitable for symbol navigation and code - completion of Java code (such as in Android projects) by finding all - .java and .jar files used as action inputs.""" - gyp.common.EnsureDirExists(out_name) - result = ET.Element("classpath") - - def AddElements(kind, paths): - # First, we need to normalize the paths so they are all relative to the - # toplevel dir. - rel_paths = set() - for path in paths: - if os.path.isabs(path): - rel_paths.add(os.path.relpath(path, toplevel_dir)) - else: - rel_paths.add(path) - - for path in sorted(rel_paths): - entry_element = ET.SubElement(result, "classpathentry") - entry_element.set("kind", kind) - entry_element.set("path", path) - - AddElements("lib", GetJavaJars(target_list, target_dicts, toplevel_dir)) - AddElements("src", GetJavaSourceDirs(target_list, target_dicts, toplevel_dir)) - # Include the standard JRE container and a dummy out folder - AddElements("con", ["org.eclipse.jdt.launching.JRE_CONTAINER"]) - # Include a dummy out folder so that Eclipse doesn't use the default /bin - # folder in the root of the project. - AddElements("output", [os.path.join(toplevel_build, ".eclipse-java-build")]) - - ET.ElementTree(result).write(out_name) - - -def GetJavaJars(target_list, target_dicts, toplevel_dir): - """Generates a sequence of all .jars used as inputs.""" - for target_name in target_list: - target = target_dicts[target_name] - for action in target.get("actions", []): - for input_ in action["inputs"]: - if os.path.splitext(input_)[1] == ".jar" and not input_.startswith("$"): - if os.path.isabs(input_): - yield input_ - else: - yield os.path.join(os.path.dirname(target_name), input_) - - -def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir): - """Generates a sequence of all likely java package root directories.""" - for target_name in target_list: - target = target_dicts[target_name] - for action in target.get("actions", []): - for input_ in action["inputs"]: - if os.path.splitext(input_)[1] == ".java" and not input_.startswith( - "$" - ): - dir_ = os.path.dirname( - os.path.join(os.path.dirname(target_name), input_) - ) - # If there is a parent 'src' or 'java' folder, navigate up to it - - # these are canonical package root names in Chromium. This will - # break if 'src' or 'java' exists in the package structure. This - # could be further improved by inspecting the java file for the - # package name if this proves to be too fragile in practice. - parent_search = dir_ - while os.path.basename(parent_search) not in ["src", "java"]: - parent_search, _ = os.path.split(parent_search) - if not parent_search or parent_search == toplevel_dir: - # Didn't find a known root, just return the original path - yield dir_ - break - else: - yield parent_search - - -def GenerateOutput(target_list, target_dicts, data, params): - """Generate an XML settings file that can be imported into a CDT project.""" - - if params["options"].generator_output: - raise NotImplementedError("--generator_output not implemented for eclipse") - - user_config = params.get("generator_flags", {}).get("config", None) - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) - else: - config_names = target_dicts[target_list[0]]["configurations"] - for config_name in config_names: - GenerateOutputForConfig( - target_list, target_dicts, data, params, config_name - ) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py deleted file mode 100644 index 4171704c4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""gypd output module - -This module produces gyp input as its output. Output files are given the -.gypd extension to avoid overwriting the .gyp files that they are generated -from. Internal references to .gyp files (such as those found in -"dependencies" sections) are not adjusted to point to .gypd files instead; -unlike other paths, which are relative to the .gyp or .gypd file, such paths -are relative to the directory from which gyp was run to create the .gypd file. - -This generator module is intended to be a sample and a debugging aid, hence -the "d" for "debug" in .gypd. It is useful to inspect the results of the -various merges, expansions, and conditional evaluations performed by gyp -and to see a representation of what would be fed to a generator module. - -It's not advisable to rename .gypd files produced by this module to .gyp, -because they will have all merges, expansions, and evaluations already -performed and the relevant constructs not present in the output; paths to -dependencies may be wrong; and various sections that do not belong in .gyp -files such as such as "included_files" and "*_excluded" will be present. -Output will also be stripped of comments. This is not intended to be a -general-purpose gyp pretty-printer; for that, you probably just want to -run "pprint.pprint(eval(open('source.gyp').read()))", which will still strip -comments but won't do all of the other things done to this module's output. - -The specific formatting of the output generated by this module is subject -to change. -""" - - -import gyp.common -import pprint - - -# These variables should just be spit back out as variable references. -_generator_identity_variables = [ - "CONFIGURATION_NAME", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "INTERMEDIATE_DIR", - "LIB_DIR", - "PRODUCT_DIR", - "RULE_INPUT_ROOT", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "RULE_INPUT_NAME", - "RULE_INPUT_PATH", - "SHARED_INTERMEDIATE_DIR", - "SHARED_LIB_DIR", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", -] - -# gypd doesn't define a default value for OS like many other generator -# modules. Specify "-D OS=whatever" on the command line to provide a value. -generator_default_variables = {} - -# gypd supports multiple toolsets -generator_supports_multiple_toolsets = True - -# TODO(mark): This always uses <, which isn't right. The input module should -# notify the generator to tell it which phase it is operating in, and this -# module should use < for the early phase and then switch to > for the late -# phase. Bonus points for carrying @ back into the output too. -for v in _generator_identity_variables: - generator_default_variables[v] = "<(%s)" % v - - -def GenerateOutput(target_list, target_dicts, data, params): - output_files = {} - for qualified_target in target_list: - [input_file, target] = gyp.common.ParseQualifiedTarget(qualified_target)[0:2] - - if input_file[-4:] != ".gyp": - continue - input_file_stem = input_file[:-4] - output_file = input_file_stem + params["options"].suffix + ".gypd" - - output_files[output_file] = output_files.get(output_file, input_file) - - for output_file, input_file in output_files.items(): - output = open(output_file, "w") - pprint.pprint(data[input_file], output) - output.close() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py deleted file mode 100644 index 82a07ddc6..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""gypsh output module - -gypsh is a GYP shell. It's not really a generator per se. All it does is -fire up an interactive Python session with a few local variables set to the -variables passed to the generator. Like gypd, it's intended as a debugging -aid, to facilitate the exploration of .gyp structures after being processed -by the input module. - -The expected usage is "gyp -f gypsh -D OS=desired_os". -""" - - -import code -import sys - - -# All of this stuff about generator variables was lovingly ripped from gypd.py. -# That module has a much better description of what's going on and why. -_generator_identity_variables = [ - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "INTERMEDIATE_DIR", - "PRODUCT_DIR", - "RULE_INPUT_ROOT", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "RULE_INPUT_NAME", - "RULE_INPUT_PATH", - "SHARED_INTERMEDIATE_DIR", -] - -generator_default_variables = {} - -for v in _generator_identity_variables: - generator_default_variables[v] = "<(%s)" % v - - -def GenerateOutput(target_list, target_dicts, data, params): - locals = { - "target_list": target_list, - "target_dicts": target_dicts, - "data": data, - } - - # Use a banner that looks like the stock Python one and like what - # code.interact uses by default, but tack on something to indicate what - # locals are available, and identify gypsh. - banner = "Python {} on {}\nlocals.keys() = {}\ngypsh".format( - sys.version, - sys.platform, - repr(sorted(locals.keys())), - ) - - code.interact(banner, local=locals) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py deleted file mode 100644 index c595f20fe..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +++ /dev/null @@ -1,2518 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Notes: -# -# This is all roughly based on the Makefile system used by the Linux -# kernel, but is a non-recursive make -- we put the entire dependency -# graph in front of make and let it figure it out. -# -# The code below generates a separate .mk file for each target, but -# all are sourced by the top-level Makefile. This means that all -# variables in .mk-files clobber one another. Be careful to use := -# where appropriate for immediate evaluation, and similarly to watch -# that you're not relying on a variable value to last between different -# .mk files. -# -# TODOs: -# -# Global settings and utility functions are currently stuffed in the -# toplevel Makefile. It may make sense to generate some .mk files on -# the side to keep the files readable. - - -import os -import re -import subprocess -import gyp -import gyp.common -import gyp.xcode_emulation -from gyp.common import GetEnvironFallback - -import hashlib - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", - "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", - "PRODUCT_DIR": "$(builddir)", - "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. - "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. - "RULE_INPUT_PATH": "$(abspath $<)", - "RULE_INPUT_EXT": "$(suffix $<)", - "RULE_INPUT_NAME": "$(notdir $<)", - "CONFIGURATION_NAME": "$(BUILDTYPE)", -} - -# Make supports multiple toolsets -generator_supports_multiple_toolsets = True - -# Request sorted dependencies in the order from dependents to dependencies. -generator_wants_sorted_dependencies = False - -# Placates pylint. -generator_additional_non_configuration_keys = [] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] -generator_filelist_paths = None - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - flavor = gyp.common.GetFlavor(params) - if flavor == "mac": - default_variables.setdefault("OS", "mac") - default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") - default_variables.setdefault( - "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - default_variables.setdefault( - "LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - - # Copy additional generator configuration data from Xcode, which is shared - # by the Mac Make generator. - import gyp.generator.xcode as xcode_generator - - global generator_additional_non_configuration_keys - generator_additional_non_configuration_keys = getattr( - xcode_generator, "generator_additional_non_configuration_keys", [] - ) - global generator_additional_path_sections - generator_additional_path_sections = getattr( - xcode_generator, "generator_additional_path_sections", [] - ) - global generator_extra_sources_for_rules - generator_extra_sources_for_rules = getattr( - xcode_generator, "generator_extra_sources_for_rules", [] - ) - COMPILABLE_EXTENSIONS.update({".m": "objc", ".mm": "objcxx"}) - else: - operating_system = flavor - if flavor == "android": - operating_system = "linux" # Keep this legacy behavior for now. - default_variables.setdefault("OS", operating_system) - if flavor == "aix": - default_variables.setdefault("SHARED_LIB_SUFFIX", ".a") - else: - default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") - default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") - default_variables.setdefault("LIB_DIR", "$(obj).$(TOOLSET)") - - -def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get("generator_flags", {}) - android_ndk_version = generator_flags.get("android_ndk_version", None) - # Android NDK requires a strict link order. - if android_ndk_version: - global generator_wants_sorted_dependencies - generator_wants_sorted_dependencies = True - - output_dir = params["options"].generator_output or params["options"].toplevel_dir - builddir_name = generator_flags.get("output_dir", "out") - qualified_out_dir = os.path.normpath( - os.path.join(output_dir, builddir_name, "gypfiles") - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": params["options"].toplevel_dir, - "qualified_out_dir": qualified_out_dir, - } - - -# The .d checking code below uses these functions: -# wildcard, sort, foreach, shell, wordlist -# wildcard can handle spaces, the rest can't. -# Since I could find no way to make foreach work with spaces in filenames -# correctly, the .d files have spaces replaced with another character. The .d -# file for -# Chromium\ Framework.framework/foo -# is for example -# out/Release/.deps/out/Release/Chromium?Framework.framework/foo -# This is the replacement character. -SPACE_REPLACEMENT = "?" - - -LINK_COMMANDS_LINUX = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -# Due to circular dependencies between libraries :(, we wrap the -# special "figure out circular dependencies" flags around the entire -# input list during linking. -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group - -# We support two kinds of shared objects (.so): -# 1) shared_library, which is just bundling together many dependent libraries -# into a link line. -# 2) loadable_module, which is generating a module intended for dlopen(). -# -# They differ only slightly: -# In the former case, we want to package all dependent code into the .so. -# In the latter case, we want to package just the API exposed by the -# outermost module. -# This means shared_library uses --whole-archive, while loadable_module doesn't. -# (Note that --whole-archive is incompatible with the --start-group used in -# normal linking.) - -# Other shared-object link notes: -# - Set SONAME to the library filename so our binaries don't reference -# the local, absolute paths used on the link command-line. -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) -""" # noqa: E501 - -LINK_COMMANDS_MAC = """\ -quiet_cmd_alink = LIBTOOL-STATIC $@ -cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - -LINK_COMMANDS_ANDROID = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -# Due to circular dependencies between libraries :(, we wrap the -# special "figure out circular dependencies" flags around the entire -# input list during linking. -quiet_cmd_link = LINK($(TOOLSET)) $@ -quiet_cmd_link_host = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) -cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) - -# Other shared-object link notes: -# - Set SONAME to the library filename so our binaries don't reference -# the local, absolute paths used on the link command-line. -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) -quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - - -LINK_COMMANDS_AIX = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - - -LINK_COMMANDS_OS390 = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL -""" # noqa: E501 - - -# Header of toplevel Makefile. -# This should go into the build tree, but it's easier to keep it here for now. -SHARED_HEADER = ( - """\ -# We borrow heavily from the kernel build setup, though we are simpler since -# we don't have Kconfig tweaking settings on us. - -# The implicit make rules have it looking for RCS files, among other things. -# We instead explicitly write all the rules we care about. -# It's even quicker (saves ~200ms) to pass -r on the command line. -MAKEFLAGS=-r - -# The source directory tree. -srcdir := %(srcdir)s -abs_srcdir := $(abspath $(srcdir)) - -# The name of the builddir. -builddir_name ?= %(builddir)s - -# The V=1 flag on command line makes us verbosely print command lines. -ifdef V - quiet= -else - quiet=quiet_ -endif - -# Specify BUILDTYPE=Release on the command line for a release build. -BUILDTYPE ?= %(default_configuration)s - -# Directory all our build output goes into. -# Note that this must be two directories beneath src/ for unit tests to pass, -# as they reach into the src/ directory for data with relative paths. -builddir ?= $(builddir_name)/$(BUILDTYPE) -abs_builddir := $(abspath $(builddir)) -depsdir := $(builddir)/.deps - -# Object output directory. -obj := $(builddir)/obj -abs_obj := $(abspath $(obj)) - -# We build up a list of every single one of the targets so we can slurp in the -# generated dependency rule Makefiles in one pass. -all_deps := - -%(make_global_settings)s - -CC.target ?= %(CC.target)s -CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) -CXX.target ?= %(CXX.target)s -CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) -LINK.target ?= %(LINK.target)s -LDFLAGS.target ?= $(LDFLAGS) -AR.target ?= $(AR) - -# C++ apps need to be linked with g++. -LINK ?= $(CXX.target) - -# TODO(evan): move all cross-compilation logic to gyp-time so we don't need -# to replicate this environment fallback in make as well. -CC.host ?= %(CC.host)s -CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) -CXX.host ?= %(CXX.host)s -CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) -LINK.host ?= %(LINK.host)s -LDFLAGS.host ?= $(LDFLAGS_host) -AR.host ?= %(AR.host)s - -# Define a dir function that can handle spaces. -# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions -# "leading spaces cannot appear in the text of the first argument as written. -# These characters can be put into the argument value by variable substitution." -empty := -space := $(empty) $(empty) - -# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces -replace_spaces = $(subst $(space),""" - + SPACE_REPLACEMENT - + """,$1) -unreplace_spaces = $(subst """ - + SPACE_REPLACEMENT - + """,$(space),$1) -dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) - -# Flags to make gcc output dependency info. Note that you need to be -# careful here to use the flags that ccache and distcc can understand. -# We write to a dep file on the side first and then rename at the end -# so we can't end up with a broken dep file. -depfile = $(depsdir)/$(call replace_spaces,$@).d -DEPFLAGS = %(makedep_args)s -MF $(depfile).raw - -# We have to fixup the deps output in a few ways. -# (1) the file output should mention the proper .o file. -# ccache or distcc lose the path to the target, so we convert a rule of -# the form: -# foobar.o: DEP1 DEP2 -# into -# path/to/foobar.o: DEP1 DEP2 -# (2) we want missing files not to cause us to fail to build. -# We want to rewrite -# foobar.o: DEP1 DEP2 \\ -# DEP3 -# to -# DEP1: -# DEP2: -# DEP3: -# so if the files are missing, they're just considered phony rules. -# We have to do some pretty insane escaping to get those backslashes -# and dollar signs past make, the shell, and sed at the same time. -# Doesn't work with spaces, but that's fine: .d files have spaces in -# their names replaced with other characters.""" - r""" -define fixup_dep -# The depfile may not exist if the input file didn't have any #includes. -touch $(depfile).raw -# Fixup path as in (1). -sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) -# Add extra rules as in (2). -# We remove slashes and replace spaces with new lines; -# remove blank lines; -# delete the first line and append a colon to the remaining lines. -sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ - grep -v '^$$' |\ - sed -e 1d -e 's|$$|:|' \ - >> $(depfile) -rm $(depfile).raw -endef -""" - """ -# Command definitions: -# - cmd_foo is the actual command to run; -# - quiet_cmd_foo is the brief-output summary of the command. - -quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c - -quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -%(extra_commands)s -quiet_cmd_touch = TOUCH $@ -cmd_touch = touch $@ - -quiet_cmd_copy = COPY $@ -# send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") - -%(link_commands)s -""" # noqa: E501 - r""" -# Define an escape_quotes function to escape single quotes. -# This allows us to handle quotes properly as long as we always use -# use single quotes and escape_quotes. -escape_quotes = $(subst ','\'',$(1)) -# This comment is here just to include a ' to unconfuse syntax highlighting. -# Define an escape_vars function to escape '$' variable syntax. -# This allows us to read/write command lines with shell variables (e.g. -# $LD_LIBRARY_PATH), without triggering make substitution. -escape_vars = $(subst $$,$$$$,$(1)) -# Helper that expands to a shell command to echo a string exactly as it is in -# make. This uses printf instead of echo because printf's behaviour with respect -# to escape sequences is more portable than echo's across different shells -# (e.g., dash, bash). -exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))' -""" - """ -# Helper to compare the command we're about to run against the command -# we logged the last time we ran the command. Produces an empty -# string (false) when the commands match. -# Tricky point: Make has no string-equality test function. -# The kernel uses the following, but it seems like it would have false -# positives, where one string reordered its arguments. -# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\ -# $(filter-out $(cmd_$@), $(cmd_$(1)))) -# We instead substitute each for the empty string into the other, and -# say they're equal if both substitutions produce the empty string. -# .d files contain """ - + SPACE_REPLACEMENT - + """ instead of spaces, take that into account. -command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\ - $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) - -# Helper that is non-empty when a prerequisite changes. -# Normally make does this implicitly, but we force rules to always run -# so we can check their command lines. -# $? -- new prerequisites -# $| -- order-only dependencies -prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) - -# Helper that executes all postbuilds until one fails. -define do_postbuilds - @E=0;\\ - for p in $(POSTBUILDS); do\\ - eval $$p;\\ - E=$$?;\\ - if [ $$E -ne 0 ]; then\\ - break;\\ - fi;\\ - done;\\ - if [ $$E -ne 0 ]; then\\ - rm -rf "$@";\\ - exit $$E;\\ - fi -endef - -# do_cmd: run a command via the above cmd_foo names, if necessary. -# Should always run for a given target to handle command-line changes. -# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. -# Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains """ - + SPACE_REPLACEMENT - + """ for -# spaces already and dirx strips the """ - + SPACE_REPLACEMENT - + """ characters. -define do_cmd -$(if $(or $(command_changed),$(prereq_changed)), - @$(call exact_echo, $($(quiet)cmd_$(1))) - @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" - $(if $(findstring flock,$(word %(flock_index)d,$(cmd_$1))), - @$(cmd_$(1)) - @echo " $(quiet_cmd_$(1)): Finished", - @$(cmd_$(1)) - ) - @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) - @$(if $(2),$(fixup_dep)) - $(if $(and $(3), $(POSTBUILDS)), - $(call do_postbuilds) - ) -) -endef - -# Declare the "%(default_target)s" target first so it is the default, -# even though we don't have the deps yet. -.PHONY: %(default_target)s -%(default_target)s: - -# make looks for ways to re-generate included makefiles, but in our case, we -# don't have a direct way. Explicitly telling make that it has nothing to do -# for them makes it go faster. -%%.d: ; - -# Use FORCE_DO_CMD to force a target to run. Should be coupled with -# do_cmd. -.PHONY: FORCE_DO_CMD -FORCE_DO_CMD: - -""" # noqa: E501 -) - -SHARED_HEADER_MAC_COMMANDS = """ -quiet_cmd_objc = CXX($(TOOLSET)) $@ -cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< - -quiet_cmd_objcxx = CXX($(TOOLSET)) $@ -cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# Commands for precompiled header files. -quiet_cmd_pch_c = CXX($(TOOLSET)) $@ -cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ -cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_m = CXX($(TOOLSET)) $@ -cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< -quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ -cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# gyp-mac-tool is written next to the root Makefile by gyp. -# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd -# already. -quiet_cmd_mac_tool = MACTOOL $(4) $< -cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" - -quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ -cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) - -quiet_cmd_infoplist = INFOPLIST $@ -cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" -""" # noqa: E501 - - -def WriteRootHeaderSuffixRules(writer): - extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) - - writer.write("# Suffix rules, putting all outputs into $(obj).\n") - for ext in extensions: - writer.write("$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n" % ext) - writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) - - writer.write("\n# Try building from generated source, too.\n") - for ext in extensions: - writer.write( - "$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n" % ext - ) - writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) - writer.write("\n") - for ext in extensions: - writer.write("$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n" % ext) - writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) - writer.write("\n") - - -SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\ -# Suffix rules, putting all outputs into $(obj). -""" - - -SHARED_HEADER_SUFFIX_RULES_COMMENT2 = """\ -# Try building from generated source, too. -""" - - -SHARED_FOOTER = """\ -# "all" is a concatenation of the "all" targets from all the included -# sub-makefiles. This is just here to clarify. -all: - -# Add in dependency-tracking rules. $(all_deps) is the list of every single -# target in our tree. Only consider the ones with .d (dependency) info: -d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) -ifneq ($(d_files),) - include $(d_files) -endif -""" - -header = """\ -# This file is generated by gyp; do not edit. - -""" - -# Maps every compilable file extension to the do_cmd that compiles it. -COMPILABLE_EXTENSIONS = { - ".c": "cc", - ".cc": "cxx", - ".cpp": "cxx", - ".cxx": "cxx", - ".s": "cc", - ".S": "cc", -} - - -def Compilable(filename): - """Return true if the file is compilable (should be in OBJS).""" - for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): - if res: - return True - return False - - -def Linkable(filename): - """Return true if the file is linkable (should be on the link line).""" - return filename.endswith(".o") - - -def Target(filename): - """Translate a compilable filename to its .o target.""" - return os.path.splitext(filename)[0] + ".o" - - -def EscapeShellArgument(s): - """Quotes an argument so that it will be interpreted literally by a POSIX - shell. Taken from - http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python - """ - return "'" + s.replace("'", "'\\''") + "'" - - -def EscapeMakeVariableExpansion(s): - """Make has its own variable expansion syntax using $. We must escape it for - string to be interpreted literally.""" - return s.replace("$", "$$") - - -def EscapeCppDefine(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = EscapeShellArgument(s) - s = EscapeMakeVariableExpansion(s) - # '#' characters must be escaped even embedded in a string, else Make will - # treat it as the start of a comment. - return s.replace("#", r"\#") - - -def QuoteIfNecessary(string): - """TODO: Should this ideally be replaced with one or more of the above - functions?""" - if '"' in string: - string = '"' + string.replace('"', '\\"') + '"' - return string - - -def StringToMakefileVariable(string): - """Convert a string to a value that is acceptable as a make variable name.""" - return re.sub("[^a-zA-Z0-9_]", "_", string) - - -srcdir_prefix = "" - - -def Sourceify(path): - """Convert a path to its source directory form.""" - if "$(" in path: - return path - if os.path.isabs(path): - return path - return srcdir_prefix + path - - -def QuoteSpaces(s, quote=r"\ "): - return s.replace(" ", quote) - - -def SourceifyAndQuoteSpaces(path): - """Convert a path to its source directory form and quote spaces.""" - return QuoteSpaces(Sourceify(path)) - - -# Map from qualified target to path to output. -target_outputs = {} -# Map from qualified target to any linkable output. A subset -# of target_outputs. E.g. when mybinary depends on liba, we want to -# include liba in the linker line; when otherbinary depends on -# mybinary, we just want to build mybinary first. -target_link_deps = {} - - -class MakefileWriter: - """MakefileWriter packages up the writing of one target-specific foobar.mk. - - Its only real entry point is Write(), and is mostly used for namespacing. - """ - - def __init__(self, generator_flags, flavor): - self.generator_flags = generator_flags - self.flavor = flavor - - self.suffix_rules_srcdir = {} - self.suffix_rules_objdir1 = {} - self.suffix_rules_objdir2 = {} - - # Generate suffix rules for all compilable extensions. - for ext in COMPILABLE_EXTENSIONS.keys(): - # Suffix rules for source folder. - self.suffix_rules_srcdir.update( - { - ext: ( - """\ -$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD -\t@$(call do_cmd,%s,1) -""" - % (ext, COMPILABLE_EXTENSIONS[ext]) - ) - } - ) - - # Suffix rules for generated source files. - self.suffix_rules_objdir1.update( - { - ext: ( - """\ -$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD -\t@$(call do_cmd,%s,1) -""" - % (ext, COMPILABLE_EXTENSIONS[ext]) - ) - } - ) - self.suffix_rules_objdir2.update( - { - ext: ( - """\ -$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD -\t@$(call do_cmd,%s,1) -""" - % (ext, COMPILABLE_EXTENSIONS[ext]) - ) - } - ) - - def Write( - self, qualified_target, base_path, output_filename, spec, configs, part_of_all - ): - """The main entry point: writes a .mk file for a single target. - - Arguments: - qualified_target: target we're generating - base_path: path relative to source root we're building in, used to resolve - target-relative paths - output_filename: output .mk file name to write - spec, configs: gyp info - part_of_all: flag indicating this target is part of 'all' - """ - gyp.common.EnsureDirExists(output_filename) - - self.fp = open(output_filename, "w") - - self.fp.write(header) - - self.qualified_target = qualified_target - self.path = base_path - self.target = spec["target_name"] - self.type = spec["type"] - self.toolset = spec["toolset"] - - self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) - if self.flavor == "mac": - self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - else: - self.xcode_settings = None - - deps, link_deps = self.ComputeDeps(spec) - - # Some of the generation below can add extra output, sources, or - # link dependencies. All of the out params of the functions that - # follow use names like extra_foo. - extra_outputs = [] - extra_sources = [] - extra_link_deps = [] - extra_mac_bundle_resources = [] - mac_bundle_deps = [] - - if self.is_mac_bundle: - self.output = self.ComputeMacBundleOutput(spec) - self.output_binary = self.ComputeMacBundleBinaryOutput(spec) - else: - self.output = self.output_binary = self.ComputeOutput(spec) - - self.is_standalone_static_library = bool( - spec.get("standalone_static_library", 0) - ) - self._INSTALLABLE_TARGETS = ("executable", "loadable_module", "shared_library") - if self.is_standalone_static_library or self.type in self._INSTALLABLE_TARGETS: - self.alias = os.path.basename(self.output) - install_path = self._InstallableTargetInstallPath() - else: - self.alias = self.output - install_path = self.output - - self.WriteLn("TOOLSET := " + self.toolset) - self.WriteLn("TARGET := " + self.target) - - # Actions must come first, since they can generate more OBJs for use below. - if "actions" in spec: - self.WriteActions( - spec["actions"], - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ) - - # Rules must be early like actions. - if "rules" in spec: - self.WriteRules( - spec["rules"], - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ) - - if "copies" in spec: - self.WriteCopies(spec["copies"], extra_outputs, part_of_all) - - # Bundle resources. - if self.is_mac_bundle: - all_mac_bundle_resources = ( - spec.get("mac_bundle_resources", []) + extra_mac_bundle_resources - ) - self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) - self.WriteMacInfoPlist(mac_bundle_deps) - - # Sources. - all_sources = spec.get("sources", []) + extra_sources - if all_sources: - self.WriteSources( - configs, - deps, - all_sources, - extra_outputs, - extra_link_deps, - part_of_all, - gyp.xcode_emulation.MacPrefixHeader( - self.xcode_settings, - lambda p: Sourceify(self.Absolutify(p)), - self.Pchify, - ), - ) - sources = [x for x in all_sources if Compilable(x)] - if sources: - self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) - extensions = {os.path.splitext(s)[1] for s in sources} - for ext in extensions: - if ext in self.suffix_rules_srcdir: - self.WriteLn(self.suffix_rules_srcdir[ext]) - self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) - for ext in extensions: - if ext in self.suffix_rules_objdir1: - self.WriteLn(self.suffix_rules_objdir1[ext]) - for ext in extensions: - if ext in self.suffix_rules_objdir2: - self.WriteLn(self.suffix_rules_objdir2[ext]) - self.WriteLn("# End of this set of suffix rules") - - # Add dependency from bundle to bundle binary. - if self.is_mac_bundle: - mac_bundle_deps.append(self.output_binary) - - self.WriteTarget( - spec, - configs, - deps, - extra_link_deps + link_deps, - mac_bundle_deps, - extra_outputs, - part_of_all, - ) - - # Update global list of target outputs, used in dependency tracking. - target_outputs[qualified_target] = install_path - - # Update global list of link dependencies. - if self.type in ("static_library", "shared_library"): - target_link_deps[qualified_target] = self.output_binary - - # Currently any versions have the same effect, but in future the behavior - # could be different. - if self.generator_flags.get("android_ndk_version", None): - self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) - - self.fp.close() - - def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): - """Write a "sub-project" Makefile. - - This is a small, wrapper Makefile that calls the top-level Makefile to build - the targets from a single gyp file (i.e. a sub-project). - - Arguments: - output_filename: sub-project Makefile name to write - makefile_path: path to the top-level Makefile - targets: list of "all" targets for this sub-project - build_dir: build output directory, relative to the sub-project - """ - gyp.common.EnsureDirExists(output_filename) - self.fp = open(output_filename, "w") - self.fp.write(header) - # For consistency with other builders, put sub-project build output in the - # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). - self.WriteLn( - "export builddir_name ?= %s" - % os.path.join(os.path.dirname(output_filename), build_dir) - ) - self.WriteLn(".PHONY: all") - self.WriteLn("all:") - if makefile_path: - makefile_path = " -C " + makefile_path - self.WriteLn("\t$(MAKE){} {}".format(makefile_path, " ".join(targets))) - self.fp.close() - - def WriteActions( - self, - actions, - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ): - """Write Makefile code for any 'actions' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - actions (used to make other pieces dependent on these - actions) - part_of_all: flag indicating this target is part of 'all' - """ - env = self.GetSortedXcodeEnv() - for action in actions: - name = StringToMakefileVariable( - "{}_{}".format(self.qualified_target, action["action_name"]) - ) - self.WriteLn('### Rules for action "%s":' % action["action_name"]) - inputs = action["inputs"] - outputs = action["outputs"] - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set() - for out in outputs: - dir = os.path.split(out)[0] - if dir: - dirs.add(dir) - if int(action.get("process_outputs_as_sources", False)): - extra_sources += outputs - if int(action.get("process_outputs_as_mac_bundle_resources", False)): - extra_mac_bundle_resources += outputs - - # Write the actual command. - action_commands = action["action"] - if self.flavor == "mac": - action_commands = [ - gyp.xcode_emulation.ExpandEnvVars(command, env) - for command in action_commands - ] - command = gyp.common.EncodePOSIXShellList(action_commands) - if "message" in action: - self.WriteLn( - "quiet_cmd_{} = ACTION {} $@".format(name, action["message"]) - ) - else: - self.WriteLn(f"quiet_cmd_{name} = ACTION {name} $@") - if len(dirs) > 0: - command = "mkdir -p %s" % " ".join(dirs) + "; " + command - - cd_action = "cd %s; " % Sourceify(self.path or ".") - - # command and cd_action get written to a toplevel variable called - # cmd_foo. Toplevel variables can't handle things that change per - # makefile like $(TARGET), so hardcode the target. - command = command.replace("$(TARGET)", self.target) - cd_action = cd_action.replace("$(TARGET)", self.target) - - # Set LD_LIBRARY_PATH in case the action runs an executable from this - # build which links to shared libs from this build. - # actions run on the host, so they should in theory only use host - # libraries, but until everything is made cross-compile safe, also use - # target libraries. - # TODO(piman): when everything is cross-compile safe, remove lib.target - self.WriteLn( - "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" - "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " - "export LD_LIBRARY_PATH; " - "%s%s" % (name, cd_action, command) - ) - self.WriteLn() - outputs = [self.Absolutify(o) for o in outputs] - # The makefile rules are all relative to the top dir, but the gyp actions - # are defined relative to their containing dir. This replaces the obj - # variable for the action rule with an absolute version so that the output - # goes in the right place. - # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); - # it's superfluous for the "extra outputs", and this avoids accidentally - # writing duplicate dummy rules for those outputs. - # Same for environment. - self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) - self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) - self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) - - for input in inputs: - assert " " not in input, ( - "Spaces in action input filenames not supported (%s)" % input - ) - for output in outputs: - assert " " not in output, ( - "Spaces in action output filenames not supported (%s)" % output - ) - - # See the comment in WriteCopies about expanding env vars. - outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] - inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] - - self.WriteDoCmd( - outputs, - [Sourceify(self.Absolutify(i)) for i in inputs], - part_of_all=part_of_all, - command=name, - ) - - # Stuff the outputs in a variable so we can refer to them later. - outputs_variable = "action_%s_outputs" % name - self.WriteLn("{} := {}".format(outputs_variable, " ".join(outputs))) - extra_outputs.append("$(%s)" % outputs_variable) - self.WriteLn() - - self.WriteLn() - - def WriteRules( - self, - rules, - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ): - """Write Makefile code for any 'rules' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - rules (used to make other pieces dependent on these rules) - part_of_all: flag indicating this target is part of 'all' - """ - env = self.GetSortedXcodeEnv() - for rule in rules: - name = StringToMakefileVariable( - "{}_{}".format(self.qualified_target, rule["rule_name"]) - ) - count = 0 - self.WriteLn("### Generated for rule %s:" % name) - - all_outputs = [] - - for rule_source in rule.get("rule_sources", []): - dirs = set() - (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = os.path.splitext( - rule_source_basename - ) - - outputs = [ - self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) - for out in rule["outputs"] - ] - - for out in outputs: - dir = os.path.dirname(out) - if dir: - dirs.add(dir) - if int(rule.get("process_outputs_as_sources", False)): - extra_sources += outputs - if int(rule.get("process_outputs_as_mac_bundle_resources", False)): - extra_mac_bundle_resources += outputs - inputs = [ - Sourceify(self.Absolutify(i)) - for i in [rule_source] + rule.get("inputs", []) - ] - actions = ["$(call do_cmd,%s_%d)" % (name, count)] - - if name == "resources_grit": - # HACK: This is ugly. Grit intentionally doesn't touch the - # timestamp of its output file when the file doesn't change, - # which is fine in hash-based dependency systems like scons - # and forge, but not kosher in the make world. After some - # discussion, hacking around it here seems like the least - # amount of pain. - actions += ["@touch --no-create $@"] - - # See the comment in WriteCopies about expanding env vars. - outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] - inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] - - outputs = [self.Absolutify(o) for o in outputs] - all_outputs += outputs - # Only write the 'obj' and 'builddir' rules for the "primary" output - # (:1); it's superfluous for the "extra outputs", and this avoids - # accidentally writing duplicate dummy rules for those outputs. - self.WriteLn("%s: obj := $(abs_obj)" % outputs[0]) - self.WriteLn("%s: builddir := $(abs_builddir)" % outputs[0]) - self.WriteMakeRule( - outputs, inputs, actions, command="%s_%d" % (name, count) - ) - # Spaces in rule filenames are not supported, but rule variables have - # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). - # The spaces within the variables are valid, so remove the variables - # before checking. - variables_with_spaces = re.compile(r"\$\([^ ]* \$<\)") - for output in outputs: - output = re.sub(variables_with_spaces, "", output) - assert " " not in output, ( - "Spaces in rule filenames not yet supported (%s)" % output - ) - self.WriteLn("all_deps += %s" % " ".join(outputs)) - - action = [ - self.ExpandInputRoot(ac, rule_source_root, rule_source_dirname) - for ac in rule["action"] - ] - mkdirs = "" - if len(dirs) > 0: - mkdirs = "mkdir -p %s; " % " ".join(dirs) - cd_action = "cd %s; " % Sourceify(self.path or ".") - - # action, cd_action, and mkdirs get written to a toplevel variable - # called cmd_foo. Toplevel variables can't handle things that change - # per makefile like $(TARGET), so hardcode the target. - if self.flavor == "mac": - action = [ - gyp.xcode_emulation.ExpandEnvVars(command, env) - for command in action - ] - action = gyp.common.EncodePOSIXShellList(action) - action = action.replace("$(TARGET)", self.target) - cd_action = cd_action.replace("$(TARGET)", self.target) - mkdirs = mkdirs.replace("$(TARGET)", self.target) - - # Set LD_LIBRARY_PATH in case the rule runs an executable from this - # build which links to shared libs from this build. - # rules run on the host, so they should in theory only use host - # libraries, but until everything is made cross-compile safe, also use - # target libraries. - # TODO(piman): when everything is cross-compile safe, remove lib.target - self.WriteLn( - "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" - "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " - "export LD_LIBRARY_PATH; " - "%(cd_action)s%(mkdirs)s%(action)s" - % { - "action": action, - "cd_action": cd_action, - "count": count, - "mkdirs": mkdirs, - "name": name, - } - ) - self.WriteLn( - "quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@" - % {"count": count, "name": name} - ) - self.WriteLn() - count += 1 - - outputs_variable = "rule_%s_outputs" % name - self.WriteList(all_outputs, outputs_variable) - extra_outputs.append("$(%s)" % outputs_variable) - - self.WriteLn("### Finished generating for rule: %s" % name) - self.WriteLn() - self.WriteLn("### Finished generating for all rules") - self.WriteLn("") - - def WriteCopies(self, copies, extra_outputs, part_of_all): - """Write Makefile code for any 'copies' from the gyp input. - - extra_outputs: a list that will be filled in with any outputs of this action - (used to make other pieces dependent on this action) - part_of_all: flag indicating this target is part of 'all' - """ - self.WriteLn("### Generated for copy rule.") - - variable = StringToMakefileVariable(self.qualified_target + "_copies") - outputs = [] - for copy in copies: - for path in copy["files"]: - # Absolutify() may call normpath, and will strip trailing slashes. - path = Sourceify(self.Absolutify(path)) - filename = os.path.split(path)[1] - output = Sourceify( - self.Absolutify(os.path.join(copy["destination"], filename)) - ) - - # If the output path has variables in it, which happens in practice for - # 'copies', writing the environment as target-local doesn't work, - # because the variables are already needed for the target name. - # Copying the environment variables into global make variables doesn't - # work either, because then the .d files will potentially contain spaces - # after variable expansion, and .d file handling cannot handle spaces. - # As a workaround, manually expand variables at gyp time. Since 'copies' - # can't run scripts, there's no need to write the env then. - # WriteDoCmd() will escape spaces for .d files. - env = self.GetSortedXcodeEnv() - output = gyp.xcode_emulation.ExpandEnvVars(output, env) - path = gyp.xcode_emulation.ExpandEnvVars(path, env) - self.WriteDoCmd([output], [path], "copy", part_of_all) - outputs.append(output) - self.WriteLn( - "{} = {}".format(variable, " ".join(QuoteSpaces(o) for o in outputs)) - ) - extra_outputs.append("$(%s)" % variable) - self.WriteLn() - - def WriteMacBundleResources(self, resources, bundle_deps): - """Writes Makefile code for 'mac_bundle_resources'.""" - self.WriteLn("### Generated for mac_bundle_resources") - - for output, res in gyp.xcode_emulation.GetMacBundleResources( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - [Sourceify(self.Absolutify(r)) for r in resources], - ): - _, ext = os.path.splitext(output) - if ext != ".xcassets": - # Make does not supports '.xcassets' emulation. - self.WriteDoCmd( - [output], [res], "mac_tool,,,copy-bundle-resource", part_of_all=True - ) - bundle_deps.append(output) - - def WriteMacInfoPlist(self, bundle_deps): - """Write Makefile code for bundle Info.plist files.""" - info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - lambda p: Sourceify(self.Absolutify(p)), - ) - if not info_plist: - return - if defines: - # Create an intermediate file to store preprocessed results. - intermediate_plist = "$(obj).$(TOOLSET)/$(TARGET)/" + os.path.basename( - info_plist - ) - self.WriteList( - defines, - intermediate_plist + ": INFOPLIST_DEFINES", - "-D", - quoter=EscapeCppDefine, - ) - self.WriteMakeRule( - [intermediate_plist], - [info_plist], - [ - "$(call do_cmd,infoplist)", - # "Convert" the plist so that any weird whitespace changes from the - # preprocessor do not affect the XML parser in mac_tool. - "@plutil -convert xml1 $@ $@", - ], - ) - info_plist = intermediate_plist - # plists can contain envvars and substitute them into the file. - self.WriteSortedXcodeEnv( - out, self.GetSortedXcodeEnv(additional_settings=extra_env) - ) - self.WriteDoCmd( - [out], [info_plist], "mac_tool,,,copy-info-plist", part_of_all=True - ) - bundle_deps.append(out) - - def WriteSources( - self, - configs, - deps, - sources, - extra_outputs, - extra_link_deps, - part_of_all, - precompiled_header, - ): - """Write Makefile code for any 'sources' from the gyp input. - These are source files necessary to build the current target. - - configs, deps, sources: input from gyp. - extra_outputs: a list of extra outputs this action should be dependent on; - used to serialize action/rules before compilation - extra_link_deps: a list that will be filled in with any outputs of - compilation (to be used in link lines) - part_of_all: flag indicating this target is part of 'all' - """ - - # Write configuration-specific variables for CFLAGS, etc. - for configname in sorted(configs.keys()): - config = configs[configname] - self.WriteList( - config.get("defines"), - "DEFS_%s" % configname, - prefix="-D", - quoter=EscapeCppDefine, - ) - - if self.flavor == "mac": - cflags = self.xcode_settings.GetCflags( - configname, arch=config.get("xcode_configuration_platform") - ) - cflags_c = self.xcode_settings.GetCflagsC(configname) - cflags_cc = self.xcode_settings.GetCflagsCC(configname) - cflags_objc = self.xcode_settings.GetCflagsObjC(configname) - cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) - else: - cflags = config.get("cflags") - cflags_c = config.get("cflags_c") - cflags_cc = config.get("cflags_cc") - - self.WriteLn("# Flags passed to all source files.") - self.WriteList(cflags, "CFLAGS_%s" % configname) - self.WriteLn("# Flags passed to only C files.") - self.WriteList(cflags_c, "CFLAGS_C_%s" % configname) - self.WriteLn("# Flags passed to only C++ files.") - self.WriteList(cflags_cc, "CFLAGS_CC_%s" % configname) - if self.flavor == "mac": - self.WriteLn("# Flags passed to only ObjC files.") - self.WriteList(cflags_objc, "CFLAGS_OBJC_%s" % configname) - self.WriteLn("# Flags passed to only ObjC++ files.") - self.WriteList(cflags_objcc, "CFLAGS_OBJCC_%s" % configname) - includes = config.get("include_dirs") - if includes: - includes = [Sourceify(self.Absolutify(i)) for i in includes] - self.WriteList(includes, "INCS_%s" % configname, prefix="-I") - - compilable = list(filter(Compilable, sources)) - objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable] - self.WriteList(objs, "OBJS") - - for obj in objs: - assert " " not in obj, "Spaces in object filenames not supported (%s)" % obj - self.WriteLn( - "# Add to the list of files we specially track " "dependencies for." - ) - self.WriteLn("all_deps += $(OBJS)") - self.WriteLn() - - # Make sure our dependencies are built first. - if deps: - self.WriteMakeRule( - ["$(OBJS)"], - deps, - comment="Make sure our dependencies are built " "before any of us.", - order_only=True, - ) - - # Make sure the actions and rules run first. - # If they generate any extra headers etc., the per-.o file dep tracking - # will catch the proper rebuilds, so order only is still ok here. - if extra_outputs: - self.WriteMakeRule( - ["$(OBJS)"], - extra_outputs, - comment="Make sure our actions/rules run " "before any of us.", - order_only=True, - ) - - pchdeps = precompiled_header.GetObjDependencies(compilable, objs) - if pchdeps: - self.WriteLn("# Dependencies from obj files to their precompiled headers") - for source, obj, gch in pchdeps: - self.WriteLn(f"{obj}: {gch}") - self.WriteLn("# End precompiled header dependencies") - - if objs: - extra_link_deps.append("$(OBJS)") - self.WriteLn( - """\ -# CFLAGS et al overrides must be target-local. -# See "Target-specific Variable Values" in the GNU Make manual.""" - ) - self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") - self.WriteLn( - "$(OBJS): GYP_CFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("c") + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_C_$(BUILDTYPE))" - ) - self.WriteLn( - "$(OBJS): GYP_CXXFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("cc") + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_CC_$(BUILDTYPE))" - ) - if self.flavor == "mac": - self.WriteLn( - "$(OBJS): GYP_OBJCFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("m") - + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_C_$(BUILDTYPE)) " - "$(CFLAGS_OBJC_$(BUILDTYPE))" - ) - self.WriteLn( - "$(OBJS): GYP_OBJCXXFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("mm") - + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_CC_$(BUILDTYPE)) " - "$(CFLAGS_OBJCC_$(BUILDTYPE))" - ) - - self.WritePchTargets(precompiled_header.GetPchBuildCommands()) - - # If there are any object files in our input file list, link them into our - # output. - extra_link_deps += [source for source in sources if Linkable(source)] - - self.WriteLn() - - def WritePchTargets(self, pch_commands): - """Writes make rules to compile prefix headers.""" - if not pch_commands: - return - - for gch, lang_flag, lang, input in pch_commands: - extra_flags = { - "c": "$(CFLAGS_C_$(BUILDTYPE))", - "cc": "$(CFLAGS_CC_$(BUILDTYPE))", - "m": "$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))", - "mm": "$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))", - }[lang] - var_name = { - "c": "GYP_PCH_CFLAGS", - "cc": "GYP_PCH_CXXFLAGS", - "m": "GYP_PCH_OBJCFLAGS", - "mm": "GYP_PCH_OBJCXXFLAGS", - }[lang] - self.WriteLn( - f"{gch}: {var_name} := {lang_flag} " + "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "$(CFLAGS_$(BUILDTYPE)) " + extra_flags - ) - - self.WriteLn(f"{gch}: {input} FORCE_DO_CMD") - self.WriteLn("\t@$(call do_cmd,pch_%s,1)" % lang) - self.WriteLn("") - assert " " not in gch, "Spaces in gch filenames not supported (%s)" % gch - self.WriteLn("all_deps += %s" % gch) - self.WriteLn("") - - def ComputeOutputBasename(self, spec): - """Return the 'output basename' of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - 'libfoobar.so' - """ - assert not self.is_mac_bundle - - if self.flavor == "mac" and self.type in ( - "static_library", - "executable", - "shared_library", - "loadable_module", - ): - return self.xcode_settings.GetExecutablePath() - - target = spec["target_name"] - target_prefix = "" - target_ext = "" - if self.type == "static_library": - if target[:3] == "lib": - target = target[3:] - target_prefix = "lib" - target_ext = ".a" - elif self.type in ("loadable_module", "shared_library"): - if target[:3] == "lib": - target = target[3:] - target_prefix = "lib" - if self.flavor == "aix": - target_ext = ".a" - else: - target_ext = ".so" - elif self.type == "none": - target = "%s.stamp" % target - elif self.type != "executable": - print( - "ERROR: What output file should be generated?", - "type", - self.type, - "target", - target, - ) - - target_prefix = spec.get("product_prefix", target_prefix) - target = spec.get("product_name", target) - product_ext = spec.get("product_extension") - if product_ext: - target_ext = "." + product_ext - - return target_prefix + target + target_ext - - def _InstallImmediately(self): - return ( - self.toolset == "target" - and self.flavor == "mac" - and self.type - in ("static_library", "executable", "shared_library", "loadable_module") - ) - - def ComputeOutput(self, spec): - """Return the 'output' (full output path) of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - '$(obj)/baz/libfoobar.so' - """ - assert not self.is_mac_bundle - - path = os.path.join("$(obj)." + self.toolset, self.path) - if self.type == "executable" or self._InstallImmediately(): - path = "$(builddir)" - path = spec.get("product_dir", path) - return os.path.join(path, self.ComputeOutputBasename(spec)) - - def ComputeMacBundleOutput(self, spec): - """Return the 'output' (full output path) to a bundle output directory.""" - assert self.is_mac_bundle - path = generator_default_variables["PRODUCT_DIR"] - return os.path.join(path, self.xcode_settings.GetWrapperName()) - - def ComputeMacBundleBinaryOutput(self, spec): - """Return the 'output' (full output path) to the binary in a bundle.""" - path = generator_default_variables["PRODUCT_DIR"] - return os.path.join(path, self.xcode_settings.GetExecutablePath()) - - def ComputeDeps(self, spec): - """Compute the dependencies of a gyp spec. - - Returns a tuple (deps, link_deps), where each is a list of - filenames that will need to be put in front of make for either - building (deps) or linking (link_deps). - """ - deps = [] - link_deps = [] - if "dependencies" in spec: - deps.extend( - [ - target_outputs[dep] - for dep in spec["dependencies"] - if target_outputs[dep] - ] - ) - for dep in spec["dependencies"]: - if dep in target_link_deps: - link_deps.append(target_link_deps[dep]) - deps.extend(link_deps) - # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? - # This hack makes it work: - # link_deps.extend(spec.get('libraries', [])) - return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) - - def WriteDependencyOnExtraOutputs(self, target, extra_outputs): - self.WriteMakeRule( - [self.output_binary], - extra_outputs, - comment="Build our special outputs first.", - order_only=True, - ) - - def WriteTarget( - self, spec, configs, deps, link_deps, bundle_deps, extra_outputs, part_of_all - ): - """Write Makefile code to produce the final target of the gyp spec. - - spec, configs: input from gyp. - deps, link_deps: dependency lists; see ComputeDeps() - extra_outputs: any extra outputs that our target should depend on - part_of_all: flag indicating this target is part of 'all' - """ - - self.WriteLn("### Rules for final target.") - - if extra_outputs: - self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) - self.WriteMakeRule( - extra_outputs, - deps, - comment=("Preserve order dependency of " "special output on deps."), - order_only=True, - ) - - target_postbuilds = {} - if self.type != "none": - for configname in sorted(configs.keys()): - config = configs[configname] - if self.flavor == "mac": - ldflags = self.xcode_settings.GetLdflags( - configname, - generator_default_variables["PRODUCT_DIR"], - lambda p: Sourceify(self.Absolutify(p)), - arch=config.get("xcode_configuration_platform"), - ) - - # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. - gyp_to_build = gyp.common.InvertRelativePath(self.path) - target_postbuild = self.xcode_settings.AddImplicitPostbuilds( - configname, - QuoteSpaces( - os.path.normpath(os.path.join(gyp_to_build, self.output)) - ), - QuoteSpaces( - os.path.normpath( - os.path.join(gyp_to_build, self.output_binary) - ) - ), - ) - if target_postbuild: - target_postbuilds[configname] = target_postbuild - else: - ldflags = config.get("ldflags", []) - # Compute an rpath for this output if needed. - if any(dep.endswith(".so") or ".so." in dep for dep in deps): - # We want to get the literal string "$ORIGIN" - # into the link command, so we need lots of escaping. - ldflags.append(r"-Wl,-rpath=\$$ORIGIN/") - ldflags.append(r"-Wl,-rpath-link=\$(builddir)/") - library_dirs = config.get("library_dirs", []) - ldflags += [("-L%s" % library_dir) for library_dir in library_dirs] - self.WriteList(ldflags, "LDFLAGS_%s" % configname) - if self.flavor == "mac": - self.WriteList( - self.xcode_settings.GetLibtoolflags(configname), - "LIBTOOLFLAGS_%s" % configname, - ) - libraries = spec.get("libraries") - if libraries: - # Remove duplicate entries - libraries = gyp.common.uniquer(libraries) - if self.flavor == "mac": - libraries = self.xcode_settings.AdjustLibraries(libraries) - self.WriteList(libraries, "LIBS") - self.WriteLn( - "%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))" - % QuoteSpaces(self.output_binary) - ) - self.WriteLn("%s: LIBS := $(LIBS)" % QuoteSpaces(self.output_binary)) - - if self.flavor == "mac": - self.WriteLn( - "%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))" - % QuoteSpaces(self.output_binary) - ) - - # Postbuild actions. Like actions, but implicitly depend on the target's - # output. - postbuilds = [] - if self.flavor == "mac": - if target_postbuilds: - postbuilds.append("$(TARGET_POSTBUILDS_$(BUILDTYPE))") - postbuilds.extend(gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) - - if postbuilds: - # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), - # so we must output its definition first, since we declare variables - # using ":=". - self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) - - for configname in target_postbuilds: - self.WriteLn( - "%s: TARGET_POSTBUILDS_%s := %s" - % ( - QuoteSpaces(self.output), - configname, - gyp.common.EncodePOSIXShellList(target_postbuilds[configname]), - ) - ) - - # Postbuilds expect to be run in the gyp file's directory, so insert an - # implicit postbuild to cd to there. - postbuilds.insert(0, gyp.common.EncodePOSIXShellList(["cd", self.path])) - for i, postbuild in enumerate(postbuilds): - if not postbuild.startswith("$"): - postbuilds[i] = EscapeShellArgument(postbuild) - self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(self.output)) - self.WriteLn( - "%s: POSTBUILDS := %s" - % (QuoteSpaces(self.output), " ".join(postbuilds)) - ) - - # A bundle directory depends on its dependencies such as bundle resources - # and bundle binary. When all dependencies have been built, the bundle - # needs to be packaged. - if self.is_mac_bundle: - # If the framework doesn't contain a binary, then nothing depends - # on the actions -- make the framework depend on them directly too. - self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) - - # Bundle dependencies. Note that the code below adds actions to this - # target, so if you move these two lines, move the lines below as well. - self.WriteList([QuoteSpaces(dep) for dep in bundle_deps], "BUNDLE_DEPS") - self.WriteLn("%s: $(BUNDLE_DEPS)" % QuoteSpaces(self.output)) - - # After the framework is built, package it. Needs to happen before - # postbuilds, since postbuilds depend on this. - if self.type in ("shared_library", "loadable_module"): - self.WriteLn( - "\t@$(call do_cmd,mac_package_framework,,,%s)" - % self.xcode_settings.GetFrameworkVersion() - ) - - # Bundle postbuilds can depend on the whole bundle, so run them after - # the bundle is packaged, not already after the bundle binary is done. - if postbuilds: - self.WriteLn("\t@$(call do_postbuilds)") - postbuilds = [] # Don't write postbuilds for target's output. - - # Needed by test/mac/gyptest-rebuild.py. - self.WriteLn("\t@true # No-op, used by tests") - - # Since this target depends on binary and resources which are in - # nested subfolders, the framework directory will be older than - # its dependencies usually. To prevent this rule from executing - # on every build (expensive, especially with postbuilds), expliclity - # update the time on the framework directory. - self.WriteLn("\t@touch -c %s" % QuoteSpaces(self.output)) - - if postbuilds: - assert not self.is_mac_bundle, ( - "Postbuilds for bundles should be done " - "on the bundle, not the binary (target '%s')" % self.target - ) - assert "product_dir" not in spec, ( - "Postbuilds do not work with " "custom product_dir" - ) - - if self.type == "executable": - self.WriteLn( - "%s: LD_INPUTS := %s" - % ( - QuoteSpaces(self.output_binary), - " ".join(QuoteSpaces(dep) for dep in link_deps), - ) - ) - if self.toolset == "host" and self.flavor == "android": - self.WriteDoCmd( - [self.output_binary], - link_deps, - "link_host", - part_of_all, - postbuilds=postbuilds, - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "link", - part_of_all, - postbuilds=postbuilds, - ) - - elif self.type == "static_library": - for link_dep in link_deps: - assert " " not in link_dep, ( - "Spaces in alink input filenames not supported (%s)" % link_dep - ) - if ( - self.flavor not in ("mac", "openbsd", "netbsd", "win") - and not self.is_standalone_static_library - ): - self.WriteDoCmd( - [self.output_binary], - link_deps, - "alink_thin", - part_of_all, - postbuilds=postbuilds, - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "alink", - part_of_all, - postbuilds=postbuilds, - ) - elif self.type == "shared_library": - self.WriteLn( - "%s: LD_INPUTS := %s" - % ( - QuoteSpaces(self.output_binary), - " ".join(QuoteSpaces(dep) for dep in link_deps), - ) - ) - self.WriteDoCmd( - [self.output_binary], - link_deps, - "solink", - part_of_all, - postbuilds=postbuilds, - ) - elif self.type == "loadable_module": - for link_dep in link_deps: - assert " " not in link_dep, ( - "Spaces in module input filenames not supported (%s)" % link_dep - ) - if self.toolset == "host" and self.flavor == "android": - self.WriteDoCmd( - [self.output_binary], - link_deps, - "solink_module_host", - part_of_all, - postbuilds=postbuilds, - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "solink_module", - part_of_all, - postbuilds=postbuilds, - ) - elif self.type == "none": - # Write a stamp line. - self.WriteDoCmd( - [self.output_binary], deps, "touch", part_of_all, postbuilds=postbuilds - ) - else: - print("WARNING: no output for", self.type, self.target) - - # Add an alias for each target (if there are any outputs). - # Installable target aliases are created below. - if (self.output and self.output != self.target) and ( - self.type not in self._INSTALLABLE_TARGETS - ): - self.WriteMakeRule( - [self.target], [self.output], comment="Add target alias", phony=True - ) - if part_of_all: - self.WriteMakeRule( - ["all"], - [self.target], - comment='Add target alias to "all" target.', - phony=True, - ) - - # Add special-case rules for our installable targets. - # 1) They need to install to the build dir or "product" dir. - # 2) They get shortcuts for building (e.g. "make chrome"). - # 3) They are part of "make all". - if self.type in self._INSTALLABLE_TARGETS or self.is_standalone_static_library: - if self.type == "shared_library": - file_desc = "shared library" - elif self.type == "static_library": - file_desc = "static library" - else: - file_desc = "executable" - install_path = self._InstallableTargetInstallPath() - installable_deps = [self.output] - if ( - self.flavor == "mac" - and "product_dir" not in spec - and self.toolset == "target" - ): - # On mac, products are created in install_path immediately. - assert install_path == self.output, "{} != {}".format( - install_path, - self.output, - ) - - # Point the target alias to the final binary output. - self.WriteMakeRule( - [self.target], [install_path], comment="Add target alias", phony=True - ) - if install_path != self.output: - assert not self.is_mac_bundle # See comment a few lines above. - self.WriteDoCmd( - [install_path], - [self.output], - "copy", - comment="Copy this to the %s output path." % file_desc, - part_of_all=part_of_all, - ) - installable_deps.append(install_path) - if self.output != self.alias and self.alias != self.target: - self.WriteMakeRule( - [self.alias], - installable_deps, - comment="Short alias for building this %s." % file_desc, - phony=True, - ) - if part_of_all: - self.WriteMakeRule( - ["all"], - [install_path], - comment='Add %s to "all" target.' % file_desc, - phony=True, - ) - - def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary): - """Write a variable definition that is a list of values. - - E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out - foo = blaha blahb - but in a pretty-printed style. - """ - values = "" - if value_list: - value_list = [quoter(prefix + value) for value in value_list] - values = " \\\n\t" + " \\\n\t".join(value_list) - self.fp.write(f"{variable} :={values}\n\n") - - def WriteDoCmd( - self, outputs, inputs, command, part_of_all, comment=None, postbuilds=False - ): - """Write a Makefile rule that uses do_cmd. - - This makes the outputs dependent on the command line that was run, - as well as support the V= make command line flag. - """ - suffix = "" - if postbuilds: - assert "," not in command - suffix = ",,1" # Tell do_cmd to honor $POSTBUILDS - self.WriteMakeRule( - outputs, - inputs, - actions=[f"$(call do_cmd,{command}{suffix})"], - comment=comment, - command=command, - force=True, - ) - # Add our outputs to the list of targets we read depfiles from. - # all_deps is only used for deps file reading, and for deps files we replace - # spaces with ? because escaping doesn't work with make's $(sort) and - # other functions. - outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] - self.WriteLn("all_deps += %s" % " ".join(outputs)) - - def WriteMakeRule( - self, - outputs, - inputs, - actions=None, - comment=None, - order_only=False, - force=False, - phony=False, - command=None, - ): - """Write a Makefile rule, with some extra tricks. - - outputs: a list of outputs for the rule (note: this is not directly - supported by make; see comments below) - inputs: a list of inputs for the rule - actions: a list of shell commands to run for the rule - comment: a comment to put in the Makefile above the rule (also useful - for making this Python script's code self-documenting) - order_only: if true, makes the dependency order-only - force: if true, include FORCE_DO_CMD as an order-only dep - phony: if true, the rule does not actually generate the named output, the - output is just a name to run the rule - command: (optional) command name to generate unambiguous labels - """ - outputs = [QuoteSpaces(o) for o in outputs] - inputs = [QuoteSpaces(i) for i in inputs] - - if comment: - self.WriteLn("# " + comment) - if phony: - self.WriteLn(".PHONY: " + " ".join(outputs)) - if actions: - self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) - force_append = " FORCE_DO_CMD" if force else "" - - if order_only: - # Order only rule: Just write a simple rule. - # TODO(evanm): just make order_only a list of deps instead of this hack. - self.WriteLn( - "{}: | {}{}".format(" ".join(outputs), " ".join(inputs), force_append) - ) - elif len(outputs) == 1: - # Regular rule, one output: Just write a simple rule. - self.WriteLn("{}: {}{}".format(outputs[0], " ".join(inputs), force_append)) - else: - # Regular rule, more than one output: Multiple outputs are tricky in - # make. We will write three rules: - # - All outputs depend on an intermediate file. - # - Make .INTERMEDIATE depend on the intermediate. - # - The intermediate file depends on the inputs and executes the - # actual command. - # - The intermediate recipe will 'touch' the intermediate file. - # - The multi-output rule will have an do-nothing recipe. - - # Hash the target name to avoid generating overlong filenames. - cmddigest = hashlib.sha1( - (command or self.target).encode("utf-8") - ).hexdigest() - intermediate = "%s.intermediate" % cmddigest - self.WriteLn("{}: {}".format(" ".join(outputs), intermediate)) - self.WriteLn("\t%s" % "@:") - self.WriteLn("{}: {}".format(".INTERMEDIATE", intermediate)) - self.WriteLn( - "{}: {}{}".format(intermediate, " ".join(inputs), force_append) - ) - actions.insert(0, "$(call do_cmd,touch)") - - if actions: - for action in actions: - self.WriteLn("\t%s" % action) - self.WriteLn() - - def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): - """Write a set of LOCAL_XXX definitions for Android NDK. - - These variable definitions will be used by Android NDK but do nothing for - non-Android applications. - - Arguments: - module_name: Android NDK module name, which must be unique among all - module names. - all_sources: A list of source files (will be filtered by Compilable). - link_deps: A list of link dependencies, which must be sorted in - the order from dependencies to dependents. - """ - if self.type not in ("executable", "shared_library", "static_library"): - return - - self.WriteLn("# Variable definitions for Android applications") - self.WriteLn("include $(CLEAR_VARS)") - self.WriteLn("LOCAL_MODULE := " + module_name) - self.WriteLn( - "LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) " - "$(DEFS_$(BUILDTYPE)) " - # LOCAL_CFLAGS is applied to both of C and C++. There is - # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C - # sources. - "$(CFLAGS_C_$(BUILDTYPE)) " - # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while - # LOCAL_C_INCLUDES does not expect it. So put it in - # LOCAL_CFLAGS. - "$(INCS_$(BUILDTYPE))" - ) - # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. - self.WriteLn("LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))") - self.WriteLn("LOCAL_C_INCLUDES :=") - self.WriteLn("LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)") - - # Detect the C++ extension. - cpp_ext = {".cc": 0, ".cpp": 0, ".cxx": 0} - default_cpp_ext = ".cpp" - for filename in all_sources: - ext = os.path.splitext(filename)[1] - if ext in cpp_ext: - cpp_ext[ext] += 1 - if cpp_ext[ext] > cpp_ext[default_cpp_ext]: - default_cpp_ext = ext - self.WriteLn("LOCAL_CPP_EXTENSION := " + default_cpp_ext) - - self.WriteList( - list(map(self.Absolutify, filter(Compilable, all_sources))), - "LOCAL_SRC_FILES", - ) - - # Filter out those which do not match prefix and suffix and produce - # the resulting list without prefix and suffix. - def DepsToModules(deps, prefix, suffix): - modules = [] - for filepath in deps: - filename = os.path.basename(filepath) - if filename.startswith(prefix) and filename.endswith(suffix): - modules.append(filename[len(prefix) : -len(suffix)]) - return modules - - # Retrieve the default value of 'SHARED_LIB_SUFFIX' - params = {"flavor": "linux"} - default_variables = {} - CalculateVariables(default_variables, params) - - self.WriteList( - DepsToModules( - link_deps, - generator_default_variables["SHARED_LIB_PREFIX"], - default_variables["SHARED_LIB_SUFFIX"], - ), - "LOCAL_SHARED_LIBRARIES", - ) - self.WriteList( - DepsToModules( - link_deps, - generator_default_variables["STATIC_LIB_PREFIX"], - generator_default_variables["STATIC_LIB_SUFFIX"], - ), - "LOCAL_STATIC_LIBRARIES", - ) - - if self.type == "executable": - self.WriteLn("include $(BUILD_EXECUTABLE)") - elif self.type == "shared_library": - self.WriteLn("include $(BUILD_SHARED_LIBRARY)") - elif self.type == "static_library": - self.WriteLn("include $(BUILD_STATIC_LIBRARY)") - self.WriteLn() - - def WriteLn(self, text=""): - self.fp.write(text + "\n") - - def GetSortedXcodeEnv(self, additional_settings=None): - return gyp.xcode_emulation.GetSortedXcodeEnv( - self.xcode_settings, - "$(abs_builddir)", - os.path.join("$(abs_srcdir)", self.path), - "$(BUILDTYPE)", - additional_settings, - ) - - def GetSortedXcodePostbuildEnv(self): - # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. - # TODO(thakis): It would be nice to have some general mechanism instead. - strip_save_file = self.xcode_settings.GetPerTargetSetting( - "CHROMIUM_STRIP_SAVE_FILE", "" - ) - # Even if strip_save_file is empty, explicitly write it. Else a postbuild - # might pick up an export from an earlier target. - return self.GetSortedXcodeEnv( - additional_settings={"CHROMIUM_STRIP_SAVE_FILE": strip_save_file} - ) - - def WriteSortedXcodeEnv(self, target, env): - for k, v in env: - # For - # foo := a\ b - # the escaped space does the right thing. For - # export foo := a\ b - # it does not -- the backslash is written to the env as literal character. - # So don't escape spaces in |env[k]|. - self.WriteLn(f"{QuoteSpaces(target)}: export {k} := {v}") - - def Objectify(self, path): - """Convert a path to its output directory form.""" - if "$(" in path: - path = path.replace("$(obj)/", "$(obj).%s/$(TARGET)/" % self.toolset) - if "$(obj)" not in path: - path = f"$(obj).{self.toolset}/$(TARGET)/{path}" - return path - - def Pchify(self, path, lang): - """Convert a prefix header path to its output directory form.""" - path = self.Absolutify(path) - if "$(" in path: - path = path.replace( - "$(obj)/", f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}" - ) - return path - return f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}/{path}" - - def Absolutify(self, path): - """Convert a subdirectory-relative path into a base-relative path. - Skips over paths that contain variables.""" - if "$(" in path: - # Don't call normpath in this case, as it might collapse the - # path too aggressively if it features '..'. However it's still - # important to strip trailing slashes. - return path.rstrip("/") - return os.path.normpath(os.path.join(self.path, path)) - - def ExpandInputRoot(self, template, expansion, dirname): - if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: - return template - path = template % { - "INPUT_ROOT": expansion, - "INPUT_DIRNAME": dirname, - } - return path - - def _InstallableTargetInstallPath(self): - """Returns the location of the final output for an installable target.""" - # Functionality removed for all platforms to match Xcode and hoist - # shared libraries into PRODUCT_DIR for users: - # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files - # rely on this. Emulate this behavior for mac. - # if self.type == "shared_library" and ( - # self.flavor != "mac" or self.toolset != "target" - # ): - # # Install all shared libs into a common directory (per toolset) for - # # convenient access with LD_LIBRARY_PATH. - # return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) - return "$(builddir)/" + self.alias - - -def WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files): - """Write the target to regenerate the Makefile.""" - options = params["options"] - build_files_args = [ - gyp.common.RelativePath(filename, options.toplevel_dir) - for filename in params["build_files_arg"] - ] - - gyp_binary = gyp.common.FixIfRelativePath( - params["gyp_binary"], options.toplevel_dir - ) - if not gyp_binary.startswith(os.sep): - gyp_binary = os.path.join(".", gyp_binary) - - root_makefile.write( - "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" - "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" - "%(makefile_name)s: %(deps)s\n" - "\t$(call do_cmd,regen_makefile)\n\n" - % { - "makefile_name": makefile_name, - "deps": " ".join(SourceifyAndQuoteSpaces(bf) for bf in build_files), - "cmd": gyp.common.EncodePOSIXShellList( - [gyp_binary, "-fmake"] + gyp.RegenerateFlags(options) + build_files_args - ), - } - ) - - -def PerformBuild(data, configurations, params): - options = params["options"] - for config in configurations: - arguments = ["make"] - if options.toplevel_dir and options.toplevel_dir != ".": - arguments += "-C", options.toplevel_dir - arguments.append("BUILDTYPE=" + config) - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def GenerateOutput(target_list, target_dicts, data, params): - options = params["options"] - flavor = gyp.common.GetFlavor(params) - generator_flags = params.get("generator_flags", {}) - builddir_name = generator_flags.get("output_dir", "out") - android_ndk_version = generator_flags.get("android_ndk_version", None) - default_target = generator_flags.get("default_target", "all") - - def CalculateMakefilePath(build_file, base_name): - """Determine where to write a Makefile for a given gyp file.""" - # Paths in gyp files are relative to the .gyp file, but we want - # paths relative to the source root for the master makefile. Grab - # the path of the .gyp file as the base to relativize against. - # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". - base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) - # We write the file in the base_path directory. - output_file = os.path.join(options.depth, base_path, base_name) - if options.generator_output: - output_file = os.path.join( - options.depth, options.generator_output, base_path, base_name - ) - base_path = gyp.common.RelativePath( - os.path.dirname(build_file), options.toplevel_dir - ) - return base_path, output_file - - # TODO: search for the first non-'Default' target. This can go - # away when we add verification that all targets have the - # necessary configurations. - default_configuration = None - toolsets = {target_dicts[target]["toolset"] for target in target_list} - for target in target_list: - spec = target_dicts[target] - if spec["default_configuration"] != "Default": - default_configuration = spec["default_configuration"] - break - if not default_configuration: - default_configuration = "Default" - - srcdir = "." - makefile_name = "Makefile" + options.suffix - makefile_path = os.path.join(options.toplevel_dir, makefile_name) - if options.generator_output: - global srcdir_prefix - makefile_path = os.path.join( - options.toplevel_dir, options.generator_output, makefile_name - ) - srcdir = gyp.common.RelativePath(srcdir, options.generator_output) - srcdir_prefix = "$(srcdir)/" - - flock_command = "flock" - copy_archive_arguments = "-af" - makedep_arguments = "-MMD" - header_params = { - "default_target": default_target, - "builddir": builddir_name, - "default_configuration": default_configuration, - "flock": flock_command, - "flock_index": 1, - "link_commands": LINK_COMMANDS_LINUX, - "extra_commands": "", - "srcdir": srcdir, - "copy_archive_args": copy_archive_arguments, - "makedep_args": makedep_arguments, - "CC.target": GetEnvironFallback(("CC_target", "CC"), "$(CC)"), - "AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"), - "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"), - "LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"), - "CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"), - "AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"), - "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"), - "LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"), - } - if flavor == "mac": - flock_command = "./gyp-mac-tool flock" - header_params.update( - { - "flock": flock_command, - "flock_index": 2, - "link_commands": LINK_COMMANDS_MAC, - "extra_commands": SHARED_HEADER_MAC_COMMANDS, - } - ) - elif flavor == "android": - header_params.update({"link_commands": LINK_COMMANDS_ANDROID}) - elif flavor == "zos": - copy_archive_arguments = "-fPR" - makedep_arguments = "-qmakedep=gcc" - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "makedep_args": makedep_arguments, - "link_commands": LINK_COMMANDS_OS390, - "CC.target": GetEnvironFallback(("CC_target", "CC"), "njsc"), - "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "njsc++"), - "CC.host": GetEnvironFallback(("CC_host", "CC"), "njsc"), - "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "njsc++"), - } - ) - elif flavor == "solaris": - copy_archive_arguments = "-pPRf@" - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "flock": "./gyp-flock-tool flock", - "flock_index": 2, - } - ) - elif flavor == "freebsd": - # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. - header_params.update({"flock": "lockf"}) - elif flavor == "openbsd": - copy_archive_arguments = "-pPRf" - header_params.update({"copy_archive_args": copy_archive_arguments}) - elif flavor == "aix": - copy_archive_arguments = "-pPRf" - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "link_commands": LINK_COMMANDS_AIX, - "flock": "./gyp-flock-tool flock", - "flock_index": 2, - } - ) - - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings_array = data[build_file].get("make_global_settings", []) - wrappers = {} - for key, value in make_global_settings_array: - if key.endswith("_wrapper"): - wrappers[key[: -len("_wrapper")]] = "$(abspath %s)" % value - make_global_settings = "" - for key, value in make_global_settings_array: - if re.match(".*_wrapper", key): - continue - if value[0] != "$": - value = "$(abspath %s)" % value - wrapper = wrappers.get(key) - if wrapper: - value = f"{wrapper} {value}" - del wrappers[key] - if key in ("CC", "CC.host", "CXX", "CXX.host"): - make_global_settings += ( - "ifneq (,$(filter $(origin %s), undefined default))\n" % key - ) - # Let gyp-time envvars win over global settings. - env_key = key.replace(".", "_") # CC.host -> CC_host - if env_key in os.environ: - value = os.environ[env_key] - make_global_settings += f" {key} = {value}\n" - make_global_settings += "endif\n" - else: - make_global_settings += f"{key} ?= {value}\n" - # TODO(ukai): define cmd when only wrapper is specified in - # make_global_settings. - - header_params["make_global_settings"] = make_global_settings - - gyp.common.EnsureDirExists(makefile_path) - root_makefile = open(makefile_path, "w") - root_makefile.write(SHARED_HEADER % header_params) - # Currently any versions have the same effect, but in future the behavior - # could be different. - if android_ndk_version: - root_makefile.write( - "# Define LOCAL_PATH for build of Android applications.\n" - "LOCAL_PATH := $(call my-dir)\n" - "\n" - ) - for toolset in toolsets: - root_makefile.write("TOOLSET := %s\n" % toolset) - WriteRootHeaderSuffixRules(root_makefile) - - # Put build-time support tools next to the root Makefile. - dest_path = os.path.dirname(makefile_path) - gyp.common.CopyTool(flavor, dest_path) - - # Find the list of targets that derive from the gyp file(s) being built. - needed_targets = set() - for build_file in params["build_files"]: - for target in gyp.common.AllTargets(target_list, target_dicts, build_file): - needed_targets.add(target) - - build_files = set() - include_list = set() - for qualified_target in target_list: - build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) - - this_make_global_settings = data[build_file].get("make_global_settings", []) - assert make_global_settings_array == this_make_global_settings, ( - "make_global_settings needs to be the same for all targets " - f"{this_make_global_settings} vs. {make_global_settings}" - ) - - build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) - included_files = data[build_file]["included_files"] - for included_file in included_files: - # The included_files entries are relative to the dir of the build file - # that included them, so we have to undo that and then make them relative - # to the root dir. - relative_include_file = gyp.common.RelativePath( - gyp.common.UnrelativePath(included_file, build_file), - options.toplevel_dir, - ) - abs_include_file = os.path.abspath(relative_include_file) - # If the include file is from the ~/.gyp dir, we should use absolute path - # so that relocating the src dir doesn't break the path. - if params["home_dot_gyp"] and abs_include_file.startswith( - params["home_dot_gyp"] - ): - build_files.add(abs_include_file) - else: - build_files.add(relative_include_file) - - base_path, output_file = CalculateMakefilePath( - build_file, target + "." + toolset + options.suffix + ".mk" - ) - - spec = target_dicts[qualified_target] - configs = spec["configurations"] - - if flavor == "mac": - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - - writer = MakefileWriter(generator_flags, flavor) - writer.Write( - qualified_target, - base_path, - output_file, - spec, - configs, - part_of_all=qualified_target in needed_targets, - ) - - # Our root_makefile lives at the source root. Compute the relative path - # from there to the output_file for including. - mkfile_rel_path = gyp.common.RelativePath( - output_file, os.path.dirname(makefile_path) - ) - include_list.add(mkfile_rel_path) - - # Write out per-gyp (sub-project) Makefiles. - depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) - for build_file in build_files: - # The paths in build_files were relativized above, so undo that before - # testing against the non-relativized items in target_list and before - # calculating the Makefile path. - build_file = os.path.join(depth_rel_path, build_file) - gyp_targets = [ - target_dicts[qualified_target]["target_name"] - for qualified_target in target_list - if qualified_target.startswith(build_file) - and qualified_target in needed_targets - ] - # Only generate Makefiles for gyp files with targets. - if not gyp_targets: - continue - base_path, output_file = CalculateMakefilePath( - build_file, os.path.splitext(os.path.basename(build_file))[0] + ".Makefile" - ) - makefile_rel_path = gyp.common.RelativePath( - os.path.dirname(makefile_path), os.path.dirname(output_file) - ) - writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, builddir_name) - - # Write out the sorted list of includes. - root_makefile.write("\n") - for include_file in sorted(include_list): - # We wrap each .mk include in an if statement so users can tell make to - # not load a file by setting NO_LOAD. The below make code says, only - # load the .mk file if the .mk filename doesn't start with a token in - # NO_LOAD. - root_makefile.write( - "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" - " $(findstring $(join ^,$(prefix)),\\\n" - " $(join ^," + include_file + ")))),)\n" - ) - root_makefile.write(" include " + include_file + "\n") - root_makefile.write("endif\n") - root_makefile.write("\n") - - if not generator_flags.get("standalone") and generator_flags.get( - "auto_regeneration", True - ): - WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) - - root_makefile.write(SHARED_FOOTER) - - root_makefile.close() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py deleted file mode 100644 index 8308fa843..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +++ /dev/null @@ -1,3978 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import ntpath -import os -import posixpath -import re -import subprocess -import sys - -from collections import OrderedDict - -import gyp.common -import gyp.easy_xml as easy_xml -import gyp.generator.ninja as ninja_generator -import gyp.MSVSNew as MSVSNew -import gyp.MSVSProject as MSVSProject -import gyp.MSVSSettings as MSVSSettings -import gyp.MSVSToolFile as MSVSToolFile -import gyp.MSVSUserFile as MSVSUserFile -import gyp.MSVSUtil as MSVSUtil -import gyp.MSVSVersion as MSVSVersion -from gyp.common import GypError -from gyp.common import OrderedSet - - -# Regular expression for validating Visual Studio GUIDs. If the GUID -# contains lowercase hex letters, MSVS will be fine. However, -# IncrediBuild BuildConsole will parse the solution file, but then -# silently skip building the target causing hard to track down errors. -# Note that this only happens with the BuildConsole, and does not occur -# if IncrediBuild is executed from inside Visual Studio. This regex -# validates that the string looks like a GUID with all uppercase hex -# letters. -VALID_MSVS_GUID_CHARS = re.compile(r"^[A-F0-9\-]+$") - -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - -generator_default_variables = { - "DRIVER_PREFIX": "", - "DRIVER_SUFFIX": ".sys", - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": ".exe", - "STATIC_LIB_PREFIX": "", - "SHARED_LIB_PREFIX": "", - "STATIC_LIB_SUFFIX": ".lib", - "SHARED_LIB_SUFFIX": ".dll", - "INTERMEDIATE_DIR": "$(IntDir)", - "SHARED_INTERMEDIATE_DIR": "$(OutDir)/obj/global_intermediate", - "OS": "win", - "PRODUCT_DIR": "$(OutDir)", - "LIB_DIR": "$(OutDir)lib", - "RULE_INPUT_ROOT": "$(InputName)", - "RULE_INPUT_DIRNAME": "$(InputDir)", - "RULE_INPUT_EXT": "$(InputExt)", - "RULE_INPUT_NAME": "$(InputFileName)", - "RULE_INPUT_PATH": "$(InputPath)", - "CONFIGURATION_NAME": "$(ConfigurationName)", -} - - -# The msvs specific sections that hold paths -generator_additional_path_sections = [ - "msvs_cygwin_dirs", - "msvs_props", -] - - -generator_additional_non_configuration_keys = [ - "msvs_cygwin_dirs", - "msvs_cygwin_shell", - "msvs_large_pdb", - "msvs_shard", - "msvs_external_builder", - "msvs_external_builder_out_dir", - "msvs_external_builder_build_cmd", - "msvs_external_builder_clean_cmd", - "msvs_external_builder_clcompile_cmd", - "msvs_enable_winrt", - "msvs_requires_importlibrary", - "msvs_enable_winphone", - "msvs_application_type_revision", - "msvs_target_platform_version", - "msvs_target_platform_minversion", -] - -generator_filelist_paths = None - -# List of precompiled header related keys. -precomp_keys = [ - "msvs_precompiled_header", - "msvs_precompiled_source", -] - - -cached_username = None - - -cached_domain = None - - -# TODO(gspencer): Switch the os.environ calls to be -# win32api.GetDomainName() and win32api.GetUserName() once the -# python version in depot_tools has been updated to work on Vista -# 64-bit. -def _GetDomainAndUserName(): - if sys.platform not in ("win32", "cygwin"): - return ("DOMAIN", "USERNAME") - global cached_username - global cached_domain - if not cached_domain or not cached_username: - domain = os.environ.get("USERDOMAIN") - username = os.environ.get("USERNAME") - if not domain or not username: - call = subprocess.Popen( - ["net", "config", "Workstation"], stdout=subprocess.PIPE - ) - config = call.communicate()[0].decode("utf-8") - username_re = re.compile(r"^User name\s+(\S+)", re.MULTILINE) - username_match = username_re.search(config) - if username_match: - username = username_match.group(1) - domain_re = re.compile(r"^Logon domain\s+(\S+)", re.MULTILINE) - domain_match = domain_re.search(config) - if domain_match: - domain = domain_match.group(1) - cached_domain = domain - cached_username = username - return (cached_domain, cached_username) - - -fixpath_prefix = None - - -def _NormalizedSource(source): - """Normalize the path. - - But not if that gets rid of a variable, as this may expand to something - larger than one directory. - - Arguments: - source: The path to be normalize.d - - Returns: - The normalized path. - """ - normalized = os.path.normpath(source) - if source.count("$") == normalized.count("$"): - source = normalized - return source - - -def _FixPath(path, separator="\\"): - """Convert paths to a form that will make sense in a vcproj file. - - Arguments: - path: The path to convert, may contain / etc. - Returns: - The path with all slashes made into backslashes. - """ - if ( - fixpath_prefix - and path - and not os.path.isabs(path) - and not path[0] == "$" - and not _IsWindowsAbsPath(path) - ): - path = os.path.join(fixpath_prefix, path) - if separator == "\\": - path = path.replace("/", "\\") - path = _NormalizedSource(path) - if separator == "/": - path = path.replace("\\", "/") - if path and path[-1] == separator: - path = path[:-1] - return path - - -def _IsWindowsAbsPath(path): - """ - On Cygwin systems Python needs a little help determining if a path - is an absolute Windows path or not, so that - it does not treat those as relative, which results in bad paths like: - '..\\C:\\\\some_source_code_file.cc' - """ - return path.startswith("c:") or path.startswith("C:") - - -def _FixPaths(paths, separator="\\"): - """Fix each of the paths of the list.""" - return [_FixPath(i, separator) for i in paths] - - -def _ConvertSourcesToFilterHierarchy( - sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None -): - """Converts a list split source file paths into a vcproj folder hierarchy. - - Arguments: - sources: A list of source file paths split. - prefix: A list of source file path layers meant to apply to each of sources. - excluded: A set of excluded files. - msvs_version: A MSVSVersion object. - - Returns: - A hierarchy of filenames and MSVSProject.Filter objects that matches the - layout of the source tree. - For example: - _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']], - prefix=['joe']) - --> - [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']), - MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])] - """ - if not prefix: - prefix = [] - result = [] - excluded_result = [] - folders = OrderedDict() - # Gather files into the final result, excluded, or folders. - for s in sources: - if len(s) == 1: - filename = _NormalizedSource("\\".join(prefix + s)) - if filename in excluded: - excluded_result.append(filename) - else: - result.append(filename) - elif msvs_version and not msvs_version.UsesVcxproj(): - # For MSVS 2008 and earlier, we need to process all files before walking - # the sub folders. - if not folders.get(s[0]): - folders[s[0]] = [] - folders[s[0]].append(s[1:]) - else: - contents = _ConvertSourcesToFilterHierarchy( - [s[1:]], - prefix + [s[0]], - excluded=excluded, - list_excluded=list_excluded, - msvs_version=msvs_version, - ) - contents = MSVSProject.Filter(s[0], contents=contents) - result.append(contents) - # Add a folder for excluded files. - if excluded_result and list_excluded: - excluded_folder = MSVSProject.Filter( - "_excluded_files", contents=excluded_result - ) - result.append(excluded_folder) - - if msvs_version and msvs_version.UsesVcxproj(): - return result - - # Populate all the folders. - for f in folders: - contents = _ConvertSourcesToFilterHierarchy( - folders[f], - prefix=prefix + [f], - excluded=excluded, - list_excluded=list_excluded, - msvs_version=msvs_version, - ) - contents = MSVSProject.Filter(f, contents=contents) - result.append(contents) - return result - - -def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False): - if not value: - return - _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset) - - -def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False): - # TODO(bradnelson): ugly hack, fix this more generally!!! - if "Directories" in setting or "Dependencies" in setting: - if type(value) == str: - value = value.replace("/", "\\") - else: - value = [i.replace("/", "\\") for i in value] - if not tools.get(tool_name): - tools[tool_name] = dict() - tool = tools[tool_name] - if "CompileAsWinRT" == setting: - return - if tool.get(setting): - if only_if_unset: - return - if type(tool[setting]) == list and type(value) == list: - tool[setting] += value - else: - raise TypeError( - 'Appending "%s" to a non-list setting "%s" for tool "%s" is ' - "not allowed, previous value: %s" - % (value, setting, tool_name, str(tool[setting])) - ) - else: - tool[setting] = value - - -def _ConfigTargetVersion(config_data): - return config_data.get("msvs_target_version", "Windows7") - - -def _ConfigPlatform(config_data): - return config_data.get("msvs_configuration_platform", "Win32") - - -def _ConfigBaseName(config_name, platform_name): - if config_name.endswith("_" + platform_name): - return config_name[0 : -len(platform_name) - 1] - else: - return config_name - - -def _ConfigFullName(config_name, config_data): - platform_name = _ConfigPlatform(config_data) - return f"{_ConfigBaseName(config_name, platform_name)}|{platform_name}" - - -def _ConfigWindowsTargetPlatformVersion(config_data, version): - target_ver = config_data.get("msvs_windows_target_platform_version") - if target_ver and re.match(r"^\d+", target_ver): - return target_ver - config_ver = config_data.get("msvs_windows_sdk_version") - vers = [config_ver] if config_ver else version.compatible_sdks - for ver in vers: - for key in [ - r"HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s", - r"HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s", - ]: - sdk_dir = MSVSVersion._RegistryGetValue(key % ver, "InstallationFolder") - if not sdk_dir: - continue - version = MSVSVersion._RegistryGetValue(key % ver, "ProductVersion") or "" - # Find a matching entry in sdk_dir\include. - expected_sdk_dir = r"%s\include" % sdk_dir - names = sorted( - ( - x - for x in ( - os.listdir(expected_sdk_dir) - if os.path.isdir(expected_sdk_dir) - else [] - ) - if x.startswith(version) - ), - reverse=True, - ) - if names: - return names[0] - else: - print( - "Warning: No include files found for detected " - "Windows SDK version %s" % (version), - file=sys.stdout, - ) - - -def _BuildCommandLineForRuleRaw( - spec, cmd, cygwin_shell, has_input_path, quote_cmd, do_setup_env -): - - if [x for x in cmd if "$(InputDir)" in x]: - input_dir_preamble = ( - "set INPUTDIR=$(InputDir)\n" - "if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n" - "set INPUTDIR=%INPUTDIR:~0,-1%\n" - ) - else: - input_dir_preamble = "" - - if cygwin_shell: - # Find path to cygwin. - cygwin_dir = _FixPath(spec.get("msvs_cygwin_dirs", ["."])[0]) - # Prepare command. - direct_cmd = cmd - direct_cmd = [ - i.replace("$(IntDir)", '`cygpath -m "${INTDIR}"`') for i in direct_cmd - ] - direct_cmd = [ - i.replace("$(OutDir)", '`cygpath -m "${OUTDIR}"`') for i in direct_cmd - ] - direct_cmd = [ - i.replace("$(InputDir)", '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd - ] - if has_input_path: - direct_cmd = [ - i.replace("$(InputPath)", '`cygpath -m "${INPUTPATH}"`') - for i in direct_cmd - ] - direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd] - # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd) - direct_cmd = " ".join(direct_cmd) - # TODO(quote): regularize quoting path names throughout the module - cmd = "" - if do_setup_env: - cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && ' - cmd += "set CYGWIN=nontsec&& " - if direct_cmd.find("NUMBER_OF_PROCESSORS") >= 0: - cmd += "set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& " - if direct_cmd.find("INTDIR") >= 0: - cmd += "set INTDIR=$(IntDir)&& " - if direct_cmd.find("OUTDIR") >= 0: - cmd += "set OUTDIR=$(OutDir)&& " - if has_input_path and direct_cmd.find("INPUTPATH") >= 0: - cmd += "set INPUTPATH=$(InputPath) && " - cmd += 'bash -c "%(cmd)s"' - cmd = cmd % {"cygwin_dir": cygwin_dir, "cmd": direct_cmd} - return input_dir_preamble + cmd - else: - # Convert cat --> type to mimic unix. - if cmd[0] == "cat": - command = ["type"] - else: - command = [cmd[0].replace("/", "\\")] - # Add call before command to ensure that commands can be tied together one - # after the other without aborting in Incredibuild, since IB makes a bat - # file out of the raw command string, and some commands (like python) are - # actually batch files themselves. - command.insert(0, "call") - # Fix the paths - # TODO(quote): This is a really ugly heuristic, and will miss path fixing - # for arguments like "--arg=path" or "/opt:path". - # If the argument starts with a slash or dash, it's probably a command line - # switch - # Return the path with forward slashes because the command using it might - # not support backslashes. - arguments = [i if (i[:1] in "/-") else _FixPath(i, "/") for i in cmd[1:]] - arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments] - arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] - if quote_cmd: - # Support a mode for using cmd directly. - # Convert any paths to native form (first element is used directly). - # TODO(quote): regularize quoting path names throughout the module - arguments = ['"%s"' % i for i in arguments] - # Collapse into a single command. - return input_dir_preamble + " ".join(command + arguments) - - -def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env): - # Currently this weird argument munging is used to duplicate the way a - # python script would need to be run as part of the chrome tree. - # Eventually we should add some sort of rule_default option to set this - # per project. For now the behavior chrome needs is the default. - mcs = rule.get("msvs_cygwin_shell") - if mcs is None: - mcs = int(spec.get("msvs_cygwin_shell", 1)) - elif isinstance(mcs, str): - mcs = int(mcs) - quote_cmd = int(rule.get("msvs_quote_cmd", 1)) - return _BuildCommandLineForRuleRaw( - spec, rule["action"], mcs, has_input_path, quote_cmd, do_setup_env=do_setup_env - ) - - -def _AddActionStep(actions_dict, inputs, outputs, description, command): - """Merge action into an existing list of actions. - - Care must be taken so that actions which have overlapping inputs either don't - get assigned to the same input, or get collapsed into one. - - Arguments: - actions_dict: dictionary keyed on input name, which maps to a list of - dicts describing the actions attached to that input file. - inputs: list of inputs - outputs: list of outputs - description: description of the action - command: command line to execute - """ - # Require there to be at least one input (call sites will ensure this). - assert inputs - - action = { - "inputs": inputs, - "outputs": outputs, - "description": description, - "command": command, - } - - # Pick where to stick this action. - # While less than optimal in terms of build time, attach them to the first - # input for now. - chosen_input = inputs[0] - - # Add it there. - if chosen_input not in actions_dict: - actions_dict[chosen_input] = [] - actions_dict[chosen_input].append(action) - - -def _AddCustomBuildToolForMSVS( - p, spec, primary_input, inputs, outputs, description, cmd -): - """Add a custom build tool to execute something. - - Arguments: - p: the target project - spec: the target project dict - primary_input: input file to attach the build tool to - inputs: list of inputs - outputs: list of outputs - description: description of the action - cmd: command line to execute - """ - inputs = _FixPaths(inputs) - outputs = _FixPaths(outputs) - tool = MSVSProject.Tool( - "VCCustomBuildTool", - { - "Description": description, - "AdditionalDependencies": ";".join(inputs), - "Outputs": ";".join(outputs), - "CommandLine": cmd, - }, - ) - # Add to the properties of primary input for each config. - for config_name, c_data in spec["configurations"].items(): - p.AddFileConfig( - _FixPath(primary_input), _ConfigFullName(config_name, c_data), tools=[tool] - ) - - -def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): - """Add actions accumulated into an actions_dict, merging as needed. - - Arguments: - p: the target project - spec: the target project dict - actions_dict: dictionary keyed on input name, which maps to a list of - dicts describing the actions attached to that input file. - """ - for primary_input in actions_dict: - inputs = OrderedSet() - outputs = OrderedSet() - descriptions = [] - commands = [] - for action in actions_dict[primary_input]: - inputs.update(OrderedSet(action["inputs"])) - outputs.update(OrderedSet(action["outputs"])) - descriptions.append(action["description"]) - commands.append(action["command"]) - # Add the custom build step for one input file. - description = ", and also ".join(descriptions) - command = "\r\n".join(commands) - _AddCustomBuildToolForMSVS( - p, - spec, - primary_input=primary_input, - inputs=inputs, - outputs=outputs, - description=description, - cmd=command, - ) - - -def _RuleExpandPath(path, input_file): - """Given the input file to which a rule applied, string substitute a path. - - Arguments: - path: a path to string expand - input_file: the file to which the rule applied. - Returns: - The string substituted path. - """ - path = path.replace( - "$(InputName)", os.path.splitext(os.path.split(input_file)[1])[0] - ) - path = path.replace("$(InputDir)", os.path.dirname(input_file)) - path = path.replace( - "$(InputExt)", os.path.splitext(os.path.split(input_file)[1])[1] - ) - path = path.replace("$(InputFileName)", os.path.split(input_file)[1]) - path = path.replace("$(InputPath)", input_file) - return path - - -def _FindRuleTriggerFiles(rule, sources): - """Find the list of files which a particular rule applies to. - - Arguments: - rule: the rule in question - sources: the set of all known source files for this project - Returns: - The list of sources that trigger a particular rule. - """ - return rule.get("rule_sources", []) - - -def _RuleInputsAndOutputs(rule, trigger_file): - """Find the inputs and outputs generated by a rule. - - Arguments: - rule: the rule in question. - trigger_file: the main trigger for this rule. - Returns: - The pair of (inputs, outputs) involved in this rule. - """ - raw_inputs = _FixPaths(rule.get("inputs", [])) - raw_outputs = _FixPaths(rule.get("outputs", [])) - inputs = OrderedSet() - outputs = OrderedSet() - inputs.add(trigger_file) - for i in raw_inputs: - inputs.add(_RuleExpandPath(i, trigger_file)) - for o in raw_outputs: - outputs.add(_RuleExpandPath(o, trigger_file)) - return (inputs, outputs) - - -def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): - """Generate a native rules file. - - Arguments: - p: the target project - rules: the set of rules to include - output_dir: the directory in which the project/gyp resides - spec: the project dict - options: global generator options - """ - rules_filename = "{}{}.rules".format(spec["target_name"], options.suffix) - rules_file = MSVSToolFile.Writer( - os.path.join(output_dir, rules_filename), spec["target_name"] - ) - # Add each rule. - for r in rules: - rule_name = r["rule_name"] - rule_ext = r["extension"] - inputs = _FixPaths(r.get("inputs", [])) - outputs = _FixPaths(r.get("outputs", [])) - # Skip a rule with no action and no inputs. - if "action" not in r and not r.get("rule_sources", []): - continue - cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, do_setup_env=True) - rules_file.AddCustomBuildRule( - name=rule_name, - description=r.get("message", rule_name), - extensions=[rule_ext], - additional_dependencies=inputs, - outputs=outputs, - cmd=cmd, - ) - # Write out rules file. - rules_file.WriteIfChanged() - - # Add rules file to project. - p.AddToolFile(rules_filename) - - -def _Cygwinify(path): - path = path.replace("$(OutDir)", "$(OutDirCygwin)") - path = path.replace("$(IntDir)", "$(IntDirCygwin)") - return path - - -def _GenerateExternalRules(rules, output_dir, spec, sources, options, actions_to_add): - """Generate an external makefile to do a set of rules. - - Arguments: - rules: the list of rules to include - output_dir: path containing project and gyp files - spec: project specification data - sources: set of sources known - options: global generator options - actions_to_add: The list of actions we will add to. - """ - filename = "{}_rules{}.mk".format(spec["target_name"], options.suffix) - mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename)) - # Find cygwin style versions of some paths. - mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n') - mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n') - # Gather stuff needed to emit all: target. - all_inputs = OrderedSet() - all_outputs = OrderedSet() - all_output_dirs = OrderedSet() - first_outputs = [] - for rule in rules: - trigger_files = _FindRuleTriggerFiles(rule, sources) - for tf in trigger_files: - inputs, outputs = _RuleInputsAndOutputs(rule, tf) - all_inputs.update(OrderedSet(inputs)) - all_outputs.update(OrderedSet(outputs)) - # Only use one target from each rule as the dependency for - # 'all' so we don't try to build each rule multiple times. - first_outputs.append(list(outputs)[0]) - # Get the unique output directories for this rule. - output_dirs = [os.path.split(i)[0] for i in outputs] - for od in output_dirs: - all_output_dirs.add(od) - first_outputs_cyg = [_Cygwinify(i) for i in first_outputs] - # Write out all: target, including mkdir for each output directory. - mk_file.write("all: %s\n" % " ".join(first_outputs_cyg)) - for od in all_output_dirs: - if od: - mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od) - mk_file.write("\n") - # Define how each output is generated. - for rule in rules: - trigger_files = _FindRuleTriggerFiles(rule, sources) - for tf in trigger_files: - # Get all the inputs and outputs for this rule for this trigger file. - inputs, outputs = _RuleInputsAndOutputs(rule, tf) - inputs = [_Cygwinify(i) for i in inputs] - outputs = [_Cygwinify(i) for i in outputs] - # Prepare the command line for this rule. - cmd = [_RuleExpandPath(c, tf) for c in rule["action"]] - cmd = ['"%s"' % i for i in cmd] - cmd = " ".join(cmd) - # Add it to the makefile. - mk_file.write("{}: {}\n".format(" ".join(outputs), " ".join(inputs))) - mk_file.write("\t%s\n\n" % cmd) - # Close up the file. - mk_file.close() - - # Add makefile to list of sources. - sources.add(filename) - # Add a build action to call makefile. - cmd = [ - "make", - "OutDir=$(OutDir)", - "IntDir=$(IntDir)", - "-j", - "${NUMBER_OF_PROCESSORS_PLUS_1}", - "-f", - filename, - ] - cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True) - # Insert makefile as 0'th input, so it gets the action attached there, - # as this is easier to understand from in the IDE. - all_inputs = list(all_inputs) - all_inputs.insert(0, filename) - _AddActionStep( - actions_to_add, - inputs=_FixPaths(all_inputs), - outputs=_FixPaths(all_outputs), - description="Running external rules for %s" % spec["target_name"], - command=cmd, - ) - - -def _EscapeEnvironmentVariableExpansion(s): - """Escapes % characters. - - Escapes any % characters so that Windows-style environment variable - expansions will leave them alone. - See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile - to understand why we have to do this. - - Args: - s: The string to be escaped. - - Returns: - The escaped string. - """ # noqa: E731,E123,E501 - s = s.replace("%", "%%") - return s - - -quote_replacer_regex = re.compile(r'(\\*)"') - - -def _EscapeCommandLineArgumentForMSVS(s): - """Escapes a Windows command-line argument. - - So that the Win32 CommandLineToArgv function will turn the escaped result back - into the original string. - See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx - ("Parsing C++ Command-Line Arguments") to understand why we have to do - this. - - Args: - s: the string to be escaped. - Returns: - the escaped string. - """ - - def _Replace(match): - # For a literal quote, CommandLineToArgv requires an odd number of - # backslashes preceding it, and it produces half as many literal backslashes - # (rounded down). So we need to produce 2n+1 backslashes. - return 2 * match.group(1) + '\\"' - - # Escape all quotes so that they are interpreted literally. - s = quote_replacer_regex.sub(_Replace, s) - # Now add unescaped quotes so that any whitespace is interpreted literally. - s = '"' + s + '"' - return s - - -delimiters_replacer_regex = re.compile(r"(\\*)([,;]+)") - - -def _EscapeVCProjCommandLineArgListItem(s): - """Escapes command line arguments for MSVS. - - The VCProj format stores string lists in a single string using commas and - semi-colons as separators, which must be quoted if they are to be - interpreted literally. However, command-line arguments may already have - quotes, and the VCProj parser is ignorant of the backslash escaping - convention used by CommandLineToArgv, so the command-line quotes and the - VCProj quotes may not be the same quotes. So to store a general - command-line argument in a VCProj list, we need to parse the existing - quoting according to VCProj's convention and quote any delimiters that are - not already quoted by that convention. The quotes that we add will also be - seen by CommandLineToArgv, so if backslashes precede them then we also have - to escape those backslashes according to the CommandLineToArgv - convention. - - Args: - s: the string to be escaped. - Returns: - the escaped string. - """ - - def _Replace(match): - # For a non-literal quote, CommandLineToArgv requires an even number of - # backslashes preceding it, and it produces half as many literal - # backslashes. So we need to produce 2n backslashes. - return 2 * match.group(1) + '"' + match.group(2) + '"' - - segments = s.split('"') - # The unquoted segments are at the even-numbered indices. - for i in range(0, len(segments), 2): - segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i]) - # Concatenate back into a single string - s = '"'.join(segments) - if len(segments) % 2 == 0: - # String ends while still quoted according to VCProj's convention. This - # means the delimiter and the next list item that follow this one in the - # .vcproj file will be misinterpreted as part of this item. There is nothing - # we can do about this. Adding an extra quote would correct the problem in - # the VCProj but cause the same problem on the final command-line. Moving - # the item to the end of the list does works, but that's only possible if - # there's only one such item. Let's just warn the user. - print( - "Warning: MSVS may misinterpret the odd number of " + "quotes in " + s, - file=sys.stderr, - ) - return s - - -def _EscapeCppDefineForMSVS(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = _EscapeEnvironmentVariableExpansion(s) - s = _EscapeCommandLineArgumentForMSVS(s) - s = _EscapeVCProjCommandLineArgListItem(s) - # cl.exe replaces literal # characters with = in preprocessor definitions for - # some reason. Octal-encode to work around that. - s = s.replace("#", "\\%03o" % ord("#")) - return s - - -quote_replacer_regex2 = re.compile(r'(\\+)"') - - -def _EscapeCommandLineArgumentForMSBuild(s): - """Escapes a Windows command-line argument for use by MSBuild.""" - - def _Replace(match): - return (len(match.group(1)) / 2 * 4) * "\\" + '\\"' - - # Escape all quotes so that they are interpreted literally. - s = quote_replacer_regex2.sub(_Replace, s) - return s - - -def _EscapeMSBuildSpecialCharacters(s): - escape_dictionary = { - "%": "%25", - "$": "%24", - "@": "%40", - "'": "%27", - ";": "%3B", - "?": "%3F", - "*": "%2A", - } - result = "".join([escape_dictionary.get(c, c) for c in s]) - return result - - -def _EscapeCppDefineForMSBuild(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = _EscapeEnvironmentVariableExpansion(s) - s = _EscapeCommandLineArgumentForMSBuild(s) - s = _EscapeMSBuildSpecialCharacters(s) - # cl.exe replaces literal # characters with = in preprocessor definitions for - # some reason. Octal-encode to work around that. - s = s.replace("#", "\\%03o" % ord("#")) - return s - - -def _GenerateRulesForMSVS( - p, output_dir, options, spec, sources, excluded_sources, actions_to_add -): - """Generate all the rules for a particular project. - - Arguments: - p: the project - output_dir: directory to emit rules to - options: global options passed to the generator - spec: the specification for this project - sources: the set of all known source files in this project - excluded_sources: the set of sources excluded from normal processing - actions_to_add: deferred list of actions to add in - """ - rules = spec.get("rules", []) - rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] - rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] - - # Handle rules that use a native rules file. - if rules_native: - _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) - - # Handle external rules (non-native rules). - if rules_external: - _GenerateExternalRules( - rules_external, output_dir, spec, sources, options, actions_to_add - ) - _AdjustSourcesForRules(rules, sources, excluded_sources, False) - - -def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild): - # Add outputs generated by each rule (if applicable). - for rule in rules: - # Add in the outputs from this rule. - trigger_files = _FindRuleTriggerFiles(rule, sources) - for trigger_file in trigger_files: - # Remove trigger_file from excluded_sources to let the rule be triggered - # (e.g. rule trigger ax_enums.idl is added to excluded_sources - # because it's also in an action's inputs in the same project) - excluded_sources.discard(_FixPath(trigger_file)) - # Done if not processing outputs as sources. - if int(rule.get("process_outputs_as_sources", False)): - inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) - inputs = OrderedSet(_FixPaths(inputs)) - outputs = OrderedSet(_FixPaths(outputs)) - inputs.remove(_FixPath(trigger_file)) - sources.update(inputs) - if not is_msbuild: - excluded_sources.update(inputs) - sources.update(outputs) - - -def _FilterActionsFromExcluded(excluded_sources, actions_to_add): - """Take inputs with actions attached out of the list of exclusions. - - Arguments: - excluded_sources: list of source files not to be built. - actions_to_add: dict of actions keyed on source file they're attached to. - Returns: - excluded_sources with files that have actions attached removed. - """ - must_keep = OrderedSet(_FixPaths(actions_to_add.keys())) - return [s for s in excluded_sources if s not in must_keep] - - -def _GetDefaultConfiguration(spec): - return spec["configurations"][spec["default_configuration"]] - - -def _GetGuidOfProject(proj_path, spec): - """Get the guid for the project. - - Arguments: - proj_path: Path of the vcproj or vcxproj file to generate. - spec: The target dictionary containing the properties of the target. - Returns: - the guid. - Raises: - ValueError: if the specified GUID is invalid. - """ - # Pluck out the default configuration. - default_config = _GetDefaultConfiguration(spec) - # Decide the guid of the project. - guid = default_config.get("msvs_guid") - if guid: - if VALID_MSVS_GUID_CHARS.match(guid) is None: - raise ValueError( - 'Invalid MSVS guid: "%s". Must match regex: "%s".' - % (guid, VALID_MSVS_GUID_CHARS.pattern) - ) - guid = "{%s}" % guid - guid = guid or MSVSNew.MakeGuid(proj_path) - return guid - - -def _GetMsbuildToolsetOfProject(proj_path, spec, version): - """Get the platform toolset for the project. - - Arguments: - proj_path: Path of the vcproj or vcxproj file to generate. - spec: The target dictionary containing the properties of the target. - version: The MSVSVersion object. - Returns: - the platform toolset string or None. - """ - # Pluck out the default configuration. - default_config = _GetDefaultConfiguration(spec) - toolset = default_config.get("msbuild_toolset") - if not toolset and version.DefaultToolset(): - toolset = version.DefaultToolset() - if spec["type"] == "windows_driver": - toolset = "WindowsKernelModeDriver10.0" - return toolset - - -def _GenerateProject(project, options, version, generator_flags, spec): - """Generates a vcproj file. - - Arguments: - project: the MSVSProject object. - options: global generator options. - version: the MSVSVersion object. - generator_flags: dict of generator-specific flags. - Returns: - A list of source files that cannot be found on disk. - """ - default_config = _GetDefaultConfiguration(project.spec) - - # Skip emitting anything if told to with msvs_existing_vcproj option. - if default_config.get("msvs_existing_vcproj"): - return [] - - if version.UsesVcxproj(): - return _GenerateMSBuildProject(project, options, version, generator_flags, spec) - else: - return _GenerateMSVSProject(project, options, version, generator_flags) - - -def _GenerateMSVSProject(project, options, version, generator_flags): - """Generates a .vcproj file. It may create .rules and .user files too. - - Arguments: - project: The project object we will generate the file for. - options: Global options passed to the generator. - version: The VisualStudioVersion object. - generator_flags: dict of generator-specific flags. - """ - spec = project.spec - gyp.common.EnsureDirExists(project.path) - - platforms = _GetUniquePlatforms(spec) - p = MSVSProject.Writer( - project.path, version, spec["target_name"], project.guid, platforms - ) - - # Get directory project file is in. - project_dir = os.path.split(project.path)[0] - gyp_path = _NormalizedSource(project.build_file) - relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) - - config_type = _GetMSVSConfigurationType(spec, project.build_file) - for config_name, config in spec["configurations"].items(): - _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config) - - # Prepare list of sources and excluded sources. - gyp_file = os.path.split(project.build_file)[1] - sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) - - # Add rules. - actions_to_add = {} - _GenerateRulesForMSVS( - p, project_dir, options, spec, sources, excluded_sources, actions_to_add - ) - list_excluded = generator_flags.get("msvs_list_excluded_files", True) - sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, project_dir, sources, excluded_sources, list_excluded, version - ) - - # Add in files. - missing_sources = _VerifySourcesExist(sources, project_dir) - p.AddFiles(sources) - - _AddToolFilesToMSVS(p, spec) - _HandlePreCompiledHeaders(p, sources, spec) - _AddActions(actions_to_add, spec, relative_path_of_gyp_file) - _AddCopies(actions_to_add, spec) - _WriteMSVSUserFile(project.path, version, spec) - - # NOTE: this stanza must appear after all actions have been decided. - # Don't excluded sources with actions attached, or they won't run. - excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) - _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded) - _AddAccumulatedActionsToMSVS(p, spec, actions_to_add) - - # Write it out. - p.WriteIfChanged() - - return missing_sources - - -def _GetUniquePlatforms(spec): - """Returns the list of unique platforms for this spec, e.g ['win32', ...]. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - The MSVSUserFile object created. - """ - # Gather list of unique platforms. - platforms = OrderedSet() - for configuration in spec["configurations"]: - platforms.add(_ConfigPlatform(spec["configurations"][configuration])) - platforms = list(platforms) - return platforms - - -def _CreateMSVSUserFile(proj_path, version, spec): - """Generates a .user file for the user running this Gyp program. - - Arguments: - proj_path: The path of the project file being created. The .user file - shares the same path (with an appropriate suffix). - version: The VisualStudioVersion object. - spec: The target dictionary containing the properties of the target. - Returns: - The MSVSUserFile object created. - """ - (domain, username) = _GetDomainAndUserName() - vcuser_filename = ".".join([proj_path, domain, username, "user"]) - user_file = MSVSUserFile.Writer(vcuser_filename, version, spec["target_name"]) - return user_file - - -def _GetMSVSConfigurationType(spec, build_file): - """Returns the configuration type for this project. - - It's a number defined by Microsoft. May raise an exception. - - Args: - spec: The target dictionary containing the properties of the target. - build_file: The path of the gyp file. - Returns: - An integer, the configuration type. - """ - try: - config_type = { - "executable": "1", # .exe - "shared_library": "2", # .dll - "loadable_module": "2", # .dll - "static_library": "4", # .lib - "windows_driver": "5", # .sys - "none": "10", # Utility type - }[spec["type"]] - except KeyError: - if spec.get("type"): - raise GypError( - "Target type %s is not a valid target type for " - "target %s in %s." % (spec["type"], spec["target_name"], build_file) - ) - else: - raise GypError( - "Missing type field for target %s in %s." - % (spec["target_name"], build_file) - ) - return config_type - - -def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): - """Adds a configuration to the MSVS project. - - Many settings in a vcproj file are specific to a configuration. This - function the main part of the vcproj file that's configuration specific. - - Arguments: - p: The target project being generated. - spec: The target dictionary containing the properties of the target. - config_type: The configuration type, a number as defined by Microsoft. - config_name: The name of the configuration. - config: The dictionary that defines the special processing to be done - for this configuration. - """ - # Get the information for this configuration - include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs(config) - libraries = _GetLibraries(spec) - library_dirs = _GetLibraryDirs(config) - out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False) - defines = _GetDefines(config) - defines = [_EscapeCppDefineForMSVS(d) for d in defines] - disabled_warnings = _GetDisabledWarnings(config) - prebuild = config.get("msvs_prebuild") - postbuild = config.get("msvs_postbuild") - def_file = _GetModuleDefinition(spec) - precompiled_header = config.get("msvs_precompiled_header") - - # Prepare the list of tools as a dictionary. - tools = dict() - # Add in user specified msvs_settings. - msvs_settings = config.get("msvs_settings", {}) - MSVSSettings.ValidateMSVSSettings(msvs_settings) - - # Prevent default library inheritance from the environment. - _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", ["$(NOINHERIT)"]) - - for tool in msvs_settings: - settings = config["msvs_settings"][tool] - for setting in settings: - _ToolAppend(tools, tool, setting, settings[setting]) - # Add the information to the appropriate tool - _ToolAppend(tools, "VCCLCompilerTool", "AdditionalIncludeDirectories", include_dirs) - _ToolAppend(tools, "VCMIDLTool", "AdditionalIncludeDirectories", midl_include_dirs) - _ToolAppend( - tools, - "VCResourceCompilerTool", - "AdditionalIncludeDirectories", - resource_include_dirs, - ) - # Add in libraries. - _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", libraries) - _ToolAppend(tools, "VCLinkerTool", "AdditionalLibraryDirectories", library_dirs) - if out_file: - _ToolAppend(tools, vc_tool, "OutputFile", out_file, only_if_unset=True) - # Add defines. - _ToolAppend(tools, "VCCLCompilerTool", "PreprocessorDefinitions", defines) - _ToolAppend(tools, "VCResourceCompilerTool", "PreprocessorDefinitions", defines) - # Change program database directory to prevent collisions. - _ToolAppend( - tools, - "VCCLCompilerTool", - "ProgramDataBaseFileName", - "$(IntDir)$(ProjectName)\\vc80.pdb", - only_if_unset=True, - ) - # Add disabled warnings. - _ToolAppend(tools, "VCCLCompilerTool", "DisableSpecificWarnings", disabled_warnings) - # Add Pre-build. - _ToolAppend(tools, "VCPreBuildEventTool", "CommandLine", prebuild) - # Add Post-build. - _ToolAppend(tools, "VCPostBuildEventTool", "CommandLine", postbuild) - # Turn on precompiled headers if appropriate. - if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] - _ToolAppend(tools, "VCCLCompilerTool", "UsePrecompiledHeader", "2") - _ToolAppend( - tools, "VCCLCompilerTool", "PrecompiledHeaderThrough", precompiled_header - ) - _ToolAppend(tools, "VCCLCompilerTool", "ForcedIncludeFiles", precompiled_header) - # Loadable modules don't generate import libraries; - # tell dependent projects to not expect one. - if spec["type"] == "loadable_module": - _ToolAppend(tools, "VCLinkerTool", "IgnoreImportLibrary", "true") - # Set the module definition file if any. - if def_file: - _ToolAppend(tools, "VCLinkerTool", "ModuleDefinitionFile", def_file) - - _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name) - - -def _GetIncludeDirs(config): - """Returns the list of directories to be used for #include directives. - - Arguments: - config: The dictionary that defines the special processing to be done - for this configuration. - Returns: - The list of directory paths. - """ - # TODO(bradnelson): include_dirs should really be flexible enough not to - # require this sort of thing. - include_dirs = config.get("include_dirs", []) + config.get( - "msvs_system_include_dirs", [] - ) - midl_include_dirs = config.get("midl_include_dirs", []) + config.get( - "msvs_system_include_dirs", [] - ) - resource_include_dirs = config.get("resource_include_dirs", include_dirs) - include_dirs = _FixPaths(include_dirs) - midl_include_dirs = _FixPaths(midl_include_dirs) - resource_include_dirs = _FixPaths(resource_include_dirs) - return include_dirs, midl_include_dirs, resource_include_dirs - - -def _GetLibraryDirs(config): - """Returns the list of directories to be used for library search paths. - - Arguments: - config: The dictionary that defines the special processing to be done - for this configuration. - Returns: - The list of directory paths. - """ - - library_dirs = config.get("library_dirs", []) - library_dirs = _FixPaths(library_dirs) - return library_dirs - - -def _GetLibraries(spec): - """Returns the list of libraries for this configuration. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - The list of directory paths. - """ - libraries = spec.get("libraries", []) - # Strip out -l, as it is not used on windows (but is needed so we can pass - # in libraries that are assumed to be in the default library path). - # Also remove duplicate entries, leaving only the last duplicate, while - # preserving order. - found = OrderedSet() - unique_libraries_list = [] - for entry in reversed(libraries): - library = re.sub(r"^\-l", "", entry) - if not os.path.splitext(library)[1]: - library += ".lib" - if library not in found: - found.add(library) - unique_libraries_list.append(library) - unique_libraries_list.reverse() - return unique_libraries_list - - -def _GetOutputFilePathAndTool(spec, msbuild): - """Returns the path and tool to use for this target. - - Figures out the path of the file this spec will create and the name of - the VC tool that will create it. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - A triple of (file path, name of the vc tool, name of the msbuild tool) - """ - # Select a name for the output file. - out_file = "" - vc_tool = "" - msbuild_tool = "" - output_file_map = { - "executable": ("VCLinkerTool", "Link", "$(OutDir)", ".exe"), - "shared_library": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), - "loadable_module": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), - "windows_driver": ("VCLinkerTool", "Link", "$(OutDir)", ".sys"), - "static_library": ("VCLibrarianTool", "Lib", "$(OutDir)lib\\", ".lib"), - } - output_file_props = output_file_map.get(spec["type"]) - if output_file_props and int(spec.get("msvs_auto_output_file", 1)): - vc_tool, msbuild_tool, out_dir, suffix = output_file_props - if spec.get("standalone_static_library", 0): - out_dir = "$(OutDir)" - out_dir = spec.get("product_dir", out_dir) - product_extension = spec.get("product_extension") - if product_extension: - suffix = "." + product_extension - elif msbuild: - suffix = "$(TargetExt)" - prefix = spec.get("product_prefix", "") - product_name = spec.get("product_name", "$(ProjectName)") - out_file = ntpath.join(out_dir, prefix + product_name + suffix) - return out_file, vc_tool, msbuild_tool - - -def _GetOutputTargetExt(spec): - """Returns the extension for this target, including the dot - - If product_extension is specified, set target_extension to this to avoid - MSB8012, returns None otherwise. Ignores any target_extension settings in - the input files. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - A string with the extension, or None - """ - target_extension = spec.get("product_extension") - if target_extension: - return "." + target_extension - return None - - -def _GetDefines(config): - """Returns the list of preprocessor definitions for this configuration. - - Arguments: - config: The dictionary that defines the special processing to be done - for this configuration. - Returns: - The list of preprocessor definitions. - """ - defines = [] - for d in config.get("defines", []): - if type(d) == list: - fd = "=".join([str(dpart) for dpart in d]) - else: - fd = str(d) - defines.append(fd) - return defines - - -def _GetDisabledWarnings(config): - return [str(i) for i in config.get("msvs_disabled_warnings", [])] - - -def _GetModuleDefinition(spec): - def_file = "" - if spec["type"] in [ - "shared_library", - "loadable_module", - "executable", - "windows_driver", - ]: - def_files = [s for s in spec.get("sources", []) if s.endswith(".def")] - if len(def_files) == 1: - def_file = _FixPath(def_files[0]) - elif def_files: - raise ValueError( - "Multiple module definition files in one target, target %s lists " - "multiple .def files: %s" % (spec["target_name"], " ".join(def_files)) - ) - return def_file - - -def _ConvertToolsToExpectedForm(tools): - """Convert tools to a form expected by Visual Studio. - - Arguments: - tools: A dictionary of settings; the tool name is the key. - Returns: - A list of Tool objects. - """ - tool_list = [] - for tool, settings in tools.items(): - # Collapse settings with lists. - settings_fixed = {} - for setting, value in settings.items(): - if type(value) == list: - if ( - tool == "VCLinkerTool" and setting == "AdditionalDependencies" - ) or setting == "AdditionalOptions": - settings_fixed[setting] = " ".join(value) - else: - settings_fixed[setting] = ";".join(value) - else: - settings_fixed[setting] = value - # Add in this tool. - tool_list.append(MSVSProject.Tool(tool, settings_fixed)) - return tool_list - - -def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name): - """Add to the project file the configuration specified by config. - - Arguments: - p: The target project being generated. - spec: the target project dict. - tools: A dictionary of settings; the tool name is the key. - config: The dictionary that defines the special processing to be done - for this configuration. - config_type: The configuration type, a number as defined by Microsoft. - config_name: The name of the configuration. - """ - attributes = _GetMSVSAttributes(spec, config, config_type) - # Add in this configuration. - tool_list = _ConvertToolsToExpectedForm(tools) - p.AddConfig(_ConfigFullName(config_name, config), attrs=attributes, tools=tool_list) - - -def _GetMSVSAttributes(spec, config, config_type): - # Prepare configuration attributes. - prepared_attrs = {} - source_attrs = config.get("msvs_configuration_attributes", {}) - for a in source_attrs: - prepared_attrs[a] = source_attrs[a] - # Add props files. - vsprops_dirs = config.get("msvs_props", []) - vsprops_dirs = _FixPaths(vsprops_dirs) - if vsprops_dirs: - prepared_attrs["InheritedPropertySheets"] = ";".join(vsprops_dirs) - # Set configuration type. - prepared_attrs["ConfigurationType"] = config_type - output_dir = prepared_attrs.get( - "OutputDirectory", "$(SolutionDir)$(ConfigurationName)" - ) - prepared_attrs["OutputDirectory"] = _FixPath(output_dir) + "\\" - if "IntermediateDirectory" not in prepared_attrs: - intermediate = "$(ConfigurationName)\\obj\\$(ProjectName)" - prepared_attrs["IntermediateDirectory"] = _FixPath(intermediate) + "\\" - else: - intermediate = _FixPath(prepared_attrs["IntermediateDirectory"]) + "\\" - intermediate = MSVSSettings.FixVCMacroSlashes(intermediate) - prepared_attrs["IntermediateDirectory"] = intermediate - return prepared_attrs - - -def _AddNormalizedSources(sources_set, sources_array): - sources_set.update(_NormalizedSource(s) for s in sources_array) - - -def _PrepareListOfSources(spec, generator_flags, gyp_file): - """Prepare list of sources and excluded sources. - - Besides the sources specified directly in the spec, adds the gyp file so - that a change to it will cause a re-compile. Also adds appropriate sources - for actions and copies. Assumes later stage will un-exclude files which - have custom build steps attached. - - Arguments: - spec: The target dictionary containing the properties of the target. - gyp_file: The name of the gyp file. - Returns: - A pair of (list of sources, list of excluded sources). - The sources will be relative to the gyp file. - """ - sources = OrderedSet() - _AddNormalizedSources(sources, spec.get("sources", [])) - excluded_sources = OrderedSet() - # Add in the gyp file. - if not generator_flags.get("standalone"): - sources.add(gyp_file) - - # Add in 'action' inputs and outputs. - for a in spec.get("actions", []): - inputs = a["inputs"] - inputs = [_NormalizedSource(i) for i in inputs] - # Add all inputs to sources and excluded sources. - inputs = OrderedSet(inputs) - sources.update(inputs) - if not spec.get("msvs_external_builder"): - excluded_sources.update(inputs) - if int(a.get("process_outputs_as_sources", False)): - _AddNormalizedSources(sources, a.get("outputs", [])) - # Add in 'copies' inputs and outputs. - for cpy in spec.get("copies", []): - _AddNormalizedSources(sources, cpy.get("files", [])) - return (sources, excluded_sources) - - -def _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, gyp_dir, sources, excluded_sources, list_excluded, version -): - """Adjusts the list of sources and excluded sources. - - Also converts the sets to lists. - - Arguments: - spec: The target dictionary containing the properties of the target. - options: Global generator options. - gyp_dir: The path to the gyp file being processed. - sources: A set of sources to be included for this project. - excluded_sources: A set of sources to be excluded for this project. - version: A MSVSVersion object. - Returns: - A trio of (list of sources, list of excluded sources, - path of excluded IDL file) - """ - # Exclude excluded sources coming into the generator. - excluded_sources.update(OrderedSet(spec.get("sources_excluded", []))) - # Add excluded sources into sources for good measure. - sources.update(excluded_sources) - # Convert to proper windows form. - # NOTE: sources goes from being a set to a list here. - # NOTE: excluded_sources goes from being a set to a list here. - sources = _FixPaths(sources) - # Convert to proper windows form. - excluded_sources = _FixPaths(excluded_sources) - - excluded_idl = _IdlFilesHandledNonNatively(spec, sources) - - precompiled_related = _GetPrecompileRelatedFiles(spec) - # Find the excluded ones, minus the precompiled header related ones. - fully_excluded = [i for i in excluded_sources if i not in precompiled_related] - - # Convert to folders and the right slashes. - sources = [i.split("\\") for i in sources] - sources = _ConvertSourcesToFilterHierarchy( - sources, - excluded=fully_excluded, - list_excluded=list_excluded, - msvs_version=version, - ) - - # Prune filters with a single child to flatten ugly directory structures - # such as ../../src/modules/module1 etc. - if version.UsesVcxproj(): - while ( - all([isinstance(s, MSVSProject.Filter) for s in sources]) - and len({s.name for s in sources}) == 1 - ): - assert all([len(s.contents) == 1 for s in sources]) - sources = [s.contents[0] for s in sources] - else: - while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter): - sources = sources[0].contents - - return sources, excluded_sources, excluded_idl - - -def _IdlFilesHandledNonNatively(spec, sources): - # If any non-native rules use 'idl' as an extension exclude idl files. - # Gather a list here to use later. - using_idl = False - for rule in spec.get("rules", []): - if rule["extension"] == "idl" and int(rule.get("msvs_external_rule", 0)): - using_idl = True - break - if using_idl: - excluded_idl = [i for i in sources if i.endswith(".idl")] - else: - excluded_idl = [] - return excluded_idl - - -def _GetPrecompileRelatedFiles(spec): - # Gather a list of precompiled header related sources. - precompiled_related = [] - for _, config in spec["configurations"].items(): - for k in precomp_keys: - f = config.get(k) - if f: - precompiled_related.append(_FixPath(f)) - return precompiled_related - - -def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded): - exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) - for file_name, excluded_configs in exclusions.items(): - if not list_excluded and len(excluded_configs) == len(spec["configurations"]): - # If we're not listing excluded files, then they won't appear in the - # project, so don't try to configure them to be excluded. - pass - else: - for config_name, config in excluded_configs: - p.AddFileConfig( - file_name, - _ConfigFullName(config_name, config), - {"ExcludedFromBuild": "true"}, - ) - - -def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl): - exclusions = {} - # Exclude excluded sources from being built. - for f in excluded_sources: - excluded_configs = [] - for config_name, config in spec["configurations"].items(): - precomped = [_FixPath(config.get(i, "")) for i in precomp_keys] - # Don't do this for ones that are precompiled header related. - if f not in precomped: - excluded_configs.append((config_name, config)) - exclusions[f] = excluded_configs - # If any non-native rules use 'idl' as an extension exclude idl files. - # Exclude them now. - for f in excluded_idl: - excluded_configs = [] - for config_name, config in spec["configurations"].items(): - excluded_configs.append((config_name, config)) - exclusions[f] = excluded_configs - return exclusions - - -def _AddToolFilesToMSVS(p, spec): - # Add in tool files (rules). - tool_files = OrderedSet() - for _, config in spec["configurations"].items(): - for f in config.get("msvs_tool_files", []): - tool_files.add(f) - for f in tool_files: - p.AddToolFile(f) - - -def _HandlePreCompiledHeaders(p, sources, spec): - # Pre-compiled header source stubs need a different compiler flag - # (generate precompiled header) and any source file not of the same - # kind (i.e. C vs. C++) as the precompiled header source stub needs - # to have use of precompiled headers disabled. - extensions_excluded_from_precompile = [] - for config_name, config in spec["configurations"].items(): - source = config.get("msvs_precompiled_source") - if source: - source = _FixPath(source) - # UsePrecompiledHeader=1 for if using precompiled headers. - tool = MSVSProject.Tool("VCCLCompilerTool", {"UsePrecompiledHeader": "1"}) - p.AddFileConfig( - source, _ConfigFullName(config_name, config), {}, tools=[tool] - ) - basename, extension = os.path.splitext(source) - if extension == ".c": - extensions_excluded_from_precompile = [".cc", ".cpp", ".cxx"] - else: - extensions_excluded_from_precompile = [".c"] - - def DisableForSourceTree(source_tree): - for source in source_tree: - if isinstance(source, MSVSProject.Filter): - DisableForSourceTree(source.contents) - else: - basename, extension = os.path.splitext(source) - if extension in extensions_excluded_from_precompile: - for config_name, config in spec["configurations"].items(): - tool = MSVSProject.Tool( - "VCCLCompilerTool", - { - "UsePrecompiledHeader": "0", - "ForcedIncludeFiles": "$(NOINHERIT)", - }, - ) - p.AddFileConfig( - _FixPath(source), - _ConfigFullName(config_name, config), - {}, - tools=[tool], - ) - - # Do nothing if there was no precompiled source. - if extensions_excluded_from_precompile: - DisableForSourceTree(sources) - - -def _AddActions(actions_to_add, spec, relative_path_of_gyp_file): - # Add actions. - actions = spec.get("actions", []) - # Don't setup_env every time. When all the actions are run together in one - # batch file in VS, the PATH will grow too long. - # Membership in this set means that the cygwin environment has been set up, - # and does not need to be set up again. - have_setup_env = set() - for a in actions: - # Attach actions to the gyp file if nothing else is there. - inputs = a.get("inputs") or [relative_path_of_gyp_file] - attached_to = inputs[0] - need_setup_env = attached_to not in have_setup_env - cmd = _BuildCommandLineForRule( - spec, a, has_input_path=False, do_setup_env=need_setup_env - ) - have_setup_env.add(attached_to) - # Add the action. - _AddActionStep( - actions_to_add, - inputs=inputs, - outputs=a.get("outputs", []), - description=a.get("message", a["action_name"]), - command=cmd, - ) - - -def _WriteMSVSUserFile(project_path, version, spec): - # Add run_as and test targets. - if "run_as" in spec: - run_as = spec["run_as"] - action = run_as.get("action", []) - environment = run_as.get("environment", []) - working_directory = run_as.get("working_directory", ".") - elif int(spec.get("test", 0)): - action = ["$(TargetPath)", "--gtest_print_time"] - environment = [] - working_directory = "." - else: - return # Nothing to add - # Write out the user file. - user_file = _CreateMSVSUserFile(project_path, version, spec) - for config_name, c_data in spec["configurations"].items(): - user_file.AddDebugSettings( - _ConfigFullName(config_name, c_data), action, environment, working_directory - ) - user_file.WriteIfChanged() - - -def _AddCopies(actions_to_add, spec): - copies = _GetCopies(spec) - for inputs, outputs, cmd, description in copies: - _AddActionStep( - actions_to_add, - inputs=inputs, - outputs=outputs, - description=description, - command=cmd, - ) - - -def _GetCopies(spec): - copies = [] - # Add copies. - for cpy in spec.get("copies", []): - for src in cpy.get("files", []): - dst = os.path.join(cpy["destination"], os.path.basename(src)) - # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and - # outputs, so do the same for our generated command line. - if src.endswith("/"): - src_bare = src[:-1] - base_dir = posixpath.split(src_bare)[0] - outer_dir = posixpath.split(src_bare)[1] - fixed_dst = _FixPath(dst) - full_dst = f'"{fixed_dst}\\{outer_dir}\\"' - cmd = 'mkdir {} 2>nul & cd "{}" && xcopy /e /f /y "{}" {}'.format( - full_dst, - _FixPath(base_dir), - outer_dir, - full_dst, - ) - copies.append( - ( - [src], - ["dummy_copies", dst], - cmd, - f"Copying {src} to {fixed_dst}", - ) - ) - else: - fix_dst = _FixPath(cpy["destination"]) - cmd = 'mkdir "{}" 2>nul & set ERRORLEVEL=0 & copy /Y "{}" "{}"'.format( - fix_dst, - _FixPath(src), - _FixPath(dst), - ) - copies.append(([src], [dst], cmd, f"Copying {src} to {fix_dst}")) - return copies - - -def _GetPathDict(root, path): - # |path| will eventually be empty (in the recursive calls) if it was initially - # relative; otherwise it will eventually end up as '\', 'D:\', etc. - if not path or path.endswith(os.sep): - return root - parent, folder = os.path.split(path) - parent_dict = _GetPathDict(root, parent) - if folder not in parent_dict: - parent_dict[folder] = dict() - return parent_dict[folder] - - -def _DictsToFolders(base_path, bucket, flat): - # Convert to folders recursively. - children = [] - for folder, contents in bucket.items(): - if type(contents) == dict: - folder_children = _DictsToFolders( - os.path.join(base_path, folder), contents, flat - ) - if flat: - children += folder_children - else: - folder_children = MSVSNew.MSVSFolder( - os.path.join(base_path, folder), - name="(" + folder + ")", - entries=folder_children, - ) - children.append(folder_children) - else: - children.append(contents) - return children - - -def _CollapseSingles(parent, node): - # Recursively explorer the tree of dicts looking for projects which are - # the sole item in a folder which has the same name as the project. Bring - # such projects up one level. - if type(node) == dict and len(node) == 1 and next(iter(node)) == parent + ".vcproj": - return node[next(iter(node))] - if type(node) != dict: - return node - for child in node: - node[child] = _CollapseSingles(child, node[child]) - return node - - -def _GatherSolutionFolders(sln_projects, project_objects, flat): - root = {} - # Convert into a tree of dicts on path. - for p in sln_projects: - gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2] - if p.endswith("#host"): - target += "_host" - gyp_dir = os.path.dirname(gyp_file) - path_dict = _GetPathDict(root, gyp_dir) - path_dict[target + ".vcproj"] = project_objects[p] - # Walk down from the top until we hit a folder that has more than one entry. - # In practice, this strips the top-level "src/" dir from the hierarchy in - # the solution. - while len(root) == 1 and type(root[next(iter(root))]) == dict: - root = root[next(iter(root))] - # Collapse singles. - root = _CollapseSingles("", root) - # Merge buckets until everything is a root entry. - return _DictsToFolders("", root, flat) - - -def _GetPathOfProject(qualified_target, spec, options, msvs_version): - default_config = _GetDefaultConfiguration(spec) - proj_filename = default_config.get("msvs_existing_vcproj") - if not proj_filename: - proj_filename = spec["target_name"] - if spec["toolset"] == "host": - proj_filename += "_host" - proj_filename = proj_filename + options.suffix + msvs_version.ProjectExtension() - - build_file = gyp.common.BuildFile(qualified_target) - proj_path = os.path.join(os.path.dirname(build_file), proj_filename) - fix_prefix = None - if options.generator_output: - project_dir_path = os.path.dirname(os.path.abspath(proj_path)) - proj_path = os.path.join(options.generator_output, proj_path) - fix_prefix = gyp.common.RelativePath( - project_dir_path, os.path.dirname(proj_path) - ) - return proj_path, fix_prefix - - -def _GetPlatformOverridesOfProject(spec): - # Prepare a dict indicating which project configurations are used for which - # solution configurations for this target. - config_platform_overrides = {} - for config_name, c in spec["configurations"].items(): - config_fullname = _ConfigFullName(config_name, c) - platform = c.get("msvs_target_platform", _ConfigPlatform(c)) - fixed_config_fullname = "{}|{}".format( - _ConfigBaseName(config_name, _ConfigPlatform(c)), - platform, - ) - if spec["toolset"] == "host" and generator_supports_multiple_toolsets: - fixed_config_fullname = f"{config_name}|x64" - config_platform_overrides[config_fullname] = fixed_config_fullname - return config_platform_overrides - - -def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): - """Create a MSVSProject object for the targets found in target list. - - Arguments: - target_list: the list of targets to generate project objects for. - target_dicts: the dictionary of specifications. - options: global generator options. - msvs_version: the MSVSVersion object. - Returns: - A set of created projects, keyed by target. - """ - global fixpath_prefix - # Generate each project. - projects = {} - for qualified_target in target_list: - spec = target_dicts[qualified_target] - proj_path, fixpath_prefix = _GetPathOfProject( - qualified_target, spec, options, msvs_version - ) - guid = _GetGuidOfProject(proj_path, spec) - overrides = _GetPlatformOverridesOfProject(spec) - build_file = gyp.common.BuildFile(qualified_target) - # Create object for this project. - target_name = spec["target_name"] - if spec["toolset"] == "host": - target_name += "_host" - obj = MSVSNew.MSVSProject( - proj_path, - name=target_name, - guid=guid, - spec=spec, - build_file=build_file, - config_platform_overrides=overrides, - fixpath_prefix=fixpath_prefix, - ) - # Set project toolset if any (MS build only) - if msvs_version.UsesVcxproj(): - obj.set_msbuild_toolset( - _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version) - ) - projects[qualified_target] = obj - # Set all the dependencies, but not if we are using an external builder like - # ninja - for project in projects.values(): - if not project.spec.get("msvs_external_builder"): - deps = project.spec.get("dependencies", []) - deps = [projects[d] for d in deps] - project.set_dependencies(deps) - return projects - - -def _InitNinjaFlavor(params, target_list, target_dicts): - """Initialize targets for the ninja flavor. - - This sets up the necessary variables in the targets to generate msvs projects - that use ninja as an external builder. The variables in the spec are only set - if they have not been set. This allows individual specs to override the - default values initialized here. - Arguments: - params: Params provided to the generator. - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - """ - for qualified_target in target_list: - spec = target_dicts[qualified_target] - if spec.get("msvs_external_builder"): - # The spec explicitly defined an external builder, so don't change it. - continue - - path_to_ninja = spec.get("msvs_path_to_ninja", "ninja.exe") - - spec["msvs_external_builder"] = "ninja" - if not spec.get("msvs_external_builder_out_dir"): - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - gyp_dir = os.path.dirname(gyp_file) - configuration = "$(Configuration)" - if params.get("target_arch") == "x64": - configuration += "_x64" - if params.get("target_arch") == "arm64": - configuration += "_arm64" - spec["msvs_external_builder_out_dir"] = os.path.join( - gyp.common.RelativePath(params["options"].toplevel_dir, gyp_dir), - ninja_generator.ComputeOutputDir(params), - configuration, - ) - if not spec.get("msvs_external_builder_build_cmd"): - spec["msvs_external_builder_build_cmd"] = [ - path_to_ninja, - "-C", - "$(OutDir)", - "$(ProjectName)", - ] - if not spec.get("msvs_external_builder_clean_cmd"): - spec["msvs_external_builder_clean_cmd"] = [ - path_to_ninja, - "-C", - "$(OutDir)", - "-tclean", - "$(ProjectName)", - ] - - -def CalculateVariables(default_variables, params): - """Generated variables that require params to be known.""" - - generator_flags = params.get("generator_flags", {}) - - # Select project file format version (if unset, default to auto detecting). - msvs_version = MSVSVersion.SelectVisualStudioVersion( - generator_flags.get("msvs_version", "auto") - ) - # Stash msvs_version for later (so we don't have to probe the system twice). - params["msvs_version"] = msvs_version - - # Set a variable so conditions can be based on msvs_version. - default_variables["MSVS_VERSION"] = msvs_version.ShortName() - - # To determine processor word size on Windows, in addition to checking - # PROCESSOR_ARCHITECTURE (which reflects the word size of the current - # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which - # contains the actual word size of the system when running thru WOW64). - if ( - os.environ.get("PROCESSOR_ARCHITECTURE", "").find("64") >= 0 - or os.environ.get("PROCESSOR_ARCHITEW6432", "").find("64") >= 0 - ): - default_variables["MSVS_OS_BITS"] = 64 - else: - default_variables["MSVS_OS_BITS"] = 32 - - if gyp.common.GetFlavor(params) == "ninja": - default_variables["SHARED_INTERMEDIATE_DIR"] = "$(OutDir)gen" - - -def PerformBuild(data, configurations, params): - options = params["options"] - msvs_version = params["msvs_version"] - devenv = os.path.join(msvs_version.path, "Common7", "IDE", "devenv.com") - - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != ".gyp": - continue - sln_path = build_file_root + options.suffix + ".sln" - if options.generator_output: - sln_path = os.path.join(options.generator_output, sln_path) - - for config in configurations: - arguments = [devenv, sln_path, "/Build", config] - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def CalculateGeneratorInputInfo(params): - if params.get("flavor") == "ninja": - toplevel = params["options"].toplevel_dir - qualified_out_dir = os.path.normpath( - os.path.join( - toplevel, - ninja_generator.ComputeOutputDir(params), - "gypfiles-msvs-ninja", - ) - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def GenerateOutput(target_list, target_dicts, data, params): - """Generate .sln and .vcproj files. - - This is the entry point for this generator. - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - data: Dictionary containing per .gyp data. - """ - global fixpath_prefix - - options = params["options"] - - # Get the project file format version back out of where we stashed it in - # GeneratorCalculatedVariables. - msvs_version = params["msvs_version"] - - generator_flags = params.get("generator_flags", {}) - - # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT. - (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts) - - # Optionally use the large PDB workaround for targets marked with - # 'msvs_large_pdb': 1. - (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims( - target_list, target_dicts, generator_default_variables - ) - - # Optionally configure each spec to use ninja as the external builder. - if params.get("flavor") == "ninja": - _InitNinjaFlavor(params, target_list, target_dicts) - - # Prepare the set of configurations. - configs = set() - for qualified_target in target_list: - spec = target_dicts[qualified_target] - for config_name, config in spec["configurations"].items(): - config_name = _ConfigFullName(config_name, config) - configs.add(config_name) - if config_name == "Release|arm64": - configs.add("Release|x64") - configs = list(configs) - - # Figure out all the projects that will be generated and their guids - project_objects = _CreateProjectObjects( - target_list, target_dicts, options, msvs_version - ) - - # Generate each project. - missing_sources = [] - for project in project_objects.values(): - fixpath_prefix = project.fixpath_prefix - missing_sources.extend( - _GenerateProject(project, options, msvs_version, generator_flags, spec) - ) - fixpath_prefix = None - - for build_file in data: - # Validate build_file extension - target_only_configs = configs - if generator_supports_multiple_toolsets: - target_only_configs = [i for i in configs if i.endswith("arm64")] - if not build_file.endswith(".gyp"): - continue - sln_path = os.path.splitext(build_file)[0] + options.suffix + ".sln" - if options.generator_output: - sln_path = os.path.join(options.generator_output, sln_path) - # Get projects in the solution, and their dependents. - sln_projects = gyp.common.BuildFileTargets(target_list, build_file) - sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects) - # Create folder hierarchy. - root_entries = _GatherSolutionFolders( - sln_projects, project_objects, flat=msvs_version.FlatSolution() - ) - # Create solution. - sln = MSVSNew.MSVSSolution( - sln_path, - entries=root_entries, - variants=target_only_configs, - websiteProperties=False, - version=msvs_version, - ) - sln.Write() - - if missing_sources: - error_message = "Missing input files:\n" + "\n".join(set(missing_sources)) - if generator_flags.get("msvs_error_on_missing_sources", False): - raise GypError(error_message) - else: - print("Warning: " + error_message, file=sys.stdout) - - -def _GenerateMSBuildFiltersFile( - filters_path, - source_files, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, -): - """Generate the filters file. - - This file is used by Visual Studio to organize the presentation of source - files into folders. - - Arguments: - filters_path: The path of the file to be created. - source_files: The hierarchical structure of all the sources. - extension_to_rule_name: A dictionary mapping file extensions to rules. - """ - filter_group = [] - source_group = [] - _AppendFiltersForMSBuild( - "", - source_files, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - filter_group, - source_group, - ) - if filter_group: - content = [ - "Project", - { - "ToolsVersion": "4.0", - "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", - }, - ["ItemGroup"] + filter_group, - ["ItemGroup"] + source_group, - ] - easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True) - elif os.path.exists(filters_path): - # We don't need this filter anymore. Delete the old filter file. - os.unlink(filters_path) - - -def _AppendFiltersForMSBuild( - parent_filter_name, - sources, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - filter_group, - source_group, -): - """Creates the list of filters and sources to be added in the filter file. - - Args: - parent_filter_name: The name of the filter under which the sources are - found. - sources: The hierarchy of filters and sources to process. - extension_to_rule_name: A dictionary mapping file extensions to rules. - filter_group: The list to which filter entries will be appended. - source_group: The list to which source entries will be appended. - """ - for source in sources: - if isinstance(source, MSVSProject.Filter): - # We have a sub-filter. Create the name of that sub-filter. - if not parent_filter_name: - filter_name = source.name - else: - filter_name = f"{parent_filter_name}\\{source.name}" - # Add the filter to the group. - filter_group.append( - [ - "Filter", - {"Include": filter_name}, - ["UniqueIdentifier", MSVSNew.MakeGuid(source.name)], - ] - ) - # Recurse and add its dependents. - _AppendFiltersForMSBuild( - filter_name, - source.contents, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - filter_group, - source_group, - ) - else: - # It's a source. Create a source entry. - _, element = _MapFileToMsBuildSourceType( - source, rule_dependencies, extension_to_rule_name, platforms, toolset - ) - source_entry = [element, {"Include": source}] - # Specify the filter it is part of, if any. - if parent_filter_name: - source_entry.append(["Filter", parent_filter_name]) - source_group.append(source_entry) - - -def _MapFileToMsBuildSourceType( - source, rule_dependencies, extension_to_rule_name, platforms, toolset -): - """Returns the group and element type of the source file. - - Arguments: - source: The source file name. - extension_to_rule_name: A dictionary mapping file extensions to rules. - - Returns: - A pair of (group this file should be part of, the label of element) - """ - _, ext = os.path.splitext(source) - ext = ext.lower() - if ext in extension_to_rule_name: - group = "rule" - element = extension_to_rule_name[ext] - elif ext in [".cc", ".cpp", ".c", ".cxx", ".mm"]: - group = "compile" - element = "ClCompile" - elif ext in [".h", ".hxx"]: - group = "include" - element = "ClInclude" - elif ext == ".rc": - group = "resource" - element = "ResourceCompile" - elif ext in [".s", ".asm"]: - group = "masm" - element = "MASM" - if "arm64" in platforms and toolset == "target": - element = "MARMASM" - elif ext == ".idl": - group = "midl" - element = "Midl" - elif source in rule_dependencies: - group = "rule_dependency" - element = "CustomBuild" - else: - group = "none" - element = "None" - return (group, element) - - -def _GenerateRulesForMSBuild( - output_dir, - options, - spec, - sources, - excluded_sources, - props_files_of_rules, - targets_files_of_rules, - actions_to_add, - rule_dependencies, - extension_to_rule_name, -): - # MSBuild rules are implemented using three files: an XML file, a .targets - # file and a .props file. - # For more details see: - # https://devblogs.microsoft.com/cppblog/quick-help-on-vs2010-custom-build-rule/ - rules = spec.get("rules", []) - rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] - rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] - - msbuild_rules = [] - for rule in rules_native: - # Skip a rule with no action and no inputs. - if "action" not in rule and not rule.get("rule_sources", []): - continue - msbuild_rule = MSBuildRule(rule, spec) - msbuild_rules.append(msbuild_rule) - rule_dependencies.update(msbuild_rule.additional_dependencies.split(";")) - extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name - if msbuild_rules: - base = spec["target_name"] + options.suffix - props_name = base + ".props" - targets_name = base + ".targets" - xml_name = base + ".xml" - - props_files_of_rules.add(props_name) - targets_files_of_rules.add(targets_name) - - props_path = os.path.join(output_dir, props_name) - targets_path = os.path.join(output_dir, targets_name) - xml_path = os.path.join(output_dir, xml_name) - - _GenerateMSBuildRulePropsFile(props_path, msbuild_rules) - _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules) - _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules) - - if rules_external: - _GenerateExternalRules( - rules_external, output_dir, spec, sources, options, actions_to_add - ) - _AdjustSourcesForRules(rules, sources, excluded_sources, True) - - -class MSBuildRule: - """Used to store information used to generate an MSBuild rule. - - Attributes: - rule_name: The rule name, sanitized to use in XML. - target_name: The name of the target. - after_targets: The name of the AfterTargets element. - before_targets: The name of the BeforeTargets element. - depends_on: The name of the DependsOn element. - compute_output: The name of the ComputeOutput element. - dirs_to_make: The name of the DirsToMake element. - inputs: The name of the _inputs element. - tlog: The name of the _tlog element. - extension: The extension this rule applies to. - description: The message displayed when this rule is invoked. - additional_dependencies: A string listing additional dependencies. - outputs: The outputs of this rule. - command: The command used to run the rule. - """ - - def __init__(self, rule, spec): - self.display_name = rule["rule_name"] - # Assure that the rule name is only characters and numbers - self.rule_name = re.sub(r"\W", "_", self.display_name) - # Create the various element names, following the example set by the - # Visual Studio 2008 to 2010 conversion. I don't know if VS2010 - # is sensitive to the exact names. - self.target_name = "_" + self.rule_name - self.after_targets = self.rule_name + "AfterTargets" - self.before_targets = self.rule_name + "BeforeTargets" - self.depends_on = self.rule_name + "DependsOn" - self.compute_output = "Compute%sOutput" % self.rule_name - self.dirs_to_make = self.rule_name + "DirsToMake" - self.inputs = self.rule_name + "_inputs" - self.tlog = self.rule_name + "_tlog" - self.extension = rule["extension"] - if not self.extension.startswith("."): - self.extension = "." + self.extension - - self.description = MSVSSettings.ConvertVCMacrosToMSBuild( - rule.get("message", self.rule_name) - ) - old_additional_dependencies = _FixPaths(rule.get("inputs", [])) - self.additional_dependencies = ";".join( - [ - MSVSSettings.ConvertVCMacrosToMSBuild(i) - for i in old_additional_dependencies - ] - ) - old_outputs = _FixPaths(rule.get("outputs", [])) - self.outputs = ";".join( - [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_outputs] - ) - old_command = _BuildCommandLineForRule( - spec, rule, has_input_path=True, do_setup_env=True - ) - self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command) - - -def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules): - """Generate the .props file.""" - content = [ - "Project", - {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, - ] - for rule in msbuild_rules: - content.extend( - [ - [ - "PropertyGroup", - { - "Condition": "'$(%s)' == '' and '$(%s)' == '' and " - "'$(ConfigurationType)' != 'Makefile'" - % (rule.before_targets, rule.after_targets) - }, - [rule.before_targets, "Midl"], - [rule.after_targets, "CustomBuild"], - ], - [ - "PropertyGroup", - [ - rule.depends_on, - {"Condition": "'$(ConfigurationType)' != 'Makefile'"}, - "_SelectedFiles;$(%s)" % rule.depends_on, - ], - ], - [ - "ItemDefinitionGroup", - [ - rule.rule_name, - ["CommandLineTemplate", rule.command], - ["Outputs", rule.outputs], - ["ExecutionDescription", rule.description], - ["AdditionalDependencies", rule.additional_dependencies], - ], - ], - ] - ) - easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) - - -def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): - """Generate the .targets file.""" - content = [ - "Project", - {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, - ] - item_group = [ - "ItemGroup", - [ - "PropertyPageSchema", - {"Include": "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"}, - ], - ] - for rule in msbuild_rules: - item_group.append( - [ - "AvailableItemName", - {"Include": rule.rule_name}, - ["Targets", rule.target_name], - ] - ) - content.append(item_group) - - for rule in msbuild_rules: - content.append( - [ - "UsingTask", - { - "TaskName": rule.rule_name, - "TaskFactory": "XamlTaskFactory", - "AssemblyName": "Microsoft.Build.Tasks.v4.0", - }, - ["Task", "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"], - ] - ) - for rule in msbuild_rules: - rule_name = rule.rule_name - target_outputs = "%%(%s.Outputs)" % rule_name - target_inputs = ( - "%%(%s.Identity);%%(%s.AdditionalDependencies);" "$(MSBuildProjectFile)" - ) % (rule_name, rule_name) - rule_inputs = "%%(%s.Identity)" % rule_name - extension_condition = ( - "'%(Extension)'=='.obj' or " - "'%(Extension)'=='.res' or " - "'%(Extension)'=='.rsc' or " - "'%(Extension)'=='.lib'" - ) - remove_section = [ - "ItemGroup", - {"Condition": "'@(SelectedFiles)' != ''"}, - [ - rule_name, - { - "Remove": "@(%s)" % rule_name, - "Condition": "'%(Identity)' != '@(SelectedFiles)'", - }, - ], - ] - inputs_section = [ - "ItemGroup", - [rule.inputs, {"Include": "%%(%s.AdditionalDependencies)" % rule_name}], - ] - logging_section = [ - "ItemGroup", - [ - rule.tlog, - { - "Include": "%%(%s.Outputs)" % rule_name, - "Condition": ( - "'%%(%s.Outputs)' != '' and " - "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name) - ), - }, - ["Source", "@(%s, '|')" % rule_name], - ["Inputs", "@(%s -> '%%(Fullpath)', ';')" % rule.inputs], - ], - ] - message_section = [ - "Message", - {"Importance": "High", "Text": "%%(%s.ExecutionDescription)" % rule_name}, - ] - write_tlog_section = [ - "WriteLinesToFile", - { - "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule.tlog, rule.tlog), - "File": "$(IntDir)$(ProjectName).write.1.tlog", - "Lines": "^%%(%s.Source);@(%s->'%%(Fullpath)')" - % (rule.tlog, rule.tlog), - }, - ] - read_tlog_section = [ - "WriteLinesToFile", - { - "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule.tlog, rule.tlog), - "File": "$(IntDir)$(ProjectName).read.1.tlog", - "Lines": f"^%({rule.tlog}.Source);%({rule.tlog}.Inputs)", - }, - ] - command_and_input_section = [ - rule_name, - { - "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule_name, rule_name), - "EchoOff": "true", - "StandardOutputImportance": "High", - "StandardErrorImportance": "High", - "CommandLineTemplate": "%%(%s.CommandLineTemplate)" % rule_name, - "AdditionalOptions": "%%(%s.AdditionalOptions)" % rule_name, - "Inputs": rule_inputs, - }, - ] - content.extend( - [ - [ - "Target", - { - "Name": rule.target_name, - "BeforeTargets": "$(%s)" % rule.before_targets, - "AfterTargets": "$(%s)" % rule.after_targets, - "Condition": "'@(%s)' != ''" % rule_name, - "DependsOnTargets": "$(%s);%s" - % (rule.depends_on, rule.compute_output), - "Outputs": target_outputs, - "Inputs": target_inputs, - }, - remove_section, - inputs_section, - logging_section, - message_section, - write_tlog_section, - read_tlog_section, - command_and_input_section, - ], - [ - "PropertyGroup", - [ - "ComputeLinkInputsTargets", - "$(ComputeLinkInputsTargets);", - "%s;" % rule.compute_output, - ], - [ - "ComputeLibInputsTargets", - "$(ComputeLibInputsTargets);", - "%s;" % rule.compute_output, - ], - ], - [ - "Target", - { - "Name": rule.compute_output, - "Condition": "'@(%s)' != ''" % rule_name, - }, - [ - "ItemGroup", - [ - rule.dirs_to_make, - { - "Condition": "'@(%s)' != '' and " - "'%%(%s.ExcludedFromBuild)' != 'true'" - % (rule_name, rule_name), - "Include": "%%(%s.Outputs)" % rule_name, - }, - ], - [ - "Link", - { - "Include": "%%(%s.Identity)" % rule.dirs_to_make, - "Condition": extension_condition, - }, - ], - [ - "Lib", - { - "Include": "%%(%s.Identity)" % rule.dirs_to_make, - "Condition": extension_condition, - }, - ], - [ - "ImpLib", - { - "Include": "%%(%s.Identity)" % rule.dirs_to_make, - "Condition": extension_condition, - }, - ], - ], - [ - "MakeDir", - { - "Directories": ( - "@(%s->'%%(RootDir)%%(Directory)')" % rule.dirs_to_make - ) - }, - ], - ], - ] - ) - easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True) - - -def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules): - # Generate the .xml file - content = [ - "ProjectSchemaDefinitions", - { - "xmlns": ( - "clr-namespace:Microsoft.Build.Framework.XamlTypes;" - "assembly=Microsoft.Build.Framework" - ), - "xmlns:x": "http://schemas.microsoft.com/winfx/2006/xaml", - "xmlns:sys": "clr-namespace:System;assembly=mscorlib", - "xmlns:transformCallback": "Microsoft.Cpp.Dev10.ConvertPropertyCallback", - }, - ] - for rule in msbuild_rules: - content.extend( - [ - [ - "Rule", - { - "Name": rule.rule_name, - "PageTemplate": "tool", - "DisplayName": rule.display_name, - "Order": "200", - }, - [ - "Rule.DataSource", - [ - "DataSource", - {"Persistence": "ProjectFile", "ItemType": rule.rule_name}, - ], - ], - [ - "Rule.Categories", - [ - "Category", - {"Name": "General"}, - ["Category.DisplayName", ["sys:String", "General"]], - ], - [ - "Category", - {"Name": "Command Line", "Subtype": "CommandLine"}, - ["Category.DisplayName", ["sys:String", "Command Line"]], - ], - ], - [ - "StringListProperty", - { - "Name": "Inputs", - "Category": "Command Line", - "IsRequired": "true", - "Switch": " ", - }, - [ - "StringListProperty.DataSource", - [ - "DataSource", - { - "Persistence": "ProjectFile", - "ItemType": rule.rule_name, - "SourceType": "Item", - }, - ], - ], - ], - [ - "StringProperty", - { - "Name": "CommandLineTemplate", - "DisplayName": "Command Line", - "Visible": "False", - "IncludeInCommandLine": "False", - }, - ], - [ - "DynamicEnumProperty", - { - "Name": rule.before_targets, - "Category": "General", - "EnumProvider": "Targets", - "IncludeInCommandLine": "False", - }, - [ - "DynamicEnumProperty.DisplayName", - ["sys:String", "Execute Before"], - ], - [ - "DynamicEnumProperty.Description", - [ - "sys:String", - "Specifies the targets for the build customization" - " to run before.", - ], - ], - [ - "DynamicEnumProperty.ProviderSettings", - [ - "NameValuePair", - { - "Name": "Exclude", - "Value": "^%s|^Compute" % rule.before_targets, - }, - ], - ], - [ - "DynamicEnumProperty.DataSource", - [ - "DataSource", - { - "Persistence": "ProjectFile", - "HasConfigurationCondition": "true", - }, - ], - ], - ], - [ - "DynamicEnumProperty", - { - "Name": rule.after_targets, - "Category": "General", - "EnumProvider": "Targets", - "IncludeInCommandLine": "False", - }, - [ - "DynamicEnumProperty.DisplayName", - ["sys:String", "Execute After"], - ], - [ - "DynamicEnumProperty.Description", - [ - "sys:String", - ( - "Specifies the targets for the build customization" - " to run after." - ), - ], - ], - [ - "DynamicEnumProperty.ProviderSettings", - [ - "NameValuePair", - { - "Name": "Exclude", - "Value": "^%s|^Compute" % rule.after_targets, - }, - ], - ], - [ - "DynamicEnumProperty.DataSource", - [ - "DataSource", - { - "Persistence": "ProjectFile", - "ItemType": "", - "HasConfigurationCondition": "true", - }, - ], - ], - ], - [ - "StringListProperty", - { - "Name": "Outputs", - "DisplayName": "Outputs", - "Visible": "False", - "IncludeInCommandLine": "False", - }, - ], - [ - "StringProperty", - { - "Name": "ExecutionDescription", - "DisplayName": "Execution Description", - "Visible": "False", - "IncludeInCommandLine": "False", - }, - ], - [ - "StringListProperty", - { - "Name": "AdditionalDependencies", - "DisplayName": "Additional Dependencies", - "IncludeInCommandLine": "False", - "Visible": "false", - }, - ], - [ - "StringProperty", - { - "Subtype": "AdditionalOptions", - "Name": "AdditionalOptions", - "Category": "Command Line", - }, - [ - "StringProperty.DisplayName", - ["sys:String", "Additional Options"], - ], - [ - "StringProperty.Description", - ["sys:String", "Additional Options"], - ], - ], - ], - [ - "ItemType", - {"Name": rule.rule_name, "DisplayName": rule.display_name}, - ], - [ - "FileExtension", - {"Name": "*" + rule.extension, "ContentType": rule.rule_name}, - ], - [ - "ContentType", - { - "Name": rule.rule_name, - "DisplayName": "", - "ItemType": rule.rule_name, - }, - ], - ] - ) - easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True) - - -def _GetConfigurationAndPlatform(name, settings, spec): - configuration = name.rsplit("_", 1)[0] - platform = settings.get("msvs_configuration_platform", "Win32") - if spec["toolset"] == "host" and platform == "arm64": - platform = "x64" # Host-only tools are always built for x64 - return (configuration, platform) - - -def _GetConfigurationCondition(name, settings, spec): - return r"'$(Configuration)|$(Platform)'=='%s|%s'" % _GetConfigurationAndPlatform( - name, settings, spec - ) - - -def _GetMSBuildProjectConfigurations(configurations, spec): - group = ["ItemGroup", {"Label": "ProjectConfigurations"}] - for (name, settings) in sorted(configurations.items()): - configuration, platform = _GetConfigurationAndPlatform(name, settings, spec) - designation = f"{configuration}|{platform}" - group.append( - [ - "ProjectConfiguration", - {"Include": designation}, - ["Configuration", configuration], - ["Platform", platform], - ] - ) - return [group] - - -def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name): - namespace = os.path.splitext(gyp_file_name)[0] - properties = [ - [ - "PropertyGroup", - {"Label": "Globals"}, - ["ProjectGuid", guid], - ["Keyword", "Win32Proj"], - ["RootNamespace", namespace], - ["IgnoreWarnCompileDuplicatedFilename", "true"], - ] - ] - - if ( - os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" - or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" - ): - properties[0].append(["PreferredToolArchitecture", "x64"]) - - if spec.get("msvs_target_platform_version"): - target_platform_version = spec.get("msvs_target_platform_version") - properties[0].append(["WindowsTargetPlatformVersion", target_platform_version]) - if spec.get("msvs_target_platform_minversion"): - target_platform_minversion = spec.get("msvs_target_platform_minversion") - properties[0].append( - ["WindowsTargetPlatformMinVersion", target_platform_minversion] - ) - else: - properties[0].append( - ["WindowsTargetPlatformMinVersion", target_platform_version] - ) - - if spec.get("msvs_enable_winrt"): - properties[0].append(["DefaultLanguage", "en-US"]) - properties[0].append(["AppContainerApplication", "true"]) - if spec.get("msvs_application_type_revision"): - app_type_revision = spec.get("msvs_application_type_revision") - properties[0].append(["ApplicationTypeRevision", app_type_revision]) - else: - properties[0].append(["ApplicationTypeRevision", "8.1"]) - if spec.get("msvs_enable_winphone"): - properties[0].append(["ApplicationType", "Windows Phone"]) - else: - properties[0].append(["ApplicationType", "Windows Store"]) - - platform_name = None - msvs_windows_sdk_version = None - for configuration in spec["configurations"].values(): - platform_name = platform_name or _ConfigPlatform(configuration) - msvs_windows_sdk_version = ( - msvs_windows_sdk_version - or _ConfigWindowsTargetPlatformVersion(configuration, version) - ) - if platform_name and msvs_windows_sdk_version: - break - if msvs_windows_sdk_version: - properties[0].append( - ["WindowsTargetPlatformVersion", str(msvs_windows_sdk_version)] - ) - elif version.compatible_sdks: - raise GypError( - "%s requires any SDK of %s version, but none were found" - % (version.description, version.compatible_sdks) - ) - - if platform_name == "ARM": - properties[0].append(["WindowsSDKDesktopARMSupport", "true"]) - - return properties - - -def _GetMSBuildConfigurationDetails(spec, build_file): - properties = {} - for name, settings in spec["configurations"].items(): - msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file) - condition = _GetConfigurationCondition(name, settings, spec) - character_set = msbuild_attributes.get("CharacterSet") - config_type = msbuild_attributes.get("ConfigurationType") - _AddConditionalProperty(properties, condition, "ConfigurationType", config_type) - if config_type == "Driver": - _AddConditionalProperty(properties, condition, "DriverType", "WDM") - _AddConditionalProperty( - properties, condition, "TargetVersion", _ConfigTargetVersion(settings) - ) - if character_set: - if "msvs_enable_winrt" not in spec: - _AddConditionalProperty( - properties, condition, "CharacterSet", character_set - ) - return _GetMSBuildPropertyGroup(spec, "Configuration", properties) - - -def _GetMSBuildLocalProperties(msbuild_toolset): - # Currently the only local property we support is PlatformToolset - properties = {} - if msbuild_toolset: - properties = [ - [ - "PropertyGroup", - {"Label": "Locals"}, - ["PlatformToolset", msbuild_toolset], - ] - ] - return properties - - -def _GetMSBuildPropertySheets(configurations, spec): - user_props = r"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" - additional_props = {} - props_specified = False - for name, settings in sorted(configurations.items()): - configuration = _GetConfigurationCondition(name, settings, spec) - if "msbuild_props" in settings: - additional_props[configuration] = _FixPaths(settings["msbuild_props"]) - props_specified = True - else: - additional_props[configuration] = "" - - if not props_specified: - return [ - [ - "ImportGroup", - {"Label": "PropertySheets"}, - [ - "Import", - { - "Project": user_props, - "Condition": "exists('%s')" % user_props, - "Label": "LocalAppDataPlatform", - }, - ], - ] - ] - else: - sheets = [] - for condition, props in additional_props.items(): - import_group = [ - "ImportGroup", - {"Label": "PropertySheets", "Condition": condition}, - [ - "Import", - { - "Project": user_props, - "Condition": "exists('%s')" % user_props, - "Label": "LocalAppDataPlatform", - }, - ], - ] - for props_file in props: - import_group.append(["Import", {"Project": props_file}]) - sheets.append(import_group) - return sheets - - -def _ConvertMSVSBuildAttributes(spec, config, build_file): - config_type = _GetMSVSConfigurationType(spec, build_file) - msvs_attributes = _GetMSVSAttributes(spec, config, config_type) - msbuild_attributes = {} - for a in msvs_attributes: - if a in ["IntermediateDirectory", "OutputDirectory"]: - directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a]) - if not directory.endswith("\\"): - directory += "\\" - msbuild_attributes[a] = directory - elif a == "CharacterSet": - msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a]) - elif a == "ConfigurationType": - msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a]) - else: - print("Warning: Do not know how to convert MSVS attribute " + a) - return msbuild_attributes - - -def _ConvertMSVSCharacterSet(char_set): - if char_set.isdigit(): - char_set = {"0": "MultiByte", "1": "Unicode", "2": "MultiByte"}[char_set] - return char_set - - -def _ConvertMSVSConfigurationType(config_type): - if config_type.isdigit(): - config_type = { - "1": "Application", - "2": "DynamicLibrary", - "4": "StaticLibrary", - "5": "Driver", - "10": "Utility", - }[config_type] - return config_type - - -def _GetMSBuildAttributes(spec, config, build_file): - if "msbuild_configuration_attributes" not in config: - msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file) - - else: - config_type = _GetMSVSConfigurationType(spec, build_file) - config_type = _ConvertMSVSConfigurationType(config_type) - msbuild_attributes = config.get("msbuild_configuration_attributes", {}) - msbuild_attributes.setdefault("ConfigurationType", config_type) - output_dir = msbuild_attributes.get( - "OutputDirectory", "$(SolutionDir)$(Configuration)" - ) - msbuild_attributes["OutputDirectory"] = _FixPath(output_dir) + "\\" - if "IntermediateDirectory" not in msbuild_attributes: - intermediate = _FixPath("$(Configuration)") + "\\" - msbuild_attributes["IntermediateDirectory"] = intermediate - if "CharacterSet" in msbuild_attributes: - msbuild_attributes["CharacterSet"] = _ConvertMSVSCharacterSet( - msbuild_attributes["CharacterSet"] - ) - if "TargetName" not in msbuild_attributes: - prefix = spec.get("product_prefix", "") - product_name = spec.get("product_name", "$(ProjectName)") - target_name = prefix + product_name - msbuild_attributes["TargetName"] = target_name - if "TargetExt" not in msbuild_attributes and "product_extension" in spec: - ext = spec.get("product_extension") - msbuild_attributes["TargetExt"] = "." + ext - - if spec.get("msvs_external_builder"): - external_out_dir = spec.get("msvs_external_builder_out_dir", ".") - msbuild_attributes["OutputDirectory"] = _FixPath(external_out_dir) + "\\" - - # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' - # (depending on the tool used) to avoid MSB8012 warning. - msbuild_tool_map = { - "executable": "Link", - "shared_library": "Link", - "loadable_module": "Link", - "windows_driver": "Link", - "static_library": "Lib", - } - msbuild_tool = msbuild_tool_map.get(spec["type"]) - if msbuild_tool: - msbuild_settings = config["finalized_msbuild_settings"] - out_file = msbuild_settings[msbuild_tool].get("OutputFile") - if out_file: - msbuild_attributes["TargetPath"] = _FixPath(out_file) - target_ext = msbuild_settings[msbuild_tool].get("TargetExt") - if target_ext: - msbuild_attributes["TargetExt"] = target_ext - - return msbuild_attributes - - -def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): - # TODO(jeanluc) We could optimize out the following and do it only if - # there are actions. - # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'. - new_paths = [] - cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."])[0] - if cygwin_dirs: - cyg_path = "$(MSBuildProjectDirectory)\\%s\\bin\\" % _FixPath(cygwin_dirs) - new_paths.append(cyg_path) - # TODO(jeanluc) Change the convention to have both a cygwin_dir and a - # python_dir. - python_path = cyg_path.replace("cygwin\\bin", "python_26") - new_paths.append(python_path) - if new_paths: - new_paths = "$(ExecutablePath);" + ";".join(new_paths) - - properties = {} - for (name, configuration) in sorted(configurations.items()): - condition = _GetConfigurationCondition(name, configuration, spec) - attributes = _GetMSBuildAttributes(spec, configuration, build_file) - msbuild_settings = configuration["finalized_msbuild_settings"] - _AddConditionalProperty( - properties, condition, "IntDir", attributes["IntermediateDirectory"] - ) - _AddConditionalProperty( - properties, condition, "OutDir", attributes["OutputDirectory"] - ) - _AddConditionalProperty( - properties, condition, "TargetName", attributes["TargetName"] - ) - if "TargetExt" in attributes: - _AddConditionalProperty( - properties, condition, "TargetExt", attributes["TargetExt"] - ) - - if attributes.get("TargetPath"): - _AddConditionalProperty( - properties, condition, "TargetPath", attributes["TargetPath"] - ) - if attributes.get("TargetExt"): - _AddConditionalProperty( - properties, condition, "TargetExt", attributes["TargetExt"] - ) - - if new_paths: - _AddConditionalProperty(properties, condition, "ExecutablePath", new_paths) - tool_settings = msbuild_settings.get("", {}) - for name, value in sorted(tool_settings.items()): - formatted_value = _GetValueFormattedForMSBuild("", name, value) - _AddConditionalProperty(properties, condition, name, formatted_value) - return _GetMSBuildPropertyGroup(spec, None, properties) - - -def _AddConditionalProperty(properties, condition, name, value): - """Adds a property / conditional value pair to a dictionary. - - Arguments: - properties: The dictionary to be modified. The key is the name of the - property. The value is itself a dictionary; its key is the value and - the value a list of condition for which this value is true. - condition: The condition under which the named property has the value. - name: The name of the property. - value: The value of the property. - """ - if name not in properties: - properties[name] = {} - values = properties[name] - if value not in values: - values[value] = [] - conditions = values[value] - conditions.append(condition) - - -# Regex for msvs variable references ( i.e. $(FOO) ). -MSVS_VARIABLE_REFERENCE = re.compile(r"\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)") - - -def _GetMSBuildPropertyGroup(spec, label, properties): - """Returns a PropertyGroup definition for the specified properties. - - Arguments: - spec: The target project dict. - label: An optional label for the PropertyGroup. - properties: The dictionary to be converted. The key is the name of the - property. The value is itself a dictionary; its key is the value and - the value a list of condition for which this value is true. - """ - group = ["PropertyGroup"] - if label: - group.append({"Label": label}) - num_configurations = len(spec["configurations"]) - - def GetEdges(node): - # Use a definition of edges such that user_of_variable -> used_varible. - # This happens to be easier in this case, since a variable's - # definition contains all variables it references in a single string. - edges = set() - for value in sorted(properties[node].keys()): - # Add to edges all $(...) references to variables. - # - # Variable references that refer to names not in properties are excluded - # These can exist for instance to refer built in definitions like - # $(SolutionDir). - # - # Self references are ignored. Self reference is used in a few places to - # append to the default value. I.e. PATH=$(PATH);other_path - edges.update( - { - v - for v in MSVS_VARIABLE_REFERENCE.findall(value) - if v in properties and v != node - } - ) - return edges - - properties_ordered = gyp.common.TopologicallySorted(properties.keys(), GetEdges) - # Walk properties in the reverse of a topological sort on - # user_of_variable -> used_variable as this ensures variables are - # defined before they are used. - # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) - for name in reversed(properties_ordered): - values = properties[name] - for value, conditions in sorted(values.items()): - if len(conditions) == num_configurations: - # If the value is the same all configurations, - # just add one unconditional entry. - group.append([name, value]) - else: - for condition in conditions: - group.append([name, {"Condition": condition}, value]) - return [group] - - -def _GetMSBuildToolSettingsSections(spec, configurations): - groups = [] - for (name, configuration) in sorted(configurations.items()): - msbuild_settings = configuration["finalized_msbuild_settings"] - group = [ - "ItemDefinitionGroup", - {"Condition": _GetConfigurationCondition(name, configuration, spec)}, - ] - for tool_name, tool_settings in sorted(msbuild_settings.items()): - # Skip the tool named '' which is a holder of global settings handled - # by _GetMSBuildConfigurationGlobalProperties. - if tool_name: - if tool_settings: - tool = [tool_name] - for name, value in sorted(tool_settings.items()): - formatted_value = _GetValueFormattedForMSBuild( - tool_name, name, value - ) - tool.append([name, formatted_value]) - group.append(tool) - groups.append(group) - return groups - - -def _FinalizeMSBuildSettings(spec, configuration): - if "msbuild_settings" in configuration: - converted = False - msbuild_settings = configuration["msbuild_settings"] - MSVSSettings.ValidateMSBuildSettings(msbuild_settings) - else: - converted = True - msvs_settings = configuration.get("msvs_settings", {}) - msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings) - include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs( - configuration - ) - libraries = _GetLibraries(spec) - library_dirs = _GetLibraryDirs(configuration) - out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True) - target_ext = _GetOutputTargetExt(spec) - defines = _GetDefines(configuration) - if converted: - # Visual Studio 2010 has TR1 - defines = [d for d in defines if d != "_HAS_TR1=0"] - # Warn of ignored settings - ignored_settings = ["msvs_tool_files"] - for ignored_setting in ignored_settings: - value = configuration.get(ignored_setting) - if value: - print( - "Warning: The automatic conversion to MSBuild does not handle " - "%s. Ignoring setting of %s" % (ignored_setting, str(value)) - ) - - defines = [_EscapeCppDefineForMSBuild(d) for d in defines] - disabled_warnings = _GetDisabledWarnings(configuration) - prebuild = configuration.get("msvs_prebuild") - postbuild = configuration.get("msvs_postbuild") - def_file = _GetModuleDefinition(spec) - precompiled_header = configuration.get("msvs_precompiled_header") - - # Add the information to the appropriate tool - # TODO(jeanluc) We could optimize and generate these settings only if - # the corresponding files are found, e.g. don't generate ResourceCompile - # if you don't have any resources. - _ToolAppend( - msbuild_settings, "ClCompile", "AdditionalIncludeDirectories", include_dirs - ) - _ToolAppend( - msbuild_settings, "Midl", "AdditionalIncludeDirectories", midl_include_dirs - ) - _ToolAppend( - msbuild_settings, - "ResourceCompile", - "AdditionalIncludeDirectories", - resource_include_dirs, - ) - # Add in libraries, note that even for empty libraries, we want this - # set, to prevent inheriting default libraries from the environment. - _ToolSetOrAppend(msbuild_settings, "Link", "AdditionalDependencies", libraries) - _ToolAppend(msbuild_settings, "Link", "AdditionalLibraryDirectories", library_dirs) - if out_file: - _ToolAppend( - msbuild_settings, msbuild_tool, "OutputFile", out_file, only_if_unset=True - ) - if target_ext: - _ToolAppend( - msbuild_settings, msbuild_tool, "TargetExt", target_ext, only_if_unset=True - ) - # Add defines. - _ToolAppend(msbuild_settings, "ClCompile", "PreprocessorDefinitions", defines) - _ToolAppend(msbuild_settings, "ResourceCompile", "PreprocessorDefinitions", defines) - # Add disabled warnings. - _ToolAppend( - msbuild_settings, "ClCompile", "DisableSpecificWarnings", disabled_warnings - ) - # Turn on precompiled headers if appropriate. - if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] - _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use") - _ToolAppend( - msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header - ) - _ToolAppend( - msbuild_settings, "ClCompile", "ForcedIncludeFiles", [precompiled_header] - ) - else: - _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "NotUsing") - # Turn off WinRT compilation - _ToolAppend(msbuild_settings, "ClCompile", "CompileAsWinRT", "false") - # Turn on import libraries if appropriate - if spec.get("msvs_requires_importlibrary"): - _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "false") - # Loadable modules don't generate import libraries; - # tell dependent projects to not expect one. - if spec["type"] == "loadable_module": - _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "true") - # Set the module definition file if any. - if def_file: - _ToolAppend(msbuild_settings, "Link", "ModuleDefinitionFile", def_file) - configuration["finalized_msbuild_settings"] = msbuild_settings - if prebuild: - _ToolAppend(msbuild_settings, "PreBuildEvent", "Command", prebuild) - if postbuild: - _ToolAppend(msbuild_settings, "PostBuildEvent", "Command", postbuild) - - -def _GetValueFormattedForMSBuild(tool_name, name, value): - if type(value) == list: - # For some settings, VS2010 does not automatically extends the settings - # TODO(jeanluc) Is this what we want? - if name in [ - "AdditionalIncludeDirectories", - "AdditionalLibraryDirectories", - "AdditionalOptions", - "DelayLoadDLLs", - "DisableSpecificWarnings", - "PreprocessorDefinitions", - ]: - value.append("%%(%s)" % name) - # For most tools, entries in a list should be separated with ';' but some - # settings use a space. Check for those first. - exceptions = { - "ClCompile": ["AdditionalOptions"], - "Link": ["AdditionalOptions"], - "Lib": ["AdditionalOptions"], - } - if tool_name in exceptions and name in exceptions[tool_name]: - char = " " - else: - char = ";" - formatted_value = char.join( - [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value] - ) - else: - formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) - return formatted_value - - -def _VerifySourcesExist(sources, root_dir): - """Verifies that all source files exist on disk. - - Checks that all regular source files, i.e. not created at run time, - exist on disk. Missing files cause needless recompilation but no otherwise - visible errors. - - Arguments: - sources: A recursive list of Filter/file names. - root_dir: The root directory for the relative path names. - Returns: - A list of source files that cannot be found on disk. - """ - missing_sources = [] - for source in sources: - if isinstance(source, MSVSProject.Filter): - missing_sources.extend(_VerifySourcesExist(source.contents, root_dir)) - else: - if "$" not in source: - full_path = os.path.join(root_dir, source) - if not os.path.exists(full_path): - missing_sources.append(full_path) - return missing_sources - - -def _GetMSBuildSources( - spec, - sources, - exclusions, - rule_dependencies, - extension_to_rule_name, - actions_spec, - sources_handled_by_action, - list_excluded, -): - groups = [ - "none", - "masm", - "midl", - "include", - "compile", - "resource", - "rule", - "rule_dependency", - ] - grouped_sources = {} - for g in groups: - grouped_sources[g] = [] - - _AddSources2( - spec, - sources, - exclusions, - grouped_sources, - rule_dependencies, - extension_to_rule_name, - sources_handled_by_action, - list_excluded, - ) - sources = [] - for g in groups: - if grouped_sources[g]: - sources.append(["ItemGroup"] + grouped_sources[g]) - if actions_spec: - sources.append(["ItemGroup"] + actions_spec) - return sources - - -def _AddSources2( - spec, - sources, - exclusions, - grouped_sources, - rule_dependencies, - extension_to_rule_name, - sources_handled_by_action, - list_excluded, -): - extensions_excluded_from_precompile = [] - for source in sources: - if isinstance(source, MSVSProject.Filter): - _AddSources2( - spec, - source.contents, - exclusions, - grouped_sources, - rule_dependencies, - extension_to_rule_name, - sources_handled_by_action, - list_excluded, - ) - else: - if source not in sources_handled_by_action: - detail = [] - excluded_configurations = exclusions.get(source, []) - if len(excluded_configurations) == len(spec["configurations"]): - detail.append(["ExcludedFromBuild", "true"]) - else: - for config_name, configuration in sorted(excluded_configurations): - condition = _GetConfigurationCondition( - config_name, configuration - ) - detail.append( - ["ExcludedFromBuild", {"Condition": condition}, "true"] - ) - # Add precompile if needed - for config_name, configuration in spec["configurations"].items(): - precompiled_source = configuration.get( - "msvs_precompiled_source", "" - ) - if precompiled_source != "": - precompiled_source = _FixPath(precompiled_source) - if not extensions_excluded_from_precompile: - # If the precompiled header is generated by a C source, - # we must not try to use it for C++ sources, - # and vice versa. - basename, extension = os.path.splitext(precompiled_source) - if extension == ".c": - extensions_excluded_from_precompile = [ - ".cc", - ".cpp", - ".cxx", - ] - else: - extensions_excluded_from_precompile = [".c"] - - if precompiled_source == source: - condition = _GetConfigurationCondition( - config_name, configuration, spec - ) - detail.append( - ["PrecompiledHeader", {"Condition": condition}, "Create"] - ) - else: - # Turn off precompiled header usage for source files of a - # different type than the file that generated the - # precompiled header. - for extension in extensions_excluded_from_precompile: - if source.endswith(extension): - detail.append(["PrecompiledHeader", ""]) - detail.append(["ForcedIncludeFiles", ""]) - - group, element = _MapFileToMsBuildSourceType( - source, - rule_dependencies, - extension_to_rule_name, - _GetUniquePlatforms(spec), - spec["toolset"], - ) - if group == "compile" and not os.path.isabs(source): - # Add an value to support duplicate source - # file basenames, except for absolute paths to avoid paths - # with more than 260 characters. - file_name = os.path.splitext(source)[0] + ".obj" - if file_name.startswith("..\\"): - file_name = re.sub(r"^(\.\.\\)+", "", file_name) - elif file_name.startswith("$("): - file_name = re.sub(r"^\$\([^)]+\)\\", "", file_name) - detail.append(["ObjectFileName", "$(IntDir)\\" + file_name]) - grouped_sources[group].append([element, {"Include": source}] + detail) - - -def _GetMSBuildProjectReferences(project): - references = [] - if project.dependencies: - group = ["ItemGroup"] - added_dependency_set = set() - for dependency in project.dependencies: - dependency_spec = dependency.spec - should_skip_dep = False - if project.spec["toolset"] == "target": - if dependency_spec["toolset"] == "host": - if dependency_spec["type"] == "static_library": - should_skip_dep = True - if dependency.name.startswith("run_"): - should_skip_dep = False - if should_skip_dep: - continue - - canonical_name = dependency.name.replace("_host", "") - added_dependency_set.add(canonical_name) - guid = dependency.guid - project_dir = os.path.split(project.path)[0] - relative_path = gyp.common.RelativePath(dependency.path, project_dir) - project_ref = [ - "ProjectReference", - {"Include": relative_path}, - ["Project", guid], - ["ReferenceOutputAssembly", "false"], - ] - for config in dependency.spec.get("configurations", {}).values(): - if config.get("msvs_use_library_dependency_inputs", 0): - project_ref.append(["UseLibraryDependencyInputs", "true"]) - break - # If it's disabled in any config, turn it off in the reference. - if config.get("msvs_2010_disable_uldi_when_referenced", 0): - project_ref.append(["UseLibraryDependencyInputs", "false"]) - break - group.append(project_ref) - references.append(group) - return references - - -def _GenerateMSBuildProject(project, options, version, generator_flags, spec): - spec = project.spec - configurations = spec["configurations"] - toolset = spec["toolset"] - project_dir, project_file_name = os.path.split(project.path) - gyp.common.EnsureDirExists(project.path) - # Prepare list of sources and excluded sources. - - gyp_file = os.path.split(project.build_file)[1] - sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) - # Add rules. - actions_to_add = {} - props_files_of_rules = set() - targets_files_of_rules = set() - rule_dependencies = set() - extension_to_rule_name = {} - list_excluded = generator_flags.get("msvs_list_excluded_files", True) - platforms = _GetUniquePlatforms(spec) - - # Don't generate rules if we are using an external builder like ninja. - if not spec.get("msvs_external_builder"): - _GenerateRulesForMSBuild( - project_dir, - options, - spec, - sources, - excluded_sources, - props_files_of_rules, - targets_files_of_rules, - actions_to_add, - rule_dependencies, - extension_to_rule_name, - ) - else: - rules = spec.get("rules", []) - _AdjustSourcesForRules(rules, sources, excluded_sources, True) - - sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, project_dir, sources, excluded_sources, list_excluded, version - ) - - # Don't add actions if we are using an external builder like ninja. - if not spec.get("msvs_external_builder"): - _AddActions(actions_to_add, spec, project.build_file) - _AddCopies(actions_to_add, spec) - - # NOTE: this stanza must appear after all actions have been decided. - # Don't excluded sources with actions attached, or they won't run. - excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) - - exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) - actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild( - spec, actions_to_add - ) - - _GenerateMSBuildFiltersFile( - project.path + ".filters", - sources, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - ) - missing_sources = _VerifySourcesExist(sources, project_dir) - - for configuration in configurations.values(): - _FinalizeMSBuildSettings(spec, configuration) - - # Add attributes to root element - - import_default_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.Default.props"}] - ] - import_cpp_props_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.props"}] - ] - import_cpp_targets_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.targets"}] - ] - import_masm_props_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.props"}] - ] - import_masm_targets_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.targets"}] - ] - import_marmasm_props_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.props"}] - ] - import_marmasm_targets_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.targets"}] - ] - macro_section = [["PropertyGroup", {"Label": "UserMacros"}]] - - content = [ - "Project", - { - "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", - "ToolsVersion": version.ProjectVersion(), - "DefaultTargets": "Build", - }, - ] - - content += _GetMSBuildProjectConfigurations(configurations, spec) - content += _GetMSBuildGlobalProperties( - spec, version, project.guid, project_file_name - ) - content += import_default_section - content += _GetMSBuildConfigurationDetails(spec, project.build_file) - if spec.get("msvs_enable_winphone"): - content += _GetMSBuildLocalProperties("v120_wp81") - else: - content += _GetMSBuildLocalProperties(project.msbuild_toolset) - content += import_cpp_props_section - content += import_masm_props_section - if "arm64" in platforms and toolset == "target": - content += import_marmasm_props_section - content += _GetMSBuildExtensions(props_files_of_rules) - content += _GetMSBuildPropertySheets(configurations, spec) - content += macro_section - content += _GetMSBuildConfigurationGlobalProperties( - spec, configurations, project.build_file - ) - content += _GetMSBuildToolSettingsSections(spec, configurations) - content += _GetMSBuildSources( - spec, - sources, - exclusions, - rule_dependencies, - extension_to_rule_name, - actions_spec, - sources_handled_by_action, - list_excluded, - ) - content += _GetMSBuildProjectReferences(project) - content += import_cpp_targets_section - content += import_masm_targets_section - if "arm64" in platforms and toolset == "target": - content += import_marmasm_targets_section - content += _GetMSBuildExtensionTargets(targets_files_of_rules) - - if spec.get("msvs_external_builder"): - content += _GetMSBuildExternalBuilderTargets(spec) - - # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS: - # has_run_as = _WriteMSVSUserFile(project.path, version, spec) - - easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True) - - return missing_sources - - -def _GetMSBuildExternalBuilderTargets(spec): - """Return a list of MSBuild targets for external builders. - - The "Build" and "Clean" targets are always generated. If the spec contains - 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also - be generated, to support building selected C/C++ files. - - Arguments: - spec: The gyp target spec. - Returns: - List of MSBuild 'Target' specs. - """ - build_cmd = _BuildCommandLineForRuleRaw( - spec, spec["msvs_external_builder_build_cmd"], False, False, False, False - ) - build_target = ["Target", {"Name": "Build"}] - build_target.append(["Exec", {"Command": build_cmd}]) - - clean_cmd = _BuildCommandLineForRuleRaw( - spec, spec["msvs_external_builder_clean_cmd"], False, False, False, False - ) - clean_target = ["Target", {"Name": "Clean"}] - clean_target.append(["Exec", {"Command": clean_cmd}]) - - targets = [build_target, clean_target] - - if spec.get("msvs_external_builder_clcompile_cmd"): - clcompile_cmd = _BuildCommandLineForRuleRaw( - spec, - spec["msvs_external_builder_clcompile_cmd"], - False, - False, - False, - False, - ) - clcompile_target = ["Target", {"Name": "ClCompile"}] - clcompile_target.append(["Exec", {"Command": clcompile_cmd}]) - targets.append(clcompile_target) - - return targets - - -def _GetMSBuildExtensions(props_files_of_rules): - extensions = ["ImportGroup", {"Label": "ExtensionSettings"}] - for props_file in props_files_of_rules: - extensions.append(["Import", {"Project": props_file}]) - return [extensions] - - -def _GetMSBuildExtensionTargets(targets_files_of_rules): - targets_node = ["ImportGroup", {"Label": "ExtensionTargets"}] - for targets_file in sorted(targets_files_of_rules): - targets_node.append(["Import", {"Project": targets_file}]) - return [targets_node] - - -def _GenerateActionsForMSBuild(spec, actions_to_add): - """Add actions accumulated into an actions_to_add, merging as needed. - - Arguments: - spec: the target project dict - actions_to_add: dictionary keyed on input name, which maps to a list of - dicts describing the actions attached to that input file. - - Returns: - A pair of (action specification, the sources handled by this action). - """ - sources_handled_by_action = OrderedSet() - actions_spec = [] - for primary_input, actions in actions_to_add.items(): - if generator_supports_multiple_toolsets: - primary_input = primary_input.replace(".exe", "_host.exe") - inputs = OrderedSet() - outputs = OrderedSet() - descriptions = [] - commands = [] - for action in actions: - - def fixup_host_exe(i): - if "$(OutDir)" in i: - i = i.replace(".exe", "_host.exe") - return i - - if generator_supports_multiple_toolsets: - action["inputs"] = [fixup_host_exe(i) for i in action["inputs"]] - inputs.update(OrderedSet(action["inputs"])) - outputs.update(OrderedSet(action["outputs"])) - descriptions.append(action["description"]) - cmd = action["command"] - if generator_supports_multiple_toolsets: - cmd = cmd.replace(".exe", "_host.exe") - # For most actions, add 'call' so that actions that invoke batch files - # return and continue executing. msbuild_use_call provides a way to - # disable this but I have not seen any adverse effect from doing that - # for everything. - if action.get("msbuild_use_call", True): - cmd = "call " + cmd - commands.append(cmd) - # Add the custom build action for one input file. - description = ", and also ".join(descriptions) - - # We can't join the commands simply with && because the command line will - # get too long. See also _AddActions: cygwin's setup_env mustn't be called - # for every invocation or the command that sets the PATH will grow too - # long. - command = "\r\n".join( - [c + "\r\nif %errorlevel% neq 0 exit /b %errorlevel%" for c in commands] - ) - _AddMSBuildAction( - spec, - primary_input, - inputs, - outputs, - command, - description, - sources_handled_by_action, - actions_spec, - ) - return actions_spec, sources_handled_by_action - - -def _AddMSBuildAction( - spec, - primary_input, - inputs, - outputs, - cmd, - description, - sources_handled_by_action, - actions_spec, -): - command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd) - primary_input = _FixPath(primary_input) - inputs_array = _FixPaths(inputs) - outputs_array = _FixPaths(outputs) - additional_inputs = ";".join([i for i in inputs_array if i != primary_input]) - outputs = ";".join(outputs_array) - sources_handled_by_action.add(primary_input) - action_spec = ["CustomBuild", {"Include": primary_input}] - action_spec.extend( - # TODO(jeanluc) 'Document' for all or just if as_sources? - [ - ["FileType", "Document"], - ["Command", command], - ["Message", description], - ["Outputs", outputs], - ] - ) - if additional_inputs: - action_spec.append(["AdditionalInputs", additional_inputs]) - actions_spec.append(action_spec) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py deleted file mode 100755 index e80b57f06..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the msvs.py file. """ - -import gyp.generator.msvs as msvs -import unittest - -from io import StringIO - - -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() - - def test_GetLibraries(self): - self.assertEqual(msvs._GetLibraries({}), []) - self.assertEqual(msvs._GetLibraries({"libraries": []}), []) - self.assertEqual( - msvs._GetLibraries({"other": "foo", "libraries": ["a.lib"]}), ["a.lib"] - ) - self.assertEqual(msvs._GetLibraries({"libraries": ["-la"]}), ["a.lib"]) - self.assertEqual( - msvs._GetLibraries( - { - "libraries": [ - "a.lib", - "b.lib", - "c.lib", - "-lb.lib", - "-lb.lib", - "d.lib", - "a.lib", - ] - } - ), - ["c.lib", "b.lib", "d.lib", "a.lib"], - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py deleted file mode 100644 index d173bf229..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +++ /dev/null @@ -1,2936 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import collections -import copy -import hashlib -import json -import multiprocessing -import os.path -import re -import signal -import subprocess -import sys -import gyp -import gyp.common -import gyp.msvs_emulation -import gyp.MSVSUtil as MSVSUtil -import gyp.xcode_emulation - -from io import StringIO - -from gyp.common import GetEnvironFallback -import gyp.ninja_syntax as ninja_syntax - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_PREFIX": "lib", - # Gyp expects the following variables to be expandable by the build - # system to the appropriate locations. Ninja prefers paths to be - # known at gyp time. To resolve this, introduce special - # variables starting with $! and $| (which begin with a $ so gyp knows it - # should be treated specially, but is otherwise an invalid - # ninja/shell variable) that are passed to gyp here but expanded - # before writing out into the target .ninja files; see - # ExpandSpecial. - # $! is used for variables that represent a path and that can only appear at - # the start of a string, while $| is used for variables that can appear - # anywhere in a string. - "INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR", - "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen", - "PRODUCT_DIR": "$!PRODUCT_DIR", - "CONFIGURATION_NAME": "$|CONFIGURATION_NAME", - # Special variables that may be used by gyp 'rule' targets. - # We generate definitions for these variables on the fly when processing a - # rule. - "RULE_INPUT_ROOT": "${root}", - "RULE_INPUT_DIRNAME": "${dirname}", - "RULE_INPUT_PATH": "${source}", - "RULE_INPUT_EXT": "${ext}", - "RULE_INPUT_NAME": "${name}", -} - -# Placates pylint. -generator_additional_non_configuration_keys = [] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] -generator_filelist_paths = None - -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - - -def StripPrefix(arg, prefix): - if arg.startswith(prefix): - return arg[len(prefix) :] - return arg - - -def QuoteShellArgument(arg, flavor): - """Quote a string such that it will be interpreted as a single argument - by the shell.""" - # Rather than attempting to enumerate the bad shell characters, just - # allow common OK ones and quote anything else. - if re.match(r"^[a-zA-Z0-9_=.\\/-]+$", arg): - return arg # No quoting necessary. - if flavor == "win": - return gyp.msvs_emulation.QuoteForRspFile(arg) - return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" - - -def Define(d, flavor): - """Takes a preprocessor define and returns a -D parameter that's ninja- and - shell-escaped.""" - if flavor == "win": - # cl.exe replaces literal # characters with = in preprocessor definitions for - # some reason. Octal-encode to work around that. - d = d.replace("#", "\\%03o" % ord("#")) - return QuoteShellArgument(ninja_syntax.escape("-D" + d), flavor) - - -def AddArch(output, arch): - """Adds an arch string to an output path.""" - output, extension = os.path.splitext(output) - return f"{output}.{arch}{extension}" - - -class Target: - """Target represents the paths used within a single gyp target. - - Conceptually, building a single target A is a series of steps: - - 1) actions/rules/copies generates source/resources/etc. - 2) compiles generates .o files - 3) link generates a binary (library/executable) - 4) bundle merges the above in a mac bundle - - (Any of these steps can be optional.) - - From a build ordering perspective, a dependent target B could just - depend on the last output of this series of steps. - - But some dependent commands sometimes need to reach inside the box. - For example, when linking B it needs to get the path to the static - library generated by A. - - This object stores those paths. To keep things simple, member - variables only store concrete paths to single files, while methods - compute derived values like "the last output of the target". - """ - - def __init__(self, type): - # Gyp type ("static_library", etc.) of this target. - self.type = type - # File representing whether any input dependencies necessary for - # dependent actions have completed. - self.preaction_stamp = None - # File representing whether any input dependencies necessary for - # dependent compiles have completed. - self.precompile_stamp = None - # File representing the completion of actions/rules/copies, if any. - self.actions_stamp = None - # Path to the output of the link step, if any. - self.binary = None - # Path to the file representing the completion of building the bundle, - # if any. - self.bundle = None - # On Windows, incremental linking requires linking against all the .objs - # that compose a .lib (rather than the .lib itself). That list is stored - # here. In this case, we also need to save the compile_deps for the target, - # so that the target that directly depends on the .objs can also depend - # on those. - self.component_objs = None - self.compile_deps = None - # Windows only. The import .lib is the output of a build step, but - # because dependents only link against the lib (not both the lib and the - # dll) we keep track of the import library here. - self.import_lib = None - # Track if this target contains any C++ files, to decide if gcc or g++ - # should be used for linking. - self.uses_cpp = False - - def Linkable(self): - """Return true if this is a target that can be linked against.""" - return self.type in ("static_library", "shared_library") - - def UsesToc(self, flavor): - """Return true if the target should produce a restat rule based on a TOC - file.""" - # For bundles, the .TOC should be produced for the binary, not for - # FinalOutput(). But the naive approach would put the TOC file into the - # bundle, so don't do this for bundles for now. - if flavor == "win" or self.bundle: - return False - return self.type in ("shared_library", "loadable_module") - - def PreActionInput(self, flavor): - """Return the path, if any, that should be used as a dependency of - any dependent action step.""" - if self.UsesToc(flavor): - return self.FinalOutput() + ".TOC" - return self.FinalOutput() or self.preaction_stamp - - def PreCompileInput(self): - """Return the path, if any, that should be used as a dependency of - any dependent compile step.""" - return self.actions_stamp or self.precompile_stamp - - def FinalOutput(self): - """Return the last output of the target, which depends on all prior - steps.""" - return self.bundle or self.binary or self.actions_stamp - - -# A small discourse on paths as used within the Ninja build: -# All files we produce (both at gyp and at build time) appear in the -# build directory (e.g. out/Debug). -# -# Paths within a given .gyp file are always relative to the directory -# containing the .gyp file. Call these "gyp paths". This includes -# sources as well as the starting directory a given gyp rule/action -# expects to be run from. We call the path from the source root to -# the gyp file the "base directory" within the per-.gyp-file -# NinjaWriter code. -# -# All paths as written into the .ninja files are relative to the build -# directory. Call these paths "ninja paths". -# -# We translate between these two notions of paths with two helper -# functions: -# -# - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file) -# into the equivalent ninja path. -# -# - GypPathToUniqueOutput translates a gyp path into a ninja path to write -# an output file; the result can be namespaced such that it is unique -# to the input file name as well as the output target name. - - -class NinjaWriter: - def __init__( - self, - hash_for_rules, - target_outputs, - base_dir, - build_dir, - output_file, - toplevel_build, - output_file_name, - flavor, - toplevel_dir=None, - ): - """ - base_dir: path from source root to directory containing this gyp file, - by gyp semantics, all input paths are relative to this - build_dir: path from source root to build output - toplevel_dir: path to the toplevel directory - """ - - self.hash_for_rules = hash_for_rules - self.target_outputs = target_outputs - self.base_dir = base_dir - self.build_dir = build_dir - self.ninja = ninja_syntax.Writer(output_file) - self.toplevel_build = toplevel_build - self.output_file_name = output_file_name - - self.flavor = flavor - self.abs_build_dir = None - if toplevel_dir is not None: - self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, build_dir)) - self.obj_ext = ".obj" if flavor == "win" else ".o" - if flavor == "win": - # See docstring of msvs_emulation.GenerateEnvironmentFiles(). - self.win_env = {} - for arch in ("x86", "x64"): - self.win_env[arch] = "environment." + arch - - # Relative path from build output dir to base dir. - build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) - self.build_to_base = os.path.join(build_to_top, base_dir) - # Relative path from base dir to build dir. - base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) - self.base_to_build = os.path.join(base_to_top, build_dir) - - def ExpandSpecial(self, path, product_dir=None): - """Expand specials like $!PRODUCT_DIR in |path|. - - If |product_dir| is None, assumes the cwd is already the product - dir. Otherwise, |product_dir| is the relative path to the product - dir. - """ - - PRODUCT_DIR = "$!PRODUCT_DIR" - if PRODUCT_DIR in path: - if product_dir: - path = path.replace(PRODUCT_DIR, product_dir) - else: - path = path.replace(PRODUCT_DIR + "/", "") - path = path.replace(PRODUCT_DIR + "\\", "") - path = path.replace(PRODUCT_DIR, ".") - - INTERMEDIATE_DIR = "$!INTERMEDIATE_DIR" - if INTERMEDIATE_DIR in path: - int_dir = self.GypPathToUniqueOutput("gen") - # GypPathToUniqueOutput generates a path relative to the product dir, - # so insert product_dir in front if it is provided. - path = path.replace( - INTERMEDIATE_DIR, os.path.join(product_dir or "", int_dir) - ) - - CONFIGURATION_NAME = "$|CONFIGURATION_NAME" - path = path.replace(CONFIGURATION_NAME, self.config_name) - - return path - - def ExpandRuleVariables(self, path, root, dirname, source, ext, name): - if self.flavor == "win": - path = self.msvs_settings.ConvertVSMacros(path, config=self.config_name) - path = path.replace(generator_default_variables["RULE_INPUT_ROOT"], root) - path = path.replace(generator_default_variables["RULE_INPUT_DIRNAME"], dirname) - path = path.replace(generator_default_variables["RULE_INPUT_PATH"], source) - path = path.replace(generator_default_variables["RULE_INPUT_EXT"], ext) - path = path.replace(generator_default_variables["RULE_INPUT_NAME"], name) - return path - - def GypPathToNinja(self, path, env=None): - """Translate a gyp path to a ninja path, optionally expanding environment - variable references in |path| with |env|. - - See the above discourse on path conversions.""" - if env: - if self.flavor == "mac": - path = gyp.xcode_emulation.ExpandEnvVars(path, env) - elif self.flavor == "win": - path = gyp.msvs_emulation.ExpandMacros(path, env) - if path.startswith("$!"): - expanded = self.ExpandSpecial(path) - if self.flavor == "win": - expanded = os.path.normpath(expanded) - return expanded - if "$|" in path: - path = self.ExpandSpecial(path) - assert "$" not in path, path - return os.path.normpath(os.path.join(self.build_to_base, path)) - - def GypPathToUniqueOutput(self, path, qualified=True): - """Translate a gyp path to a ninja path for writing output. - - If qualified is True, qualify the resulting filename with the name - of the target. This is necessary when e.g. compiling the same - path twice for two separate output targets. - - See the above discourse on path conversions.""" - - path = self.ExpandSpecial(path) - assert not path.startswith("$"), path - - # Translate the path following this scheme: - # Input: foo/bar.gyp, target targ, references baz/out.o - # Output: obj/foo/baz/targ.out.o (if qualified) - # obj/foo/baz/out.o (otherwise) - # (and obj.host instead of obj for cross-compiles) - # - # Why this scheme and not some other one? - # 1) for a given input, you can compute all derived outputs by matching - # its path, even if the input is brought via a gyp file with '..'. - # 2) simple files like libraries and stamps have a simple filename. - - obj = "obj" - if self.toolset != "target": - obj += "." + self.toolset - - path_dir, path_basename = os.path.split(path) - assert not os.path.isabs(path_dir), ( - "'%s' can not be absolute path (see crbug.com/462153)." % path_dir - ) - - if qualified: - path_basename = self.name + "." + path_basename - return os.path.normpath( - os.path.join(obj, self.base_dir, path_dir, path_basename) - ) - - def WriteCollapsedDependencies(self, name, targets, order_only=None): - """Given a list of targets, return a path for a single file - representing the result of building all the targets or None. - - Uses a stamp file if necessary.""" - - assert targets == [item for item in targets if item], targets - if len(targets) == 0: - assert not order_only - return None - if len(targets) > 1 or order_only: - stamp = self.GypPathToUniqueOutput(name + ".stamp") - targets = self.ninja.build(stamp, "stamp", targets, order_only=order_only) - self.ninja.newline() - return targets[0] - - def _SubninjaNameForArch(self, arch): - output_file_base = os.path.splitext(self.output_file_name)[0] - return f"{output_file_base}.{arch}.ninja" - - def WriteSpec(self, spec, config_name, generator_flags): - """The main entry point for NinjaWriter: write the build rules for a spec. - - Returns a Target object, which represents the output paths for this spec. - Returns None if there are no outputs (e.g. a settings-only 'none' type - target).""" - - self.config_name = config_name - self.name = spec["target_name"] - self.toolset = spec["toolset"] - config = spec["configurations"][config_name] - self.target = Target(spec["type"]) - self.is_standalone_static_library = bool( - spec.get("standalone_static_library", 0) - ) - - self.target_rpath = generator_flags.get("target_rpath", r"\$$ORIGIN/lib/") - - self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) - self.xcode_settings = self.msvs_settings = None - if self.flavor == "mac": - self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) - if mac_toolchain_dir: - self.xcode_settings.mac_toolchain_dir = mac_toolchain_dir - - if self.flavor == "win": - self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, generator_flags) - arch = self.msvs_settings.GetArch(config_name) - self.ninja.variable("arch", self.win_env[arch]) - self.ninja.variable("cc", "$cl_" + arch) - self.ninja.variable("cxx", "$cl_" + arch) - self.ninja.variable("cc_host", "$cl_" + arch) - self.ninja.variable("cxx_host", "$cl_" + arch) - self.ninja.variable("asm", "$ml_" + arch) - - if self.flavor == "mac": - self.archs = self.xcode_settings.GetActiveArchs(config_name) - if len(self.archs) > 1: - self.arch_subninjas = { - arch: ninja_syntax.Writer( - OpenOutput( - os.path.join( - self.toplevel_build, self._SubninjaNameForArch(arch) - ), - "w", - ) - ) - for arch in self.archs - } - - # Compute predepends for all rules. - # actions_depends is the dependencies this target depends on before running - # any of its action/rule/copy steps. - # compile_depends is the dependencies this target depends on before running - # any of its compile steps. - actions_depends = [] - compile_depends = [] - # TODO(evan): it is rather confusing which things are lists and which - # are strings. Fix these. - if "dependencies" in spec: - for dep in spec["dependencies"]: - if dep in self.target_outputs: - target = self.target_outputs[dep] - actions_depends.append(target.PreActionInput(self.flavor)) - compile_depends.append(target.PreCompileInput()) - if target.uses_cpp: - self.target.uses_cpp = True - actions_depends = [item for item in actions_depends if item] - compile_depends = [item for item in compile_depends if item] - actions_depends = self.WriteCollapsedDependencies( - "actions_depends", actions_depends - ) - compile_depends = self.WriteCollapsedDependencies( - "compile_depends", compile_depends - ) - self.target.preaction_stamp = actions_depends - self.target.precompile_stamp = compile_depends - - # Write out actions, rules, and copies. These must happen before we - # compile any sources, so compute a list of predependencies for sources - # while we do it. - extra_sources = [] - mac_bundle_depends = [] - self.target.actions_stamp = self.WriteActionsRulesCopies( - spec, extra_sources, actions_depends, mac_bundle_depends - ) - - # If we have actions/rules/copies, we depend directly on those, but - # otherwise we depend on dependent target's actions/rules/copies etc. - # We never need to explicitly depend on previous target's link steps, - # because no compile ever depends on them. - compile_depends_stamp = self.target.actions_stamp or compile_depends - - # Write out the compilation steps, if any. - link_deps = [] - try: - sources = extra_sources + spec.get("sources", []) - except TypeError: - print("extra_sources: ", str(extra_sources)) - print('spec.get("sources"): ', str(spec.get("sources"))) - raise - if sources: - if self.flavor == "mac" and len(self.archs) > 1: - # Write subninja file containing compile and link commands scoped to - # a single arch if a fat binary is being built. - for arch in self.archs: - self.ninja.subninja(self._SubninjaNameForArch(arch)) - - pch = None - if self.flavor == "win": - gyp.msvs_emulation.VerifyMissingSources( - sources, self.abs_build_dir, generator_flags, self.GypPathToNinja - ) - pch = gyp.msvs_emulation.PrecompiledHeader( - self.msvs_settings, - config_name, - self.GypPathToNinja, - self.GypPathToUniqueOutput, - self.obj_ext, - ) - else: - pch = gyp.xcode_emulation.MacPrefixHeader( - self.xcode_settings, - self.GypPathToNinja, - lambda path, lang: self.GypPathToUniqueOutput(path + "-" + lang), - ) - link_deps = self.WriteSources( - self.ninja, - config_name, - config, - sources, - compile_depends_stamp, - pch, - spec, - ) - # Some actions/rules output 'sources' that are already object files. - obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] - if obj_outputs: - if self.flavor != "mac" or len(self.archs) == 1: - link_deps += [self.GypPathToNinja(o) for o in obj_outputs] - else: - print( - "Warning: Actions/rules writing object files don't work with " - "multiarch targets, dropping. (target %s)" % spec["target_name"] - ) - elif self.flavor == "mac" and len(self.archs) > 1: - link_deps = collections.defaultdict(list) - - compile_deps = self.target.actions_stamp or actions_depends - if self.flavor == "win" and self.target.type == "static_library": - self.target.component_objs = link_deps - self.target.compile_deps = compile_deps - - # Write out a link step, if needed. - output = None - is_empty_bundle = not link_deps and not mac_bundle_depends - if link_deps or self.target.actions_stamp or actions_depends: - output = self.WriteTarget( - spec, config_name, config, link_deps, compile_deps - ) - if self.is_mac_bundle: - mac_bundle_depends.append(output) - - # Bundle all of the above together, if needed. - if self.is_mac_bundle: - output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) - - if not output: - return None - - assert self.target.FinalOutput(), output - return self.target - - def _WinIdlRule(self, source, prebuild, outputs): - """Handle the implicit VS .idl rule for one source file. Fills |outputs| - with files that are generated.""" - outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( - source, self.config_name - ) - outdir = self.GypPathToNinja(outdir) - - def fix_path(path, rel=None): - path = os.path.join(outdir, path) - dirname, basename = os.path.split(source) - root, ext = os.path.splitext(basename) - path = self.ExpandRuleVariables(path, root, dirname, source, ext, basename) - if rel: - path = os.path.relpath(path, rel) - return path - - vars = [(name, fix_path(value, outdir)) for name, value in vars] - output = [fix_path(p) for p in output] - vars.append(("outdir", outdir)) - vars.append(("idlflags", flags)) - input = self.GypPathToNinja(source) - self.ninja.build(output, "idl", input, variables=vars, order_only=prebuild) - outputs.extend(output) - - def WriteWinIdlFiles(self, spec, prebuild): - """Writes rules to match MSVS's implicit idl handling.""" - assert self.flavor == "win" - if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): - return [] - outputs = [] - for source in filter(lambda x: x.endswith(".idl"), spec["sources"]): - self._WinIdlRule(source, prebuild, outputs) - return outputs - - def WriteActionsRulesCopies( - self, spec, extra_sources, prebuild, mac_bundle_depends - ): - """Write out the Actions, Rules, and Copies steps. Return a path - representing the outputs of these steps.""" - outputs = [] - if self.is_mac_bundle: - mac_bundle_resources = spec.get("mac_bundle_resources", [])[:] - else: - mac_bundle_resources = [] - extra_mac_bundle_resources = [] - - if "actions" in spec: - outputs += self.WriteActions( - spec["actions"], extra_sources, prebuild, extra_mac_bundle_resources - ) - if "rules" in spec: - outputs += self.WriteRules( - spec["rules"], - extra_sources, - prebuild, - mac_bundle_resources, - extra_mac_bundle_resources, - ) - if "copies" in spec: - outputs += self.WriteCopies(spec["copies"], prebuild, mac_bundle_depends) - - if "sources" in spec and self.flavor == "win": - outputs += self.WriteWinIdlFiles(spec, prebuild) - - if self.xcode_settings and self.xcode_settings.IsIosFramework(): - self.WriteiOSFrameworkHeaders(spec, outputs, prebuild) - - stamp = self.WriteCollapsedDependencies("actions_rules_copies", outputs) - - if self.is_mac_bundle: - xcassets = self.WriteMacBundleResources( - extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends - ) - partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) - self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) - - return stamp - - def GenerateDescription(self, verb, message, fallback): - """Generate and return a description of a build step. - - |verb| is the short summary, e.g. ACTION or RULE. - |message| is a hand-written description, or None if not available. - |fallback| is the gyp-level name of the step, usable as a fallback. - """ - if self.toolset != "target": - verb += "(%s)" % self.toolset - if message: - return f"{verb} {self.ExpandSpecial(message)}" - else: - return f"{verb} {self.name}: {fallback}" - - def WriteActions( - self, actions, extra_sources, prebuild, extra_mac_bundle_resources - ): - # Actions cd into the base directory. - env = self.GetToolchainEnv() - all_outputs = [] - for action in actions: - # First write out a rule for the action. - name = "{}_{}".format(action["action_name"], self.hash_for_rules) - description = self.GenerateDescription( - "ACTION", action.get("message", None), name - ) - win_shell_flags = ( - self.msvs_settings.GetRuleShellFlags(action) - if self.flavor == "win" - else None - ) - args = action["action"] - depfile = action.get("depfile", None) - if depfile: - depfile = self.ExpandSpecial(depfile, self.base_to_build) - pool = "console" if int(action.get("ninja_use_console", 0)) else None - rule_name, _ = self.WriteNewNinjaRule( - name, args, description, win_shell_flags, env, pool, depfile=depfile - ) - - inputs = [self.GypPathToNinja(i, env) for i in action["inputs"]] - if int(action.get("process_outputs_as_sources", False)): - extra_sources += action["outputs"] - if int(action.get("process_outputs_as_mac_bundle_resources", False)): - extra_mac_bundle_resources += action["outputs"] - outputs = [self.GypPathToNinja(o, env) for o in action["outputs"]] - - # Then write out an edge using the rule. - self.ninja.build(outputs, rule_name, inputs, order_only=prebuild) - all_outputs += outputs - - self.ninja.newline() - - return all_outputs - - def WriteRules( - self, - rules, - extra_sources, - prebuild, - mac_bundle_resources, - extra_mac_bundle_resources, - ): - env = self.GetToolchainEnv() - all_outputs = [] - for rule in rules: - # Skip a rule with no action and no inputs. - if "action" not in rule and not rule.get("rule_sources", []): - continue - - # First write out a rule for the rule action. - name = "{}_{}".format(rule["rule_name"], self.hash_for_rules) - - args = rule["action"] - description = self.GenerateDescription( - "RULE", - rule.get("message", None), - ("%s " + generator_default_variables["RULE_INPUT_PATH"]) % name, - ) - win_shell_flags = ( - self.msvs_settings.GetRuleShellFlags(rule) - if self.flavor == "win" - else None - ) - pool = "console" if int(rule.get("ninja_use_console", 0)) else None - rule_name, args = self.WriteNewNinjaRule( - name, args, description, win_shell_flags, env, pool - ) - - # TODO: if the command references the outputs directly, we should - # simplify it to just use $out. - - # Rules can potentially make use of some special variables which - # must vary per source file. - # Compute the list of variables we'll need to provide. - special_locals = ("source", "root", "dirname", "ext", "name") - needed_variables = {"source"} - for argument in args: - for var in special_locals: - if "${%s}" % var in argument: - needed_variables.add(var) - needed_variables = sorted(needed_variables) - - def cygwin_munge(path): - # pylint: disable=cell-var-from-loop - if win_shell_flags and win_shell_flags.cygwin: - return path.replace("\\", "/") - return path - - inputs = [self.GypPathToNinja(i, env) for i in rule.get("inputs", [])] - - # If there are n source files matching the rule, and m additional rule - # inputs, then adding 'inputs' to each build edge written below will - # write m * n inputs. Collapsing reduces this to m + n. - sources = rule.get("rule_sources", []) - num_inputs = len(inputs) - if prebuild: - num_inputs += 1 - if num_inputs > 2 and len(sources) > 2: - inputs = [ - self.WriteCollapsedDependencies( - rule["rule_name"], inputs, order_only=prebuild - ) - ] - prebuild = [] - - # For each source file, write an edge that generates all the outputs. - for source in sources: - source = os.path.normpath(source) - dirname, basename = os.path.split(source) - root, ext = os.path.splitext(basename) - - # Gather the list of inputs and outputs, expanding $vars if possible. - outputs = [ - self.ExpandRuleVariables(o, root, dirname, source, ext, basename) - for o in rule["outputs"] - ] - - if int(rule.get("process_outputs_as_sources", False)): - extra_sources += outputs - - was_mac_bundle_resource = source in mac_bundle_resources - if was_mac_bundle_resource or int( - rule.get("process_outputs_as_mac_bundle_resources", False) - ): - extra_mac_bundle_resources += outputs - # Note: This is n_resources * n_outputs_in_rule. - # Put to-be-removed items in a set and - # remove them all in a single pass - # if this becomes a performance issue. - if was_mac_bundle_resource: - mac_bundle_resources.remove(source) - - extra_bindings = [] - for var in needed_variables: - if var == "root": - extra_bindings.append(("root", cygwin_munge(root))) - elif var == "dirname": - # '$dirname' is a parameter to the rule action, which means - # it shouldn't be converted to a Ninja path. But we don't - # want $!PRODUCT_DIR in there either. - dirname_expanded = self.ExpandSpecial( - dirname, self.base_to_build - ) - extra_bindings.append( - ("dirname", cygwin_munge(dirname_expanded)) - ) - elif var == "source": - # '$source' is a parameter to the rule action, which means - # it shouldn't be converted to a Ninja path. But we don't - # want $!PRODUCT_DIR in there either. - source_expanded = self.ExpandSpecial(source, self.base_to_build) - extra_bindings.append(("source", cygwin_munge(source_expanded))) - elif var == "ext": - extra_bindings.append(("ext", ext)) - elif var == "name": - extra_bindings.append(("name", cygwin_munge(basename))) - else: - assert var is None, repr(var) - - outputs = [self.GypPathToNinja(o, env) for o in outputs] - if self.flavor == "win": - # WriteNewNinjaRule uses unique_name to create a rsp file on win. - extra_bindings.append( - ("unique_name", hashlib.md5(outputs[0]).hexdigest()) - ) - - self.ninja.build( - outputs, - rule_name, - self.GypPathToNinja(source), - implicit=inputs, - order_only=prebuild, - variables=extra_bindings, - ) - - all_outputs.extend(outputs) - - return all_outputs - - def WriteCopies(self, copies, prebuild, mac_bundle_depends): - outputs = [] - if self.xcode_settings: - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetToolchainEnv(additional_settings=extra_env) - else: - env = self.GetToolchainEnv() - for to_copy in copies: - for path in to_copy["files"]: - # Normalize the path so trailing slashes don't confuse us. - path = os.path.normpath(path) - basename = os.path.split(path)[1] - src = self.GypPathToNinja(path, env) - dst = self.GypPathToNinja( - os.path.join(to_copy["destination"], basename), env - ) - outputs += self.ninja.build(dst, "copy", src, order_only=prebuild) - if self.is_mac_bundle: - # gyp has mac_bundle_resources to copy things into a bundle's - # Resources folder, but there's no built-in way to copy files - # to other places in the bundle. - # Hence, some targets use copies for this. - # Check if this file is copied into the current bundle, - # and if so add it to the bundle depends so - # that dependent targets get rebuilt if the copy input changes. - if dst.startswith( - self.xcode_settings.GetBundleContentsFolderPath() - ): - mac_bundle_depends.append(dst) - - return outputs - - def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild): - """Prebuild steps to generate hmap files and copy headers to destination.""" - framework = self.ComputeMacBundleOutput() - all_sources = spec["sources"] - copy_headers = spec["mac_framework_headers"] - output = self.GypPathToUniqueOutput("headers.hmap") - self.xcode_settings.header_map_path = output - all_headers = map( - self.GypPathToNinja, filter(lambda x: x.endswith(".h"), all_sources) - ) - variables = [ - ("framework", framework), - ("copy_headers", map(self.GypPathToNinja, copy_headers)), - ] - outputs.extend( - self.ninja.build( - output, - "compile_ios_framework_headers", - all_headers, - variables=variables, - order_only=prebuild, - ) - ) - - def WriteMacBundleResources(self, resources, bundle_depends): - """Writes ninja edges for 'mac_bundle_resources'.""" - xcassets = [] - - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) - - for output, res in gyp.xcode_emulation.GetMacBundleResources( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - map(self.GypPathToNinja, resources), - ): - output = self.ExpandSpecial(output) - if os.path.splitext(output)[-1] != ".xcassets": - self.ninja.build( - output, - "mac_tool", - res, - variables=[ - ("mactool_cmd", "copy-bundle-resource"), - ("env", env), - ("binary", isBinary), - ], - ) - bundle_depends.append(output) - else: - xcassets.append(res) - return xcassets - - def WriteMacXCassets(self, xcassets, bundle_depends): - """Writes ninja edges for 'mac_bundle_resources' .xcassets files. - - This add an invocation of 'actool' via the 'mac_tool.py' helper script. - It assumes that the assets catalogs define at least one imageset and - thus an Assets.car file will be generated in the application resources - directory. If this is not the case, then the build will probably be done - at each invocation of ninja.""" - if not xcassets: - return - - extra_arguments = {} - settings_to_arg = { - "XCASSETS_APP_ICON": "app-icon", - "XCASSETS_LAUNCH_IMAGE": "launch-image", - } - settings = self.xcode_settings.xcode_settings[self.config_name] - for settings_key, arg_name in settings_to_arg.items(): - value = settings.get(settings_key) - if value: - extra_arguments[arg_name] = value - - partial_info_plist = None - if extra_arguments: - partial_info_plist = self.GypPathToUniqueOutput( - "assetcatalog_generated_info.plist" - ) - extra_arguments["output-partial-info-plist"] = partial_info_plist - - outputs = [] - outputs.append( - os.path.join(self.xcode_settings.GetBundleResourceFolder(), "Assets.car") - ) - if partial_info_plist: - outputs.append(partial_info_plist) - - keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - - bundle_depends.extend( - self.ninja.build( - outputs, - "compile_xcassets", - xcassets, - variables=[("env", env), ("keys", keys)], - ) - ) - return partial_info_plist - - def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): - """Write build rules for bundle Info.plist files.""" - info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - self.GypPathToNinja, - ) - if not info_plist: - return - out = self.ExpandSpecial(out) - if defines: - # Create an intermediate file to store preprocessed results. - intermediate_plist = self.GypPathToUniqueOutput( - os.path.basename(info_plist) - ) - defines = " ".join([Define(d, self.flavor) for d in defines]) - info_plist = self.ninja.build( - intermediate_plist, - "preprocess_infoplist", - info_plist, - variables=[("defines", defines)], - ) - - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - - if partial_info_plist: - intermediate_plist = self.GypPathToUniqueOutput("merged_info.plist") - info_plist = self.ninja.build( - intermediate_plist, "merge_infoplist", [partial_info_plist, info_plist] - ) - - keys = self.xcode_settings.GetExtraPlistItems(self.config_name) - keys = QuoteShellArgument(json.dumps(keys), self.flavor) - isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) - self.ninja.build( - out, - "copy_infoplist", - info_plist, - variables=[("env", env), ("keys", keys), ("binary", isBinary)], - ) - bundle_depends.append(out) - - def WriteSources( - self, - ninja_file, - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - ): - """Write build rules to compile all of |sources|.""" - if self.toolset == "host": - self.ninja.variable("ar", "$ar_host") - self.ninja.variable("cc", "$cc_host") - self.ninja.variable("cxx", "$cxx_host") - self.ninja.variable("ld", "$ld_host") - self.ninja.variable("ldxx", "$ldxx_host") - self.ninja.variable("nm", "$nm_host") - self.ninja.variable("readelf", "$readelf_host") - - if self.flavor != "mac" or len(self.archs) == 1: - return self.WriteSourcesForArch( - self.ninja, - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - ) - else: - return { - arch: self.WriteSourcesForArch( - self.arch_subninjas[arch], - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - arch=arch, - ) - for arch in self.archs - } - - def WriteSourcesForArch( - self, - ninja_file, - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - arch=None, - ): - """Write build rules to compile all of |sources|.""" - - extra_defines = [] - if self.flavor == "mac": - cflags = self.xcode_settings.GetCflags(config_name, arch=arch) - cflags_c = self.xcode_settings.GetCflagsC(config_name) - cflags_cc = self.xcode_settings.GetCflagsCC(config_name) - cflags_objc = ["$cflags_c"] + self.xcode_settings.GetCflagsObjC(config_name) - cflags_objcc = ["$cflags_cc"] + self.xcode_settings.GetCflagsObjCC( - config_name - ) - elif self.flavor == "win": - asmflags = self.msvs_settings.GetAsmflags(config_name) - cflags = self.msvs_settings.GetCflags(config_name) - cflags_c = self.msvs_settings.GetCflagsC(config_name) - cflags_cc = self.msvs_settings.GetCflagsCC(config_name) - extra_defines = self.msvs_settings.GetComputedDefines(config_name) - # See comment at cc_command for why there's two .pdb files. - pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( - config_name, self.ExpandSpecial - ) - if not pdbpath_c: - obj = "obj" - if self.toolset != "target": - obj += "." + self.toolset - pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) - pdbpath_c = pdbpath + ".c.pdb" - pdbpath_cc = pdbpath + ".cc.pdb" - self.WriteVariableList(ninja_file, "pdbname_c", [pdbpath_c]) - self.WriteVariableList(ninja_file, "pdbname_cc", [pdbpath_cc]) - self.WriteVariableList(ninja_file, "pchprefix", [self.name]) - else: - cflags = config.get("cflags", []) - cflags_c = config.get("cflags_c", []) - cflags_cc = config.get("cflags_cc", []) - - # Respect environment variables related to build, but target-specific - # flags can still override them. - if self.toolset == "target": - cflags_c = ( - os.environ.get("CPPFLAGS", "").split() - + os.environ.get("CFLAGS", "").split() - + cflags_c - ) - cflags_cc = ( - os.environ.get("CPPFLAGS", "").split() - + os.environ.get("CXXFLAGS", "").split() - + cflags_cc - ) - elif self.toolset == "host": - cflags_c = ( - os.environ.get("CPPFLAGS_host", "").split() - + os.environ.get("CFLAGS_host", "").split() - + cflags_c - ) - cflags_cc = ( - os.environ.get("CPPFLAGS_host", "").split() - + os.environ.get("CXXFLAGS_host", "").split() - + cflags_cc - ) - - defines = config.get("defines", []) + extra_defines - self.WriteVariableList( - ninja_file, "defines", [Define(d, self.flavor) for d in defines] - ) - if self.flavor == "win": - self.WriteVariableList( - ninja_file, "asmflags", map(self.ExpandSpecial, asmflags) - ) - self.WriteVariableList( - ninja_file, - "rcflags", - [ - QuoteShellArgument(self.ExpandSpecial(f), self.flavor) - for f in self.msvs_settings.GetRcflags( - config_name, self.GypPathToNinja - ) - ], - ) - - include_dirs = config.get("include_dirs", []) - - env = self.GetToolchainEnv() - if self.flavor == "win": - include_dirs = self.msvs_settings.AdjustIncludeDirs( - include_dirs, config_name - ) - self.WriteVariableList( - ninja_file, - "includes", - [ - QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) - for i in include_dirs - ], - ) - - if self.flavor == "win": - midl_include_dirs = config.get("midl_include_dirs", []) - midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( - midl_include_dirs, config_name - ) - self.WriteVariableList( - ninja_file, - "midl_includes", - [ - QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) - for i in midl_include_dirs - ], - ) - - pch_commands = precompiled_header.GetPchBuildCommands(arch) - if self.flavor == "mac": - # Most targets use no precompiled headers, so only write these if needed. - for ext, var in [ - ("c", "cflags_pch_c"), - ("cc", "cflags_pch_cc"), - ("m", "cflags_pch_objc"), - ("mm", "cflags_pch_objcc"), - ]: - include = precompiled_header.GetInclude(ext, arch) - if include: - ninja_file.variable(var, include) - - arflags = config.get("arflags", []) - - self.WriteVariableList(ninja_file, "cflags", map(self.ExpandSpecial, cflags)) - self.WriteVariableList( - ninja_file, "cflags_c", map(self.ExpandSpecial, cflags_c) - ) - self.WriteVariableList( - ninja_file, "cflags_cc", map(self.ExpandSpecial, cflags_cc) - ) - if self.flavor == "mac": - self.WriteVariableList( - ninja_file, "cflags_objc", map(self.ExpandSpecial, cflags_objc) - ) - self.WriteVariableList( - ninja_file, "cflags_objcc", map(self.ExpandSpecial, cflags_objcc) - ) - self.WriteVariableList(ninja_file, "arflags", map(self.ExpandSpecial, arflags)) - ninja_file.newline() - outputs = [] - has_rc_source = False - for source in sources: - filename, ext = os.path.splitext(source) - ext = ext[1:] - obj_ext = self.obj_ext - if ext in ("cc", "cpp", "cxx"): - command = "cxx" - self.target.uses_cpp = True - elif ext == "c" or (ext == "S" and self.flavor != "win"): - command = "cc" - elif ext == "s" and self.flavor != "win": # Doesn't generate .o.d files. - command = "cc_s" - elif ( - self.flavor == "win" - and ext in ("asm", "S") - and not self.msvs_settings.HasExplicitAsmRules(spec) - ): - command = "asm" - # Add the _asm suffix as msvs is capable of handling .cc and - # .asm files of the same name without collision. - obj_ext = "_asm.obj" - elif self.flavor == "mac" and ext == "m": - command = "objc" - elif self.flavor == "mac" and ext == "mm": - command = "objcxx" - self.target.uses_cpp = True - elif self.flavor == "win" and ext == "rc": - command = "rc" - obj_ext = ".res" - has_rc_source = True - else: - # Ignore unhandled extensions. - continue - input = self.GypPathToNinja(source) - output = self.GypPathToUniqueOutput(filename + obj_ext) - if arch is not None: - output = AddArch(output, arch) - implicit = precompiled_header.GetObjDependencies([input], [output], arch) - variables = [] - if self.flavor == "win": - variables, output, implicit = precompiled_header.GetFlagsModifications( - input, - output, - implicit, - command, - cflags_c, - cflags_cc, - self.ExpandSpecial, - ) - ninja_file.build( - output, - command, - input, - implicit=[gch for _, _, gch in implicit], - order_only=predepends, - variables=variables, - ) - outputs.append(output) - - if has_rc_source: - resource_include_dirs = config.get("resource_include_dirs", include_dirs) - self.WriteVariableList( - ninja_file, - "resource_includes", - [ - QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) - for i in resource_include_dirs - ], - ) - - self.WritePchTargets(ninja_file, pch_commands) - - ninja_file.newline() - return outputs - - def WritePchTargets(self, ninja_file, pch_commands): - """Writes ninja rules to compile prefix headers.""" - if not pch_commands: - return - - for gch, lang_flag, lang, input in pch_commands: - var_name = { - "c": "cflags_pch_c", - "cc": "cflags_pch_cc", - "m": "cflags_pch_objc", - "mm": "cflags_pch_objcc", - }[lang] - - map = { - "c": "cc", - "cc": "cxx", - "m": "objc", - "mm": "objcxx", - } - cmd = map.get(lang) - ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) - - def WriteLink(self, spec, config_name, config, link_deps, compile_deps): - """Write out a link step. Fills out target.binary. """ - if self.flavor != "mac" or len(self.archs) == 1: - return self.WriteLinkForArch( - self.ninja, spec, config_name, config, link_deps, compile_deps - ) - else: - output = self.ComputeOutput(spec) - inputs = [ - self.WriteLinkForArch( - self.arch_subninjas[arch], - spec, - config_name, - config, - link_deps[arch], - compile_deps, - arch=arch, - ) - for arch in self.archs - ] - extra_bindings = [] - build_output = output - if not self.is_mac_bundle: - self.AppendPostbuildVariable(extra_bindings, spec, output, output) - - # TODO(yyanagisawa): more work needed to fix: - # https://code.google.com/p/gyp/issues/detail?id=411 - if ( - spec["type"] in ("shared_library", "loadable_module") - and not self.is_mac_bundle - ): - extra_bindings.append(("lib", output)) - self.ninja.build( - [output, output + ".TOC"], - "solipo", - inputs, - variables=extra_bindings, - ) - else: - self.ninja.build(build_output, "lipo", inputs, variables=extra_bindings) - return output - - def WriteLinkForArch( - self, ninja_file, spec, config_name, config, link_deps, compile_deps, arch=None - ): - """Write out a link step. Fills out target.binary. """ - command = { - "executable": "link", - "loadable_module": "solink_module", - "shared_library": "solink", - }[spec["type"]] - command_suffix = "" - - implicit_deps = set() - solibs = set() - order_deps = set() - - if compile_deps: - # Normally, the compiles of the target already depend on compile_deps, - # but a shared_library target might have no sources and only link together - # a few static_library deps, so the link step also needs to depend - # on compile_deps to make sure actions in the shared_library target - # get run before the link. - order_deps.add(compile_deps) - - if "dependencies" in spec: - # Two kinds of dependencies: - # - Linkable dependencies (like a .a or a .so): add them to the link line. - # - Non-linkable dependencies (like a rule that generates a file - # and writes a stamp file): add them to implicit_deps - extra_link_deps = set() - for dep in spec["dependencies"]: - target = self.target_outputs.get(dep) - if not target: - continue - linkable = target.Linkable() - if linkable: - new_deps = [] - if ( - self.flavor == "win" - and target.component_objs - and self.msvs_settings.IsUseLibraryDependencyInputs(config_name) - ): - new_deps = target.component_objs - if target.compile_deps: - order_deps.add(target.compile_deps) - elif self.flavor == "win" and target.import_lib: - new_deps = [target.import_lib] - elif target.UsesToc(self.flavor): - solibs.add(target.binary) - implicit_deps.add(target.binary + ".TOC") - else: - new_deps = [target.binary] - for new_dep in new_deps: - if new_dep not in extra_link_deps: - extra_link_deps.add(new_dep) - link_deps.append(new_dep) - - final_output = target.FinalOutput() - if not linkable or final_output != target.binary: - implicit_deps.add(final_output) - - extra_bindings = [] - if self.target.uses_cpp and self.flavor != "win": - extra_bindings.append(("ld", "$ldxx")) - - output = self.ComputeOutput(spec, arch) - if arch is None and not self.is_mac_bundle: - self.AppendPostbuildVariable(extra_bindings, spec, output, output) - - is_executable = spec["type"] == "executable" - # The ldflags config key is not used on mac or win. On those platforms - # linker flags are set via xcode_settings and msvs_settings, respectively. - if self.toolset == "target": - env_ldflags = os.environ.get("LDFLAGS", "").split() - elif self.toolset == "host": - env_ldflags = os.environ.get("LDFLAGS_host", "").split() - - if self.flavor == "mac": - ldflags = self.xcode_settings.GetLdflags( - config_name, - self.ExpandSpecial(generator_default_variables["PRODUCT_DIR"]), - self.GypPathToNinja, - arch, - ) - ldflags = env_ldflags + ldflags - elif self.flavor == "win": - manifest_base_name = self.GypPathToUniqueOutput( - self.ComputeOutputFileName(spec) - ) - ( - ldflags, - intermediate_manifest, - manifest_files, - ) = self.msvs_settings.GetLdflags( - config_name, - self.GypPathToNinja, - self.ExpandSpecial, - manifest_base_name, - output, - is_executable, - self.toplevel_build, - ) - ldflags = env_ldflags + ldflags - self.WriteVariableList(ninja_file, "manifests", manifest_files) - implicit_deps = implicit_deps.union(manifest_files) - if intermediate_manifest: - self.WriteVariableList( - ninja_file, "intermediatemanifest", [intermediate_manifest] - ) - command_suffix = _GetWinLinkRuleNameSuffix( - self.msvs_settings.IsEmbedManifest(config_name) - ) - def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) - if def_file: - implicit_deps.add(def_file) - else: - # Respect environment variables related to build, but target-specific - # flags can still override them. - ldflags = env_ldflags + config.get("ldflags", []) - if is_executable and len(solibs): - rpath = "lib/" - if self.toolset != "target": - rpath += self.toolset - ldflags.append(r"-Wl,-rpath=\$$ORIGIN/%s" % rpath) - else: - ldflags.append("-Wl,-rpath=%s" % self.target_rpath) - ldflags.append("-Wl,-rpath-link=%s" % rpath) - self.WriteVariableList(ninja_file, "ldflags", map(self.ExpandSpecial, ldflags)) - - library_dirs = config.get("library_dirs", []) - if self.flavor == "win": - library_dirs = [ - self.msvs_settings.ConvertVSMacros(library_dir, config_name) - for library_dir in library_dirs - ] - library_dirs = [ - "/LIBPATH:" - + QuoteShellArgument(self.GypPathToNinja(library_dir), self.flavor) - for library_dir in library_dirs - ] - else: - library_dirs = [ - QuoteShellArgument("-L" + self.GypPathToNinja(library_dir), self.flavor) - for library_dir in library_dirs - ] - - libraries = gyp.common.uniquer( - map(self.ExpandSpecial, spec.get("libraries", [])) - ) - if self.flavor == "mac": - libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) - elif self.flavor == "win": - libraries = self.msvs_settings.AdjustLibraries(libraries) - - self.WriteVariableList(ninja_file, "libs", library_dirs + libraries) - - linked_binary = output - - if command in ("solink", "solink_module"): - extra_bindings.append(("soname", os.path.split(output)[1])) - extra_bindings.append(("lib", gyp.common.EncodePOSIXShellArgument(output))) - if self.flavor != "win": - link_file_list = output - if self.is_mac_bundle: - # 'Dependency Framework.framework/Versions/A/Dependency Framework' - # -> 'Dependency Framework.framework.rsp' - link_file_list = self.xcode_settings.GetWrapperName() - if arch: - link_file_list += "." + arch - link_file_list += ".rsp" - # If an rspfile contains spaces, ninja surrounds the filename with - # quotes around it and then passes it to open(), creating a file with - # quotes in its name (and when looking for the rsp file, the name - # makes it through bash which strips the quotes) :-/ - link_file_list = link_file_list.replace(" ", "_") - extra_bindings.append( - ( - "link_file_list", - gyp.common.EncodePOSIXShellArgument(link_file_list), - ) - ) - if self.flavor == "win": - extra_bindings.append(("binary", output)) - if ( - "/NOENTRY" not in ldflags - and not self.msvs_settings.GetNoImportLibrary(config_name) - ): - self.target.import_lib = output + ".lib" - extra_bindings.append( - ("implibflag", "/IMPLIB:%s" % self.target.import_lib) - ) - pdbname = self.msvs_settings.GetPDBName( - config_name, self.ExpandSpecial, output + ".pdb" - ) - output = [output, self.target.import_lib] - if pdbname: - output.append(pdbname) - elif not self.is_mac_bundle: - output = [output, output + ".TOC"] - else: - command = command + "_notoc" - elif self.flavor == "win": - extra_bindings.append(("binary", output)) - pdbname = self.msvs_settings.GetPDBName( - config_name, self.ExpandSpecial, output + ".pdb" - ) - if pdbname: - output = [output, pdbname] - - if len(solibs): - extra_bindings.append( - ("solibs", gyp.common.EncodePOSIXShellList(sorted(solibs))) - ) - - ninja_file.build( - output, - command + command_suffix, - link_deps, - implicit=sorted(implicit_deps), - order_only=list(order_deps), - variables=extra_bindings, - ) - return linked_binary - - def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): - extra_link_deps = any( - self.target_outputs.get(dep).Linkable() - for dep in spec.get("dependencies", []) - if dep in self.target_outputs - ) - if spec["type"] == "none" or (not link_deps and not extra_link_deps): - # TODO(evan): don't call this function for 'none' target types, as - # it doesn't do anything, and we fake out a 'binary' with a stamp file. - self.target.binary = compile_deps - self.target.type = "none" - elif spec["type"] == "static_library": - self.target.binary = self.ComputeOutput(spec) - if ( - self.flavor not in ("mac", "openbsd", "netbsd", "win") - and not self.is_standalone_static_library - ): - self.ninja.build( - self.target.binary, "alink_thin", link_deps, order_only=compile_deps - ) - else: - variables = [] - if self.xcode_settings: - libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) - if libtool_flags: - variables.append(("libtool_flags", libtool_flags)) - if self.msvs_settings: - libflags = self.msvs_settings.GetLibFlags( - config_name, self.GypPathToNinja - ) - variables.append(("libflags", libflags)) - - if self.flavor != "mac" or len(self.archs) == 1: - self.AppendPostbuildVariable( - variables, spec, self.target.binary, self.target.binary - ) - self.ninja.build( - self.target.binary, - "alink", - link_deps, - order_only=compile_deps, - variables=variables, - ) - else: - inputs = [] - for arch in self.archs: - output = self.ComputeOutput(spec, arch) - self.arch_subninjas[arch].build( - output, - "alink", - link_deps[arch], - order_only=compile_deps, - variables=variables, - ) - inputs.append(output) - # TODO: It's not clear if - # libtool_flags should be passed to the alink - # call that combines single-arch .a files into a fat .a file. - self.AppendPostbuildVariable( - variables, spec, self.target.binary, self.target.binary - ) - self.ninja.build( - self.target.binary, - "alink", - inputs, - # FIXME: test proving order_only=compile_deps isn't - # needed. - variables=variables, - ) - else: - self.target.binary = self.WriteLink( - spec, config_name, config, link_deps, compile_deps - ) - return self.target.binary - - def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): - assert self.is_mac_bundle - package_framework = spec["type"] in ("shared_library", "loadable_module") - output = self.ComputeMacBundleOutput() - if is_empty: - output += ".stamp" - variables = [] - self.AppendPostbuildVariable( - variables, - spec, - output, - self.target.binary, - is_command_start=not package_framework, - ) - if package_framework and not is_empty: - if spec["type"] == "shared_library" and self.xcode_settings.isIOS: - self.ninja.build( - output, - "package_ios_framework", - mac_bundle_depends, - variables=variables, - ) - else: - variables.append(("version", self.xcode_settings.GetFrameworkVersion())) - self.ninja.build( - output, "package_framework", mac_bundle_depends, variables=variables - ) - else: - self.ninja.build(output, "stamp", mac_bundle_depends, variables=variables) - self.target.bundle = output - return output - - def GetToolchainEnv(self, additional_settings=None): - """Returns the variables toolchain would set for build steps.""" - env = self.GetSortedXcodeEnv(additional_settings=additional_settings) - if self.flavor == "win": - env = self.GetMsvsToolchainEnv(additional_settings=additional_settings) - return env - - def GetMsvsToolchainEnv(self, additional_settings=None): - """Returns the variables Visual Studio would set for build steps.""" - return self.msvs_settings.GetVSMacroEnv( - "$!PRODUCT_DIR", config=self.config_name - ) - - def GetSortedXcodeEnv(self, additional_settings=None): - """Returns the variables Xcode would set for build steps.""" - assert self.abs_build_dir - abs_build_dir = self.abs_build_dir - return gyp.xcode_emulation.GetSortedXcodeEnv( - self.xcode_settings, - abs_build_dir, - os.path.join(abs_build_dir, self.build_to_base), - self.config_name, - additional_settings, - ) - - def GetSortedXcodePostbuildEnv(self): - """Returns the variables Xcode would set for postbuild steps.""" - postbuild_settings = {} - # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. - # TODO(thakis): It would be nice to have some general mechanism instead. - strip_save_file = self.xcode_settings.GetPerTargetSetting( - "CHROMIUM_STRIP_SAVE_FILE" - ) - if strip_save_file: - postbuild_settings["CHROMIUM_STRIP_SAVE_FILE"] = strip_save_file - return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) - - def AppendPostbuildVariable( - self, variables, spec, output, binary, is_command_start=False - ): - """Adds a 'postbuild' variable if there is a postbuild for |output|.""" - postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) - if postbuild: - variables.append(("postbuilds", postbuild)) - - def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): - """Returns a shell command that runs all the postbuilds, and removes - |output| if any of them fails. If |is_command_start| is False, then the - returned string will start with ' && '.""" - if not self.xcode_settings or spec["type"] == "none" or not output: - return "" - output = QuoteShellArgument(output, self.flavor) - postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) - if output_binary is not None: - postbuilds = self.xcode_settings.AddImplicitPostbuilds( - self.config_name, - os.path.normpath(os.path.join(self.base_to_build, output)), - QuoteShellArgument( - os.path.normpath(os.path.join(self.base_to_build, output_binary)), - self.flavor, - ), - postbuilds, - quiet=True, - ) - - if not postbuilds: - return "" - # Postbuilds expect to be run in the gyp file's directory, so insert an - # implicit postbuild to cd to there. - postbuilds.insert( - 0, gyp.common.EncodePOSIXShellList(["cd", self.build_to_base]) - ) - env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) - # G will be non-null if any postbuild fails. Run all postbuilds in a - # subshell. - commands = ( - env - + " (" - + " && ".join([ninja_syntax.escape(command) for command in postbuilds]) - ) - command_string = ( - commands - + "); G=$$?; " - # Remove the final output if any postbuild failed. - "((exit $$G) || rm -rf %s) " % output - + "&& exit $$G)" - ) - if is_command_start: - return "(" + command_string + " && " - else: - return "$ && (" + command_string - - def ComputeExportEnvString(self, env): - """Given an environment, returns a string looking like - 'export FOO=foo; export BAR="${FOO} bar;' - that exports |env| to the shell.""" - export_str = [] - for k, v in env: - export_str.append( - "export %s=%s;" - % (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v))) - ) - return " ".join(export_str) - - def ComputeMacBundleOutput(self): - """Return the 'output' (full output path) to a bundle output directory.""" - assert self.is_mac_bundle - path = generator_default_variables["PRODUCT_DIR"] - return self.ExpandSpecial( - os.path.join(path, self.xcode_settings.GetWrapperName()) - ) - - def ComputeOutputFileName(self, spec, type=None): - """Compute the filename of the final output for the current target.""" - if not type: - type = spec["type"] - - default_variables = copy.copy(generator_default_variables) - CalculateVariables(default_variables, {"flavor": self.flavor}) - - # Compute filename prefix: the product prefix, or a default for - # the product type. - DEFAULT_PREFIX = { - "loadable_module": default_variables["SHARED_LIB_PREFIX"], - "shared_library": default_variables["SHARED_LIB_PREFIX"], - "static_library": default_variables["STATIC_LIB_PREFIX"], - "executable": default_variables["EXECUTABLE_PREFIX"], - } - prefix = spec.get("product_prefix", DEFAULT_PREFIX.get(type, "")) - - # Compute filename extension: the product extension, or a default - # for the product type. - DEFAULT_EXTENSION = { - "loadable_module": default_variables["SHARED_LIB_SUFFIX"], - "shared_library": default_variables["SHARED_LIB_SUFFIX"], - "static_library": default_variables["STATIC_LIB_SUFFIX"], - "executable": default_variables["EXECUTABLE_SUFFIX"], - } - extension = spec.get("product_extension") - if extension: - extension = "." + extension - else: - extension = DEFAULT_EXTENSION.get(type, "") - - if "product_name" in spec: - # If we were given an explicit name, use that. - target = spec["product_name"] - else: - # Otherwise, derive a name from the target name. - target = spec["target_name"] - if prefix == "lib": - # Snip out an extra 'lib' from libs if appropriate. - target = StripPrefix(target, "lib") - - if type in ( - "static_library", - "loadable_module", - "shared_library", - "executable", - ): - return f"{prefix}{target}{extension}" - elif type == "none": - return "%s.stamp" % target - else: - raise Exception("Unhandled output type %s" % type) - - def ComputeOutput(self, spec, arch=None): - """Compute the path for the final output of the spec.""" - type = spec["type"] - - if self.flavor == "win": - override = self.msvs_settings.GetOutputName( - self.config_name, self.ExpandSpecial - ) - if override: - return override - - if ( - arch is None - and self.flavor == "mac" - and type - in ("static_library", "executable", "shared_library", "loadable_module") - ): - filename = self.xcode_settings.GetExecutablePath() - else: - filename = self.ComputeOutputFileName(spec, type) - - if arch is None and "product_dir" in spec: - path = os.path.join(spec["product_dir"], filename) - return self.ExpandSpecial(path) - - # Some products go into the output root, libraries go into shared library - # dir, and everything else goes into the normal place. - type_in_output_root = ["executable", "loadable_module"] - if self.flavor == "mac" and self.toolset == "target": - type_in_output_root += ["shared_library", "static_library"] - elif self.flavor == "win" and self.toolset == "target": - type_in_output_root += ["shared_library"] - - if arch is not None: - # Make sure partial executables don't end up in a bundle or the regular - # output directory. - archdir = "arch" - if self.toolset != "target": - archdir = os.path.join("arch", "%s" % self.toolset) - return os.path.join(archdir, AddArch(filename, arch)) - elif type in type_in_output_root or self.is_standalone_static_library: - return filename - elif type == "shared_library": - libdir = "lib" - if self.toolset != "target": - libdir = os.path.join("lib", "%s" % self.toolset) - return os.path.join(libdir, filename) - else: - return self.GypPathToUniqueOutput(filename, qualified=False) - - def WriteVariableList(self, ninja_file, var, values): - assert not isinstance(values, str) - if values is None: - values = [] - ninja_file.variable(var, " ".join(values)) - - def WriteNewNinjaRule( - self, name, args, description, win_shell_flags, env, pool, depfile=None - ): - """Write out a new ninja "rule" statement for a given command. - - Returns the name of the new rule, and a copy of |args| with variables - expanded.""" - - if self.flavor == "win": - args = [ - self.msvs_settings.ConvertVSMacros( - arg, self.base_to_build, config=self.config_name - ) - for arg in args - ] - description = self.msvs_settings.ConvertVSMacros( - description, config=self.config_name - ) - elif self.flavor == "mac": - # |env| is an empty list on non-mac. - args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] - description = gyp.xcode_emulation.ExpandEnvVars(description, env) - - # TODO: we shouldn't need to qualify names; we do it because - # currently the ninja rule namespace is global, but it really - # should be scoped to the subninja. - rule_name = self.name - if self.toolset == "target": - rule_name += "." + self.toolset - rule_name += "." + name - rule_name = re.sub("[^a-zA-Z0-9_]", "_", rule_name) - - # Remove variable references, but not if they refer to the magic rule - # variables. This is not quite right, as it also protects these for - # actions, not just for rules where they are valid. Good enough. - protect = ["${root}", "${dirname}", "${source}", "${ext}", "${name}"] - protect = "(?!" + "|".join(map(re.escape, protect)) + ")" - description = re.sub(protect + r"\$", "_", description) - - # gyp dictates that commands are run from the base directory. - # cd into the directory before running, and adjust paths in - # the arguments to point to the proper locations. - rspfile = None - rspfile_content = None - args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] - if self.flavor == "win": - rspfile = rule_name + ".$unique_name.rsp" - # The cygwin case handles this inside the bash sub-shell. - run_in = "" if win_shell_flags.cygwin else " " + self.build_to_base - if win_shell_flags.cygwin: - rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( - args, self.build_to_base - ) - else: - rspfile_content = gyp.msvs_emulation.EncodeRspFileList( - args, win_shell_flags.quote) - command = ( - "%s gyp-win-tool action-wrapper $arch " % sys.executable - + rspfile - + run_in - ) - else: - env = self.ComputeExportEnvString(env) - command = gyp.common.EncodePOSIXShellList(args) - command = "cd %s; " % self.build_to_base + env + command - - # GYP rules/actions express being no-ops by not touching their outputs. - # Avoid executing downstream dependencies in this case by specifying - # restat=1 to ninja. - self.ninja.rule( - rule_name, - command, - description, - depfile=depfile, - restat=True, - pool=pool, - rspfile=rspfile, - rspfile_content=rspfile_content, - ) - self.ninja.newline() - - return rule_name, args - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - global generator_additional_non_configuration_keys - global generator_additional_path_sections - flavor = gyp.common.GetFlavor(params) - if flavor == "mac": - default_variables.setdefault("OS", "mac") - default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") - default_variables.setdefault( - "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - default_variables.setdefault( - "LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - - # Copy additional generator configuration data from Xcode, which is shared - # by the Mac Ninja generator. - import gyp.generator.xcode as xcode_generator - - generator_additional_non_configuration_keys = getattr( - xcode_generator, "generator_additional_non_configuration_keys", [] - ) - generator_additional_path_sections = getattr( - xcode_generator, "generator_additional_path_sections", [] - ) - global generator_extra_sources_for_rules - generator_extra_sources_for_rules = getattr( - xcode_generator, "generator_extra_sources_for_rules", [] - ) - elif flavor == "win": - exts = gyp.MSVSUtil.TARGET_TYPE_EXT - default_variables.setdefault("OS", "win") - default_variables["EXECUTABLE_SUFFIX"] = "." + exts["executable"] - default_variables["STATIC_LIB_PREFIX"] = "" - default_variables["STATIC_LIB_SUFFIX"] = "." + exts["static_library"] - default_variables["SHARED_LIB_PREFIX"] = "" - default_variables["SHARED_LIB_SUFFIX"] = "." + exts["shared_library"] - - # Copy additional generator configuration data from VS, which is shared - # by the Windows Ninja generator. - import gyp.generator.msvs as msvs_generator - - generator_additional_non_configuration_keys = getattr( - msvs_generator, "generator_additional_non_configuration_keys", [] - ) - generator_additional_path_sections = getattr( - msvs_generator, "generator_additional_path_sections", [] - ) - - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - else: - operating_system = flavor - if flavor == "android": - operating_system = "linux" # Keep this legacy behavior for now. - default_variables.setdefault("OS", operating_system) - default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") - default_variables.setdefault( - "SHARED_LIB_DIR", os.path.join("$!PRODUCT_DIR", "lib") - ) - default_variables.setdefault("LIB_DIR", os.path.join("$!PRODUCT_DIR", "obj")) - - -def ComputeOutputDir(params): - """Returns the path from the toplevel_dir to the build output directory.""" - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to ninja easier, ninja doesn't put anything here. - generator_dir = os.path.relpath(params["options"].generator_output or ".") - - # output_dir: relative path from generator_dir to the build directory. - output_dir = params.get("generator_flags", {}).get("output_dir", "out") - - # Relative path from source root to our output files. e.g. "out" - return os.path.normpath(os.path.join(generator_dir, output_dir)) - - -def CalculateGeneratorInputInfo(params): - """Called by __init__ to initialize generator values based on params.""" - # E.g. "out/gypfiles" - toplevel = params["options"].toplevel_dir - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, ComputeOutputDir(params), "gypfiles") - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def OpenOutput(path, mode="w"): - """Open |path| for writing, creating directories if necessary.""" - gyp.common.EnsureDirExists(path) - return open(path, mode) - - -def CommandWithWrapper(cmd, wrappers, prog): - wrapper = wrappers.get(cmd, "") - if wrapper: - return wrapper + " " + prog - return prog - - -def GetDefaultConcurrentLinks(): - """Returns a best-guess for a number of concurrent links.""" - pool_size = int(os.environ.get("GYP_LINK_CONCURRENCY", 0)) - if pool_size: - return pool_size - - if sys.platform in ("win32", "cygwin"): - import ctypes - - class MEMORYSTATUSEX(ctypes.Structure): - _fields_ = [ - ("dwLength", ctypes.c_ulong), - ("dwMemoryLoad", ctypes.c_ulong), - ("ullTotalPhys", ctypes.c_ulonglong), - ("ullAvailPhys", ctypes.c_ulonglong), - ("ullTotalPageFile", ctypes.c_ulonglong), - ("ullAvailPageFile", ctypes.c_ulonglong), - ("ullTotalVirtual", ctypes.c_ulonglong), - ("ullAvailVirtual", ctypes.c_ulonglong), - ("sullAvailExtendedVirtual", ctypes.c_ulonglong), - ] - - stat = MEMORYSTATUSEX() - stat.dwLength = ctypes.sizeof(stat) - ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) - - # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM - # on a 64 GB machine. - mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB - hard_cap = max(1, int(os.environ.get("GYP_LINK_CONCURRENCY_MAX", 2 ** 32))) - return min(mem_limit, hard_cap) - elif sys.platform.startswith("linux"): - if os.path.exists("/proc/meminfo"): - with open("/proc/meminfo") as meminfo: - memtotal_re = re.compile(r"^MemTotal:\s*(\d*)\s*kB") - for line in meminfo: - match = memtotal_re.match(line) - if not match: - continue - # Allow 8Gb per link on Linux because Gold is quite memory hungry - return max(1, int(match.group(1)) // (8 * (2 ** 20))) - return 1 - elif sys.platform == "darwin": - try: - avail_bytes = int(subprocess.check_output(["sysctl", "-n", "hw.memsize"])) - # A static library debug build of Chromium's unit_tests takes ~2.7GB, so - # 4GB per ld process allows for some more bloat. - return max(1, avail_bytes // (4 * (2 ** 30))) # total / 4GB - except subprocess.CalledProcessError: - return 1 - else: - # TODO(scottmg): Implement this for other platforms. - return 1 - - -def _GetWinLinkRuleNameSuffix(embed_manifest): - """Returns the suffix used to select an appropriate linking rule depending on - whether the manifest embedding is enabled.""" - return "_embed" if embed_manifest else "" - - -def _AddWinLinkRules(master_ninja, embed_manifest): - """Adds link rules for Windows platform to |master_ninja|.""" - - def FullLinkCommand(ldcmd, out, binary_type): - resource_name = {"exe": "1", "dll": "2"}[binary_type] - return ( - "%(python)s gyp-win-tool link-with-manifests $arch %(embed)s " - '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' - "$manifests" - % { - "python": sys.executable, - "out": out, - "ldcmd": ldcmd, - "resname": resource_name, - "embed": embed_manifest, - } - ) - - rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) - use_separate_mspdbsrv = int(os.environ.get("GYP_USE_SEPARATE_MSPDBSRV", "0")) != 0 - dlldesc = "LINK%s(DLL) $binary" % rule_name_suffix.upper() - dllcmd = ( - "%s gyp-win-tool link-wrapper $arch %s " - "$ld /nologo $implibflag /DLL /OUT:$binary " - "@$binary.rsp" % (sys.executable, use_separate_mspdbsrv) - ) - dllcmd = FullLinkCommand(dllcmd, "$binary", "dll") - master_ninja.rule( - "solink" + rule_name_suffix, - description=dlldesc, - command=dllcmd, - rspfile="$binary.rsp", - rspfile_content="$libs $in_newline $ldflags", - restat=True, - pool="link_pool", - ) - master_ninja.rule( - "solink_module" + rule_name_suffix, - description=dlldesc, - command=dllcmd, - rspfile="$binary.rsp", - rspfile_content="$libs $in_newline $ldflags", - restat=True, - pool="link_pool", - ) - # Note that ldflags goes at the end so that it has the option of - # overriding default settings earlier in the command line. - exe_cmd = ( - "%s gyp-win-tool link-wrapper $arch %s " - "$ld /nologo /OUT:$binary @$binary.rsp" - % (sys.executable, use_separate_mspdbsrv) - ) - exe_cmd = FullLinkCommand(exe_cmd, "$binary", "exe") - master_ninja.rule( - "link" + rule_name_suffix, - description="LINK%s $binary" % rule_name_suffix.upper(), - command=exe_cmd, - rspfile="$binary.rsp", - rspfile_content="$in_newline $libs $ldflags", - pool="link_pool", - ) - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): - options = params["options"] - flavor = gyp.common.GetFlavor(params) - generator_flags = params.get("generator_flags", {}) - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath(os.path.join(ComputeOutputDir(params), config_name)) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - - master_ninja_file = OpenOutput(os.path.join(toplevel_build, "build.ninja")) - master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) - - # Put build-time support tools in out/{config_name}. - gyp.common.CopyTool(flavor, toplevel_build, generator_flags) - - # Grab make settings for CC/CXX. - # The rules are - # - The priority from low to high is gcc/g++, the 'make_global_settings' in - # gyp, the environment variable. - # - If there is no 'make_global_settings' for CC.host/CXX.host or - # 'CC_host'/'CXX_host' environment variable, cc_host/cxx_host should be set - # to cc/cxx. - if flavor == "win": - ar = "lib.exe" - # cc and cxx must be set to the correct architecture by overriding with one - # of cl_x86 or cl_x64 below. - cc = "UNSET" - cxx = "UNSET" - ld = "link.exe" - ld_host = "$ld" - else: - ar = "ar" - cc = "cc" - cxx = "c++" - ld = "$cc" - ldxx = "$cxx" - ld_host = "$cc_host" - ldxx_host = "$cxx_host" - - ar_host = ar - cc_host = None - cxx_host = None - cc_host_global_setting = None - cxx_host_global_setting = None - clang_cl = None - nm = "nm" - nm_host = "nm" - readelf = "readelf" - readelf_host = "readelf" - - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings = data[build_file].get("make_global_settings", []) - build_to_root = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - wrappers = {} - for key, value in make_global_settings: - if key == "AR": - ar = os.path.join(build_to_root, value) - if key == "AR.host": - ar_host = os.path.join(build_to_root, value) - if key == "CC": - cc = os.path.join(build_to_root, value) - if cc.endswith("clang-cl"): - clang_cl = cc - if key == "CXX": - cxx = os.path.join(build_to_root, value) - if key == "CC.host": - cc_host = os.path.join(build_to_root, value) - cc_host_global_setting = value - if key == "CXX.host": - cxx_host = os.path.join(build_to_root, value) - cxx_host_global_setting = value - if key == "LD": - ld = os.path.join(build_to_root, value) - if key == "LD.host": - ld_host = os.path.join(build_to_root, value) - if key == "LDXX": - ldxx = os.path.join(build_to_root, value) - if key == "LDXX.host": - ldxx_host = os.path.join(build_to_root, value) - if key == "NM": - nm = os.path.join(build_to_root, value) - if key == "NM.host": - nm_host = os.path.join(build_to_root, value) - if key == "READELF": - readelf = os.path.join(build_to_root, value) - if key == "READELF.host": - readelf_host = os.path.join(build_to_root, value) - if key.endswith("_wrapper"): - wrappers[key[: -len("_wrapper")]] = os.path.join(build_to_root, value) - - # Support wrappers from environment variables too. - for key, value in os.environ.items(): - if key.lower().endswith("_wrapper"): - key_prefix = key[: -len("_wrapper")] - key_prefix = re.sub(r"\.HOST$", ".host", key_prefix) - wrappers[key_prefix] = os.path.join(build_to_root, value) - - mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) - if mac_toolchain_dir: - wrappers["LINK"] = "export DEVELOPER_DIR='%s' &&" % mac_toolchain_dir - - if flavor == "win": - configs = [ - target_dicts[qualified_target]["configurations"][config_name] - for qualified_target in target_list - ] - shared_system_includes = None - if not generator_flags.get("ninja_use_custom_environment_files", 0): - shared_system_includes = gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( - configs, generator_flags - ) - cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( - toplevel_build, generator_flags, shared_system_includes, OpenOutput - ) - for arch, path in sorted(cl_paths.items()): - if clang_cl: - # If we have selected clang-cl, use that instead. - path = clang_cl - command = CommandWithWrapper( - "CC", wrappers, QuoteShellArgument(path, "win") - ) - if clang_cl: - # Use clang-cl to cross-compile for x86 or x86_64. - command += " -m32" if arch == "x86" else " -m64" - master_ninja.variable("cl_" + arch, command) - - cc = GetEnvironFallback(["CC_target", "CC"], cc) - master_ninja.variable("cc", CommandWithWrapper("CC", wrappers, cc)) - cxx = GetEnvironFallback(["CXX_target", "CXX"], cxx) - master_ninja.variable("cxx", CommandWithWrapper("CXX", wrappers, cxx)) - - if flavor == "win": - master_ninja.variable("ld", ld) - master_ninja.variable("idl", "midl.exe") - master_ninja.variable("ar", ar) - master_ninja.variable("rc", "rc.exe") - master_ninja.variable("ml_x86", "ml.exe") - master_ninja.variable("ml_x64", "ml64.exe") - master_ninja.variable("mt", "mt.exe") - else: - master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld)) - master_ninja.variable("ldxx", CommandWithWrapper("LINK", wrappers, ldxx)) - master_ninja.variable("ar", GetEnvironFallback(["AR_target", "AR"], ar)) - if flavor != "mac": - # Mac does not use readelf/nm for .TOC generation, so avoiding polluting - # the master ninja with extra unused variables. - master_ninja.variable("nm", GetEnvironFallback(["NM_target", "NM"], nm)) - master_ninja.variable( - "readelf", GetEnvironFallback(["READELF_target", "READELF"], readelf) - ) - - if generator_supports_multiple_toolsets: - if not cc_host: - cc_host = cc - if not cxx_host: - cxx_host = cxx - - master_ninja.variable("ar_host", GetEnvironFallback(["AR_host"], ar_host)) - master_ninja.variable("nm_host", GetEnvironFallback(["NM_host"], nm_host)) - master_ninja.variable( - "readelf_host", GetEnvironFallback(["READELF_host"], readelf_host) - ) - cc_host = GetEnvironFallback(["CC_host"], cc_host) - cxx_host = GetEnvironFallback(["CXX_host"], cxx_host) - - # The environment variable could be used in 'make_global_settings', like - # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. - if "$(CC)" in cc_host and cc_host_global_setting: - cc_host = cc_host_global_setting.replace("$(CC)", cc) - if "$(CXX)" in cxx_host and cxx_host_global_setting: - cxx_host = cxx_host_global_setting.replace("$(CXX)", cxx) - master_ninja.variable( - "cc_host", CommandWithWrapper("CC.host", wrappers, cc_host) - ) - master_ninja.variable( - "cxx_host", CommandWithWrapper("CXX.host", wrappers, cxx_host) - ) - if flavor == "win": - master_ninja.variable("ld_host", ld_host) - else: - master_ninja.variable( - "ld_host", CommandWithWrapper("LINK", wrappers, ld_host) - ) - master_ninja.variable( - "ldxx_host", CommandWithWrapper("LINK", wrappers, ldxx_host) - ) - - master_ninja.newline() - - master_ninja.pool("link_pool", depth=GetDefaultConcurrentLinks()) - master_ninja.newline() - - deps = "msvc" if flavor == "win" else "gcc" - - if flavor != "win": - master_ninja.rule( - "cc", - description="CC $out", - command=( - "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c " - "$cflags_pch_c -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - master_ninja.rule( - "cc_s", - description="CC $out", - command=( - "$cc $defines $includes $cflags $cflags_c " - "$cflags_pch_c -c $in -o $out" - ), - ) - master_ninja.rule( - "cxx", - description="CXX $out", - command=( - "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc " - "$cflags_pch_cc -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - else: - # TODO(scottmg) Separate pdb names is a test to see if it works around - # http://crbug.com/142362. It seems there's a race between the creation of - # the .pdb by the precompiled header step for .cc and the compilation of - # .c files. This should be handled by mspdbsrv, but rarely errors out with - # c1xx : fatal error C1033: cannot open program database - # By making the rules target separate pdb files this might be avoided. - cc_command = ( - "ninja -t msvc -e $arch " + "-- " - "$cc /nologo /showIncludes /FC " - "@$out.rsp /c $in /Fo$out /Fd$pdbname_c " - ) - cxx_command = ( - "ninja -t msvc -e $arch " + "-- " - "$cxx /nologo /showIncludes /FC " - "@$out.rsp /c $in /Fo$out /Fd$pdbname_cc " - ) - master_ninja.rule( - "cc", - description="CC $out", - command=cc_command, - rspfile="$out.rsp", - rspfile_content="$defines $includes $cflags $cflags_c", - deps=deps, - ) - master_ninja.rule( - "cxx", - description="CXX $out", - command=cxx_command, - rspfile="$out.rsp", - rspfile_content="$defines $includes $cflags $cflags_cc", - deps=deps, - ) - master_ninja.rule( - "idl", - description="IDL $in", - command=( - "%s gyp-win-tool midl-wrapper $arch $outdir " - "$tlb $h $dlldata $iid $proxy $in " - "$midl_includes $idlflags" % sys.executable - ), - ) - master_ninja.rule( - "rc", - description="RC $in", - # Note: $in must be last otherwise rc.exe complains. - command=( - "%s gyp-win-tool rc-wrapper " - "$arch $rc $defines $resource_includes $rcflags /fo$out $in" - % sys.executable - ), - ) - master_ninja.rule( - "asm", - description="ASM $out", - command=( - "%s gyp-win-tool asm-wrapper " - "$arch $asm $defines $includes $asmflags /c /Fo $out $in" - % sys.executable - ), - ) - - if flavor != "mac" and flavor != "win": - master_ninja.rule( - "alink", - description="AR $out", - command="rm -f $out && $ar rcs $arflags $out $in", - ) - master_ninja.rule( - "alink_thin", - description="AR $out", - command="rm -f $out && $ar rcsT $arflags $out $in", - ) - - # This allows targets that only need to depend on $lib's API to declare an - # order-only dependency on $lib.TOC and avoid relinking such downstream - # dependencies when $lib changes only in non-public ways. - # The resulting string leaves an uninterpolated %{suffix} which - # is used in the final substitution below. - mtime_preserving_solink_base = ( - "if [ ! -e $lib -o ! -e $lib.TOC ]; then " - "%(solink)s && %(extract_toc)s > $lib.TOC; else " - "%(solink)s && %(extract_toc)s > $lib.tmp && " - "if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; " - "fi; fi" - % { - "solink": "$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s", - "extract_toc": ( - "{ $readelf -d $lib | grep SONAME ; " - "$nm -gD -f p $lib | cut -f1-2 -d' '; }" - ), - } - ) - - master_ninja.rule( - "solink", - description="SOLINK $lib", - restat=True, - command=mtime_preserving_solink_base - % {"suffix": "@$link_file_list"}, # noqa: E501 - rspfile="$link_file_list", - rspfile_content=( - "-Wl,--whole-archive $in $solibs -Wl," "--no-whole-archive $libs" - ), - pool="link_pool", - ) - master_ninja.rule( - "solink_module", - description="SOLINK(module) $lib", - restat=True, - command=mtime_preserving_solink_base % {"suffix": "@$link_file_list"}, - rspfile="$link_file_list", - rspfile_content="-Wl,--start-group $in $solibs $libs -Wl,--end-group", - pool="link_pool", - ) - master_ninja.rule( - "link", - description="LINK $out", - command=( - "$ld $ldflags -o $out " - "-Wl,--start-group $in $solibs $libs -Wl,--end-group" - ), - pool="link_pool", - ) - elif flavor == "win": - master_ninja.rule( - "alink", - description="LIB $out", - command=( - "%s gyp-win-tool link-wrapper $arch False " - "$ar /nologo /ignore:4221 /OUT:$out @$out.rsp" % sys.executable - ), - rspfile="$out.rsp", - rspfile_content="$in_newline $libflags", - ) - _AddWinLinkRules(master_ninja, embed_manifest=True) - _AddWinLinkRules(master_ninja, embed_manifest=False) - else: - master_ninja.rule( - "objc", - description="OBJC $out", - command=( - "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc " - "$cflags_pch_objc -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - master_ninja.rule( - "objcxx", - description="OBJCXX $out", - command=( - "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc " - "$cflags_pch_objcc -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - master_ninja.rule( - "alink", - description="LIBTOOL-STATIC $out, POSTBUILDS", - command="rm -f $out && " - "./gyp-mac-tool filter-libtool libtool $libtool_flags " - "-static -o $out $in" - "$postbuilds", - ) - master_ninja.rule( - "lipo", - description="LIPO $out, POSTBUILDS", - command="rm -f $out && lipo -create $in -output $out$postbuilds", - ) - master_ninja.rule( - "solipo", - description="SOLIPO $out, POSTBUILDS", - command=( - "rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&" - "%(extract_toc)s > $lib.TOC" - % { - "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " - "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }" - } - ), - ) - - # Record the public interface of $lib in $lib.TOC. See the corresponding - # comment in the posix section above for details. - solink_base = "$ld %(type)s $ldflags -o $lib %(suffix)s" - mtime_preserving_solink_base = ( - "if [ ! -e $lib -o ! -e $lib.TOC ] || " - # Always force dependent targets to relink if this library - # reexports something. Handling this correctly would require - # recursive TOC dumping but this is rare in practice, so punt. - "otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then " - "%(solink)s && %(extract_toc)s > $lib.TOC; " - "else " - "%(solink)s && %(extract_toc)s > $lib.tmp && " - "if ! cmp -s $lib.tmp $lib.TOC; then " - "mv $lib.tmp $lib.TOC ; " - "fi; " - "fi" - % { - "solink": solink_base, - "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " - "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }", - } - ) - - solink_suffix = "@$link_file_list$postbuilds" - master_ninja.rule( - "solink", - description="SOLINK $lib, POSTBUILDS", - restat=True, - command=mtime_preserving_solink_base - % {"suffix": solink_suffix, "type": "-shared"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - master_ninja.rule( - "solink_notoc", - description="SOLINK $lib, POSTBUILDS", - restat=True, - command=solink_base % {"suffix": solink_suffix, "type": "-shared"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - - master_ninja.rule( - "solink_module", - description="SOLINK(module) $lib, POSTBUILDS", - restat=True, - command=mtime_preserving_solink_base - % {"suffix": solink_suffix, "type": "-bundle"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - master_ninja.rule( - "solink_module_notoc", - description="SOLINK(module) $lib, POSTBUILDS", - restat=True, - command=solink_base % {"suffix": solink_suffix, "type": "-bundle"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - - master_ninja.rule( - "link", - description="LINK $out, POSTBUILDS", - command=("$ld $ldflags -o $out " "$in $solibs $libs$postbuilds"), - pool="link_pool", - ) - master_ninja.rule( - "preprocess_infoplist", - description="PREPROCESS INFOPLIST $out", - command=( - "$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && " - "plutil -convert xml1 $out $out" - ), - ) - master_ninja.rule( - "copy_infoplist", - description="COPY INFOPLIST $in", - command="$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys", - ) - master_ninja.rule( - "merge_infoplist", - description="MERGE INFOPLISTS $in", - command="$env ./gyp-mac-tool merge-info-plist $out $in", - ) - master_ninja.rule( - "compile_xcassets", - description="COMPILE XCASSETS $in", - command="$env ./gyp-mac-tool compile-xcassets $keys $in", - ) - master_ninja.rule( - "compile_ios_framework_headers", - description="COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in", - command="$env ./gyp-mac-tool compile-ios-framework-header-map $out " - "$framework $in && $env ./gyp-mac-tool " - "copy-ios-framework-headers $framework $copy_headers", - ) - master_ninja.rule( - "mac_tool", - description="MACTOOL $mactool_cmd $in", - command="$env ./gyp-mac-tool $mactool_cmd $in $out $binary", - ) - master_ninja.rule( - "package_framework", - description="PACKAGE FRAMEWORK $out, POSTBUILDS", - command="./gyp-mac-tool package-framework $out $version$postbuilds " - "&& touch $out", - ) - master_ninja.rule( - "package_ios_framework", - description="PACKAGE IOS FRAMEWORK $out, POSTBUILDS", - command="./gyp-mac-tool package-ios-framework $out $postbuilds " - "&& touch $out", - ) - if flavor == "win": - master_ninja.rule( - "stamp", - description="STAMP $out", - command="%s gyp-win-tool stamp $out" % sys.executable, - ) - else: - master_ninja.rule( - "stamp", description="STAMP $out", command="${postbuilds}touch $out" - ) - if flavor == "win": - master_ninja.rule( - "copy", - description="COPY $in $out", - command="%s gyp-win-tool recursive-mirror $in $out" % sys.executable, - ) - elif flavor == "zos": - master_ninja.rule( - "copy", - description="COPY $in $out", - command="rm -rf $out && cp -fRP $in $out", - ) - else: - master_ninja.rule( - "copy", - description="COPY $in $out", - command="ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)", - ) - master_ninja.newline() - - all_targets = set() - for build_file in params["build_files"]: - for target in gyp.common.AllTargets( - target_list, target_dicts, os.path.normpath(build_file) - ): - all_targets.add(target) - all_outputs = set() - - # target_outputs is a map from qualified target name to a Target object. - target_outputs = {} - # target_short_names is a map from target short name to a list of Target - # objects. - target_short_names = {} - - # short name of targets that were skipped because they didn't contain anything - # interesting. - # NOTE: there may be overlap between this an non_empty_target_names. - empty_target_names = set() - - # Set of non-empty short target names. - # NOTE: there may be overlap between this an empty_target_names. - non_empty_target_names = set() - - for qualified_target in target_list: - # qualified_target is like: third_party/icu/icu.gyp:icui18n#target - build_file, name, toolset = gyp.common.ParseQualifiedTarget(qualified_target) - - this_make_global_settings = data[build_file].get("make_global_settings", []) - assert make_global_settings == this_make_global_settings, ( - "make_global_settings needs to be the same for all targets. " - f"{this_make_global_settings} vs. {make_global_settings}" - ) - - spec = target_dicts[qualified_target] - if flavor == "mac": - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - - # If build_file is a symlink, we must not follow it because there's a chance - # it could point to a path above toplevel_dir, and we cannot correctly deal - # with that case at the moment. - build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, False) - - qualified_target_for_hash = gyp.common.QualifiedTarget( - build_file, name, toolset - ) - qualified_target_for_hash = qualified_target_for_hash.encode("utf-8") - hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() - - base_path = os.path.dirname(build_file) - obj = "obj" - if toolset != "target": - obj += "." + toolset - output_file = os.path.join(obj, base_path, name + ".ninja") - - ninja_output = StringIO() - writer = NinjaWriter( - hash_for_rules, - target_outputs, - base_path, - build_dir, - ninja_output, - toplevel_build, - output_file, - flavor, - toplevel_dir=options.toplevel_dir, - ) - - target = writer.WriteSpec(spec, config_name, generator_flags) - - if ninja_output.tell() > 0: - # Only create files for ninja files that actually have contents. - with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: - ninja_file.write(ninja_output.getvalue()) - ninja_output.close() - master_ninja.subninja(output_file) - - if target: - if name != target.FinalOutput() and spec["toolset"] == "target": - target_short_names.setdefault(name, []).append(target) - target_outputs[qualified_target] = target - if qualified_target in all_targets: - all_outputs.add(target.FinalOutput()) - non_empty_target_names.add(name) - else: - empty_target_names.add(name) - - if target_short_names: - # Write a short name to build this target. This benefits both the - # "build chrome" case as well as the gyp tests, which expect to be - # able to run actions and build libraries by their short name. - master_ninja.newline() - master_ninja.comment("Short names for targets.") - for short_name in sorted(target_short_names): - master_ninja.build( - short_name, - "phony", - [x.FinalOutput() for x in target_short_names[short_name]], - ) - - # Write phony targets for any empty targets that weren't written yet. As - # short names are not necessarily unique only do this for short names that - # haven't already been output for another target. - empty_target_names = empty_target_names - non_empty_target_names - if empty_target_names: - master_ninja.newline() - master_ninja.comment("Empty targets (output for completeness).") - for name in sorted(empty_target_names): - master_ninja.build(name, "phony") - - if all_outputs: - master_ninja.newline() - master_ninja.build("all", "phony", sorted(all_outputs)) - master_ninja.default(generator_flags.get("default_target", "all")) - - master_ninja_file.close() - - -def PerformBuild(data, configurations, params): - options = params["options"] - for config in configurations: - builddir = os.path.join(options.toplevel_dir, "out", config) - arguments = ["ninja", "-C", builddir] - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def CallGenerateOutputForConfig(arglist): - # Ignore the interrupt signal so that the parent process catches it and - # kills all multiprocessing children. - signal.signal(signal.SIGINT, signal.SIG_IGN) - - (target_list, target_dicts, data, params, config_name) = arglist - GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) - - -def GenerateOutput(target_list, target_dicts, data, params): - # Update target_dicts for iOS device builds. - target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( - target_dicts - ) - - user_config = params.get("generator_flags", {}).get("config", None) - if gyp.common.GetFlavor(params) == "win": - target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) - target_list, target_dicts = MSVSUtil.InsertLargePdbShims( - target_list, target_dicts, generator_default_variables - ) - - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) - else: - config_names = target_dicts[target_list[0]]["configurations"] - if params["parallel"]: - try: - pool = multiprocessing.Pool(len(config_names)) - arglists = [] - for config_name in config_names: - arglists.append( - (target_list, target_dicts, data, params, config_name) - ) - pool.map(CallGenerateOutputForConfig, arglists) - except KeyboardInterrupt as e: - pool.terminate() - raise e - else: - for config_name in config_names: - GenerateOutputForConfig( - target_list, target_dicts, data, params, config_name - ) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py deleted file mode 100644 index 7d180685b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the ninja.py file. """ - -import sys -import unittest - -import gyp.generator.ninja as ninja - - -class TestPrefixesAndSuffixes(unittest.TestCase): - def test_BinaryNamesWindows(self): - # These cannot run on non-Windows as they require a VS installation to - # correctly handle variable expansion. - if sys.platform.startswith("win"): - writer = ninja.NinjaWriter( - "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "win" - ) - spec = {"target_name": "wee"} - self.assertTrue( - writer.ComputeOutputFileName(spec, "executable").endswith(".exe") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "shared_library").endswith(".dll") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "static_library").endswith(".lib") - ) - - def test_BinaryNamesLinux(self): - writer = ninja.NinjaWriter( - "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "linux" - ) - spec = {"target_name": "wee"} - self.assertTrue("." not in writer.ComputeOutputFileName(spec, "executable")) - self.assertTrue( - writer.ComputeOutputFileName(spec, "shared_library").startswith("lib") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "static_library").startswith("lib") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "shared_library").endswith(".so") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "static_library").endswith(".a") - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py deleted file mode 100644 index 2f4d17e51..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +++ /dev/null @@ -1,1394 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import filecmp -import gyp.common -import gyp.xcodeproj_file -import gyp.xcode_ninja -import errno -import os -import sys -import posixpath -import re -import shutil -import subprocess -import tempfile - - -# Project files generated by this module will use _intermediate_var as a -# custom Xcode setting whose value is a DerivedSources-like directory that's -# project-specific and configuration-specific. The normal choice, -# DERIVED_FILE_DIR, is target-specific, which is thought to be too restrictive -# as it is likely that multiple targets within a single project file will want -# to access the same set of generated files. The other option, -# PROJECT_DERIVED_FILE_DIR, is unsuitable because while it is project-specific, -# it is not configuration-specific. INTERMEDIATE_DIR is defined as -# $(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION). -_intermediate_var = "INTERMEDIATE_DIR" - -# SHARED_INTERMEDIATE_DIR is the same, except that it is shared among all -# targets that share the same BUILT_PRODUCTS_DIR. -_shared_intermediate_var = "SHARED_INTERMEDIATE_DIR" - -_library_search_paths_var = "LIBRARY_SEARCH_PATHS" - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_SUFFIX": ".dylib", - # INTERMEDIATE_DIR is a place for targets to build up intermediate products. - # It is specific to each build environment. It is only guaranteed to exist - # and be constant within the context of a project, corresponding to a single - # input file. Some build environments may allow their intermediate directory - # to be shared on a wider scale, but this is not guaranteed. - "INTERMEDIATE_DIR": "$(%s)" % _intermediate_var, - "OS": "mac", - "PRODUCT_DIR": "$(BUILT_PRODUCTS_DIR)", - "LIB_DIR": "$(BUILT_PRODUCTS_DIR)", - "RULE_INPUT_ROOT": "$(INPUT_FILE_BASE)", - "RULE_INPUT_EXT": "$(INPUT_FILE_SUFFIX)", - "RULE_INPUT_NAME": "$(INPUT_FILE_NAME)", - "RULE_INPUT_PATH": "$(INPUT_FILE_PATH)", - "RULE_INPUT_DIRNAME": "$(INPUT_FILE_DIRNAME)", - "SHARED_INTERMEDIATE_DIR": "$(%s)" % _shared_intermediate_var, - "CONFIGURATION_NAME": "$(CONFIGURATION)", -} - -# The Xcode-specific sections that hold paths. -generator_additional_path_sections = [ - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", - # 'mac_framework_dirs', input already handles _dirs endings. -] - -# The Xcode-specific keys that exist on targets and aren't moved down to -# configurations. -generator_additional_non_configuration_keys = [ - "ios_app_extension", - "ios_watch_app", - "ios_watchkit_extension", - "mac_bundle", - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", - "mac_xctest_bundle", - "mac_xcuitest_bundle", - "xcode_create_dependents_test_runner", -] - -# We want to let any rules apply to files that are resources also. -generator_extra_sources_for_rules = [ - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", -] - -generator_filelist_paths = None - -# Xcode's standard set of library directories, which don't need to be duplicated -# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. -xcode_standard_library_dirs = frozenset( - ["$(SDKROOT)/usr/lib", "$(SDKROOT)/usr/local/lib"] -) - - -def CreateXCConfigurationList(configuration_names): - xccl = gyp.xcodeproj_file.XCConfigurationList({"buildConfigurations": []}) - if len(configuration_names) == 0: - configuration_names = ["Default"] - for configuration_name in configuration_names: - xcbc = gyp.xcodeproj_file.XCBuildConfiguration({"name": configuration_name}) - xccl.AppendProperty("buildConfigurations", xcbc) - xccl.SetProperty("defaultConfigurationName", configuration_names[0]) - return xccl - - -class XcodeProject: - def __init__(self, gyp_path, path, build_file_dict): - self.gyp_path = gyp_path - self.path = path - self.project = gyp.xcodeproj_file.PBXProject(path=path) - projectDirPath = gyp.common.RelativePath( - os.path.dirname(os.path.abspath(self.gyp_path)), - os.path.dirname(path) or ".", - ) - self.project.SetProperty("projectDirPath", projectDirPath) - self.project_file = gyp.xcodeproj_file.XCProjectFile( - {"rootObject": self.project} - ) - self.build_file_dict = build_file_dict - - # TODO(mark): add destructor that cleans up self.path if created_dir is - # True and things didn't complete successfully. Or do something even - # better with "try"? - self.created_dir = False - try: - os.makedirs(self.path) - self.created_dir = True - except OSError as e: - if e.errno != errno.EEXIST: - raise - - def Finalize1(self, xcode_targets, serialize_all_tests): - # Collect a list of all of the build configuration names used by the - # various targets in the file. It is very heavily advised to keep each - # target in an entire project (even across multiple project files) using - # the same set of configuration names. - configurations = [] - for xct in self.project.GetProperty("targets"): - xccl = xct.GetProperty("buildConfigurationList") - xcbcs = xccl.GetProperty("buildConfigurations") - for xcbc in xcbcs: - name = xcbc.GetProperty("name") - if name not in configurations: - configurations.append(name) - - # Replace the XCConfigurationList attached to the PBXProject object with - # a new one specifying all of the configuration names used by the various - # targets. - try: - xccl = CreateXCConfigurationList(configurations) - self.project.SetProperty("buildConfigurationList", xccl) - except Exception: - sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path) - raise - - # The need for this setting is explained above where _intermediate_var is - # defined. The comments below about wanting to avoid project-wide build - # settings apply here too, but this needs to be set on a project-wide basis - # so that files relative to the _intermediate_var setting can be displayed - # properly in the Xcode UI. - # - # Note that for configuration-relative files such as anything relative to - # _intermediate_var, for the purposes of UI tree view display, Xcode will - # only resolve the configuration name once, when the project file is - # opened. If the active build configuration is changed, the project file - # must be closed and reopened if it is desired for the tree view to update. - # This is filed as Apple radar 6588391. - xccl.SetBuildSetting( - _intermediate_var, "$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)" - ) - xccl.SetBuildSetting( - _shared_intermediate_var, "$(SYMROOT)/DerivedSources/$(CONFIGURATION)" - ) - - # Set user-specified project-wide build settings and config files. This - # is intended to be used very sparingly. Really, almost everything should - # go into target-specific build settings sections. The project-wide - # settings are only intended to be used in cases where Xcode attempts to - # resolve variable references in a project context as opposed to a target - # context, such as when resolving sourceTree references while building up - # the tree tree view for UI display. - # Any values set globally are applied to all configurations, then any - # per-configuration values are applied. - for xck, xcv in self.build_file_dict.get("xcode_settings", {}).items(): - xccl.SetBuildSetting(xck, xcv) - if "xcode_config_file" in self.build_file_dict: - config_ref = self.project.AddOrGetFileInRootGroup( - self.build_file_dict["xcode_config_file"] - ) - xccl.SetBaseConfiguration(config_ref) - build_file_configurations = self.build_file_dict.get("configurations", {}) - if build_file_configurations: - for config_name in configurations: - build_file_configuration_named = build_file_configurations.get( - config_name, {} - ) - if build_file_configuration_named: - xcc = xccl.ConfigurationNamed(config_name) - for xck, xcv in build_file_configuration_named.get( - "xcode_settings", {} - ).items(): - xcc.SetBuildSetting(xck, xcv) - if "xcode_config_file" in build_file_configuration_named: - config_ref = self.project.AddOrGetFileInRootGroup( - build_file_configurations[config_name]["xcode_config_file"] - ) - xcc.SetBaseConfiguration(config_ref) - - # Sort the targets based on how they appeared in the input. - # TODO(mark): Like a lot of other things here, this assumes internal - # knowledge of PBXProject - in this case, of its "targets" property. - - # ordinary_targets are ordinary targets that are already in the project - # file. run_test_targets are the targets that run unittests and should be - # used for the Run All Tests target. support_targets are the action/rule - # targets used by GYP file targets, just kept for the assert check. - ordinary_targets = [] - run_test_targets = [] - support_targets = [] - - # targets is full list of targets in the project. - targets = [] - - # does the it define it's own "all"? - has_custom_all = False - - # targets_for_all is the list of ordinary_targets that should be listed - # in this project's "All" target. It includes each non_runtest_target - # that does not have suppress_wildcard set. - targets_for_all = [] - - for target in self.build_file_dict["targets"]: - target_name = target["target_name"] - toolset = target["toolset"] - qualified_target = gyp.common.QualifiedTarget( - self.gyp_path, target_name, toolset - ) - xcode_target = xcode_targets[qualified_target] - # Make sure that the target being added to the sorted list is already in - # the unsorted list. - assert xcode_target in self.project._properties["targets"] - targets.append(xcode_target) - ordinary_targets.append(xcode_target) - if xcode_target.support_target: - support_targets.append(xcode_target.support_target) - targets.append(xcode_target.support_target) - - if not int(target.get("suppress_wildcard", False)): - targets_for_all.append(xcode_target) - - if target_name.lower() == "all": - has_custom_all = True - - # If this target has a 'run_as' attribute, add its target to the - # targets, and add it to the test targets. - if target.get("run_as"): - # Make a target to run something. It should have one - # dependency, the parent xcode target. - xccl = CreateXCConfigurationList(configurations) - run_target = gyp.xcodeproj_file.PBXAggregateTarget( - { - "name": "Run " + target_name, - "productName": xcode_target.GetProperty("productName"), - "buildConfigurationList": xccl, - }, - parent=self.project, - ) - run_target.AddDependency(xcode_target) - - command = target["run_as"] - script = "" - if command.get("working_directory"): - script = ( - script - + 'cd "%s"\n' - % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - command.get("working_directory") - ) - ) - - if command.get("environment"): - script = ( - script - + "\n".join( - [ - 'export %s="%s"' - % ( - key, - gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - val - ), - ) - for (key, val) in command.get("environment").items() - ] - ) - + "\n" - ) - - # Some test end up using sockets, files on disk, etc. and can get - # confused if more then one test runs at a time. The generator - # flag 'xcode_serialize_all_test_runs' controls the forcing of all - # tests serially. It defaults to True. To get serial runs this - # little bit of python does the same as the linux flock utility to - # make sure only one runs at a time. - command_prefix = "" - if serialize_all_tests: - command_prefix = """python -c "import fcntl, subprocess, sys -file = open('$TMPDIR/GYP_serialize_test_runs', 'a') -fcntl.flock(file.fileno(), fcntl.LOCK_EX) -sys.exit(subprocess.call(sys.argv[1:]))" """ - - # If we were unable to exec for some reason, we want to exit - # with an error, and fixup variable references to be shell - # syntax instead of xcode syntax. - script = ( - script - + "exec " - + command_prefix - + "%s\nexit 1\n" - % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - gyp.common.EncodePOSIXShellList(command.get("action")) - ) - ) - - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - {"shellScript": script, "showEnvVarsInLog": 0} - ) - run_target.AppendProperty("buildPhases", ssbp) - - # Add the run target to the project file. - targets.append(run_target) - run_test_targets.append(run_target) - xcode_target.test_runner = run_target - - # Make sure that the list of targets being replaced is the same length as - # the one replacing it, but allow for the added test runner targets. - assert len(self.project._properties["targets"]) == len(ordinary_targets) + len( - support_targets - ) - - self.project._properties["targets"] = targets - - # Get rid of unnecessary levels of depth in groups like the Source group. - self.project.RootGroupsTakeOverOnlyChildren(True) - - # Sort the groups nicely. Do this after sorting the targets, because the - # Products group is sorted based on the order of the targets. - self.project.SortGroups() - - # Create an "All" target if there's more than one target in this project - # file and the project didn't define its own "All" target. Put a generated - # "All" target first so that people opening up the project for the first - # time will build everything by default. - if len(targets_for_all) > 1 and not has_custom_all: - xccl = CreateXCConfigurationList(configurations) - all_target = gyp.xcodeproj_file.PBXAggregateTarget( - {"buildConfigurationList": xccl, "name": "All"}, parent=self.project - ) - - for target in targets_for_all: - all_target.AddDependency(target) - - # TODO(mark): This is evil because it relies on internal knowledge of - # PBXProject._properties. It's important to get the "All" target first, - # though. - self.project._properties["targets"].insert(0, all_target) - - # The same, but for run_test_targets. - if len(run_test_targets) > 1: - xccl = CreateXCConfigurationList(configurations) - run_all_tests_target = gyp.xcodeproj_file.PBXAggregateTarget( - {"buildConfigurationList": xccl, "name": "Run All Tests"}, - parent=self.project, - ) - for run_test_target in run_test_targets: - run_all_tests_target.AddDependency(run_test_target) - - # Insert after the "All" target, which must exist if there is more than - # one run_test_target. - self.project._properties["targets"].insert(1, run_all_tests_target) - - def Finalize2(self, xcode_targets, xcode_target_to_target_dict): - # Finalize2 needs to happen in a separate step because the process of - # updating references to other projects depends on the ordering of targets - # within remote project files. Finalize1 is responsible for sorting duty, - # and once all project files are sorted, Finalize2 can come in and update - # these references. - - # To support making a "test runner" target that will run all the tests - # that are direct dependents of any given target, we look for - # xcode_create_dependents_test_runner being set on an Aggregate target, - # and generate a second target that will run the tests runners found under - # the marked target. - for bf_tgt in self.build_file_dict["targets"]: - if int(bf_tgt.get("xcode_create_dependents_test_runner", 0)): - tgt_name = bf_tgt["target_name"] - toolset = bf_tgt["toolset"] - qualified_target = gyp.common.QualifiedTarget( - self.gyp_path, tgt_name, toolset - ) - xcode_target = xcode_targets[qualified_target] - if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): - # Collect all the run test targets. - all_run_tests = [] - pbxtds = xcode_target.GetProperty("dependencies") - for pbxtd in pbxtds: - pbxcip = pbxtd.GetProperty("targetProxy") - dependency_xct = pbxcip.GetProperty("remoteGlobalIDString") - if hasattr(dependency_xct, "test_runner"): - all_run_tests.append(dependency_xct.test_runner) - - # Directly depend on all the runners as they depend on the target - # that builds them. - if len(all_run_tests) > 0: - run_all_target = gyp.xcodeproj_file.PBXAggregateTarget( - { - "name": "Run %s Tests" % tgt_name, - "productName": tgt_name, - }, - parent=self.project, - ) - for run_test_target in all_run_tests: - run_all_target.AddDependency(run_test_target) - - # Insert the test runner after the related target. - idx = self.project._properties["targets"].index(xcode_target) - self.project._properties["targets"].insert( - idx + 1, run_all_target - ) - - # Update all references to other projects, to make sure that the lists of - # remote products are complete. Otherwise, Xcode will fill them in when - # it opens the project file, which will result in unnecessary diffs. - # TODO(mark): This is evil because it relies on internal knowledge of - # PBXProject._other_pbxprojects. - for other_pbxproject in self.project._other_pbxprojects.keys(): - self.project.AddOrGetProjectReference(other_pbxproject) - - self.project.SortRemoteProductReferences() - - # Give everything an ID. - self.project_file.ComputeIDs() - - # Make sure that no two objects in the project file have the same ID. If - # multiple objects wind up with the same ID, upon loading the file, Xcode - # will only recognize one object (the last one in the file?) and the - # results are unpredictable. - self.project_file.EnsureNoIDCollisions() - - def Write(self): - # Write the project file to a temporary location first. Xcode watches for - # changes to the project file and presents a UI sheet offering to reload - # the project when it does change. However, in some cases, especially when - # multiple projects are open or when Xcode is busy, things don't work so - # seamlessly. Sometimes, Xcode is able to detect that a project file has - # changed but can't unload it because something else is referencing it. - # To mitigate this problem, and to avoid even having Xcode present the UI - # sheet when an open project is rewritten for inconsequential changes, the - # project file is written to a temporary file in the xcodeproj directory - # first. The new temporary file is then compared to the existing project - # file, if any. If they differ, the new file replaces the old; otherwise, - # the new project file is simply deleted. Xcode properly detects a file - # being renamed over an open project file as a change and so it remains - # able to present the "project file changed" sheet under this system. - # Writing to a temporary file first also avoids the possible problem of - # Xcode rereading an incomplete project file. - (output_fd, new_pbxproj_path) = tempfile.mkstemp( - suffix=".tmp", prefix="project.pbxproj.gyp.", dir=self.path - ) - - try: - output_file = os.fdopen(output_fd, "w") - - self.project_file.Print(output_file) - output_file.close() - - pbxproj_path = os.path.join(self.path, "project.pbxproj") - - same = False - try: - same = filecmp.cmp(pbxproj_path, new_pbxproj_path, False) - except OSError as e: - if e.errno != errno.ENOENT: - raise - - if same: - # The new file is identical to the old one, just get rid of the new - # one. - os.unlink(new_pbxproj_path) - else: - # The new file is different from the old one, or there is no old one. - # Rename the new file to the permanent name. - # - # tempfile.mkstemp uses an overly restrictive mode, resulting in a - # file that can only be read by the owner, regardless of the umask. - # There's no reason to not respect the umask here, which means that - # an extra hoop is required to fetch it and reset the new file's mode. - # - # No way to get the umask without setting a new one? Set a safe one - # and then set it back to the old value. - umask = os.umask(0o77) - os.umask(umask) - - os.chmod(new_pbxproj_path, 0o666 & ~umask) - os.rename(new_pbxproj_path, pbxproj_path) - - except Exception: - # Don't leave turds behind. In fact, if this code was responsible for - # creating the xcodeproj directory, get rid of that too. - os.unlink(new_pbxproj_path) - if self.created_dir: - shutil.rmtree(self.path, True) - raise - - -def AddSourceToTarget(source, type, pbxp, xct): - # TODO(mark): Perhaps source_extensions and library_extensions can be made a - # little bit fancier. - source_extensions = ["c", "cc", "cpp", "cxx", "m", "mm", "s", "swift"] - - # .o is conceptually more of a "source" than a "library," but Xcode thinks - # of "sources" as things to compile and "libraries" (or "frameworks") as - # things to link with. Adding an object file to an Xcode target's frameworks - # phase works properly. - library_extensions = ["a", "dylib", "framework", "o"] - - basename = posixpath.basename(source) - (root, ext) = posixpath.splitext(basename) - if ext: - ext = ext[1:].lower() - - if ext in source_extensions and type != "none": - xct.SourcesPhase().AddFile(source) - elif ext in library_extensions and type != "none": - xct.FrameworksPhase().AddFile(source) - else: - # Files that aren't added to a sources or frameworks build phase can still - # go into the project file, just not as part of a build phase. - pbxp.AddOrGetFileInRootGroup(source) - - -def AddResourceToTarget(resource, pbxp, xct): - # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call - # where it's used. - xct.ResourcesPhase().AddFile(resource) - - -def AddHeaderToTarget(header, pbxp, xct, is_public): - # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call - # where it's used. - settings = "{ATTRIBUTES = (%s, ); }" % ("Private", "Public")[is_public] - xct.HeadersPhase().AddFile(header, settings) - - -_xcode_variable_re = re.compile(r"(\$\((.*?)\))") - - -def ExpandXcodeVariables(string, expansions): - """Expands Xcode-style $(VARIABLES) in string per the expansions dict. - - In some rare cases, it is appropriate to expand Xcode variables when a - project file is generated. For any substring $(VAR) in string, if VAR is a - key in the expansions dict, $(VAR) will be replaced with expansions[VAR]. - Any $(VAR) substring in string for which VAR is not a key in the expansions - dict will remain in the returned string. - """ - - matches = _xcode_variable_re.findall(string) - if matches is None: - return string - - matches.reverse() - for match in matches: - (to_replace, variable) = match - if variable not in expansions: - continue - - replacement = expansions[variable] - string = re.sub(re.escape(to_replace), replacement, string) - - return string - - -_xcode_define_re = re.compile(r"([\\\"\' ])") - - -def EscapeXcodeDefine(s): - """We must escape the defines that we give to XCode so that it knows not to - split on spaces and to respect backslash and quote literals. However, we - must not quote the define, or Xcode will incorrectly interpret variables - especially $(inherited).""" - return re.sub(_xcode_define_re, r"\\\1", s) - - -def PerformBuild(data, configurations, params): - options = params["options"] - - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != ".gyp": - continue - xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" - if options.generator_output: - xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) - - for config in configurations: - arguments = ["xcodebuild", "-project", xcodeproj_path] - arguments += ["-configuration", config] - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def CalculateGeneratorInputInfo(params): - toplevel = params["options"].toplevel_dir - if params.get("flavor") == "ninja": - generator_dir = os.path.relpath(params["options"].generator_output or ".") - output_dir = params.get("generator_flags", {}).get("output_dir", "out") - output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, output_dir, "gypfiles-xcode-ninja") - ) - else: - output_dir = os.path.normpath(os.path.join(toplevel, "xcodebuild")) - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, output_dir, "gypfiles") - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def GenerateOutput(target_list, target_dicts, data, params): - # Optionally configure each spec to use ninja as the external builder. - ninja_wrapper = params.get("flavor") == "ninja" - if ninja_wrapper: - (target_list, target_dicts, data) = gyp.xcode_ninja.CreateWrapper( - target_list, target_dicts, data, params - ) - - options = params["options"] - generator_flags = params.get("generator_flags", {}) - parallel_builds = generator_flags.get("xcode_parallel_builds", True) - serialize_all_tests = generator_flags.get("xcode_serialize_all_test_runs", True) - upgrade_check_project_version = generator_flags.get( - "xcode_upgrade_check_project_version", None - ) - - # Format upgrade_check_project_version with leading zeros as needed. - if upgrade_check_project_version: - upgrade_check_project_version = str(upgrade_check_project_version) - while len(upgrade_check_project_version) < 4: - upgrade_check_project_version = "0" + upgrade_check_project_version - - skip_excluded_files = not generator_flags.get("xcode_list_excluded_files", True) - xcode_projects = {} - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != ".gyp": - continue - xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" - if options.generator_output: - xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) - xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) - xcode_projects[build_file] = xcp - pbxp = xcp.project - - # Set project-level attributes from multiple options - project_attributes = {} - if parallel_builds: - project_attributes["BuildIndependentTargetsInParallel"] = "YES" - if upgrade_check_project_version: - project_attributes["LastUpgradeCheck"] = upgrade_check_project_version - project_attributes[ - "LastTestingUpgradeCheck" - ] = upgrade_check_project_version - project_attributes["LastSwiftUpdateCheck"] = upgrade_check_project_version - pbxp.SetProperty("attributes", project_attributes) - - # Add gyp/gypi files to project - if not generator_flags.get("standalone"): - main_group = pbxp.GetProperty("mainGroup") - build_group = gyp.xcodeproj_file.PBXGroup({"name": "Build"}) - main_group.AppendChild(build_group) - for included_file in build_file_dict["included_files"]: - build_group.AddOrGetFileByPath(included_file, False) - - xcode_targets = {} - xcode_target_to_target_dict = {} - for qualified_target in target_list: - [build_file, target_name, toolset] = gyp.common.ParseQualifiedTarget( - qualified_target - ) - - spec = target_dicts[qualified_target] - if spec["toolset"] != "target": - raise Exception( - "Multiple toolsets not supported in xcode build (target %s)" - % qualified_target - ) - configuration_names = [spec["default_configuration"]] - for configuration_name in sorted(spec["configurations"].keys()): - if configuration_name not in configuration_names: - configuration_names.append(configuration_name) - xcp = xcode_projects[build_file] - pbxp = xcp.project - - # Set up the configurations for the target according to the list of names - # supplied. - xccl = CreateXCConfigurationList(configuration_names) - - # Create an XCTarget subclass object for the target. The type with - # "+bundle" appended will be used if the target has "mac_bundle" set. - # loadable_modules not in a mac_bundle are mapped to - # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets - # to create a single-file mh_bundle. - _types = { - "executable": "com.apple.product-type.tool", - "loadable_module": "com.googlecode.gyp.xcode.bundle", - "shared_library": "com.apple.product-type.library.dynamic", - "static_library": "com.apple.product-type.library.static", - "mac_kernel_extension": "com.apple.product-type.kernel-extension", - "executable+bundle": "com.apple.product-type.application", - "loadable_module+bundle": "com.apple.product-type.bundle", - "loadable_module+xctest": "com.apple.product-type.bundle.unit-test", - "loadable_module+xcuitest": "com.apple.product-type.bundle.ui-testing", - "shared_library+bundle": "com.apple.product-type.framework", - "executable+extension+bundle": "com.apple.product-type.app-extension", - "executable+watch+extension+bundle": - "com.apple.product-type.watchkit-extension", - "executable+watch+bundle": "com.apple.product-type.application.watchapp", - "mac_kernel_extension+bundle": "com.apple.product-type.kernel-extension", - } - - target_properties = { - "buildConfigurationList": xccl, - "name": target_name, - } - - type = spec["type"] - is_xctest = int(spec.get("mac_xctest_bundle", 0)) - is_xcuitest = int(spec.get("mac_xcuitest_bundle", 0)) - is_bundle = int(spec.get("mac_bundle", 0)) or is_xctest - is_app_extension = int(spec.get("ios_app_extension", 0)) - is_watchkit_extension = int(spec.get("ios_watchkit_extension", 0)) - is_watch_app = int(spec.get("ios_watch_app", 0)) - if type != "none": - type_bundle_key = type - if is_xcuitest: - type_bundle_key += "+xcuitest" - assert type == "loadable_module", ( - "mac_xcuitest_bundle targets must have type loadable_module " - "(target %s)" % target_name - ) - elif is_xctest: - type_bundle_key += "+xctest" - assert type == "loadable_module", ( - "mac_xctest_bundle targets must have type loadable_module " - "(target %s)" % target_name - ) - elif is_app_extension: - assert is_bundle, ( - "ios_app_extension flag requires mac_bundle " - "(target %s)" % target_name - ) - type_bundle_key += "+extension+bundle" - elif is_watchkit_extension: - assert is_bundle, ( - "ios_watchkit_extension flag requires mac_bundle " - "(target %s)" % target_name - ) - type_bundle_key += "+watch+extension+bundle" - elif is_watch_app: - assert is_bundle, ( - "ios_watch_app flag requires mac_bundle " - "(target %s)" % target_name - ) - type_bundle_key += "+watch+bundle" - elif is_bundle: - type_bundle_key += "+bundle" - - xctarget_type = gyp.xcodeproj_file.PBXNativeTarget - try: - target_properties["productType"] = _types[type_bundle_key] - except KeyError as e: - gyp.common.ExceptionAppend( - e, - "-- unknown product type while " "writing target %s" % target_name, - ) - raise - else: - xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget - assert not is_bundle, ( - 'mac_bundle targets cannot have type none (target "%s")' % target_name - ) - assert not is_xcuitest, ( - 'mac_xcuitest_bundle targets cannot have type none (target "%s")' - % target_name - ) - assert not is_xctest, ( - 'mac_xctest_bundle targets cannot have type none (target "%s")' - % target_name - ) - - target_product_name = spec.get("product_name") - if target_product_name is not None: - target_properties["productName"] = target_product_name - - xct = xctarget_type( - target_properties, - parent=pbxp, - force_outdir=spec.get("product_dir"), - force_prefix=spec.get("product_prefix"), - force_extension=spec.get("product_extension"), - ) - pbxp.AppendProperty("targets", xct) - xcode_targets[qualified_target] = xct - xcode_target_to_target_dict[xct] = spec - - spec_actions = spec.get("actions", []) - spec_rules = spec.get("rules", []) - - # Xcode has some "issues" with checking dependencies for the "Compile - # sources" step with any source files/headers generated by actions/rules. - # To work around this, if a target is building anything directly (not - # type "none"), then a second target is used to run the GYP actions/rules - # and is made a dependency of this target. This way the work is done - # before the dependency checks for what should be recompiled. - support_xct = None - # The Xcode "issues" don't affect xcode-ninja builds, since the dependency - # logic all happens in ninja. Don't bother creating the extra targets in - # that case. - if type != "none" and (spec_actions or spec_rules) and not ninja_wrapper: - support_xccl = CreateXCConfigurationList(configuration_names) - support_target_suffix = generator_flags.get( - "support_target_suffix", " Support" - ) - support_target_properties = { - "buildConfigurationList": support_xccl, - "name": target_name + support_target_suffix, - } - if target_product_name: - support_target_properties["productName"] = ( - target_product_name + " Support" - ) - support_xct = gyp.xcodeproj_file.PBXAggregateTarget( - support_target_properties, parent=pbxp - ) - pbxp.AppendProperty("targets", support_xct) - xct.AddDependency(support_xct) - # Hang the support target off the main target so it can be tested/found - # by the generator during Finalize. - xct.support_target = support_xct - - prebuild_index = 0 - - # Add custom shell script phases for "actions" sections. - for action in spec_actions: - # There's no need to write anything into the script to ensure that the - # output directories already exist, because Xcode will look at the - # declared outputs and automatically ensure that they exist for us. - - # Do we have a message to print when this action runs? - message = action.get("message") - if message: - message = "echo note: " + gyp.common.EncodePOSIXShellArgument(message) - else: - message = "" - - # Turn the list into a string that can be passed to a shell. - action_string = gyp.common.EncodePOSIXShellList(action["action"]) - - # Convert Xcode-type variable references to sh-compatible environment - # variable references. - message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) - action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - action_string - ) - - script = "" - # Include the optional message - if message_sh: - script += message_sh + "\n" - # Be sure the script runs in exec, and that if exec fails, the script - # exits signalling an error. - script += "exec " + action_string_sh + "\nexit 1\n" - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - { - "inputPaths": action["inputs"], - "name": 'Action "' + action["action_name"] + '"', - "outputPaths": action["outputs"], - "shellScript": script, - "showEnvVarsInLog": 0, - } - ) - - if support_xct: - support_xct.AppendProperty("buildPhases", ssbp) - else: - # TODO(mark): this assumes too much knowledge of the internals of - # xcodeproj_file; some of these smarts should move into xcodeproj_file - # itself. - xct._properties["buildPhases"].insert(prebuild_index, ssbp) - prebuild_index = prebuild_index + 1 - - # TODO(mark): Should verify that at most one of these is specified. - if int(action.get("process_outputs_as_sources", False)): - for output in action["outputs"]: - AddSourceToTarget(output, type, pbxp, xct) - - if int(action.get("process_outputs_as_mac_bundle_resources", False)): - for output in action["outputs"]: - AddResourceToTarget(output, pbxp, xct) - - # tgt_mac_bundle_resources holds the list of bundle resources so - # the rule processing can check against it. - if is_bundle: - tgt_mac_bundle_resources = spec.get("mac_bundle_resources", []) - else: - tgt_mac_bundle_resources = [] - - # Add custom shell script phases driving "make" for "rules" sections. - # - # Xcode's built-in rule support is almost powerful enough to use directly, - # but there are a few significant deficiencies that render them unusable. - # There are workarounds for some of its inadequacies, but in aggregate, - # the workarounds added complexity to the generator, and some workarounds - # actually require input files to be crafted more carefully than I'd like. - # Consequently, until Xcode rules are made more capable, "rules" input - # sections will be handled in Xcode output by shell script build phases - # performed prior to the compilation phase. - # - # The following problems with Xcode rules were found. The numbers are - # Apple radar IDs. I hope that these shortcomings are addressed, I really - # liked having the rules handled directly in Xcode during the period that - # I was prototyping this. - # - # 6588600 Xcode compiles custom script rule outputs too soon, compilation - # fails. This occurs when rule outputs from distinct inputs are - # interdependent. The only workaround is to put rules and their - # inputs in a separate target from the one that compiles the rule - # outputs. This requires input file cooperation and it means that - # process_outputs_as_sources is unusable. - # 6584932 Need to declare that custom rule outputs should be excluded from - # compilation. A possible workaround is to lie to Xcode about a - # rule's output, giving it a dummy file it doesn't know how to - # compile. The rule action script would need to touch the dummy. - # 6584839 I need a way to declare additional inputs to a custom rule. - # A possible workaround is a shell script phase prior to - # compilation that touches a rule's primary input files if any - # would-be additional inputs are newer than the output. Modifying - # the source tree - even just modification times - feels dirty. - # 6564240 Xcode "custom script" build rules always dump all environment - # variables. This is a low-prioroty problem and is not a - # show-stopper. - rules_by_ext = {} - for rule in spec_rules: - rules_by_ext[rule["extension"]] = rule - - # First, some definitions: - # - # A "rule source" is a file that was listed in a target's "sources" - # list and will have a rule applied to it on the basis of matching the - # rule's "extensions" attribute. Rule sources are direct inputs to - # rules. - # - # Rule definitions may specify additional inputs in their "inputs" - # attribute. These additional inputs are used for dependency tracking - # purposes. - # - # A "concrete output" is a rule output with input-dependent variables - # resolved. For example, given a rule with: - # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], - # if the target's "sources" list contained "one.ext" and "two.ext", - # the "concrete output" for rule input "two.ext" would be "two.cc". If - # a rule specifies multiple outputs, each input file that the rule is - # applied to will have the same number of concrete outputs. - # - # If any concrete outputs are outdated or missing relative to their - # corresponding rule_source or to any specified additional input, the - # rule action must be performed to generate the concrete outputs. - - # concrete_outputs_by_rule_source will have an item at the same index - # as the rule['rule_sources'] that it corresponds to. Each item is a - # list of all of the concrete outputs for the rule_source. - concrete_outputs_by_rule_source = [] - - # concrete_outputs_all is a flat list of all concrete outputs that this - # rule is able to produce, given the known set of input files - # (rule_sources) that apply to it. - concrete_outputs_all = [] - - # messages & actions are keyed by the same indices as rule['rule_sources'] - # and concrete_outputs_by_rule_source. They contain the message and - # action to perform after resolving input-dependent variables. The - # message is optional, in which case None is stored for each rule source. - messages = [] - actions = [] - - for rule_source in rule.get("rule_sources", []): - rule_source_dirname, rule_source_basename = posixpath.split(rule_source) - (rule_source_root, rule_source_ext) = posixpath.splitext( - rule_source_basename - ) - - # These are the same variable names that Xcode uses for its own native - # rule support. Because Xcode's rule engine is not being used, they - # need to be expanded as they are written to the makefile. - rule_input_dict = { - "INPUT_FILE_BASE": rule_source_root, - "INPUT_FILE_SUFFIX": rule_source_ext, - "INPUT_FILE_NAME": rule_source_basename, - "INPUT_FILE_PATH": rule_source, - "INPUT_FILE_DIRNAME": rule_source_dirname, - } - - concrete_outputs_for_this_rule_source = [] - for output in rule.get("outputs", []): - # Fortunately, Xcode and make both use $(VAR) format for their - # variables, so the expansion is the only transformation necessary. - # Any remaining $(VAR)-type variables in the string can be given - # directly to make, which will pick up the correct settings from - # what Xcode puts into the environment. - concrete_output = ExpandXcodeVariables(output, rule_input_dict) - concrete_outputs_for_this_rule_source.append(concrete_output) - - # Add all concrete outputs to the project. - pbxp.AddOrGetFileInRootGroup(concrete_output) - - concrete_outputs_by_rule_source.append( - concrete_outputs_for_this_rule_source - ) - concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) - - # TODO(mark): Should verify that at most one of these is specified. - if int(rule.get("process_outputs_as_sources", False)): - for output in concrete_outputs_for_this_rule_source: - AddSourceToTarget(output, type, pbxp, xct) - - # If the file came from the mac_bundle_resources list or if the rule - # is marked to process outputs as bundle resource, do so. - was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources - if was_mac_bundle_resource or int( - rule.get("process_outputs_as_mac_bundle_resources", False) - ): - for output in concrete_outputs_for_this_rule_source: - AddResourceToTarget(output, pbxp, xct) - - # Do we have a message to print when this rule runs? - message = rule.get("message") - if message: - message = gyp.common.EncodePOSIXShellArgument(message) - message = ExpandXcodeVariables(message, rule_input_dict) - messages.append(message) - - # Turn the list into a string that can be passed to a shell. - action_string = gyp.common.EncodePOSIXShellList(rule["action"]) - - action = ExpandXcodeVariables(action_string, rule_input_dict) - actions.append(action) - - if len(concrete_outputs_all) > 0: - # TODO(mark): There's a possibility for collision here. Consider - # target "t" rule "A_r" and target "t_A" rule "r". - makefile_name = "%s.make" % re.sub( - "[^a-zA-Z0-9_]", "_", "{}_{}".format(target_name, rule["rule_name"]) - ) - makefile_path = os.path.join( - xcode_projects[build_file].path, makefile_name - ) - # TODO(mark): try/close? Write to a temporary file and swap it only - # if it's got changes? - makefile = open(makefile_path, "w") - - # make will build the first target in the makefile by default. By - # convention, it's called "all". List all (or at least one) - # concrete output for each rule source as a prerequisite of the "all" - # target. - makefile.write("all: \\\n") - for concrete_output_index, concrete_output_by_rule_source in enumerate( - concrete_outputs_by_rule_source - ): - # Only list the first (index [0]) concrete output of each input - # in the "all" target. Otherwise, a parallel make (-j > 1) would - # attempt to process each input multiple times simultaneously. - # Otherwise, "all" could just contain the entire list of - # concrete_outputs_all. - concrete_output = concrete_output_by_rule_source[0] - if ( - concrete_output_index - == len(concrete_outputs_by_rule_source) - 1 - ): - eol = "" - else: - eol = " \\" - makefile.write(f" {concrete_output}{eol}\n") - - for (rule_source, concrete_outputs, message, action) in zip( - rule["rule_sources"], - concrete_outputs_by_rule_source, - messages, - actions, - ): - makefile.write("\n") - - # Add a rule that declares it can build each concrete output of a - # rule source. Collect the names of the directories that are - # required. - concrete_output_dirs = [] - for concrete_output_index, concrete_output in enumerate( - concrete_outputs - ): - if concrete_output_index == 0: - bol = "" - else: - bol = " " - makefile.write(f"{bol}{concrete_output} \\\n") - - concrete_output_dir = posixpath.dirname(concrete_output) - if ( - concrete_output_dir - and concrete_output_dir not in concrete_output_dirs - ): - concrete_output_dirs.append(concrete_output_dir) - - makefile.write(" : \\\n") - - # The prerequisites for this rule are the rule source itself and - # the set of additional rule inputs, if any. - prerequisites = [rule_source] - prerequisites.extend(rule.get("inputs", [])) - for prerequisite_index, prerequisite in enumerate(prerequisites): - if prerequisite_index == len(prerequisites) - 1: - eol = "" - else: - eol = " \\" - makefile.write(f" {prerequisite}{eol}\n") - - # Make sure that output directories exist before executing the rule - # action. - if len(concrete_output_dirs) > 0: - makefile.write( - '\t@mkdir -p "%s"\n' % '" "'.join(concrete_output_dirs) - ) - - # The rule message and action have already had - # the necessary variable substitutions performed. - if message: - # Mark it with note: so Xcode picks it up in build output. - makefile.write("\t@echo note: %s\n" % message) - makefile.write("\t%s\n" % action) - - makefile.close() - - # It might be nice to ensure that needed output directories exist - # here rather than in each target in the Makefile, but that wouldn't - # work if there ever was a concrete output that had an input-dependent - # variable anywhere other than in the leaf position. - - # Don't declare any inputPaths or outputPaths. If they're present, - # Xcode will provide a slight optimization by only running the script - # phase if any output is missing or outdated relative to any input. - # Unfortunately, it will also assume that all outputs are touched by - # the script, and if the outputs serve as files in a compilation - # phase, they will be unconditionally rebuilt. Since make might not - # rebuild everything that could be declared here as an output, this - # extra compilation activity is unnecessary. With inputPaths and - # outputPaths not supplied, make will always be called, but it knows - # enough to not do anything when everything is up-to-date. - - # To help speed things up, pass -j COUNT to make so it does some work - # in parallel. Don't use ncpus because Xcode will build ncpus targets - # in parallel and if each target happens to have a rules step, there - # would be ncpus^2 things going. With a machine that has 2 quad-core - # Xeons, a build can quickly run out of processes based on - # scheduling/other tasks, and randomly failing builds are no good. - script = ( - """JOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" -if [ "${JOB_COUNT}" -gt 4 ]; then - JOB_COUNT=4 -fi -exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}" -exit 1 -""" - % makefile_name - ) - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - { - "name": 'Rule "' + rule["rule_name"] + '"', - "shellScript": script, - "showEnvVarsInLog": 0, - } - ) - - if support_xct: - support_xct.AppendProperty("buildPhases", ssbp) - else: - # TODO(mark): this assumes too much knowledge of the internals of - # xcodeproj_file; some of these smarts should move - # into xcodeproj_file itself. - xct._properties["buildPhases"].insert(prebuild_index, ssbp) - prebuild_index = prebuild_index + 1 - - # Extra rule inputs also go into the project file. Concrete outputs were - # already added when they were computed. - groups = ["inputs", "inputs_excluded"] - if skip_excluded_files: - groups = [x for x in groups if not x.endswith("_excluded")] - for group in groups: - for item in rule.get(group, []): - pbxp.AddOrGetFileInRootGroup(item) - - # Add "sources". - for source in spec.get("sources", []): - (source_root, source_extension) = posixpath.splitext(source) - if source_extension[1:] not in rules_by_ext: - # AddSourceToTarget will add the file to a root group if it's not - # already there. - AddSourceToTarget(source, type, pbxp, xct) - else: - pbxp.AddOrGetFileInRootGroup(source) - - # Add "mac_bundle_resources" and "mac_framework_private_headers" if - # it's a bundle of any type. - if is_bundle: - for resource in tgt_mac_bundle_resources: - (resource_root, resource_extension) = posixpath.splitext(resource) - if resource_extension[1:] not in rules_by_ext: - AddResourceToTarget(resource, pbxp, xct) - else: - pbxp.AddOrGetFileInRootGroup(resource) - - for header in spec.get("mac_framework_private_headers", []): - AddHeaderToTarget(header, pbxp, xct, False) - - # Add "mac_framework_headers". These can be valid for both frameworks - # and static libraries. - if is_bundle or type == "static_library": - for header in spec.get("mac_framework_headers", []): - AddHeaderToTarget(header, pbxp, xct, True) - - # Add "copies". - pbxcp_dict = {} - for copy_group in spec.get("copies", []): - dest = copy_group["destination"] - if dest[0] not in ("/", "$"): - # Relative paths are relative to $(SRCROOT). - dest = "$(SRCROOT)/" + dest - - code_sign = int(copy_group.get("xcode_code_sign", 0)) - settings = (None, "{ATTRIBUTES = (CodeSignOnCopy, ); }")[code_sign] - - # Coalesce multiple "copies" sections in the same target with the same - # "destination" property into the same PBXCopyFilesBuildPhase, otherwise - # they'll wind up with ID collisions. - pbxcp = pbxcp_dict.get(dest, None) - if pbxcp is None: - pbxcp = gyp.xcodeproj_file.PBXCopyFilesBuildPhase( - {"name": "Copy to " + copy_group["destination"]}, parent=xct - ) - pbxcp.SetDestination(dest) - - # TODO(mark): The usual comment about this knowing too much about - # gyp.xcodeproj_file internals applies. - xct._properties["buildPhases"].insert(prebuild_index, pbxcp) - - pbxcp_dict[dest] = pbxcp - - for file in copy_group["files"]: - pbxcp.AddFile(file, settings) - - # Excluded files can also go into the project file. - if not skip_excluded_files: - for key in [ - "sources", - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", - ]: - excluded_key = key + "_excluded" - for item in spec.get(excluded_key, []): - pbxp.AddOrGetFileInRootGroup(item) - - # So can "inputs" and "outputs" sections of "actions" groups. - groups = ["inputs", "inputs_excluded", "outputs", "outputs_excluded"] - if skip_excluded_files: - groups = [x for x in groups if not x.endswith("_excluded")] - for action in spec.get("actions", []): - for group in groups: - for item in action.get(group, []): - # Exclude anything in BUILT_PRODUCTS_DIR. They're products, not - # sources. - if not item.startswith("$(BUILT_PRODUCTS_DIR)/"): - pbxp.AddOrGetFileInRootGroup(item) - - for postbuild in spec.get("postbuilds", []): - action_string_sh = gyp.common.EncodePOSIXShellList(postbuild["action"]) - script = "exec " + action_string_sh + "\nexit 1\n" - - # Make the postbuild step depend on the output of ld or ar from this - # target. Apparently putting the script step after the link step isn't - # sufficient to ensure proper ordering in all cases. With an input - # declared but no outputs, the script step should run every time, as - # desired. - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - { - "inputPaths": ["$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)"], - "name": 'Postbuild "' + postbuild["postbuild_name"] + '"', - "shellScript": script, - "showEnvVarsInLog": 0, - } - ) - xct.AppendProperty("buildPhases", ssbp) - - # Add dependencies before libraries, because adding a dependency may imply - # adding a library. It's preferable to keep dependencies listed first - # during a link phase so that they can override symbols that would - # otherwise be provided by libraries, which will usually include system - # libraries. On some systems, ld is finicky and even requires the - # libraries to be ordered in such a way that unresolved symbols in - # earlier-listed libraries may only be resolved by later-listed libraries. - # The Mac linker doesn't work that way, but other platforms do, and so - # their linker invocations need to be constructed in this way. There's - # no compelling reason for Xcode's linker invocations to differ. - - if "dependencies" in spec: - for dependency in spec["dependencies"]: - xct.AddDependency(xcode_targets[dependency]) - # The support project also gets the dependencies (in case they are - # needed for the actions/rules to work). - if support_xct: - support_xct.AddDependency(xcode_targets[dependency]) - - if "libraries" in spec: - for library in spec["libraries"]: - xct.FrameworksPhase().AddFile(library) - # Add the library's directory to LIBRARY_SEARCH_PATHS if necessary. - # I wish Xcode handled this automatically. - library_dir = posixpath.dirname(library) - if library_dir not in xcode_standard_library_dirs and ( - not xct.HasBuildSetting(_library_search_paths_var) - or library_dir not in xct.GetBuildSetting(_library_search_paths_var) - ): - xct.AppendBuildSetting(_library_search_paths_var, library_dir) - - for configuration_name in configuration_names: - configuration = spec["configurations"][configuration_name] - xcbc = xct.ConfigurationNamed(configuration_name) - for include_dir in configuration.get("mac_framework_dirs", []): - xcbc.AppendBuildSetting("FRAMEWORK_SEARCH_PATHS", include_dir) - for include_dir in configuration.get("include_dirs", []): - xcbc.AppendBuildSetting("HEADER_SEARCH_PATHS", include_dir) - for library_dir in configuration.get("library_dirs", []): - if library_dir not in xcode_standard_library_dirs and ( - not xcbc.HasBuildSetting(_library_search_paths_var) - or library_dir - not in xcbc.GetBuildSetting(_library_search_paths_var) - ): - xcbc.AppendBuildSetting(_library_search_paths_var, library_dir) - - if "defines" in configuration: - for define in configuration["defines"]: - set_define = EscapeXcodeDefine(define) - xcbc.AppendBuildSetting("GCC_PREPROCESSOR_DEFINITIONS", set_define) - if "xcode_settings" in configuration: - for xck, xcv in configuration["xcode_settings"].items(): - xcbc.SetBuildSetting(xck, xcv) - if "xcode_config_file" in configuration: - config_ref = pbxp.AddOrGetFileInRootGroup( - configuration["xcode_config_file"] - ) - xcbc.SetBaseConfiguration(config_ref) - - build_files = [] - for build_file, build_file_dict in data.items(): - if build_file.endswith(".gyp"): - build_files.append(build_file) - - for build_file in build_files: - xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) - - for build_file in build_files: - xcode_projects[build_file].Finalize2(xcode_targets, xcode_target_to_target_dict) - - for build_file in build_files: - xcode_projects[build_file].Write() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py deleted file mode 100644 index 49772d1f4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the xcode.py file. """ - -import gyp.generator.xcode as xcode -import unittest -import sys - - -class TestEscapeXcodeDefine(unittest.TestCase): - if sys.platform == "darwin": - - def test_InheritedRemainsUnescaped(self): - self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)") - - def test_Escaping(self): - self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/input.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/input.py deleted file mode 100644 index 354958bfb..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/input.py +++ /dev/null @@ -1,3137 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import ast - -import gyp.common -import gyp.simple_copy -import multiprocessing -import os.path -import re -import shlex -import signal -import subprocess -import sys -import threading -import traceback -from distutils.version import StrictVersion -from gyp.common import GypError -from gyp.common import OrderedSet - -# A list of types that are treated as linkable. -linkable_types = [ - "executable", - "shared_library", - "loadable_module", - "mac_kernel_extension", - "windows_driver", -] - -# A list of sections that contain links to other targets. -dependency_sections = ["dependencies", "export_dependent_settings"] - -# base_path_sections is a list of sections defined by GYP that contain -# pathnames. The generators can provide more keys, the two lists are merged -# into path_sections, but you should call IsPathSection instead of using either -# list directly. -base_path_sections = [ - "destination", - "files", - "include_dirs", - "inputs", - "libraries", - "outputs", - "sources", -] -path_sections = set() - -# These per-process dictionaries are used to cache build file data when loading -# in parallel mode. -per_process_data = {} -per_process_aux_data = {} - - -def IsPathSection(section): - # If section ends in one of the '=+?!' characters, it's applied to a section - # without the trailing characters. '/' is notably absent from this list, - # because there's no way for a regular expression to be treated as a path. - while section and section[-1:] in "=+?!": - section = section[:-1] - - if section in path_sections: - return True - - # Sections matching the regexp '_(dir|file|path)s?$' are also - # considered PathSections. Using manual string matching since that - # is much faster than the regexp and this can be called hundreds of - # thousands of times so micro performance matters. - if "_" in section: - tail = section[-6:] - if tail[-1] == "s": - tail = tail[:-1] - if tail[-5:] in ("_file", "_path"): - return True - return tail[-4:] == "_dir" - - return False - - -# base_non_configuration_keys is a list of key names that belong in the target -# itself and should not be propagated into its configurations. It is merged -# with a list that can come from the generator to -# create non_configuration_keys. -base_non_configuration_keys = [ - # Sections that must exist inside targets and not configurations. - "actions", - "configurations", - "copies", - "default_configuration", - "dependencies", - "dependencies_original", - "libraries", - "postbuilds", - "product_dir", - "product_extension", - "product_name", - "product_prefix", - "rules", - "run_as", - "sources", - "standalone_static_library", - "suppress_wildcard", - "target_name", - "toolset", - "toolsets", - "type", - # Sections that can be found inside targets or configurations, but that - # should not be propagated from targets into their configurations. - "variables", -] -non_configuration_keys = [] - -# Keys that do not belong inside a configuration dictionary. -invalid_configuration_keys = [ - "actions", - "all_dependent_settings", - "configurations", - "dependencies", - "direct_dependent_settings", - "libraries", - "link_settings", - "sources", - "standalone_static_library", - "target_name", - "type", -] - -# Controls whether or not the generator supports multiple toolsets. -multiple_toolsets = False - -# Paths for converting filelist paths to output paths: { -# toplevel, -# qualified_output_dir, -# } -generator_filelist_paths = None - - -def GetIncludedBuildFiles(build_file_path, aux_data, included=None): - """Return a list of all build files included into build_file_path. - - The returned list will contain build_file_path as well as all other files - that it included, either directly or indirectly. Note that the list may - contain files that were included into a conditional section that evaluated - to false and was not merged into build_file_path's dict. - - aux_data is a dict containing a key for each build file or included build - file. Those keys provide access to dicts whose "included" keys contain - lists of all other files included by the build file. - - included should be left at its default None value by external callers. It - is used for recursion. - - The returned list will not contain any duplicate entries. Each build file - in the list will be relative to the current directory. - """ - - if included is None: - included = [] - - if build_file_path in included: - return included - - included.append(build_file_path) - - for included_build_file in aux_data[build_file_path].get("included", []): - GetIncludedBuildFiles(included_build_file, aux_data, included) - - return included - - -def CheckedEval(file_contents): - """Return the eval of a gyp file. - The gyp file is restricted to dictionaries and lists only, and - repeated keys are not allowed. - Note that this is slower than eval() is. - """ - - syntax_tree = ast.parse(file_contents) - assert isinstance(syntax_tree, ast.Module) - c1 = syntax_tree.body - assert len(c1) == 1 - c2 = c1[0] - assert isinstance(c2, ast.Expr) - return CheckNode(c2.value, []) - - -def CheckNode(node, keypath): - if isinstance(node, ast.Dict): - dict = {} - for key, value in zip(node.keys, node.values): - assert isinstance(key, ast.Str) - key = key.s - if key in dict: - raise GypError( - "Key '" - + key - + "' repeated at level " - + repr(len(keypath) + 1) - + " with key path '" - + ".".join(keypath) - + "'" - ) - kp = list(keypath) # Make a copy of the list for descending this node. - kp.append(key) - dict[key] = CheckNode(value, kp) - return dict - elif isinstance(node, ast.List): - children = [] - for index, child in enumerate(node.elts): - kp = list(keypath) # Copy list. - kp.append(repr(index)) - children.append(CheckNode(child, kp)) - return children - elif isinstance(node, ast.Str): - return node.s - else: - raise TypeError( - "Unknown AST node at key path '" + ".".join(keypath) + "': " + repr(node) - ) - - -def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check): - if build_file_path in data: - return data[build_file_path] - - if os.path.exists(build_file_path): - build_file_contents = open(build_file_path, encoding='utf-8').read() - else: - raise GypError(f"{build_file_path} not found (cwd: {os.getcwd()})") - - build_file_data = None - try: - if check: - build_file_data = CheckedEval(build_file_contents) - else: - build_file_data = eval(build_file_contents, {"__builtins__": {}}, None) - except SyntaxError as e: - e.filename = build_file_path - raise - except Exception as e: - gyp.common.ExceptionAppend(e, "while reading " + build_file_path) - raise - - if type(build_file_data) is not dict: - raise GypError("%s does not evaluate to a dictionary." % build_file_path) - - data[build_file_path] = build_file_data - aux_data[build_file_path] = {} - - # Scan for includes and merge them in. - if "skip_includes" not in build_file_data or not build_file_data["skip_includes"]: - try: - if is_target: - LoadBuildFileIncludesIntoDict( - build_file_data, build_file_path, data, aux_data, includes, check - ) - else: - LoadBuildFileIncludesIntoDict( - build_file_data, build_file_path, data, aux_data, None, check - ) - except Exception as e: - gyp.common.ExceptionAppend( - e, "while reading includes of " + build_file_path - ) - raise - - return build_file_data - - -def LoadBuildFileIncludesIntoDict( - subdict, subdict_path, data, aux_data, includes, check -): - includes_list = [] - if includes is not None: - includes_list.extend(includes) - if "includes" in subdict: - for include in subdict["includes"]: - # "include" is specified relative to subdict_path, so compute the real - # path to include by appending the provided "include" to the directory - # in which subdict_path resides. - relative_include = os.path.normpath( - os.path.join(os.path.dirname(subdict_path), include) - ) - includes_list.append(relative_include) - # Unhook the includes list, it's no longer needed. - del subdict["includes"] - - # Merge in the included files. - for include in includes_list: - if "included" not in aux_data[subdict_path]: - aux_data[subdict_path]["included"] = [] - aux_data[subdict_path]["included"].append(include) - - gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) - - MergeDicts( - subdict, - LoadOneBuildFile(include, data, aux_data, None, False, check), - subdict_path, - include, - ) - - # Recurse into subdictionaries. - for k, v in subdict.items(): - if type(v) is dict: - LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, None, check) - elif type(v) is list: - LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, check) - - -# This recurses into lists so that it can look for dicts. -def LoadBuildFileIncludesIntoList(sublist, sublist_path, data, aux_data, check): - for item in sublist: - if type(item) is dict: - LoadBuildFileIncludesIntoDict( - item, sublist_path, data, aux_data, None, check - ) - elif type(item) is list: - LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check) - - -# Processes toolsets in all the targets. This recurses into condition entries -# since they can contain toolsets as well. -def ProcessToolsetsInDict(data): - if "targets" in data: - target_list = data["targets"] - new_target_list = [] - for target in target_list: - # If this target already has an explicit 'toolset', and no 'toolsets' - # list, don't modify it further. - if "toolset" in target and "toolsets" not in target: - new_target_list.append(target) - continue - if multiple_toolsets: - toolsets = target.get("toolsets", ["target"]) - else: - toolsets = ["target"] - # Make sure this 'toolsets' definition is only processed once. - if "toolsets" in target: - del target["toolsets"] - if len(toolsets) > 0: - # Optimization: only do copies if more than one toolset is specified. - for build in toolsets[1:]: - new_target = gyp.simple_copy.deepcopy(target) - new_target["toolset"] = build - new_target_list.append(new_target) - target["toolset"] = toolsets[0] - new_target_list.append(target) - data["targets"] = new_target_list - if "conditions" in data: - for condition in data["conditions"]: - if type(condition) is list: - for condition_dict in condition[1:]: - if type(condition_dict) is dict: - ProcessToolsetsInDict(condition_dict) - - -# TODO(mark): I don't love this name. It just means that it's going to load -# a build file that contains targets and is expected to provide a targets dict -# that contains the targets... -def LoadTargetBuildFile( - build_file_path, - data, - aux_data, - variables, - includes, - depth, - check, - load_dependencies, -): - # If depth is set, predefine the DEPTH variable to be a relative path from - # this build file's directory to the directory identified by depth. - if depth: - # TODO(dglazkov) The backslash/forward-slash replacement at the end is a - # temporary measure. This should really be addressed by keeping all paths - # in POSIX until actual project generation. - d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) - if d == "": - variables["DEPTH"] = "." - else: - variables["DEPTH"] = d.replace("\\", "/") - - # The 'target_build_files' key is only set when loading target build files in - # the non-parallel code path, where LoadTargetBuildFile is called - # recursively. In the parallel code path, we don't need to check whether the - # |build_file_path| has already been loaded, because the 'scheduled' set in - # ParallelState guarantees that we never load the same |build_file_path| - # twice. - if "target_build_files" in data: - if build_file_path in data["target_build_files"]: - # Already loaded. - return False - data["target_build_files"].add(build_file_path) - - gyp.DebugOutput( - gyp.DEBUG_INCLUDES, "Loading Target Build File '%s'", build_file_path - ) - - build_file_data = LoadOneBuildFile( - build_file_path, data, aux_data, includes, True, check - ) - - # Store DEPTH for later use in generators. - build_file_data["_DEPTH"] = depth - - # Set up the included_files key indicating which .gyp files contributed to - # this target dict. - if "included_files" in build_file_data: - raise GypError(build_file_path + " must not contain included_files key") - - included = GetIncludedBuildFiles(build_file_path, aux_data) - build_file_data["included_files"] = [] - for included_file in included: - # included_file is relative to the current directory, but it needs to - # be made relative to build_file_path's directory. - included_relative = gyp.common.RelativePath( - included_file, os.path.dirname(build_file_path) - ) - build_file_data["included_files"].append(included_relative) - - # Do a first round of toolsets expansion so that conditions can be defined - # per toolset. - ProcessToolsetsInDict(build_file_data) - - # Apply "pre"/"early" variable expansions and condition evaluations. - ProcessVariablesAndConditionsInDict( - build_file_data, PHASE_EARLY, variables, build_file_path - ) - - # Since some toolsets might have been defined conditionally, perform - # a second round of toolsets expansion now. - ProcessToolsetsInDict(build_file_data) - - # Look at each project's target_defaults dict, and merge settings into - # targets. - if "target_defaults" in build_file_data: - if "targets" not in build_file_data: - raise GypError("Unable to find targets in build file %s" % build_file_path) - - index = 0 - while index < len(build_file_data["targets"]): - # This procedure needs to give the impression that target_defaults is - # used as defaults, and the individual targets inherit from that. - # The individual targets need to be merged into the defaults. Make - # a deep copy of the defaults for each target, merge the target dict - # as found in the input file into that copy, and then hook up the - # copy with the target-specific data merged into it as the replacement - # target dict. - old_target_dict = build_file_data["targets"][index] - new_target_dict = gyp.simple_copy.deepcopy( - build_file_data["target_defaults"] - ) - MergeDicts( - new_target_dict, old_target_dict, build_file_path, build_file_path - ) - build_file_data["targets"][index] = new_target_dict - index += 1 - - # No longer needed. - del build_file_data["target_defaults"] - - # Look for dependencies. This means that dependency resolution occurs - # after "pre" conditionals and variable expansion, but before "post" - - # in other words, you can't put a "dependencies" section inside a "post" - # conditional within a target. - - dependencies = [] - if "targets" in build_file_data: - for target_dict in build_file_data["targets"]: - if "dependencies" not in target_dict: - continue - for dependency in target_dict["dependencies"]: - dependencies.append( - gyp.common.ResolveTarget(build_file_path, dependency, None)[0] - ) - - if load_dependencies: - for dependency in dependencies: - try: - LoadTargetBuildFile( - dependency, - data, - aux_data, - variables, - includes, - depth, - check, - load_dependencies, - ) - except Exception as e: - gyp.common.ExceptionAppend( - e, "while loading dependencies of %s" % build_file_path - ) - raise - else: - return (build_file_path, dependencies) - - -def CallLoadTargetBuildFile( - global_flags, - build_file_path, - variables, - includes, - depth, - check, - generator_input_info, -): - """Wrapper around LoadTargetBuildFile for parallel processing. - - This wrapper is used when LoadTargetBuildFile is executed in - a worker process. - """ - - try: - signal.signal(signal.SIGINT, signal.SIG_IGN) - - # Apply globals so that the worker process behaves the same. - for key, value in global_flags.items(): - globals()[key] = value - - SetGeneratorGlobals(generator_input_info) - result = LoadTargetBuildFile( - build_file_path, - per_process_data, - per_process_aux_data, - variables, - includes, - depth, - check, - False, - ) - if not result: - return result - - (build_file_path, dependencies) = result - - # We can safely pop the build_file_data from per_process_data because it - # will never be referenced by this process again, so we don't need to keep - # it in the cache. - build_file_data = per_process_data.pop(build_file_path) - - # This gets serialized and sent back to the main process via a pipe. - # It's handled in LoadTargetBuildFileCallback. - return (build_file_path, build_file_data, dependencies) - except GypError as e: - sys.stderr.write("gyp: %s\n" % e) - return None - except Exception as e: - print("Exception:", e, file=sys.stderr) - print(traceback.format_exc(), file=sys.stderr) - return None - - -class ParallelProcessingError(Exception): - pass - - -class ParallelState: - """Class to keep track of state when processing input files in parallel. - - If build files are loaded in parallel, use this to keep track of - state during farming out and processing parallel jobs. It's stored - in a global so that the callback function can have access to it. - """ - - def __init__(self): - # The multiprocessing pool. - self.pool = None - # The condition variable used to protect this object and notify - # the main loop when there might be more data to process. - self.condition = None - # The "data" dict that was passed to LoadTargetBuildFileParallel - self.data = None - # The number of parallel calls outstanding; decremented when a response - # was received. - self.pending = 0 - # The set of all build files that have been scheduled, so we don't - # schedule the same one twice. - self.scheduled = set() - # A list of dependency build file paths that haven't been scheduled yet. - self.dependencies = [] - # Flag to indicate if there was an error in a child process. - self.error = False - - def LoadTargetBuildFileCallback(self, result): - """Handle the results of running LoadTargetBuildFile in another process. - """ - self.condition.acquire() - if not result: - self.error = True - self.condition.notify() - self.condition.release() - return - (build_file_path0, build_file_data0, dependencies0) = result - self.data[build_file_path0] = build_file_data0 - self.data["target_build_files"].add(build_file_path0) - for new_dependency in dependencies0: - if new_dependency not in self.scheduled: - self.scheduled.add(new_dependency) - self.dependencies.append(new_dependency) - self.pending -= 1 - self.condition.notify() - self.condition.release() - - -def LoadTargetBuildFilesParallel( - build_files, data, variables, includes, depth, check, generator_input_info -): - parallel_state = ParallelState() - parallel_state.condition = threading.Condition() - # Make copies of the build_files argument that we can modify while working. - parallel_state.dependencies = list(build_files) - parallel_state.scheduled = set(build_files) - parallel_state.pending = 0 - parallel_state.data = data - - try: - parallel_state.condition.acquire() - while parallel_state.dependencies or parallel_state.pending: - if parallel_state.error: - break - if not parallel_state.dependencies: - parallel_state.condition.wait() - continue - - dependency = parallel_state.dependencies.pop() - - parallel_state.pending += 1 - global_flags = { - "path_sections": globals()["path_sections"], - "non_configuration_keys": globals()["non_configuration_keys"], - "multiple_toolsets": globals()["multiple_toolsets"], - } - - if not parallel_state.pool: - parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) - parallel_state.pool.apply_async( - CallLoadTargetBuildFile, - args=( - global_flags, - dependency, - variables, - includes, - depth, - check, - generator_input_info, - ), - callback=parallel_state.LoadTargetBuildFileCallback, - ) - except KeyboardInterrupt as e: - parallel_state.pool.terminate() - raise e - - parallel_state.condition.release() - - parallel_state.pool.close() - parallel_state.pool.join() - parallel_state.pool = None - - if parallel_state.error: - sys.exit(1) - - -# Look for the bracket that matches the first bracket seen in a -# string, and return the start and end as a tuple. For example, if -# the input is something like "<(foo <(bar)) blah", then it would -# return (1, 13), indicating the entire string except for the leading -# "<" and trailing " blah". -LBRACKETS = set("{[(") -BRACKETS = {"}": "{", "]": "[", ")": "("} - - -def FindEnclosingBracketGroup(input_str): - stack = [] - start = -1 - for index, char in enumerate(input_str): - if char in LBRACKETS: - stack.append(char) - if start == -1: - start = index - elif char in BRACKETS: - if not stack: - return (-1, -1) - if stack.pop() != BRACKETS[char]: - return (-1, -1) - if not stack: - return (start, index + 1) - return (-1, -1) - - -def IsStrCanonicalInt(string): - """Returns True if |string| is in its canonical integer form. - - The canonical form is such that str(int(string)) == string. - """ - if type(string) is str: - # This function is called a lot so for maximum performance, avoid - # involving regexps which would otherwise make the code much - # shorter. Regexps would need twice the time of this function. - if string: - if string == "0": - return True - if string[0] == "-": - string = string[1:] - if not string: - return False - if "1" <= string[0] <= "9": - return string.isdigit() - - return False - - -# This matches things like "<(asdf)", "(?P<(?:(?:!?@?)|\|)?)" - r"(?P[-a-zA-Z0-9_.]+)?" - r"\((?P\s*\[?)" - r"(?P.*?)(\]?)\))" -) - -# This matches the same as early_variable_re, but with '>' instead of '<'. -late_variable_re = re.compile( - r"(?P(?P>(?:(?:!?@?)|\|)?)" - r"(?P[-a-zA-Z0-9_.]+)?" - r"\((?P\s*\[?)" - r"(?P.*?)(\]?)\))" -) - -# This matches the same as early_variable_re, but with '^' instead of '<'. -latelate_variable_re = re.compile( - r"(?P(?P[\^](?:(?:!?@?)|\|)?)" - r"(?P[-a-zA-Z0-9_.]+)?" - r"\((?P\s*\[?)" - r"(?P.*?)(\]?)\))" -) - -# Global cache of results from running commands so they don't have to be run -# more then once. -cached_command_results = {} - - -def FixupPlatformCommand(cmd): - if sys.platform == "win32": - if type(cmd) is list: - cmd = [re.sub("^cat ", "type ", cmd[0])] + cmd[1:] - else: - cmd = re.sub("^cat ", "type ", cmd) - return cmd - - -PHASE_EARLY = 0 -PHASE_LATE = 1 -PHASE_LATELATE = 2 - - -def ExpandVariables(input, phase, variables, build_file): - # Look for the pattern that gets expanded into variables - if phase == PHASE_EARLY: - variable_re = early_variable_re - expansion_symbol = "<" - elif phase == PHASE_LATE: - variable_re = late_variable_re - expansion_symbol = ">" - elif phase == PHASE_LATELATE: - variable_re = latelate_variable_re - expansion_symbol = "^" - else: - assert False - - input_str = str(input) - if IsStrCanonicalInt(input_str): - return int(input_str) - - # Do a quick scan to determine if an expensive regex search is warranted. - if expansion_symbol not in input_str: - return input_str - - # Get the entire list of matches as a list of MatchObject instances. - # (using findall here would return strings instead of MatchObjects). - matches = list(variable_re.finditer(input_str)) - if not matches: - return input_str - - output = input_str - # Reverse the list of matches so that replacements are done right-to-left. - # That ensures that earlier replacements won't mess up the string in a - # way that causes later calls to find the earlier substituted text instead - # of what's intended for replacement. - matches.reverse() - for match_group in matches: - match = match_group.groupdict() - gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %r", match) - # match['replace'] is the substring to look for, match['type'] - # is the character code for the replacement type (< > ! <| >| <@ - # >@ !@), match['is_array'] contains a '[' for command - # arrays, and match['content'] is the name of the variable (< >) - # or command to run (!). match['command_string'] is an optional - # command string. Currently, only 'pymod_do_main' is supported. - - # run_command is true if a ! variant is used. - run_command = "!" in match["type"] - command_string = match["command_string"] - - # file_list is true if a | variant is used. - file_list = "|" in match["type"] - - # Capture these now so we can adjust them later. - replace_start = match_group.start("replace") - replace_end = match_group.end("replace") - - # Find the ending paren, and re-evaluate the contained string. - (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) - - # Adjust the replacement range to match the entire command - # found by FindEnclosingBracketGroup (since the variable_re - # probably doesn't match the entire command if it contained - # nested variables). - replace_end = replace_start + c_end - - # Find the "real" replacement, matching the appropriate closing - # paren, and adjust the replacement start and end. - replacement = input_str[replace_start:replace_end] - - # Figure out what the contents of the variable parens are. - contents_start = replace_start + c_start + 1 - contents_end = replace_end - 1 - contents = input_str[contents_start:contents_end] - - # Do filter substitution now for <|(). - # Admittedly, this is different than the evaluation order in other - # contexts. However, since filtration has no chance to run on <|(), - # this seems like the only obvious way to give them access to filters. - if file_list: - processed_variables = gyp.simple_copy.deepcopy(variables) - ProcessListFiltersInDict(contents, processed_variables) - # Recurse to expand variables in the contents - contents = ExpandVariables(contents, phase, processed_variables, build_file) - else: - # Recurse to expand variables in the contents - contents = ExpandVariables(contents, phase, variables, build_file) - - # Strip off leading/trailing whitespace so that variable matches are - # simpler below (and because they are rarely needed). - contents = contents.strip() - - # expand_to_list is true if an @ variant is used. In that case, - # the expansion should result in a list. Note that the caller - # is to be expecting a list in return, and not all callers do - # because not all are working in list context. Also, for list - # expansions, there can be no other text besides the variable - # expansion in the input string. - expand_to_list = "@" in match["type"] and input_str == replacement - - if run_command or file_list: - # Find the build file's directory, so commands can be run or file lists - # generated relative to it. - build_file_dir = os.path.dirname(build_file) - if build_file_dir == "" and not file_list: - # If build_file is just a leaf filename indicating a file in the - # current directory, build_file_dir might be an empty string. Set - # it to None to signal to subprocess.Popen that it should run the - # command in the current directory. - build_file_dir = None - - # Support <|(listfile.txt ...) which generates a file - # containing items from a gyp list, generated at gyp time. - # This works around actions/rules which have more inputs than will - # fit on the command line. - if file_list: - if type(contents) is list: - contents_list = contents - else: - contents_list = contents.split(" ") - replacement = contents_list[0] - if os.path.isabs(replacement): - raise GypError('| cannot handle absolute paths, got "%s"' % replacement) - - if not generator_filelist_paths: - path = os.path.join(build_file_dir, replacement) - else: - if os.path.isabs(build_file_dir): - toplevel = generator_filelist_paths["toplevel"] - rel_build_file_dir = gyp.common.RelativePath( - build_file_dir, toplevel - ) - else: - rel_build_file_dir = build_file_dir - qualified_out_dir = generator_filelist_paths["qualified_out_dir"] - path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) - gyp.common.EnsureDirExists(path) - - replacement = gyp.common.RelativePath(path, build_file_dir) - f = gyp.common.WriteOnDiff(path) - for i in contents_list[1:]: - f.write("%s\n" % i) - f.close() - - elif run_command: - use_shell = True - if match["is_array"]: - contents = eval(contents) - use_shell = False - - # Check for a cached value to avoid executing commands, or generating - # file lists more than once. The cache key contains the command to be - # run as well as the directory to run it from, to account for commands - # that depend on their current directory. - # TODO(http://code.google.com/p/gyp/issues/detail?id=111): In theory, - # someone could author a set of GYP files where each time the command - # is invoked it produces different output by design. When the need - # arises, the syntax should be extended to support no caching off a - # command's output so it is run every time. - cache_key = (str(contents), build_file_dir) - cached_value = cached_command_results.get(cache_key, None) - if cached_value is None: - gyp.DebugOutput( - gyp.DEBUG_VARIABLES, - "Executing command '%s' in directory '%s'", - contents, - build_file_dir, - ) - - replacement = "" - - if command_string == "pymod_do_main": - # (sources/) etc. to resolve to - # and empty list if undefined. This allows actions to: - # 'action!': [ - # '>@(_sources!)', - # ], - # 'action/': [ - # '>@(_sources/)', - # ], - replacement = [] - else: - raise GypError( - "Undefined variable " + contents + " in " + build_file - ) - else: - replacement = variables[contents] - - if isinstance(replacement, bytes) and not isinstance(replacement, str): - replacement = replacement.decode("utf-8") # done on Python 3 only - if type(replacement) is list: - for item in replacement: - if isinstance(item, bytes) and not isinstance(item, str): - item = item.decode("utf-8") # done on Python 3 only - if not contents[-1] == "/" and type(item) not in (str, int): - raise GypError( - "Variable " - + contents - + " must expand to a string or list of strings; " - + "list contains a " - + item.__class__.__name__ - ) - # Run through the list and handle variable expansions in it. Since - # the list is guaranteed not to contain dicts, this won't do anything - # with conditions sections. - ProcessVariablesAndConditionsInList( - replacement, phase, variables, build_file - ) - elif type(replacement) not in (str, int): - raise GypError( - "Variable " - + contents - + " must expand to a string or list of strings; " - + "found a " - + replacement.__class__.__name__ - ) - - if expand_to_list: - # Expanding in list context. It's guaranteed that there's only one - # replacement to do in |input_str| and that it's this replacement. See - # above. - if type(replacement) is list: - # If it's already a list, make a copy. - output = replacement[:] - else: - # Split it the same way sh would split arguments. - output = shlex.split(str(replacement)) - else: - # Expanding in string context. - encoded_replacement = "" - if type(replacement) is list: - # When expanding a list into string context, turn the list items - # into a string in a way that will work with a subprocess call. - # - # TODO(mark): This isn't completely correct. This should - # call a generator-provided function that observes the - # proper list-to-argument quoting rules on a specific - # platform instead of just calling the POSIX encoding - # routine. - encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) - else: - encoded_replacement = replacement - - output = ( - output[:replace_start] + str(encoded_replacement) + output[replace_end:] - ) - # Prepare for the next match iteration. - input_str = output - - if output == input: - gyp.DebugOutput( - gyp.DEBUG_VARIABLES, - "Found only identity matches on %r, avoiding infinite " "recursion.", - output, - ) - else: - # Look for more matches now that we've replaced some, to deal with - # expanding local variables (variables defined in the same - # variables block as this one). - gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %r, recursing.", output) - if type(output) is list: - if output and type(output[0]) is list: - # Leave output alone if it's a list of lists. - # We don't want such lists to be stringified. - pass - else: - new_output = [] - for item in output: - new_output.append( - ExpandVariables(item, phase, variables, build_file) - ) - output = new_output - else: - output = ExpandVariables(output, phase, variables, build_file) - - # Convert all strings that are canonically-represented integers into integers. - if type(output) is list: - for index, outstr in enumerate(output): - if IsStrCanonicalInt(outstr): - output[index] = int(outstr) - elif IsStrCanonicalInt(output): - output = int(output) - - return output - - -# The same condition is often evaluated over and over again so it -# makes sense to cache as much as possible between evaluations. -cached_conditions_asts = {} - - -def EvalCondition(condition, conditions_key, phase, variables, build_file): - """Returns the dict that should be used or None if the result was - that nothing should be used.""" - if type(condition) is not list: - raise GypError(conditions_key + " must be a list") - if len(condition) < 2: - # It's possible that condition[0] won't work in which case this - # attempt will raise its own IndexError. That's probably fine. - raise GypError( - conditions_key - + " " - + condition[0] - + " must be at least length 2, not " - + str(len(condition)) - ) - - i = 0 - result = None - while i < len(condition): - cond_expr = condition[i] - true_dict = condition[i + 1] - if type(true_dict) is not dict: - raise GypError( - "{} {} must be followed by a dictionary, not {}".format( - conditions_key, cond_expr, type(true_dict) - ) - ) - if len(condition) > i + 2 and type(condition[i + 2]) is dict: - false_dict = condition[i + 2] - i = i + 3 - if i != len(condition): - raise GypError( - "{} {} has {} unexpected trailing items".format( - conditions_key, cond_expr, len(condition) - i - ) - ) - else: - false_dict = None - i = i + 2 - if result is None: - result = EvalSingleCondition( - cond_expr, true_dict, false_dict, phase, variables, build_file - ) - - return result - - -def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, build_file): - """Returns true_dict if cond_expr evaluates to true, and false_dict - otherwise.""" - # Do expansions on the condition itself. Since the condition can naturally - # contain variable references without needing to resort to GYP expansion - # syntax, this is of dubious value for variables, but someone might want to - # use a command expansion directly inside a condition. - cond_expr_expanded = ExpandVariables(cond_expr, phase, variables, build_file) - if type(cond_expr_expanded) not in (str, int): - raise ValueError( - "Variable expansion in this context permits str and int " - + "only, found " - + cond_expr_expanded.__class__.__name__ - ) - - try: - if cond_expr_expanded in cached_conditions_asts: - ast_code = cached_conditions_asts[cond_expr_expanded] - else: - ast_code = compile(cond_expr_expanded, "", "eval") - cached_conditions_asts[cond_expr_expanded] = ast_code - env = {"__builtins__": {}, "v": StrictVersion} - if eval(ast_code, env, variables): - return true_dict - return false_dict - except SyntaxError as e: - syntax_error = SyntaxError( - "%s while evaluating condition '%s' in %s " - "at character %d." % (str(e.args[0]), e.text, build_file, e.offset), - e.filename, - e.lineno, - e.offset, - e.text, - ) - raise syntax_error - except NameError as e: - gyp.common.ExceptionAppend( - e, - f"while evaluating condition '{cond_expr_expanded}' in {build_file}", - ) - raise GypError(e) - - -def ProcessConditionsInDict(the_dict, phase, variables, build_file): - # Process a 'conditions' or 'target_conditions' section in the_dict, - # depending on phase. - # early -> conditions - # late -> target_conditions - # latelate -> no conditions - # - # Each item in a conditions list consists of cond_expr, a string expression - # evaluated as the condition, and true_dict, a dict that will be merged into - # the_dict if cond_expr evaluates to true. Optionally, a third item, - # false_dict, may be present. false_dict is merged into the_dict if - # cond_expr evaluates to false. - # - # Any dict merged into the_dict will be recursively processed for nested - # conditionals and other expansions, also according to phase, immediately - # prior to being merged. - - if phase == PHASE_EARLY: - conditions_key = "conditions" - elif phase == PHASE_LATE: - conditions_key = "target_conditions" - elif phase == PHASE_LATELATE: - return - else: - assert False - - if conditions_key not in the_dict: - return - - conditions_list = the_dict[conditions_key] - # Unhook the conditions list, it's no longer needed. - del the_dict[conditions_key] - - for condition in conditions_list: - merge_dict = EvalCondition( - condition, conditions_key, phase, variables, build_file - ) - - if merge_dict is not None: - # Expand variables and nested conditinals in the merge_dict before - # merging it. - ProcessVariablesAndConditionsInDict( - merge_dict, phase, variables, build_file - ) - - MergeDicts(the_dict, merge_dict, build_file, build_file) - - -def LoadAutomaticVariablesFromDict(variables, the_dict): - # Any keys with plain string values in the_dict become automatic variables. - # The variable name is the key name with a "_" character prepended. - for key, value in the_dict.items(): - if type(value) in (str, int, list): - variables["_" + key] = value - - -def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key): - # Any keys in the_dict's "variables" dict, if it has one, becomes a - # variable. The variable name is the key name in the "variables" dict. - # Variables that end with the % character are set only if they are unset in - # the variables dict. the_dict_key is the name of the key that accesses - # the_dict in the_dict's parent dict. If the_dict's parent is not a dict - # (it could be a list or it could be parentless because it is a root dict), - # the_dict_key will be None. - for key, value in the_dict.get("variables", {}).items(): - if type(value) not in (str, int, list): - continue - - if key.endswith("%"): - variable_name = key[:-1] - if variable_name in variables: - # If the variable is already set, don't set it. - continue - if the_dict_key == "variables" and variable_name in the_dict: - # If the variable is set without a % in the_dict, and the_dict is a - # variables dict (making |variables| a variables sub-dict of a - # variables dict), use the_dict's definition. - value = the_dict[variable_name] - else: - variable_name = key - - variables[variable_name] = value - - -def ProcessVariablesAndConditionsInDict( - the_dict, phase, variables_in, build_file, the_dict_key=None -): - """Handle all variable and command expansion and conditional evaluation. - - This function is the public entry point for all variable expansions and - conditional evaluations. The variables_in dictionary will not be modified - by this function. - """ - - # Make a copy of the variables_in dict that can be modified during the - # loading of automatics and the loading of the variables dict. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - - if "variables" in the_dict: - # Make sure all the local variables are added to the variables - # list before we process them so that you can reference one - # variable from another. They will be fully expanded by recursion - # in ExpandVariables. - for key, value in the_dict["variables"].items(): - variables[key] = value - - # Handle the associated variables dict first, so that any variable - # references within can be resolved prior to using them as variables. - # Pass a copy of the variables dict to avoid having it be tainted. - # Otherwise, it would have extra automatics added for everything that - # should just be an ordinary variable in this scope. - ProcessVariablesAndConditionsInDict( - the_dict["variables"], phase, variables, build_file, "variables" - ) - - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - for key, value in the_dict.items(): - # Skip "variables", which was already processed if present. - if key != "variables" and type(value) is str: - expanded = ExpandVariables(value, phase, variables, build_file) - if type(expanded) not in (str, int): - raise ValueError( - "Variable expansion in this context permits str and int " - + "only, found " - + expanded.__class__.__name__ - + " for " - + key - ) - the_dict[key] = expanded - - # Variable expansion may have resulted in changes to automatics. Reload. - # TODO(mark): Optimization: only reload if no changes were made. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - # Process conditions in this dict. This is done after variable expansion - # so that conditions may take advantage of expanded variables. For example, - # if the_dict contains: - # {'type': '<(library_type)', - # 'conditions': [['_type=="static_library"', { ... }]]}, - # _type, as used in the condition, will only be set to the value of - # library_type if variable expansion is performed before condition - # processing. However, condition processing should occur prior to recursion - # so that variables (both automatic and "variables" dict type) may be - # adjusted by conditions sections, merged into the_dict, and have the - # intended impact on contained dicts. - # - # This arrangement means that a "conditions" section containing a "variables" - # section will only have those variables effective in subdicts, not in - # the_dict. The workaround is to put a "conditions" section within a - # "variables" section. For example: - # {'conditions': [['os=="mac"', {'variables': {'define': 'IS_MAC'}}]], - # 'defines': ['<(define)'], - # 'my_subdict': {'defines': ['<(define)']}}, - # will not result in "IS_MAC" being appended to the "defines" list in the - # current scope but would result in it being appended to the "defines" list - # within "my_subdict". By comparison: - # {'variables': {'conditions': [['os=="mac"', {'define': 'IS_MAC'}]]}, - # 'defines': ['<(define)'], - # 'my_subdict': {'defines': ['<(define)']}}, - # will append "IS_MAC" to both "defines" lists. - - # Evaluate conditions sections, allowing variable expansions within them - # as well as nested conditionals. This will process a 'conditions' or - # 'target_conditions' section, perform appropriate merging and recursive - # conditional and variable processing, and then remove the conditions section - # from the_dict if it is present. - ProcessConditionsInDict(the_dict, phase, variables, build_file) - - # Conditional processing may have resulted in changes to automatics or the - # variables dict. Reload. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - # Recurse into child dicts, or process child lists which may result in - # further recursion into descendant dicts. - for key, value in the_dict.items(): - # Skip "variables" and string values, which were already processed if - # present. - if key == "variables" or type(value) is str: - continue - if type(value) is dict: - # Pass a copy of the variables dict so that subdicts can't influence - # parents. - ProcessVariablesAndConditionsInDict( - value, phase, variables, build_file, key - ) - elif type(value) is list: - # The list itself can't influence the variables dict, and - # ProcessVariablesAndConditionsInList will make copies of the variables - # dict if it needs to pass it to something that can influence it. No - # copy is necessary here. - ProcessVariablesAndConditionsInList(value, phase, variables, build_file) - elif type(value) is not int: - raise TypeError("Unknown type " + value.__class__.__name__ + " for " + key) - - -def ProcessVariablesAndConditionsInList(the_list, phase, variables, build_file): - # Iterate using an index so that new values can be assigned into the_list. - index = 0 - while index < len(the_list): - item = the_list[index] - if type(item) is dict: - # Make a copy of the variables dict so that it won't influence anything - # outside of its own scope. - ProcessVariablesAndConditionsInDict(item, phase, variables, build_file) - elif type(item) is list: - ProcessVariablesAndConditionsInList(item, phase, variables, build_file) - elif type(item) is str: - expanded = ExpandVariables(item, phase, variables, build_file) - if type(expanded) in (str, int): - the_list[index] = expanded - elif type(expanded) is list: - the_list[index : index + 1] = expanded - index += len(expanded) - - # index now identifies the next item to examine. Continue right now - # without falling into the index increment below. - continue - else: - raise ValueError( - "Variable expansion in this context permits strings and " - + "lists only, found " - + expanded.__class__.__name__ - + " at " - + index - ) - elif type(item) is not int: - raise TypeError( - "Unknown type " + item.__class__.__name__ + " at index " + index - ) - index = index + 1 - - -def BuildTargetsDict(data): - """Builds a dict mapping fully-qualified target names to their target dicts. - - |data| is a dict mapping loaded build files by pathname relative to the - current directory. Values in |data| are build file contents. For each - |data| value with a "targets" key, the value of the "targets" key is taken - as a list containing target dicts. Each target's fully-qualified name is - constructed from the pathname of the build file (|data| key) and its - "target_name" property. These fully-qualified names are used as the keys - in the returned dict. These keys provide access to the target dicts, - the dicts in the "targets" lists. - """ - - targets = {} - for build_file in data["target_build_files"]: - for target in data[build_file].get("targets", []): - target_name = gyp.common.QualifiedTarget( - build_file, target["target_name"], target["toolset"] - ) - if target_name in targets: - raise GypError("Duplicate target definitions for " + target_name) - targets[target_name] = target - - return targets - - -def QualifyDependencies(targets): - """Make dependency links fully-qualified relative to the current directory. - - |targets| is a dict mapping fully-qualified target names to their target - dicts. For each target in this dict, keys known to contain dependency - links are examined, and any dependencies referenced will be rewritten - so that they are fully-qualified and relative to the current directory. - All rewritten dependencies are suitable for use as keys to |targets| or a - similar dict. - """ - - all_dependency_sections = [ - dep + op for dep in dependency_sections for op in ("", "!", "/") - ] - - for target, target_dict in targets.items(): - target_build_file = gyp.common.BuildFile(target) - toolset = target_dict["toolset"] - for dependency_key in all_dependency_sections: - dependencies = target_dict.get(dependency_key, []) - for index, dep in enumerate(dependencies): - dep_file, dep_target, dep_toolset = gyp.common.ResolveTarget( - target_build_file, dep, toolset - ) - if not multiple_toolsets: - # Ignore toolset specification in the dependency if it is specified. - dep_toolset = toolset - dependency = gyp.common.QualifiedTarget( - dep_file, dep_target, dep_toolset - ) - dependencies[index] = dependency - - # Make sure anything appearing in a list other than "dependencies" also - # appears in the "dependencies" list. - if ( - dependency_key != "dependencies" - and dependency not in target_dict["dependencies"] - ): - raise GypError( - "Found " - + dependency - + " in " - + dependency_key - + " of " - + target - + ", but not in dependencies" - ) - - -def ExpandWildcardDependencies(targets, data): - """Expands dependencies specified as build_file:*. - - For each target in |targets|, examines sections containing links to other - targets. If any such section contains a link of the form build_file:*, it - is taken as a wildcard link, and is expanded to list each target in - build_file. The |data| dict provides access to build file dicts. - - Any target that does not wish to be included by wildcard can provide an - optional "suppress_wildcard" key in its target dict. When present and - true, a wildcard dependency link will not include such targets. - - All dependency names, including the keys to |targets| and the values in each - dependency list, must be qualified when this function is called. - """ - - for target, target_dict in targets.items(): - target_build_file = gyp.common.BuildFile(target) - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - - # Loop this way instead of "for dependency in" or "for index in range" - # because the dependencies list will be modified within the loop body. - index = 0 - while index < len(dependencies): - ( - dependency_build_file, - dependency_target, - dependency_toolset, - ) = gyp.common.ParseQualifiedTarget(dependencies[index]) - if dependency_target != "*" and dependency_toolset != "*": - # Not a wildcard. Keep it moving. - index = index + 1 - continue - - if dependency_build_file == target_build_file: - # It's an error for a target to depend on all other targets in - # the same file, because a target cannot depend on itself. - raise GypError( - "Found wildcard in " - + dependency_key - + " of " - + target - + " referring to same build file" - ) - - # Take the wildcard out and adjust the index so that the next - # dependency in the list will be processed the next time through the - # loop. - del dependencies[index] - index = index - 1 - - # Loop through the targets in the other build file, adding them to - # this target's list of dependencies in place of the removed - # wildcard. - dependency_target_dicts = data[dependency_build_file]["targets"] - for dependency_target_dict in dependency_target_dicts: - if int(dependency_target_dict.get("suppress_wildcard", False)): - continue - dependency_target_name = dependency_target_dict["target_name"] - if ( - dependency_target != "*" - and dependency_target != dependency_target_name - ): - continue - dependency_target_toolset = dependency_target_dict["toolset"] - if ( - dependency_toolset != "*" - and dependency_toolset != dependency_target_toolset - ): - continue - dependency = gyp.common.QualifiedTarget( - dependency_build_file, - dependency_target_name, - dependency_target_toolset, - ) - index = index + 1 - dependencies.insert(index, dependency) - - index = index + 1 - - -def Unify(items): - """Removes duplicate elements from items, keeping the first element.""" - seen = {} - return [seen.setdefault(e, e) for e in items if e not in seen] - - -def RemoveDuplicateDependencies(targets): - """Makes sure every dependency appears only once in all targets's dependency - lists.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - target_dict[dependency_key] = Unify(dependencies) - - -def Filter(items, item): - """Removes item from items.""" - res = {} - return [res.setdefault(e, e) for e in items if e != item] - - -def RemoveSelfDependencies(targets): - """Remove self dependencies from targets that have the prune_self_dependency - variable set.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - for t in dependencies: - if t == target_name: - if ( - targets[t] - .get("variables", {}) - .get("prune_self_dependency", 0) - ): - target_dict[dependency_key] = Filter( - dependencies, target_name - ) - - -def RemoveLinkDependenciesFromNoneTargets(targets): - """Remove dependencies having the 'link_dependency' attribute from the 'none' - targets.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - for t in dependencies: - if target_dict.get("type", None) == "none": - if targets[t].get("variables", {}).get("link_dependency", 0): - target_dict[dependency_key] = Filter( - target_dict[dependency_key], t - ) - - -class DependencyGraphNode: - """ - - Attributes: - ref: A reference to an object that this DependencyGraphNode represents. - dependencies: List of DependencyGraphNodes on which this one depends. - dependents: List of DependencyGraphNodes that depend on this one. - """ - - class CircularException(GypError): - pass - - def __init__(self, ref): - self.ref = ref - self.dependencies = [] - self.dependents = [] - - def __repr__(self): - return "" % self.ref - - def FlattenToList(self): - # flat_list is the sorted list of dependencies - actually, the list items - # are the "ref" attributes of DependencyGraphNodes. Every target will - # appear in flat_list after all of its dependencies, and before all of its - # dependents. - flat_list = OrderedSet() - - def ExtractNodeRef(node): - """Extracts the object that the node represents from the given node.""" - return node.ref - - # in_degree_zeros is the list of DependencyGraphNodes that have no - # dependencies not in flat_list. Initially, it is a copy of the children - # of this node, because when the graph was built, nodes with no - # dependencies were made implicit dependents of the root node. - in_degree_zeros = sorted(self.dependents[:], key=ExtractNodeRef) - - while in_degree_zeros: - # Nodes in in_degree_zeros have no dependencies not in flat_list, so they - # can be appended to flat_list. Take these nodes out of in_degree_zeros - # as work progresses, so that the next node to process from the list can - # always be accessed at a consistent position. - node = in_degree_zeros.pop() - flat_list.add(node.ref) - - # Look at dependents of the node just added to flat_list. Some of them - # may now belong in in_degree_zeros. - for node_dependent in sorted(node.dependents, key=ExtractNodeRef): - is_in_degree_zero = True - # TODO: We want to check through the - # node_dependent.dependencies list but if it's long and we - # always start at the beginning, then we get O(n^2) behaviour. - for node_dependent_dependency in sorted( - node_dependent.dependencies, key=ExtractNodeRef - ): - if node_dependent_dependency.ref not in flat_list: - # The dependent one or more dependencies not in flat_list. - # There will be more chances to add it to flat_list - # when examining it again as a dependent of those other - # dependencies, provided that there are no cycles. - is_in_degree_zero = False - break - - if is_in_degree_zero: - # All of the dependent's dependencies are already in flat_list. Add - # it to in_degree_zeros where it will be processed in a future - # iteration of the outer loop. - in_degree_zeros += [node_dependent] - - return list(flat_list) - - def FindCycles(self): - """ - Returns a list of cycles in the graph, where each cycle is its own list. - """ - results = [] - visited = set() - - def Visit(node, path): - for child in node.dependents: - if child in path: - results.append([child] + path[: path.index(child) + 1]) - elif child not in visited: - visited.add(child) - Visit(child, [child] + path) - - visited.add(self) - Visit(self, [self]) - - return results - - def DirectDependencies(self, dependencies=None): - """Returns a list of just direct dependencies.""" - if dependencies is None: - dependencies = [] - - for dependency in self.dependencies: - # Check for None, corresponding to the root node. - if dependency.ref and dependency.ref not in dependencies: - dependencies.append(dependency.ref) - - return dependencies - - def _AddImportedDependencies(self, targets, dependencies=None): - """Given a list of direct dependencies, adds indirect dependencies that - other dependencies have declared to export their settings. - - This method does not operate on self. Rather, it operates on the list - of dependencies in the |dependencies| argument. For each dependency in - that list, if any declares that it exports the settings of one of its - own dependencies, those dependencies whose settings are "passed through" - are added to the list. As new items are added to the list, they too will - be processed, so it is possible to import settings through multiple levels - of dependencies. - - This method is not terribly useful on its own, it depends on being - "primed" with a list of direct dependencies such as one provided by - DirectDependencies. DirectAndImportedDependencies is intended to be the - public entry point. - """ - - if dependencies is None: - dependencies = [] - - index = 0 - while index < len(dependencies): - dependency = dependencies[index] - dependency_dict = targets[dependency] - # Add any dependencies whose settings should be imported to the list - # if not already present. Newly-added items will be checked for - # their own imports when the list iteration reaches them. - # Rather than simply appending new items, insert them after the - # dependency that exported them. This is done to more closely match - # the depth-first method used by DeepDependencies. - add_index = 1 - for imported_dependency in dependency_dict.get( - "export_dependent_settings", [] - ): - if imported_dependency not in dependencies: - dependencies.insert(index + add_index, imported_dependency) - add_index = add_index + 1 - index = index + 1 - - return dependencies - - def DirectAndImportedDependencies(self, targets, dependencies=None): - """Returns a list of a target's direct dependencies and all indirect - dependencies that a dependency has advertised settings should be exported - through the dependency for. - """ - - dependencies = self.DirectDependencies(dependencies) - return self._AddImportedDependencies(targets, dependencies) - - def DeepDependencies(self, dependencies=None): - """Returns an OrderedSet of all of a target's dependencies, recursively.""" - if dependencies is None: - # Using a list to get ordered output and a set to do fast "is it - # already added" checks. - dependencies = OrderedSet() - - for dependency in self.dependencies: - # Check for None, corresponding to the root node. - if dependency.ref is None: - continue - if dependency.ref not in dependencies: - dependency.DeepDependencies(dependencies) - dependencies.add(dependency.ref) - - return dependencies - - def _LinkDependenciesInternal( - self, targets, include_shared_libraries, dependencies=None, initial=True - ): - """Returns an OrderedSet of dependency targets that are linked - into this target. - - This function has a split personality, depending on the setting of - |initial|. Outside callers should always leave |initial| at its default - setting. - - When adding a target to the list of dependencies, this function will - recurse into itself with |initial| set to False, to collect dependencies - that are linked into the linkable target for which the list is being built. - - If |include_shared_libraries| is False, the resulting dependencies will not - include shared_library targets that are linked into this target. - """ - if dependencies is None: - # Using a list to get ordered output and a set to do fast "is it - # already added" checks. - dependencies = OrderedSet() - - # Check for None, corresponding to the root node. - if self.ref is None: - return dependencies - - # It's kind of sucky that |targets| has to be passed into this function, - # but that's presently the easiest way to access the target dicts so that - # this function can find target types. - - if "target_name" not in targets[self.ref]: - raise GypError("Missing 'target_name' field in target.") - - if "type" not in targets[self.ref]: - raise GypError( - "Missing 'type' field in target %s" % targets[self.ref]["target_name"] - ) - - target_type = targets[self.ref]["type"] - - is_linkable = target_type in linkable_types - - if initial and not is_linkable: - # If this is the first target being examined and it's not linkable, - # return an empty list of link dependencies, because the link - # dependencies are intended to apply to the target itself (initial is - # True) and this target won't be linked. - return dependencies - - # Don't traverse 'none' targets if explicitly excluded. - if target_type == "none" and not targets[self.ref].get( - "dependencies_traverse", True - ): - dependencies.add(self.ref) - return dependencies - - # Executables, mac kernel extensions, windows drivers and loadable modules - # are already fully and finally linked. Nothing else can be a link - # dependency of them, there can only be dependencies in the sense that a - # dependent target might run an executable or load the loadable_module. - if not initial and target_type in ( - "executable", - "loadable_module", - "mac_kernel_extension", - "windows_driver", - ): - return dependencies - - # Shared libraries are already fully linked. They should only be included - # in |dependencies| when adjusting static library dependencies (in order to - # link against the shared_library's import lib), but should not be included - # in |dependencies| when propagating link_settings. - # The |include_shared_libraries| flag controls which of these two cases we - # are handling. - if ( - not initial - and target_type == "shared_library" - and not include_shared_libraries - ): - return dependencies - - # The target is linkable, add it to the list of link dependencies. - if self.ref not in dependencies: - dependencies.add(self.ref) - if initial or not is_linkable: - # If this is a subsequent target and it's linkable, don't look any - # further for linkable dependencies, as they'll already be linked into - # this target linkable. Always look at dependencies of the initial - # target, and always look at dependencies of non-linkables. - for dependency in self.dependencies: - dependency._LinkDependenciesInternal( - targets, include_shared_libraries, dependencies, False - ) - - return dependencies - - def DependenciesForLinkSettings(self, targets): - """ - Returns a list of dependency targets whose link_settings should be merged - into this target. - """ - - # TODO(sbaig) Currently, chrome depends on the bug that shared libraries' - # link_settings are propagated. So for now, we will allow it, unless the - # 'allow_sharedlib_linksettings_propagation' flag is explicitly set to - # False. Once chrome is fixed, we can remove this flag. - include_shared_libraries = targets[self.ref].get( - "allow_sharedlib_linksettings_propagation", True - ) - return self._LinkDependenciesInternal(targets, include_shared_libraries) - - def DependenciesToLinkAgainst(self, targets): - """ - Returns a list of dependency targets that are linked into this target. - """ - return self._LinkDependenciesInternal(targets, True) - - -def BuildDependencyList(targets): - # Create a DependencyGraphNode for each target. Put it into a dict for easy - # access. - dependency_nodes = {} - for target, spec in targets.items(): - if target not in dependency_nodes: - dependency_nodes[target] = DependencyGraphNode(target) - - # Set up the dependency links. Targets that have no dependencies are treated - # as dependent on root_node. - root_node = DependencyGraphNode(None) - for target, spec in targets.items(): - target_node = dependency_nodes[target] - dependencies = spec.get("dependencies") - if not dependencies: - target_node.dependencies = [root_node] - root_node.dependents.append(target_node) - else: - for dependency in dependencies: - dependency_node = dependency_nodes.get(dependency) - if not dependency_node: - raise GypError( - "Dependency '%s' not found while " - "trying to load target %s" % (dependency, target) - ) - target_node.dependencies.append(dependency_node) - dependency_node.dependents.append(target_node) - - flat_list = root_node.FlattenToList() - - # If there's anything left unvisited, there must be a circular dependency - # (cycle). - if len(flat_list) != len(targets): - if not root_node.dependents: - # If all targets have dependencies, add the first target as a dependent - # of root_node so that the cycle can be discovered from root_node. - target = next(iter(targets)) - target_node = dependency_nodes[target] - target_node.dependencies.append(root_node) - root_node.dependents.append(target_node) - - cycles = [] - for cycle in root_node.FindCycles(): - paths = [node.ref for node in cycle] - cycles.append("Cycle: %s" % " -> ".join(paths)) - raise DependencyGraphNode.CircularException( - "Cycles in dependency graph detected:\n" + "\n".join(cycles) - ) - - return [dependency_nodes, flat_list] - - -def VerifyNoGYPFileCircularDependencies(targets): - # Create a DependencyGraphNode for each gyp file containing a target. Put - # it into a dict for easy access. - dependency_nodes = {} - for target in targets: - build_file = gyp.common.BuildFile(target) - if build_file not in dependency_nodes: - dependency_nodes[build_file] = DependencyGraphNode(build_file) - - # Set up the dependency links. - for target, spec in targets.items(): - build_file = gyp.common.BuildFile(target) - build_file_node = dependency_nodes[build_file] - target_dependencies = spec.get("dependencies", []) - for dependency in target_dependencies: - try: - dependency_build_file = gyp.common.BuildFile(dependency) - except GypError as e: - gyp.common.ExceptionAppend( - e, "while computing dependencies of .gyp file %s" % build_file - ) - raise - - if dependency_build_file == build_file: - # A .gyp file is allowed to refer back to itself. - continue - dependency_node = dependency_nodes.get(dependency_build_file) - if not dependency_node: - raise GypError("Dependency '%s' not found" % dependency_build_file) - if dependency_node not in build_file_node.dependencies: - build_file_node.dependencies.append(dependency_node) - dependency_node.dependents.append(build_file_node) - - # Files that have no dependencies are treated as dependent on root_node. - root_node = DependencyGraphNode(None) - for build_file_node in dependency_nodes.values(): - if len(build_file_node.dependencies) == 0: - build_file_node.dependencies.append(root_node) - root_node.dependents.append(build_file_node) - - flat_list = root_node.FlattenToList() - - # If there's anything left unvisited, there must be a circular dependency - # (cycle). - if len(flat_list) != len(dependency_nodes): - if not root_node.dependents: - # If all files have dependencies, add the first file as a dependent - # of root_node so that the cycle can be discovered from root_node. - file_node = next(iter(dependency_nodes.values())) - file_node.dependencies.append(root_node) - root_node.dependents.append(file_node) - cycles = [] - for cycle in root_node.FindCycles(): - paths = [node.ref for node in cycle] - cycles.append("Cycle: %s" % " -> ".join(paths)) - raise DependencyGraphNode.CircularException( - "Cycles in .gyp file dependency graph detected:\n" + "\n".join(cycles) - ) - - -def DoDependentSettings(key, flat_list, targets, dependency_nodes): - # key should be one of all_dependent_settings, direct_dependent_settings, - # or link_settings. - - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - - if key == "all_dependent_settings": - dependencies = dependency_nodes[target].DeepDependencies() - elif key == "direct_dependent_settings": - dependencies = dependency_nodes[target].DirectAndImportedDependencies( - targets - ) - elif key == "link_settings": - dependencies = dependency_nodes[target].DependenciesForLinkSettings(targets) - else: - raise GypError( - "DoDependentSettings doesn't know how to determine " - "dependencies for " + key - ) - - for dependency in dependencies: - dependency_dict = targets[dependency] - if key not in dependency_dict: - continue - dependency_build_file = gyp.common.BuildFile(dependency) - MergeDicts( - target_dict, dependency_dict[key], build_file, dependency_build_file - ) - - -def AdjustStaticLibraryDependencies( - flat_list, targets, dependency_nodes, sort_dependencies -): - # Recompute target "dependencies" properties. For each static library - # target, remove "dependencies" entries referring to other static libraries, - # unless the dependency has the "hard_dependency" attribute set. For each - # linkable target, add a "dependencies" entry referring to all of the - # target's computed list of link dependencies (including static libraries - # if no such entry is already present. - for target in flat_list: - target_dict = targets[target] - target_type = target_dict["type"] - - if target_type == "static_library": - if "dependencies" not in target_dict: - continue - - target_dict["dependencies_original"] = target_dict.get("dependencies", [])[ - : - ] - - # A static library should not depend on another static library unless - # the dependency relationship is "hard," which should only be done when - # a dependent relies on some side effect other than just the build - # product, like a rule or action output. Further, if a target has a - # non-hard dependency, but that dependency exports a hard dependency, - # the non-hard dependency can safely be removed, but the exported hard - # dependency must be added to the target to keep the same dependency - # ordering. - dependencies = dependency_nodes[target].DirectAndImportedDependencies( - targets - ) - index = 0 - while index < len(dependencies): - dependency = dependencies[index] - dependency_dict = targets[dependency] - - # Remove every non-hard static library dependency and remove every - # non-static library dependency that isn't a direct dependency. - if ( - dependency_dict["type"] == "static_library" - and not dependency_dict.get("hard_dependency", False) - ) or ( - dependency_dict["type"] != "static_library" - and dependency not in target_dict["dependencies"] - ): - # Take the dependency out of the list, and don't increment index - # because the next dependency to analyze will shift into the index - # formerly occupied by the one being removed. - del dependencies[index] - else: - index = index + 1 - - # Update the dependencies. If the dependencies list is empty, it's not - # needed, so unhook it. - if len(dependencies) > 0: - target_dict["dependencies"] = dependencies - else: - del target_dict["dependencies"] - - elif target_type in linkable_types: - # Get a list of dependency targets that should be linked into this - # target. Add them to the dependencies list if they're not already - # present. - - link_dependencies = dependency_nodes[target].DependenciesToLinkAgainst( - targets - ) - for dependency in link_dependencies: - if dependency == target: - continue - if "dependencies" not in target_dict: - target_dict["dependencies"] = [] - if dependency not in target_dict["dependencies"]: - target_dict["dependencies"].append(dependency) - # Sort the dependencies list in the order from dependents to dependencies. - # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. - # Note: flat_list is already sorted in the order from dependencies to - # dependents. - if sort_dependencies and "dependencies" in target_dict: - target_dict["dependencies"] = [ - dep - for dep in reversed(flat_list) - if dep in target_dict["dependencies"] - ] - - -# Initialize this here to speed up MakePathRelative. -exception_re = re.compile(r"""["']?[-/$<>^]""") - - -def MakePathRelative(to_file, fro_file, item): - # If item is a relative path, it's relative to the build file dict that it's - # coming from. Fix it up to make it relative to the build file dict that - # it's going into. - # Exception: any |item| that begins with these special characters is - # returned without modification. - # / Used when a path is already absolute (shortcut optimization; - # such paths would be returned as absolute anyway) - # $ Used for build environment variables - # - Used for some build environment flags (such as -lapr-1 in a - # "libraries" section) - # < Used for our own variable and command expansions (see ExpandVariables) - # > Used for our own variable and command expansions (see ExpandVariables) - # ^ Used for our own variable and command expansions (see ExpandVariables) - # - # "/' Used when a value is quoted. If these are present, then we - # check the second character instead. - # - if to_file == fro_file or exception_re.match(item): - return item - else: - # TODO(dglazkov) The backslash/forward-slash replacement at the end is a - # temporary measure. This should really be addressed by keeping all paths - # in POSIX until actual project generation. - ret = os.path.normpath( - os.path.join( - gyp.common.RelativePath( - os.path.dirname(fro_file), os.path.dirname(to_file) - ), - item, - ) - ).replace("\\", "/") - if item.endswith("/"): - ret += "/" - return ret - - -def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): - # Python documentation recommends objects which do not support hash - # set this value to None. Python library objects follow this rule. - def is_hashable(val): - return val.__hash__ - - # If x is hashable, returns whether x is in s. Else returns whether x is in items. - def is_in_set_or_list(x, s, items): - if is_hashable(x): - return x in s - return x in items - - prepend_index = 0 - - # Make membership testing of hashables in |to| (in particular, strings) - # faster. - hashable_to_set = {x for x in to if is_hashable(x)} - for item in fro: - singleton = False - if type(item) in (str, int): - # The cheap and easy case. - if is_paths: - to_item = MakePathRelative(to_file, fro_file, item) - else: - to_item = item - - if not (type(item) is str and item.startswith("-")): - # Any string that doesn't begin with a "-" is a singleton - it can - # only appear once in a list, to be enforced by the list merge append - # or prepend. - singleton = True - elif type(item) is dict: - # Make a copy of the dictionary, continuing to look for paths to fix. - # The other intelligent aspects of merge processing won't apply because - # item is being merged into an empty dict. - to_item = {} - MergeDicts(to_item, item, to_file, fro_file) - elif type(item) is list: - # Recurse, making a copy of the list. If the list contains any - # descendant dicts, path fixing will occur. Note that here, custom - # values for is_paths and append are dropped; those are only to be - # applied to |to| and |fro|, not sublists of |fro|. append shouldn't - # matter anyway because the new |to_item| list is empty. - to_item = [] - MergeLists(to_item, item, to_file, fro_file) - else: - raise TypeError( - "Attempt to merge list item of unsupported type " - + item.__class__.__name__ - ) - - if append: - # If appending a singleton that's already in the list, don't append. - # This ensures that the earliest occurrence of the item will stay put. - if not singleton or not is_in_set_or_list(to_item, hashable_to_set, to): - to.append(to_item) - if is_hashable(to_item): - hashable_to_set.add(to_item) - else: - # If prepending a singleton that's already in the list, remove the - # existing instance and proceed with the prepend. This ensures that the - # item appears at the earliest possible position in the list. - while singleton and to_item in to: - to.remove(to_item) - - # Don't just insert everything at index 0. That would prepend the new - # items to the list in reverse order, which would be an unwelcome - # surprise. - to.insert(prepend_index, to_item) - if is_hashable(to_item): - hashable_to_set.add(to_item) - prepend_index = prepend_index + 1 - - -def MergeDicts(to, fro, to_file, fro_file): - # I wanted to name the parameter "from" but it's a Python keyword... - for k, v in fro.items(): - # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give - # copy semantics. Something else may want to merge from the |fro| dict - # later, and having the same dict ref pointed to twice in the tree isn't - # what anyone wants considering that the dicts may subsequently be - # modified. - if k in to: - bad_merge = False - if type(v) in (str, int): - if type(to[k]) not in (str, int): - bad_merge = True - elif not isinstance(v, type(to[k])): - bad_merge = True - - if bad_merge: - raise TypeError( - "Attempt to merge dict value of type " - + v.__class__.__name__ - + " into incompatible type " - + to[k].__class__.__name__ - + " for key " - + k - ) - if type(v) in (str, int): - # Overwrite the existing value, if any. Cheap and easy. - is_path = IsPathSection(k) - if is_path: - to[k] = MakePathRelative(to_file, fro_file, v) - else: - to[k] = v - elif type(v) is dict: - # Recurse, guaranteeing copies will be made of objects that require it. - if k not in to: - to[k] = {} - MergeDicts(to[k], v, to_file, fro_file) - elif type(v) is list: - # Lists in dicts can be merged with different policies, depending on - # how the key in the "from" dict (k, the from-key) is written. - # - # If the from-key has ...the to-list will have this action - # this character appended:... applied when receiving the from-list: - # = replace - # + prepend - # ? set, only if to-list does not yet exist - # (none) append - # - # This logic is list-specific, but since it relies on the associated - # dict key, it's checked in this dict-oriented function. - ext = k[-1] - append = True - if ext == "=": - list_base = k[:-1] - lists_incompatible = [list_base, list_base + "?"] - to[list_base] = [] - elif ext == "+": - list_base = k[:-1] - lists_incompatible = [list_base + "=", list_base + "?"] - append = False - elif ext == "?": - list_base = k[:-1] - lists_incompatible = [list_base, list_base + "=", list_base + "+"] - else: - list_base = k - lists_incompatible = [list_base + "=", list_base + "?"] - - # Some combinations of merge policies appearing together are meaningless. - # It's stupid to replace and append simultaneously, for example. Append - # and prepend are the only policies that can coexist. - for list_incompatible in lists_incompatible: - if list_incompatible in fro: - raise GypError( - "Incompatible list policies " + k + " and " + list_incompatible - ) - - if list_base in to: - if ext == "?": - # If the key ends in "?", the list will only be merged if it doesn't - # already exist. - continue - elif type(to[list_base]) is not list: - # This may not have been checked above if merging in a list with an - # extension character. - raise TypeError( - "Attempt to merge dict value of type " - + v.__class__.__name__ - + " into incompatible type " - + to[list_base].__class__.__name__ - + " for key " - + list_base - + "(" - + k - + ")" - ) - else: - to[list_base] = [] - - # Call MergeLists, which will make copies of objects that require it. - # MergeLists can recurse back into MergeDicts, although this will be - # to make copies of dicts (with paths fixed), there will be no - # subsequent dict "merging" once entering a list because lists are - # always replaced, appended to, or prepended to. - is_paths = IsPathSection(list_base) - MergeLists(to[list_base], v, to_file, fro_file, is_paths, append) - else: - raise TypeError( - "Attempt to merge dict value of unsupported type " - + v.__class__.__name__ - + " for key " - + k - ) - - -def MergeConfigWithInheritance( - new_configuration_dict, build_file, target_dict, configuration, visited -): - # Skip if previously visited. - if configuration in visited: - return - - # Look at this configuration. - configuration_dict = target_dict["configurations"][configuration] - - # Merge in parents. - for parent in configuration_dict.get("inherit_from", []): - MergeConfigWithInheritance( - new_configuration_dict, - build_file, - target_dict, - parent, - visited + [configuration], - ) - - # Merge it into the new config. - MergeDicts(new_configuration_dict, configuration_dict, build_file, build_file) - - # Drop abstract. - if "abstract" in new_configuration_dict: - del new_configuration_dict["abstract"] - - -def SetUpConfigurations(target, target_dict): - # key_suffixes is a list of key suffixes that might appear on key names. - # These suffixes are handled in conditional evaluations (for =, +, and ?) - # and rules/exclude processing (for ! and /). Keys with these suffixes - # should be treated the same as keys without. - key_suffixes = ["=", "+", "?", "!", "/"] - - build_file = gyp.common.BuildFile(target) - - # Provide a single configuration by default if none exists. - # TODO(mark): Signal an error if default_configurations exists but - # configurations does not. - if "configurations" not in target_dict: - target_dict["configurations"] = {"Default": {}} - if "default_configuration" not in target_dict: - concrete = [ - i - for (i, config) in target_dict["configurations"].items() - if not config.get("abstract") - ] - target_dict["default_configuration"] = sorted(concrete)[0] - - merged_configurations = {} - configs = target_dict["configurations"] - for (configuration, old_configuration_dict) in configs.items(): - # Skip abstract configurations (saves work only). - if old_configuration_dict.get("abstract"): - continue - # Configurations inherit (most) settings from the enclosing target scope. - # Get the inheritance relationship right by making a copy of the target - # dict. - new_configuration_dict = {} - for (key, target_val) in target_dict.items(): - key_ext = key[-1:] - if key_ext in key_suffixes: - key_base = key[:-1] - else: - key_base = key - if key_base not in non_configuration_keys: - new_configuration_dict[key] = gyp.simple_copy.deepcopy(target_val) - - # Merge in configuration (with all its parents first). - MergeConfigWithInheritance( - new_configuration_dict, build_file, target_dict, configuration, [] - ) - - merged_configurations[configuration] = new_configuration_dict - - # Put the new configurations back into the target dict as a configuration. - for configuration in merged_configurations.keys(): - target_dict["configurations"][configuration] = merged_configurations[ - configuration - ] - - # Now drop all the abstract ones. - configs = target_dict["configurations"] - target_dict["configurations"] = { - k: v for k, v in configs.items() if not v.get("abstract") - } - - # Now that all of the target's configurations have been built, go through - # the target dict's keys and remove everything that's been moved into a - # "configurations" section. - delete_keys = [] - for key in target_dict: - key_ext = key[-1:] - if key_ext in key_suffixes: - key_base = key[:-1] - else: - key_base = key - if key_base not in non_configuration_keys: - delete_keys.append(key) - for key in delete_keys: - del target_dict[key] - - # Check the configurations to see if they contain invalid keys. - for configuration in target_dict["configurations"].keys(): - configuration_dict = target_dict["configurations"][configuration] - for key in configuration_dict.keys(): - if key in invalid_configuration_keys: - raise GypError( - "%s not allowed in the %s configuration, found in " - "target %s" % (key, configuration, target) - ) - - -def ProcessListFiltersInDict(name, the_dict): - """Process regular expression and exclusion-based filters on lists. - - An exclusion list is in a dict key named with a trailing "!", like - "sources!". Every item in such a list is removed from the associated - main list, which in this example, would be "sources". Removed items are - placed into a "sources_excluded" list in the dict. - - Regular expression (regex) filters are contained in dict keys named with a - trailing "/", such as "sources/" to operate on the "sources" list. Regex - filters in a dict take the form: - 'sources/': [ ['exclude', '_(linux|mac|win)\\.cc$'], - ['include', '_mac\\.cc$'] ], - The first filter says to exclude all files ending in _linux.cc, _mac.cc, and - _win.cc. The second filter then includes all files ending in _mac.cc that - are now or were once in the "sources" list. Items matching an "exclude" - filter are subject to the same processing as would occur if they were listed - by name in an exclusion list (ending in "!"). Items matching an "include" - filter are brought back into the main list if previously excluded by an - exclusion list or exclusion regex filter. Subsequent matching "exclude" - patterns can still cause items to be excluded after matching an "include". - """ - - # Look through the dictionary for any lists whose keys end in "!" or "/". - # These are lists that will be treated as exclude lists and regular - # expression-based exclude/include lists. Collect the lists that are - # needed first, looking for the lists that they operate on, and assemble - # then into |lists|. This is done in a separate loop up front, because - # the _included and _excluded keys need to be added to the_dict, and that - # can't be done while iterating through it. - - lists = [] - del_lists = [] - for key, value in the_dict.items(): - operation = key[-1] - if operation != "!" and operation != "/": - continue - - if type(value) is not list: - raise ValueError( - name + " key " + key + " must be list, not " + value.__class__.__name__ - ) - - list_key = key[:-1] - if list_key not in the_dict: - # This happens when there's a list like "sources!" but no corresponding - # "sources" list. Since there's nothing for it to operate on, queue up - # the "sources!" list for deletion now. - del_lists.append(key) - continue - - if type(the_dict[list_key]) is not list: - value = the_dict[list_key] - raise ValueError( - name - + " key " - + list_key - + " must be list, not " - + value.__class__.__name__ - + " when applying " - + {"!": "exclusion", "/": "regex"}[operation] - ) - - if list_key not in lists: - lists.append(list_key) - - # Delete the lists that are known to be unneeded at this point. - for del_list in del_lists: - del the_dict[del_list] - - for list_key in lists: - the_list = the_dict[list_key] - - # Initialize the list_actions list, which is parallel to the_list. Each - # item in list_actions identifies whether the corresponding item in - # the_list should be excluded, unconditionally preserved (included), or - # whether no exclusion or inclusion has been applied. Items for which - # no exclusion or inclusion has been applied (yet) have value -1, items - # excluded have value 0, and items included have value 1. Includes and - # excludes override previous actions. All items in list_actions are - # initialized to -1 because no excludes or includes have been processed - # yet. - list_actions = list((-1,) * len(the_list)) - - exclude_key = list_key + "!" - if exclude_key in the_dict: - for exclude_item in the_dict[exclude_key]: - for index, list_item in enumerate(the_list): - if exclude_item == list_item: - # This item matches the exclude_item, so set its action to 0 - # (exclude). - list_actions[index] = 0 - - # The "whatever!" list is no longer needed, dump it. - del the_dict[exclude_key] - - regex_key = list_key + "/" - if regex_key in the_dict: - for regex_item in the_dict[regex_key]: - [action, pattern] = regex_item - pattern_re = re.compile(pattern) - - if action == "exclude": - # This item matches an exclude regex, set its value to 0 (exclude). - action_value = 0 - elif action == "include": - # This item matches an include regex, set its value to 1 (include). - action_value = 1 - else: - # This is an action that doesn't make any sense. - raise ValueError( - "Unrecognized action " - + action - + " in " - + name - + " key " - + regex_key - ) - - for index, list_item in enumerate(the_list): - if list_actions[index] == action_value: - # Even if the regex matches, nothing will change so continue - # (regex searches are expensive). - continue - if pattern_re.search(list_item): - # Regular expression match. - list_actions[index] = action_value - - # The "whatever/" list is no longer needed, dump it. - del the_dict[regex_key] - - # Add excluded items to the excluded list. - # - # Note that exclude_key ("sources!") is different from excluded_key - # ("sources_excluded"). The exclude_key list is input and it was already - # processed and deleted; the excluded_key list is output and it's about - # to be created. - excluded_key = list_key + "_excluded" - if excluded_key in the_dict: - raise GypError( - name + " key " + excluded_key + " must not be present prior " - " to applying exclusion/regex filters for " + list_key - ) - - excluded_list = [] - - # Go backwards through the list_actions list so that as items are deleted, - # the indices of items that haven't been seen yet don't shift. That means - # that things need to be prepended to excluded_list to maintain them in the - # same order that they existed in the_list. - for index in range(len(list_actions) - 1, -1, -1): - if list_actions[index] == 0: - # Dump anything with action 0 (exclude). Keep anything with action 1 - # (include) or -1 (no include or exclude seen for the item). - excluded_list.insert(0, the_list[index]) - del the_list[index] - - # If anything was excluded, put the excluded list into the_dict at - # excluded_key. - if len(excluded_list) > 0: - the_dict[excluded_key] = excluded_list - - # Now recurse into subdicts and lists that may contain dicts. - for key, value in the_dict.items(): - if type(value) is dict: - ProcessListFiltersInDict(key, value) - elif type(value) is list: - ProcessListFiltersInList(key, value) - - -def ProcessListFiltersInList(name, the_list): - for item in the_list: - if type(item) is dict: - ProcessListFiltersInDict(name, item) - elif type(item) is list: - ProcessListFiltersInList(name, item) - - -def ValidateTargetType(target, target_dict): - """Ensures the 'type' field on the target is one of the known types. - - Arguments: - target: string, name of target. - target_dict: dict, target spec. - - Raises an exception on error. - """ - VALID_TARGET_TYPES = ( - "executable", - "loadable_module", - "static_library", - "shared_library", - "mac_kernel_extension", - "none", - "windows_driver", - ) - target_type = target_dict.get("type", None) - if target_type not in VALID_TARGET_TYPES: - raise GypError( - "Target %s has an invalid target type '%s'. " - "Must be one of %s." % (target, target_type, "/".join(VALID_TARGET_TYPES)) - ) - if ( - target_dict.get("standalone_static_library", 0) - and not target_type == "static_library" - ): - raise GypError( - "Target %s has type %s but standalone_static_library flag is" - " only valid for static_library type." % (target, target_type) - ) - - -def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): - """Ensures that the rules sections in target_dict are valid and consistent, - and determines which sources they apply to. - - Arguments: - target: string, name of target. - target_dict: dict, target spec containing "rules" and "sources" lists. - extra_sources_for_rules: a list of keys to scan for rule matches in - addition to 'sources'. - """ - - # Dicts to map between values found in rules' 'rule_name' and 'extension' - # keys and the rule dicts themselves. - rule_names = {} - rule_extensions = {} - - rules = target_dict.get("rules", []) - for rule in rules: - # Make sure that there's no conflict among rule names and extensions. - rule_name = rule["rule_name"] - if rule_name in rule_names: - raise GypError( - f"rule {rule_name} exists in duplicate, target {target}" - ) - rule_names[rule_name] = rule - - rule_extension = rule["extension"] - if rule_extension.startswith("."): - rule_extension = rule_extension[1:] - if rule_extension in rule_extensions: - raise GypError( - ( - "extension %s associated with multiple rules, " - + "target %s rules %s and %s" - ) - % ( - rule_extension, - target, - rule_extensions[rule_extension]["rule_name"], - rule_name, - ) - ) - rule_extensions[rule_extension] = rule - - # Make sure rule_sources isn't already there. It's going to be - # created below if needed. - if "rule_sources" in rule: - raise GypError( - "rule_sources must not exist in input, target %s rule %s" - % (target, rule_name) - ) - - rule_sources = [] - source_keys = ["sources"] - source_keys.extend(extra_sources_for_rules) - for source_key in source_keys: - for source in target_dict.get(source_key, []): - (source_root, source_extension) = os.path.splitext(source) - if source_extension.startswith("."): - source_extension = source_extension[1:] - if source_extension == rule_extension: - rule_sources.append(source) - - if len(rule_sources) > 0: - rule["rule_sources"] = rule_sources - - -def ValidateRunAsInTarget(target, target_dict, build_file): - target_name = target_dict.get("target_name") - run_as = target_dict.get("run_as") - if not run_as: - return - if type(run_as) is not dict: - raise GypError( - "The 'run_as' in target %s from file %s should be a " - "dictionary." % (target_name, build_file) - ) - action = run_as.get("action") - if not action: - raise GypError( - "The 'run_as' in target %s from file %s must have an " - "'action' section." % (target_name, build_file) - ) - if type(action) is not list: - raise GypError( - "The 'action' for 'run_as' in target %s from file %s " - "must be a list." % (target_name, build_file) - ) - working_directory = run_as.get("working_directory") - if working_directory and type(working_directory) is not str: - raise GypError( - "The 'working_directory' for 'run_as' in target %s " - "in file %s should be a string." % (target_name, build_file) - ) - environment = run_as.get("environment") - if environment and type(environment) is not dict: - raise GypError( - "The 'environment' for 'run_as' in target %s " - "in file %s should be a dictionary." % (target_name, build_file) - ) - - -def ValidateActionsInTarget(target, target_dict, build_file): - """Validates the inputs to the actions in a target.""" - target_name = target_dict.get("target_name") - actions = target_dict.get("actions", []) - for action in actions: - action_name = action.get("action_name") - if not action_name: - raise GypError( - "Anonymous action in target %s. " - "An action must have an 'action_name' field." % target_name - ) - inputs = action.get("inputs", None) - if inputs is None: - raise GypError("Action in target %s has no inputs." % target_name) - action_command = action.get("action") - if action_command and not action_command[0]: - raise GypError("Empty action as command in target %s." % target_name) - - -def TurnIntIntoStrInDict(the_dict): - """Given dict the_dict, recursively converts all integers into strings. - """ - # Use items instead of iteritems because there's no need to try to look at - # reinserted keys and their associated values. - for k, v in the_dict.items(): - if type(v) is int: - v = str(v) - the_dict[k] = v - elif type(v) is dict: - TurnIntIntoStrInDict(v) - elif type(v) is list: - TurnIntIntoStrInList(v) - - if type(k) is int: - del the_dict[k] - the_dict[str(k)] = v - - -def TurnIntIntoStrInList(the_list): - """Given list the_list, recursively converts all integers into strings. - """ - for index, item in enumerate(the_list): - if type(item) is int: - the_list[index] = str(item) - elif type(item) is dict: - TurnIntIntoStrInDict(item) - elif type(item) is list: - TurnIntIntoStrInList(item) - - -def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets, data): - """Return only the targets that are deep dependencies of |root_targets|.""" - qualified_root_targets = [] - for target in root_targets: - target = target.strip() - qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list) - if not qualified_targets: - raise GypError("Could not find target %s" % target) - qualified_root_targets.extend(qualified_targets) - - wanted_targets = {} - for target in qualified_root_targets: - wanted_targets[target] = targets[target] - for dependency in dependency_nodes[target].DeepDependencies(): - wanted_targets[dependency] = targets[dependency] - - wanted_flat_list = [t for t in flat_list if t in wanted_targets] - - # Prune unwanted targets from each build_file's data dict. - for build_file in data["target_build_files"]: - if "targets" not in data[build_file]: - continue - new_targets = [] - for target in data[build_file]["targets"]: - qualified_name = gyp.common.QualifiedTarget( - build_file, target["target_name"], target["toolset"] - ) - if qualified_name in wanted_targets: - new_targets.append(target) - data[build_file]["targets"] = new_targets - - return wanted_targets, wanted_flat_list - - -def VerifyNoCollidingTargets(targets): - """Verify that no two targets in the same directory share the same name. - - Arguments: - targets: A list of targets in the form 'path/to/file.gyp:target_name'. - """ - # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'. - used = {} - for target in targets: - # Separate out 'path/to/file.gyp, 'target_name' from - # 'path/to/file.gyp:target_name'. - path, name = target.rsplit(":", 1) - # Separate out 'path/to', 'file.gyp' from 'path/to/file.gyp'. - subdir, gyp = os.path.split(path) - # Use '.' for the current directory '', so that the error messages make - # more sense. - if not subdir: - subdir = "." - # Prepare a key like 'path/to:target_name'. - key = subdir + ":" + name - if key in used: - # Complain if this target is already used. - raise GypError( - 'Duplicate target name "%s" in directory "%s" used both ' - 'in "%s" and "%s".' % (name, subdir, gyp, used[key]) - ) - used[key] = gyp - - -def SetGeneratorGlobals(generator_input_info): - # Set up path_sections and non_configuration_keys with the default data plus - # the generator-specific data. - global path_sections - path_sections = set(base_path_sections) - path_sections.update(generator_input_info["path_sections"]) - - global non_configuration_keys - non_configuration_keys = base_non_configuration_keys[:] - non_configuration_keys.extend(generator_input_info["non_configuration_keys"]) - - global multiple_toolsets - multiple_toolsets = generator_input_info["generator_supports_multiple_toolsets"] - - global generator_filelist_paths - generator_filelist_paths = generator_input_info["generator_filelist_paths"] - - -def Load( - build_files, - variables, - includes, - depth, - generator_input_info, - check, - circular_check, - parallel, - root_targets, -): - SetGeneratorGlobals(generator_input_info) - # A generator can have other lists (in addition to sources) be processed - # for rules. - extra_sources_for_rules = generator_input_info["extra_sources_for_rules"] - - # Load build files. This loads every target-containing build file into - # the |data| dictionary such that the keys to |data| are build file names, - # and the values are the entire build file contents after "early" or "pre" - # processing has been done and includes have been resolved. - # NOTE: data contains both "target" files (.gyp) and "includes" (.gypi), as - # well as meta-data (e.g. 'included_files' key). 'target_build_files' keeps - # track of the keys corresponding to "target" files. - data = {"target_build_files": set()} - # Normalize paths everywhere. This is important because paths will be - # used as keys to the data dict and for references between input files. - build_files = set(map(os.path.normpath, build_files)) - if parallel: - LoadTargetBuildFilesParallel( - build_files, data, variables, includes, depth, check, generator_input_info - ) - else: - aux_data = {} - for build_file in build_files: - try: - LoadTargetBuildFile( - build_file, data, aux_data, variables, includes, depth, check, True - ) - except Exception as e: - gyp.common.ExceptionAppend(e, "while trying to load %s" % build_file) - raise - - # Build a dict to access each target's subdict by qualified name. - targets = BuildTargetsDict(data) - - # Fully qualify all dependency links. - QualifyDependencies(targets) - - # Remove self-dependencies from targets that have 'prune_self_dependencies' - # set to 1. - RemoveSelfDependencies(targets) - - # Expand dependencies specified as build_file:*. - ExpandWildcardDependencies(targets, data) - - # Remove all dependencies marked as 'link_dependency' from the targets of - # type 'none'. - RemoveLinkDependenciesFromNoneTargets(targets) - - # Apply exclude (!) and regex (/) list filters only for dependency_sections. - for target_name, target_dict in targets.items(): - tmp_dict = {} - for key_base in dependency_sections: - for op in ("", "!", "/"): - key = key_base + op - if key in target_dict: - tmp_dict[key] = target_dict[key] - del target_dict[key] - ProcessListFiltersInDict(target_name, tmp_dict) - # Write the results back to |target_dict|. - for key in tmp_dict: - target_dict[key] = tmp_dict[key] - - # Make sure every dependency appears at most once. - RemoveDuplicateDependencies(targets) - - if circular_check: - # Make sure that any targets in a.gyp don't contain dependencies in other - # .gyp files that further depend on a.gyp. - VerifyNoGYPFileCircularDependencies(targets) - - [dependency_nodes, flat_list] = BuildDependencyList(targets) - - if root_targets: - # Remove, from |targets| and |flat_list|, the targets that are not deep - # dependencies of the targets specified in |root_targets|. - targets, flat_list = PruneUnwantedTargets( - targets, flat_list, dependency_nodes, root_targets, data - ) - - # Check that no two targets in the same directory have the same name. - VerifyNoCollidingTargets(flat_list) - - # Handle dependent settings of various types. - for settings_type in [ - "all_dependent_settings", - "direct_dependent_settings", - "link_settings", - ]: - DoDependentSettings(settings_type, flat_list, targets, dependency_nodes) - - # Take out the dependent settings now that they've been published to all - # of the targets that require them. - for target in flat_list: - if settings_type in targets[target]: - del targets[target][settings_type] - - # Make sure static libraries don't declare dependencies on other static - # libraries, but that linkables depend on all unlinked static libraries - # that they need so that their link steps will be correct. - gii = generator_input_info - if gii["generator_wants_static_library_dependencies_adjusted"]: - AdjustStaticLibraryDependencies( - flat_list, - targets, - dependency_nodes, - gii["generator_wants_sorted_dependencies"], - ) - - # Apply "post"/"late"/"target" variable expansions and condition evaluations. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ProcessVariablesAndConditionsInDict( - target_dict, PHASE_LATE, variables, build_file - ) - - # Move everything that can go into a "configurations" section into one. - for target in flat_list: - target_dict = targets[target] - SetUpConfigurations(target, target_dict) - - # Apply exclude (!) and regex (/) list filters. - for target in flat_list: - target_dict = targets[target] - ProcessListFiltersInDict(target, target_dict) - - # Apply "latelate" variable expansions and condition evaluations. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ProcessVariablesAndConditionsInDict( - target_dict, PHASE_LATELATE, variables, build_file - ) - - # Make sure that the rules make sense, and build up rule_sources lists as - # needed. Not all generators will need to use the rule_sources lists, but - # some may, and it seems best to build the list in a common spot. - # Also validate actions and run_as elements in targets. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ValidateTargetType(target, target_dict) - ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) - ValidateRunAsInTarget(target, target_dict, build_file) - ValidateActionsInTarget(target, target_dict, build_file) - - # Generators might not expect ints. Turn them into strs. - TurnIntIntoStrInDict(data) - - # TODO(mark): Return |data| for now because the generator needs a list of - # build files that came in. In the future, maybe it should just accept - # a list, and not the whole data dict. - return [flat_list, targets, data] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/input_test.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/input_test.py deleted file mode 100755 index a18f72e9e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Unit tests for the input.py file.""" - -import gyp.input -import unittest - - -class TestFindCycles(unittest.TestCase): - def setUp(self): - self.nodes = {} - for x in ("a", "b", "c", "d", "e"): - self.nodes[x] = gyp.input.DependencyGraphNode(x) - - def _create_dependency(self, dependent, dependency): - dependent.dependencies.append(dependency) - dependency.dependents.append(dependent) - - def test_no_cycle_empty_graph(self): - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_no_cycle_line(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["c"]) - self._create_dependency(self.nodes["c"], self.nodes["d"]) - - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_no_cycle_dag(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["a"], self.nodes["c"]) - self._create_dependency(self.nodes["b"], self.nodes["c"]) - - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_cycle_self_reference(self): - self._create_dependency(self.nodes["a"], self.nodes["a"]) - - self.assertEqual( - [[self.nodes["a"], self.nodes["a"]]], self.nodes["a"].FindCycles() - ) - - def test_cycle_two_nodes(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["a"]) - - self.assertEqual( - [[self.nodes["a"], self.nodes["b"], self.nodes["a"]]], - self.nodes["a"].FindCycles(), - ) - self.assertEqual( - [[self.nodes["b"], self.nodes["a"], self.nodes["b"]]], - self.nodes["b"].FindCycles(), - ) - - def test_two_cycles(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["a"]) - - self._create_dependency(self.nodes["b"], self.nodes["c"]) - self._create_dependency(self.nodes["c"], self.nodes["b"]) - - cycles = self.nodes["a"].FindCycles() - self.assertTrue([self.nodes["a"], self.nodes["b"], self.nodes["a"]] in cycles) - self.assertTrue([self.nodes["b"], self.nodes["c"], self.nodes["b"]] in cycles) - self.assertEqual(2, len(cycles)) - - def test_big_cycle(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["c"]) - self._create_dependency(self.nodes["c"], self.nodes["d"]) - self._create_dependency(self.nodes["d"], self.nodes["e"]) - self._create_dependency(self.nodes["e"], self.nodes["a"]) - - self.assertEqual( - [ - [ - self.nodes["a"], - self.nodes["b"], - self.nodes["c"], - self.nodes["d"], - self.nodes["e"], - self.nodes["a"], - ] - ], - self.nodes["a"].FindCycles(), - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py deleted file mode 100755 index 59647c9a8..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +++ /dev/null @@ -1,771 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions to perform Xcode-style build steps. - -These functions are executed via gyp-mac-tool when using the Makefile generator. -""" - - -import fcntl -import fnmatch -import glob -import json -import os -import plistlib -import re -import shutil -import struct -import subprocess -import sys -import tempfile - - -def main(args): - executor = MacTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) - - -class MacTool: - """This class performs all the Mac tooling steps. The methods can either be - executed directly, or dispatched from an argument list.""" - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace("-", "") - - def ExecCopyBundleResource(self, source, dest, convert_to_binary): - """Copies a resource file to the bundle/Resources directory, performing any - necessary compilation on each resource.""" - convert_to_binary = convert_to_binary == "True" - extension = os.path.splitext(source)[1].lower() - if os.path.isdir(source): - # Copy tree. - # TODO(thakis): This copies file attributes like mtime, while the - # single-file branch below doesn't. This should probably be changed to - # be consistent with the single-file branch. - if os.path.exists(dest): - shutil.rmtree(dest) - shutil.copytree(source, dest) - elif extension == ".xib": - return self._CopyXIBFile(source, dest) - elif extension == ".storyboard": - return self._CopyXIBFile(source, dest) - elif extension == ".strings" and not convert_to_binary: - self._CopyStringsFile(source, dest) - else: - if os.path.exists(dest): - os.unlink(dest) - shutil.copy(source, dest) - - if convert_to_binary and extension in (".plist", ".strings"): - self._ConvertToBinary(dest) - - def _CopyXIBFile(self, source, dest): - """Compiles a XIB file with ibtool into a binary plist in the bundle.""" - - # ibtool sometimes crashes with relative paths. See crbug.com/314728. - base = os.path.dirname(os.path.realpath(__file__)) - if os.path.relpath(source): - source = os.path.join(base, source) - if os.path.relpath(dest): - dest = os.path.join(base, dest) - - args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"] - - if os.environ["XCODE_VERSION_ACTUAL"] > "0700": - args.extend(["--auto-activate-custom-fonts"]) - if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ: - args.extend( - [ - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - ] - ) - else: - args.extend( - [ - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - ] - ) - - args.extend( - ["--output-format", "human-readable-text", "--compile", dest, source] - ) - - ibtool_section_re = re.compile(r"/\*.*\*/") - ibtool_re = re.compile(r".*note:.*is clipping its content") - try: - stdout = subprocess.check_output(args) - except subprocess.CalledProcessError as e: - print(e.output) - raise - current_section_header = None - for line in stdout.splitlines(): - if ibtool_section_re.match(line): - current_section_header = line - elif not ibtool_re.match(line): - if current_section_header: - print(current_section_header) - current_section_header = None - print(line) - return 0 - - def _ConvertToBinary(self, dest): - subprocess.check_call( - ["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest] - ) - - def _CopyStringsFile(self, source, dest): - """Copies a .strings file using iconv to reconvert the input into UTF-16.""" - input_code = self._DetectInputEncoding(source) or "UTF-8" - - # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call - # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints - # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing - # semicolon in dictionary. - # on invalid files. Do the same kind of validation. - import CoreFoundation - - with open(source, "rb") as in_file: - s = in_file.read() - d = CoreFoundation.CFDataCreate(None, s, len(s)) - _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) - if error: - return - - with open(dest, "wb") as fp: - fp.write(s.decode(input_code).encode("UTF-16")) - - def _DetectInputEncoding(self, file_name): - """Reads the first few bytes from file_name and tries to guess the text - encoding. Returns None as a guess if it can't detect it.""" - with open(file_name, "rb") as fp: - try: - header = fp.read(3) - except Exception: - return None - if header.startswith(b"\xFE\xFF"): - return "UTF-16" - elif header.startswith(b"\xFF\xFE"): - return "UTF-16" - elif header.startswith(b"\xEF\xBB\xBF"): - return "UTF-8" - else: - return None - - def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): - """Copies the |source| Info.plist to the destination directory |dest|.""" - # Read the source Info.plist into memory. - with open(source) as fd: - lines = fd.read() - - # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). - plist = plistlib.readPlistFromString(lines) - if keys: - plist.update(json.loads(keys[0])) - lines = plistlib.writePlistToString(plist) - - # Go through all the environment variables and replace them as variables in - # the file. - IDENT_RE = re.compile(r"[_/\s]") - for key in os.environ: - if key.startswith("_"): - continue - evar = "${%s}" % key - evalue = os.environ[key] - lines = lines.replace(lines, evar, evalue) - - # Xcode supports various suffices on environment variables, which are - # all undocumented. :rfc1034identifier is used in the standard project - # template these days, and :identifier was used earlier. They are used to - # convert non-url characters into things that look like valid urls -- - # except that the replacement character for :identifier, '_' isn't valid - # in a URL either -- oops, hence :rfc1034identifier was born. - evar = "${%s:identifier}" % key - evalue = IDENT_RE.sub("_", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - evar = "${%s:rfc1034identifier}" % key - evalue = IDENT_RE.sub("-", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - # Remove any keys with values that haven't been replaced. - lines = lines.splitlines() - for i in range(len(lines)): - if lines[i].strip().startswith("${"): - lines[i] = None - lines[i - 1] = None - lines = "\n".join(line for line in lines if line is not None) - - # Write out the file with variables replaced. - with open(dest, "w") as fd: - fd.write(lines) - - # Now write out PkgInfo file now that the Info.plist file has been - # "compiled". - self._WritePkgInfo(dest) - - if convert_to_binary == "True": - self._ConvertToBinary(dest) - - def _WritePkgInfo(self, info_plist): - """This writes the PkgInfo file from the data stored in Info.plist.""" - plist = plistlib.readPlist(info_plist) - if not plist: - return - - # Only create PkgInfo for executable types. - package_type = plist["CFBundlePackageType"] - if package_type != "APPL": - return - - # The format of PkgInfo is eight characters, representing the bundle type - # and bundle signature, each four characters. If that is missing, four - # '?' characters are used instead. - signature_code = plist.get("CFBundleSignature", "????") - if len(signature_code) != 4: # Wrong length resets everything, too. - signature_code = "?" * 4 - - dest = os.path.join(os.path.dirname(info_plist), "PkgInfo") - with open(dest, "w") as fp: - fp.write(f"{package_type}{signature_code}") - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - fcntl.flock(fd, fcntl.LOCK_EX) - return subprocess.call(cmd_list) - - def ExecFilterLibtool(self, *cmd_list): - """Calls libtool and filters out '/path/to/libtool: file: foo.o has no - symbols'.""" - libtool_re = re.compile( - r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$" - ) - libtool_re5 = re.compile( - r"^.*libtool: warning for library: " - + r".* the table of contents is empty " - + r"\(no object file members in the library define global symbols\)$" - ) - env = os.environ.copy() - # Ref: - # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c - # The problem with this flag is that it resets the file mtime on the file to - # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. - env["ZERO_AR_DATE"] = "1" - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) - err = libtoolout.communicate()[1].decode("utf-8") - for line in err.splitlines(): - if not libtool_re.match(line) and not libtool_re5.match(line): - print(line, file=sys.stderr) - # Unconditionally touch the output .a file on the command line if present - # and the command succeeded. A bit hacky. - if not libtoolout.returncode: - for i in range(len(cmd_list) - 1): - if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"): - os.utime(cmd_list[i + 1], None) - break - return libtoolout.returncode - - def ExecPackageIosFramework(self, framework): - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - module_path = os.path.join(framework, "Modules") - if not os.path.exists(module_path): - os.mkdir(module_path) - module_template = ( - "framework module %s {\n" - ' umbrella header "%s.h"\n' - "\n" - " export *\n" - " module * { export * }\n" - "}\n" % (binary, binary) - ) - - with open(os.path.join(module_path, "module.modulemap"), "w") as module_file: - module_file.write(module_template) - - def ExecPackageFramework(self, framework, version): - """Takes a path to Something.framework and the Current version of that and - sets up all the symlinks.""" - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - - CURRENT = "Current" - RESOURCES = "Resources" - VERSIONS = "Versions" - - if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): - # Binary-less frameworks don't seem to contain symlinks (see e.g. - # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). - return - - # Move into the framework directory to set the symlinks correctly. - pwd = os.getcwd() - os.chdir(framework) - - # Set up the Current version. - self._Relink(version, os.path.join(VERSIONS, CURRENT)) - - # Set up the root symlinks. - self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) - self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) - - # Back to where we were before! - os.chdir(pwd) - - def _Relink(self, dest, link): - """Creates a symlink to |dest| named |link|. If |link| already exists, - it is overwritten.""" - if os.path.lexists(link): - os.remove(link) - os.symlink(dest, link) - - def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): - framework_name = os.path.basename(framework).split(".")[0] - all_headers = [os.path.abspath(header) for header in all_headers] - filelist = {} - for header in all_headers: - filename = os.path.basename(header) - filelist[filename] = header - filelist[os.path.join(framework_name, filename)] = header - WriteHmap(out, filelist) - - def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers): - header_path = os.path.join(framework, "Headers") - if not os.path.exists(header_path): - os.makedirs(header_path) - for header in copy_headers: - shutil.copy(header, os.path.join(header_path, os.path.basename(header))) - - def ExecCompileXcassets(self, keys, *inputs): - """Compiles multiple .xcassets files into a single .car file. - - This invokes 'actool' to compile all the inputs .xcassets files. The - |keys| arguments is a json-encoded dictionary of extra arguments to - pass to 'actool' when the asset catalogs contains an application icon - or a launch image. - - Note that 'actool' does not create the Assets.car file if the asset - catalogs does not contains imageset. - """ - command_line = [ - "xcrun", - "actool", - "--output-format", - "human-readable-text", - "--compress-pngs", - "--notices", - "--warnings", - "--errors", - ] - is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ - if is_iphone_target: - platform = os.environ["CONFIGURATION"].split("-")[-1] - if platform not in ("iphoneos", "iphonesimulator"): - platform = "iphonesimulator" - command_line.extend( - [ - "--platform", - platform, - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]), - ] - ) - else: - command_line.extend( - [ - "--platform", - "macosx", - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]), - ] - ) - if keys: - keys = json.loads(keys) - for key, value in keys.items(): - arg_name = "--" + key - if isinstance(value, bool): - if value: - command_line.append(arg_name) - elif isinstance(value, list): - for v in value: - command_line.append(arg_name) - command_line.append(str(v)) - else: - command_line.append(arg_name) - command_line.append(str(value)) - # Note: actool crashes if inputs path are relative, so use os.path.abspath - # to get absolute path name for inputs. - command_line.extend(map(os.path.abspath, inputs)) - subprocess.check_call(command_line) - - def ExecMergeInfoPlist(self, output, *inputs): - """Merge multiple .plist files into a single .plist file.""" - merged_plist = {} - for path in inputs: - plist = self._LoadPlistMaybeBinary(path) - self._MergePlist(merged_plist, plist) - plistlib.writePlist(merged_plist, output) - - def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): - """Code sign a bundle. - - This function tries to code sign an iOS bundle, following the same - algorithm as Xcode: - 1. pick the provisioning profile that best match the bundle identifier, - and copy it into the bundle as embedded.mobileprovision, - 2. copy Entitlements.plist from user or SDK next to the bundle, - 3. code sign the bundle. - """ - substitutions, overrides = self._InstallProvisioningProfile( - provisioning, self._GetCFBundleIdentifier() - ) - entitlements_path = self._InstallEntitlements( - entitlements, substitutions, overrides - ) - - args = ["codesign", "--force", "--sign", key] - if preserve == "True": - args.extend(["--deep", "--preserve-metadata=identifier,entitlements"]) - else: - args.extend(["--entitlements", entitlements_path]) - args.extend(["--timestamp=none", path]) - subprocess.check_call(args) - - def _InstallProvisioningProfile(self, profile, bundle_identifier): - """Installs embedded.mobileprovision into the bundle. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple containing two dictionary: variables substitutions and values - to overrides when generating the entitlements file. - """ - source_path, provisioning_data, team_id = self._FindProvisioningProfile( - profile, bundle_identifier - ) - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], - os.environ["CONTENTS_FOLDER_PATH"], - "embedded.mobileprovision", - ) - shutil.copy2(source_path, target_path) - substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".") - return substitutions, provisioning_data["Entitlements"] - - def _FindProvisioningProfile(self, profile, bundle_identifier): - """Finds the .mobileprovision file to use for signing the bundle. - - Checks all the installed provisioning profiles (or if the user specified - the PROVISIONING_PROFILE variable, only consult it) and select the most - specific that correspond to the bundle identifier. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple of the path to the selected provisioning profile, the data of - the embedded plist in the provisioning profile and the team identifier - to use for code signing. - - Raises: - SystemExit: if no .mobileprovision can be used to sign the bundle. - """ - profiles_dir = os.path.join( - os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles" - ) - if not os.path.isdir(profiles_dir): - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - provisioning_profiles = None - if profile: - profile_path = os.path.join(profiles_dir, profile + ".mobileprovision") - if os.path.exists(profile_path): - provisioning_profiles = [profile_path] - if not provisioning_profiles: - provisioning_profiles = glob.glob( - os.path.join(profiles_dir, "*.mobileprovision") - ) - valid_provisioning_profiles = {} - for profile_path in provisioning_profiles: - profile_data = self._LoadProvisioningProfile(profile_path) - app_id_pattern = profile_data.get("Entitlements", {}).get( - "application-identifier", "" - ) - for team_identifier in profile_data.get("TeamIdentifier", []): - app_id = f"{team_identifier}.{bundle_identifier}" - if fnmatch.fnmatch(app_id, app_id_pattern): - valid_provisioning_profiles[app_id_pattern] = ( - profile_path, - profile_data, - team_identifier, - ) - if not valid_provisioning_profiles: - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - # If the user has multiple provisioning profiles installed that can be - # used for ${bundle_identifier}, pick the most specific one (ie. the - # provisioning profile whose pattern is the longest). - selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) - return valid_provisioning_profiles[selected_key] - - def _LoadProvisioningProfile(self, profile_path): - """Extracts the plist embedded in a provisioning profile. - - Args: - profile_path: string, path to the .mobileprovision file - - Returns: - Content of the plist embedded in the provisioning profile as a dictionary. - """ - with tempfile.NamedTemporaryFile() as temp: - subprocess.check_call( - ["security", "cms", "-D", "-i", profile_path, "-o", temp.name] - ) - return self._LoadPlistMaybeBinary(temp.name) - - def _MergePlist(self, merged_plist, plist): - """Merge |plist| into |merged_plist|.""" - for key, value in plist.items(): - if isinstance(value, dict): - merged_value = merged_plist.get(key, {}) - if isinstance(merged_value, dict): - self._MergePlist(merged_value, value) - merged_plist[key] = merged_value - else: - merged_plist[key] = value - else: - merged_plist[key] = value - - def _LoadPlistMaybeBinary(self, plist_path): - """Loads into a memory a plist possibly encoded in binary format. - - This is a wrapper around plistlib.readPlist that tries to convert the - plist to the XML format if it can't be parsed (assuming that it is in - the binary format). - - Args: - plist_path: string, path to a plist file, in XML or binary format - - Returns: - Content of the plist as a dictionary. - """ - try: - # First, try to read the file using plistlib that only supports XML, - # and if an exception is raised, convert a temporary copy to XML and - # load that copy. - return plistlib.readPlist(plist_path) - except Exception: - pass - with tempfile.NamedTemporaryFile() as temp: - shutil.copy2(plist_path, temp.name) - subprocess.check_call(["plutil", "-convert", "xml1", temp.name]) - return plistlib.readPlist(temp.name) - - def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): - """Constructs a dictionary of variable substitutions for Entitlements.plist. - - Args: - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - app_identifier_prefix: string, value for AppIdentifierPrefix - - Returns: - Dictionary of substitutions to apply when generating Entitlements.plist. - """ - return { - "CFBundleIdentifier": bundle_identifier, - "AppIdentifierPrefix": app_identifier_prefix, - } - - def _GetCFBundleIdentifier(self): - """Extracts CFBundleIdentifier value from Info.plist in the bundle. - - Returns: - Value of CFBundleIdentifier in the Info.plist located in the bundle. - """ - info_plist_path = os.path.join( - os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"] - ) - info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) - return info_plist_data["CFBundleIdentifier"] - - def _InstallEntitlements(self, entitlements, substitutions, overrides): - """Generates and install the ${BundleName}.xcent entitlements file. - - Expands variables "$(variable)" pattern in the source entitlements file, - add extra entitlements defined in the .mobileprovision file and the copy - the generated plist to "${BundlePath}.xcent". - - Args: - entitlements: string, optional, path to the Entitlements.plist template - to use, defaults to "${SDKROOT}/Entitlements.plist" - substitutions: dictionary, variable substitutions - overrides: dictionary, values to add to the entitlements - - Returns: - Path to the generated entitlements file. - """ - source_path = entitlements - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent" - ) - if not source_path: - source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist") - shutil.copy2(source_path, target_path) - data = self._LoadPlistMaybeBinary(target_path) - data = self._ExpandVariables(data, substitutions) - if overrides: - for key in overrides: - if key not in data: - data[key] = overrides[key] - plistlib.writePlist(data, target_path) - return target_path - - def _ExpandVariables(self, data, substitutions): - """Expands variables "$(variable)" in data. - - Args: - data: object, can be either string, list or dictionary - substitutions: dictionary, variable substitutions to perform - - Returns: - Copy of data where each references to "$(variable)" has been replaced - by the corresponding value found in substitutions, or left intact if - the key was not found. - """ - if isinstance(data, str): - for key, value in substitutions.items(): - data = data.replace("$(%s)" % key, value) - return data - if isinstance(data, list): - return [self._ExpandVariables(v, substitutions) for v in data] - if isinstance(data, dict): - return {k: self._ExpandVariables(data[k], substitutions) for k in data} - return data - - -def NextGreaterPowerOf2(x): - return 2 ** (x).bit_length() - - -def WriteHmap(output_name, filelist): - """Generates a header map based on |filelist|. - - Per Mark Mentovai: - A header map is structured essentially as a hash table, keyed by names used - in #includes, and providing pathnames to the actual files. - - The implementation below and the comment above comes from inspecting: - http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt - while also looking at the implementation in clang in: - https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp - """ - magic = 1751998832 - version = 1 - _reserved = 0 - count = len(filelist) - capacity = NextGreaterPowerOf2(count) - strings_offset = 24 + (12 * capacity) - max_value_length = max(len(value) for value in filelist.values()) - - out = open(output_name, "wb") - out.write( - struct.pack( - " 0 or arg.count("/") > 1: - arg = os.path.normpath(arg) - - # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes - # preceding it, and results in n backslashes + the quote. So we substitute - # in 2* what we match, +1 more, plus the quote. - if quote_cmd: - arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg) - - # %'s also need to be doubled otherwise they're interpreted as batch - # positional arguments. Also make sure to escape the % so that they're - # passed literally through escaping so they can be singled to just the - # original %. Otherwise, trying to pass the literal representation that - # looks like an environment variable to the shell (e.g. %PATH%) would fail. - arg = arg.replace("%", "%%") - - # These commands are used in rsp files, so no escaping for the shell (via ^) - # is necessary. - - # As a workaround for programs that don't use CommandLineToArgvW, gyp - # supports msvs_quote_cmd=0, which simply disables all quoting. - if quote_cmd: - # Finally, wrap the whole thing in quotes so that the above quote rule - # applies and whitespace isn't a word break. - return f'"{arg}"' - - return arg - - -def EncodeRspFileList(args, quote_cmd): - """Process a list of arguments using QuoteCmdExeArgument.""" - # Note that the first argument is assumed to be the command. Don't add - # quotes around it because then built-ins like 'echo', etc. won't work. - # Take care to normpath only the path in the case of 'call ../x.bat' because - # otherwise the whole thing is incorrectly interpreted as a path and not - # normalized correctly. - if not args: - return "" - if args[0].startswith("call "): - call, program = args[0].split(" ", 1) - program = call + " " + os.path.normpath(program) - else: - program = os.path.normpath(args[0]) - return (program + " " - + " ".join(QuoteForRspFile(arg, quote_cmd) for arg in args[1:])) - - -def _GenericRetrieve(root, default, path): - """Given a list of dictionary keys |path| and a tree of dicts |root|, find - value at path, or return |default| if any of the path doesn't exist.""" - if not root: - return default - if not path: - return root - return _GenericRetrieve(root.get(path[0]), default, path[1:]) - - -def _AddPrefix(element, prefix): - """Add |prefix| to |element| or each subelement if element is iterable.""" - if element is None: - return element - # Note, not Iterable because we don't want to handle strings like that. - if isinstance(element, list) or isinstance(element, tuple): - return [prefix + e for e in element] - else: - return prefix + element - - -def _DoRemapping(element, map): - """If |element| then remap it through |map|. If |element| is iterable then - each item will be remapped. Any elements not found will be removed.""" - if map is not None and element is not None: - if not callable(map): - map = map.get # Assume it's a dict, otherwise a callable to do the remap. - if isinstance(element, list) or isinstance(element, tuple): - element = filter(None, [map(elem) for elem in element]) - else: - element = map(element) - return element - - -def _AppendOrReturn(append, element): - """If |append| is None, simply return |element|. If |append| is not None, - then add |element| to it, adding each item in |element| if it's a list or - tuple.""" - if append is not None and element is not None: - if isinstance(element, list) or isinstance(element, tuple): - append.extend(element) - else: - append.append(element) - else: - return element - - -def _FindDirectXInstallation(): - """Try to find an installation location for the DirectX SDK. Check for the - standard environment variable, and if that doesn't exist, try to find - via the registry. May return None if not found in either location.""" - # Return previously calculated value, if there is one - if hasattr(_FindDirectXInstallation, "dxsdk_dir"): - return _FindDirectXInstallation.dxsdk_dir - - dxsdk_dir = os.environ.get("DXSDK_DIR") - if not dxsdk_dir: - # Setup params to pass to and attempt to launch reg.exe. - cmd = ["reg.exe", "query", r"HKLM\Software\Microsoft\DirectX", "/s"] - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout = p.communicate()[0].decode("utf-8") - for line in stdout.splitlines(): - if "InstallPath" in line: - dxsdk_dir = line.split(" ")[3] + "\\" - - # Cache return value - _FindDirectXInstallation.dxsdk_dir = dxsdk_dir - return dxsdk_dir - - -def GetGlobalVSMacroEnv(vs_version): - """Get a dict of variables mapping internal VS macro names to their gyp - equivalents. Returns all variables that are independent of the target.""" - env = {} - # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when - # Visual Studio is actually installed. - if vs_version.Path(): - env["$(VSInstallDir)"] = vs_version.Path() - env["$(VCInstallDir)"] = os.path.join(vs_version.Path(), "VC") + "\\" - # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be - # set. This happens when the SDK is sync'd via src-internal, rather than - # by typical end-user installation of the SDK. If it's not set, we don't - # want to leave the unexpanded variable in the path, so simply strip it. - dxsdk_dir = _FindDirectXInstallation() - env["$(DXSDK_DIR)"] = dxsdk_dir if dxsdk_dir else "" - # Try to find an installation location for the Windows DDK by checking - # the WDK_DIR environment variable, may be None. - env["$(WDK_DIR)"] = os.environ.get("WDK_DIR", "") - return env - - -def ExtractSharedMSVSSystemIncludes(configs, generator_flags): - """Finds msvs_system_include_dirs that are common to all targets, removes - them from all targets, and returns an OrderedSet containing them.""" - all_system_includes = OrderedSet(configs[0].get("msvs_system_include_dirs", [])) - for config in configs[1:]: - system_includes = config.get("msvs_system_include_dirs", []) - all_system_includes = all_system_includes & OrderedSet(system_includes) - if not all_system_includes: - return None - # Expand macros in all_system_includes. - env = GetGlobalVSMacroEnv(GetVSVersion(generator_flags)) - expanded_system_includes = OrderedSet( - [ExpandMacros(include, env) for include in all_system_includes] - ) - if any(["$" in include for include in expanded_system_includes]): - # Some path relies on target-specific variables, bail. - return None - - # Remove system includes shared by all targets from the targets. - for config in configs: - includes = config.get("msvs_system_include_dirs", []) - if includes: # Don't insert a msvs_system_include_dirs key if not needed. - # This must check the unexpanded includes list: - new_includes = [i for i in includes if i not in all_system_includes] - config["msvs_system_include_dirs"] = new_includes - return expanded_system_includes - - -class MsvsSettings: - """A class that understands the gyp 'msvs_...' values (especially the - msvs_settings field). They largely correpond to the VS2008 IDE DOM. This - class helps map those settings to command line options.""" - - def __init__(self, spec, generator_flags): - self.spec = spec - self.vs_version = GetVSVersion(generator_flags) - - supported_fields = [ - ("msvs_configuration_attributes", dict), - ("msvs_settings", dict), - ("msvs_system_include_dirs", list), - ("msvs_disabled_warnings", list), - ("msvs_precompiled_header", str), - ("msvs_precompiled_source", str), - ("msvs_configuration_platform", str), - ("msvs_target_platform", str), - ] - configs = spec["configurations"] - for field, default in supported_fields: - setattr(self, field, {}) - for configname, config in configs.items(): - getattr(self, field)[configname] = config.get(field, default()) - - self.msvs_cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."]) - - unsupported_fields = [ - "msvs_prebuild", - "msvs_postbuild", - ] - unsupported = [] - for field in unsupported_fields: - for config in configs.values(): - if field in config: - unsupported += [ - "{} not supported (target {}).".format( - field, spec["target_name"] - ) - ] - if unsupported: - raise Exception("\n".join(unsupported)) - - def GetExtension(self): - """Returns the extension for the target, with no leading dot. - - Uses 'product_extension' if specified, otherwise uses MSVS defaults based on - the target type. - """ - ext = self.spec.get("product_extension", None) - if ext: - return ext - return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec["type"], "") - - def GetVSMacroEnv(self, base_to_build=None, config=None): - """Get a dict of variables mapping internal VS macro names to their gyp - equivalents.""" - target_arch = self.GetArch(config) - if target_arch == "x86": - target_platform = "Win32" - else: - target_platform = target_arch - target_name = self.spec.get("product_prefix", "") + self.spec.get( - "product_name", self.spec["target_name"] - ) - target_dir = base_to_build + "\\" if base_to_build else "" - target_ext = "." + self.GetExtension() - target_file_name = target_name + target_ext - - replacements = { - "$(InputName)": "${root}", - "$(InputPath)": "${source}", - "$(IntDir)": "$!INTERMEDIATE_DIR", - "$(OutDir)\\": target_dir, - "$(PlatformName)": target_platform, - "$(ProjectDir)\\": "", - "$(ProjectName)": self.spec["target_name"], - "$(TargetDir)\\": target_dir, - "$(TargetExt)": target_ext, - "$(TargetFileName)": target_file_name, - "$(TargetName)": target_name, - "$(TargetPath)": os.path.join(target_dir, target_file_name), - } - replacements.update(GetGlobalVSMacroEnv(self.vs_version)) - return replacements - - def ConvertVSMacros(self, s, base_to_build=None, config=None): - """Convert from VS macro names to something equivalent.""" - env = self.GetVSMacroEnv(base_to_build, config=config) - return ExpandMacros(s, env) - - def AdjustLibraries(self, libraries): - """Strip -l from library if it's specified with that.""" - libs = [lib[2:] if lib.startswith("-l") else lib for lib in libraries] - return [ - lib + ".lib" - if not lib.lower().endswith(".lib") and not lib.lower().endswith(".obj") - else lib - for lib in libs - ] - - def _GetAndMunge(self, field, path, default, prefix, append, map): - """Retrieve a value from |field| at |path| or return |default|. If - |append| is specified, and the item is found, it will be appended to that - object instead of returned. If |map| is specified, results will be - remapped through |map| before being returned or appended.""" - result = _GenericRetrieve(field, default, path) - result = _DoRemapping(result, map) - result = _AddPrefix(result, prefix) - return _AppendOrReturn(append, result) - - class _GetWrapper: - def __init__(self, parent, field, base_path, append=None): - self.parent = parent - self.field = field - self.base_path = [base_path] - self.append = append - - def __call__(self, name, map=None, prefix="", default=None): - return self.parent._GetAndMunge( - self.field, - self.base_path + [name], - default=default, - prefix=prefix, - append=self.append, - map=map, - ) - - def GetArch(self, config): - """Get architecture based on msvs_configuration_platform and - msvs_target_platform. Returns either 'x86' or 'x64'.""" - configuration_platform = self.msvs_configuration_platform.get(config, "") - platform = self.msvs_target_platform.get(config, "") - if not platform: # If no specific override, use the configuration's. - platform = configuration_platform - # Map from platform to architecture. - return {"Win32": "x86", "x64": "x64", "ARM64": "arm64"}.get(platform, "x86") - - def _TargetConfig(self, config): - """Returns the target-specific configuration.""" - # There's two levels of architecture/platform specification in VS. The - # first level is globally for the configuration (this is what we consider - # "the" config at the gyp level, which will be something like 'Debug' or - # 'Release'), VS2015 and later only use this level - if int(self.vs_version.short_name) >= 2015: - return config - # and a second target-specific configuration, which is an - # override for the global one. |config| is remapped here to take into - # account the local target-specific overrides to the global configuration. - arch = self.GetArch(config) - if arch == "x64" and not config.endswith("_x64"): - config += "_x64" - if arch == "x86" and config.endswith("_x64"): - config = config.rsplit("_", 1)[0] - return config - - def _Setting(self, path, config, default=None, prefix="", append=None, map=None): - """_GetAndMunge for msvs_settings.""" - return self._GetAndMunge( - self.msvs_settings[config], path, default, prefix, append, map - ) - - def _ConfigAttrib( - self, path, config, default=None, prefix="", append=None, map=None - ): - """_GetAndMunge for msvs_configuration_attributes.""" - return self._GetAndMunge( - self.msvs_configuration_attributes[config], - path, - default, - prefix, - append, - map, - ) - - def AdjustIncludeDirs(self, include_dirs, config): - """Updates include_dirs to expand VS specific paths, and adds the system - include dirs used for platform SDK and similar.""" - config = self._TargetConfig(config) - includes = include_dirs + self.msvs_system_include_dirs[config] - includes.extend( - self._Setting( - ("VCCLCompilerTool", "AdditionalIncludeDirectories"), config, default=[] - ) - ) - return [self.ConvertVSMacros(p, config=config) for p in includes] - - def AdjustMidlIncludeDirs(self, midl_include_dirs, config): - """Updates midl_include_dirs to expand VS specific paths, and adds the - system include dirs used for platform SDK and similar.""" - config = self._TargetConfig(config) - includes = midl_include_dirs + self.msvs_system_include_dirs[config] - includes.extend( - self._Setting( - ("VCMIDLTool", "AdditionalIncludeDirectories"), config, default=[] - ) - ) - return [self.ConvertVSMacros(p, config=config) for p in includes] - - def GetComputedDefines(self, config): - """Returns the set of defines that are injected to the defines list based - on other VS settings.""" - config = self._TargetConfig(config) - defines = [] - if self._ConfigAttrib(["CharacterSet"], config) == "1": - defines.extend(("_UNICODE", "UNICODE")) - if self._ConfigAttrib(["CharacterSet"], config) == "2": - defines.append("_MBCS") - defines.extend( - self._Setting( - ("VCCLCompilerTool", "PreprocessorDefinitions"), config, default=[] - ) - ) - return defines - - def GetCompilerPdbName(self, config, expand_special): - """Get the pdb file name that should be used for compiler invocations, or - None if there's no explicit name specified.""" - config = self._TargetConfig(config) - pdbname = self._Setting(("VCCLCompilerTool", "ProgramDataBaseFileName"), config) - if pdbname: - pdbname = expand_special(self.ConvertVSMacros(pdbname)) - return pdbname - - def GetMapFileName(self, config, expand_special): - """Gets the explicitly overridden map file name for a target or returns None - if it's not set.""" - config = self._TargetConfig(config) - map_file = self._Setting(("VCLinkerTool", "MapFileName"), config) - if map_file: - map_file = expand_special(self.ConvertVSMacros(map_file, config=config)) - return map_file - - def GetOutputName(self, config, expand_special): - """Gets the explicitly overridden output name for a target or returns None - if it's not overridden.""" - config = self._TargetConfig(config) - type = self.spec["type"] - root = "VCLibrarianTool" if type == "static_library" else "VCLinkerTool" - # TODO(scottmg): Handle OutputDirectory without OutputFile. - output_file = self._Setting((root, "OutputFile"), config) - if output_file: - output_file = expand_special( - self.ConvertVSMacros(output_file, config=config) - ) - return output_file - - def GetPDBName(self, config, expand_special, default): - """Gets the explicitly overridden pdb name for a target or returns - default if it's not overridden, or if no pdb will be generated.""" - config = self._TargetConfig(config) - output_file = self._Setting(("VCLinkerTool", "ProgramDatabaseFile"), config) - generate_debug_info = self._Setting( - ("VCLinkerTool", "GenerateDebugInformation"), config - ) - if generate_debug_info == "true": - if output_file: - return expand_special(self.ConvertVSMacros(output_file, config=config)) - else: - return default - else: - return None - - def GetNoImportLibrary(self, config): - """If NoImportLibrary: true, ninja will not expect the output to include - an import library.""" - config = self._TargetConfig(config) - noimplib = self._Setting(("NoImportLibrary",), config) - return noimplib == "true" - - def GetAsmflags(self, config): - """Returns the flags that need to be added to ml invocations.""" - config = self._TargetConfig(config) - asmflags = [] - safeseh = self._Setting(("MASM", "UseSafeExceptionHandlers"), config) - if safeseh == "true": - asmflags.append("/safeseh") - return asmflags - - def GetCflags(self, config): - """Returns the flags that need to be added to .c and .cc compilations.""" - config = self._TargetConfig(config) - cflags = [] - cflags.extend(["/wd" + w for w in self.msvs_disabled_warnings[config]]) - cl = self._GetWrapper( - self, self.msvs_settings[config], "VCCLCompilerTool", append=cflags - ) - cl( - "Optimization", - map={"0": "d", "1": "1", "2": "2", "3": "x"}, - prefix="/O", - default="2", - ) - cl("InlineFunctionExpansion", prefix="/Ob") - cl("DisableSpecificWarnings", prefix="/wd") - cl("StringPooling", map={"true": "/GF"}) - cl("EnableFiberSafeOptimizations", map={"true": "/GT"}) - cl("OmitFramePointers", map={"false": "-", "true": ""}, prefix="/Oy") - cl("EnableIntrinsicFunctions", map={"false": "-", "true": ""}, prefix="/Oi") - cl("FavorSizeOrSpeed", map={"1": "t", "2": "s"}, prefix="/O") - cl( - "FloatingPointModel", - map={"0": "precise", "1": "strict", "2": "fast"}, - prefix="/fp:", - default="0", - ) - cl("CompileAsManaged", map={"false": "", "true": "/clr"}) - cl("WholeProgramOptimization", map={"true": "/GL"}) - cl("WarningLevel", prefix="/W") - cl("WarnAsError", map={"true": "/WX"}) - cl( - "CallingConvention", - map={"0": "d", "1": "r", "2": "z", "3": "v"}, - prefix="/G", - ) - cl("DebugInformationFormat", map={"1": "7", "3": "i", "4": "I"}, prefix="/Z") - cl("RuntimeTypeInfo", map={"true": "/GR", "false": "/GR-"}) - cl("EnableFunctionLevelLinking", map={"true": "/Gy", "false": "/Gy-"}) - cl("MinimalRebuild", map={"true": "/Gm"}) - cl("BufferSecurityCheck", map={"true": "/GS", "false": "/GS-"}) - cl("BasicRuntimeChecks", map={"1": "s", "2": "u", "3": "1"}, prefix="/RTC") - cl( - "RuntimeLibrary", - map={"0": "T", "1": "Td", "2": "D", "3": "Dd"}, - prefix="/M", - ) - cl("ExceptionHandling", map={"1": "sc", "2": "a"}, prefix="/EH") - cl("DefaultCharIsUnsigned", map={"true": "/J"}) - cl( - "TreatWChar_tAsBuiltInType", - map={"false": "-", "true": ""}, - prefix="/Zc:wchar_t", - ) - cl("EnablePREfast", map={"true": "/analyze"}) - cl("AdditionalOptions", prefix="") - cl( - "EnableEnhancedInstructionSet", - map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2"}, - prefix="/arch:", - ) - cflags.extend( - [ - "/FI" + f - for f in self._Setting( - ("VCCLCompilerTool", "ForcedIncludeFiles"), config, default=[] - ) - ] - ) - if float(self.vs_version.project_version) >= 12.0: - # New flag introduced in VS2013 (project version 12.0) Forces writes to - # the program database (PDB) to be serialized through MSPDBSRV.EXE. - # https://msdn.microsoft.com/en-us/library/dn502518.aspx - cflags.append("/FS") - # ninja handles parallelism by itself, don't have the compiler do it too. - cflags = [x for x in cflags if not x.startswith("/MP")] - return cflags - - def _GetPchFlags(self, config, extension): - """Get the flags to be added to the cflags for precompiled header support.""" - config = self._TargetConfig(config) - # The PCH is only built once by a particular source file. Usage of PCH must - # only be for the same language (i.e. C vs. C++), so only include the pch - # flags when the language matches. - if self.msvs_precompiled_header[config]: - source_ext = os.path.splitext(self.msvs_precompiled_source[config])[1] - if _LanguageMatchesForPch(source_ext, extension): - pch = self.msvs_precompiled_header[config] - pchbase = os.path.split(pch)[1] - return ["/Yu" + pch, "/FI" + pch, "/Fp${pchprefix}." + pchbase + ".pch"] - return [] - - def GetCflagsC(self, config): - """Returns the flags that need to be added to .c compilations.""" - config = self._TargetConfig(config) - return self._GetPchFlags(config, ".c") - - def GetCflagsCC(self, config): - """Returns the flags that need to be added to .cc compilations.""" - config = self._TargetConfig(config) - return ["/TP"] + self._GetPchFlags(config, ".cc") - - def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path): - """Get and normalize the list of paths in AdditionalLibraryDirectories - setting.""" - config = self._TargetConfig(config) - libpaths = self._Setting( - (root, "AdditionalLibraryDirectories"), config, default=[] - ) - libpaths = [ - os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(p, config=config))) - for p in libpaths - ] - return ['/LIBPATH:"' + p + '"' for p in libpaths] - - def GetLibFlags(self, config, gyp_to_build_path): - """Returns the flags that need to be added to lib commands.""" - config = self._TargetConfig(config) - libflags = [] - lib = self._GetWrapper( - self, self.msvs_settings[config], "VCLibrarianTool", append=libflags - ) - libflags.extend( - self._GetAdditionalLibraryDirectories( - "VCLibrarianTool", config, gyp_to_build_path - ) - ) - lib("LinkTimeCodeGeneration", map={"true": "/LTCG"}) - lib( - "TargetMachine", - map={"1": "X86", "17": "X64", "3": "ARM"}, - prefix="/MACHINE:", - ) - lib("AdditionalOptions") - return libflags - - def GetDefFile(self, gyp_to_build_path): - """Returns the .def file from sources, if any. Otherwise returns None.""" - spec = self.spec - if spec["type"] in ("shared_library", "loadable_module", "executable"): - def_files = [ - s for s in spec.get("sources", []) if s.lower().endswith(".def") - ] - if len(def_files) == 1: - return gyp_to_build_path(def_files[0]) - elif len(def_files) > 1: - raise Exception("Multiple .def files") - return None - - def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path): - """.def files get implicitly converted to a ModuleDefinitionFile for the - linker in the VS generator. Emulate that behaviour here.""" - def_file = self.GetDefFile(gyp_to_build_path) - if def_file: - ldflags.append('/DEF:"%s"' % def_file) - - def GetPGDName(self, config, expand_special): - """Gets the explicitly overridden pgd name for a target or returns None - if it's not overridden.""" - config = self._TargetConfig(config) - output_file = self._Setting(("VCLinkerTool", "ProfileGuidedDatabase"), config) - if output_file: - output_file = expand_special( - self.ConvertVSMacros(output_file, config=config) - ) - return output_file - - def GetLdflags( - self, - config, - gyp_to_build_path, - expand_special, - manifest_base_name, - output_name, - is_executable, - build_dir, - ): - """Returns the flags that need to be added to link commands, and the - manifest files.""" - config = self._TargetConfig(config) - ldflags = [] - ld = self._GetWrapper( - self, self.msvs_settings[config], "VCLinkerTool", append=ldflags - ) - self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) - ld("GenerateDebugInformation", map={"true": "/DEBUG"}) - # TODO: These 'map' values come from machineTypeOption enum, - # and does not have an official value for ARM64 in VS2017 (yet). - # It needs to verify the ARM64 value when machineTypeOption is updated. - ld( - "TargetMachine", - map={"1": "X86", "17": "X64", "3": "ARM", "18": "ARM64"}, - prefix="/MACHINE:", - ) - ldflags.extend( - self._GetAdditionalLibraryDirectories( - "VCLinkerTool", config, gyp_to_build_path - ) - ) - ld("DelayLoadDLLs", prefix="/DELAYLOAD:") - ld("TreatLinkerWarningAsErrors", prefix="/WX", map={"true": "", "false": ":NO"}) - out = self.GetOutputName(config, expand_special) - if out: - ldflags.append("/OUT:" + out) - pdb = self.GetPDBName(config, expand_special, output_name + ".pdb") - if pdb: - ldflags.append("/PDB:" + pdb) - pgd = self.GetPGDName(config, expand_special) - if pgd: - ldflags.append("/PGD:" + pgd) - map_file = self.GetMapFileName(config, expand_special) - ld("GenerateMapFile", map={"true": "/MAP:" + map_file if map_file else "/MAP"}) - ld("MapExports", map={"true": "/MAPINFO:EXPORTS"}) - ld("AdditionalOptions", prefix="") - - minimum_required_version = self._Setting( - ("VCLinkerTool", "MinimumRequiredVersion"), config, default="" - ) - if minimum_required_version: - minimum_required_version = "," + minimum_required_version - ld( - "SubSystem", - map={ - "1": "CONSOLE%s" % minimum_required_version, - "2": "WINDOWS%s" % minimum_required_version, - }, - prefix="/SUBSYSTEM:", - ) - - stack_reserve_size = self._Setting( - ("VCLinkerTool", "StackReserveSize"), config, default="" - ) - if stack_reserve_size: - stack_commit_size = self._Setting( - ("VCLinkerTool", "StackCommitSize"), config, default="" - ) - if stack_commit_size: - stack_commit_size = "," + stack_commit_size - ldflags.append(f"/STACK:{stack_reserve_size}{stack_commit_size}") - - ld("TerminalServerAware", map={"1": ":NO", "2": ""}, prefix="/TSAWARE") - ld("LinkIncremental", map={"1": ":NO", "2": ""}, prefix="/INCREMENTAL") - ld("BaseAddress", prefix="/BASE:") - ld("FixedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/FIXED") - ld("RandomizedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/DYNAMICBASE") - ld("DataExecutionPrevention", map={"1": ":NO", "2": ""}, prefix="/NXCOMPAT") - ld("OptimizeReferences", map={"1": "NOREF", "2": "REF"}, prefix="/OPT:") - ld("ForceSymbolReferences", prefix="/INCLUDE:") - ld("EnableCOMDATFolding", map={"1": "NOICF", "2": "ICF"}, prefix="/OPT:") - ld( - "LinkTimeCodeGeneration", - map={"1": "", "2": ":PGINSTRUMENT", "3": ":PGOPTIMIZE", "4": ":PGUPDATE"}, - prefix="/LTCG", - ) - ld("IgnoreDefaultLibraryNames", prefix="/NODEFAULTLIB:") - ld("ResourceOnlyDLL", map={"true": "/NOENTRY"}) - ld("EntryPointSymbol", prefix="/ENTRY:") - ld("Profile", map={"true": "/PROFILE"}) - ld("LargeAddressAware", map={"1": ":NO", "2": ""}, prefix="/LARGEADDRESSAWARE") - # TODO(scottmg): This should sort of be somewhere else (not really a flag). - ld("AdditionalDependencies", prefix="") - - if self.GetArch(config) == "x86": - safeseh_default = "true" - else: - safeseh_default = None - ld( - "ImageHasSafeExceptionHandlers", - map={"false": ":NO", "true": ""}, - prefix="/SAFESEH", - default=safeseh_default, - ) - - # If the base address is not specifically controlled, DYNAMICBASE should - # be on by default. - if not any("DYNAMICBASE" in flag or flag == "/FIXED" for flag in ldflags): - ldflags.append("/DYNAMICBASE") - - # If the NXCOMPAT flag has not been specified, default to on. Despite the - # documentation that says this only defaults to on when the subsystem is - # Vista or greater (which applies to the linker), the IDE defaults it on - # unless it's explicitly off. - if not any("NXCOMPAT" in flag for flag in ldflags): - ldflags.append("/NXCOMPAT") - - have_def_file = any(flag.startswith("/DEF:") for flag in ldflags) - ( - manifest_flags, - intermediate_manifest, - manifest_files, - ) = self._GetLdManifestFlags( - config, - manifest_base_name, - gyp_to_build_path, - is_executable and not have_def_file, - build_dir, - ) - ldflags.extend(manifest_flags) - return ldflags, intermediate_manifest, manifest_files - - def _GetLdManifestFlags( - self, config, name, gyp_to_build_path, allow_isolation, build_dir - ): - """Returns a 3-tuple: - - the set of flags that need to be added to the link to generate - a default manifest - - the intermediate manifest that the linker will generate that should be - used to assert it doesn't add anything to the merged one. - - the list of all the manifest files to be merged by the manifest tool and - included into the link.""" - generate_manifest = self._Setting( - ("VCLinkerTool", "GenerateManifest"), config, default="true" - ) - if generate_manifest != "true": - # This means not only that the linker should not generate the intermediate - # manifest but also that the manifest tool should do nothing even when - # additional manifests are specified. - return ["/MANIFEST:NO"], [], [] - - output_name = name + ".intermediate.manifest" - flags = [ - "/MANIFEST", - "/ManifestFile:" + output_name, - ] - - # Instead of using the MANIFESTUAC flags, we generate a .manifest to - # include into the list of manifests. This allows us to avoid the need to - # do two passes during linking. The /MANIFEST flag and /ManifestFile are - # still used, and the intermediate manifest is used to assert that the - # final manifest we get from merging all the additional manifest files - # (plus the one we generate here) isn't modified by merging the - # intermediate into it. - - # Always NO, because we generate a manifest file that has what we want. - flags.append("/MANIFESTUAC:NO") - - config = self._TargetConfig(config) - enable_uac = self._Setting( - ("VCLinkerTool", "EnableUAC"), config, default="true" - ) - manifest_files = [] - generated_manifest_outer = ( - "" - "" - "%s" - ) - if enable_uac == "true": - execution_level = self._Setting( - ("VCLinkerTool", "UACExecutionLevel"), config, default="0" - ) - execution_level_map = { - "0": "asInvoker", - "1": "highestAvailable", - "2": "requireAdministrator", - } - - ui_access = self._Setting( - ("VCLinkerTool", "UACUIAccess"), config, default="false" - ) - - inner = """ - - - - - - -""".format( - execution_level_map[execution_level], - ui_access, - ) - else: - inner = "" - - generated_manifest_contents = generated_manifest_outer % inner - generated_name = name + ".generated.manifest" - # Need to join with the build_dir here as we're writing it during - # generation time, but we return the un-joined version because the build - # will occur in that directory. We only write the file if the contents - # have changed so that simply regenerating the project files doesn't - # cause a relink. - build_dir_generated_name = os.path.join(build_dir, generated_name) - gyp.common.EnsureDirExists(build_dir_generated_name) - f = gyp.common.WriteOnDiff(build_dir_generated_name) - f.write(generated_manifest_contents) - f.close() - manifest_files = [generated_name] - - if allow_isolation: - flags.append("/ALLOWISOLATION") - - manifest_files += self._GetAdditionalManifestFiles(config, gyp_to_build_path) - return flags, output_name, manifest_files - - def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): - """Gets additional manifest files that are added to the default one - generated by the linker.""" - files = self._Setting( - ("VCManifestTool", "AdditionalManifestFiles"), config, default=[] - ) - if isinstance(files, str): - files = files.split(";") - return [ - os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(f, config=config))) - for f in files - ] - - def IsUseLibraryDependencyInputs(self, config): - """Returns whether the target should be linked via Use Library Dependency - Inputs (using component .objs of a given .lib).""" - config = self._TargetConfig(config) - uldi = self._Setting(("VCLinkerTool", "UseLibraryDependencyInputs"), config) - return uldi == "true" - - def IsEmbedManifest(self, config): - """Returns whether manifest should be linked into binary.""" - config = self._TargetConfig(config) - embed = self._Setting( - ("VCManifestTool", "EmbedManifest"), config, default="true" - ) - return embed == "true" - - def IsLinkIncremental(self, config): - """Returns whether the target should be linked incrementally.""" - config = self._TargetConfig(config) - link_inc = self._Setting(("VCLinkerTool", "LinkIncremental"), config) - return link_inc != "1" - - def GetRcflags(self, config, gyp_to_ninja_path): - """Returns the flags that need to be added to invocations of the resource - compiler.""" - config = self._TargetConfig(config) - rcflags = [] - rc = self._GetWrapper( - self, self.msvs_settings[config], "VCResourceCompilerTool", append=rcflags - ) - rc("AdditionalIncludeDirectories", map=gyp_to_ninja_path, prefix="/I") - rcflags.append("/I" + gyp_to_ninja_path(".")) - rc("PreprocessorDefinitions", prefix="/d") - # /l arg must be in hex without leading '0x' - rc("Culture", prefix="/l", map=lambda x: hex(int(x))[2:]) - return rcflags - - def BuildCygwinBashCommandLine(self, args, path_to_base): - """Build a command line that runs args via cygwin bash. We assume that all - incoming paths are in Windows normpath'd form, so they need to be - converted to posix style for the part of the command line that's passed to - bash. We also have to do some Visual Studio macro emulation here because - various rules use magic VS names for things. Also note that rules that - contain ninja variables cannot be fixed here (for example ${source}), so - the outer generator needs to make sure that the paths that are written out - are in posix style, if the command line will be used here.""" - cygwin_dir = os.path.normpath( - os.path.join(path_to_base, self.msvs_cygwin_dirs[0]) - ) - cd = ("cd %s" % path_to_base).replace("\\", "/") - args = [a.replace("\\", "/").replace('"', '\\"') for a in args] - args = ["'%s'" % a.replace("'", "'\\''") for a in args] - bash_cmd = " ".join(args) - cmd = ( - 'call "%s\\setup_env.bat" && set CYGWIN=nontsec && ' % cygwin_dir - + f'bash -c "{cd} ; {bash_cmd}"' - ) - return cmd - - RuleShellFlags = collections.namedtuple("RuleShellFlags", ["cygwin", "quote"]) - - def GetRuleShellFlags(self, rule): - """Return RuleShellFlags about how the given rule should be run. This - includes whether it should run under cygwin (msvs_cygwin_shell), and - whether the commands should be quoted (msvs_quote_cmd).""" - # If the variable is unset, or set to 1 we use cygwin - cygwin = int(rule.get("msvs_cygwin_shell", - self.spec.get("msvs_cygwin_shell", 1))) != 0 - # Default to quoting. There's only a few special instances where the - # target command uses non-standard command line parsing and handle quotes - # and quote escaping differently. - quote_cmd = int(rule.get("msvs_quote_cmd", 1)) - assert quote_cmd != 0 or cygwin != 1, \ - "msvs_quote_cmd=0 only applicable for msvs_cygwin_shell=0" - return MsvsSettings.RuleShellFlags(cygwin, quote_cmd) - - def _HasExplicitRuleForExtension(self, spec, extension): - """Determine if there's an explicit rule for a particular extension.""" - for rule in spec.get("rules", []): - if rule["extension"] == extension: - return True - return False - - def _HasExplicitIdlActions(self, spec): - """Determine if an action should not run midl for .idl files.""" - return any( - [action.get("explicit_idl_action", 0) for action in spec.get("actions", [])] - ) - - def HasExplicitIdlRulesOrActions(self, spec): - """Determine if there's an explicit rule or action for idl files. When - there isn't we need to generate implicit rules to build MIDL .idl files.""" - return self._HasExplicitRuleForExtension( - spec, "idl" - ) or self._HasExplicitIdlActions(spec) - - def HasExplicitAsmRules(self, spec): - """Determine if there's an explicit rule for asm files. When there isn't we - need to generate implicit rules to assemble .asm files.""" - return self._HasExplicitRuleForExtension(spec, "asm") - - def GetIdlBuildData(self, source, config): - """Determine the implicit outputs for an idl file. Returns output - directory, outputs, and variables and flags that are required.""" - config = self._TargetConfig(config) - midl_get = self._GetWrapper(self, self.msvs_settings[config], "VCMIDLTool") - - def midl(name, default=None): - return self.ConvertVSMacros(midl_get(name, default=default), config=config) - - tlb = midl("TypeLibraryName", default="${root}.tlb") - header = midl("HeaderFileName", default="${root}.h") - dlldata = midl("DLLDataFileName", default="dlldata.c") - iid = midl("InterfaceIdentifierFileName", default="${root}_i.c") - proxy = midl("ProxyFileName", default="${root}_p.c") - # Note that .tlb is not included in the outputs as it is not always - # generated depending on the content of the input idl file. - outdir = midl("OutputDirectory", default="") - output = [header, dlldata, iid, proxy] - variables = [ - ("tlb", tlb), - ("h", header), - ("dlldata", dlldata), - ("iid", iid), - ("proxy", proxy), - ] - # TODO(scottmg): Are there configuration settings to set these flags? - target_platform = self.GetArch(config) - if target_platform == "x86": - target_platform = "win32" - flags = ["/char", "signed", "/env", target_platform, "/Oicf"] - return outdir, output, variables, flags - - -def _LanguageMatchesForPch(source_ext, pch_source_ext): - c_exts = (".c",) - cc_exts = (".cc", ".cxx", ".cpp") - return (source_ext in c_exts and pch_source_ext in c_exts) or ( - source_ext in cc_exts and pch_source_ext in cc_exts - ) - - -class PrecompiledHeader: - """Helper to generate dependencies and build rules to handle generation of - precompiled headers. Interface matches the GCH handler in xcode_emulation.py. - """ - - def __init__( - self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext - ): - self.settings = settings - self.config = config - pch_source = self.settings.msvs_precompiled_source[self.config] - self.pch_source = gyp_to_build_path(pch_source) - filename, _ = os.path.splitext(pch_source) - self.output_obj = gyp_to_unique_output(filename + obj_ext).lower() - - def _PchHeader(self): - """Get the header that will appear in an #include line for all source - files.""" - return self.settings.msvs_precompiled_header[self.config] - - def GetObjDependencies(self, sources, objs, arch): - """Given a list of sources files and the corresponding object files, - returns a list of the pch files that should be depended upon. The - additional wrapping in the return value is for interface compatibility - with make.py on Mac, and xcode_emulation.py.""" - assert arch is None - if not self._PchHeader(): - return [] - pch_ext = os.path.splitext(self.pch_source)[1] - for source in sources: - if _LanguageMatchesForPch(os.path.splitext(source)[1], pch_ext): - return [(None, None, self.output_obj)] - return [] - - def GetPchBuildCommands(self, arch): - """Not used on Windows as there are no additional build steps required - (instead, existing steps are modified in GetFlagsModifications below).""" - return [] - - def GetFlagsModifications( - self, input, output, implicit, command, cflags_c, cflags_cc, expand_special - ): - """Get the modified cflags and implicit dependencies that should be used - for the pch compilation step.""" - if input == self.pch_source: - pch_output = ["/Yc" + self._PchHeader()] - if command == "cxx": - return ( - [("cflags_cc", map(expand_special, cflags_cc + pch_output))], - self.output_obj, - [], - ) - elif command == "cc": - return ( - [("cflags_c", map(expand_special, cflags_c + pch_output))], - self.output_obj, - [], - ) - return [], output, implicit - - -vs_version = None - - -def GetVSVersion(generator_flags): - global vs_version - if not vs_version: - vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( - generator_flags.get("msvs_version", "auto"), allow_fallback=False - ) - return vs_version - - -def _GetVsvarsSetupArgs(generator_flags, arch): - vs = GetVSVersion(generator_flags) - return vs.SetupScript() - - -def ExpandMacros(string, expansions): - """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv - for the canonical way to retrieve a suitable dict.""" - if "$" in string: - for old, new in expansions.items(): - assert "$(" not in new, new - string = string.replace(old, new) - return string - - -def _ExtractImportantEnvironment(output_of_set): - """Extracts environment variables required for the toolchain to run from - a textual dump output by the cmd.exe 'set' command.""" - envvars_to_save = ( - "goma_.*", # TODO(scottmg): This is ugly, but needed for goma. - "include", - "lib", - "libpath", - "path", - "pathext", - "systemroot", - "temp", - "tmp", - ) - env = {} - # This occasionally happens and leads to misleading SYSTEMROOT error messages - # if not caught here. - if output_of_set.count("=") == 0: - raise Exception("Invalid output_of_set. Value is:\n%s" % output_of_set) - for line in output_of_set.splitlines(): - for envvar in envvars_to_save: - if re.match(envvar + "=", line.lower()): - var, setting = line.split("=", 1) - if envvar == "path": - # Our own rules (for running gyp-win-tool) and other actions in - # Chromium rely on python being in the path. Add the path to this - # python here so that if it's not in the path when ninja is run - # later, python will still be found. - setting = os.path.dirname(sys.executable) + os.pathsep + setting - env[var.upper()] = setting - break - for required in ("SYSTEMROOT", "TEMP", "TMP"): - if required not in env: - raise Exception( - 'Environment variable "%s" ' - "required to be set to valid path" % required - ) - return env - - -def _FormatAsEnvironmentBlock(envvar_dict): - """Format as an 'environment block' directly suitable for CreateProcess. - Briefly this is a list of key=value\0, terminated by an additional \0. See - CreateProcess documentation for more details.""" - block = "" - nul = "\0" - for key, value in envvar_dict.items(): - block += key + "=" + value + nul - block += nul - return block - - -def _ExtractCLPath(output_of_where): - """Gets the path to cl.exe based on the output of calling the environment - setup batch file, followed by the equivalent of `where`.""" - # Take the first line, as that's the first found in the PATH. - for line in output_of_where.strip().splitlines(): - if line.startswith("LOC:"): - return line[len("LOC:") :].strip() - - -def GenerateEnvironmentFiles( - toplevel_build_dir, generator_flags, system_includes, open_out -): - """It's not sufficient to have the absolute path to the compiler, linker, - etc. on Windows, as those tools rely on .dlls being in the PATH. We also - need to support both x86 and x64 compilers within the same build (to support - msvs_target_platform hackery). Different architectures require a different - compiler binary, and different supporting environment variables (INCLUDE, - LIB, LIBPATH). So, we extract the environment here, wrap all invocations - of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which - sets up the environment, and then we do not prefix the compiler with - an absolute path, instead preferring something like "cl.exe" in the rule - which will then run whichever the environment setup has put in the path. - When the following procedure to generate environment files does not - meet your requirement (e.g. for custom toolchains), you can pass - "-G ninja_use_custom_environment_files" to the gyp to suppress file - generation and use custom environment files prepared by yourself.""" - archs = ("x86", "x64") - if generator_flags.get("ninja_use_custom_environment_files", 0): - cl_paths = {} - for arch in archs: - cl_paths[arch] = "cl.exe" - return cl_paths - vs = GetVSVersion(generator_flags) - cl_paths = {} - for arch in archs: - # Extract environment variables for subprocesses. - args = vs.SetupScript(arch) - args.extend(("&&", "set")) - popen = subprocess.Popen( - args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - variables = popen.communicate()[0].decode("utf-8") - if popen.returncode != 0: - raise Exception('"%s" failed with error %d' % (args, popen.returncode)) - env = _ExtractImportantEnvironment(variables) - - # Inject system includes from gyp files into INCLUDE. - if system_includes: - system_includes = system_includes | OrderedSet( - env.get("INCLUDE", "").split(";") - ) - env["INCLUDE"] = ";".join(system_includes) - - env_block = _FormatAsEnvironmentBlock(env) - f = open_out(os.path.join(toplevel_build_dir, "environment." + arch), "w") - f.write(env_block) - f.close() - - # Find cl.exe location for this architecture. - args = vs.SetupScript(arch) - args.extend( - ("&&", "for", "%i", "in", "(cl.exe)", "do", "@echo", "LOC:%~$PATH:i") - ) - popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) - output = popen.communicate()[0].decode("utf-8") - cl_paths[arch] = _ExtractCLPath(output) - return cl_paths - - -def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): - """Emulate behavior of msvs_error_on_missing_sources present in the msvs - generator: Check that all regular source files, i.e. not created at run time, - exist on disk. Missing files cause needless recompilation when building via - VS, and we want this check to match for people/bots that build using ninja, - so they're not surprised when the VS build fails.""" - if int(generator_flags.get("msvs_error_on_missing_sources", 0)): - no_specials = filter(lambda x: "$" not in x, sources) - relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] - missing = [x for x in relative if not os.path.exists(x)] - if missing: - # They'll look like out\Release\..\..\stuff\things.cc, so normalize the - # path for a slightly less crazy looking output. - cleaned_up = [os.path.normpath(x) for x in missing] - raise Exception("Missing input files:\n%s" % "\n".join(cleaned_up)) - - -# Sets some values in default_variables, which are required for many -# generators, run on Windows. -def CalculateCommonVariables(default_variables, params): - generator_flags = params.get("generator_flags", {}) - - # Set a variable so conditions can be based on msvs_version. - msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) - default_variables["MSVS_VERSION"] = msvs_version.ShortName() - - # To determine processor word size on Windows, in addition to checking - # PROCESSOR_ARCHITECTURE (which reflects the word size of the current - # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which - # contains the actual word size of the system when running thru WOW64). - if "64" in os.environ.get("PROCESSOR_ARCHITECTURE", "") or "64" in os.environ.get( - "PROCESSOR_ARCHITEW6432", "" - ): - default_variables["MSVS_OS_BITS"] = 64 - else: - default_variables["MSVS_OS_BITS"] = 32 diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py deleted file mode 100644 index 0e3e86c74..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +++ /dev/null @@ -1,174 +0,0 @@ -# This file comes from -# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py -# Do not edit! Edit the upstream one instead. - -"""Python module for generating .ninja files. - -Note that this is emphatically not a required piece of Ninja; it's -just a helpful utility for build-file-generation systems that already -use Python. -""" - -import textwrap - - -def escape_path(word): - return word.replace("$ ", "$$ ").replace(" ", "$ ").replace(":", "$:") - - -class Writer: - def __init__(self, output, width=78): - self.output = output - self.width = width - - def newline(self): - self.output.write("\n") - - def comment(self, text): - for line in textwrap.wrap(text, self.width - 2): - self.output.write("# " + line + "\n") - - def variable(self, key, value, indent=0): - if value is None: - return - if isinstance(value, list): - value = " ".join(filter(None, value)) # Filter out empty strings. - self._line(f"{key} = {value}", indent) - - def pool(self, name, depth): - self._line("pool %s" % name) - self.variable("depth", depth, indent=1) - - def rule( - self, - name, - command, - description=None, - depfile=None, - generator=False, - pool=None, - restat=False, - rspfile=None, - rspfile_content=None, - deps=None, - ): - self._line("rule %s" % name) - self.variable("command", command, indent=1) - if description: - self.variable("description", description, indent=1) - if depfile: - self.variable("depfile", depfile, indent=1) - if generator: - self.variable("generator", "1", indent=1) - if pool: - self.variable("pool", pool, indent=1) - if restat: - self.variable("restat", "1", indent=1) - if rspfile: - self.variable("rspfile", rspfile, indent=1) - if rspfile_content: - self.variable("rspfile_content", rspfile_content, indent=1) - if deps: - self.variable("deps", deps, indent=1) - - def build( - self, outputs, rule, inputs=None, implicit=None, order_only=None, variables=None - ): - outputs = self._as_list(outputs) - all_inputs = self._as_list(inputs)[:] - out_outputs = list(map(escape_path, outputs)) - all_inputs = list(map(escape_path, all_inputs)) - - if implicit: - implicit = map(escape_path, self._as_list(implicit)) - all_inputs.append("|") - all_inputs.extend(implicit) - if order_only: - order_only = map(escape_path, self._as_list(order_only)) - all_inputs.append("||") - all_inputs.extend(order_only) - - self._line( - "build {}: {}".format(" ".join(out_outputs), " ".join([rule] + all_inputs)) - ) - - if variables: - if isinstance(variables, dict): - iterator = iter(variables.items()) - else: - iterator = iter(variables) - - for key, val in iterator: - self.variable(key, val, indent=1) - - return outputs - - def include(self, path): - self._line("include %s" % path) - - def subninja(self, path): - self._line("subninja %s" % path) - - def default(self, paths): - self._line("default %s" % " ".join(self._as_list(paths))) - - def _count_dollars_before_index(self, s, i): - """Returns the number of '$' characters right in front of s[i].""" - dollar_count = 0 - dollar_index = i - 1 - while dollar_index > 0 and s[dollar_index] == "$": - dollar_count += 1 - dollar_index -= 1 - return dollar_count - - def _line(self, text, indent=0): - """Write 'text' word-wrapped at self.width characters.""" - leading_space = " " * indent - while len(leading_space) + len(text) > self.width: - # The text is too wide; wrap if possible. - - # Find the rightmost space that would obey our width constraint and - # that's not an escaped space. - available_space = self.width - len(leading_space) - len(" $") - space = available_space - while True: - space = text.rfind(" ", 0, space) - if space < 0 or self._count_dollars_before_index(text, space) % 2 == 0: - break - - if space < 0: - # No such space; just use the first unescaped space we can find. - space = available_space - 1 - while True: - space = text.find(" ", space + 1) - if ( - space < 0 - or self._count_dollars_before_index(text, space) % 2 == 0 - ): - break - if space < 0: - # Give up on breaking. - break - - self.output.write(leading_space + text[0:space] + " $\n") - text = text[space + 1 :] - - # Subsequent lines are continuations, so indent them. - leading_space = " " * (indent + 2) - - self.output.write(leading_space + text + "\n") - - def _as_list(self, input): - if input is None: - return [] - if isinstance(input, list): - return input - return [input] - - -def escape(string): - """Escape a string such that it can be embedded into a Ninja file without - further interpretation.""" - assert "\n" not in string, "Ninja syntax does not allow newlines" - # We only have one special metacharacter: '$'. - return string.replace("$", "$$") diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py deleted file mode 100644 index 729cec063..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2014 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""A clone of the default copy.deepcopy that doesn't handle cyclic -structures or complex types except for dicts and lists. This is -because gyp copies so large structure that small copy overhead ends up -taking seconds in a project the size of Chromium.""" - - -class Error(Exception): - pass - - -__all__ = ["Error", "deepcopy"] - - -def deepcopy(x): - """Deep copy operation on gyp objects such as strings, ints, dicts - and lists. More than twice as fast as copy.deepcopy but much less - generic.""" - - try: - return _deepcopy_dispatch[type(x)](x) - except KeyError: - raise Error( - "Unsupported type %s for deepcopy. Use copy.deepcopy " - + "or expand simple_copy support." % type(x) - ) - - -_deepcopy_dispatch = d = {} - - -def _deepcopy_atomic(x): - return x - - -types = bool, float, int, str, type, type(None) - -for x in types: - d[x] = _deepcopy_atomic - - -def _deepcopy_list(x): - return [deepcopy(a) for a in x] - - -d[list] = _deepcopy_list - - -def _deepcopy_dict(x): - y = {} - for key, value in x.items(): - y[deepcopy(key)] = deepcopy(value) - return y - - -d[dict] = _deepcopy_dict - -del d diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py deleted file mode 100755 index 638eee400..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +++ /dev/null @@ -1,374 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions for Windows builds. - -These functions are executed via gyp-win-tool when using the ninja generator. -""" - - -import os -import re -import shutil -import subprocess -import stat -import string -import sys - -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) - -# A regex matching an argument corresponding to the output filename passed to -# link.exe. -_LINK_EXE_OUT_ARG = re.compile("/OUT:(?P.+)$", re.IGNORECASE) - - -def main(args): - executor = WinTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) - - -class WinTool: - """This class performs all the Windows tooling steps. The methods can either - be executed directly, or dispatched from an argument list.""" - - def _UseSeparateMspdbsrv(self, env, args): - """Allows to use a unique instance of mspdbsrv.exe per linker instead of a - shared one.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - if args[0] != "link.exe": - return - - # Use the output filename passed to the linker to generate an endpoint name - # for mspdbsrv.exe. - endpoint_name = None - for arg in args: - m = _LINK_EXE_OUT_ARG.match(arg) - if m: - endpoint_name = re.sub( - r"\W+", "", "%s_%d" % (m.group("out"), os.getpid()) - ) - break - - if endpoint_name is None: - return - - # Adds the appropriate environment variable. This will be read by link.exe - # to know which instance of mspdbsrv.exe it should connect to (if it's - # not set then the default endpoint is used). - env["_MSPDBSRV_ENDPOINT_"] = endpoint_name - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like recursive-mirror to RecursiveMirror.""" - return name_string.title().replace("-", "") - - def _GetEnv(self, arch): - """Gets the saved environment from a file for a given architecture.""" - # The environment is saved as an "environment block" (see CreateProcess - # and msvs_emulation for details). We convert to a dict here. - # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. - pairs = open(arch).read()[:-2].split("\0") - kvs = [item.split("=", 1) for item in pairs] - return dict(kvs) - - def ExecStamp(self, path): - """Simple stamp command.""" - open(path, "w").close() - - def ExecRecursiveMirror(self, source, dest): - """Emulation of rm -rf out && cp -af in out.""" - if os.path.exists(dest): - if os.path.isdir(dest): - - def _on_error(fn, path, excinfo): - # The operation failed, possibly because the file is set to - # read-only. If that's why, make it writable and try the op again. - if not os.access(path, os.W_OK): - os.chmod(path, stat.S_IWRITE) - fn(path) - - shutil.rmtree(dest, onerror=_on_error) - else: - if not os.access(dest, os.W_OK): - # Attempt to make the file writable before deleting it. - os.chmod(dest, stat.S_IWRITE) - os.unlink(dest) - - if os.path.isdir(source): - shutil.copytree(source, dest) - else: - shutil.copy2(source, dest) - - def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): - """Filter diagnostic output from link that looks like: - ' Creating library ui.dll.lib and object ui.dll.exp' - This happens when there are exports from the dll or exe. - """ - env = self._GetEnv(arch) - if use_separate_mspdbsrv == "True": - self._UseSeparateMspdbsrv(env, args) - if sys.platform == "win32": - args = list(args) # *args is a tuple by default, which is read-only. - args[0] = args[0].replace("/", "\\") - # https://docs.python.org/2/library/subprocess.html: - # "On Unix with shell=True [...] if args is a sequence, the first item - # specifies the command string, and any additional items will be treated as - # additional arguments to the shell itself. That is to say, Popen does the - # equivalent of: - # Popen(['/bin/sh', '-c', args[0], args[1], ...])" - # For that reason, since going through the shell doesn't seem necessary on - # non-Windows don't do that there. - link = subprocess.Popen( - args, - shell=sys.platform == "win32", - env=env, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - ) - out = link.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if ( - not line.startswith(" Creating library ") - and not line.startswith("Generating code") - and not line.startswith("Finished generating code") - ): - print(line) - return link.returncode - - def ExecLinkWithManifests( - self, - arch, - embed_manifest, - out, - ldcmd, - resname, - mt, - rc, - intermediate_manifest, - *manifests - ): - """A wrapper for handling creating a manifest resource and then executing - a link command.""" - # The 'normal' way to do manifests is to have link generate a manifest - # based on gathering dependencies from the object files, then merge that - # manifest with other manifests supplied as sources, convert the merged - # manifest to a resource, and then *relink*, including the compiled - # version of the manifest resource. This breaks incremental linking, and - # is generally overly complicated. Instead, we merge all the manifests - # provided (along with one that includes what would normally be in the - # linker-generated one, see msvs_emulation.py), and include that into the - # first and only link. We still tell link to generate a manifest, but we - # only use that to assert that our simpler process did not miss anything. - variables = { - "python": sys.executable, - "arch": arch, - "out": out, - "ldcmd": ldcmd, - "resname": resname, - "mt": mt, - "rc": rc, - "intermediate_manifest": intermediate_manifest, - "manifests": " ".join(manifests), - } - add_to_ld = "" - if manifests: - subprocess.check_call( - "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " - "-manifest %(manifests)s -out:%(out)s.manifest" % variables - ) - if embed_manifest == "True": - subprocess.check_call( - "%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest" - " %(out)s.manifest.rc %(resname)s" % variables - ) - subprocess.check_call( - "%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s " - "%(out)s.manifest.rc" % variables - ) - add_to_ld = " %(out)s.manifest.res" % variables - subprocess.check_call(ldcmd + add_to_ld) - - # Run mt.exe on the theoretically complete manifest we generated, merging - # it with the one the linker generated to confirm that the linker - # generated one does not add anything. This is strictly unnecessary for - # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not - # used in a #pragma comment. - if manifests: - # Merge the intermediate one with ours to .assert.manifest, then check - # that .assert.manifest is identical to ours. - subprocess.check_call( - "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " - "-manifest %(out)s.manifest %(intermediate_manifest)s " - "-out:%(out)s.assert.manifest" % variables - ) - assert_manifest = "%(out)s.assert.manifest" % variables - our_manifest = "%(out)s.manifest" % variables - # Load and normalize the manifests. mt.exe sometimes removes whitespace, - # and sometimes doesn't unfortunately. - with open(our_manifest) as our_f: - with open(assert_manifest) as assert_f: - translator = str.maketrans('', '', string.whitespace) - our_data = our_f.read().translate(translator) - assert_data = assert_f.read().translate(translator) - if our_data != assert_data: - os.unlink(out) - - def dump(filename): - print(filename, file=sys.stderr) - print("-----", file=sys.stderr) - with open(filename) as f: - print(f.read(), file=sys.stderr) - print("-----", file=sys.stderr) - - dump(intermediate_manifest) - dump(our_manifest) - dump(assert_manifest) - sys.stderr.write( - 'Linker generated manifest "%s" added to final manifest "%s" ' - '(result in "%s"). ' - "Were /MANIFEST switches used in #pragma statements? " - % (intermediate_manifest, our_manifest, assert_manifest) - ) - return 1 - - def ExecManifestWrapper(self, arch, *args): - """Run manifest tool with environment set. Strip out undesirable warning - (some XML blocks are recognized by the OS loader, but not the manifest - tool).""" - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if line and "manifest authoring warning 81010002" not in line: - print(line) - return popen.returncode - - def ExecManifestToRc(self, arch, *args): - """Creates a resource file pointing a SxS assembly manifest. - |args| is tuple containing path to resource file, path to manifest file - and resource name which can be "1" (for executables) or "2" (for DLLs).""" - manifest_path, resource_path, resource_name = args - with open(resource_path, "w") as output: - output.write( - '#include \n%s RT_MANIFEST "%s"' - % (resource_name, os.path.abspath(manifest_path).replace("\\", "/")) - ) - - def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): - """Filter noisy filenames output from MIDL compile step that isn't - quietable via command line flags. - """ - args = ( - ["midl", "/nologo"] - + list(flags) - + [ - "/out", - outdir, - "/tlb", - tlb, - "/h", - h, - "/dlldata", - dlldata, - "/iid", - iid, - "/proxy", - proxy, - idl, - ] - ) - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - # Filter junk out of stdout, and write filtered versions. Output we want - # to filter is pairs of lines that look like this: - # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl - # objidl.idl - lines = out.splitlines() - prefixes = ("Processing ", "64 bit Processing ") - processing = {os.path.basename(x) for x in lines if x.startswith(prefixes)} - for line in lines: - if not line.startswith(prefixes) and line not in processing: - print(line) - return popen.returncode - - def ExecAsmWrapper(self, arch, *args): - """Filter logo banner from invocations of asm.exe.""" - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if ( - not line.startswith("Copyright (C) Microsoft Corporation") - and not line.startswith("Microsoft (R) Macro Assembler") - and not line.startswith(" Assembling: ") - and line - ): - print(line) - return popen.returncode - - def ExecRcWrapper(self, arch, *args): - """Filter logo banner from invocations of rc.exe. Older versions of RC - don't support the /nologo flag.""" - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if ( - not line.startswith("Microsoft (R) Windows (R) Resource Compiler") - and not line.startswith("Copyright (C) Microsoft Corporation") - and line - ): - print(line) - return popen.returncode - - def ExecActionWrapper(self, arch, rspfile, *dir): - """Runs an action command line from a response file using the environment - for |arch|. If |dir| is supplied, use that as the working directory.""" - env = self._GetEnv(arch) - # TODO(scottmg): This is a temporary hack to get some specific variables - # through to actions that are set after gyp-time. http://crbug.com/333738. - for k, v in os.environ.items(): - if k not in env: - env[k] = v - args = open(rspfile).read() - dir = dir[0] if dir else None - return subprocess.call(args, shell=True, env=env, cwd=dir) - - def ExecClCompile(self, project_dir, selected_files): - """Executed by msvs-ninja projects when the 'ClCompile' target is used to - build selected C/C++ files.""" - project_dir = os.path.relpath(project_dir, BASE_DIR) - selected_files = selected_files.split(";") - ninja_targets = [ - os.path.join(project_dir, filename) + "^^" for filename in selected_files - ] - cmd = ["ninja.exe"] - cmd.extend(ninja_targets) - return subprocess.call(cmd, shell=True, cwd=BASE_DIR) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py deleted file mode 100644 index a75d8eeab..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +++ /dev/null @@ -1,1939 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" -This module contains classes that help to emulate xcodebuild behavior on top of -other build systems, such as make and ninja. -""" - - -import copy -import gyp.common -import os -import os.path -import re -import shlex -import subprocess -import sys -from gyp.common import GypError - -# Populated lazily by XcodeVersion, for efficiency, and to fix an issue when -# "xcodebuild" is called too quickly (it has been found to return incorrect -# version number). -XCODE_VERSION_CACHE = None - -# Populated lazily by GetXcodeArchsDefault, to an |XcodeArchsDefault| instance -# corresponding to the installed version of Xcode. -XCODE_ARCHS_DEFAULT_CACHE = None - - -def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): - """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, - and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" - mapping = {"$(ARCHS_STANDARD)": archs} - if archs_including_64_bit: - mapping["$(ARCHS_STANDARD_INCLUDING_64_BIT)"] = archs_including_64_bit - return mapping - - -class XcodeArchsDefault: - """A class to resolve ARCHS variable from xcode_settings, resolving Xcode - macros and implementing filtering by VALID_ARCHS. The expansion of macros - depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and - on the version of Xcode. - """ - - # Match variable like $(ARCHS_STANDARD). - variable_pattern = re.compile(r"\$\([a-zA-Z_][a-zA-Z0-9_]*\)$") - - def __init__(self, default, mac, iphonesimulator, iphoneos): - self._default = (default,) - self._archs = {"mac": mac, "ios": iphoneos, "iossim": iphonesimulator} - - def _VariableMapping(self, sdkroot): - """Returns the dictionary of variable mapping depending on the SDKROOT.""" - sdkroot = sdkroot.lower() - if "iphoneos" in sdkroot: - return self._archs["ios"] - elif "iphonesimulator" in sdkroot: - return self._archs["iossim"] - else: - return self._archs["mac"] - - def _ExpandArchs(self, archs, sdkroot): - """Expands variables references in ARCHS, and remove duplicates.""" - variable_mapping = self._VariableMapping(sdkroot) - expanded_archs = [] - for arch in archs: - if self.variable_pattern.match(arch): - variable = arch - try: - variable_expansion = variable_mapping[variable] - for arch in variable_expansion: - if arch not in expanded_archs: - expanded_archs.append(arch) - except KeyError: - print('Warning: Ignoring unsupported variable "%s".' % variable) - elif arch not in expanded_archs: - expanded_archs.append(arch) - return expanded_archs - - def ActiveArchs(self, archs, valid_archs, sdkroot): - """Expands variables references in ARCHS, and filter by VALID_ARCHS if it - is defined (if not set, Xcode accept any value in ARCHS, otherwise, only - values present in VALID_ARCHS are kept).""" - expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or "") - if valid_archs: - filtered_archs = [] - for arch in expanded_archs: - if arch in valid_archs: - filtered_archs.append(arch) - expanded_archs = filtered_archs - return expanded_archs - - -def GetXcodeArchsDefault(): - """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the - installed version of Xcode. The default values used by Xcode for ARCHS - and the expansion of the variables depends on the version of Xcode used. - - For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included - uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses - $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0 - and deprecated with Xcode 5.1. - - For "macosx" SDKROOT, all version starting with Xcode 5.0 includes 64-bit - architecture as part of $(ARCHS_STANDARD) and default to only building it. - - For "iphoneos" and "iphonesimulator" SDKROOT, 64-bit architectures are part - of $(ARCHS_STANDARD_INCLUDING_64_BIT) from Xcode 5.0. From Xcode 5.1, they - are also part of $(ARCHS_STANDARD). - - All these rules are coded in the construction of the |XcodeArchsDefault| - object to use depending on the version of Xcode detected. The object is - for performance reason.""" - global XCODE_ARCHS_DEFAULT_CACHE - if XCODE_ARCHS_DEFAULT_CACHE: - return XCODE_ARCHS_DEFAULT_CACHE - xcode_version, _ = XcodeVersion() - if xcode_version < "0500": - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - "$(ARCHS_STANDARD)", - XcodeArchsVariableMapping(["i386"]), - XcodeArchsVariableMapping(["i386"]), - XcodeArchsVariableMapping(["armv7"]), - ) - elif xcode_version < "0510": - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - "$(ARCHS_STANDARD_INCLUDING_64_BIT)", - XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), - XcodeArchsVariableMapping(["i386"], ["i386", "x86_64"]), - XcodeArchsVariableMapping( - ["armv7", "armv7s"], ["armv7", "armv7s", "arm64"] - ), - ) - else: - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - "$(ARCHS_STANDARD)", - XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), - XcodeArchsVariableMapping(["i386", "x86_64"], ["i386", "x86_64"]), - XcodeArchsVariableMapping( - ["armv7", "armv7s", "arm64"], ["armv7", "armv7s", "arm64"] - ), - ) - return XCODE_ARCHS_DEFAULT_CACHE - - -class XcodeSettings: - """A class that understands the gyp 'xcode_settings' object.""" - - # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached - # at class-level for efficiency. - _sdk_path_cache = {} - _platform_path_cache = {} - _sdk_root_cache = {} - - # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so - # cached at class-level for efficiency. - _plist_cache = {} - - # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so - # cached at class-level for efficiency. - _codesigning_key_cache = {} - - def __init__(self, spec): - self.spec = spec - - self.isIOS = False - self.mac_toolchain_dir = None - self.header_map_path = None - - # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. - # This means self.xcode_settings[config] always contains all settings - # for that config -- the per-target settings as well. Settings that are - # the same for all configs are implicitly per-target settings. - self.xcode_settings = {} - configs = spec["configurations"] - for configname, config in configs.items(): - self.xcode_settings[configname] = config.get("xcode_settings", {}) - self._ConvertConditionalKeys(configname) - if self.xcode_settings[configname].get("IPHONEOS_DEPLOYMENT_TARGET", None): - self.isIOS = True - - # This is only non-None temporarily during the execution of some methods. - self.configname = None - - # Used by _AdjustLibrary to match .a and .dylib entries in libraries. - self.library_re = re.compile(r"^lib([^/]+)\.(a|dylib)$") - - def _ConvertConditionalKeys(self, configname): - """Converts or warns on conditional keys. Xcode supports conditional keys, - such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation - with some keys converted while the rest force a warning.""" - settings = self.xcode_settings[configname] - conditional_keys = [key for key in settings if key.endswith("]")] - for key in conditional_keys: - # If you need more, speak up at http://crbug.com/122592 - if key.endswith("[sdk=iphoneos*]"): - if configname.endswith("iphoneos"): - new_key = key.split("[")[0] - settings[new_key] = settings[key] - else: - print( - "Warning: Conditional keys not implemented, ignoring:", - " ".join(conditional_keys), - ) - del settings[key] - - def _Settings(self): - assert self.configname - return self.xcode_settings[self.configname] - - def _Test(self, test_key, cond_key, default): - return self._Settings().get(test_key, default) == cond_key - - def _Appendf(self, lst, test_key, format_str, default=None): - if test_key in self._Settings(): - lst.append(format_str % str(self._Settings()[test_key])) - elif default: - lst.append(format_str % str(default)) - - def _WarnUnimplemented(self, test_key): - if test_key in self._Settings(): - print('Warning: Ignoring not yet implemented key "%s".' % test_key) - - def IsBinaryOutputFormat(self, configname): - default = "binary" if self.isIOS else "xml" - format = self.xcode_settings[configname].get("INFOPLIST_OUTPUT_FORMAT", default) - return format == "binary" - - def IsIosFramework(self): - return self.spec["type"] == "shared_library" and self._IsBundle() and self.isIOS - - def _IsBundle(self): - return ( - int(self.spec.get("mac_bundle", 0)) != 0 - or self._IsXCTest() - or self._IsXCUiTest() - ) - - def _IsXCTest(self): - return int(self.spec.get("mac_xctest_bundle", 0)) != 0 - - def _IsXCUiTest(self): - return int(self.spec.get("mac_xcuitest_bundle", 0)) != 0 - - def _IsIosAppExtension(self): - return int(self.spec.get("ios_app_extension", 0)) != 0 - - def _IsIosWatchKitExtension(self): - return int(self.spec.get("ios_watchkit_extension", 0)) != 0 - - def _IsIosWatchApp(self): - return int(self.spec.get("ios_watch_app", 0)) != 0 - - def GetFrameworkVersion(self): - """Returns the framework version of the current target. Only valid for - bundles.""" - assert self._IsBundle() - return self.GetPerTargetSetting("FRAMEWORK_VERSION", default="A") - - def GetWrapperExtension(self): - """Returns the bundle extension (.app, .framework, .plugin, etc). Only - valid for bundles.""" - assert self._IsBundle() - if self.spec["type"] in ("loadable_module", "shared_library"): - default_wrapper_extension = { - "loadable_module": "bundle", - "shared_library": "framework", - }[self.spec["type"]] - wrapper_extension = self.GetPerTargetSetting( - "WRAPPER_EXTENSION", default=default_wrapper_extension - ) - return "." + self.spec.get("product_extension", wrapper_extension) - elif self.spec["type"] == "executable": - if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): - return "." + self.spec.get("product_extension", "appex") - else: - return "." + self.spec.get("product_extension", "app") - else: - assert False, "Don't know extension for '{}', target '{}'".format( - self.spec["type"], - self.spec["target_name"], - ) - - def GetProductName(self): - """Returns PRODUCT_NAME.""" - return self.spec.get("product_name", self.spec["target_name"]) - - def GetFullProductName(self): - """Returns FULL_PRODUCT_NAME.""" - if self._IsBundle(): - return self.GetWrapperName() - else: - return self._GetStandaloneBinaryPath() - - def GetWrapperName(self): - """Returns the directory name of the bundle represented by this target. - Only valid for bundles.""" - assert self._IsBundle() - return self.GetProductName() + self.GetWrapperExtension() - - def GetBundleContentsFolderPath(self): - """Returns the qualified path to the bundle's contents folder. E.g. - Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" - if self.isIOS: - return self.GetWrapperName() - assert self._IsBundle() - if self.spec["type"] == "shared_library": - return os.path.join( - self.GetWrapperName(), "Versions", self.GetFrameworkVersion() - ) - else: - # loadable_modules have a 'Contents' folder like executables. - return os.path.join(self.GetWrapperName(), "Contents") - - def GetBundleResourceFolder(self): - """Returns the qualified path to the bundle's resource folder. E.g. - Chromium.app/Contents/Resources. Only valid for bundles.""" - assert self._IsBundle() - if self.isIOS: - return self.GetBundleContentsFolderPath() - return os.path.join(self.GetBundleContentsFolderPath(), "Resources") - - def GetBundleExecutableFolderPath(self): - """Returns the qualified path to the bundle's executables folder. E.g. - Chromium.app/Contents/MacOS. Only valid for bundles.""" - assert self._IsBundle() - if self.spec["type"] in ("shared_library") or self.isIOS: - return self.GetBundleContentsFolderPath() - elif self.spec["type"] in ("executable", "loadable_module"): - return os.path.join(self.GetBundleContentsFolderPath(), "MacOS") - - def GetBundleJavaFolderPath(self): - """Returns the qualified path to the bundle's Java resource folder. - E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleResourceFolder(), "Java") - - def GetBundleFrameworksFolderPath(self): - """Returns the qualified path to the bundle's frameworks folder. E.g, - Chromium.app/Contents/Frameworks. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "Frameworks") - - def GetBundleSharedFrameworksFolderPath(self): - """Returns the qualified path to the bundle's frameworks folder. E.g, - Chromium.app/Contents/SharedFrameworks. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "SharedFrameworks") - - def GetBundleSharedSupportFolderPath(self): - """Returns the qualified path to the bundle's shared support folder. E.g, - Chromium.app/Contents/SharedSupport. Only valid for bundles.""" - assert self._IsBundle() - if self.spec["type"] == "shared_library": - return self.GetBundleResourceFolder() - else: - return os.path.join(self.GetBundleContentsFolderPath(), "SharedSupport") - - def GetBundlePlugInsFolderPath(self): - """Returns the qualified path to the bundle's plugins folder. E.g, - Chromium.app/Contents/PlugIns. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "PlugIns") - - def GetBundleXPCServicesFolderPath(self): - """Returns the qualified path to the bundle's XPC services folder. E.g, - Chromium.app/Contents/XPCServices. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "XPCServices") - - def GetBundlePlistPath(self): - """Returns the qualified path to the bundle's plist file. E.g. - Chromium.app/Contents/Info.plist. Only valid for bundles.""" - assert self._IsBundle() - if ( - self.spec["type"] in ("executable", "loadable_module") - or self.IsIosFramework() - ): - return os.path.join(self.GetBundleContentsFolderPath(), "Info.plist") - else: - return os.path.join( - self.GetBundleContentsFolderPath(), "Resources", "Info.plist" - ) - - def GetProductType(self): - """Returns the PRODUCT_TYPE of this target.""" - if self._IsIosAppExtension(): - assert self._IsBundle(), ( - "ios_app_extension flag requires mac_bundle " - "(target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.app-extension" - if self._IsIosWatchKitExtension(): - assert self._IsBundle(), ( - "ios_watchkit_extension flag requires " - "mac_bundle (target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.watchkit-extension" - if self._IsIosWatchApp(): - assert self._IsBundle(), ( - "ios_watch_app flag requires mac_bundle " - "(target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.application.watchapp" - if self._IsXCUiTest(): - assert self._IsBundle(), ( - "mac_xcuitest_bundle flag requires mac_bundle " - "(target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.bundle.ui-testing" - if self._IsBundle(): - return { - "executable": "com.apple.product-type.application", - "loadable_module": "com.apple.product-type.bundle", - "shared_library": "com.apple.product-type.framework", - }[self.spec["type"]] - else: - return { - "executable": "com.apple.product-type.tool", - "loadable_module": "com.apple.product-type.library.dynamic", - "shared_library": "com.apple.product-type.library.dynamic", - "static_library": "com.apple.product-type.library.static", - }[self.spec["type"]] - - def GetMachOType(self): - """Returns the MACH_O_TYPE of this target.""" - # Weird, but matches Xcode. - if not self._IsBundle() and self.spec["type"] == "executable": - return "" - return { - "executable": "mh_execute", - "static_library": "staticlib", - "shared_library": "mh_dylib", - "loadable_module": "mh_bundle", - }[self.spec["type"]] - - def _GetBundleBinaryPath(self): - """Returns the name of the bundle binary of by this target. - E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join( - self.GetBundleExecutableFolderPath(), self.GetExecutableName() - ) - - def _GetStandaloneExecutableSuffix(self): - if "product_extension" in self.spec: - return "." + self.spec["product_extension"] - return { - "executable": "", - "static_library": ".a", - "shared_library": ".dylib", - "loadable_module": ".so", - }[self.spec["type"]] - - def _GetStandaloneExecutablePrefix(self): - return self.spec.get( - "product_prefix", - { - "executable": "", - "static_library": "lib", - "shared_library": "lib", - # Non-bundled loadable_modules are called foo.so for some reason - # (that is, .so and no prefix) with the xcode build -- match that. - "loadable_module": "", - }[self.spec["type"]], - ) - - def _GetStandaloneBinaryPath(self): - """Returns the name of the non-bundle binary represented by this target. - E.g. hello_world. Only valid for non-bundles.""" - assert not self._IsBundle() - assert self.spec["type"] in ( - "executable", - "shared_library", - "static_library", - "loadable_module", - ), ("Unexpected type %s" % self.spec["type"]) - target = self.spec["target_name"] - if self.spec["type"] == "static_library": - if target[:3] == "lib": - target = target[3:] - elif self.spec["type"] in ("loadable_module", "shared_library"): - if target[:3] == "lib": - target = target[3:] - - target_prefix = self._GetStandaloneExecutablePrefix() - target = self.spec.get("product_name", target) - target_ext = self._GetStandaloneExecutableSuffix() - return target_prefix + target + target_ext - - def GetExecutableName(self): - """Returns the executable name of the bundle represented by this target. - E.g. Chromium.""" - if self._IsBundle(): - return self.spec.get("product_name", self.spec["target_name"]) - else: - return self._GetStandaloneBinaryPath() - - def GetExecutablePath(self): - """Returns the qualified path to the primary executable of the bundle - represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" - if self._IsBundle(): - return self._GetBundleBinaryPath() - else: - return self._GetStandaloneBinaryPath() - - def GetActiveArchs(self, configname): - """Returns the architectures this target should be built for.""" - config_settings = self.xcode_settings[configname] - xcode_archs_default = GetXcodeArchsDefault() - return xcode_archs_default.ActiveArchs( - config_settings.get("ARCHS"), - config_settings.get("VALID_ARCHS"), - config_settings.get("SDKROOT"), - ) - - def _GetSdkVersionInfoItem(self, sdk, infoitem): - # xcodebuild requires Xcode and can't run on Command Line Tools-only - # systems from 10.7 onward. - # Since the CLT has no SDK paths anyway, returning None is the - # most sensible route and should still do the right thing. - try: - return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem]) - except GypError: - pass - - def _SdkRoot(self, configname): - if configname is None: - configname = self.configname - return self.GetPerConfigSetting("SDKROOT", configname, default="") - - def _XcodePlatformPath(self, configname=None): - sdk_root = self._SdkRoot(configname) - if sdk_root not in XcodeSettings._platform_path_cache: - platform_path = self._GetSdkVersionInfoItem( - sdk_root, "--show-sdk-platform-path" - ) - XcodeSettings._platform_path_cache[sdk_root] = platform_path - return XcodeSettings._platform_path_cache[sdk_root] - - def _SdkPath(self, configname=None): - sdk_root = self._SdkRoot(configname) - if sdk_root.startswith("/"): - return sdk_root - return self._XcodeSdkPath(sdk_root) - - def _XcodeSdkPath(self, sdk_root): - if sdk_root not in XcodeSettings._sdk_path_cache: - sdk_path = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-path") - XcodeSettings._sdk_path_cache[sdk_root] = sdk_path - if sdk_root: - XcodeSettings._sdk_root_cache[sdk_path] = sdk_root - return XcodeSettings._sdk_path_cache[sdk_root] - - def _AppendPlatformVersionMinFlags(self, lst): - self._Appendf(lst, "MACOSX_DEPLOYMENT_TARGET", "-mmacosx-version-min=%s") - if "IPHONEOS_DEPLOYMENT_TARGET" in self._Settings(): - # TODO: Implement this better? - sdk_path_basename = os.path.basename(self._SdkPath()) - if sdk_path_basename.lower().startswith("iphonesimulator"): - self._Appendf( - lst, "IPHONEOS_DEPLOYMENT_TARGET", "-mios-simulator-version-min=%s" - ) - else: - self._Appendf( - lst, "IPHONEOS_DEPLOYMENT_TARGET", "-miphoneos-version-min=%s" - ) - - def GetCflags(self, configname, arch=None): - """Returns flags that need to be added to .c, .cc, .m, and .mm - compilations.""" - # This functions (and the similar ones below) do not offer complete - # emulation of all xcode_settings keys. They're implemented on demand. - - self.configname = configname - cflags = [] - - sdk_root = self._SdkPath() - if "SDKROOT" in self._Settings() and sdk_root: - cflags.append("-isysroot %s" % sdk_root) - - if self.header_map_path: - cflags.append("-I%s" % self.header_map_path) - - if self._Test("CLANG_WARN_CONSTANT_CONVERSION", "YES", default="NO"): - cflags.append("-Wconstant-conversion") - - if self._Test("GCC_CHAR_IS_UNSIGNED_CHAR", "YES", default="NO"): - cflags.append("-funsigned-char") - - if self._Test("GCC_CW_ASM_SYNTAX", "YES", default="YES"): - cflags.append("-fasm-blocks") - - if "GCC_DYNAMIC_NO_PIC" in self._Settings(): - if self._Settings()["GCC_DYNAMIC_NO_PIC"] == "YES": - cflags.append("-mdynamic-no-pic") - else: - pass - # TODO: In this case, it depends on the target. xcode passes - # mdynamic-no-pic by default for executable and possibly static lib - # according to mento - - if self._Test("GCC_ENABLE_PASCAL_STRINGS", "YES", default="YES"): - cflags.append("-mpascal-strings") - - self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") - - if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): - dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") - if dbg_format == "dwarf": - cflags.append("-gdwarf-2") - elif dbg_format == "stabs": - raise NotImplementedError("stabs debug format is not supported yet.") - elif dbg_format == "dwarf-with-dsym": - cflags.append("-gdwarf-2") - else: - raise NotImplementedError("Unknown debug format %s" % dbg_format) - - if self._Settings().get("GCC_STRICT_ALIASING") == "YES": - cflags.append("-fstrict-aliasing") - elif self._Settings().get("GCC_STRICT_ALIASING") == "NO": - cflags.append("-fno-strict-aliasing") - - if self._Test("GCC_SYMBOLS_PRIVATE_EXTERN", "YES", default="NO"): - cflags.append("-fvisibility=hidden") - - if self._Test("GCC_TREAT_WARNINGS_AS_ERRORS", "YES", default="NO"): - cflags.append("-Werror") - - if self._Test("GCC_WARN_ABOUT_MISSING_NEWLINE", "YES", default="NO"): - cflags.append("-Wnewline-eof") - - # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or - # llvm-gcc. It also requires a fairly recent libtool, and - # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the - # path to the libLTO.dylib that matches the used clang. - if self._Test("LLVM_LTO", "YES", default="NO"): - cflags.append("-flto") - - self._AppendPlatformVersionMinFlags(cflags) - - # TODO: - if self._Test("COPY_PHASE_STRIP", "YES", default="NO"): - self._WarnUnimplemented("COPY_PHASE_STRIP") - self._WarnUnimplemented("GCC_DEBUGGING_SYMBOLS") - self._WarnUnimplemented("GCC_ENABLE_OBJC_EXCEPTIONS") - - # TODO: This is exported correctly, but assigning to it is not supported. - self._WarnUnimplemented("MACH_O_TYPE") - self._WarnUnimplemented("PRODUCT_TYPE") - - # If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific - # additions and assume these will be provided as required via CC_host, - # CXX_host, CC_target and CXX_target. - if not gyp.common.CrossCompileRequested(): - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented("ARCHS") - archs = ["i386"] - cflags.append("-arch " + archs[0]) - - if archs[0] in ("i386", "x86_64"): - if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse3") - if self._Test( - "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" - ): - cflags.append("-mssse3") # Note 3rd 's'. - if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse4.1") - if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse4.2") - - cflags += self._Settings().get("WARNING_CFLAGS", []) - - if self._IsXCTest(): - platform_root = self._XcodePlatformPath(configname) - if platform_root: - cflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") - - if sdk_root: - framework_root = sdk_root - else: - framework_root = "" - config = self.spec["configurations"][self.configname] - framework_dirs = config.get("mac_framework_dirs", []) - for directory in framework_dirs: - cflags.append("-F" + directory.replace("$(SDKROOT)", framework_root)) - - self.configname = None - return cflags - - def GetCflagsC(self, configname): - """Returns flags that need to be added to .c, and .m compilations.""" - self.configname = configname - cflags_c = [] - if self._Settings().get("GCC_C_LANGUAGE_STANDARD", "") == "ansi": - cflags_c.append("-ansi") - else: - self._Appendf(cflags_c, "GCC_C_LANGUAGE_STANDARD", "-std=%s") - cflags_c += self._Settings().get("OTHER_CFLAGS", []) - self.configname = None - return cflags_c - - def GetCflagsCC(self, configname): - """Returns flags that need to be added to .cc, and .mm compilations.""" - self.configname = configname - cflags_cc = [] - - clang_cxx_language_standard = self._Settings().get( - "CLANG_CXX_LANGUAGE_STANDARD" - ) - # Note: Don't make c++0x to c++11 so that c++0x can be used with older - # clangs that don't understand c++11 yet (like Xcode 4.2's). - if clang_cxx_language_standard: - cflags_cc.append("-std=%s" % clang_cxx_language_standard) - - self._Appendf(cflags_cc, "CLANG_CXX_LIBRARY", "-stdlib=%s") - - if self._Test("GCC_ENABLE_CPP_RTTI", "NO", default="YES"): - cflags_cc.append("-fno-rtti") - if self._Test("GCC_ENABLE_CPP_EXCEPTIONS", "NO", default="YES"): - cflags_cc.append("-fno-exceptions") - if self._Test("GCC_INLINES_ARE_PRIVATE_EXTERN", "YES", default="NO"): - cflags_cc.append("-fvisibility-inlines-hidden") - if self._Test("GCC_THREADSAFE_STATICS", "NO", default="YES"): - cflags_cc.append("-fno-threadsafe-statics") - # Note: This flag is a no-op for clang, it only has an effect for gcc. - if self._Test("GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO", "NO", default="YES"): - cflags_cc.append("-Wno-invalid-offsetof") - - other_ccflags = [] - - for flag in self._Settings().get("OTHER_CPLUSPLUSFLAGS", ["$(inherited)"]): - # TODO: More general variable expansion. Missing in many other places too. - if flag in ("$inherited", "$(inherited)", "${inherited}"): - flag = "$OTHER_CFLAGS" - if flag in ("$OTHER_CFLAGS", "$(OTHER_CFLAGS)", "${OTHER_CFLAGS}"): - other_ccflags += self._Settings().get("OTHER_CFLAGS", []) - else: - other_ccflags.append(flag) - cflags_cc += other_ccflags - - self.configname = None - return cflags_cc - - def _AddObjectiveCGarbageCollectionFlags(self, flags): - gc_policy = self._Settings().get("GCC_ENABLE_OBJC_GC", "unsupported") - if gc_policy == "supported": - flags.append("-fobjc-gc") - elif gc_policy == "required": - flags.append("-fobjc-gc-only") - - def _AddObjectiveCARCFlags(self, flags): - if self._Test("CLANG_ENABLE_OBJC_ARC", "YES", default="NO"): - flags.append("-fobjc-arc") - - def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): - if self._Test( - "CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS", "YES", default="NO" - ): - flags.append("-Wobjc-missing-property-synthesis") - - def GetCflagsObjC(self, configname): - """Returns flags that need to be added to .m compilations.""" - self.configname = configname - cflags_objc = [] - self._AddObjectiveCGarbageCollectionFlags(cflags_objc) - self._AddObjectiveCARCFlags(cflags_objc) - self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) - self.configname = None - return cflags_objc - - def GetCflagsObjCC(self, configname): - """Returns flags that need to be added to .mm compilations.""" - self.configname = configname - cflags_objcc = [] - self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) - self._AddObjectiveCARCFlags(cflags_objcc) - self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) - if self._Test("GCC_OBJC_CALL_CXX_CDTORS", "YES", default="NO"): - cflags_objcc.append("-fobjc-call-cxx-cdtors") - self.configname = None - return cflags_objcc - - def GetInstallNameBase(self): - """Return DYLIB_INSTALL_NAME_BASE for this target.""" - # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. - if self.spec["type"] != "shared_library" and ( - self.spec["type"] != "loadable_module" or self._IsBundle() - ): - return None - install_base = self.GetPerTargetSetting( - "DYLIB_INSTALL_NAME_BASE", - default="/Library/Frameworks" if self._IsBundle() else "/usr/local/lib", - ) - return install_base - - def _StandardizePath(self, path): - """Do :standardizepath processing for path.""" - # I'm not quite sure what :standardizepath does. Just call normpath(), - # but don't let @executable_path/../foo collapse to foo. - if "/" in path: - prefix, rest = "", path - if path.startswith("@"): - prefix, rest = path.split("/", 1) - rest = os.path.normpath(rest) # :standardizepath - path = os.path.join(prefix, rest) - return path - - def GetInstallName(self): - """Return LD_DYLIB_INSTALL_NAME for this target.""" - # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. - if self.spec["type"] != "shared_library" and ( - self.spec["type"] != "loadable_module" or self._IsBundle() - ): - return None - - default_install_name = ( - "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)" - ) - install_name = self.GetPerTargetSetting( - "LD_DYLIB_INSTALL_NAME", default=default_install_name - ) - - # Hardcode support for the variables used in chromium for now, to - # unblock people using the make build. - if "$" in install_name: - assert install_name in ( - "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/" - "$(WRAPPER_NAME)/$(PRODUCT_NAME)", - default_install_name, - ), ( - "Variables in LD_DYLIB_INSTALL_NAME are not generally supported " - "yet in target '%s' (got '%s')" - % (self.spec["target_name"], install_name) - ) - - install_name = install_name.replace( - "$(DYLIB_INSTALL_NAME_BASE:standardizepath)", - self._StandardizePath(self.GetInstallNameBase()), - ) - if self._IsBundle(): - # These are only valid for bundles, hence the |if|. - install_name = install_name.replace( - "$(WRAPPER_NAME)", self.GetWrapperName() - ) - install_name = install_name.replace( - "$(PRODUCT_NAME)", self.GetProductName() - ) - else: - assert "$(WRAPPER_NAME)" not in install_name - assert "$(PRODUCT_NAME)" not in install_name - - install_name = install_name.replace( - "$(EXECUTABLE_PATH)", self.GetExecutablePath() - ) - return install_name - - def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): - """Checks if ldflag contains a filename and if so remaps it from - gyp-directory-relative to build-directory-relative.""" - # This list is expanded on demand. - # They get matched as: - # -exported_symbols_list file - # -Wl,exported_symbols_list file - # -Wl,exported_symbols_list,file - LINKER_FILE = r"(\S+)" - WORD = r"\S+" - linker_flags = [ - ["-exported_symbols_list", LINKER_FILE], # Needed for NaCl. - ["-unexported_symbols_list", LINKER_FILE], - ["-reexported_symbols_list", LINKER_FILE], - ["-sectcreate", WORD, WORD, LINKER_FILE], # Needed for remoting. - ] - for flag_pattern in linker_flags: - regex = re.compile("(?:-Wl,)?" + "[ ,]".join(flag_pattern)) - m = regex.match(ldflag) - if m: - ldflag = ( - ldflag[: m.start(1)] - + gyp_to_build_path(m.group(1)) - + ldflag[m.end(1) :] - ) - # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, - # TODO(thakis): Update ffmpeg.gyp): - if ldflag.startswith("-L"): - ldflag = "-L" + gyp_to_build_path(ldflag[len("-L") :]) - return ldflag - - def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): - """Returns flags that need to be passed to the linker. - - Args: - configname: The name of the configuration to get ld flags for. - product_dir: The directory where products such static and dynamic - libraries are placed. This is added to the library search path. - gyp_to_build_path: A function that converts paths relative to the - current gyp file to paths relative to the build directory. - """ - self.configname = configname - ldflags = [] - - # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS - # can contain entries that depend on this. Explicitly absolutify these. - for ldflag in self._Settings().get("OTHER_LDFLAGS", []): - ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) - - if self._Test("DEAD_CODE_STRIPPING", "YES", default="NO"): - ldflags.append("-Wl,-dead_strip") - - if self._Test("PREBINDING", "YES", default="NO"): - ldflags.append("-Wl,-prebind") - - self._Appendf( - ldflags, "DYLIB_COMPATIBILITY_VERSION", "-compatibility_version %s" - ) - self._Appendf(ldflags, "DYLIB_CURRENT_VERSION", "-current_version %s") - - self._AppendPlatformVersionMinFlags(ldflags) - - if "SDKROOT" in self._Settings() and self._SdkPath(): - ldflags.append("-isysroot " + self._SdkPath()) - - for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []): - ldflags.append("-L" + gyp_to_build_path(library_path)) - - if "ORDER_FILE" in self._Settings(): - ldflags.append( - "-Wl,-order_file " - + "-Wl," - + gyp_to_build_path(self._Settings()["ORDER_FILE"]) - ) - - if not gyp.common.CrossCompileRequested(): - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented("ARCHS") - archs = ["i386"] - ldflags.append("-arch " + archs[0]) - - # Xcode adds the product directory by default. - # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 - ldflags.append("-L" + (product_dir if product_dir != "." else "./")) - - install_name = self.GetInstallName() - if install_name and self.spec["type"] != "loadable_module": - ldflags.append("-install_name " + install_name.replace(" ", r"\ ")) - - for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []): - ldflags.append("-Wl,-rpath," + rpath) - - sdk_root = self._SdkPath() - if not sdk_root: - sdk_root = "" - config = self.spec["configurations"][self.configname] - framework_dirs = config.get("mac_framework_dirs", []) - for directory in framework_dirs: - ldflags.append("-F" + directory.replace("$(SDKROOT)", sdk_root)) - - if self._IsXCTest(): - platform_root = self._XcodePlatformPath(configname) - if sdk_root and platform_root: - ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") - ldflags.append("-framework XCTest") - - is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() - if sdk_root and is_extension: - # Adds the link flags for extensions. These flags are common for all - # extensions and provide loader and main function. - # These flags reflect the compilation options used by xcode to compile - # extensions. - xcode_version, _ = XcodeVersion() - if xcode_version < "0900": - ldflags.append("-lpkstart") - ldflags.append( - sdk_root - + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit" - ) - else: - ldflags.append("-e _NSExtensionMain") - ldflags.append("-fapplication-extension") - - self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s") - - self.configname = None - return ldflags - - def GetLibtoolflags(self, configname): - """Returns flags that need to be passed to the static linker. - - Args: - configname: The name of the configuration to get ld flags for. - """ - self.configname = configname - libtoolflags = [] - - for libtoolflag in self._Settings().get("OTHER_LDFLAGS", []): - libtoolflags.append(libtoolflag) - # TODO(thakis): ARCHS? - - self.configname = None - return libtoolflags - - def GetPerTargetSettings(self): - """Gets a list of all the per-target settings. This will only fetch keys - whose values are the same across all configurations.""" - first_pass = True - result = {} - for configname in sorted(self.xcode_settings.keys()): - if first_pass: - result = dict(self.xcode_settings[configname]) - first_pass = False - else: - for key, value in self.xcode_settings[configname].items(): - if key not in result: - continue - elif result[key] != value: - del result[key] - return result - - def GetPerConfigSetting(self, setting, configname, default=None): - if configname in self.xcode_settings: - return self.xcode_settings[configname].get(setting, default) - else: - return self.GetPerTargetSetting(setting, default) - - def GetPerTargetSetting(self, setting, default=None): - """Tries to get xcode_settings.setting from spec. Assumes that the setting - has the same value in all configurations and throws otherwise.""" - is_first_pass = True - result = None - for configname in sorted(self.xcode_settings.keys()): - if is_first_pass: - result = self.xcode_settings[configname].get(setting, None) - is_first_pass = False - else: - assert result == self.xcode_settings[configname].get(setting, None), ( - "Expected per-target setting for '%s', got per-config setting " - "(target %s)" % (setting, self.spec["target_name"]) - ) - if result is None: - return default - return result - - def _GetStripPostbuilds(self, configname, output_binary, quiet): - """Returns a list of shell commands that contain the shell commands - necessary to strip this target's binary. These should be run as postbuilds - before the actual postbuilds run.""" - self.configname = configname - - result = [] - if self._Test("DEPLOYMENT_POSTPROCESSING", "YES", default="NO") and self._Test( - "STRIP_INSTALLED_PRODUCT", "YES", default="NO" - ): - - default_strip_style = "debugging" - if ( - self.spec["type"] == "loadable_module" or self._IsIosAppExtension() - ) and self._IsBundle(): - default_strip_style = "non-global" - elif self.spec["type"] == "executable": - default_strip_style = "all" - - strip_style = self._Settings().get("STRIP_STYLE", default_strip_style) - strip_flags = {"all": "", "non-global": "-x", "debugging": "-S"}[ - strip_style - ] - - explicit_strip_flags = self._Settings().get("STRIPFLAGS", "") - if explicit_strip_flags: - strip_flags += " " + _NormalizeEnvVarReferences(explicit_strip_flags) - - if not quiet: - result.append("echo STRIP\\(%s\\)" % self.spec["target_name"]) - result.append(f"strip {strip_flags} {output_binary}") - - self.configname = None - return result - - def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): - """Returns a list of shell commands that contain the shell commands - necessary to massage this target's debug information. These should be run - as postbuilds before the actual postbuilds run.""" - self.configname = configname - - # For static libraries, no dSYMs are created. - result = [] - if ( - self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") - and self._Test( - "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" - ) - and self.spec["type"] != "static_library" - ): - if not quiet: - result.append("echo DSYMUTIL\\(%s\\)" % self.spec["target_name"]) - result.append("dsymutil {} -o {}".format(output_binary, output + ".dSYM")) - - self.configname = None - return result - - def _GetTargetPostbuilds(self, configname, output, output_binary, quiet=False): - """Returns a list of shell commands that contain the shell commands - to run as postbuilds for this target, before the actual postbuilds.""" - # dSYMs need to build before stripping happens. - return self._GetDebugInfoPostbuilds( - configname, output, output_binary, quiet - ) + self._GetStripPostbuilds(configname, output_binary, quiet) - - def _GetIOSPostbuilds(self, configname, output_binary): - """Return a shell command to codesign the iOS output binary so it can - be deployed to a device. This should be run as the very last step of the - build.""" - if not ( - self.isIOS - and (self.spec["type"] == "executable" or self._IsXCTest()) - or self.IsIosFramework() - ): - return [] - - postbuilds = [] - product_name = self.GetFullProductName() - settings = self.xcode_settings[configname] - - # Xcode expects XCTests to be copied into the TEST_HOST dir. - if self._IsXCTest(): - source = os.path.join("${BUILT_PRODUCTS_DIR}", product_name) - test_host = os.path.dirname(settings.get("TEST_HOST")) - xctest_destination = os.path.join(test_host, "PlugIns", product_name) - postbuilds.extend([f"ditto {source} {xctest_destination}"]) - - key = self._GetIOSCodeSignIdentityKey(settings) - if not key: - return postbuilds - - # Warn for any unimplemented signing xcode keys. - unimpl = ["OTHER_CODE_SIGN_FLAGS"] - unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) - if unimpl: - print( - "Warning: Some codesign keys not implemented, ignoring: %s" - % ", ".join(sorted(unimpl)) - ) - - if self._IsXCTest(): - # For device xctests, Xcode copies two extra frameworks into $TEST_HOST. - test_host = os.path.dirname(settings.get("TEST_HOST")) - frameworks_dir = os.path.join(test_host, "Frameworks") - platform_root = self._XcodePlatformPath(configname) - frameworks = [ - "Developer/Library/PrivateFrameworks/IDEBundleInjection.framework", - "Developer/Library/Frameworks/XCTest.framework", - ] - for framework in frameworks: - source = os.path.join(platform_root, framework) - destination = os.path.join(frameworks_dir, os.path.basename(framework)) - postbuilds.extend([f"ditto {source} {destination}"]) - - # Then re-sign everything with 'preserve=True' - postbuilds.extend( - [ - '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' - % ( - os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), - key, - settings.get("CODE_SIGN_ENTITLEMENTS", ""), - settings.get("PROVISIONING_PROFILE", ""), - destination, - True, - ) - ] - ) - plugin_dir = os.path.join(test_host, "PlugIns") - targets = [os.path.join(plugin_dir, product_name), test_host] - for target in targets: - postbuilds.extend( - [ - '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' - % ( - os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), - key, - settings.get("CODE_SIGN_ENTITLEMENTS", ""), - settings.get("PROVISIONING_PROFILE", ""), - target, - True, - ) - ] - ) - - postbuilds.extend( - [ - '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' - % ( - os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), - key, - settings.get("CODE_SIGN_ENTITLEMENTS", ""), - settings.get("PROVISIONING_PROFILE", ""), - os.path.join("${BUILT_PRODUCTS_DIR}", product_name), - False, - ) - ] - ) - return postbuilds - - def _GetIOSCodeSignIdentityKey(self, settings): - identity = settings.get("CODE_SIGN_IDENTITY") - if not identity: - return None - if identity not in XcodeSettings._codesigning_key_cache: - output = subprocess.check_output( - ["security", "find-identity", "-p", "codesigning", "-v"] - ) - for line in output.splitlines(): - if identity in line: - fingerprint = line.split()[1] - cache = XcodeSettings._codesigning_key_cache - assert identity not in cache or fingerprint == cache[identity], ( - "Multiple codesigning fingerprints for identity: %s" % identity - ) - XcodeSettings._codesigning_key_cache[identity] = fingerprint - return XcodeSettings._codesigning_key_cache.get(identity, "") - - def AddImplicitPostbuilds( - self, configname, output, output_binary, postbuilds=[], quiet=False - ): - """Returns a list of shell commands that should run before and after - |postbuilds|.""" - assert output_binary is not None - pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) - post = self._GetIOSPostbuilds(configname, output_binary) - return pre + postbuilds + post - - def _AdjustLibrary(self, library, config_name=None): - if library.endswith(".framework"): - l_flag = "-framework " + os.path.splitext(os.path.basename(library))[0] - else: - m = self.library_re.match(library) - if m: - l_flag = "-l" + m.group(1) - else: - l_flag = library - - sdk_root = self._SdkPath(config_name) - if not sdk_root: - sdk_root = "" - # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of - # ".dylib" without providing a real support for them. What it does, for - # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the - # library order and cause collision when building Chrome. - # - # Instead substitute ".tbd" to ".dylib" in the generated project when the - # following conditions are both true: - # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", - # - the ".dylib" file does not exists but a ".tbd" file do. - library = l_flag.replace("$(SDKROOT)", sdk_root) - if l_flag.startswith("$(SDKROOT)"): - basename, ext = os.path.splitext(library) - if ext == ".dylib" and not os.path.exists(library): - tbd_library = basename + ".tbd" - if os.path.exists(tbd_library): - library = tbd_library - return library - - def AdjustLibraries(self, libraries, config_name=None): - """Transforms entries like 'Cocoa.framework' in libraries into entries like - '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. - """ - libraries = [self._AdjustLibrary(library, config_name) for library in libraries] - return libraries - - def _BuildMachineOSBuild(self): - return GetStdout(["sw_vers", "-buildVersion"]) - - def _XcodeIOSDeviceFamily(self, configname): - family = self.xcode_settings[configname].get("TARGETED_DEVICE_FAMILY", "1") - return [int(x) for x in family.split(",")] - - def GetExtraPlistItems(self, configname=None): - """Returns a dictionary with extra items to insert into Info.plist.""" - if configname not in XcodeSettings._plist_cache: - cache = {} - cache["BuildMachineOSBuild"] = self._BuildMachineOSBuild() - - xcode_version, xcode_build = XcodeVersion() - cache["DTXcode"] = xcode_version - cache["DTXcodeBuild"] = xcode_build - compiler = self.xcode_settings[configname].get("GCC_VERSION") - if compiler is not None: - cache["DTCompiler"] = compiler - - sdk_root = self._SdkRoot(configname) - if not sdk_root: - sdk_root = self._DefaultSdkRoot() - sdk_version = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-version") - cache["DTSDKName"] = sdk_root + (sdk_version or "") - if xcode_version >= "0720": - cache["DTSDKBuild"] = self._GetSdkVersionInfoItem( - sdk_root, "--show-sdk-build-version" - ) - elif xcode_version >= "0430": - cache["DTSDKBuild"] = sdk_version - else: - cache["DTSDKBuild"] = cache["BuildMachineOSBuild"] - - if self.isIOS: - cache["MinimumOSVersion"] = self.xcode_settings[configname].get( - "IPHONEOS_DEPLOYMENT_TARGET" - ) - cache["DTPlatformName"] = sdk_root - cache["DTPlatformVersion"] = sdk_version - - if configname.endswith("iphoneos"): - cache["CFBundleSupportedPlatforms"] = ["iPhoneOS"] - cache["DTPlatformBuild"] = cache["DTSDKBuild"] - else: - cache["CFBundleSupportedPlatforms"] = ["iPhoneSimulator"] - # This is weird, but Xcode sets DTPlatformBuild to an empty field - # for simulator builds. - cache["DTPlatformBuild"] = "" - XcodeSettings._plist_cache[configname] = cache - - # Include extra plist items that are per-target, not per global - # XcodeSettings. - items = dict(XcodeSettings._plist_cache[configname]) - if self.isIOS: - items["UIDeviceFamily"] = self._XcodeIOSDeviceFamily(configname) - return items - - def _DefaultSdkRoot(self): - """Returns the default SDKROOT to use. - - Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode - project, then the environment variable was empty. Starting with this - version, Xcode uses the name of the newest SDK installed. - """ - xcode_version, _ = XcodeVersion() - if xcode_version < "0500": - return "" - default_sdk_path = self._XcodeSdkPath("") - default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) - if default_sdk_root: - return default_sdk_root - try: - all_sdks = GetStdout(["xcodebuild", "-showsdks"]) - except GypError: - # If xcodebuild fails, there will be no valid SDKs - return "" - for line in all_sdks.splitlines(): - items = line.split() - if len(items) >= 3 and items[-2] == "-sdk": - sdk_root = items[-1] - sdk_path = self._XcodeSdkPath(sdk_root) - if sdk_path == default_sdk_path: - return sdk_root - return "" - - -class MacPrefixHeader: - """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. - - This feature consists of several pieces: - * If GCC_PREFIX_HEADER is present, all compilations in that project get an - additional |-include path_to_prefix_header| cflag. - * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is - instead compiled, and all other compilations in the project get an - additional |-include path_to_compiled_header| instead. - + Compiled prefix headers have the extension gch. There is one gch file for - every language used in the project (c, cc, m, mm), since gch files for - different languages aren't compatible. - + gch files themselves are built with the target's normal cflags, but they - obviously don't get the |-include| flag. Instead, they need a -x flag that - describes their language. - + All o files in the target need to depend on the gch file, to make sure - it's built before any o file is built. - - This class helps with some of these tasks, but it needs help from the build - system for writing dependencies to the gch files, for writing build commands - for the gch files, and for figuring out the location of the gch files. - """ - - def __init__( - self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output - ): - """If xcode_settings is None, all methods on this class are no-ops. - - Args: - gyp_path_to_build_path: A function that takes a gyp-relative path, - and returns a path relative to the build directory. - gyp_path_to_build_output: A function that takes a gyp-relative path and - a language code ('c', 'cc', 'm', or 'mm'), and that returns a path - to where the output of precompiling that path for that language - should be placed (without the trailing '.gch'). - """ - # This doesn't support per-configuration prefix headers. Good enough - # for now. - self.header = None - self.compile_headers = False - if xcode_settings: - self.header = xcode_settings.GetPerTargetSetting("GCC_PREFIX_HEADER") - self.compile_headers = ( - xcode_settings.GetPerTargetSetting( - "GCC_PRECOMPILE_PREFIX_HEADER", default="NO" - ) - != "NO" - ) - self.compiled_headers = {} - if self.header: - if self.compile_headers: - for lang in ["c", "cc", "m", "mm"]: - self.compiled_headers[lang] = gyp_path_to_build_output( - self.header, lang - ) - self.header = gyp_path_to_build_path(self.header) - - def _CompiledHeader(self, lang, arch): - assert self.compile_headers - h = self.compiled_headers[lang] - if arch: - h += "." + arch - return h - - def GetInclude(self, lang, arch=None): - """Gets the cflags to include the prefix header for language |lang|.""" - if self.compile_headers and lang in self.compiled_headers: - return "-include %s" % self._CompiledHeader(lang, arch) - elif self.header: - return "-include %s" % self.header - else: - return "" - - def _Gch(self, lang, arch): - """Returns the actual file name of the prefix header for language |lang|.""" - assert self.compile_headers - return self._CompiledHeader(lang, arch) + ".gch" - - def GetObjDependencies(self, sources, objs, arch=None): - """Given a list of source files and the corresponding object files, returns - a list of (source, object, gch) tuples, where |gch| is the build-directory - relative path to the gch file each object file depends on. |compilable[i]| - has to be the source file belonging to |objs[i]|.""" - if not self.header or not self.compile_headers: - return [] - - result = [] - for source, obj in zip(sources, objs): - ext = os.path.splitext(source)[1] - lang = { - ".c": "c", - ".cpp": "cc", - ".cc": "cc", - ".cxx": "cc", - ".m": "m", - ".mm": "mm", - }.get(ext, None) - if lang: - result.append((source, obj, self._Gch(lang, arch))) - return result - - def GetPchBuildCommands(self, arch=None): - """Returns [(path_to_gch, language_flag, language, header)]. - |path_to_gch| and |header| are relative to the build directory. - """ - if not self.header or not self.compile_headers: - return [] - return [ - (self._Gch("c", arch), "-x c-header", "c", self.header), - (self._Gch("cc", arch), "-x c++-header", "cc", self.header), - (self._Gch("m", arch), "-x objective-c-header", "m", self.header), - (self._Gch("mm", arch), "-x objective-c++-header", "mm", self.header), - ] - - -def XcodeVersion(): - """Returns a tuple of version and build version of installed Xcode.""" - # `xcodebuild -version` output looks like - # Xcode 4.6.3 - # Build version 4H1503 - # or like - # Xcode 3.2.6 - # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 - # BuildVersion: 10M2518 - # Convert that to ('0463', '4H1503') or ('0326', '10M2518'). - global XCODE_VERSION_CACHE - if XCODE_VERSION_CACHE: - return XCODE_VERSION_CACHE - version = "" - build = "" - try: - version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines() - # In some circumstances xcodebuild exits 0 but doesn't return - # the right results; for example, a user on 10.7 or 10.8 with - # a bogus path set via xcode-select - # In that case this may be a CLT-only install so fall back to - # checking that version. - if len(version_list) < 2: - raise GypError("xcodebuild returned unexpected results") - version = version_list[0].split()[-1] # Last word on first line - build = version_list[-1].split()[-1] # Last word on last line - except GypError: # Xcode not installed so look for XCode Command Line Tools - version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322 - if not version: - raise GypError("No Xcode or CLT version detected!") - # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100": - version = version.split(".")[:3] # Just major, minor, micro - version[0] = version[0].zfill(2) # Add a leading zero if major is one digit - version = ("".join(version) + "00")[:4] # Limit to exactly four characters - XCODE_VERSION_CACHE = (version, build) - return XCODE_VERSION_CACHE - - -# This function ported from the logic in Homebrew's CLT version check -def CLTVersion(): - """Returns the version of command-line tools from pkgutil.""" - # pkgutil output looks like - # package-id: com.apple.pkg.CLTools_Executables - # version: 5.0.1.0.1.1382131676 - # volume: / - # location: / - # install-time: 1382544035 - # groups: com.apple.FindSystemFiles.pkg-group - # com.apple.DevToolsBoth.pkg-group - # com.apple.DevToolsNonRelocatableShared.pkg-group - STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" - FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" - MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" - - regex = re.compile("version: (?P.+)") - for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: - try: - output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key]) - return re.search(regex, output).groupdict()["version"] - except GypError: - continue - - regex = re.compile(r'Command Line Tools for Xcode\s+(?P\S+)') - try: - output = GetStdout(["/usr/sbin/softwareupdate", "--history"]) - return re.search(regex, output).groupdict()["version"] - except GypError: - return None - - -def GetStdoutQuiet(cmdlist): - """Returns the content of standard output returned by invoking |cmdlist|. - Ignores the stderr. - Raises |GypError| if the command return with a non-zero return code.""" - job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out = job.communicate()[0].decode("utf-8") - if job.returncode != 0: - raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) - return out.rstrip("\n") - - -def GetStdout(cmdlist): - """Returns the content of standard output returned by invoking |cmdlist|. - Raises |GypError| if the command return with a non-zero return code.""" - job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) - out = job.communicate()[0].decode("utf-8") - if job.returncode != 0: - sys.stderr.write(out + "\n") - raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) - return out.rstrip("\n") - - -def MergeGlobalXcodeSettingsToSpec(global_dict, spec): - """Merges the global xcode_settings dictionary into each configuration of the - target represented by spec. For keys that are both in the global and the local - xcode_settings dict, the local key gets precedence. - """ - # The xcode generator special-cases global xcode_settings and does something - # that amounts to merging in the global xcode_settings into each local - # xcode_settings dict. - global_xcode_settings = global_dict.get("xcode_settings", {}) - for config in spec["configurations"].values(): - if "xcode_settings" in config: - new_settings = global_xcode_settings.copy() - new_settings.update(config["xcode_settings"]) - config["xcode_settings"] = new_settings - - -def IsMacBundle(flavor, spec): - """Returns if |spec| should be treated as a bundle. - - Bundles are directories with a certain subdirectory structure, instead of - just a single file. Bundle rules do not produce a binary but also package - resources into that directory.""" - is_mac_bundle = ( - int(spec.get("mac_xctest_bundle", 0)) != 0 - or int(spec.get("mac_xcuitest_bundle", 0)) != 0 - or (int(spec.get("mac_bundle", 0)) != 0 and flavor == "mac") - ) - - if is_mac_bundle: - assert spec["type"] != "none", ( - 'mac_bundle targets cannot have type none (target "%s")' - % spec["target_name"] - ) - return is_mac_bundle - - -def GetMacBundleResources(product_dir, xcode_settings, resources): - """Yields (output, resource) pairs for every resource in |resources|. - Only call this for mac bundle targets. - - Args: - product_dir: Path to the directory containing the output bundle, - relative to the build directory. - xcode_settings: The XcodeSettings of the current target. - resources: A list of bundle resources, relative to the build directory. - """ - dest = os.path.join(product_dir, xcode_settings.GetBundleResourceFolder()) - for res in resources: - output = dest - - # The make generator doesn't support it, so forbid it everywhere - # to keep the generators more interchangeable. - assert " " not in res, "Spaces in resource filenames not supported (%s)" % res - - # Split into (path,file). - res_parts = os.path.split(res) - - # Now split the path into (prefix,maybe.lproj). - lproj_parts = os.path.split(res_parts[0]) - # If the resource lives in a .lproj bundle, add that to the destination. - if lproj_parts[1].endswith(".lproj"): - output = os.path.join(output, lproj_parts[1]) - - output = os.path.join(output, res_parts[1]) - # Compiled XIB files are referred to by .nib. - if output.endswith(".xib"): - output = os.path.splitext(output)[0] + ".nib" - # Compiled storyboard files are referred to by .storyboardc. - if output.endswith(".storyboard"): - output = os.path.splitext(output)[0] + ".storyboardc" - - yield output, res - - -def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): - """Returns (info_plist, dest_plist, defines, extra_env), where: - * |info_plist| is the source plist path, relative to the - build directory, - * |dest_plist| is the destination plist path, relative to the - build directory, - * |defines| is a list of preprocessor defines (empty if the plist - shouldn't be preprocessed, - * |extra_env| is a dict of env variables that should be exported when - invoking |mac_tool copy-info-plist|. - - Only call this for mac bundle targets. - - Args: - product_dir: Path to the directory containing the output bundle, - relative to the build directory. - xcode_settings: The XcodeSettings of the current target. - gyp_to_build_path: A function that converts paths relative to the - current gyp file to paths relative to the build directory. - """ - info_plist = xcode_settings.GetPerTargetSetting("INFOPLIST_FILE") - if not info_plist: - return None, None, [], {} - - # The make generator doesn't support it, so forbid it everywhere - # to keep the generators more interchangeable. - assert " " not in info_plist, ( - "Spaces in Info.plist filenames not supported (%s)" % info_plist - ) - - info_plist = gyp_path_to_build_path(info_plist) - - # If explicitly set to preprocess the plist, invoke the C preprocessor and - # specify any defines as -D flags. - if ( - xcode_settings.GetPerTargetSetting("INFOPLIST_PREPROCESS", default="NO") - == "YES" - ): - # Create an intermediate file based on the path. - defines = shlex.split( - xcode_settings.GetPerTargetSetting( - "INFOPLIST_PREPROCESSOR_DEFINITIONS", default="" - ) - ) - else: - defines = [] - - dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) - extra_env = xcode_settings.GetPerTargetSettings() - - return info_plist, dest_plist, defines, extra_env - - -def _GetXcodeEnv( - xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None -): - """Return the environment variables that Xcode would set. See - http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 - for a full list. - - Args: - xcode_settings: An XcodeSettings object. If this is None, this function - returns an empty dict. - built_products_dir: Absolute path to the built products dir. - srcroot: Absolute path to the source root. - configuration: The build configuration name. - additional_settings: An optional dict with more values to add to the - result. - """ - - if not xcode_settings: - return {} - - # This function is considered a friend of XcodeSettings, so let it reach into - # its implementation details. - spec = xcode_settings.spec - - # These are filled in on an as-needed basis. - env = { - "BUILT_FRAMEWORKS_DIR": built_products_dir, - "BUILT_PRODUCTS_DIR": built_products_dir, - "CONFIGURATION": configuration, - "PRODUCT_NAME": xcode_settings.GetProductName(), - # For FULL_PRODUCT_NAME see: - # /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec # noqa: E501 - "SRCROOT": srcroot, - "SOURCE_ROOT": "${SRCROOT}", - # This is not true for static libraries, but currently the env is only - # written for bundles: - "TARGET_BUILD_DIR": built_products_dir, - "TEMP_DIR": "${TMPDIR}", - "XCODE_VERSION_ACTUAL": XcodeVersion()[0], - } - if xcode_settings.GetPerConfigSetting("SDKROOT", configuration): - env["SDKROOT"] = xcode_settings._SdkPath(configuration) - else: - env["SDKROOT"] = "" - - if xcode_settings.mac_toolchain_dir: - env["DEVELOPER_DIR"] = xcode_settings.mac_toolchain_dir - - if spec["type"] in ( - "executable", - "static_library", - "shared_library", - "loadable_module", - ): - env["EXECUTABLE_NAME"] = xcode_settings.GetExecutableName() - env["EXECUTABLE_PATH"] = xcode_settings.GetExecutablePath() - env["FULL_PRODUCT_NAME"] = xcode_settings.GetFullProductName() - mach_o_type = xcode_settings.GetMachOType() - if mach_o_type: - env["MACH_O_TYPE"] = mach_o_type - env["PRODUCT_TYPE"] = xcode_settings.GetProductType() - if xcode_settings._IsBundle(): - # xcodeproj_file.py sets the same Xcode subfolder value for this as for - # FRAMEWORKS_FOLDER_PATH so Xcode builds will actually use FFP's value. - env["BUILT_FRAMEWORKS_DIR"] = os.path.join( - built_products_dir + os.sep + xcode_settings.GetBundleFrameworksFolderPath() - ) - env["CONTENTS_FOLDER_PATH"] = xcode_settings.GetBundleContentsFolderPath() - env["EXECUTABLE_FOLDER_PATH"] = xcode_settings.GetBundleExecutableFolderPath() - env[ - "UNLOCALIZED_RESOURCES_FOLDER_PATH" - ] = xcode_settings.GetBundleResourceFolder() - env["JAVA_FOLDER_PATH"] = xcode_settings.GetBundleJavaFolderPath() - env["FRAMEWORKS_FOLDER_PATH"] = xcode_settings.GetBundleFrameworksFolderPath() - env[ - "SHARED_FRAMEWORKS_FOLDER_PATH" - ] = xcode_settings.GetBundleSharedFrameworksFolderPath() - env[ - "SHARED_SUPPORT_FOLDER_PATH" - ] = xcode_settings.GetBundleSharedSupportFolderPath() - env["PLUGINS_FOLDER_PATH"] = xcode_settings.GetBundlePlugInsFolderPath() - env["XPCSERVICES_FOLDER_PATH"] = xcode_settings.GetBundleXPCServicesFolderPath() - env["INFOPLIST_PATH"] = xcode_settings.GetBundlePlistPath() - env["WRAPPER_NAME"] = xcode_settings.GetWrapperName() - - install_name = xcode_settings.GetInstallName() - if install_name: - env["LD_DYLIB_INSTALL_NAME"] = install_name - install_name_base = xcode_settings.GetInstallNameBase() - if install_name_base: - env["DYLIB_INSTALL_NAME_BASE"] = install_name_base - xcode_version, _ = XcodeVersion() - if xcode_version >= "0500" and not env.get("SDKROOT"): - sdk_root = xcode_settings._SdkRoot(configuration) - if not sdk_root: - sdk_root = xcode_settings._XcodeSdkPath("") - if sdk_root is None: - sdk_root = "" - env["SDKROOT"] = sdk_root - - if not additional_settings: - additional_settings = {} - else: - # Flatten lists to strings. - for k in additional_settings: - if not isinstance(additional_settings[k], str): - additional_settings[k] = " ".join(additional_settings[k]) - additional_settings.update(env) - - for k in additional_settings: - additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) - - return additional_settings - - -def _NormalizeEnvVarReferences(str): - """Takes a string containing variable references in the form ${FOO}, $(FOO), - or $FOO, and returns a string with all variable references in the form ${FOO}. - """ - # $FOO -> ${FOO} - str = re.sub(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", r"${\1}", str) - - # $(FOO) -> ${FOO} - matches = re.findall(r"(\$\(([a-zA-Z0-9\-_]+)\))", str) - for match in matches: - to_replace, variable = match - assert "$(" not in match, "$($(FOO)) variables not supported: " + match - str = str.replace(to_replace, "${" + variable + "}") - - return str - - -def ExpandEnvVars(string, expansions): - """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the - expansions list. If the variable expands to something that references - another variable, this variable is expanded as well if it's in env -- - until no variables present in env are left.""" - for k, v in reversed(expansions): - string = string.replace("${" + k + "}", v) - string = string.replace("$(" + k + ")", v) - string = string.replace("$" + k, v) - return string - - -def _TopologicallySortedEnvVarKeys(env): - """Takes a dict |env| whose values are strings that can refer to other keys, - for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of - env such that key2 is after key1 in L if env[key2] refers to env[key1]. - - Throws an Exception in case of dependency cycles. - """ - # Since environment variables can refer to other variables, the evaluation - # order is important. Below is the logic to compute the dependency graph - # and sort it. - regex = re.compile(r"\$\{([a-zA-Z0-9\-_]+)\}") - - def GetEdges(node): - # Use a definition of edges such that user_of_variable -> used_varible. - # This happens to be easier in this case, since a variable's - # definition contains all variables it references in a single string. - # We can then reverse the result of the topological sort at the end. - # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) - matches = {v for v in regex.findall(env[node]) if v in env} - for dependee in matches: - assert "${" not in dependee, "Nested variables not supported: " + dependee - return matches - - try: - # Topologically sort, and then reverse, because we used an edge definition - # that's inverted from the expected result of this function (see comment - # above). - order = gyp.common.TopologicallySorted(env.keys(), GetEdges) - order.reverse() - return order - except gyp.common.CycleError as e: - raise GypError( - "Xcode environment variables are cyclically dependent: " + str(e.nodes) - ) - - -def GetSortedXcodeEnv( - xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None -): - env = _GetXcodeEnv( - xcode_settings, built_products_dir, srcroot, configuration, additional_settings - ) - return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] - - -def GetSpecPostbuildCommands(spec, quiet=False): - """Returns the list of postbuilds explicitly defined on |spec|, in a form - executable by a shell.""" - postbuilds = [] - for postbuild in spec.get("postbuilds", []): - if not quiet: - postbuilds.append( - "echo POSTBUILD\\(%s\\) %s" - % (spec["target_name"], postbuild["postbuild_name"]) - ) - postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild["action"])) - return postbuilds - - -def _HasIOSTarget(targets): - """Returns true if any target contains the iOS specific key - IPHONEOS_DEPLOYMENT_TARGET.""" - for target_dict in targets.values(): - for config in target_dict["configurations"].values(): - if config.get("xcode_settings", {}).get("IPHONEOS_DEPLOYMENT_TARGET"): - return True - return False - - -def _AddIOSDeviceConfigurations(targets): - """Clone all targets and append -iphoneos to the name. Configure these targets - to build for iOS devices and use correct architectures for those builds.""" - for target_dict in targets.values(): - toolset = target_dict["toolset"] - configs = target_dict["configurations"] - for config_name, simulator_config_dict in dict(configs).items(): - iphoneos_config_dict = copy.deepcopy(simulator_config_dict) - configs[config_name + "-iphoneos"] = iphoneos_config_dict - configs[config_name + "-iphonesimulator"] = simulator_config_dict - if toolset == "target": - simulator_config_dict["xcode_settings"]["SDKROOT"] = "iphonesimulator" - iphoneos_config_dict["xcode_settings"]["SDKROOT"] = "iphoneos" - return targets - - -def CloneConfigurationForDeviceAndEmulator(target_dicts): - """If |target_dicts| contains any iOS targets, automatically create -iphoneos - targets for iOS device builds.""" - if _HasIOSTarget(target_dicts): - return _AddIOSDeviceConfigurations(target_dicts) - return target_dicts diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py deleted file mode 100644 index bb74eacbe..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +++ /dev/null @@ -1,302 +0,0 @@ -# Copyright (c) 2014 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Xcode-ninja wrapper project file generator. - -This updates the data structures passed to the Xcode gyp generator to build -with ninja instead. The Xcode project itself is transformed into a list of -executable targets, each with a build step to build with ninja, and a target -with every source and resource file. This appears to sidestep some of the -major performance headaches experienced using complex projects and large number -of targets within Xcode. -""" - -import errno -import gyp.generator.ninja -import os -import re -import xml.sax.saxutils - - -def _WriteWorkspace(main_gyp, sources_gyp, params): - """ Create a workspace to wrap main and sources gyp paths. """ - (build_file_root, build_file_ext) = os.path.splitext(main_gyp) - workspace_path = build_file_root + ".xcworkspace" - options = params["options"] - if options.generator_output: - workspace_path = os.path.join(options.generator_output, workspace_path) - try: - os.makedirs(workspace_path) - except OSError as e: - if e.errno != errno.EEXIST: - raise - output_string = ( - '\n' + '\n' - ) - for gyp_name in [main_gyp, sources_gyp]: - name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj" - name = xml.sax.saxutils.quoteattr("group:" + name) - output_string += " \n" % name - output_string += "\n" - - workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata") - - try: - with open(workspace_file) as input_file: - input_string = input_file.read() - if input_string == output_string: - return - except OSError: - # Ignore errors if the file doesn't exist. - pass - - with open(workspace_file, "w") as output_file: - output_file.write(output_string) - - -def _TargetFromSpec(old_spec, params): - """ Create fake target for xcode-ninja wrapper. """ - # Determine ninja top level build dir (e.g. /path/to/out). - ninja_toplevel = None - jobs = 0 - if params: - options = params["options"] - ninja_toplevel = os.path.join( - options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params) - ) - jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0) - - target_name = old_spec.get("target_name") - product_name = old_spec.get("product_name", target_name) - product_extension = old_spec.get("product_extension") - - ninja_target = {} - ninja_target["target_name"] = target_name - ninja_target["product_name"] = product_name - if product_extension: - ninja_target["product_extension"] = product_extension - ninja_target["toolset"] = old_spec.get("toolset") - ninja_target["default_configuration"] = old_spec.get("default_configuration") - ninja_target["configurations"] = {} - - # Tell Xcode to look in |ninja_toplevel| for build products. - new_xcode_settings = {} - if ninja_toplevel: - new_xcode_settings["CONFIGURATION_BUILD_DIR"] = ( - "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel - ) - - if "configurations" in old_spec: - for config in old_spec["configurations"]: - old_xcode_settings = old_spec["configurations"][config].get( - "xcode_settings", {} - ) - if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings: - new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO" - new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[ - "IPHONEOS_DEPLOYMENT_TARGET" - ] - for key in ["BUNDLE_LOADER", "TEST_HOST"]: - if key in old_xcode_settings: - new_xcode_settings[key] = old_xcode_settings[key] - - ninja_target["configurations"][config] = {} - ninja_target["configurations"][config][ - "xcode_settings" - ] = new_xcode_settings - - ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0) - ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0) - ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0) - ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0) - ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0) - ninja_target["type"] = old_spec["type"] - if ninja_toplevel: - ninja_target["actions"] = [ - { - "action_name": "Compile and copy %s via ninja" % target_name, - "inputs": [], - "outputs": [], - "action": [ - "env", - "PATH=%s" % os.environ["PATH"], - "ninja", - "-C", - new_xcode_settings["CONFIGURATION_BUILD_DIR"], - target_name, - ], - "message": "Compile and copy %s via ninja" % target_name, - }, - ] - if jobs > 0: - ninja_target["actions"][0]["action"].extend(("-j", jobs)) - return ninja_target - - -def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): - """Limit targets for Xcode wrapper. - - Xcode sometimes performs poorly with too many targets, so only include - proper executable targets, with filters to customize. - Arguments: - target_extras: Regular expression to always add, matching any target. - executable_target_pattern: Regular expression limiting executable targets. - spec: Specifications for target. - """ - target_name = spec.get("target_name") - # Always include targets matching target_extras. - if target_extras is not None and re.search(target_extras, target_name): - return True - - # Otherwise just show executable targets and xc_tests. - if int(spec.get("mac_xctest_bundle", 0)) != 0 or ( - spec.get("type", "") == "executable" - and spec.get("product_extension", "") != "bundle" - ): - - # If there is a filter and the target does not match, exclude the target. - if executable_target_pattern is not None: - if not re.search(executable_target_pattern, target_name): - return False - return True - return False - - -def CreateWrapper(target_list, target_dicts, data, params): - """Initialize targets for the ninja wrapper. - - This sets up the necessary variables in the targets to generate Xcode projects - that use ninja as an external builder. - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - data: Dict of flattened build files keyed on gyp path. - params: Dict of global options for gyp. - """ - orig_gyp = params["build_files"][0] - for gyp_name, gyp_dict in data.items(): - if gyp_name == orig_gyp: - depth = gyp_dict["_DEPTH"] - - # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE - # and prepend .ninja before the .gyp extension. - generator_flags = params.get("generator_flags", {}) - main_gyp = generator_flags.get("xcode_ninja_main_gyp", None) - if main_gyp is None: - (build_file_root, build_file_ext) = os.path.splitext(orig_gyp) - main_gyp = build_file_root + ".ninja" + build_file_ext - - # Create new |target_list|, |target_dicts| and |data| data structures. - new_target_list = [] - new_target_dicts = {} - new_data = {} - - # Set base keys needed for |data|. - new_data[main_gyp] = {} - new_data[main_gyp]["included_files"] = [] - new_data[main_gyp]["targets"] = [] - new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) - - # Normally the xcode-ninja generator includes only valid executable targets. - # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to - # executable targets that match the pattern. (Default all) - executable_target_pattern = generator_flags.get( - "xcode_ninja_executable_target_pattern", None - ) - - # For including other non-executable targets, add the matching target name - # to the |xcode_ninja_target_pattern| regular expression. (Default none) - target_extras = generator_flags.get("xcode_ninja_target_pattern", None) - - for old_qualified_target in target_list: - spec = target_dicts[old_qualified_target] - if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): - # Add to new_target_list. - target_name = spec.get("target_name") - new_target_name = f"{main_gyp}:{target_name}#target" - new_target_list.append(new_target_name) - - # Add to new_target_dicts. - new_target_dicts[new_target_name] = _TargetFromSpec(spec, params) - - # Add to new_data. - for old_target in data[old_qualified_target.split(":")[0]]["targets"]: - if old_target["target_name"] == target_name: - new_data_target = {} - new_data_target["target_name"] = old_target["target_name"] - new_data_target["toolset"] = old_target["toolset"] - new_data[main_gyp]["targets"].append(new_data_target) - - # Create sources target. - sources_target_name = "sources_for_indexing" - sources_target = _TargetFromSpec( - { - "target_name": sources_target_name, - "toolset": "target", - "default_configuration": "Default", - "mac_bundle": "0", - "type": "executable", - }, - None, - ) - - # Tell Xcode to look everywhere for headers. - sources_target["configurations"] = {"Default": {"include_dirs": [depth]}} - - # Put excluded files into the sources target so they can be opened in Xcode. - skip_excluded_files = not generator_flags.get( - "xcode_ninja_list_excluded_files", True - ) - - sources = [] - for target, target_dict in target_dicts.items(): - base = os.path.dirname(target) - files = target_dict.get("sources", []) + target_dict.get( - "mac_bundle_resources", [] - ) - - if not skip_excluded_files: - files.extend( - target_dict.get("sources_excluded", []) - + target_dict.get("mac_bundle_resources_excluded", []) - ) - - for action in target_dict.get("actions", []): - files.extend(action.get("inputs", [])) - - if not skip_excluded_files: - files.extend(action.get("inputs_excluded", [])) - - # Remove files starting with $. These are mostly intermediate files for the - # build system. - files = [file for file in files if not file.startswith("$")] - - # Make sources relative to root build file. - relative_path = os.path.dirname(main_gyp) - sources += [ - os.path.relpath(os.path.join(base, file), relative_path) for file in files - ] - - sources_target["sources"] = sorted(set(sources)) - - # Put sources_to_index in it's own gyp. - sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp") - fully_qualified_target_name = f"{sources_gyp}:{sources_target_name}#target" - - # Add to new_target_list, new_target_dicts and new_data. - new_target_list.append(fully_qualified_target_name) - new_target_dicts[fully_qualified_target_name] = sources_target - new_data_target = {} - new_data_target["target_name"] = sources_target["target_name"] - new_data_target["_DEPTH"] = depth - new_data_target["toolset"] = "target" - new_data[sources_gyp] = {} - new_data[sources_gyp]["targets"] = [] - new_data[sources_gyp]["included_files"] = [] - new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) - new_data[sources_gyp]["targets"].append(new_data_target) - - # Write workspace to file. - _WriteWorkspace(main_gyp, sources_gyp, params) - return (new_target_list, new_target_dicts, new_data) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py deleted file mode 100644 index 076eea372..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +++ /dev/null @@ -1,3197 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Xcode project file generator. - -This module is both an Xcode project file generator and a documentation of the -Xcode project file format. Knowledge of the project file format was gained -based on extensive experience with Xcode, and by making changes to projects in -Xcode.app and observing the resultant changes in the associated project files. - -XCODE PROJECT FILES - -The generator targets the file format as written by Xcode 3.2 (specifically, -3.2.6), but past experience has taught that the format has not changed -significantly in the past several years, and future versions of Xcode are able -to read older project files. - -Xcode project files are "bundled": the project "file" from an end-user's -perspective is actually a directory with an ".xcodeproj" extension. The -project file from this module's perspective is actually a file inside this -directory, always named "project.pbxproj". This file contains a complete -description of the project and is all that is needed to use the xcodeproj. -Other files contained in the xcodeproj directory are simply used to store -per-user settings, such as the state of various UI elements in the Xcode -application. - -The project.pbxproj file is a property list, stored in a format almost -identical to the NeXTstep property list format. The file is able to carry -Unicode data, and is encoded in UTF-8. The root element in the property list -is a dictionary that contains several properties of minimal interest, and two -properties of immense interest. The most important property is a dictionary -named "objects". The entire structure of the project is represented by the -children of this property. The objects dictionary is keyed by unique 96-bit -values represented by 24 uppercase hexadecimal characters. Each value in the -objects dictionary is itself a dictionary, describing an individual object. - -Each object in the dictionary is a member of a class, which is identified by -the "isa" property of each object. A variety of classes are represented in a -project file. Objects can refer to other objects by ID, using the 24-character -hexadecimal object key. A project's objects form a tree, with a root object -of class PBXProject at the root. As an example, the PBXProject object serves -as parent to an XCConfigurationList object defining the build configurations -used in the project, a PBXGroup object serving as a container for all files -referenced in the project, and a list of target objects, each of which defines -a target in the project. There are several different types of target object, -such as PBXNativeTarget and PBXAggregateTarget. In this module, this -relationship is expressed by having each target type derive from an abstract -base named XCTarget. - -The project.pbxproj file's root dictionary also contains a property, sibling to -the "objects" dictionary, named "rootObject". The value of rootObject is a -24-character object key referring to the root PBXProject object in the -objects dictionary. - -In Xcode, every file used as input to a target or produced as a final product -of a target must appear somewhere in the hierarchy rooted at the PBXGroup -object referenced by the PBXProject's mainGroup property. A PBXGroup is -generally represented as a folder in the Xcode application. PBXGroups can -contain other PBXGroups as well as PBXFileReferences, which are pointers to -actual files. - -Each XCTarget contains a list of build phases, represented in this module by -the abstract base XCBuildPhase. Examples of concrete XCBuildPhase derivations -are PBXSourcesBuildPhase and PBXFrameworksBuildPhase, which correspond to the -"Compile Sources" and "Link Binary With Libraries" phases displayed in the -Xcode application. Files used as input to these phases (for example, source -files in the former case and libraries and frameworks in the latter) are -represented by PBXBuildFile objects, referenced by elements of "files" lists -in XCTarget objects. Each PBXBuildFile object refers to a PBXBuildFile -object as a "weak" reference: it does not "own" the PBXBuildFile, which is -owned by the root object's mainGroup or a descendant group. In most cases, the -layer of indirection between an XCBuildPhase and a PBXFileReference via a -PBXBuildFile appears extraneous, but there's actually one reason for this: -file-specific compiler flags are added to the PBXBuildFile object so as to -allow a single file to be a member of multiple targets while having distinct -compiler flags for each. These flags can be modified in the Xcode applciation -in the "Build" tab of a File Info window. - -When a project is open in the Xcode application, Xcode will rewrite it. As -such, this module is careful to adhere to the formatting used by Xcode, to -avoid insignificant changes appearing in the file when it is used in the -Xcode application. This will keep version control repositories happy, and -makes it possible to compare a project file used in Xcode to one generated by -this module to determine if any significant changes were made in the -application. - -Xcode has its own way of assigning 24-character identifiers to each object, -which is not duplicated here. Because the identifier only is only generated -once, when an object is created, and is then left unchanged, there is no need -to attempt to duplicate Xcode's behavior in this area. The generator is free -to select any identifier, even at random, to refer to the objects it creates, -and Xcode will retain those identifiers and use them when subsequently -rewriting the project file. However, the generator would choose new random -identifiers each time the project files are generated, leading to difficulties -comparing "used" project files to "pristine" ones produced by this module, -and causing the appearance of changes as every object identifier is changed -when updated projects are checked in to a version control repository. To -mitigate this problem, this module chooses identifiers in a more deterministic -way, by hashing a description of each object as well as its parent and ancestor -objects. This strategy should result in minimal "shift" in IDs as successive -generations of project files are produced. - -THIS MODULE - -This module introduces several classes, all derived from the XCObject class. -Nearly all of the "brains" are built into the XCObject class, which understands -how to create and modify objects, maintain the proper tree structure, compute -identifiers, and print objects. For the most part, classes derived from -XCObject need only provide a _schema class object, a dictionary that -expresses what properties objects of the class may contain. - -Given this structure, it's possible to build a minimal project file by creating -objects of the appropriate types and making the proper connections: - - config_list = XCConfigurationList() - group = PBXGroup() - project = PBXProject({'buildConfigurationList': config_list, - 'mainGroup': group}) - -With the project object set up, it can be added to an XCProjectFile object. -XCProjectFile is a pseudo-class in the sense that it is a concrete XCObject -subclass that does not actually correspond to a class type found in a project -file. Rather, it is used to represent the project file's root dictionary. -Printing an XCProjectFile will print the entire project file, including the -full "objects" dictionary. - - project_file = XCProjectFile({'rootObject': project}) - project_file.ComputeIDs() - project_file.Print() - -Xcode project files are always encoded in UTF-8. This module will accept -strings of either the str class or the unicode class. Strings of class str -are assumed to already be encoded in UTF-8. Obviously, if you're just using -ASCII, you won't encounter difficulties because ASCII is a UTF-8 subset. -Strings of class unicode are handled properly and encoded in UTF-8 when -a project file is output. -""" - -import gyp.common -from functools import cmp_to_key -import hashlib -from operator import attrgetter -import posixpath -import re -import struct -import sys - - -def cmp(x, y): - return (x > y) - (x < y) - - -# See XCObject._EncodeString. This pattern is used to determine when a string -# can be printed unquoted. Strings that match this pattern may be printed -# unquoted. Strings that do not match must be quoted and may be further -# transformed to be properly encoded. Note that this expression matches the -# characters listed with "+", for 1 or more occurrences: if a string is empty, -# it must not match this pattern, because it needs to be encoded as "". -_unquoted = re.compile("^[A-Za-z0-9$./_]+$") - -# Strings that match this pattern are quoted regardless of what _unquoted says. -# Oddly, Xcode will quote any string with a run of three or more underscores. -_quoted = re.compile("___") - -# This pattern should match any character that needs to be escaped by -# XCObject._EncodeString. See that function. -_escaped = re.compile('[\\\\"]|[\x00-\x1f]') - - -# Used by SourceTreeAndPathFromPath -_path_leading_variable = re.compile(r"^\$\((.*?)\)(/(.*))?$") - - -def SourceTreeAndPathFromPath(input_path): - """Given input_path, returns a tuple with sourceTree and path values. - - Examples: - input_path (source_tree, output_path) - '$(VAR)/path' ('VAR', 'path') - '$(VAR)' ('VAR', None) - 'path' (None, 'path') - """ - - source_group_match = _path_leading_variable.match(input_path) - if source_group_match: - source_tree = source_group_match.group(1) - output_path = source_group_match.group(3) # This may be None. - else: - source_tree = None - output_path = input_path - - return (source_tree, output_path) - - -def ConvertVariablesToShellSyntax(input_string): - return re.sub(r"\$\((.*?)\)", "${\\1}", input_string) - - -class XCObject: - """The abstract base of all class types used in Xcode project files. - - Class variables: - _schema: A dictionary defining the properties of this class. The keys to - _schema are string property keys as used in project files. Values - are a list of four or five elements: - [ is_list, property_type, is_strong, is_required, default ] - is_list: True if the property described is a list, as opposed - to a single element. - property_type: The type to use as the value of the property, - or if is_list is True, the type to use for each - element of the value's list. property_type must - be an XCObject subclass, or one of the built-in - types str, int, or dict. - is_strong: If property_type is an XCObject subclass, is_strong - is True to assert that this class "owns," or serves - as parent, to the property value (or, if is_list is - True, values). is_strong must be False if - property_type is not an XCObject subclass. - is_required: True if the property is required for the class. - Note that is_required being True does not preclude - an empty string ("", in the case of property_type - str) or list ([], in the case of is_list True) from - being set for the property. - default: Optional. If is_required is True, default may be set - to provide a default value for objects that do not supply - their own value. If is_required is True and default - is not provided, users of the class must supply their own - value for the property. - Note that although the values of the array are expressed in - boolean terms, subclasses provide values as integers to conserve - horizontal space. - _should_print_single_line: False in XCObject. Subclasses whose objects - should be written to the project file in the - alternate single-line format, such as - PBXFileReference and PBXBuildFile, should - set this to True. - _encode_transforms: Used by _EncodeString to encode unprintable characters. - The index into this list is the ordinal of the - character to transform; each value is a string - used to represent the character in the output. XCObject - provides an _encode_transforms list suitable for most - XCObject subclasses. - _alternate_encode_transforms: Provided for subclasses that wish to use - the alternate encoding rules. Xcode seems - to use these rules when printing objects in - single-line format. Subclasses that desire - this behavior should set _encode_transforms - to _alternate_encode_transforms. - _hashables: A list of XCObject subclasses that can be hashed by ComputeIDs - to construct this object's ID. Most classes that need custom - hashing behavior should do it by overriding Hashables, - but in some cases an object's parent may wish to push a - hashable value into its child, and it can do so by appending - to _hashables. - Attributes: - id: The object's identifier, a 24-character uppercase hexadecimal string. - Usually, objects being created should not set id until the entire - project file structure is built. At that point, UpdateIDs() should - be called on the root object to assign deterministic values for id to - each object in the tree. - parent: The object's parent. This is set by a parent XCObject when a child - object is added to it. - _properties: The object's property dictionary. An object's properties are - described by its class' _schema variable. - """ - - _schema = {} - _should_print_single_line = False - - # See _EncodeString. - _encode_transforms = [] - i = 0 - while i < ord(" "): - _encode_transforms.append("\\U%04x" % i) - i = i + 1 - _encode_transforms[7] = "\\a" - _encode_transforms[8] = "\\b" - _encode_transforms[9] = "\\t" - _encode_transforms[10] = "\\n" - _encode_transforms[11] = "\\v" - _encode_transforms[12] = "\\f" - _encode_transforms[13] = "\\n" - - _alternate_encode_transforms = list(_encode_transforms) - _alternate_encode_transforms[9] = chr(9) - _alternate_encode_transforms[10] = chr(10) - _alternate_encode_transforms[11] = chr(11) - - def __init__(self, properties=None, id=None, parent=None): - self.id = id - self.parent = parent - self._properties = {} - self._hashables = [] - self._SetDefaultsFromSchema() - self.UpdateProperties(properties) - - def __repr__(self): - try: - name = self.Name() - except NotImplementedError: - return f"<{self.__class__.__name__} at 0x{id(self):x}>" - return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" - - def Copy(self): - """Make a copy of this object. - - The new object will have its own copy of lists and dicts. Any XCObject - objects owned by this object (marked "strong") will be copied in the - new object, even those found in lists. If this object has any weak - references to other XCObjects, the same references are added to the new - object without making a copy. - """ - - that = self.__class__(id=self.id, parent=self.parent) - for key, value in self._properties.items(): - is_strong = self._schema[key][2] - - if isinstance(value, XCObject): - if is_strong: - new_value = value.Copy() - new_value.parent = that - that._properties[key] = new_value - else: - that._properties[key] = value - elif isinstance(value, (str, int)): - that._properties[key] = value - elif isinstance(value, list): - if is_strong: - # If is_strong is True, each element is an XCObject, so it's safe to - # call Copy. - that._properties[key] = [] - for item in value: - new_item = item.Copy() - new_item.parent = that - that._properties[key].append(new_item) - else: - that._properties[key] = value[:] - elif isinstance(value, dict): - # dicts are never strong. - if is_strong: - raise TypeError( - "Strong dict for key " + key + " in " + self.__class__.__name__ - ) - else: - that._properties[key] = value.copy() - else: - raise TypeError( - "Unexpected type " - + value.__class__.__name__ - + " for key " - + key - + " in " - + self.__class__.__name__ - ) - - return that - - def Name(self): - """Return the name corresponding to an object. - - Not all objects necessarily need to be nameable, and not all that do have - a "name" property. Override as needed. - """ - - # If the schema indicates that "name" is required, try to access the - # property even if it doesn't exist. This will result in a KeyError - # being raised for the property that should be present, which seems more - # appropriate than NotImplementedError in this case. - if "name" in self._properties or ( - "name" in self._schema and self._schema["name"][3] - ): - return self._properties["name"] - - raise NotImplementedError(self.__class__.__name__ + " must implement Name") - - def Comment(self): - """Return a comment string for the object. - - Most objects just use their name as the comment, but PBXProject uses - different values. - - The returned comment is not escaped and does not have any comment marker - strings applied to it. - """ - - return self.Name() - - def Hashables(self): - hashables = [self.__class__.__name__] - - name = self.Name() - if name is not None: - hashables.append(name) - - hashables.extend(self._hashables) - - return hashables - - def HashablesForChild(self): - return None - - def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): - """Set "id" properties deterministically. - - An object's "id" property is set based on a hash of its class type and - name, as well as the class type and name of all ancestor objects. As - such, it is only advisable to call ComputeIDs once an entire project file - tree is built. - - If recursive is True, recurse into all descendant objects and update their - hashes. - - If overwrite is True, any existing value set in the "id" property will be - replaced. - """ - - def _HashUpdate(hash, data): - """Update hash with data's length and contents. - - If the hash were updated only with the value of data, it would be - possible for clowns to induce collisions by manipulating the names of - their objects. By adding the length, it's exceedingly less likely that - ID collisions will be encountered, intentionally or not. - """ - - hash.update(struct.pack(">i", len(data))) - if isinstance(data, str): - data = data.encode("utf-8") - hash.update(data) - - if seed_hash is None: - seed_hash = hashlib.sha1() - - hash = seed_hash.copy() - - hashables = self.Hashables() - assert len(hashables) > 0 - for hashable in hashables: - _HashUpdate(hash, hashable) - - if recursive: - hashables_for_child = self.HashablesForChild() - if hashables_for_child is None: - child_hash = hash - else: - assert len(hashables_for_child) > 0 - child_hash = seed_hash.copy() - for hashable in hashables_for_child: - _HashUpdate(child_hash, hashable) - - for child in self.Children(): - child.ComputeIDs(recursive, overwrite, child_hash) - - if overwrite or self.id is None: - # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is - # is 160 bits. Instead of throwing out 64 bits of the digest, xor them - # into the portion that gets used. - assert hash.digest_size % 4 == 0 - digest_int_count = hash.digest_size // 4 - digest_ints = struct.unpack(">" + "I" * digest_int_count, hash.digest()) - id_ints = [0, 0, 0] - for index in range(0, digest_int_count): - id_ints[index % 3] ^= digest_ints[index] - self.id = "%08X%08X%08X" % tuple(id_ints) - - def EnsureNoIDCollisions(self): - """Verifies that no two objects have the same ID. Checks all descendants. - """ - - ids = {} - descendants = self.Descendants() - for descendant in descendants: - if descendant.id in ids: - other = ids[descendant.id] - raise KeyError( - 'Duplicate ID %s, objects "%s" and "%s" in "%s"' - % ( - descendant.id, - str(descendant._properties), - str(other._properties), - self._properties["rootObject"].Name(), - ) - ) - ids[descendant.id] = descendant - - def Children(self): - """Returns a list of all of this object's owned (strong) children.""" - - children = [] - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong) = attributes[0:3] - if is_strong and property in self._properties: - if not is_list: - children.append(self._properties[property]) - else: - children.extend(self._properties[property]) - return children - - def Descendants(self): - """Returns a list of all of this object's descendants, including this - object. - """ - - children = self.Children() - descendants = [self] - for child in children: - descendants.extend(child.Descendants()) - return descendants - - def PBXProjectAncestor(self): - # The base case for recursion is defined at PBXProject.PBXProjectAncestor. - if self.parent: - return self.parent.PBXProjectAncestor() - return None - - def _EncodeComment(self, comment): - """Encodes a comment to be placed in the project file output, mimicking - Xcode behavior. - """ - - # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If - # the string already contains a "*/", it is turned into "(*)/". This keeps - # the file writer from outputting something that would be treated as the - # end of a comment in the middle of something intended to be entirely a - # comment. - - return "/* " + comment.replace("*/", "(*)/") + " */" - - def _EncodeTransform(self, match): - # This function works closely with _EncodeString. It will only be called - # by re.sub with match.group(0) containing a character matched by the - # the _escaped expression. - char = match.group(0) - - # Backslashes (\) and quotation marks (") are always replaced with a - # backslash-escaped version of the same. Everything else gets its - # replacement from the class' _encode_transforms array. - if char == "\\": - return "\\\\" - if char == '"': - return '\\"' - return self._encode_transforms[ord(char)] - - def _EncodeString(self, value): - """Encodes a string to be placed in the project file output, mimicking - Xcode behavior. - """ - - # Use quotation marks when any character outside of the range A-Z, a-z, 0-9, - # $ (dollar sign), . (period), and _ (underscore) is present. Also use - # quotation marks to represent empty strings. - # - # Escape " (double-quote) and \ (backslash) by preceding them with a - # backslash. - # - # Some characters below the printable ASCII range are encoded specially: - # 7 ^G BEL is encoded as "\a" - # 8 ^H BS is encoded as "\b" - # 11 ^K VT is encoded as "\v" - # 12 ^L NP is encoded as "\f" - # 127 ^? DEL is passed through as-is without escaping - # - In PBXFileReference and PBXBuildFile objects: - # 9 ^I HT is passed through as-is without escaping - # 10 ^J NL is passed through as-is without escaping - # 13 ^M CR is passed through as-is without escaping - # - In other objects: - # 9 ^I HT is encoded as "\t" - # 10 ^J NL is encoded as "\n" - # 13 ^M CR is encoded as "\n" rendering it indistinguishable from - # 10 ^J NL - # All other characters within the ASCII control character range (0 through - # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point - # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e". - # Characters above the ASCII range are passed through to the output encoded - # as UTF-8 without any escaping. These mappings are contained in the - # class' _encode_transforms list. - - if _unquoted.search(value) and not _quoted.search(value): - return value - - return '"' + _escaped.sub(self._EncodeTransform, value) + '"' - - def _XCPrint(self, file, tabs, line): - file.write("\t" * tabs + line) - - def _XCPrintableValue(self, tabs, value, flatten_list=False): - """Returns a representation of value that may be printed in a project file, - mimicking Xcode's behavior. - - _XCPrintableValue can handle str and int values, XCObjects (which are - made printable by returning their id property), and list and dict objects - composed of any of the above types. When printing a list or dict, and - _should_print_single_line is False, the tabs parameter is used to determine - how much to indent the lines corresponding to the items in the list or - dict. - - If flatten_list is True, single-element lists will be transformed into - strings. - """ - - printable = "" - comment = None - - if self._should_print_single_line: - sep = " " - element_tabs = "" - end_tabs = "" - else: - sep = "\n" - element_tabs = "\t" * (tabs + 1) - end_tabs = "\t" * tabs - - if isinstance(value, XCObject): - printable += value.id - comment = value.Comment() - elif isinstance(value, str): - printable += self._EncodeString(value) - elif isinstance(value, str): - printable += self._EncodeString(value.encode("utf-8")) - elif isinstance(value, int): - printable += str(value) - elif isinstance(value, list): - if flatten_list and len(value) <= 1: - if len(value) == 0: - printable += self._EncodeString("") - else: - printable += self._EncodeString(value[0]) - else: - printable = "(" + sep - for item in value: - printable += ( - element_tabs - + self._XCPrintableValue(tabs + 1, item, flatten_list) - + "," - + sep - ) - printable += end_tabs + ")" - elif isinstance(value, dict): - printable = "{" + sep - for item_key, item_value in sorted(value.items()): - printable += ( - element_tabs - + self._XCPrintableValue(tabs + 1, item_key, flatten_list) - + " = " - + self._XCPrintableValue(tabs + 1, item_value, flatten_list) - + ";" - + sep - ) - printable += end_tabs + "}" - else: - raise TypeError("Can't make " + value.__class__.__name__ + " printable") - - if comment: - printable += " " + self._EncodeComment(comment) - - return printable - - def _XCKVPrint(self, file, tabs, key, value): - """Prints a key and value, members of an XCObject's _properties dictionary, - to file. - - tabs is an int identifying the indentation level. If the class' - _should_print_single_line variable is True, tabs is ignored and the - key-value pair will be followed by a space insead of a newline. - """ - - if self._should_print_single_line: - printable = "" - after_kv = " " - else: - printable = "\t" * tabs - after_kv = "\n" - - # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy - # objects without comments. Sometimes it prints them with comments, but - # the majority of the time, it doesn't. To avoid unnecessary changes to - # the project file after Xcode opens it, don't write comments for - # remoteGlobalIDString. This is a sucky hack and it would certainly be - # cleaner to extend the schema to indicate whether or not a comment should - # be printed, but since this is the only case where the problem occurs and - # Xcode itself can't seem to make up its mind, the hack will suffice. - # - # Also see PBXContainerItemProxy._schema['remoteGlobalIDString']. - if key == "remoteGlobalIDString" and isinstance(self, PBXContainerItemProxy): - value_to_print = value.id - else: - value_to_print = value - - # PBXBuildFile's settings property is represented in the output as a dict, - # but a hack here has it represented as a string. Arrange to strip off the - # quotes so that it shows up in the output as expected. - if key == "settings" and isinstance(self, PBXBuildFile): - strip_value_quotes = True - else: - strip_value_quotes = False - - # In another one-off, let's set flatten_list on buildSettings properties - # of XCBuildConfiguration objects, because that's how Xcode treats them. - if key == "buildSettings" and isinstance(self, XCBuildConfiguration): - flatten_list = True - else: - flatten_list = False - - try: - printable_key = self._XCPrintableValue(tabs, key, flatten_list) - printable_value = self._XCPrintableValue(tabs, value_to_print, flatten_list) - if ( - strip_value_quotes - and len(printable_value) > 1 - and printable_value[0] == '"' - and printable_value[-1] == '"' - ): - printable_value = printable_value[1:-1] - printable += printable_key + " = " + printable_value + ";" + after_kv - except TypeError as e: - gyp.common.ExceptionAppend(e, 'while printing key "%s"' % key) - raise - - self._XCPrint(file, 0, printable) - - def Print(self, file=sys.stdout): - """Prints a reprentation of this object to file, adhering to Xcode output - formatting. - """ - - self.VerifyHasRequiredProperties() - - if self._should_print_single_line: - # When printing an object in a single line, Xcode doesn't put any space - # between the beginning of a dictionary (or presumably a list) and the - # first contained item, so you wind up with snippets like - # ...CDEF = {isa = PBXFileReference; fileRef = 0123... - # If it were me, I would have put a space in there after the opening - # curly, but I guess this is just another one of those inconsistencies - # between how Xcode prints PBXFileReference and PBXBuildFile objects as - # compared to other objects. Mimic Xcode's behavior here by using an - # empty string for sep. - sep = "" - end_tabs = 0 - else: - sep = "\n" - end_tabs = 2 - - # Start the object. For example, '\t\tPBXProject = {\n'. - self._XCPrint(file, 2, self._XCPrintableValue(2, self) + " = {" + sep) - - # "isa" isn't in the _properties dictionary, it's an intrinsic property - # of the class which the object belongs to. Xcode always outputs "isa" - # as the first element of an object dictionary. - self._XCKVPrint(file, 3, "isa", self.__class__.__name__) - - # The remaining elements of an object dictionary are sorted alphabetically. - for property, value in sorted(self._properties.items()): - self._XCKVPrint(file, 3, property, value) - - # End the object. - self._XCPrint(file, end_tabs, "};\n") - - def UpdateProperties(self, properties, do_copy=False): - """Merge the supplied properties into the _properties dictionary. - - The input properties must adhere to the class schema or a KeyError or - TypeError exception will be raised. If adding an object of an XCObject - subclass and the schema indicates a strong relationship, the object's - parent will be set to this object. - - If do_copy is True, then lists, dicts, strong-owned XCObjects, and - strong-owned XCObjects in lists will be copied instead of having their - references added. - """ - - if properties is None: - return - - for property, value in properties.items(): - # Make sure the property is in the schema. - if property not in self._schema: - raise KeyError(property + " not in " + self.__class__.__name__) - - # Make sure the property conforms to the schema. - (is_list, property_type, is_strong) = self._schema[property][0:3] - if is_list: - if value.__class__ != list: - raise TypeError( - property - + " of " - + self.__class__.__name__ - + " must be list, not " - + value.__class__.__name__ - ) - for item in value: - if not isinstance(item, property_type) and not ( - isinstance(item, str) and property_type == str - ): - # Accept unicode where str is specified. str is treated as - # UTF-8-encoded. - raise TypeError( - "item of " - + property - + " of " - + self.__class__.__name__ - + " must be " - + property_type.__name__ - + ", not " - + item.__class__.__name__ - ) - elif not isinstance(value, property_type) and not ( - isinstance(value, str) and property_type == str - ): - # Accept unicode where str is specified. str is treated as - # UTF-8-encoded. - raise TypeError( - property - + " of " - + self.__class__.__name__ - + " must be " - + property_type.__name__ - + ", not " - + value.__class__.__name__ - ) - - # Checks passed, perform the assignment. - if do_copy: - if isinstance(value, XCObject): - if is_strong: - self._properties[property] = value.Copy() - else: - self._properties[property] = value - elif isinstance(value, (str, int)): - self._properties[property] = value - elif isinstance(value, list): - if is_strong: - # If is_strong is True, each element is an XCObject, - # so it's safe to call Copy. - self._properties[property] = [] - for item in value: - self._properties[property].append(item.Copy()) - else: - self._properties[property] = value[:] - elif isinstance(value, dict): - self._properties[property] = value.copy() - else: - raise TypeError( - "Don't know how to copy a " - + value.__class__.__name__ - + " object for " - + property - + " in " - + self.__class__.__name__ - ) - else: - self._properties[property] = value - - # Set up the child's back-reference to this object. Don't use |value| - # any more because it may not be right if do_copy is true. - if is_strong: - if not is_list: - self._properties[property].parent = self - else: - for item in self._properties[property]: - item.parent = self - - def HasProperty(self, key): - return key in self._properties - - def GetProperty(self, key): - return self._properties[key] - - def SetProperty(self, key, value): - self.UpdateProperties({key: value}) - - def DelProperty(self, key): - if key in self._properties: - del self._properties[key] - - def AppendProperty(self, key, value): - # TODO(mark): Support ExtendProperty too (and make this call that)? - - # Schema validation. - if key not in self._schema: - raise KeyError(key + " not in " + self.__class__.__name__) - - (is_list, property_type, is_strong) = self._schema[key][0:3] - if not is_list: - raise TypeError(key + " of " + self.__class__.__name__ + " must be list") - if not isinstance(value, property_type): - raise TypeError( - "item of " - + key - + " of " - + self.__class__.__name__ - + " must be " - + property_type.__name__ - + ", not " - + value.__class__.__name__ - ) - - # If the property doesn't exist yet, create a new empty list to receive the - # item. - self._properties[key] = self._properties.get(key, []) - - # Set up the ownership link. - if is_strong: - value.parent = self - - # Store the item. - self._properties[key].append(value) - - def VerifyHasRequiredProperties(self): - """Ensure that all properties identified as required by the schema are - set. - """ - - # TODO(mark): A stronger verification mechanism is needed. Some - # subclasses need to perform validation beyond what the schema can enforce. - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] - if is_required and property not in self._properties: - raise KeyError(self.__class__.__name__ + " requires " + property) - - def _SetDefaultsFromSchema(self): - """Assign object default values according to the schema. This will not - overwrite properties that have already been set.""" - - defaults = {} - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] - if ( - is_required - and len(attributes) >= 5 - and property not in self._properties - ): - default = attributes[4] - - defaults[property] = default - - if len(defaults) > 0: - # Use do_copy=True so that each new object gets its own copy of strong - # objects, lists, and dicts. - self.UpdateProperties(defaults, do_copy=True) - - -class XCHierarchicalElement(XCObject): - """Abstract base for PBXGroup and PBXFileReference. Not represented in a - project file.""" - - # TODO(mark): Do name and path belong here? Probably so. - # If path is set and name is not, name may have a default value. Name will - # be set to the basename of path, if the basename of path is different from - # the full value of path. If path is already just a leaf name, name will - # not be set. - _schema = XCObject._schema.copy() - _schema.update( - { - "comments": [0, str, 0, 0], - "fileEncoding": [0, str, 0, 0], - "includeInIndex": [0, int, 0, 0], - "indentWidth": [0, int, 0, 0], - "lineEnding": [0, int, 0, 0], - "sourceTree": [0, str, 0, 1, ""], - "tabWidth": [0, int, 0, 0], - "usesTabs": [0, int, 0, 0], - "wrapsLines": [0, int, 0, 0], - } - ) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCObject.__init__(self, properties, id, parent) - if "path" in self._properties and "name" not in self._properties: - path = self._properties["path"] - name = posixpath.basename(path) - if name != "" and path != name: - self.SetProperty("name", name) - - if "path" in self._properties and ( - "sourceTree" not in self._properties - or self._properties["sourceTree"] == "" - ): - # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take - # the variable out and make the path be relative to that variable by - # assigning the variable name as the sourceTree. - (source_tree, path) = SourceTreeAndPathFromPath(self._properties["path"]) - if source_tree is not None: - self._properties["sourceTree"] = source_tree - if path is not None: - self._properties["path"] = path - if ( - source_tree is not None - and path is None - and "name" not in self._properties - ): - # The path was of the form "$(SDKROOT)" with no path following it. - # This object is now relative to that variable, so it has no path - # attribute of its own. It does, however, keep a name. - del self._properties["path"] - self._properties["name"] = source_tree - - def Name(self): - if "name" in self._properties: - return self._properties["name"] - elif "path" in self._properties: - return self._properties["path"] - else: - # This happens in the case of the root PBXGroup. - return None - - def Hashables(self): - """Custom hashables for XCHierarchicalElements. - - XCHierarchicalElements are special. Generally, their hashes shouldn't - change if the paths don't change. The normal XCObject implementation of - Hashables adds a hashable for each object, which means that if - the hierarchical structure changes (possibly due to changes caused when - TakeOverOnlyChild runs and encounters slight changes in the hierarchy), - the hashes will change. For example, if a project file initially contains - a/b/f1 and a/b becomes collapsed into a/b, f1 will have a single parent - a/b. If someone later adds a/f2 to the project file, a/b can no longer be - collapsed, and f1 winds up with parent b and grandparent a. That would - be sufficient to change f1's hash. - - To counteract this problem, hashables for all XCHierarchicalElements except - for the main group (which has neither a name nor a path) are taken to be - just the set of path components. Because hashables are inherited from - parents, this provides assurance that a/b/f1 has the same set of hashables - whether its parent is b or a/b. - - The main group is a special case. As it is permitted to have no name or - path, it is permitted to use the standard XCObject hash mechanism. This - is not considered a problem because there can be only one main group. - """ - - if self == self.PBXProjectAncestor()._properties["mainGroup"]: - # super - return XCObject.Hashables(self) - - hashables = [] - - # Put the name in first, ensuring that if TakeOverOnlyChild collapses - # children into a top-level group like "Source", the name always goes - # into the list of hashables without interfering with path components. - if "name" in self._properties: - # Make it less likely for people to manipulate hashes by following the - # pattern of always pushing an object type value onto the list first. - hashables.append(self.__class__.__name__ + ".name") - hashables.append(self._properties["name"]) - - # NOTE: This still has the problem that if an absolute path is encountered, - # including paths with a sourceTree, they'll still inherit their parents' - # hashables, even though the paths aren't relative to their parents. This - # is not expected to be much of a problem in practice. - path = self.PathFromSourceTreeAndPath() - if path is not None: - components = path.split(posixpath.sep) - for component in components: - hashables.append(self.__class__.__name__ + ".path") - hashables.append(component) - - hashables.extend(self._hashables) - - return hashables - - def Compare(self, other): - # Allow comparison of these types. PBXGroup has the highest sort rank; - # PBXVariantGroup is treated as equal to PBXFileReference. - valid_class_types = { - PBXFileReference: "file", - PBXGroup: "group", - PBXVariantGroup: "file", - } - self_type = valid_class_types[self.__class__] - other_type = valid_class_types[other.__class__] - - if self_type == other_type: - # If the two objects are of the same sort rank, compare their names. - return cmp(self.Name(), other.Name()) - - # Otherwise, sort groups before everything else. - if self_type == "group": - return -1 - return 1 - - def CompareRootGroup(self, other): - # This function should be used only to compare direct children of the - # containing PBXProject's mainGroup. These groups should appear in the - # listed order. - # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the - # generator should have a way of influencing this list rather than having - # to hardcode for the generator here. - order = [ - "Source", - "Intermediates", - "Projects", - "Frameworks", - "Products", - "Build", - ] - - # If the groups aren't in the listed order, do a name comparison. - # Otherwise, groups in the listed order should come before those that - # aren't. - self_name = self.Name() - other_name = other.Name() - self_in = isinstance(self, PBXGroup) and self_name in order - other_in = isinstance(self, PBXGroup) and other_name in order - if not self_in and not other_in: - return self.Compare(other) - if self_name in order and other_name not in order: - return -1 - if other_name in order and self_name not in order: - return 1 - - # If both groups are in the listed order, go by the defined order. - self_index = order.index(self_name) - other_index = order.index(other_name) - if self_index < other_index: - return -1 - if self_index > other_index: - return 1 - return 0 - - def PathFromSourceTreeAndPath(self): - # Turn the object's sourceTree and path properties into a single flat - # string of a form comparable to the path parameter. If there's a - # sourceTree property other than "", wrap it in $(...) for the - # comparison. - components = [] - if self._properties["sourceTree"] != "": - components.append("$(" + self._properties["sourceTree"] + ")") - if "path" in self._properties: - components.append(self._properties["path"]) - - if len(components) > 0: - return posixpath.join(*components) - - return None - - def FullPath(self): - # Returns a full path to self relative to the project file, or relative - # to some other source tree. Start with self, and walk up the chain of - # parents prepending their paths, if any, until no more parents are - # available (project-relative path) or until a path relative to some - # source tree is found. - xche = self - path = None - while isinstance(xche, XCHierarchicalElement) and ( - path is None or (not path.startswith("/") and not path.startswith("$")) - ): - this_path = xche.PathFromSourceTreeAndPath() - if this_path is not None and path is not None: - path = posixpath.join(this_path, path) - elif this_path is not None: - path = this_path - xche = xche.parent - - return path - - -class PBXGroup(XCHierarchicalElement): - """ - Attributes: - _children_by_path: Maps pathnames of children of this PBXGroup to the - actual child XCHierarchicalElement objects. - _variant_children_by_name_and_path: Maps (name, path) tuples of - PBXVariantGroup children to the actual child PBXVariantGroup objects. - """ - - _schema = XCHierarchicalElement._schema.copy() - _schema.update( - { - "children": [1, XCHierarchicalElement, 1, 1, []], - "name": [0, str, 0, 0], - "path": [0, str, 0, 0], - } - ) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCHierarchicalElement.__init__(self, properties, id, parent) - self._children_by_path = {} - self._variant_children_by_name_and_path = {} - for child in self._properties.get("children", []): - self._AddChildToDicts(child) - - def Hashables(self): - # super - hashables = XCHierarchicalElement.Hashables(self) - - # It is not sufficient to just rely on name and parent to build a unique - # hashable : a node could have two child PBXGroup sharing a common name. - # To add entropy the hashable is enhanced with the names of all its - # children. - for child in self._properties.get("children", []): - child_name = child.Name() - if child_name is not None: - hashables.append(child_name) - - return hashables - - def HashablesForChild(self): - # To avoid a circular reference the hashables used to compute a child id do - # not include the child names. - return XCHierarchicalElement.Hashables(self) - - def _AddChildToDicts(self, child): - # Sets up this PBXGroup object's dicts to reference the child properly. - child_path = child.PathFromSourceTreeAndPath() - if child_path: - if child_path in self._children_by_path: - raise ValueError("Found multiple children with path " + child_path) - self._children_by_path[child_path] = child - - if isinstance(child, PBXVariantGroup): - child_name = child._properties.get("name", None) - key = (child_name, child_path) - if key in self._variant_children_by_name_and_path: - raise ValueError( - "Found multiple PBXVariantGroup children with " - + "name " - + str(child_name) - + " and path " - + str(child_path) - ) - self._variant_children_by_name_and_path[key] = child - - def AppendChild(self, child): - # Callers should use this instead of calling - # AppendProperty('children', child) directly because this function - # maintains the group's dicts. - self.AppendProperty("children", child) - self._AddChildToDicts(child) - - def GetChildByName(self, name): - # This is not currently optimized with a dict as GetChildByPath is because - # it has few callers. Most callers probably want GetChildByPath. This - # function is only useful to get children that have names but no paths, - # which is rare. The children of the main group ("Source", "Products", - # etc.) is pretty much the only case where this likely to come up. - # - # TODO(mark): Maybe this should raise an error if more than one child is - # present with the same name. - if "children" not in self._properties: - return None - - for child in self._properties["children"]: - if child.Name() == name: - return child - - return None - - def GetChildByPath(self, path): - if not path: - return None - - if path in self._children_by_path: - return self._children_by_path[path] - - return None - - def GetChildByRemoteObject(self, remote_object): - # This method is a little bit esoteric. Given a remote_object, which - # should be a PBXFileReference in another project file, this method will - # return this group's PBXReferenceProxy object serving as a local proxy - # for the remote PBXFileReference. - # - # This function might benefit from a dict optimization as GetChildByPath - # for some workloads, but profiling shows that it's not currently a - # problem. - if "children" not in self._properties: - return None - - for child in self._properties["children"]: - if not isinstance(child, PBXReferenceProxy): - continue - - container_proxy = child._properties["remoteRef"] - if container_proxy._properties["remoteGlobalIDString"] == remote_object: - return child - - return None - - def AddOrGetFileByPath(self, path, hierarchical): - """Returns an existing or new file reference corresponding to path. - - If hierarchical is True, this method will create or use the necessary - hierarchical group structure corresponding to path. Otherwise, it will - look in and create an item in the current group only. - - If an existing matching reference is found, it is returned, otherwise, a - new one will be created, added to the correct group, and returned. - - If path identifies a directory by virtue of carrying a trailing slash, - this method returns a PBXFileReference of "folder" type. If path - identifies a variant, by virtue of it identifying a file inside a directory - with an ".lproj" extension, this method returns a PBXVariantGroup - containing the variant named by path, and possibly other variants. For - all other paths, a "normal" PBXFileReference will be returned. - """ - - # Adding or getting a directory? Directories end with a trailing slash. - is_dir = False - if path.endswith("/"): - is_dir = True - path = posixpath.normpath(path) - if is_dir: - path = path + "/" - - # Adding or getting a variant? Variants are files inside directories - # with an ".lproj" extension. Xcode uses variants for localization. For - # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named - # MainMenu.nib inside path/to, and give it a variant named Language. In - # this example, grandparent would be set to path/to and parent_root would - # be set to Language. - variant_name = None - parent = posixpath.dirname(path) - grandparent = posixpath.dirname(parent) - parent_basename = posixpath.basename(parent) - (parent_root, parent_ext) = posixpath.splitext(parent_basename) - if parent_ext == ".lproj": - variant_name = parent_root - if grandparent == "": - grandparent = None - - # Putting a directory inside a variant group is not currently supported. - assert not is_dir or variant_name is None - - path_split = path.split(posixpath.sep) - if ( - len(path_split) == 1 - or ((is_dir or variant_name is not None) and len(path_split) == 2) - or not hierarchical - ): - # The PBXFileReference or PBXVariantGroup will be added to or gotten from - # this PBXGroup, no recursion necessary. - if variant_name is None: - # Add or get a PBXFileReference. - file_ref = self.GetChildByPath(path) - if file_ref is not None: - assert file_ref.__class__ == PBXFileReference - else: - file_ref = PBXFileReference({"path": path}) - self.AppendChild(file_ref) - else: - # Add or get a PBXVariantGroup. The variant group name is the same - # as the basename (MainMenu.nib in the example above). grandparent - # specifies the path to the variant group itself, and path_split[-2:] - # is the path of the specific variant relative to its group. - variant_group_name = posixpath.basename(path) - variant_group_ref = self.AddOrGetVariantGroupByNameAndPath( - variant_group_name, grandparent - ) - variant_path = posixpath.sep.join(path_split[-2:]) - variant_ref = variant_group_ref.GetChildByPath(variant_path) - if variant_ref is not None: - assert variant_ref.__class__ == PBXFileReference - else: - variant_ref = PBXFileReference( - {"name": variant_name, "path": variant_path} - ) - variant_group_ref.AppendChild(variant_ref) - # The caller is interested in the variant group, not the specific - # variant file. - file_ref = variant_group_ref - return file_ref - else: - # Hierarchical recursion. Add or get a PBXGroup corresponding to the - # outermost path component, and then recurse into it, chopping off that - # path component. - next_dir = path_split[0] - group_ref = self.GetChildByPath(next_dir) - if group_ref is not None: - assert group_ref.__class__ == PBXGroup - else: - group_ref = PBXGroup({"path": next_dir}) - self.AppendChild(group_ref) - return group_ref.AddOrGetFileByPath( - posixpath.sep.join(path_split[1:]), hierarchical - ) - - def AddOrGetVariantGroupByNameAndPath(self, name, path): - """Returns an existing or new PBXVariantGroup for name and path. - - If a PBXVariantGroup identified by the name and path arguments is already - present as a child of this object, it is returned. Otherwise, a new - PBXVariantGroup with the correct properties is created, added as a child, - and returned. - - This method will generally be called by AddOrGetFileByPath, which knows - when to create a variant group based on the structure of the pathnames - passed to it. - """ - - key = (name, path) - if key in self._variant_children_by_name_and_path: - variant_group_ref = self._variant_children_by_name_and_path[key] - assert variant_group_ref.__class__ == PBXVariantGroup - return variant_group_ref - - variant_group_properties = {"name": name} - if path is not None: - variant_group_properties["path"] = path - variant_group_ref = PBXVariantGroup(variant_group_properties) - self.AppendChild(variant_group_ref) - - return variant_group_ref - - def TakeOverOnlyChild(self, recurse=False): - """If this PBXGroup has only one child and it's also a PBXGroup, take - it over by making all of its children this object's children. - - This function will continue to take over only children when those children - are groups. If there are three PBXGroups representing a, b, and c, with - c inside b and b inside a, and a and b have no other children, this will - result in a taking over both b and c, forming a PBXGroup for a/b/c. - - If recurse is True, this function will recurse into children and ask them - to collapse themselves by taking over only children as well. Assuming - an example hierarchy with files at a/b/c/d1, a/b/c/d2, and a/b/c/d3/e/f - (d1, d2, and f are files, the rest are groups), recursion will result in - a group for a/b/c containing a group for d3/e. - """ - - # At this stage, check that child class types are PBXGroup exactly, - # instead of using isinstance. The only subclass of PBXGroup, - # PBXVariantGroup, should not participate in reparenting in the same way: - # reparenting by merging different object types would be wrong. - while ( - len(self._properties["children"]) == 1 - and self._properties["children"][0].__class__ == PBXGroup - ): - # Loop to take over the innermost only-child group possible. - - child = self._properties["children"][0] - - # Assume the child's properties, including its children. Save a copy - # of this object's old properties, because they'll still be needed. - # This object retains its existing id and parent attributes. - old_properties = self._properties - self._properties = child._properties - self._children_by_path = child._children_by_path - - if ( - "sourceTree" not in self._properties - or self._properties["sourceTree"] == "" - ): - # The child was relative to its parent. Fix up the path. Note that - # children with a sourceTree other than "" are not relative to - # their parents, so no path fix-up is needed in that case. - if "path" in old_properties: - if "path" in self._properties: - # Both the original parent and child have paths set. - self._properties["path"] = posixpath.join( - old_properties["path"], self._properties["path"] - ) - else: - # Only the original parent has a path, use it. - self._properties["path"] = old_properties["path"] - if "sourceTree" in old_properties: - # The original parent had a sourceTree set, use it. - self._properties["sourceTree"] = old_properties["sourceTree"] - - # If the original parent had a name set, keep using it. If the original - # parent didn't have a name but the child did, let the child's name - # live on. If the name attribute seems unnecessary now, get rid of it. - if "name" in old_properties and old_properties["name"] not in ( - None, - self.Name(), - ): - self._properties["name"] = old_properties["name"] - if ( - "name" in self._properties - and "path" in self._properties - and self._properties["name"] == self._properties["path"] - ): - del self._properties["name"] - - # Notify all children of their new parent. - for child in self._properties["children"]: - child.parent = self - - # If asked to recurse, recurse. - if recurse: - for child in self._properties["children"]: - if child.__class__ == PBXGroup: - child.TakeOverOnlyChild(recurse) - - def SortGroup(self): - self._properties["children"] = sorted( - self._properties["children"], key=cmp_to_key(lambda x, y: x.Compare(y)) - ) - - # Recurse. - for child in self._properties["children"]: - if isinstance(child, PBXGroup): - child.SortGroup() - - -class XCFileLikeElement(XCHierarchicalElement): - # Abstract base for objects that can be used as the fileRef property of - # PBXBuildFile. - - def PathHashables(self): - # A PBXBuildFile that refers to this object will call this method to - # obtain additional hashables specific to this XCFileLikeElement. Don't - # just use this object's hashables, they're not specific and unique enough - # on their own (without access to the parent hashables.) Instead, provide - # hashables that identify this object by path by getting its hashables as - # well as the hashables of ancestor XCHierarchicalElement objects. - - hashables = [] - xche = self - while isinstance(xche, XCHierarchicalElement): - xche_hashables = xche.Hashables() - for index, xche_hashable in enumerate(xche_hashables): - hashables.insert(index, xche_hashable) - xche = xche.parent - return hashables - - -class XCContainerPortal(XCObject): - # Abstract base for objects that can be used as the containerPortal property - # of PBXContainerItemProxy. - pass - - -class XCRemoteObject(XCObject): - # Abstract base for objects that can be used as the remoteGlobalIDString - # property of PBXContainerItemProxy. - pass - - -class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject): - _schema = XCFileLikeElement._schema.copy() - _schema.update( - { - "explicitFileType": [0, str, 0, 0], - "lastKnownFileType": [0, str, 0, 0], - "name": [0, str, 0, 0], - "path": [0, str, 0, 1], - } - ) - - # Weird output rules for PBXFileReference. - _should_print_single_line = True - # super - _encode_transforms = XCFileLikeElement._alternate_encode_transforms - - def __init__(self, properties=None, id=None, parent=None): - # super - XCFileLikeElement.__init__(self, properties, id, parent) - if "path" in self._properties and self._properties["path"].endswith("/"): - self._properties["path"] = self._properties["path"][:-1] - is_dir = True - else: - is_dir = False - - if ( - "path" in self._properties - and "lastKnownFileType" not in self._properties - and "explicitFileType" not in self._properties - ): - # TODO(mark): This is the replacement for a replacement for a quick hack. - # It is no longer incredibly sucky, but this list needs to be extended. - extension_map = { - "a": "archive.ar", - "app": "wrapper.application", - "bdic": "file", - "bundle": "wrapper.cfbundle", - "c": "sourcecode.c.c", - "cc": "sourcecode.cpp.cpp", - "cpp": "sourcecode.cpp.cpp", - "css": "text.css", - "cxx": "sourcecode.cpp.cpp", - "dart": "sourcecode", - "dylib": "compiled.mach-o.dylib", - "framework": "wrapper.framework", - "gyp": "sourcecode", - "gypi": "sourcecode", - "h": "sourcecode.c.h", - "hxx": "sourcecode.cpp.h", - "icns": "image.icns", - "java": "sourcecode.java", - "js": "sourcecode.javascript", - "kext": "wrapper.kext", - "m": "sourcecode.c.objc", - "mm": "sourcecode.cpp.objcpp", - "nib": "wrapper.nib", - "o": "compiled.mach-o.objfile", - "pdf": "image.pdf", - "pl": "text.script.perl", - "plist": "text.plist.xml", - "pm": "text.script.perl", - "png": "image.png", - "py": "text.script.python", - "r": "sourcecode.rez", - "rez": "sourcecode.rez", - "s": "sourcecode.asm", - "storyboard": "file.storyboard", - "strings": "text.plist.strings", - "swift": "sourcecode.swift", - "ttf": "file", - "xcassets": "folder.assetcatalog", - "xcconfig": "text.xcconfig", - "xcdatamodel": "wrapper.xcdatamodel", - "xcdatamodeld": "wrapper.xcdatamodeld", - "xib": "file.xib", - "y": "sourcecode.yacc", - } - - prop_map = { - "dart": "explicitFileType", - "gyp": "explicitFileType", - "gypi": "explicitFileType", - } - - if is_dir: - file_type = "folder" - prop_name = "lastKnownFileType" - else: - basename = posixpath.basename(self._properties["path"]) - (root, ext) = posixpath.splitext(basename) - # Check the map using a lowercase extension. - # TODO(mark): Maybe it should try with the original case first and fall - # back to lowercase, in case there are any instances where case - # matters. There currently aren't. - if ext != "": - ext = ext[1:].lower() - - # TODO(mark): "text" is the default value, but "file" is appropriate - # for unrecognized files not containing text. Xcode seems to choose - # based on content. - file_type = extension_map.get(ext, "text") - prop_name = prop_map.get(ext, "lastKnownFileType") - - self._properties[prop_name] = file_type - - -class PBXVariantGroup(PBXGroup, XCFileLikeElement): - """PBXVariantGroup is used by Xcode to represent localizations.""" - - # No additions to the schema relative to PBXGroup. - pass - - -# PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below -# because it uses PBXContainerItemProxy, defined below. - - -class XCBuildConfiguration(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "baseConfigurationReference": [0, PBXFileReference, 0, 0], - "buildSettings": [0, dict, 0, 1, {}], - "name": [0, str, 0, 1], - } - ) - - def HasBuildSetting(self, key): - return key in self._properties["buildSettings"] - - def GetBuildSetting(self, key): - return self._properties["buildSettings"][key] - - def SetBuildSetting(self, key, value): - # TODO(mark): If a list, copy? - self._properties["buildSettings"][key] = value - - def AppendBuildSetting(self, key, value): - if key not in self._properties["buildSettings"]: - self._properties["buildSettings"][key] = [] - self._properties["buildSettings"][key].append(value) - - def DelBuildSetting(self, key): - if key in self._properties["buildSettings"]: - del self._properties["buildSettings"][key] - - def SetBaseConfiguration(self, value): - self._properties["baseConfigurationReference"] = value - - -class XCConfigurationList(XCObject): - # _configs is the default list of configurations. - _configs = [ - XCBuildConfiguration({"name": "Debug"}), - XCBuildConfiguration({"name": "Release"}), - ] - - _schema = XCObject._schema.copy() - _schema.update( - { - "buildConfigurations": [1, XCBuildConfiguration, 1, 1, _configs], - "defaultConfigurationIsVisible": [0, int, 0, 1, 1], - "defaultConfigurationName": [0, str, 0, 1, "Release"], - } - ) - - def Name(self): - return ( - "Build configuration list for " - + self.parent.__class__.__name__ - + ' "' - + self.parent.Name() - + '"' - ) - - def ConfigurationNamed(self, name): - """Convenience accessor to obtain an XCBuildConfiguration by name.""" - for configuration in self._properties["buildConfigurations"]: - if configuration._properties["name"] == name: - return configuration - - raise KeyError(name) - - def DefaultConfiguration(self): - """Convenience accessor to obtain the default XCBuildConfiguration.""" - return self.ConfigurationNamed(self._properties["defaultConfigurationName"]) - - def HasBuildSetting(self, key): - """Determines the state of a build setting in all XCBuildConfiguration - child objects. - - If all child objects have key in their build settings, and the value is the - same in all child objects, returns 1. - - If no child objects have the key in their build settings, returns 0. - - If some, but not all, child objects have the key in their build settings, - or if any children have different values for the key, returns -1. - """ - - has = None - value = None - for configuration in self._properties["buildConfigurations"]: - configuration_has = configuration.HasBuildSetting(key) - if has is None: - has = configuration_has - elif has != configuration_has: - return -1 - - if configuration_has: - configuration_value = configuration.GetBuildSetting(key) - if value is None: - value = configuration_value - elif value != configuration_value: - return -1 - - if not has: - return 0 - - return 1 - - def GetBuildSetting(self, key): - """Gets the build setting for key. - - All child XCConfiguration objects must have the same value set for the - setting, or a ValueError will be raised. - """ - - # TODO(mark): This is wrong for build settings that are lists. The list - # contents should be compared (and a list copy returned?) - - value = None - for configuration in self._properties["buildConfigurations"]: - configuration_value = configuration.GetBuildSetting(key) - if value is None: - value = configuration_value - else: - if value != configuration_value: - raise ValueError("Variant values for " + key) - - return value - - def SetBuildSetting(self, key, value): - """Sets the build setting for key to value in all child - XCBuildConfiguration objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.SetBuildSetting(key, value) - - def AppendBuildSetting(self, key, value): - """Appends value to the build setting for key, which is treated as a list, - in all child XCBuildConfiguration objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.AppendBuildSetting(key, value) - - def DelBuildSetting(self, key): - """Deletes the build setting key from all child XCBuildConfiguration - objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.DelBuildSetting(key) - - def SetBaseConfiguration(self, value): - """Sets the build configuration in all child XCBuildConfiguration objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.SetBaseConfiguration(value) - - -class PBXBuildFile(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "fileRef": [0, XCFileLikeElement, 0, 1], - "settings": [0, str, 0, 0], # hack, it's a dict - } - ) - - # Weird output rules for PBXBuildFile. - _should_print_single_line = True - _encode_transforms = XCObject._alternate_encode_transforms - - def Name(self): - # Example: "main.cc in Sources" - return self._properties["fileRef"].Name() + " in " + self.parent.Name() - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # It is not sufficient to just rely on Name() to get the - # XCFileLikeElement's name, because that is not a complete pathname. - # PathHashables returns hashables unique enough that no two - # PBXBuildFiles should wind up with the same set of hashables, unless - # someone adds the same file multiple times to the same target. That - # would be considered invalid anyway. - hashables.extend(self._properties["fileRef"].PathHashables()) - - return hashables - - -class XCBuildPhase(XCObject): - """Abstract base for build phase classes. Not represented in a project - file. - - Attributes: - _files_by_path: A dict mapping each path of a child in the files list by - path (keys) to the corresponding PBXBuildFile children (values). - _files_by_xcfilelikeelement: A dict mapping each XCFileLikeElement (keys) - to the corresponding PBXBuildFile children (values). - """ - - # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't - # actually have a "files" list. XCBuildPhase should not have "files" but - # another abstract subclass of it should provide this, and concrete build - # phase types that do have "files" lists should be derived from that new - # abstract subclass. XCBuildPhase should only provide buildActionMask and - # runOnlyForDeploymentPostprocessing, and not files or the various - # file-related methods and attributes. - - _schema = XCObject._schema.copy() - _schema.update( - { - "buildActionMask": [0, int, 0, 1, 0x7FFFFFFF], - "files": [1, PBXBuildFile, 1, 1, []], - "runOnlyForDeploymentPostprocessing": [0, int, 0, 1, 0], - } - ) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCObject.__init__(self, properties, id, parent) - - self._files_by_path = {} - self._files_by_xcfilelikeelement = {} - for pbxbuildfile in self._properties.get("files", []): - self._AddBuildFileToDicts(pbxbuildfile) - - def FileGroup(self, path): - # Subclasses must override this by returning a two-element tuple. The - # first item in the tuple should be the PBXGroup to which "path" should be - # added, either as a child or deeper descendant. The second item should - # be a boolean indicating whether files should be added into hierarchical - # groups or one single flat group. - raise NotImplementedError(self.__class__.__name__ + " must implement FileGroup") - - def _AddPathToDict(self, pbxbuildfile, path): - """Adds path to the dict tracking paths belonging to this build phase. - - If the path is already a member of this build phase, raises an exception. - """ - - if path in self._files_by_path: - raise ValueError("Found multiple build files with path " + path) - self._files_by_path[path] = pbxbuildfile - - def _AddBuildFileToDicts(self, pbxbuildfile, path=None): - """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts. - - If path is specified, then it is the path that is being added to the - phase, and pbxbuildfile must contain either a PBXFileReference directly - referencing that path, or it must contain a PBXVariantGroup that itself - contains a PBXFileReference referencing the path. - - If path is not specified, either the PBXFileReference's path or the paths - of all children of the PBXVariantGroup are taken as being added to the - phase. - - If the path is already present in the phase, raises an exception. - - If the PBXFileReference or PBXVariantGroup referenced by pbxbuildfile - are already present in the phase, referenced by a different PBXBuildFile - object, raises an exception. This does not raise an exception when - a PBXFileReference or PBXVariantGroup reappear and are referenced by the - same PBXBuildFile that has already introduced them, because in the case - of PBXVariantGroup objects, they may correspond to multiple paths that are - not all added simultaneously. When this situation occurs, the path needs - to be added to _files_by_path, but nothing needs to change in - _files_by_xcfilelikeelement, and the caller should have avoided adding - the PBXBuildFile if it is already present in the list of children. - """ - - xcfilelikeelement = pbxbuildfile._properties["fileRef"] - - paths = [] - if path is not None: - # It's best when the caller provides the path. - if isinstance(xcfilelikeelement, PBXVariantGroup): - paths.append(path) - else: - # If the caller didn't provide a path, there can be either multiple - # paths (PBXVariantGroup) or one. - if isinstance(xcfilelikeelement, PBXVariantGroup): - for variant in xcfilelikeelement._properties["children"]: - paths.append(variant.FullPath()) - else: - paths.append(xcfilelikeelement.FullPath()) - - # Add the paths first, because if something's going to raise, the - # messages provided by _AddPathToDict are more useful owing to its - # having access to a real pathname and not just an object's Name(). - for a_path in paths: - self._AddPathToDict(pbxbuildfile, a_path) - - # If another PBXBuildFile references this XCFileLikeElement, there's a - # problem. - if ( - xcfilelikeelement in self._files_by_xcfilelikeelement - and self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile - ): - raise ValueError( - "Found multiple build files for " + xcfilelikeelement.Name() - ) - self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile - - def AppendBuildFile(self, pbxbuildfile, path=None): - # Callers should use this instead of calling - # AppendProperty('files', pbxbuildfile) directly because this function - # maintains the object's dicts. Better yet, callers can just call AddFile - # with a pathname and not worry about building their own PBXBuildFile - # objects. - self.AppendProperty("files", pbxbuildfile) - self._AddBuildFileToDicts(pbxbuildfile, path) - - def AddFile(self, path, settings=None): - (file_group, hierarchical) = self.FileGroup(path) - file_ref = file_group.AddOrGetFileByPath(path, hierarchical) - - if file_ref in self._files_by_xcfilelikeelement and isinstance( - file_ref, PBXVariantGroup - ): - # There's already a PBXBuildFile in this phase corresponding to the - # PBXVariantGroup. path just provides a new variant that belongs to - # the group. Add the path to the dict. - pbxbuildfile = self._files_by_xcfilelikeelement[file_ref] - self._AddBuildFileToDicts(pbxbuildfile, path) - else: - # Add a new PBXBuildFile to get file_ref into the phase. - if settings is None: - pbxbuildfile = PBXBuildFile({"fileRef": file_ref}) - else: - pbxbuildfile = PBXBuildFile({"fileRef": file_ref, "settings": settings}) - self.AppendBuildFile(pbxbuildfile, path) - - -class PBXHeadersBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Headers" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - -class PBXResourcesBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Resources" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - -class PBXSourcesBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Sources" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - -class PBXFrameworksBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Frameworks" - - def FileGroup(self, path): - (root, ext) = posixpath.splitext(path) - if ext != "": - ext = ext[1:].lower() - if ext == "o": - # .o files are added to Xcode Frameworks phases, but conceptually aren't - # frameworks, they're more like sources or intermediates. Redirect them - # to show up in one of those other groups. - return self.PBXProjectAncestor().RootGroupForPath(path) - else: - return (self.PBXProjectAncestor().FrameworksGroup(), False) - - -class PBXShellScriptBuildPhase(XCBuildPhase): - _schema = XCBuildPhase._schema.copy() - _schema.update( - { - "inputPaths": [1, str, 0, 1, []], - "name": [0, str, 0, 0], - "outputPaths": [1, str, 0, 1, []], - "shellPath": [0, str, 0, 1, "/bin/sh"], - "shellScript": [0, str, 0, 1], - "showEnvVarsInLog": [0, int, 0, 0], - } - ) - - def Name(self): - if "name" in self._properties: - return self._properties["name"] - - return "ShellScript" - - -class PBXCopyFilesBuildPhase(XCBuildPhase): - _schema = XCBuildPhase._schema.copy() - _schema.update( - { - "dstPath": [0, str, 0, 1], - "dstSubfolderSpec": [0, int, 0, 1], - "name": [0, str, 0, 0], - } - ) - - # path_tree_re matches "$(DIR)/path", "$(DIR)/$(DIR2)/path" or just "$(DIR)". - # Match group 1 is "DIR", group 3 is "path" or "$(DIR2") or "$(DIR2)/path" - # or None. If group 3 is "path", group 4 will be None otherwise group 4 is - # "DIR2" and group 6 is "path". - path_tree_re = re.compile(r"^\$\((.*?)\)(/(\$\((.*?)\)(/(.*)|)|(.*)|)|)$") - - # path_tree_{first,second}_to_subfolder map names of Xcode variables to the - # associated dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase - # object. - path_tree_first_to_subfolder = { - # Types that can be chosen via the Xcode UI. - "BUILT_PRODUCTS_DIR": 16, # Products Directory - "BUILT_FRAMEWORKS_DIR": 10, # Not an official Xcode macro. - # Existed before support for the - # names below was added. Maps to - # "Frameworks". - } - - path_tree_second_to_subfolder = { - "WRAPPER_NAME": 1, # Wrapper - # Although Xcode's friendly name is "Executables", the destination - # is demonstrably the value of the build setting - # EXECUTABLE_FOLDER_PATH not EXECUTABLES_FOLDER_PATH. - "EXECUTABLE_FOLDER_PATH": 6, # Executables. - "UNLOCALIZED_RESOURCES_FOLDER_PATH": 7, # Resources - "JAVA_FOLDER_PATH": 15, # Java Resources - "FRAMEWORKS_FOLDER_PATH": 10, # Frameworks - "SHARED_FRAMEWORKS_FOLDER_PATH": 11, # Shared Frameworks - "SHARED_SUPPORT_FOLDER_PATH": 12, # Shared Support - "PLUGINS_FOLDER_PATH": 13, # PlugIns - # For XPC Services, Xcode sets both dstPath and dstSubfolderSpec. - # Note that it re-uses the BUILT_PRODUCTS_DIR value for - # dstSubfolderSpec. dstPath is set below. - "XPCSERVICES_FOLDER_PATH": 16, # XPC Services. - } - - def Name(self): - if "name" in self._properties: - return self._properties["name"] - - return "CopyFiles" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - def SetDestination(self, path): - """Set the dstSubfolderSpec and dstPath properties from path. - - path may be specified in the same notation used for XCHierarchicalElements, - specifically, "$(DIR)/path". - """ - - path_tree_match = self.path_tree_re.search(path) - if path_tree_match: - path_tree = path_tree_match.group(1) - if path_tree in self.path_tree_first_to_subfolder: - subfolder = self.path_tree_first_to_subfolder[path_tree] - relative_path = path_tree_match.group(3) - if relative_path is None: - relative_path = "" - - if subfolder == 16 and path_tree_match.group(4) is not None: - # BUILT_PRODUCTS_DIR (16) is the first element in a path whose - # second element is possibly one of the variable names in - # path_tree_second_to_subfolder. Xcode sets the values of all these - # variables to relative paths so .gyp files must prefix them with - # BUILT_PRODUCTS_DIR, e.g. - # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then - # xcode_emulation.py can export these variables with the same values - # as Xcode yet make & ninja files can determine the absolute path - # to the target. Xcode uses the dstSubfolderSpec value set here - # to determine the full path. - # - # An alternative of xcode_emulation.py setting the values to - # absolute paths when exporting these variables has been - # ruled out because then the values would be different - # depending on the build tool. - # - # Another alternative is to invent new names for the variables used - # to match to the subfolder indices in the second table. .gyp files - # then will not need to prepend $(BUILT_PRODUCTS_DIR) because - # xcode_emulation.py can set the values of those variables to - # the absolute paths when exporting. This is possibly the thinking - # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner. - # - # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because - # this same way could be used to specify destinations in .gyp files - # that pre-date this addition to GYP. However they would only work - # with the Xcode generator. - # The previous version of xcode_emulation.py - # does not export these variables. Such files will get the benefit - # of the Xcode UI showing the proper destination name simply by - # regenerating the projects with this version of GYP. - path_tree = path_tree_match.group(4) - relative_path = path_tree_match.group(6) - separator = "/" - - if path_tree in self.path_tree_second_to_subfolder: - subfolder = self.path_tree_second_to_subfolder[path_tree] - if relative_path is None: - relative_path = "" - separator = "" - if path_tree == "XPCSERVICES_FOLDER_PATH": - relative_path = ( - "$(CONTENTS_FOLDER_PATH)/XPCServices" - + separator - + relative_path - ) - else: - # subfolder = 16 from above - # The second element of the path is an unrecognized variable. - # Include it and any remaining elements in relative_path. - relative_path = path_tree_match.group(3) - - else: - # The path starts with an unrecognized Xcode variable - # name like $(SRCROOT). Xcode will still handle this - # as an "absolute path" that starts with the variable. - subfolder = 0 - relative_path = path - elif path.startswith("/"): - # Special case. Absolute paths are in dstSubfolderSpec 0. - subfolder = 0 - relative_path = path[1:] - else: - raise ValueError( - f"Can't use path {path} in a {self.__class__.__name__}" - ) - - self._properties["dstPath"] = relative_path - self._properties["dstSubfolderSpec"] = subfolder - - -class PBXBuildRule(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "compilerSpec": [0, str, 0, 1], - "filePatterns": [0, str, 0, 0], - "fileType": [0, str, 0, 1], - "isEditable": [0, int, 0, 1, 1], - "outputFiles": [1, str, 0, 1, []], - "script": [0, str, 0, 0], - } - ) - - def Name(self): - # Not very inspired, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # Use the hashables of the weak objects that this object refers to. - hashables.append(self._properties["fileType"]) - if "filePatterns" in self._properties: - hashables.append(self._properties["filePatterns"]) - return hashables - - -class PBXContainerItemProxy(XCObject): - # When referencing an item in this project file, containerPortal is the - # PBXProject root object of this project file. When referencing an item in - # another project file, containerPortal is a PBXFileReference identifying - # the other project file. - # - # When serving as a proxy to an XCTarget (in this project file or another), - # proxyType is 1. When serving as a proxy to a PBXFileReference (in another - # project file), proxyType is 2. Type 2 is used for references to the - # producs of the other project file's targets. - # - # Xcode is weird about remoteGlobalIDString. Usually, it's printed without - # a comment, indicating that it's tracked internally simply as a string, but - # sometimes it's printed with a comment (usually when the object is initially - # created), indicating that it's tracked as a project file object at least - # sometimes. This module always tracks it as an object, but contains a hack - # to prevent it from printing the comment in the project file output. See - # _XCKVPrint. - _schema = XCObject._schema.copy() - _schema.update( - { - "containerPortal": [0, XCContainerPortal, 0, 1], - "proxyType": [0, int, 0, 1], - "remoteGlobalIDString": [0, XCRemoteObject, 0, 1], - "remoteInfo": [0, str, 0, 1], - } - ) - - def __repr__(self): - props = self._properties - name = "{}.gyp:{}".format(props["containerPortal"].Name(), props["remoteInfo"]) - return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" - - def Name(self): - # Admittedly not the best name, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # Use the hashables of the weak objects that this object refers to. - hashables.extend(self._properties["containerPortal"].Hashables()) - hashables.extend(self._properties["remoteGlobalIDString"].Hashables()) - return hashables - - -class PBXTargetDependency(XCObject): - # The "target" property accepts an XCTarget object, and obviously not - # NoneType. But XCTarget is defined below, so it can't be put into the - # schema yet. The definition of PBXTargetDependency can't be moved below - # XCTarget because XCTarget's own schema references PBXTargetDependency. - # Python doesn't deal well with this circular relationship, and doesn't have - # a real way to do forward declarations. To work around, the type of - # the "target" property is reset below, after XCTarget is defined. - # - # At least one of "name" and "target" is required. - _schema = XCObject._schema.copy() - _schema.update( - { - "name": [0, str, 0, 0], - "target": [0, None.__class__, 0, 0], - "targetProxy": [0, PBXContainerItemProxy, 1, 1], - } - ) - - def __repr__(self): - name = self._properties.get("name") or self._properties["target"].Name() - return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" - - def Name(self): - # Admittedly not the best name, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # Use the hashables of the weak objects that this object refers to. - hashables.extend(self._properties["targetProxy"].Hashables()) - return hashables - - -class PBXReferenceProxy(XCFileLikeElement): - _schema = XCFileLikeElement._schema.copy() - _schema.update( - { - "fileType": [0, str, 0, 1], - "path": [0, str, 0, 1], - "remoteRef": [0, PBXContainerItemProxy, 1, 1], - } - ) - - -class XCTarget(XCRemoteObject): - # An XCTarget is really just an XCObject, the XCRemoteObject thing is just - # to allow PBXProject to be used in the remoteGlobalIDString property of - # PBXContainerItemProxy. - # - # Setting a "name" property at instantiation may also affect "productName", - # which may in turn affect the "PRODUCT_NAME" build setting in children of - # "buildConfigurationList". See __init__ below. - _schema = XCRemoteObject._schema.copy() - _schema.update( - { - "buildConfigurationList": [ - 0, - XCConfigurationList, - 1, - 1, - XCConfigurationList(), - ], - "buildPhases": [1, XCBuildPhase, 1, 1, []], - "dependencies": [1, PBXTargetDependency, 1, 1, []], - "name": [0, str, 0, 1], - "productName": [0, str, 0, 1], - } - ) - - def __init__( - self, - properties=None, - id=None, - parent=None, - force_outdir=None, - force_prefix=None, - force_extension=None, - ): - # super - XCRemoteObject.__init__(self, properties, id, parent) - - # Set up additional defaults not expressed in the schema. If a "name" - # property was supplied, set "productName" if it is not present. Also set - # the "PRODUCT_NAME" build setting in each configuration, but only if - # the setting is not present in any build configuration. - if "name" in self._properties: - if "productName" not in self._properties: - self.SetProperty("productName", self._properties["name"]) - - if "productName" in self._properties: - if "buildConfigurationList" in self._properties: - configs = self._properties["buildConfigurationList"] - if configs.HasBuildSetting("PRODUCT_NAME") == 0: - configs.SetBuildSetting( - "PRODUCT_NAME", self._properties["productName"] - ) - - def AddDependency(self, other): - pbxproject = self.PBXProjectAncestor() - other_pbxproject = other.PBXProjectAncestor() - if pbxproject == other_pbxproject: - # Add a dependency to another target in the same project file. - container = PBXContainerItemProxy( - { - "containerPortal": pbxproject, - "proxyType": 1, - "remoteGlobalIDString": other, - "remoteInfo": other.Name(), - } - ) - dependency = PBXTargetDependency( - {"target": other, "targetProxy": container} - ) - self.AppendProperty("dependencies", dependency) - else: - # Add a dependency to a target in a different project file. - other_project_ref = pbxproject.AddOrGetProjectReference(other_pbxproject)[1] - container = PBXContainerItemProxy( - { - "containerPortal": other_project_ref, - "proxyType": 1, - "remoteGlobalIDString": other, - "remoteInfo": other.Name(), - } - ) - dependency = PBXTargetDependency( - {"name": other.Name(), "targetProxy": container} - ) - self.AppendProperty("dependencies", dependency) - - # Proxy all of these through to the build configuration list. - - def ConfigurationNamed(self, name): - return self._properties["buildConfigurationList"].ConfigurationNamed(name) - - def DefaultConfiguration(self): - return self._properties["buildConfigurationList"].DefaultConfiguration() - - def HasBuildSetting(self, key): - return self._properties["buildConfigurationList"].HasBuildSetting(key) - - def GetBuildSetting(self, key): - return self._properties["buildConfigurationList"].GetBuildSetting(key) - - def SetBuildSetting(self, key, value): - return self._properties["buildConfigurationList"].SetBuildSetting(key, value) - - def AppendBuildSetting(self, key, value): - return self._properties["buildConfigurationList"].AppendBuildSetting(key, value) - - def DelBuildSetting(self, key): - return self._properties["buildConfigurationList"].DelBuildSetting(key) - - -# Redefine the type of the "target" property. See PBXTargetDependency._schema -# above. -PBXTargetDependency._schema["target"][1] = XCTarget - - -class PBXNativeTarget(XCTarget): - # buildPhases is overridden in the schema to be able to set defaults. - # - # NOTE: Contrary to most objects, it is advisable to set parent when - # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject - # object. A parent reference is required for a PBXNativeTarget during - # construction to be able to set up the target defaults for productReference, - # because a PBXBuildFile object must be created for the target and it must - # be added to the PBXProject's mainGroup hierarchy. - _schema = XCTarget._schema.copy() - _schema.update( - { - "buildPhases": [ - 1, - XCBuildPhase, - 1, - 1, - [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()], - ], - "buildRules": [1, PBXBuildRule, 1, 1, []], - "productReference": [0, PBXFileReference, 0, 1], - "productType": [0, str, 0, 1], - } - ) - - # Mapping from Xcode product-types to settings. The settings are: - # filetype : used for explicitFileType in the project file - # prefix : the prefix for the file name - # suffix : the suffix for the file name - _product_filetypes = { - "com.apple.product-type.application": ["wrapper.application", "", ".app"], - "com.apple.product-type.application.watchapp": [ - "wrapper.application", - "", - ".app", - ], - "com.apple.product-type.watchkit-extension": [ - "wrapper.app-extension", - "", - ".appex", - ], - "com.apple.product-type.app-extension": ["wrapper.app-extension", "", ".appex"], - "com.apple.product-type.bundle": ["wrapper.cfbundle", "", ".bundle"], - "com.apple.product-type.framework": ["wrapper.framework", "", ".framework"], - "com.apple.product-type.library.dynamic": [ - "compiled.mach-o.dylib", - "lib", - ".dylib", - ], - "com.apple.product-type.library.static": ["archive.ar", "lib", ".a"], - "com.apple.product-type.tool": ["compiled.mach-o.executable", "", ""], - "com.apple.product-type.bundle.unit-test": ["wrapper.cfbundle", "", ".xctest"], - "com.apple.product-type.bundle.ui-testing": ["wrapper.cfbundle", "", ".xctest"], - "com.googlecode.gyp.xcode.bundle": ["compiled.mach-o.dylib", "", ".so"], - "com.apple.product-type.kernel-extension": ["wrapper.kext", "", ".kext"], - } - - def __init__( - self, - properties=None, - id=None, - parent=None, - force_outdir=None, - force_prefix=None, - force_extension=None, - ): - # super - XCTarget.__init__(self, properties, id, parent) - - if ( - "productName" in self._properties - and "productType" in self._properties - and "productReference" not in self._properties - and self._properties["productType"] in self._product_filetypes - ): - products_group = None - pbxproject = self.PBXProjectAncestor() - if pbxproject is not None: - products_group = pbxproject.ProductsGroup() - - if products_group is not None: - (filetype, prefix, suffix) = self._product_filetypes[ - self._properties["productType"] - ] - # Xcode does not have a distinct type for loadable modules that are - # pure BSD targets (not in a bundle wrapper). GYP allows such modules - # to be specified by setting a target type to loadable_module without - # having mac_bundle set. These are mapped to the pseudo-product type - # com.googlecode.gyp.xcode.bundle. - # - # By picking up this special type and converting it to a dynamic - # library (com.apple.product-type.library.dynamic) with fix-ups, - # single-file loadable modules can be produced. - # - # MACH_O_TYPE is changed to mh_bundle to produce the proper file type - # (as opposed to mh_dylib). In order for linking to succeed, - # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be - # cleared. They are meaningless for type mh_bundle. - # - # Finally, the .so extension is forcibly applied over the default - # (.dylib), unless another forced extension is already selected. - # .dylib is plainly wrong, and .bundle is used by loadable_modules in - # bundle wrappers (com.apple.product-type.bundle). .so seems an odd - # choice because it's used as the extension on many other systems that - # don't distinguish between linkable shared libraries and non-linkable - # loadable modules, but there's precedent: Python loadable modules on - # Mac OS X use an .so extension. - if self._properties["productType"] == "com.googlecode.gyp.xcode.bundle": - self._properties[ - "productType" - ] = "com.apple.product-type.library.dynamic" - self.SetBuildSetting("MACH_O_TYPE", "mh_bundle") - self.SetBuildSetting("DYLIB_CURRENT_VERSION", "") - self.SetBuildSetting("DYLIB_COMPATIBILITY_VERSION", "") - if force_extension is None: - force_extension = suffix[1:] - - if ( - self._properties["productType"] - == "com.apple.product-type-bundle.unit.test" - or self._properties["productType"] - == "com.apple.product-type-bundle.ui-testing" - ): - if force_extension is None: - force_extension = suffix[1:] - - if force_extension is not None: - # If it's a wrapper (bundle), set WRAPPER_EXTENSION. - # Extension override. - suffix = "." + force_extension - if filetype.startswith("wrapper."): - self.SetBuildSetting("WRAPPER_EXTENSION", force_extension) - else: - self.SetBuildSetting("EXECUTABLE_EXTENSION", force_extension) - - if filetype.startswith("compiled.mach-o.executable"): - product_name = self._properties["productName"] - product_name += suffix - suffix = "" - self.SetProperty("productName", product_name) - self.SetBuildSetting("PRODUCT_NAME", product_name) - - # Xcode handles most prefixes based on the target type, however there - # are exceptions. If a "BSD Dynamic Library" target is added in the - # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that - # behavior. - if force_prefix is not None: - prefix = force_prefix - if filetype.startswith("wrapper."): - self.SetBuildSetting("WRAPPER_PREFIX", prefix) - else: - self.SetBuildSetting("EXECUTABLE_PREFIX", prefix) - - if force_outdir is not None: - self.SetBuildSetting("TARGET_BUILD_DIR", force_outdir) - - # TODO(tvl): Remove the below hack. - # http://code.google.com/p/gyp/issues/detail?id=122 - - # Some targets include the prefix in the target_name. These targets - # really should just add a product_name setting that doesn't include - # the prefix. For example: - # target_name = 'libevent', product_name = 'event' - # This check cleans up for them. - product_name = self._properties["productName"] - prefix_len = len(prefix) - if prefix_len and (product_name[:prefix_len] == prefix): - product_name = product_name[prefix_len:] - self.SetProperty("productName", product_name) - self.SetBuildSetting("PRODUCT_NAME", product_name) - - ref_props = { - "explicitFileType": filetype, - "includeInIndex": 0, - "path": prefix + product_name + suffix, - "sourceTree": "BUILT_PRODUCTS_DIR", - } - file_ref = PBXFileReference(ref_props) - products_group.AppendChild(file_ref) - self.SetProperty("productReference", file_ref) - - def GetBuildPhaseByType(self, type): - if "buildPhases" not in self._properties: - return None - - the_phase = None - for phase in self._properties["buildPhases"]: - if isinstance(phase, type): - # Some phases may be present in multiples in a well-formed project file, - # but phases like PBXSourcesBuildPhase may only be present singly, and - # this function is intended as an aid to GetBuildPhaseByType. Loop - # over the entire list of phases and assert if more than one of the - # desired type is found. - assert the_phase is None - the_phase = phase - - return the_phase - - def HeadersPhase(self): - headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase) - if headers_phase is None: - headers_phase = PBXHeadersBuildPhase() - - # The headers phase should come before the resources, sources, and - # frameworks phases, if any. - insert_at = len(self._properties["buildPhases"]) - for index, phase in enumerate(self._properties["buildPhases"]): - if ( - isinstance(phase, PBXResourcesBuildPhase) - or isinstance(phase, PBXSourcesBuildPhase) - or isinstance(phase, PBXFrameworksBuildPhase) - ): - insert_at = index - break - - self._properties["buildPhases"].insert(insert_at, headers_phase) - headers_phase.parent = self - - return headers_phase - - def ResourcesPhase(self): - resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase) - if resources_phase is None: - resources_phase = PBXResourcesBuildPhase() - - # The resources phase should come before the sources and frameworks - # phases, if any. - insert_at = len(self._properties["buildPhases"]) - for index, phase in enumerate(self._properties["buildPhases"]): - if isinstance(phase, PBXSourcesBuildPhase) or isinstance( - phase, PBXFrameworksBuildPhase - ): - insert_at = index - break - - self._properties["buildPhases"].insert(insert_at, resources_phase) - resources_phase.parent = self - - return resources_phase - - def SourcesPhase(self): - sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase) - if sources_phase is None: - sources_phase = PBXSourcesBuildPhase() - self.AppendProperty("buildPhases", sources_phase) - - return sources_phase - - def FrameworksPhase(self): - frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase) - if frameworks_phase is None: - frameworks_phase = PBXFrameworksBuildPhase() - self.AppendProperty("buildPhases", frameworks_phase) - - return frameworks_phase - - def AddDependency(self, other): - # super - XCTarget.AddDependency(self, other) - - static_library_type = "com.apple.product-type.library.static" - shared_library_type = "com.apple.product-type.library.dynamic" - framework_type = "com.apple.product-type.framework" - if ( - isinstance(other, PBXNativeTarget) - and "productType" in self._properties - and self._properties["productType"] != static_library_type - and "productType" in other._properties - and ( - other._properties["productType"] == static_library_type - or ( - ( - other._properties["productType"] == shared_library_type - or other._properties["productType"] == framework_type - ) - and ( - (not other.HasBuildSetting("MACH_O_TYPE")) - or other.GetBuildSetting("MACH_O_TYPE") != "mh_bundle" - ) - ) - ) - ): - - file_ref = other.GetProperty("productReference") - - pbxproject = self.PBXProjectAncestor() - other_pbxproject = other.PBXProjectAncestor() - if pbxproject != other_pbxproject: - other_project_product_group = pbxproject.AddOrGetProjectReference( - other_pbxproject - )[0] - file_ref = other_project_product_group.GetChildByRemoteObject(file_ref) - - self.FrameworksPhase().AppendProperty( - "files", PBXBuildFile({"fileRef": file_ref}) - ) - - -class PBXAggregateTarget(XCTarget): - pass - - -class PBXProject(XCContainerPortal): - # A PBXProject is really just an XCObject, the XCContainerPortal thing is - # just to allow PBXProject to be used in the containerPortal property of - # PBXContainerItemProxy. - """ - - Attributes: - path: "sample.xcodeproj". TODO(mark) Document me! - _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each - value is a reference to the dict in the - projectReferences list associated with the keyed - PBXProject. - """ - - _schema = XCContainerPortal._schema.copy() - _schema.update( - { - "attributes": [0, dict, 0, 0], - "buildConfigurationList": [ - 0, - XCConfigurationList, - 1, - 1, - XCConfigurationList(), - ], - "compatibilityVersion": [0, str, 0, 1, "Xcode 3.2"], - "hasScannedForEncodings": [0, int, 0, 1, 1], - "mainGroup": [0, PBXGroup, 1, 1, PBXGroup()], - "projectDirPath": [0, str, 0, 1, ""], - "projectReferences": [1, dict, 0, 0], - "projectRoot": [0, str, 0, 1, ""], - "targets": [1, XCTarget, 1, 1, []], - } - ) - - def __init__(self, properties=None, id=None, parent=None, path=None): - self.path = path - self._other_pbxprojects = {} - # super - return XCContainerPortal.__init__(self, properties, id, parent) - - def Name(self): - name = self.path - if name[-10:] == ".xcodeproj": - name = name[:-10] - return posixpath.basename(name) - - def Path(self): - return self.path - - def Comment(self): - return "Project object" - - def Children(self): - # super - children = XCContainerPortal.Children(self) - - # Add children that the schema doesn't know about. Maybe there's a more - # elegant way around this, but this is the only case where we need to own - # objects in a dictionary (that is itself in a list), and three lines for - # a one-off isn't that big a deal. - if "projectReferences" in self._properties: - for reference in self._properties["projectReferences"]: - children.append(reference["ProductGroup"]) - - return children - - def PBXProjectAncestor(self): - return self - - def _GroupByName(self, name): - if "mainGroup" not in self._properties: - self.SetProperty("mainGroup", PBXGroup()) - - main_group = self._properties["mainGroup"] - group = main_group.GetChildByName(name) - if group is None: - group = PBXGroup({"name": name}) - main_group.AppendChild(group) - - return group - - # SourceGroup and ProductsGroup are created by default in Xcode's own - # templates. - def SourceGroup(self): - return self._GroupByName("Source") - - def ProductsGroup(self): - return self._GroupByName("Products") - - # IntermediatesGroup is used to collect source-like files that are generated - # by rules or script phases and are placed in intermediate directories such - # as DerivedSources. - def IntermediatesGroup(self): - return self._GroupByName("Intermediates") - - # FrameworksGroup and ProjectsGroup are top-level groups used to collect - # frameworks and projects. - def FrameworksGroup(self): - return self._GroupByName("Frameworks") - - def ProjectsGroup(self): - return self._GroupByName("Projects") - - def RootGroupForPath(self, path): - """Returns a PBXGroup child of this object to which path should be added. - - This method is intended to choose between SourceGroup and - IntermediatesGroup on the basis of whether path is present in a source - directory or an intermediates directory. For the purposes of this - determination, any path located within a derived file directory such as - PROJECT_DERIVED_FILE_DIR is treated as being in an intermediates - directory. - - The returned value is a two-element tuple. The first element is the - PBXGroup, and the second element specifies whether that group should be - organized hierarchically (True) or as a single flat list (False). - """ - - # TODO(mark): make this a class variable and bind to self on call? - # Also, this list is nowhere near exhaustive. - # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by - # gyp.generator.xcode. There should probably be some way for that module - # to push the names in, rather than having to hard-code them here. - source_tree_groups = { - "DERIVED_FILE_DIR": (self.IntermediatesGroup, True), - "INTERMEDIATE_DIR": (self.IntermediatesGroup, True), - "PROJECT_DERIVED_FILE_DIR": (self.IntermediatesGroup, True), - "SHARED_INTERMEDIATE_DIR": (self.IntermediatesGroup, True), - } - - (source_tree, path) = SourceTreeAndPathFromPath(path) - if source_tree is not None and source_tree in source_tree_groups: - (group_func, hierarchical) = source_tree_groups[source_tree] - group = group_func() - return (group, hierarchical) - - # TODO(mark): make additional choices based on file extension. - - return (self.SourceGroup(), True) - - def AddOrGetFileInRootGroup(self, path): - """Returns a PBXFileReference corresponding to path in the correct group - according to RootGroupForPath's heuristics. - - If an existing PBXFileReference for path exists, it will be returned. - Otherwise, one will be created and returned. - """ - - (group, hierarchical) = self.RootGroupForPath(path) - return group.AddOrGetFileByPath(path, hierarchical) - - def RootGroupsTakeOverOnlyChildren(self, recurse=False): - """Calls TakeOverOnlyChild for all groups in the main group.""" - - for group in self._properties["mainGroup"]._properties["children"]: - if isinstance(group, PBXGroup): - group.TakeOverOnlyChild(recurse) - - def SortGroups(self): - # Sort the children of the mainGroup (like "Source" and "Products") - # according to their defined order. - self._properties["mainGroup"]._properties["children"] = sorted( - self._properties["mainGroup"]._properties["children"], - key=cmp_to_key(lambda x, y: x.CompareRootGroup(y)), - ) - - # Sort everything else by putting group before files, and going - # alphabetically by name within sections of groups and files. SortGroup - # is recursive. - for group in self._properties["mainGroup"]._properties["children"]: - if not isinstance(group, PBXGroup): - continue - - if group.Name() == "Products": - # The Products group is a special case. Instead of sorting - # alphabetically, sort things in the order of the targets that - # produce the products. To do this, just build up a new list of - # products based on the targets. - products = [] - for target in self._properties["targets"]: - if not isinstance(target, PBXNativeTarget): - continue - product = target._properties["productReference"] - # Make sure that the product is already in the products group. - assert product in group._properties["children"] - products.append(product) - - # Make sure that this process doesn't miss anything that was already - # in the products group. - assert len(products) == len(group._properties["children"]) - group._properties["children"] = products - else: - group.SortGroup() - - def AddOrGetProjectReference(self, other_pbxproject): - """Add a reference to another project file (via PBXProject object) to this - one. - - Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in - this project file that contains a PBXReferenceProxy object for each - product of each PBXNativeTarget in the other project file. ProjectRef is - a PBXFileReference to the other project file. - - If this project file already references the other project file, the - existing ProductGroup and ProjectRef are returned. The ProductGroup will - still be updated if necessary. - """ - - if "projectReferences" not in self._properties: - self._properties["projectReferences"] = [] - - product_group = None - project_ref = None - - if other_pbxproject not in self._other_pbxprojects: - # This project file isn't yet linked to the other one. Establish the - # link. - product_group = PBXGroup({"name": "Products"}) - - # ProductGroup is strong. - product_group.parent = self - - # There's nothing unique about this PBXGroup, and if left alone, it will - # wind up with the same set of hashables as all other PBXGroup objects - # owned by the projectReferences list. Add the hashables of the - # remote PBXProject that it's related to. - product_group._hashables.extend(other_pbxproject.Hashables()) - - # The other project reports its path as relative to the same directory - # that this project's path is relative to. The other project's path - # is not necessarily already relative to this project. Figure out the - # pathname that this project needs to use to refer to the other one. - this_path = posixpath.dirname(self.Path()) - projectDirPath = self.GetProperty("projectDirPath") - if projectDirPath: - if posixpath.isabs(projectDirPath[0]): - this_path = projectDirPath - else: - this_path = posixpath.join(this_path, projectDirPath) - other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path) - - # ProjectRef is weak (it's owned by the mainGroup hierarchy). - project_ref = PBXFileReference( - { - "lastKnownFileType": "wrapper.pb-project", - "path": other_path, - "sourceTree": "SOURCE_ROOT", - } - ) - self.ProjectsGroup().AppendChild(project_ref) - - ref_dict = {"ProductGroup": product_group, "ProjectRef": project_ref} - self._other_pbxprojects[other_pbxproject] = ref_dict - self.AppendProperty("projectReferences", ref_dict) - - # Xcode seems to sort this list case-insensitively - self._properties["projectReferences"] = sorted( - self._properties["projectReferences"], - key=lambda x: x["ProjectRef"].Name().lower - ) - else: - # The link already exists. Pull out the relevnt data. - project_ref_dict = self._other_pbxprojects[other_pbxproject] - product_group = project_ref_dict["ProductGroup"] - project_ref = project_ref_dict["ProjectRef"] - - self._SetUpProductReferences(other_pbxproject, product_group, project_ref) - - inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False) - targets = other_pbxproject.GetProperty("targets") - if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets): - dir_path = project_ref._properties["path"] - product_group._hashables.extend(dir_path) - - return [product_group, project_ref] - - def _AllSymrootsUnique(self, target, inherit_unique_symroot): - # Returns True if all configurations have a unique 'SYMROOT' attribute. - # The value of inherit_unique_symroot decides, if a configuration is assumed - # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't - # define an explicit value for 'SYMROOT'. - symroots = self._DefinedSymroots(target) - for s in self._DefinedSymroots(target): - if ( - s is not None - and not self._IsUniqueSymrootForTarget(s) - or s is None - and not inherit_unique_symroot - ): - return False - return True if symroots else inherit_unique_symroot - - def _DefinedSymroots(self, target): - # Returns all values for the 'SYMROOT' attribute defined in all - # configurations for this target. If any configuration doesn't define the - # 'SYMROOT' attribute, None is added to the returned set. If all - # configurations don't define the 'SYMROOT' attribute, an empty set is - # returned. - config_list = target.GetProperty("buildConfigurationList") - symroots = set() - for config in config_list.GetProperty("buildConfigurations"): - setting = config.GetProperty("buildSettings") - if "SYMROOT" in setting: - symroots.add(setting["SYMROOT"]) - else: - symroots.add(None) - if len(symroots) == 1 and None in symroots: - return set() - return symroots - - def _IsUniqueSymrootForTarget(self, symroot): - # This method returns True if all configurations in target contain a - # 'SYMROOT' attribute that is unique for the given target. A value is - # unique, if the Xcode macro '$SRCROOT' appears in it in any form. - uniquifier = ["$SRCROOT", "$(SRCROOT)"] - if any(x in symroot for x in uniquifier): - return True - return False - - def _SetUpProductReferences(self, other_pbxproject, product_group, project_ref): - # TODO(mark): This only adds references to products in other_pbxproject - # when they don't exist in this pbxproject. Perhaps it should also - # remove references from this pbxproject that are no longer present in - # other_pbxproject. Perhaps it should update various properties if they - # change. - for target in other_pbxproject._properties["targets"]: - if not isinstance(target, PBXNativeTarget): - continue - - other_fileref = target._properties["productReference"] - if product_group.GetChildByRemoteObject(other_fileref) is None: - # Xcode sets remoteInfo to the name of the target and not the name - # of its product, despite this proxy being a reference to the product. - container_item = PBXContainerItemProxy( - { - "containerPortal": project_ref, - "proxyType": 2, - "remoteGlobalIDString": other_fileref, - "remoteInfo": target.Name(), - } - ) - # TODO(mark): Does sourceTree get copied straight over from the other - # project? Can the other project ever have lastKnownFileType here - # instead of explicitFileType? (Use it if so?) Can path ever be - # unset? (I don't think so.) Can other_fileref have name set, and - # does it impact the PBXReferenceProxy if so? These are the questions - # that perhaps will be answered one day. - reference_proxy = PBXReferenceProxy( - { - "fileType": other_fileref._properties["explicitFileType"], - "path": other_fileref._properties["path"], - "sourceTree": other_fileref._properties["sourceTree"], - "remoteRef": container_item, - } - ) - - product_group.AppendChild(reference_proxy) - - def SortRemoteProductReferences(self): - # For each remote project file, sort the associated ProductGroup in the - # same order that the targets are sorted in the remote project file. This - # is the sort order used by Xcode. - - def CompareProducts(x, y, remote_products): - # x and y are PBXReferenceProxy objects. Go through their associated - # PBXContainerItem to get the remote PBXFileReference, which will be - # present in the remote_products list. - x_remote = x._properties["remoteRef"]._properties["remoteGlobalIDString"] - y_remote = y._properties["remoteRef"]._properties["remoteGlobalIDString"] - x_index = remote_products.index(x_remote) - y_index = remote_products.index(y_remote) - - # Use the order of each remote PBXFileReference in remote_products to - # determine the sort order. - return cmp(x_index, y_index) - - for other_pbxproject, ref_dict in self._other_pbxprojects.items(): - # Build up a list of products in the remote project file, ordered the - # same as the targets that produce them. - remote_products = [] - for target in other_pbxproject._properties["targets"]: - if not isinstance(target, PBXNativeTarget): - continue - remote_products.append(target._properties["productReference"]) - - # Sort the PBXReferenceProxy children according to the list of remote - # products. - product_group = ref_dict["ProductGroup"] - product_group._properties["children"] = sorted( - product_group._properties["children"], - key=cmp_to_key( - lambda x, y, rp=remote_products: CompareProducts(x, y, rp)), - ) - - -class XCProjectFile(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "archiveVersion": [0, int, 0, 1, 1], - "classes": [0, dict, 0, 1, {}], - "objectVersion": [0, int, 0, 1, 46], - "rootObject": [0, PBXProject, 1, 1], - } - ) - - def ComputeIDs(self, recursive=True, overwrite=True, hash=None): - # Although XCProjectFile is implemented here as an XCObject, it's not a - # proper object in the Xcode sense, and it certainly doesn't have its own - # ID. Pass through an attempt to update IDs to the real root object. - if recursive: - self._properties["rootObject"].ComputeIDs(recursive, overwrite, hash) - - def Print(self, file=sys.stdout): - self.VerifyHasRequiredProperties() - - # Add the special "objects" property, which will be caught and handled - # separately during printing. This structure allows a fairly standard - # loop do the normal printing. - self._properties["objects"] = {} - self._XCPrint(file, 0, "// !$*UTF8*$!\n") - if self._should_print_single_line: - self._XCPrint(file, 0, "{ ") - else: - self._XCPrint(file, 0, "{\n") - for property, value in sorted( - self._properties.items() - ): - if property == "objects": - self._PrintObjects(file) - else: - self._XCKVPrint(file, 1, property, value) - self._XCPrint(file, 0, "}\n") - del self._properties["objects"] - - def _PrintObjects(self, file): - if self._should_print_single_line: - self._XCPrint(file, 0, "objects = {") - else: - self._XCPrint(file, 1, "objects = {\n") - - objects_by_class = {} - for object in self.Descendants(): - if object == self: - continue - class_name = object.__class__.__name__ - if class_name not in objects_by_class: - objects_by_class[class_name] = [] - objects_by_class[class_name].append(object) - - for class_name in sorted(objects_by_class): - self._XCPrint(file, 0, "\n") - self._XCPrint(file, 0, "/* Begin " + class_name + " section */\n") - for object in sorted( - objects_by_class[class_name], key=attrgetter("id") - ): - object.Print(file) - self._XCPrint(file, 0, "/* End " + class_name + " section */\n") - - if self._should_print_single_line: - self._XCPrint(file, 0, "}; ") - else: - self._XCPrint(file, 1, "};\n") diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py deleted file mode 100644 index 530196366..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Applies a fix to CR LF TAB handling in xml.dom. - -Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 -Working around this: http://bugs.python.org/issue5752 -TODO(bradnelson): Consider dropping this when we drop XP support. -""" - - -import xml.dom.minidom - - -def _Replacement_write_data(writer, data, is_attrib=False): - """Writes datachars to writer.""" - data = data.replace("&", "&").replace("<", "<") - data = data.replace('"', """).replace(">", ">") - if is_attrib: - data = data.replace("\r", " ").replace("\n", " ").replace("\t", " ") - writer.write(data) - - -def _Replacement_writexml(self, writer, indent="", addindent="", newl=""): - # indent = current indentation - # addindent = indentation to add to higher levels - # newl = newline string - writer.write(indent + "<" + self.tagName) - - attrs = self._get_attributes() - a_names = sorted(attrs.keys()) - - for a_name in a_names: - writer.write(' %s="' % a_name) - _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) - writer.write('"') - if self.childNodes: - writer.write(">%s" % newl) - for node in self.childNodes: - node.writexml(writer, indent + addindent, addindent, newl) - writer.write(f"{indent}{newl}") - else: - writer.write("/>%s" % newl) - - -class XmlFix: - """Object to manage temporary patching of xml.dom.minidom.""" - - def __init__(self): - # Preserve current xml.dom.minidom functions. - self.write_data = xml.dom.minidom._write_data - self.writexml = xml.dom.minidom.Element.writexml - # Inject replacement versions of a function and a method. - xml.dom.minidom._write_data = _Replacement_write_data - xml.dom.minidom.Element.writexml = _Replacement_writexml - - def Cleanup(self): - if self.write_data: - xml.dom.minidom._write_data = self.write_data - xml.dom.minidom.Element.writexml = self.writexml - self.write_data = None - - def __del__(self): - self.Cleanup() diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/requirements_dev.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/requirements_dev.txt deleted file mode 100644 index 28ecacab6..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/requirements_dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -flake8 -pytest diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/setup.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/setup.py deleted file mode 100644 index cf9d7d2e5..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2009 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -from os import path - -from setuptools import setup - -here = path.abspath(path.dirname(__file__)) -# Get the long description from the README file -with open(path.join(here, "README.md")) as in_file: - long_description = in_file.read() - -setup( - name="gyp-next", - version="0.10.0", - description="A fork of the GYP build system for use in the Node.js projects", - long_description=long_description, - long_description_content_type="text/markdown", - author="Node.js contributors", - author_email="ryzokuken@disroot.org", - url="https://github.com/nodejs/gyp-next", - package_dir={"": "pylib"}, - packages=["gyp", "gyp.generator"], - entry_points={"console_scripts": ["gyp=gyp:script_main"]}, - python_requires=">=3.6", - classifiers=[ - "Development Status :: 3 - Alpha", - "Environment :: Console", - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], -) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/test_gyp.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/test_gyp.py deleted file mode 100755 index 9ba264170..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/test_gyp.py +++ /dev/null @@ -1,260 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""gyptest.py -- test runner for GYP tests.""" - - -import argparse -import os -import platform -import subprocess -import sys -import time - - -def is_test_name(f): - return f.startswith("gyptest") and f.endswith(".py") - - -def find_all_gyptest_files(directory): - result = [] - for root, dirs, files in os.walk(directory): - result.extend([os.path.join(root, f) for f in files if is_test_name(f)]) - result.sort() - return result - - -def main(argv=None): - if argv is None: - argv = sys.argv - - parser = argparse.ArgumentParser() - parser.add_argument("-a", "--all", action="store_true", help="run all tests") - parser.add_argument("-C", "--chdir", action="store", help="change to directory") - parser.add_argument( - "-f", - "--format", - action="store", - default="", - help="run tests with the specified formats", - ) - parser.add_argument( - "-G", - "--gyp_option", - action="append", - default=[], - help="Add -G options to the gyp command line", - ) - parser.add_argument( - "-l", "--list", action="store_true", help="list available tests and exit" - ) - parser.add_argument( - "-n", - "--no-exec", - action="store_true", - help="no execute, just print the command line", - ) - parser.add_argument( - "--path", action="append", default=[], help="additional $PATH directory" - ) - parser.add_argument( - "-q", - "--quiet", - action="store_true", - help="quiet, don't print anything unless there are failures", - ) - parser.add_argument( - "-v", - "--verbose", - action="store_true", - help="print configuration info and test results.", - ) - parser.add_argument("tests", nargs="*") - args = parser.parse_args(argv[1:]) - - if args.chdir: - os.chdir(args.chdir) - - if args.path: - extra_path = [os.path.abspath(p) for p in args.path] - extra_path = os.pathsep.join(extra_path) - os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"] - - if not args.tests: - if not args.all: - sys.stderr.write("Specify -a to get all tests.\n") - return 1 - args.tests = ["test"] - - tests = [] - for arg in args.tests: - if os.path.isdir(arg): - tests.extend(find_all_gyptest_files(os.path.normpath(arg))) - else: - if not is_test_name(os.path.basename(arg)): - print(arg, "is not a valid gyp test name.", file=sys.stderr) - sys.exit(1) - tests.append(arg) - - if args.list: - for test in tests: - print(test) - sys.exit(0) - - os.environ["PYTHONPATH"] = os.path.abspath("test/lib") - - if args.verbose: - print_configuration_info() - - if args.gyp_option and not args.quiet: - print("Extra Gyp options: %s\n" % args.gyp_option) - - if args.format: - format_list = args.format.split(",") - else: - format_list = { - "aix5": ["make"], - "freebsd7": ["make"], - "freebsd8": ["make"], - "openbsd5": ["make"], - "cygwin": ["msvs"], - "win32": ["msvs", "ninja"], - "linux": ["make", "ninja"], - "linux2": ["make", "ninja"], - "linux3": ["make", "ninja"], - # TODO: Re-enable xcode-ninja. - # https://bugs.chromium.org/p/gyp/issues/detail?id=530 - # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], - "darwin": ["make", "ninja", "xcode"], - }[sys.platform] - - gyp_options = [] - for option in args.gyp_option: - gyp_options += ["-G", option] - - runner = Runner(format_list, tests, gyp_options, args.verbose) - runner.run() - - if not args.quiet: - runner.print_results() - - return 1 if runner.failures else 0 - - -def print_configuration_info(): - print("Test configuration:") - if sys.platform == "darwin": - sys.path.append(os.path.abspath("test/lib")) - import TestMac - - print(f" Mac {platform.mac_ver()[0]} {platform.mac_ver()[2]}") - print(f" Xcode {TestMac.Xcode.Version()}") - elif sys.platform == "win32": - sys.path.append(os.path.abspath("pylib")) - import gyp.MSVSVersion - - print(" Win %s %s\n" % platform.win32_ver()[0:2]) - print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description()) - elif sys.platform in ("linux", "linux2"): - print(" Linux %s" % " ".join(platform.linux_distribution())) - print(f" Python {platform.python_version()}") - print(f" PYTHONPATH={os.environ['PYTHONPATH']}") - print() - - -class Runner: - def __init__(self, formats, tests, gyp_options, verbose): - self.formats = formats - self.tests = tests - self.verbose = verbose - self.gyp_options = gyp_options - self.failures = [] - self.num_tests = len(formats) * len(tests) - num_digits = len(str(self.num_tests)) - self.fmt_str = "[%%%dd/%%%dd] (%%s) %%s" % (num_digits, num_digits) - self.isatty = sys.stdout.isatty() and not self.verbose - self.env = os.environ.copy() - self.hpos = 0 - - def run(self): - run_start = time.time() - - i = 1 - for fmt in self.formats: - for test in self.tests: - self.run_test(test, fmt, i) - i += 1 - - if self.isatty: - self.erase_current_line() - - self.took = time.time() - run_start - - def run_test(self, test, fmt, i): - if self.isatty: - self.erase_current_line() - - msg = self.fmt_str % (i, self.num_tests, fmt, test) - self.print_(msg) - - start = time.time() - cmd = [sys.executable, test] + self.gyp_options - self.env["TESTGYP_FORMAT"] = fmt - proc = subprocess.Popen( - cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=self.env - ) - proc.wait() - took = time.time() - start - - stdout = proc.stdout.read().decode("utf8") - if proc.returncode == 2: - res = "skipped" - elif proc.returncode: - res = "failed" - self.failures.append(f"({test}) {fmt}") - else: - res = "passed" - res_msg = f" {res} {took:.3f}s" - self.print_(res_msg) - - if stdout and not stdout.endswith(("PASSED\n", "NO RESULT\n")): - print() - print("\n".join(f" {line}" for line in stdout.splitlines())) - elif not self.isatty: - print() - - def print_(self, msg): - print(msg, end="") - index = msg.rfind("\n") - if index == -1: - self.hpos += len(msg) - else: - self.hpos = len(msg) - index - sys.stdout.flush() - - def erase_current_line(self): - print("\b" * self.hpos + " " * self.hpos + "\b" * self.hpos, end="") - sys.stdout.flush() - self.hpos = 0 - - def print_results(self): - num_failures = len(self.failures) - if num_failures: - print() - if num_failures == 1: - print("Failed the following test:") - else: - print("Failed the following %d tests:" % num_failures) - print("\t" + "\n\t".join(sorted(self.failures))) - print() - print( - "Ran %d tests in %.3fs, %d failed." - % (self.num_tests, self.took, num_failures) - ) - print() - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/README b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/README deleted file mode 100644 index 84a73d152..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/README +++ /dev/null @@ -1,15 +0,0 @@ -pretty_vcproj: - Usage: pretty_vcproj.py "c:\path\to\vcproj.vcproj" [key1=value1] [key2=value2] - - They key/value pair are used to resolve vsprops name. - - For example, if I want to diff the base.vcproj project: - - pretty_vcproj.py z:\dev\src-chrome\src\base\build\base.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > original.txt - pretty_vcproj.py z:\dev\src-chrome\src\base\base_gyp.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > gyp.txt - - And you can use your favorite diff tool to see the changes. - - Note: In the case of base.vcproj, the original vcproj is one level up the generated one. - I suggest you do a search and replace for '"..\' and replace it with '"' in original.txt - before you perform the diff. \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/README b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/README deleted file mode 100644 index 2492a2c2f..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/README +++ /dev/null @@ -1,5 +0,0 @@ -Specifications contains syntax formatters for Xcode 3. These do not appear to be supported yet on Xcode 4. To use these with Xcode 3 please install both the gyp.pbfilespec and gyp.xclangspec files in - -~/Library/Application Support/Developer/Shared/Xcode/Specifications/ - -and restart Xcode. \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec deleted file mode 100644 index 85e2e268a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec +++ /dev/null @@ -1,27 +0,0 @@ -/* - gyp.pbfilespec - GYP source file spec for Xcode 3 - - There is not much documentation available regarding the format - of .pbfilespec files. As a starting point, see for instance the - outdated documentation at: - http://maxao.free.fr/xcode-plugin-interface/specifications.html - and the files in: - /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/ - - Place this file in directory: - ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ -*/ - -( - { - Identifier = sourcecode.gyp; - BasedOn = sourcecode; - Name = "GYP Files"; - Extensions = ("gyp", "gypi"); - MIMETypes = ("text/gyp"); - Language = "xcode.lang.gyp"; - IsTextFile = YES; - IsSourceFile = YES; - } -) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec deleted file mode 100644 index 3b3506d31..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec +++ /dev/null @@ -1,226 +0,0 @@ -/* - Copyright (c) 2011 Google Inc. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - - gyp.xclangspec - GYP language specification for Xcode 3 - - There is not much documentation available regarding the format - of .xclangspec files. As a starting point, see for instance the - outdated documentation at: - http://maxao.free.fr/xcode-plugin-interface/specifications.html - and the files in: - /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/ - - Place this file in directory: - ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ -*/ - -( - - { - Identifier = "xcode.lang.gyp.keyword"; - Syntax = { - Words = ( - "and", - "or", - " (caar gyp-parse-history) target-point) - (setq gyp-parse-history (cdr gyp-parse-history)))) - -(defun gyp-parse-point () - "The point of the last parse state added by gyp-parse-to." - (caar gyp-parse-history)) - -(defun gyp-parse-sections () - "A list of section symbols holding at the last parse state point." - (cdar gyp-parse-history)) - -(defun gyp-inside-dictionary-p () - "Predicate returning true if the parser is inside a dictionary." - (not (eq (cadar gyp-parse-history) 'list))) - -(defun gyp-add-parse-history (point sections) - "Add parse state SECTIONS to the parse history at POINT so that parsing can be - resumed instantly." - (while (>= (caar gyp-parse-history) point) - (setq gyp-parse-history (cdr gyp-parse-history))) - (setq gyp-parse-history (cons (cons point sections) gyp-parse-history))) - -(defun gyp-parse-to (target-point) - "Parses from (point) to TARGET-POINT adding the parse state information to - gyp-parse-state-history. Parsing stops if TARGET-POINT is reached or if a - string literal has been parsed. Returns nil if no further parsing can be - done, otherwise returns the position of the start of a parsed string, leaving - the point at the end of the string." - (let ((parsing t) - string-start) - (while parsing - (setq string-start nil) - ;; Parse up to a character that starts a sexp, or if the nesting - ;; level decreases. - (let ((state (parse-partial-sexp (gyp-parse-point) - target-point - -1 - t)) - (sections (gyp-parse-sections))) - (if (= (nth 0 state) -1) - (setq sections (cdr sections)) ; pop out a level - (cond ((looking-at-p "['\"]") ; a string - (setq string-start (point)) - (goto-char (scan-sexps (point) 1)) - (if (gyp-inside-dictionary-p) - ;; Look for sections inside a dictionary - (let ((section (gyp-section-name - (buffer-substring-no-properties - (+ 1 string-start) - (- (point) 1))))) - (setq sections (cons section (cdr sections))))) - ;; Stop after the string so it can be fontified. - (setq target-point (point))) - ((looking-at-p "{") - ;; Inside a dictionary. Increase nesting. - (forward-char 1) - (setq sections (cons 'unknown sections))) - ((looking-at-p "\\[") - ;; Inside a list. Increase nesting - (forward-char 1) - (setq sections (cons 'list sections))) - ((not (eobp)) - ;; other - (forward-char 1)))) - (gyp-add-parse-history (point) sections) - (setq parsing (< (point) target-point)))) - string-start)) - -(defun gyp-section-at-point () - "Transform the last parse state, which is a list of nested sections and return - the section symbol that should be used to determine font-lock information for - the string. Can return nil indicating the string should not have any attached - section." - (let ((sections (gyp-parse-sections))) - (cond - ((eq (car sections) 'conditions) - ;; conditions can occur in a variables section, but we still want to - ;; highlight it as a keyword. - nil) - ((and (eq (car sections) 'list) - (eq (cadr sections) 'list)) - ;; conditions and sources can have items in [[ ]] - (caddr sections)) - (t (cadr sections))))) - -(defun gyp-section-match (limit) - "Parse from (point) to LIMIT returning by means of match data what was - matched. The group of the match indicates what style font-lock should apply. - See also `gyp-add-font-lock-keywords'." - (gyp-invalidate-parse-states-after (point)) - (let ((group nil) - (string-start t)) - (while (and (< (point) limit) - (not group) - string-start) - (setq string-start (gyp-parse-to limit)) - (if string-start - (setq group (cl-case (gyp-section-at-point) - ('dependencies 1) - ('variables 2) - ('conditions 2) - ('sources 3) - ('defines 4) - (nil nil))))) - (if group - (progn - ;; Set the match data to indicate to the font-lock mechanism the - ;; highlighting to be performed. - (set-match-data (append (list string-start (point)) - (make-list (* (1- group) 2) nil) - (list (1+ string-start) (1- (point))))) - t)))) - -;;; Please see http://code.google.com/p/gyp/wiki/GypLanguageSpecification for -;;; canonical list of keywords. -(defun gyp-add-font-lock-keywords () - "Add gyp-mode keywords to font-lock mechanism." - ;; TODO(jknotten): Move all the keyword highlighting into gyp-section-match - ;; so that we can do the font-locking in a single font-lock pass. - (font-lock-add-keywords - nil - (list - ;; Top-level keywords - (list (concat "['\"]\\(" - (regexp-opt (list "action" "action_name" "actions" "cflags" - "cflags_cc" "conditions" "configurations" - "copies" "defines" "dependencies" "destination" - "direct_dependent_settings" - "export_dependent_settings" "extension" "files" - "include_dirs" "includes" "inputs" "ldflags" "libraries" - "link_settings" "mac_bundle" "message" - "msvs_external_rule" "outputs" "product_name" - "process_outputs_as_sources" "rules" "rule_name" - "sources" "suppress_wildcard" - "target_conditions" "target_defaults" - "target_defines" "target_name" "toolsets" - "targets" "type" "variables" "xcode_settings")) - "[!/+=]?\\)") 1 'font-lock-keyword-face t) - ;; Type of target - (list (concat "['\"]\\(" - (regexp-opt (list "loadable_module" "static_library" - "shared_library" "executable" "none")) - "\\)") 1 'font-lock-type-face t) - (list "\\(?:target\\|action\\)_name['\"]\\s-*:\\s-*['\"]\\([^ '\"]*\\)" 1 - 'font-lock-function-name-face t) - (list 'gyp-section-match - (list 1 'font-lock-function-name-face t t) ; dependencies - (list 2 'font-lock-variable-name-face t t) ; variables, conditions - (list 3 'font-lock-constant-face t t) ; sources - (list 4 'font-lock-preprocessor-face t t)) ; preprocessor - ;; Variable expansion - (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) - ;; Command expansion - (list " "{dst}"') - - print("}") - - -def main(): - if len(sys.argv) < 2: - print(__doc__, file=sys.stderr) - print(file=sys.stderr) - print("usage: %s target1 target2..." % (sys.argv[0]), file=sys.stderr) - return 1 - - edges = LoadEdges("dump.json", sys.argv[1:]) - - WriteGraph(edges) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_gyp.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_gyp.py deleted file mode 100755 index 4ffa44455..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_gyp.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Pretty-prints the contents of a GYP file.""" - - -import sys -import re - - -# Regex to remove comments when we're counting braces. -COMMENT_RE = re.compile(r"\s*#.*") - -# Regex to remove quoted strings when we're counting braces. -# It takes into account quoted quotes, and makes sure that the quotes match. -# NOTE: It does not handle quotes that span more than one line, or -# cases where an escaped quote is preceded by an escaped backslash. -QUOTE_RE_STR = r'(?P[\'"])(.*?)(? 0: - after = True - - # This catches the special case of a closing brace having something - # other than just whitespace ahead of it -- we don't want to - # unindent that until after this line is printed so it stays with - # the previous indentation level. - if cnt < 0 and closing_prefix_re.match(stripline): - after = True - return (cnt, after) - - -def prettyprint_input(lines): - """Does the main work of indenting the input based on the brace counts.""" - indent = 0 - basic_offset = 2 - for line in lines: - if COMMENT_RE.match(line): - print(line) - else: - line = line.strip("\r\n\t ") # Otherwise doesn't strip \r on Unix. - if len(line) > 0: - (brace_diff, after) = count_braces(line) - if brace_diff != 0: - if after: - print(" " * (basic_offset * indent) + line) - indent += brace_diff - else: - indent += brace_diff - print(" " * (basic_offset * indent) + line) - else: - print(" " * (basic_offset * indent) + line) - else: - print("") - - -def main(): - if len(sys.argv) > 1: - data = open(sys.argv[1]).read().splitlines() - else: - data = sys.stdin.read().splitlines() - # Split up the double braces. - lines = split_double_braces(data) - - # Indent and print the output. - prettyprint_input(lines) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_sln.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_sln.py deleted file mode 100755 index 6ca0cd12a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_sln.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Prints the information in a sln file in a diffable way. - - It first outputs each projects in alphabetical order with their - dependencies. - - Then it outputs a possible build order. -""" - - -import os -import re -import sys -import pretty_vcproj - -__author__ = "nsylvain (Nicolas Sylvain)" - - -def BuildProject(project, built, projects, deps): - # if all dependencies are done, we can build it, otherwise we try to build the - # dependency. - # This is not infinite-recursion proof. - for dep in deps[project]: - if dep not in built: - BuildProject(dep, built, projects, deps) - print(project) - built.append(project) - - -def ParseSolution(solution_file): - # All projects, their clsid and paths. - projects = dict() - - # A list of dependencies associated with a project. - dependencies = dict() - - # Regular expressions that matches the SLN format. - # The first line of a project definition. - begin_project = re.compile( - r'^Project\("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' - r'}"\) = "(.*)", "(.*)", "(.*)"$' - ) - # The last line of a project definition. - end_project = re.compile("^EndProject$") - # The first line of a dependency list. - begin_dep = re.compile(r"ProjectSection\(ProjectDependencies\) = postProject$") - # The last line of a dependency list. - end_dep = re.compile("EndProjectSection$") - # A line describing a dependency. - dep_line = re.compile(" *({.*}) = ({.*})$") - - in_deps = False - solution = open(solution_file) - for line in solution: - results = begin_project.search(line) - if results: - # Hack to remove icu because the diff is too different. - if results.group(1).find("icu") != -1: - continue - # We remove "_gyp" from the names because it helps to diff them. - current_project = results.group(1).replace("_gyp", "") - projects[current_project] = [ - results.group(2).replace("_gyp", ""), - results.group(3), - results.group(2), - ] - dependencies[current_project] = [] - continue - - results = end_project.search(line) - if results: - current_project = None - continue - - results = begin_dep.search(line) - if results: - in_deps = True - continue - - results = end_dep.search(line) - if results: - in_deps = False - continue - - results = dep_line.search(line) - if results and in_deps and current_project: - dependencies[current_project].append(results.group(1)) - continue - - # Change all dependencies clsid to name instead. - for project in dependencies: - # For each dependencies in this project - new_dep_array = [] - for dep in dependencies[project]: - # Look for the project name matching this cldis - for project_info in projects: - if projects[project_info][1] == dep: - new_dep_array.append(project_info) - dependencies[project] = sorted(new_dep_array) - - return (projects, dependencies) - - -def PrintDependencies(projects, deps): - print("---------------------------------------") - print("Dependencies for all projects") - print("---------------------------------------") - print("-- --") - - for (project, dep_list) in sorted(deps.items()): - print("Project : %s" % project) - print("Path : %s" % projects[project][0]) - if dep_list: - for dep in dep_list: - print(" - %s" % dep) - print("") - - print("-- --") - - -def PrintBuildOrder(projects, deps): - print("---------------------------------------") - print("Build order ") - print("---------------------------------------") - print("-- --") - - built = [] - for (project, _) in sorted(deps.items()): - if project not in built: - BuildProject(project, built, projects, deps) - - print("-- --") - - -def PrintVCProj(projects): - - for project in projects: - print("-------------------------------------") - print("-------------------------------------") - print(project) - print(project) - print(project) - print("-------------------------------------") - print("-------------------------------------") - - project_path = os.path.abspath( - os.path.join(os.path.dirname(sys.argv[1]), projects[project][2]) - ) - - pretty = pretty_vcproj - argv = [ - "", - project_path, - "$(SolutionDir)=%s\\" % os.path.dirname(sys.argv[1]), - ] - argv.extend(sys.argv[3:]) - pretty.main(argv) - - -def main(): - # check if we have exactly 1 parameter. - if len(sys.argv) < 2: - print('Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0]) - return 1 - - (projects, deps) = ParseSolution(sys.argv[1]) - PrintDependencies(projects, deps) - PrintBuildOrder(projects, deps) - - if "--recursive" in sys.argv: - PrintVCProj(projects) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_vcproj.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_vcproj.py deleted file mode 100755 index 00d32debd..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +++ /dev/null @@ -1,339 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Make the format of a vcproj really pretty. - - This script normalize and sort an xml. It also fetches all the properties - inside linked vsprops and include them explicitly in the vcproj. - - It outputs the resulting xml to stdout. -""" - - -import os -import sys - -from xml.dom.minidom import parse -from xml.dom.minidom import Node - -__author__ = "nsylvain (Nicolas Sylvain)" -ARGUMENTS = None -REPLACEMENTS = dict() - - -def cmp(x, y): - return (x > y) - (x < y) - - -class CmpTuple: - """Compare function between 2 tuple.""" - - def __call__(self, x, y): - return cmp(x[0], y[0]) - - -class CmpNode: - """Compare function between 2 xml nodes.""" - - def __call__(self, x, y): - def get_string(node): - node_string = "node" - node_string += node.nodeName - if node.nodeValue: - node_string += node.nodeValue - - if node.attributes: - # We first sort by name, if present. - node_string += node.getAttribute("Name") - - all_nodes = [] - for (name, value) in node.attributes.items(): - all_nodes.append((name, value)) - - all_nodes.sort(CmpTuple()) - for (name, value) in all_nodes: - node_string += name - node_string += value - - return node_string - - return cmp(get_string(x), get_string(y)) - - -def PrettyPrintNode(node, indent=0): - if node.nodeType == Node.TEXT_NODE: - if node.data.strip(): - print("{}{}".format(" " * indent, node.data.strip())) - return - - if node.childNodes: - node.normalize() - # Get the number of attributes - attr_count = 0 - if node.attributes: - attr_count = node.attributes.length - - # Print the main tag - if attr_count == 0: - print("{}<{}>".format(" " * indent, node.nodeName)) - else: - print("{}<{}".format(" " * indent, node.nodeName)) - - all_attributes = [] - for (name, value) in node.attributes.items(): - all_attributes.append((name, value)) - all_attributes.sort(CmpTuple()) - for (name, value) in all_attributes: - print('{} {}="{}"'.format(" " * indent, name, value)) - print("%s>" % (" " * indent)) - if node.nodeValue: - print("{} {}".format(" " * indent, node.nodeValue)) - - for sub_node in node.childNodes: - PrettyPrintNode(sub_node, indent=indent + 2) - print("{}".format(" " * indent, node.nodeName)) - - -def FlattenFilter(node): - """Returns a list of all the node and sub nodes.""" - node_list = [] - - if node.attributes and node.getAttribute("Name") == "_excluded_files": - # We don't add the "_excluded_files" filter. - return [] - - for current in node.childNodes: - if current.nodeName == "Filter": - node_list.extend(FlattenFilter(current)) - else: - node_list.append(current) - - return node_list - - -def FixFilenames(filenames, current_directory): - new_list = [] - for filename in filenames: - if filename: - for key in REPLACEMENTS: - filename = filename.replace(key, REPLACEMENTS[key]) - os.chdir(current_directory) - filename = filename.strip("\"' ") - if filename.startswith("$"): - new_list.append(filename) - else: - new_list.append(os.path.abspath(filename)) - return new_list - - -def AbsoluteNode(node): - """Makes all the properties we know about in this node absolute.""" - if node.attributes: - for (name, value) in node.attributes.items(): - if name in [ - "InheritedPropertySheets", - "RelativePath", - "AdditionalIncludeDirectories", - "IntermediateDirectory", - "OutputDirectory", - "AdditionalLibraryDirectories", - ]: - # We want to fix up these paths - path_list = value.split(";") - new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) - node.setAttribute(name, ";".join(new_list)) - if not value: - node.removeAttribute(name) - - -def CleanupVcproj(node): - """For each sub node, we call recursively this function.""" - for sub_node in node.childNodes: - AbsoluteNode(sub_node) - CleanupVcproj(sub_node) - - # Normalize the node, and remove all extraneous whitespaces. - for sub_node in node.childNodes: - if sub_node.nodeType == Node.TEXT_NODE: - sub_node.data = sub_node.data.replace("\r", "") - sub_node.data = sub_node.data.replace("\n", "") - sub_node.data = sub_node.data.rstrip() - - # Fix all the semicolon separated attributes to be sorted, and we also - # remove the dups. - if node.attributes: - for (name, value) in node.attributes.items(): - sorted_list = sorted(value.split(";")) - unique_list = [] - for i in sorted_list: - if not unique_list.count(i): - unique_list.append(i) - node.setAttribute(name, ";".join(unique_list)) - if not value: - node.removeAttribute(name) - - if node.childNodes: - node.normalize() - - # For each node, take a copy, and remove it from the list. - node_array = [] - while node.childNodes and node.childNodes[0]: - # Take a copy of the node and remove it from the list. - current = node.childNodes[0] - node.removeChild(current) - - # If the child is a filter, we want to append all its children - # to this same list. - if current.nodeName == "Filter": - node_array.extend(FlattenFilter(current)) - else: - node_array.append(current) - - # Sort the list. - node_array.sort(CmpNode()) - - # Insert the nodes in the correct order. - for new_node in node_array: - # But don't append empty tool node. - if new_node.nodeName == "Tool": - if new_node.attributes and new_node.attributes.length == 1: - # This one was empty. - continue - if new_node.nodeName == "UserMacro": - continue - node.appendChild(new_node) - - -def GetConfiguationNodes(vcproj): - # TODO(nsylvain): Find a better way to navigate the xml. - nodes = [] - for node in vcproj.childNodes: - if node.nodeName == "Configurations": - for sub_node in node.childNodes: - if sub_node.nodeName == "Configuration": - nodes.append(sub_node) - - return nodes - - -def GetChildrenVsprops(filename): - dom = parse(filename) - if dom.documentElement.attributes: - vsprops = dom.documentElement.getAttribute("InheritedPropertySheets") - return FixFilenames(vsprops.split(";"), os.path.dirname(filename)) - return [] - - -def SeekToNode(node1, child2): - # A text node does not have properties. - if child2.nodeType == Node.TEXT_NODE: - return None - - # Get the name of the current node. - current_name = child2.getAttribute("Name") - if not current_name: - # There is no name. We don't know how to merge. - return None - - # Look through all the nodes to find a match. - for sub_node in node1.childNodes: - if sub_node.nodeName == child2.nodeName: - name = sub_node.getAttribute("Name") - if name == current_name: - return sub_node - - # No match. We give up. - return None - - -def MergeAttributes(node1, node2): - # No attributes to merge? - if not node2.attributes: - return - - for (name, value2) in node2.attributes.items(): - # Don't merge the 'Name' attribute. - if name == "Name": - continue - value1 = node1.getAttribute(name) - if value1: - # The attribute exist in the main node. If it's equal, we leave it - # untouched, otherwise we concatenate it. - if value1 != value2: - node1.setAttribute(name, ";".join([value1, value2])) - else: - # The attribute does not exist in the main node. We append this one. - node1.setAttribute(name, value2) - - # If the attribute was a property sheet attributes, we remove it, since - # they are useless. - if name == "InheritedPropertySheets": - node1.removeAttribute(name) - - -def MergeProperties(node1, node2): - MergeAttributes(node1, node2) - for child2 in node2.childNodes: - child1 = SeekToNode(node1, child2) - if child1: - MergeProperties(child1, child2) - else: - node1.appendChild(child2.cloneNode(True)) - - -def main(argv): - """Main function of this vcproj prettifier.""" - global ARGUMENTS - ARGUMENTS = argv - - # check if we have exactly 1 parameter. - if len(argv) < 2: - print( - 'Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' - "[key2=value2]" % argv[0] - ) - return 1 - - # Parse the keys - for i in range(2, len(argv)): - (key, value) = argv[i].split("=") - REPLACEMENTS[key] = value - - # Open the vcproj and parse the xml. - dom = parse(argv[1]) - - # First thing we need to do is find the Configuration Node and merge them - # with the vsprops they include. - for configuration_node in GetConfiguationNodes(dom.documentElement): - # Get the property sheets associated with this configuration. - vsprops = configuration_node.getAttribute("InheritedPropertySheets") - - # Fix the filenames to be absolute. - vsprops_list = FixFilenames( - vsprops.strip().split(";"), os.path.dirname(argv[1]) - ) - - # Extend the list of vsprops with all vsprops contained in the current - # vsprops. - for current_vsprops in vsprops_list: - vsprops_list.extend(GetChildrenVsprops(current_vsprops)) - - # Now that we have all the vsprops, we need to merge them. - for current_vsprops in vsprops_list: - MergeProperties(configuration_node, parse(current_vsprops).documentElement) - - # Now that everything is merged, we need to cleanup the xml. - CleanupVcproj(dom.documentElement) - - # Finally, we use the prett xml function to print the vcproj back to the - # user. - # print dom.toprettyxml(newl="\n") - PrettyPrintNode(dom.documentElement) - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv)) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/Find-VisualStudio.cs b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/Find-VisualStudio.cs deleted file mode 100644 index d2e45a762..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/Find-VisualStudio.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2017 - Refael Ackermann -// Distributed under MIT style license -// See accompanying file LICENSE at https://github.com/node4good/windows-autoconf - -// Usage: -// powershell -ExecutionPolicy Unrestricted -Command "Add-Type -Path Find-VisualStudio.cs; [VisualStudioConfiguration.Main]::PrintJson()" -// This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace VisualStudioConfiguration -{ - [Flags] - public enum InstanceState : uint - { - None = 0, - Local = 1, - Registered = 2, - NoRebootRequired = 4, - NoErrors = 8, - Complete = 4294967295, - } - - [Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumSetupInstances - { - - void Next([MarshalAs(UnmanagedType.U4), In] int celt, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt, - [MarshalAs(UnmanagedType.U4)] out int pceltFetched); - - void Skip([MarshalAs(UnmanagedType.U4), In] int celt); - - void Reset(); - - [return: MarshalAs(UnmanagedType.Interface)] - IEnumSetupInstances Clone(); - } - - [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupConfiguration - { - } - - [Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupConfiguration2 : ISetupConfiguration - { - - [return: MarshalAs(UnmanagedType.Interface)] - IEnumSetupInstances EnumInstances(); - - [return: MarshalAs(UnmanagedType.Interface)] - ISetupInstance GetInstanceForCurrentProcess(); - - [return: MarshalAs(UnmanagedType.Interface)] - ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path); - - [return: MarshalAs(UnmanagedType.Interface)] - IEnumSetupInstances EnumAllInstances(); - } - - [Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupInstance - { - } - - [Guid("89143C9A-05AF-49B0-B717-72E218A2185C")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupInstance2 : ISetupInstance - { - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstanceId(); - - [return: MarshalAs(UnmanagedType.Struct)] - System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstallationName(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstallationPath(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstallationVersion(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid); - - [return: MarshalAs(UnmanagedType.BStr)] - string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath); - - [return: MarshalAs(UnmanagedType.U4)] - InstanceState GetState(); - - [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] - ISetupPackageReference[] GetPackages(); - - ISetupPackageReference GetProduct(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetProductPath(); - - [return: MarshalAs(UnmanagedType.VariantBool)] - bool IsLaunchable(); - - [return: MarshalAs(UnmanagedType.VariantBool)] - bool IsComplete(); - - [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] - ISetupPropertyStore GetProperties(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetEnginePath(); - } - - [Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupPackageReference - { - - [return: MarshalAs(UnmanagedType.BStr)] - string GetId(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetVersion(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetChip(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetLanguage(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetBranch(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetType(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetUniqueId(); - - [return: MarshalAs(UnmanagedType.VariantBool)] - bool GetIsExtension(); - } - - [Guid("c601c175-a3be-44bc-91f6-4568d230fc83")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupPropertyStore - { - - [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] - string[] GetNames(); - - object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName); - } - - [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] - [CoClass(typeof(SetupConfigurationClass))] - [ComImport] - public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration - { - } - - [Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")] - [ClassInterface(ClassInterfaceType.None)] - [ComImport] - public class SetupConfigurationClass - { - } - - public static class Main - { - public static void PrintJson() - { - ISetupConfiguration query = new SetupConfiguration(); - ISetupConfiguration2 query2 = (ISetupConfiguration2)query; - IEnumSetupInstances e = query2.EnumAllInstances(); - - int pceltFetched; - ISetupInstance2[] rgelt = new ISetupInstance2[1]; - List instances = new List(); - while (true) - { - e.Next(1, rgelt, out pceltFetched); - if (pceltFetched <= 0) - { - Console.WriteLine(String.Format("[{0}]", string.Join(",", instances.ToArray()))); - return; - } - - try - { - instances.Add(InstanceJson(rgelt[0])); - } - catch (COMException) - { - // Ignore instances that can't be queried. - } - } - } - - private static string JsonString(string s) - { - return "\"" + s.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""; - } - - private static string InstanceJson(ISetupInstance2 setupInstance2) - { - // Visual Studio component directory: - // https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids - - StringBuilder json = new StringBuilder(); - json.Append("{"); - - string path = JsonString(setupInstance2.GetInstallationPath()); - json.Append(String.Format("\"path\":{0},", path)); - - string version = JsonString(setupInstance2.GetInstallationVersion()); - json.Append(String.Format("\"version\":{0},", version)); - - List packages = new List(); - foreach (ISetupPackageReference package in setupInstance2.GetPackages()) - { - string id = JsonString(package.GetId()); - packages.Add(id); - } - json.Append(String.Format("\"packages\":[{0}]", string.Join(",", packages.ToArray()))); - - json.Append("}"); - return json.ToString(); - } - } -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/build.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/build.js deleted file mode 100644 index c2388fb34..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/build.js +++ /dev/null @@ -1,204 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const glob = require('glob') -const log = require('npmlog') -const which = require('which') -const win = process.platform === 'win32' - -function build (gyp, argv, callback) { - var platformMake = 'make' - if (process.platform === 'aix') { - platformMake = 'gmake' - } else if (process.platform.indexOf('bsd') !== -1) { - platformMake = 'gmake' - } else if (win && argv.length > 0) { - argv = argv.map(function (target) { - return '/t:' + target - }) - } - - var makeCommand = gyp.opts.make || process.env.MAKE || platformMake - var command = win ? 'msbuild' : makeCommand - var jobs = gyp.opts.jobs || process.env.JOBS - var buildType - var config - var arch - var nodeDir - var guessedSolution - - loadConfigGypi() - - /** - * Load the "config.gypi" file that was generated during "configure". - */ - - function loadConfigGypi () { - var configPath = path.resolve('build', 'config.gypi') - - fs.readFile(configPath, 'utf8', function (err, data) { - if (err) { - if (err.code === 'ENOENT') { - callback(new Error('You must run `node-gyp configure` first!')) - } else { - callback(err) - } - return - } - config = JSON.parse(data.replace(/#.+\n/, '')) - - // get the 'arch', 'buildType', and 'nodeDir' vars from the config - buildType = config.target_defaults.default_configuration - arch = config.variables.target_arch - nodeDir = config.variables.nodedir - - if ('debug' in gyp.opts) { - buildType = gyp.opts.debug ? 'Debug' : 'Release' - } - if (!buildType) { - buildType = 'Release' - } - - log.verbose('build type', buildType) - log.verbose('architecture', arch) - log.verbose('node dev dir', nodeDir) - - if (win) { - findSolutionFile() - } else { - doWhich() - } - }) - } - - /** - * On Windows, find the first build/*.sln file. - */ - - function findSolutionFile () { - glob('build/*.sln', function (err, files) { - if (err) { - return callback(err) - } - if (files.length === 0) { - return callback(new Error('Could not find *.sln file. Did you run "configure"?')) - } - guessedSolution = files[0] - log.verbose('found first Solution file', guessedSolution) - doWhich() - }) - } - - /** - * Uses node-which to locate the msbuild / make executable. - */ - - function doWhich () { - // On Windows use msbuild provided by node-gyp configure - if (win) { - if (!config.variables.msbuild_path) { - return callback(new Error( - 'MSBuild is not set, please run `node-gyp configure`.')) - } - command = config.variables.msbuild_path - log.verbose('using MSBuild:', command) - doBuild() - return - } - // First make sure we have the build command in the PATH - which(command, function (err, execPath) { - if (err) { - // Some other error or 'make' not found on Unix, report that to the user - callback(err) - return - } - log.verbose('`which` succeeded for `' + command + '`', execPath) - doBuild() - }) - } - - /** - * Actually spawn the process and compile the module. - */ - - function doBuild () { - // Enable Verbose build - var verbose = log.levels[log.level] <= log.levels.verbose - var j - - if (!win && verbose) { - argv.push('V=1') - } - - if (win && !verbose) { - argv.push('/clp:Verbosity=minimal') - } - - if (win) { - // Turn off the Microsoft logo on Windows - argv.push('/nologo') - } - - // Specify the build type, Release by default - if (win) { - // Convert .gypi config target_arch to MSBuild /Platform - // Since there are many ways to state '32-bit Intel', default to it. - // N.B. msbuild's Condition string equality tests are case-insensitive. - var archLower = arch.toLowerCase() - var p = archLower === 'x64' ? 'x64' - : (archLower === 'arm' ? 'ARM' - : (archLower === 'arm64' ? 'ARM64' : 'Win32')) - argv.push('/p:Configuration=' + buildType + ';Platform=' + p) - if (jobs) { - j = parseInt(jobs, 10) - if (!isNaN(j) && j > 0) { - argv.push('/m:' + j) - } else if (jobs.toUpperCase() === 'MAX') { - argv.push('/m:' + require('os').cpus().length) - } - } - } else { - argv.push('BUILDTYPE=' + buildType) - // Invoke the Makefile in the 'build' dir. - argv.push('-C') - argv.push('build') - if (jobs) { - j = parseInt(jobs, 10) - if (!isNaN(j) && j > 0) { - argv.push('--jobs') - argv.push(j) - } else if (jobs.toUpperCase() === 'MAX') { - argv.push('--jobs') - argv.push(require('os').cpus().length) - } - } - } - - if (win) { - // did the user specify their own .sln file? - var hasSln = argv.some(function (arg) { - return path.extname(arg) === '.sln' - }) - if (!hasSln) { - argv.unshift(gyp.opts.solution || guessedSolution) - } - } - - var proc = gyp.spawn(command, argv) - proc.on('exit', onExit) - } - - function onExit (code, signal) { - if (code !== 0) { - return callback(new Error('`' + command + '` failed with exit code: ' + code)) - } - if (signal) { - return callback(new Error('`' + command + '` got signal: ' + signal)) - } - callback() - } -} - -module.exports = build -module.exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/clean.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/clean.js deleted file mode 100644 index dbfa4dbb9..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/clean.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' - -const rm = require('rimraf') -const log = require('npmlog') - -function clean (gyp, argv, callback) { - // Remove the 'build' dir - var buildDir = 'build' - - log.verbose('clean', 'removing "%s" directory', buildDir) - rm(buildDir, callback) -} - -module.exports = clean -module.exports.usage = 'Removes any generated build files and the "out" dir' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/configure.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/configure.js deleted file mode 100644 index d9b8fe340..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/configure.js +++ /dev/null @@ -1,294 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const log = require('npmlog') -const os = require('os') -const processRelease = require('./process-release') -const win = process.platform === 'win32' -const findNodeDirectory = require('./find-node-directory') -const createConfigGypi = require('./create-config-gypi') -const msgFormat = require('util').format -var findPython = require('./find-python') -if (win) { - var findVisualStudio = require('./find-visualstudio') -} - -function configure (gyp, argv, callback) { - var python - var buildDir = path.resolve('build') - var configNames = ['config.gypi', 'common.gypi'] - var configs = [] - var nodeDir - var release = processRelease(argv, gyp, process.version, process.release) - - findPython(gyp.opts.python, function (err, found) { - if (err) { - callback(err) - } else { - python = found - getNodeDir() - } - }) - - function getNodeDir () { - // 'python' should be set by now - process.env.PYTHON = python - - if (gyp.opts.nodedir) { - // --nodedir was specified. use that for the dev files - nodeDir = gyp.opts.nodedir.replace(/^~/, os.homedir()) - - log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir) - createBuildDir() - } else { - // if no --nodedir specified, ensure node dependencies are installed - if ('v' + release.version !== process.version) { - // if --target was given, then determine a target version to compile for - log.verbose('get node dir', 'compiling against --target node version: %s', release.version) - } else { - // if no --target was specified then use the current host node version - log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) - } - - if (!release.semver) { - // could not parse the version string with semver - return callback(new Error('Invalid version number: ' + release.version)) - } - - // If the tarball option is set, always remove and reinstall the headers - // into devdir. Otherwise only install if they're not already there. - gyp.opts.ensure = !gyp.opts.tarball - - gyp.commands.install([release.version], function (err) { - if (err) { - return callback(err) - } - log.verbose('get node dir', 'target node version installed:', release.versionDir) - nodeDir = path.resolve(gyp.devDir, release.versionDir) - createBuildDir() - }) - } - } - - function createBuildDir () { - log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) - fs.mkdir(buildDir, { recursive: true }, function (err, isNew) { - if (err) { - return callback(err) - } - log.verbose( - 'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No' - ) - if (win) { - findVisualStudio(release.semver, gyp.opts.msvs_version, - createConfigFile) - } else { - createConfigFile() - } - }) - } - - function createConfigFile (err, vsInfo) { - if (err) { - return callback(err) - } - if (process.platform === 'win32') { - process.env.GYP_MSVS_VERSION = Math.min(vsInfo.versionYear, 2015) - process.env.GYP_MSVS_OVERRIDE_PATH = vsInfo.path - } - createConfigGypi({ gyp, buildDir, nodeDir, vsInfo }).then(configPath => { - configs.push(configPath) - findConfigs() - }).catch(err => { - callback(err) - }) - } - - function findConfigs () { - var name = configNames.shift() - if (!name) { - return runGyp() - } - var fullPath = path.resolve(name) - - log.verbose(name, 'checking for gypi file: %s', fullPath) - fs.stat(fullPath, function (err) { - if (err) { - if (err.code === 'ENOENT') { - findConfigs() // check next gypi filename - } else { - callback(err) - } - } else { - log.verbose(name, 'found gypi file') - configs.push(fullPath) - findConfigs() - } - }) - } - - function runGyp (err) { - if (err) { - return callback(err) - } - - if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) { - if (win) { - log.verbose('gyp', 'gyp format was not specified; forcing "msvs"') - // force the 'make' target for non-Windows - argv.push('-f', 'msvs') - } else { - log.verbose('gyp', 'gyp format was not specified; forcing "make"') - // force the 'make' target for non-Windows - argv.push('-f', 'make') - } - } - - // include all the ".gypi" files that were found - configs.forEach(function (config) { - argv.push('-I', config) - }) - - // For AIX and z/OS we need to set up the path to the exports file - // which contains the symbols needed for linking. - var nodeExpFile - if (process.platform === 'aix' || process.platform === 'os390') { - var ext = process.platform === 'aix' ? 'exp' : 'x' - var nodeRootDir = findNodeDirectory() - var candidates - - if (process.platform === 'aix') { - candidates = [ - 'include/node/node', - 'out/Release/node', - 'out/Debug/node', - 'node' - ].map(function (file) { - return file + '.' + ext - }) - } else { - candidates = [ - 'out/Release/obj.target/libnode', - 'out/Debug/obj.target/libnode', - 'lib/libnode' - ].map(function (file) { - return file + '.' + ext - }) - } - - var logprefix = 'find exports file' - nodeExpFile = findAccessibleSync(logprefix, nodeRootDir, candidates) - if (nodeExpFile !== undefined) { - log.verbose(logprefix, 'Found exports file: %s', nodeExpFile) - } else { - var msg = msgFormat('Could not find node.%s file in %s', ext, nodeRootDir) - log.error(logprefix, 'Could not find exports file') - return callback(new Error(msg)) - } - } - - // this logic ported from the old `gyp_addon` python file - var gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') - var addonGypi = path.resolve(__dirname, '..', 'addon.gypi') - var commonGypi = path.resolve(nodeDir, 'include/node/common.gypi') - fs.stat(commonGypi, function (err) { - if (err) { - commonGypi = path.resolve(nodeDir, 'common.gypi') - } - - var outputDir = 'build' - if (win) { - // Windows expects an absolute path - outputDir = buildDir - } - var nodeGypDir = path.resolve(__dirname, '..') - - var nodeLibFile = path.join(nodeDir, - !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)', - release.name + '.lib') - - argv.push('-I', addonGypi) - argv.push('-I', commonGypi) - argv.push('-Dlibrary=shared_library') - argv.push('-Dvisibility=default') - argv.push('-Dnode_root_dir=' + nodeDir) - if (process.platform === 'aix' || process.platform === 'os390') { - argv.push('-Dnode_exp_file=' + nodeExpFile) - } - argv.push('-Dnode_gyp_dir=' + nodeGypDir) - - // Do this to keep Cygwin environments happy, else the unescaped '\' gets eaten up, - // resulting in bad paths, Ex c:parentFolderfolderanotherFolder instead of c:\parentFolder\folder\anotherFolder - if (win) { - nodeLibFile = nodeLibFile.replace(/\\/g, '\\\\') - } - argv.push('-Dnode_lib_file=' + nodeLibFile) - argv.push('-Dmodule_root_dir=' + process.cwd()) - argv.push('-Dnode_engine=' + - (gyp.opts.node_engine || process.jsEngine || 'v8')) - argv.push('--depth=.') - argv.push('--no-parallel') - - // tell gyp to write the Makefile/Solution files into output_dir - argv.push('--generator-output', outputDir) - - // tell make to write its output into the same dir - argv.push('-Goutput_dir=.') - - // enforce use of the "binding.gyp" file - argv.unshift('binding.gyp') - - // execute `gyp` from the current target nodedir - argv.unshift(gypScript) - - // make sure python uses files that came with this particular node package - var pypath = [path.join(__dirname, '..', 'gyp', 'pylib')] - if (process.env.PYTHONPATH) { - pypath.push(process.env.PYTHONPATH) - } - process.env.PYTHONPATH = pypath.join(win ? ';' : ':') - - var cp = gyp.spawn(python, argv) - cp.on('exit', onCpExit) - }) - } - - function onCpExit (code) { - if (code !== 0) { - callback(new Error('`gyp` failed with exit code: ' + code)) - } else { - // we're done - callback() - } - } -} - -/** - * Returns the first file or directory from an array of candidates that is - * readable by the current user, or undefined if none of the candidates are - * readable. - */ -function findAccessibleSync (logprefix, dir, candidates) { - for (var next = 0; next < candidates.length; next++) { - var candidate = path.resolve(dir, candidates[next]) - try { - var fd = fs.openSync(candidate, 'r') - } catch (e) { - // this candidate was not found or not readable, do nothing - log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) - continue - } - fs.closeSync(fd) - log.silly(logprefix, 'Found readable %s', candidate) - return candidate - } - - return undefined -} - -module.exports = configure -module.exports.test = { - findAccessibleSync: findAccessibleSync -} -module.exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/create-config-gypi.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/create-config-gypi.js deleted file mode 100644 index dbcb8b485..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/create-config-gypi.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const log = require('npmlog') -const path = require('path') - -function parseConfigGypi (config) { - // translated from tools/js2c.py of Node.js - // 1. string comments - config = config.replace(/#.*/g, '') - // 2. join multiline strings - config = config.replace(/'$\s+'/mg, '') - // 3. normalize string literals from ' into " - config = config.replace(/'/g, '"') - return JSON.parse(config) -} - -async function getBaseConfigGypi ({ gyp, nodeDir }) { - // try reading $nodeDir/include/node/config.gypi first when: - // 1. --dist-url or --nodedir is specified - // 2. and --force-process-config is not specified - const shouldReadConfigGypi = (gyp.opts.nodedir || gyp.opts['dist-url']) && !gyp.opts['force-process-config'] - if (shouldReadConfigGypi && nodeDir) { - try { - const baseConfigGypiPath = path.resolve(nodeDir, 'include/node/config.gypi') - const baseConfigGypi = await fs.promises.readFile(baseConfigGypiPath) - return parseConfigGypi(baseConfigGypi.toString()) - } catch (err) { - log.warn('read config.gypi', err.message) - } - } - - // fallback to process.config if it is invalid - return JSON.parse(JSON.stringify(process.config)) -} - -async function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo }) { - const config = await getBaseConfigGypi({ gyp, nodeDir }) - if (!config.target_defaults) { - config.target_defaults = {} - } - if (!config.variables) { - config.variables = {} - } - - const defaults = config.target_defaults - const variables = config.variables - - // don't inherit the "defaults" from the base config.gypi. - // doing so could cause problems in cases where the `node` executable was - // compiled on a different machine (with different lib/include paths) than - // the machine where the addon is being built to - defaults.cflags = [] - defaults.defines = [] - defaults.include_dirs = [] - defaults.libraries = [] - - // set the default_configuration prop - if ('debug' in gyp.opts) { - defaults.default_configuration = gyp.opts.debug ? 'Debug' : 'Release' - } - - if (!defaults.default_configuration) { - defaults.default_configuration = 'Release' - } - - // set the target_arch variable - variables.target_arch = gyp.opts.arch || process.arch || 'ia32' - if (variables.target_arch === 'arm64') { - defaults.msvs_configuration_platform = 'ARM64' - defaults.xcode_configuration_platform = 'arm64' - } - - // set the node development directory - variables.nodedir = nodeDir - - // disable -T "thin" static archives by default - variables.standalone_static_library = gyp.opts.thin ? 0 : 1 - - if (process.platform === 'win32') { - defaults.msbuild_toolset = vsInfo.toolset - if (vsInfo.sdk) { - defaults.msvs_windows_target_platform_version = vsInfo.sdk - } - if (variables.target_arch === 'arm64') { - if (vsInfo.versionMajor > 15 || - (vsInfo.versionMajor === 15 && vsInfo.versionMajor >= 9)) { - defaults.msvs_enable_marmasm = 1 - } else { - log.warn('Compiling ARM64 assembly is only available in\n' + - 'Visual Studio 2017 version 15.9 and above') - } - } - variables.msbuild_path = vsInfo.msBuild - } - - // loop through the rest of the opts and add the unknown ones as variables. - // this allows for module-specific configure flags like: - // - // $ node-gyp configure --shared-libxml2 - Object.keys(gyp.opts).forEach(function (opt) { - if (opt === 'argv') { - return - } - if (opt in gyp.configDefs) { - return - } - variables[opt.replace(/-/g, '_')] = gyp.opts[opt] - }) - - return config -} - -async function createConfigGypi ({ gyp, buildDir, nodeDir, vsInfo }) { - const configFilename = 'config.gypi' - const configPath = path.resolve(buildDir, configFilename) - - log.verbose('build/' + configFilename, 'creating config file') - - const config = await getCurrentConfigGypi({ gyp, nodeDir, vsInfo }) - - // ensures that any boolean values in config.gypi get stringified - function boolsToString (k, v) { - if (typeof v === 'boolean') { - return String(v) - } - return v - } - - log.silly('build/' + configFilename, config) - - // now write out the config.gypi file to the build/ dir - const prefix = '# Do not edit. File was generated by node-gyp\'s "configure" step' - - const json = JSON.stringify(config, boolsToString, 2) - log.verbose('build/' + configFilename, 'writing out config file: %s', configPath) - await fs.promises.writeFile(configPath, [prefix, json, ''].join('\n')) - - return configPath -} - -module.exports = createConfigGypi -module.exports.test = { - parseConfigGypi: parseConfigGypi, - getCurrentConfigGypi: getCurrentConfigGypi -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-node-directory.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-node-directory.js deleted file mode 100644 index 0dd781a6c..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-node-directory.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict' - -const path = require('path') -const log = require('npmlog') - -function findNodeDirectory (scriptLocation, processObj) { - // set dirname and process if not passed in - // this facilitates regression tests - if (scriptLocation === undefined) { - scriptLocation = __dirname - } - if (processObj === undefined) { - processObj = process - } - - // Have a look to see what is above us, to try and work out where we are - var npmParentDirectory = path.join(scriptLocation, '../../../..') - log.verbose('node-gyp root', 'npm_parent_directory is ' + - path.basename(npmParentDirectory)) - var nodeRootDir = '' - - log.verbose('node-gyp root', 'Finding node root directory') - if (path.basename(npmParentDirectory) === 'deps') { - // We are in a build directory where this script lives in - // deps/npm/node_modules/node-gyp/lib - nodeRootDir = path.join(npmParentDirectory, '..') - log.verbose('node-gyp root', 'in build directory, root = ' + - nodeRootDir) - } else if (path.basename(npmParentDirectory) === 'node_modules') { - // We are in a node install directory where this script lives in - // lib/node_modules/npm/node_modules/node-gyp/lib or - // node_modules/npm/node_modules/node-gyp/lib depending on the - // platform - if (processObj.platform === 'win32') { - nodeRootDir = path.join(npmParentDirectory, '..') - } else { - nodeRootDir = path.join(npmParentDirectory, '../..') - } - log.verbose('node-gyp root', 'in install directory, root = ' + - nodeRootDir) - } else { - // We don't know where we are, try working it out from the location - // of the node binary - var nodeDir = path.dirname(processObj.execPath) - var directoryUp = path.basename(nodeDir) - if (directoryUp === 'bin') { - nodeRootDir = path.join(nodeDir, '..') - } else if (directoryUp === 'Release' || directoryUp === 'Debug') { - // If we are a recently built node, and the directory structure - // is that of a repository. If we are on Windows then we only need - // to go one level up, everything else, two - if (processObj.platform === 'win32') { - nodeRootDir = path.join(nodeDir, '..') - } else { - nodeRootDir = path.join(nodeDir, '../..') - } - } - // Else return the default blank, "". - } - return nodeRootDir -} - -module.exports = findNodeDirectory diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-python.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-python.js deleted file mode 100644 index a445e825b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-python.js +++ /dev/null @@ -1,344 +0,0 @@ -'use strict' - -const log = require('npmlog') -const semver = require('semver') -const cp = require('child_process') -const extend = require('util')._extend // eslint-disable-line -const win = process.platform === 'win32' -const logWithPrefix = require('./util').logWithPrefix - -const systemDrive = process.env.SystemDrive || 'C:' -const username = process.env.USERNAME || process.env.USER || getOsUserInfo() -const localAppData = process.env.LOCALAPPDATA || `${systemDrive}\\${username}\\AppData\\Local` -const foundLocalAppData = process.env.LOCALAPPDATA || username -const programFiles = process.env.ProgramW6432 || process.env.ProgramFiles || `${systemDrive}\\Program Files` -const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)` - -const winDefaultLocationsArray = [] -for (const majorMinor of ['39', '38', '37', '36']) { - if (foundLocalAppData) { - winDefaultLocationsArray.push( - `${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`, - `${programFiles}\\Python${majorMinor}\\python.exe`, - `${localAppData}\\Programs\\Python\\Python${majorMinor}-32\\python.exe`, - `${programFiles}\\Python${majorMinor}-32\\python.exe`, - `${programFilesX86}\\Python${majorMinor}-32\\python.exe` - ) - } else { - winDefaultLocationsArray.push( - `${programFiles}\\Python${majorMinor}\\python.exe`, - `${programFiles}\\Python${majorMinor}-32\\python.exe`, - `${programFilesX86}\\Python${majorMinor}-32\\python.exe` - ) - } -} - -function getOsUserInfo () { - try { - return require('os').userInfo().username - } catch (e) {} -} - -function PythonFinder (configPython, callback) { - this.callback = callback - this.configPython = configPython - this.errorLog = [] -} - -PythonFinder.prototype = { - log: logWithPrefix(log, 'find Python'), - argsExecutable: ['-c', 'import sys; print(sys.executable);'], - argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'], - semverRange: '>=3.6.0', - - // These can be overridden for testing: - execFile: cp.execFile, - env: process.env, - win: win, - pyLauncher: 'py.exe', - winDefaultLocations: winDefaultLocationsArray, - - // Logs a message at verbose level, but also saves it to be displayed later - // at error level if an error occurs. This should help diagnose the problem. - addLog: function addLog (message) { - this.log.verbose(message) - this.errorLog.push(message) - }, - - // Find Python by trying a sequence of possibilities. - // Ignore errors, keep trying until Python is found. - findPython: function findPython () { - const SKIP = 0; const FAIL = 1 - var toCheck = getChecks.apply(this) - - function getChecks () { - if (this.env.NODE_GYP_FORCE_PYTHON) { - return [{ - before: () => { - this.addLog( - 'checking Python explicitly set from NODE_GYP_FORCE_PYTHON') - this.addLog('- process.env.NODE_GYP_FORCE_PYTHON is ' + - `"${this.env.NODE_GYP_FORCE_PYTHON}"`) - }, - check: this.checkCommand, - arg: this.env.NODE_GYP_FORCE_PYTHON - }] - } - - var checks = [ - { - before: () => { - if (!this.configPython) { - this.addLog( - 'Python is not set from command line or npm configuration') - return SKIP - } - this.addLog('checking Python explicitly set from command line or ' + - 'npm configuration') - this.addLog('- "--python=" or "npm config get python" is ' + - `"${this.configPython}"`) - }, - check: this.checkCommand, - arg: this.configPython - }, - { - before: () => { - if (!this.env.PYTHON) { - this.addLog('Python is not set from environment variable ' + - 'PYTHON') - return SKIP - } - this.addLog('checking Python explicitly set from environment ' + - 'variable PYTHON') - this.addLog(`- process.env.PYTHON is "${this.env.PYTHON}"`) - }, - check: this.checkCommand, - arg: this.env.PYTHON - }, - { - before: () => { this.addLog('checking if "python3" can be used') }, - check: this.checkCommand, - arg: 'python3' - }, - { - before: () => { this.addLog('checking if "python" can be used') }, - check: this.checkCommand, - arg: 'python' - } - ] - - if (this.win) { - for (var i = 0; i < this.winDefaultLocations.length; ++i) { - const location = this.winDefaultLocations[i] - checks.push({ - before: () => { - this.addLog('checking if Python is ' + - `${location}`) - }, - check: this.checkExecPath, - arg: location - }) - } - checks.push({ - before: () => { - this.addLog( - 'checking if the py launcher can be used to find Python 3') - }, - check: this.checkPyLauncher - }) - } - - return checks - } - - function runChecks (err) { - this.log.silly('runChecks: err = %j', (err && err.stack) || err) - - const check = toCheck.shift() - if (!check) { - return this.fail() - } - - const before = check.before.apply(this) - if (before === SKIP) { - return runChecks.apply(this) - } - if (before === FAIL) { - return this.fail() - } - - const args = [runChecks.bind(this)] - if (check.arg) { - args.unshift(check.arg) - } - check.check.apply(this, args) - } - - runChecks.apply(this) - }, - - // Check if command is a valid Python to use. - // Will exit the Python finder on success. - // If on Windows, run in a CMD shell to support BAT/CMD launchers. - checkCommand: function checkCommand (command, errorCallback) { - var exec = command - var args = this.argsExecutable - var shell = false - if (this.win) { - // Arguments have to be manually quoted - exec = `"${exec}"` - args = args.map(a => `"${a}"`) - shell = true - } - - this.log.verbose(`- executing "${command}" to get executable path`) - this.run(exec, args, shell, function (err, execPath) { - // Possible outcomes: - // - Error: not in PATH, not executable or execution fails - // - Gibberish: the next command to check version will fail - // - Absolute path to executable - if (err) { - this.addLog(`- "${command}" is not in PATH or produced an error`) - return errorCallback(err) - } - this.addLog(`- executable path is "${execPath}"`) - this.checkExecPath(execPath, errorCallback) - }.bind(this)) - }, - - // Check if the py launcher can find a valid Python to use. - // Will exit the Python finder on success. - // Distributions of Python on Windows by default install with the "py.exe" - // Python launcher which is more likely to exist than the Python executable - // being in the $PATH. - // Because the Python launcher supports Python 2 and Python 3, we should - // explicitly request a Python 3 version. This is done by supplying "-3" as - // the first command line argument. Since "py.exe -3" would be an invalid - // executable for "execFile", we have to use the launcher to figure out - // where the actual "python.exe" executable is located. - checkPyLauncher: function checkPyLauncher (errorCallback) { - this.log.verbose( - `- executing "${this.pyLauncher}" to get Python 3 executable path`) - this.run(this.pyLauncher, ['-3', ...this.argsExecutable], false, - function (err, execPath) { - // Possible outcomes: same as checkCommand - if (err) { - this.addLog( - `- "${this.pyLauncher}" is not in PATH or produced an error`) - return errorCallback(err) - } - this.addLog(`- executable path is "${execPath}"`) - this.checkExecPath(execPath, errorCallback) - }.bind(this)) - }, - - // Check if a Python executable is the correct version to use. - // Will exit the Python finder on success. - checkExecPath: function checkExecPath (execPath, errorCallback) { - this.log.verbose(`- executing "${execPath}" to get version`) - this.run(execPath, this.argsVersion, false, function (err, version) { - // Possible outcomes: - // - Error: executable can not be run (likely meaning the command wasn't - // a Python executable and the previous command produced gibberish) - // - Gibberish: somehow the last command produced an executable path, - // this will fail when verifying the version - // - Version of the Python executable - if (err) { - this.addLog(`- "${execPath}" could not be run`) - return errorCallback(err) - } - this.addLog(`- version is "${version}"`) - - const range = new semver.Range(this.semverRange) - var valid = false - try { - valid = range.test(version) - } catch (err) { - this.log.silly('range.test() threw:\n%s', err.stack) - this.addLog(`- "${execPath}" does not have a valid version`) - this.addLog('- is it a Python executable?') - return errorCallback(err) - } - - if (!valid) { - this.addLog(`- version is ${version} - should be ${this.semverRange}`) - this.addLog('- THIS VERSION OF PYTHON IS NOT SUPPORTED') - return errorCallback(new Error( - `Found unsupported Python version ${version}`)) - } - this.succeed(execPath, version) - }.bind(this)) - }, - - // Run an executable or shell command, trimming the output. - run: function run (exec, args, shell, callback) { - var env = extend({}, this.env) - env.TERM = 'dumb' - const opts = { env: env, shell: shell } - - this.log.silly('execFile: exec = %j', exec) - this.log.silly('execFile: args = %j', args) - this.log.silly('execFile: opts = %j', opts) - try { - this.execFile(exec, args, opts, execFileCallback.bind(this)) - } catch (err) { - this.log.silly('execFile: threw:\n%s', err.stack) - return callback(err) - } - - function execFileCallback (err, stdout, stderr) { - this.log.silly('execFile result: err = %j', (err && err.stack) || err) - this.log.silly('execFile result: stdout = %j', stdout) - this.log.silly('execFile result: stderr = %j', stderr) - if (err) { - return callback(err) - } - const execPath = stdout.trim() - callback(null, execPath) - } - }, - - succeed: function succeed (execPath, version) { - this.log.info(`using Python version ${version} found at "${execPath}"`) - process.nextTick(this.callback.bind(null, null, execPath)) - }, - - fail: function fail () { - const errorLog = this.errorLog.join('\n') - - const pathExample = this.win ? 'C:\\Path\\To\\python.exe' - : '/path/to/pythonexecutable' - // For Windows 80 col console, use up to the column before the one marked - // with X (total 79 chars including logger prefix, 58 chars usable here): - // X - const info = [ - '**********************************************************', - 'You need to install the latest version of Python.', - 'Node-gyp should be able to find and use Python. If not,', - 'you can try one of the following options:', - `- Use the switch --python="${pathExample}"`, - ' (accepted by both node-gyp and npm)', - '- Set the environment variable PYTHON', - '- Set the npm configuration variable python:', - ` npm config set python "${pathExample}"`, - 'For more information consult the documentation at:', - 'https://github.com/nodejs/node-gyp#installation', - '**********************************************************' - ].join('\n') - - this.log.error(`\n${errorLog}\n\n${info}\n`) - process.nextTick(this.callback.bind(null, new Error( - 'Could not find any Python installation to use'))) - } -} - -function findPython (configPython, callback) { - var finder = new PythonFinder(configPython, callback) - finder.findPython() -} - -module.exports = findPython -module.exports.test = { - PythonFinder: PythonFinder, - findPython: findPython -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-visualstudio.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-visualstudio.js deleted file mode 100644 index 64af7be34..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/find-visualstudio.js +++ /dev/null @@ -1,446 +0,0 @@ -'use strict' - -const log = require('npmlog') -const execFile = require('child_process').execFile -const fs = require('fs') -const path = require('path').win32 -const logWithPrefix = require('./util').logWithPrefix -const regSearchKeys = require('./util').regSearchKeys - -function findVisualStudio (nodeSemver, configMsvsVersion, callback) { - const finder = new VisualStudioFinder(nodeSemver, configMsvsVersion, - callback) - finder.findVisualStudio() -} - -function VisualStudioFinder (nodeSemver, configMsvsVersion, callback) { - this.nodeSemver = nodeSemver - this.configMsvsVersion = configMsvsVersion - this.callback = callback - this.errorLog = [] - this.validVersions = [] -} - -VisualStudioFinder.prototype = { - log: logWithPrefix(log, 'find VS'), - - regSearchKeys: regSearchKeys, - - // Logs a message at verbose level, but also saves it to be displayed later - // at error level if an error occurs. This should help diagnose the problem. - addLog: function addLog (message) { - this.log.verbose(message) - this.errorLog.push(message) - }, - - findVisualStudio: function findVisualStudio () { - this.configVersionYear = null - this.configPath = null - if (this.configMsvsVersion) { - this.addLog('msvs_version was set from command line or npm config') - if (this.configMsvsVersion.match(/^\d{4}$/)) { - this.configVersionYear = parseInt(this.configMsvsVersion, 10) - this.addLog( - `- looking for Visual Studio version ${this.configVersionYear}`) - } else { - this.configPath = path.resolve(this.configMsvsVersion) - this.addLog( - `- looking for Visual Studio installed in "${this.configPath}"`) - } - } else { - this.addLog('msvs_version not set from command line or npm config') - } - - if (process.env.VCINSTALLDIR) { - this.envVcInstallDir = - path.resolve(process.env.VCINSTALLDIR, '..') - this.addLog('running in VS Command Prompt, installation path is:\n' + - `"${this.envVcInstallDir}"\n- will only use this version`) - } else { - this.addLog('VCINSTALLDIR not set, not running in VS Command Prompt') - } - - this.findVisualStudio2017OrNewer((info) => { - if (info) { - return this.succeed(info) - } - this.findVisualStudio2015((info) => { - if (info) { - return this.succeed(info) - } - this.findVisualStudio2013((info) => { - if (info) { - return this.succeed(info) - } - this.fail() - }) - }) - }) - }, - - succeed: function succeed (info) { - this.log.info(`using VS${info.versionYear} (${info.version}) found at:` + - `\n"${info.path}"` + - '\nrun with --verbose for detailed information') - process.nextTick(this.callback.bind(null, null, info)) - }, - - fail: function fail () { - if (this.configMsvsVersion && this.envVcInstallDir) { - this.errorLog.push( - 'msvs_version does not match this VS Command Prompt or the', - 'installation cannot be used.') - } else if (this.configMsvsVersion) { - // If msvs_version was specified but finding VS failed, print what would - // have been accepted - this.errorLog.push('') - if (this.validVersions) { - this.errorLog.push('valid versions for msvs_version:') - this.validVersions.forEach((version) => { - this.errorLog.push(`- "${version}"`) - }) - } else { - this.errorLog.push('no valid versions for msvs_version were found') - } - } - - const errorLog = this.errorLog.join('\n') - - // For Windows 80 col console, use up to the column before the one marked - // with X (total 79 chars including logger prefix, 62 chars usable here): - // X - const infoLog = [ - '**************************************************************', - 'You need to install the latest version of Visual Studio', - 'including the "Desktop development with C++" workload.', - 'For more information consult the documentation at:', - 'https://github.com/nodejs/node-gyp#on-windows', - '**************************************************************' - ].join('\n') - - this.log.error(`\n${errorLog}\n\n${infoLog}\n`) - process.nextTick(this.callback.bind(null, new Error( - 'Could not find any Visual Studio installation to use'))) - }, - - // Invoke the PowerShell script to get information about Visual Studio 2017 - // or newer installations - findVisualStudio2017OrNewer: function findVisualStudio2017OrNewer (cb) { - var ps = path.join(process.env.SystemRoot, 'System32', - 'WindowsPowerShell', 'v1.0', 'powershell.exe') - var csFile = path.join(__dirname, 'Find-VisualStudio.cs') - var psArgs = [ - '-ExecutionPolicy', - 'Unrestricted', - '-NoProfile', - '-Command', - '&{Add-Type -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}' - ] - - this.log.silly('Running', ps, psArgs) - var child = execFile(ps, psArgs, { encoding: 'utf8' }, - (err, stdout, stderr) => { - this.parseData(err, stdout, stderr, cb) - }) - child.stdin.end() - }, - - // Parse the output of the PowerShell script and look for an installation - // of Visual Studio 2017 or newer to use - parseData: function parseData (err, stdout, stderr, cb) { - this.log.silly('PS stderr = %j', stderr) - - const failPowershell = () => { - this.addLog( - 'could not use PowerShell to find Visual Studio 2017 or newer, try re-running with \'--loglevel silly\' for more details') - cb(null) - } - - if (err) { - this.log.silly('PS err = %j', err && (err.stack || err)) - return failPowershell() - } - - var vsInfo - try { - vsInfo = JSON.parse(stdout) - } catch (e) { - this.log.silly('PS stdout = %j', stdout) - this.log.silly(e) - return failPowershell() - } - - if (!Array.isArray(vsInfo)) { - this.log.silly('PS stdout = %j', stdout) - return failPowershell() - } - - vsInfo = vsInfo.map((info) => { - this.log.silly(`processing installation: "${info.path}"`) - info.path = path.resolve(info.path) - var ret = this.getVersionInfo(info) - ret.path = info.path - ret.msBuild = this.getMSBuild(info, ret.versionYear) - ret.toolset = this.getToolset(info, ret.versionYear) - ret.sdk = this.getSDK(info) - return ret - }) - this.log.silly('vsInfo:', vsInfo) - - // Remove future versions or errors parsing version number - vsInfo = vsInfo.filter((info) => { - if (info.versionYear) { - return true - } - this.addLog(`unknown version "${info.version}" found at "${info.path}"`) - return false - }) - - // Sort to place newer versions first - vsInfo.sort((a, b) => b.versionYear - a.versionYear) - - for (var i = 0; i < vsInfo.length; ++i) { - const info = vsInfo[i] - this.addLog(`checking VS${info.versionYear} (${info.version}) found ` + - `at:\n"${info.path}"`) - - if (info.msBuild) { - this.addLog('- found "Visual Studio C++ core features"') - } else { - this.addLog('- "Visual Studio C++ core features" missing') - continue - } - - if (info.toolset) { - this.addLog(`- found VC++ toolset: ${info.toolset}`) - } else { - this.addLog('- missing any VC++ toolset') - continue - } - - if (info.sdk) { - this.addLog(`- found Windows SDK: ${info.sdk}`) - } else { - this.addLog('- missing any Windows SDK') - continue - } - - if (!this.checkConfigVersion(info.versionYear, info.path)) { - continue - } - - return cb(info) - } - - this.addLog( - 'could not find a version of Visual Studio 2017 or newer to use') - cb(null) - }, - - // Helper - process version information - getVersionInfo: function getVersionInfo (info) { - const match = /^(\d+)\.(\d+)\..*/.exec(info.version) - if (!match) { - this.log.silly('- failed to parse version:', info.version) - return {} - } - this.log.silly('- version match = %j', match) - var ret = { - version: info.version, - versionMajor: parseInt(match[1], 10), - versionMinor: parseInt(match[2], 10) - } - if (ret.versionMajor === 15) { - ret.versionYear = 2017 - return ret - } - if (ret.versionMajor === 16) { - ret.versionYear = 2019 - return ret - } - if (ret.versionMajor === 17) { - ret.versionYear = 2022 - return ret - } - this.log.silly('- unsupported version:', ret.versionMajor) - return {} - }, - - // Helper - process MSBuild information - getMSBuild: function getMSBuild (info, versionYear) { - const pkg = 'Microsoft.VisualStudio.VC.MSBuild.Base' - const msbuildPath = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe') - if (info.packages.indexOf(pkg) !== -1) { - this.log.silly('- found VC.MSBuild.Base') - if (versionYear === 2017) { - return path.join(info.path, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe') - } - if (versionYear === 2019) { - return msbuildPath - } - } - // visual studio 2022 don't has msbuild pkg - if (fs.existsSync(msbuildPath)) { - return msbuildPath - } - return null - }, - - // Helper - process toolset information - getToolset: function getToolset (info, versionYear) { - const pkg = 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' - const express = 'Microsoft.VisualStudio.WDExpress' - - if (info.packages.indexOf(pkg) !== -1) { - this.log.silly('- found VC.Tools.x86.x64') - } else if (info.packages.indexOf(express) !== -1) { - this.log.silly('- found Visual Studio Express (looking for toolset)') - } else { - return null - } - - if (versionYear === 2017) { - return 'v141' - } else if (versionYear === 2019) { - return 'v142' - } else if (versionYear === 2022) { - return 'v143' - } - this.log.silly('- invalid versionYear:', versionYear) - return null - }, - - // Helper - process Windows SDK information - getSDK: function getSDK (info) { - const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK' - const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.' - - var Win10SDKVer = 0 - info.packages.forEach((pkg) => { - if (!pkg.startsWith(win10SDKPrefix)) { - return - } - const parts = pkg.split('.') - if (parts.length > 5 && parts[5] !== 'Desktop') { - this.log.silly('- ignoring non-Desktop Win10SDK:', pkg) - return - } - const foundSdkVer = parseInt(parts[4], 10) - if (isNaN(foundSdkVer)) { - // Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb - this.log.silly('- failed to parse Win10SDK number:', pkg) - return - } - this.log.silly('- found Win10SDK:', foundSdkVer) - Win10SDKVer = Math.max(Win10SDKVer, foundSdkVer) - }) - - if (Win10SDKVer !== 0) { - return `10.0.${Win10SDKVer}.0` - } else if (info.packages.indexOf(win8SDK) !== -1) { - this.log.silly('- found Win8SDK') - return '8.1' - } - return null - }, - - // Find an installation of Visual Studio 2015 to use - findVisualStudio2015: function findVisualStudio2015 (cb) { - return this.findOldVS({ - version: '14.0', - versionMajor: 14, - versionMinor: 0, - versionYear: 2015, - toolset: 'v140' - }, cb) - }, - - // Find an installation of Visual Studio 2013 to use - findVisualStudio2013: function findVisualStudio2013 (cb) { - if (this.nodeSemver.major >= 9) { - this.addLog( - 'not looking for VS2013 as it is only supported up to Node.js 8') - return cb(null) - } - return this.findOldVS({ - version: '12.0', - versionMajor: 12, - versionMinor: 0, - versionYear: 2013, - toolset: 'v120' - }, cb) - }, - - // Helper - common code for VS2013 and VS2015 - findOldVS: function findOldVS (info, cb) { - const regVC7 = ['HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7', - 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'] - const regMSBuild = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions' - - this.addLog(`looking for Visual Studio ${info.versionYear}`) - this.regSearchKeys(regVC7, info.version, [], (err, res) => { - if (err) { - this.addLog('- not found') - return cb(null) - } - - const vsPath = path.resolve(res, '..') - this.addLog(`- found in "${vsPath}"`) - - const msBuildRegOpts = process.arch === 'ia32' ? [] : ['/reg:32'] - this.regSearchKeys([`${regMSBuild}\\${info.version}`], - 'MSBuildToolsPath', msBuildRegOpts, (err, res) => { - if (err) { - this.addLog( - '- could not find MSBuild in registry for this version') - return cb(null) - } - - const msBuild = path.join(res, 'MSBuild.exe') - this.addLog(`- MSBuild in "${msBuild}"`) - - if (!this.checkConfigVersion(info.versionYear, vsPath)) { - return cb(null) - } - - info.path = vsPath - info.msBuild = msBuild - info.sdk = null - cb(info) - }) - }) - }, - - // After finding a usable version of Visual Studio: - // - add it to validVersions to be displayed at the end if a specific - // version was requested and not found; - // - check if this is the version that was requested. - // - check if this matches the Visual Studio Command Prompt - checkConfigVersion: function checkConfigVersion (versionYear, vsPath) { - this.validVersions.push(versionYear) - this.validVersions.push(vsPath) - - if (this.configVersionYear && this.configVersionYear !== versionYear) { - this.addLog('- msvs_version does not match this version') - return false - } - if (this.configPath && - path.relative(this.configPath, vsPath) !== '') { - this.addLog('- msvs_version does not point to this installation') - return false - } - if (this.envVcInstallDir && - path.relative(this.envVcInstallDir, vsPath) !== '') { - this.addLog('- does not match this Visual Studio Command Prompt') - return false - } - - return true - } -} - -module.exports = findVisualStudio -module.exports.test = { - VisualStudioFinder: VisualStudioFinder, - findVisualStudio: findVisualStudio -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/install.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/install.js deleted file mode 100644 index 99f6d8592..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/install.js +++ /dev/null @@ -1,376 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const os = require('os') -const tar = require('tar') -const path = require('path') -const util = require('util') -const stream = require('stream') -const crypto = require('crypto') -const log = require('npmlog') -const semver = require('semver') -const fetch = require('make-fetch-happen') -const processRelease = require('./process-release') -const win = process.platform === 'win32' -const streamPipeline = util.promisify(stream.pipeline) - -/** - * @param {typeof import('graceful-fs')} fs - */ - -async function install (fs, gyp, argv) { - const release = processRelease(argv, gyp, process.version, process.release) - - // Determine which node dev files version we are installing - log.verbose('install', 'input version string %j', release.version) - - if (!release.semver) { - // could not parse the version string with semver - throw new Error('Invalid version number: ' + release.version) - } - - if (semver.lt(release.version, '0.8.0')) { - throw new Error('Minimum target version is `0.8.0` or greater. Got: ' + release.version) - } - - // 0.x.y-pre versions are not published yet and cannot be installed. Bail. - if (release.semver.prerelease[0] === 'pre') { - log.verbose('detected "pre" node version', release.version) - if (!gyp.opts.nodedir) { - throw new Error('"pre" versions of node cannot be installed, use the --nodedir flag instead') - } - log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir) - return - } - - // flatten version into String - log.verbose('install', 'installing version: %s', release.versionDir) - - // the directory where the dev files will be installed - const devDir = path.resolve(gyp.devDir, release.versionDir) - - // If '--ensure' was passed, then don't *always* install the version; - // check if it is already installed, and only install when needed - if (gyp.opts.ensure) { - log.verbose('install', '--ensure was passed, so won\'t reinstall if already installed') - try { - await fs.promises.stat(devDir) - } catch (err) { - if (err.code === 'ENOENT') { - log.verbose('install', 'version not already installed, continuing with install', release.version) - try { - return await go() - } catch (err) { - return rollback(err) - } - } else if (err.code === 'EACCES') { - return eaccesFallback(err) - } - throw err - } - log.verbose('install', 'version is already installed, need to check "installVersion"') - const installVersionFile = path.resolve(devDir, 'installVersion') - let installVersion = 0 - try { - const ver = await fs.promises.readFile(installVersionFile, 'ascii') - installVersion = parseInt(ver, 10) || 0 - } catch (err) { - if (err.code !== 'ENOENT') { - throw err - } - } - log.verbose('got "installVersion"', installVersion) - log.verbose('needs "installVersion"', gyp.package.installVersion) - if (installVersion < gyp.package.installVersion) { - log.verbose('install', 'version is no good; reinstalling') - try { - return await go() - } catch (err) { - return rollback(err) - } - } - log.verbose('install', 'version is good') - } else { - try { - return await go() - } catch (err) { - return rollback(err) - } - } - - async function go () { - log.verbose('ensuring nodedir is created', devDir) - - // first create the dir for the node dev files - try { - const created = await fs.promises.mkdir(devDir, { recursive: true }) - - if (created) { - log.verbose('created nodedir', created) - } - } catch (err) { - if (err.code === 'EACCES') { - return eaccesFallback(err) - } - - throw err - } - - // now download the node tarball - const tarPath = gyp.opts.tarball - let extractCount = 0 - const contentShasums = {} - const expectShasums = {} - - // checks if a file to be extracted from the tarball is valid. - // only .h header files and the gyp files get extracted - function isValid (path) { - const isValid = valid(path) - if (isValid) { - log.verbose('extracted file from tarball', path) - extractCount++ - } else { - // invalid - log.silly('ignoring from tarball', path) - } - return isValid - } - - // download the tarball and extract! - - if (tarPath) { - await tar.extract({ - file: tarPath, - strip: 1, - filter: isValid, - cwd: devDir - }) - } else { - try { - const res = await download(gyp, release.tarballUrl) - - if (res.status !== 200) { - throw new Error(`${res.status} response downloading ${release.tarballUrl}`) - } - - await streamPipeline( - res.body, - // content checksum - new ShaSum((_, checksum) => { - const filename = path.basename(release.tarballUrl).trim() - contentShasums[filename] = checksum - log.verbose('content checksum', filename, checksum) - }), - tar.extract({ - strip: 1, - cwd: devDir, - filter: isValid - }) - ) - } catch (err) { - // something went wrong downloading the tarball? - if (err.code === 'ENOTFOUND') { - throw new Error('This is most likely not a problem with node-gyp or the package itself and\n' + - 'is related to network connectivity. In most cases you are behind a proxy or have bad \n' + - 'network settings.') - } - throw err - } - } - - // invoked after the tarball has finished being extracted - if (extractCount === 0) { - throw new Error('There was a fatal problem while downloading/extracting the tarball') - } - - log.verbose('tarball', 'done parsing tarball') - - const installVersionPath = path.resolve(devDir, 'installVersion') - await Promise.all([ - // need to download node.lib - ...(win ? downloadNodeLib() : []), - // write the "installVersion" file - fs.promises.writeFile(installVersionPath, gyp.package.installVersion + '\n'), - // Only download SHASUMS.txt if we downloaded something in need of SHA verification - ...(!tarPath || win ? [downloadShasums()] : []) - ]) - - log.verbose('download contents checksum', JSON.stringify(contentShasums)) - // check content shasums - for (const k in contentShasums) { - log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k]) - if (contentShasums[k] !== expectShasums[k]) { - throw new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k]) - } - } - - async function downloadShasums () { - log.verbose('check download content checksum, need to download `SHASUMS256.txt`...') - log.verbose('checksum url', release.shasumsUrl) - - const res = await download(gyp, release.shasumsUrl) - - if (res.status !== 200) { - throw new Error(`${res.status} status code downloading checksum`) - } - - for (const line of (await res.text()).trim().split('\n')) { - const items = line.trim().split(/\s+/) - if (items.length !== 2) { - return - } - - // 0035d18e2dcf9aad669b1c7c07319e17abfe3762 ./node-v0.11.4.tar.gz - const name = items[1].replace(/^\.\//, '') - expectShasums[name] = items[0] - } - - log.verbose('checksum data', JSON.stringify(expectShasums)) - } - - function downloadNodeLib () { - log.verbose('on Windows; need to download `' + release.name + '.lib`...') - const archs = ['ia32', 'x64', 'arm64'] - return archs.map(async (arch) => { - const dir = path.resolve(devDir, arch) - const targetLibPath = path.resolve(dir, release.name + '.lib') - const { libUrl, libPath } = release[arch] - const name = `${arch} ${release.name}.lib` - log.verbose(name, 'dir', dir) - log.verbose(name, 'url', libUrl) - - await fs.promises.mkdir(dir, { recursive: true }) - log.verbose('streaming', name, 'to:', targetLibPath) - - const res = await download(gyp, libUrl) - - if (res.status === 403 || res.status === 404) { - if (arch === 'arm64') { - // Arm64 is a newer platform on Windows and not all node distributions provide it. - log.verbose(`${name} was not found in ${libUrl}`) - } else { - log.warn(`${name} was not found in ${libUrl}`) - } - return - } else if (res.status !== 200) { - throw new Error(`${res.status} status code downloading ${name}`) - } - - return streamPipeline( - res.body, - new ShaSum((_, checksum) => { - contentShasums[libPath] = checksum - log.verbose('content checksum', libPath, checksum) - }), - fs.createWriteStream(targetLibPath) - ) - }) - } // downloadNodeLib() - } // go() - - /** - * Checks if a given filename is "valid" for this installation. - */ - - function valid (file) { - // header files - const extname = path.extname(file) - return extname === '.h' || extname === '.gypi' - } - - async function rollback (err) { - log.warn('install', 'got an error, rolling back install') - // roll-back the install if anything went wrong - await util.promisify(gyp.commands.remove)([release.versionDir]) - throw err - } - - /** - * The EACCES fallback is a workaround for npm's `sudo` behavior, where - * it drops the permissions before invoking any child processes (like - * node-gyp). So what happens is the "nobody" user doesn't have - * permission to create the dev dir. As a fallback, make the tmpdir() be - * the dev dir for this installation. This is not ideal, but at least - * the compilation will succeed... - */ - - async function eaccesFallback (err) { - const noretry = '--node_gyp_internal_noretry' - if (argv.indexOf(noretry) !== -1) { - throw err - } - const tmpdir = os.tmpdir() - gyp.devDir = path.resolve(tmpdir, '.node-gyp') - let userString = '' - try { - // os.userInfo can fail on some systems, it's not critical here - userString = ` ("${os.userInfo().username}")` - } catch (e) {} - log.warn('EACCES', 'current user%s does not have permission to access the dev dir "%s"', userString, devDir) - log.warn('EACCES', 'attempting to reinstall using temporary dev dir "%s"', gyp.devDir) - if (process.cwd() === tmpdir) { - log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') - gyp.todo.push({ name: 'remove', args: argv }) - } - return util.promisify(gyp.commands.install)([noretry].concat(argv)) - } -} - -class ShaSum extends stream.Transform { - constructor (callback) { - super() - this._callback = callback - this._digester = crypto.createHash('sha256') - } - - _transform (chunk, _, callback) { - this._digester.update(chunk) - callback(null, chunk) - } - - _flush (callback) { - this._callback(null, this._digester.digest('hex')) - callback() - } -} - -async function download (gyp, url) { - log.http('GET', url) - - const requestOpts = { - headers: { - 'User-Agent': `node-gyp v${gyp.version} (node ${process.version})`, - Connection: 'keep-alive' - }, - proxy: gyp.opts.proxy, - noProxy: gyp.opts.noproxy - } - - const cafile = gyp.opts.cafile - if (cafile) { - requestOpts.ca = await readCAFile(cafile) - } - - const res = await fetch(url, requestOpts) - log.http(res.status, res.url) - - return res -} - -async function readCAFile (filename) { - // The CA file can contain multiple certificates so split on certificate - // boundaries. [\S\s]*? is used to match everything including newlines. - const ca = await fs.promises.readFile(filename, 'utf8') - const re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g - return ca.match(re) -} - -module.exports = function (gyp, argv, callback) { - install(fs, gyp, argv).then(callback.bind(undefined, null), callback) -} -module.exports.test = { - download, - install, - readCAFile -} -module.exports.usage = 'Install node development files for the specified node version.' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/list.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/list.js deleted file mode 100644 index 405ebc0d8..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/list.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const log = require('npmlog') - -function list (gyp, args, callback) { - var devDir = gyp.devDir - log.verbose('list', 'using node-gyp dir:', devDir) - - fs.readdir(devDir, onreaddir) - - function onreaddir (err, versions) { - if (err && err.code !== 'ENOENT') { - return callback(err) - } - - if (Array.isArray(versions)) { - versions = versions.filter(function (v) { return v !== 'current' }) - } else { - versions = [] - } - callback(null, versions) - } -} - -module.exports = list -module.exports.usage = 'Prints a listing of the currently installed node development files' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/node-gyp.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/node-gyp.js deleted file mode 100644 index 0f1118564..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/node-gyp.js +++ /dev/null @@ -1,211 +0,0 @@ -'use strict' - -const path = require('path') -const nopt = require('nopt') -const log = require('npmlog') -const childProcess = require('child_process') -const EE = require('events').EventEmitter -const inherits = require('util').inherits -const commands = [ - // Module build commands - 'build', - 'clean', - 'configure', - 'rebuild', - // Development Header File management commands - 'install', - 'list', - 'remove' -] -const aliases = { - ls: 'list', - rm: 'remove' -} - -// differentiate node-gyp's logs from npm's -log.heading = 'gyp' - -function gyp () { - return new Gyp() -} - -function Gyp () { - var self = this - - this.devDir = '' - this.commands = {} - - commands.forEach(function (command) { - self.commands[command] = function (argv, callback) { - log.verbose('command', command, argv) - return require('./' + command)(self, argv, callback) - } - }) -} -inherits(Gyp, EE) -exports.Gyp = Gyp -var proto = Gyp.prototype - -/** - * Export the contents of the package.json. - */ - -proto.package = require('../package.json') - -/** - * nopt configuration definitions - */ - -proto.configDefs = { - help: Boolean, // everywhere - arch: String, // 'configure' - cafile: String, // 'install' - debug: Boolean, // 'build' - directory: String, // bin - make: String, // 'build' - msvs_version: String, // 'configure' - ensure: Boolean, // 'install' - solution: String, // 'build' (windows only) - proxy: String, // 'install' - noproxy: String, // 'install' - devdir: String, // everywhere - nodedir: String, // 'configure' - loglevel: String, // everywhere - python: String, // 'configure' - 'dist-url': String, // 'install' - tarball: String, // 'install' - jobs: String, // 'build' - thin: String, // 'configure' - 'force-process-config': Boolean // 'configure' -} - -/** - * nopt shorthands - */ - -proto.shorthands = { - release: '--no-debug', - C: '--directory', - debug: '--debug', - j: '--jobs', - silly: '--loglevel=silly', - verbose: '--loglevel=verbose', - silent: '--loglevel=silent' -} - -/** - * expose the command aliases for the bin file to use. - */ - -proto.aliases = aliases - -/** - * Parses the given argv array and sets the 'opts', - * 'argv' and 'command' properties. - */ - -proto.parseArgv = function parseOpts (argv) { - this.opts = nopt(this.configDefs, this.shorthands, argv) - this.argv = this.opts.argv.remain.slice() - - var commands = this.todo = [] - - // create a copy of the argv array with aliases mapped - argv = this.argv.map(function (arg) { - // is this an alias? - if (arg in this.aliases) { - arg = this.aliases[arg] - } - return arg - }, this) - - // process the mapped args into "command" objects ("name" and "args" props) - argv.slice().forEach(function (arg) { - if (arg in this.commands) { - var args = argv.splice(0, argv.indexOf(arg)) - argv.shift() - if (commands.length > 0) { - commands[commands.length - 1].args = args - } - commands.push({ name: arg, args: [] }) - } - }, this) - if (commands.length > 0) { - commands[commands.length - 1].args = argv.splice(0) - } - - // support for inheriting config env variables from npm - var npmConfigPrefix = 'npm_config_' - Object.keys(process.env).forEach(function (name) { - if (name.indexOf(npmConfigPrefix) !== 0) { - return - } - var val = process.env[name] - if (name === npmConfigPrefix + 'loglevel') { - log.level = val - } else { - // add the user-defined options to the config - name = name.substring(npmConfigPrefix.length) - // gyp@741b7f1 enters an infinite loop when it encounters - // zero-length options so ensure those don't get through. - if (name) { - this.opts[name] = val - } - } - }, this) - - if (this.opts.loglevel) { - log.level = this.opts.loglevel - } - log.resume() -} - -/** - * Spawns a child process and emits a 'spawn' event. - */ - -proto.spawn = function spawn (command, args, opts) { - if (!opts) { - opts = {} - } - if (!opts.silent && !opts.stdio) { - opts.stdio = [0, 1, 2] - } - var cp = childProcess.spawn(command, args, opts) - log.info('spawn', command) - log.info('spawn args', args) - return cp -} - -/** - * Returns the usage instructions for node-gyp. - */ - -proto.usage = function usage () { - var str = [ - '', - ' Usage: node-gyp [options]', - '', - ' where is one of:', - commands.map(function (c) { - return ' - ' + c + ' - ' + require('./' + c).usage - }).join('\n'), - '', - 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'), - 'node@' + process.versions.node - ].join('\n') - return str -} - -/** - * Version number getter. - */ - -Object.defineProperty(proto, 'version', { - get: function () { - return this.package.version - }, - enumerable: true -}) - -module.exports = exports = gyp diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/process-release.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/process-release.js deleted file mode 100644 index 95b55e442..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/process-release.js +++ /dev/null @@ -1,147 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ - -'use strict' - -const semver = require('semver') -const url = require('url') -const path = require('path') -const log = require('npmlog') - -// versions where -headers.tar.gz started shipping -const headersTarballRange = '>= 3.0.0 || ~0.12.10 || ~0.10.42' -const bitsre = /\/win-(x86|x64|arm64)\// -const bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should -// have been "x86" - -// Captures all the logic required to determine download URLs, local directory and -// file names. Inputs come from command-line switches (--target, --dist-url), -// `process.version` and `process.release` where it exists. -function processRelease (argv, gyp, defaultVersion, defaultRelease) { - var version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion - var versionSemver = semver.parse(version) - var overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl - var isDefaultVersion - var isNamedForLegacyIojs - var name - var distBaseUrl - var baseUrl - var libUrl32 - var libUrl64 - var libUrlArm64 - var tarballUrl - var canGetHeaders - - if (!versionSemver) { - // not a valid semver string, nothing we can do - return { version: version } - } - // flatten version into String - version = versionSemver.version - - // defaultVersion should come from process.version so ought to be valid semver - isDefaultVersion = version === semver.parse(defaultVersion).version - - // can't use process.release if we're using --target=x.y.z - if (!isDefaultVersion) { - defaultRelease = null - } - - if (defaultRelease) { - // v3 onward, has process.release - name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes - } else { - // old node or alternative --target= - // semver.satisfies() doesn't like prerelease tags so test major directly - isNamedForLegacyIojs = versionSemver.major >= 1 && versionSemver.major < 4 - // isNamedForLegacyIojs is required to support Electron < 4 (in particular Electron 3) - // as previously this logic was used to ensure "iojs" was used to download iojs releases - // and "node" for node releases. Unfortunately the logic was broad enough that electron@3 - // published release assets as "iojs" so that the node-gyp logic worked. Once Electron@3 has - // been EOL for a while (late 2019) we should remove this hack. - name = isNamedForLegacyIojs ? 'iojs' : 'node' - } - - // check for the nvm.sh standard mirror env variables - if (!overrideDistUrl && process.env.NODEJS_ORG_MIRROR) { - overrideDistUrl = process.env.NODEJS_ORG_MIRROR - } - - if (overrideDistUrl) { - log.verbose('download', 'using dist-url', overrideDistUrl) - } - - if (overrideDistUrl) { - distBaseUrl = overrideDistUrl.replace(/\/+$/, '') - } else { - distBaseUrl = 'https://nodejs.org/dist' - } - distBaseUrl += '/v' + version + '/' - - // new style, based on process.release so we have a lot of the data we need - if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) { - baseUrl = url.resolve(defaultRelease.headersUrl, './') - libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major) - libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major) - libUrlArm64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'arm64', versionSemver.major) - tarballUrl = defaultRelease.headersUrl - } else { - // older versions without process.release are captured here and we have to make - // a lot of assumptions, additionally if you --target=x.y.z then we can't use the - // current process.release - baseUrl = distBaseUrl - libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major) - libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major) - libUrlArm64 = resolveLibUrl(name, baseUrl, 'arm64', versionSemver.major) - - // making the bold assumption that anything with a version number >3.0.0 will - // have a *-headers.tar.gz file in its dist location, even some frankenstein - // custom version - canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) - tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz') - } - - return { - version: version, - semver: versionSemver, - name: name, - baseUrl: baseUrl, - tarballUrl: tarballUrl, - shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), - versionDir: (name !== 'node' ? name + '-' : '') + version, - ia32: { - libUrl: libUrl32, - libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)) - }, - x64: { - libUrl: libUrl64, - libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) - }, - arm64: { - libUrl: libUrlArm64, - libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrlArm64).path)) - } - } -} - -function normalizePath (p) { - return path.normalize(p).replace(/\\/g, '/') -} - -function resolveLibUrl (name, defaultUrl, arch, versionMajor) { - var base = url.resolve(defaultUrl, './') - var hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl)) - - if (!hasLibUrl) { - // let's assume it's a baseUrl then - if (versionMajor >= 1) { - return url.resolve(base, 'win-' + arch + '/' + name + '.lib') - } - // prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/ - return url.resolve(base, (arch === 'x86' ? '' : arch + '/') + name + '.lib') - } - - // else we have a proper url to a .lib, just make sure it's the right arch - return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/') -} - -module.exports = processRelease diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/rebuild.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/rebuild.js deleted file mode 100644 index a1c5b27cb..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/rebuild.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -function rebuild (gyp, argv, callback) { - gyp.todo.push( - { name: 'clean', args: [] } - , { name: 'configure', args: argv } - , { name: 'build', args: [] } - ) - process.nextTick(callback) -} - -module.exports = rebuild -module.exports.usage = 'Runs "clean", "configure" and "build" all at once' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/remove.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/remove.js deleted file mode 100644 index 8c945e565..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/remove.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' - -const fs = require('fs') -const rm = require('rimraf') -const path = require('path') -const log = require('npmlog') -const semver = require('semver') - -function remove (gyp, argv, callback) { - var devDir = gyp.devDir - log.verbose('remove', 'using node-gyp dir:', devDir) - - // get the user-specified version to remove - var version = argv[0] || gyp.opts.target - log.verbose('remove', 'removing target version:', version) - - if (!version) { - return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"')) - } - - var versionSemver = semver.parse(version) - if (versionSemver) { - // flatten the version Array into a String - version = versionSemver.version - } - - var versionPath = path.resolve(gyp.devDir, version) - log.verbose('remove', 'removing development files for version:', version) - - // first check if its even installed - fs.stat(versionPath, function (err) { - if (err) { - if (err.code === 'ENOENT') { - callback(null, 'version was already uninstalled: ' + version) - } else { - callback(err) - } - return - } - // Go ahead and delete the dir - rm(versionPath, callback) - }) -} - -module.exports = exports = remove -module.exports.usage = 'Removes the node development files for the specified version' diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/util.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/util.js deleted file mode 100644 index 3e23c628e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/lib/util.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -const log = require('npmlog') -const execFile = require('child_process').execFile -const path = require('path') - -function logWithPrefix (log, prefix) { - function setPrefix (logFunction) { - return (...args) => logFunction.apply(null, [ prefix, ...args ]) // eslint-disable-line - } - return { - silly: setPrefix(log.silly), - verbose: setPrefix(log.verbose), - info: setPrefix(log.info), - warn: setPrefix(log.warn), - error: setPrefix(log.error) - } -} - -function regGetValue (key, value, addOpts, cb) { - const outReValue = value.replace(/\W/g, '.') - const outRe = new RegExp(`^\\s+${outReValue}\\s+REG_\\w+\\s+(\\S.*)$`, 'im') - const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe') - const regArgs = ['query', key, '/v', value].concat(addOpts) - - log.silly('reg', 'running', reg, regArgs) - const child = execFile(reg, regArgs, { encoding: 'utf8' }, - function (err, stdout, stderr) { - log.silly('reg', 'reg.exe stdout = %j', stdout) - if (err || stderr.trim() !== '') { - log.silly('reg', 'reg.exe err = %j', err && (err.stack || err)) - log.silly('reg', 'reg.exe stderr = %j', stderr) - return cb(err, stderr) - } - - const result = outRe.exec(stdout) - if (!result) { - log.silly('reg', 'error parsing stdout') - return cb(new Error('Could not parse output of reg.exe')) - } - log.silly('reg', 'found: %j', result[1]) - cb(null, result[1]) - }) - child.stdin.end() -} - -function regSearchKeys (keys, value, addOpts, cb) { - var i = 0 - const search = () => { - log.silly('reg-search', 'looking for %j in %j', value, keys[i]) - regGetValue(keys[i], value, addOpts, (err, res) => { - ++i - if (err && i < keys.length) { return search() } - cb(err, res) - }) - } - search() -} - -module.exports = { - logWithPrefix: logWithPrefix, - regGetValue: regGetValue, - regSearchKeys: regSearchKeys -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/macOS_Catalina.md b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/macOS_Catalina.md deleted file mode 100644 index 4fe0f29b2..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/macOS_Catalina.md +++ /dev/null @@ -1,104 +0,0 @@ -# Installation notes for macOS Catalina (v10.15) - -_This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or when future Catalina versions no longer raise these issues._ - -**Both upgrading to macOS Catalina and running a Software Update in Catalina may cause normal `node-gyp` installations to fail. This might manifest as the following error during `npm install`:** - -```console -gyp: No Xcode or CLT version detected! -``` - -## node-gyp v7 - -The newest release of `node-gyp` should solve this problem. If you are using `node-gyp` directly then you should be able to install v7 and use it as-is. - -If you need to use `node-gyp` from within `npm` (e.g. through `npm install`), you will have to install `node-gyp` (either globally with `-g` or to a predictable location) and tell `npm` where the new version is. Either use: - -* `npm config set node_gyp `; or -* run `npm` with an environment variable prefix: `npm_config_node_gyp= npm install` - -Where "path to node-gyp" is to the `node-gyp` executable which may be a symlink in your global bin directory (e.g. `/usr/local/bin/node-gyp`), or a path to the `node-gyp` installation directory and the `bin/node-gyp.js` file within it (e.g. `/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js`). - -**If you use `npm config set` to change your global `node_gyp` you are responsible for keeping it up to date and can't rely on `npm` to give you a newer version when available.** Use `npm config delete node_gyp` to unset this configuration option. - -## Fixing Catalina for older versions of `node-gyp` - -### Is my Mac running macOS Catalina? -Let's first make sure that your Mac is running Catalina: -``` -% sw_vers - ProductName: Mac OS X - ProductVersion: 10.15 - BuildVersion: 19A602 -``` -If `ProductVersion` is less then `10.15` then this document is not for you. Normal install docs for `node-gyp` on macOS can be found at https://github.com/nodejs/node-gyp#on-macos - - -### The acid test -To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run: -``` -curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash -``` - -If test succeeded, _you are done_! You should be ready to [install](https://github.com/nodejs/node-gyp#installation) `node-gyp`. - -If test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions). - -### Solutions -There are three ways to install the Xcode libraries `node-gyp` needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable. - -1. With the full Xcode (~7.6 GB download) from the `App Store` app. -2. With the _much_ smaller Xcode Command Line Tools via `xcode-select --install` -3. With the _much_ smaller Xcode Command Line Tools via manual download. **For people running the latest version of Catalina (10.15.2 at the time of this writing), this has worked when the other two solutions haven't.** - -### Installing `node-gyp` using the full Xcode -1. `xcodebuild -version` should show `Xcode 11.1` or later. - * If not, then install/upgrade Xcode from the App Store app. -2. Open the Xcode app and... - * Under __Preferences > Locations__ select the tools if their location is empty. - * Allow Xcode app to do an essential install of the most recent compiler tools. -3. Once all installations are _complete_, quit out of Xcode. -4. `sudo xcodebuild -license accept` # If you agree with the licensing terms. -5. `softwareupdate -l` # No listing is a good sign. - * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them. -6. `xcode-select -version` # Should return `xcode-select version 2370` or later. -7. `xcode-select -print-path` # Should return `/Applications/Xcode.app/Contents/Developer` -8. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. -9. If the _acid test_ does _not_ pass then... -10. `sudo xcode-select --reset` # Enter root password. No output is normal. -11. Repeat step 7 above. Is the path different this time? Repeat the _acid test_. - -### Installing `node-gyp` using the Xcode Command Line Tools via `xcode-select --install` -1. If the _acid test_ has not succeeded, then try `xcode-select --install` -2. If the installation command returns `xcode-select: error: command line tools are already installed, use "Software Update" to install updates`, continue to [remove and reinstall](#i-did-all-that-and-the-acid-test-still-does-not-pass--) -3. Wait until the install process is _complete_. -4. `softwareupdate -l` # No listing is a good sign. - * If Xcode or Tools upgrades are listed, use "Software Update" to install them. -5. `xcode-select -version` # Should return `xcode-select version 2370` or later. -6. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` -7. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. -8. If the _acid test_ does _not_ pass then... -9. `sudo xcode-select --reset` # Enter root password. No output is normal. -10. Repeat step 5 above. Is the path different this time? Repeat the _acid test_. - -### Installing `node-gyp` using the Xcode Command Line Tools via manual download -1. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from . As of MacOS 10.15.5, that's [Command_Line_Tools_for_Xcode_11.5.dmg](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11.5/Command_Line_Tools_for_Xcode_11.5.dmg) -2. Install the package. -3. Run the [_acid test_ steps above](#The-acid-test). - -### I did all that and the acid test still does not pass :-( -1. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal. -2. `sudo rm -rf /Library/Developer/CommandLineTools` # Enter root password. -3. `sudo xcode-select --reset` -4. `xcode-select --install` -5. If the [_acid test_ steps above](#The-acid-test) still does _not_ pass then... -6. `npm explore npm -g -- npm install node-gyp@latest` -7. `npm explore npm -g -- npm explore npm-lifecycle -- npm install node-gyp@latest` -8. If the _acid test_ still does _not_ pass then... -9. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. - -Lessons learned from: -* https://github.com/nodejs/node-gyp/issues/1779 -* https://github.com/nodejs/node-gyp/issues/1861 -* https://github.com/nodejs/node-gyp/issues/1927 and elsewhere -* Thanks to @rrrix for discovering Solution 3 diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/macOS_Catalina_acid_test.sh b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/macOS_Catalina_acid_test.sh deleted file mode 100644 index e1e98941a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/macOS_Catalina_acid_test.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -pkgs=( - "com.apple.pkg.DeveloperToolsCLILeo" # standalone - "com.apple.pkg.DeveloperToolsCLI" # from XCode - "com.apple.pkg.CLTools_Executables" # Mavericks -) - -for pkg in "${pkgs[@]}"; do - output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null) - if [ "$output" ]; then - version=$(echo "$output" | grep 'version' | cut -d' ' -f2) - break - fi -done - -if [ "$version" ]; then - echo "Command Line Tools version: $version" -else - echo >&2 'Command Line Tools not found' -fi diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/package.json b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/package.json deleted file mode 100644 index fbeae5e20..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "node-gyp", - "description": "Node.js native addon build tool", - "license": "MIT", - "keywords": [ - "native", - "addon", - "module", - "c", - "c++", - "bindings", - "gyp" - ], - "version": "8.4.1", - "installVersion": 9, - "author": "Nathan Rajlich (http://tootallnate.net)", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/node-gyp.git" - }, - "preferGlobal": true, - "bin": "./bin/node-gyp.js", - "main": "./lib/node-gyp.js", - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "engines": { - "node": ">= 10.12.0" - }, - "devDependencies": { - "bindings": "^1.5.0", - "nan": "^2.14.2", - "require-inject": "^1.4.4", - "standard": "^14.3.4", - "tap": "^12.7.0" - }, - "scripts": { - "lint": "standard */*.js test/**/*.js", - "test": "npm run lint && tap --timeout=120 test/test-*" - } -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/src/win_delay_load_hook.cc b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/src/win_delay_load_hook.cc deleted file mode 100644 index 169f8029f..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/src/win_delay_load_hook.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * When this file is linked to a DLL, it sets up a delay-load hook that - * intervenes when the DLL is trying to load the host executable - * dynamically. Instead of trying to locate the .exe file it'll just - * return a handle to the process image. - * - * This allows compiled addons to work when the host executable is renamed. - */ - -#ifdef _MSC_VER - -#pragma managed(push, off) - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include - -#include -#include - -static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { - HMODULE m; - if (event != dliNotePreLoadLibrary) - return NULL; - - if (_stricmp(info->szDll, HOST_BINARY) != 0) - return NULL; - - m = GetModuleHandle(NULL); - return (FARPROC) m; -} - -decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; - -#pragma managed(pop) - -#endif diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/common.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/common.js deleted file mode 100644 index b714ee290..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/common.js +++ /dev/null @@ -1,3 +0,0 @@ -const envPaths = require('env-paths') - -module.exports.devDir = () => envPaths('node-gyp', { suffix: '' }).cache diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_BuildTools_minimal.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_BuildTools_minimal.txt deleted file mode 100644 index 244f6b079..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_BuildTools_minimal.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools","version":"15.9.28307.665","packages":["Microsoft.VisualStudio.Product.BuildTools","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.JavaScript.LanguageService","Microsoft.VisualStudio.JavaScript.LanguageService.Resources","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.CodeAnalysis.VisualStudio.Setup.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.CodeAnalysis.ExpressionEvaluator.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.PackageGroup.CoreEditor","PortableFacades","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer","Microsoft.TeamFoundation.OfficeIntegration","Microsoft.TeamFoundation.OfficeIntegration.Resources","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Editors","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.Component.Windows10SDK.17134","Win10SDK_10.0.17134","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.Workload.MSBuildTools","Microsoft.VisualStudio.Component.CoreBuildTools","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.BuildTools.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Component.MSBuild","Microsoft.PythonTools.BuildCore.Vsix","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.VisualStudio.NativeImageSupport","Microsoft.Build"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Community_workload.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Community_workload.txt deleted file mode 100644 index dd5e77daf..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Community_workload.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community","version":"15.9.28307.665","packages":["Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb","Win10SDK_IpOverUsb","Microsoft.VisualStudio.Component.VC.ATL.ARM64","Microsoft.VisualCpp.ATL.ARM64","Microsoft.VisualStudio.Component.VC.ATL.ARM","Microsoft.VisualCpp.ATL.ARM","Microsoft.VisualStudio.Component.VC.Tools.ARM","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualStudio.Graphics.Analyzer.Resources","Microsoft.Icecap.Analysis","Microsoft.VisualCpp.CRT.Redist.arm.OneCore.Desktop","Microsoft.VisualCpp.CRT.arm.Store","Microsoft.VisualCpp.CRT.arm.Desktop","Microsoft.VisualStudio.PackageGroup.VC.Tools.x64.ARM","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetarm","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetARM.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM.Resources","Microsoft.VisualCpp.Premium.Tools.ARM.Base","Microsoft.VisualCpp.Premium.Tools.ARM.Base.Resources","Microsoft.VisualCpp.PGO.ARM","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualStudio.Product.Community","Microsoft.VisualCpp.Tools.Hostx86.Targetarm","Microsoft.VisualStudio.Component.VC.Tools.ARM64","Microsoft.VisualStudio.VC.MSBuild.Arm64","Microsoft.VisualCpp.CRT.Redist.ARM64.OneCore.Desktop","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.CRT.ARM64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ARM64.Store","Microsoft.VisualCpp.CRT.ARM64.Desktop","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.Icecap.Analysis.Resources","Microsoft.VisualCpp.VCTip.hostX86.targetARM","Microsoft.VisualStudio.PackageGroup.VC.Tools.x64.ARM64","Microsoft.VisualCpp.Tools.Core","Microsoft.VisualCpp.PGO.ARM64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetarm64","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetARM64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM64.Resources","Microsoft.VisualCpp.Premium.Tools.ARM64.Base","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Tools.HostX86.TargetARM.Resources","Microsoft.VisualCpp.CRT.Redist.ARM64","Microsoft.VisualCpp.CRT.arm.OneCore.Desktop","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Component.WixToolset.VisualStudioExtension.Dev15","WixToolset.VisualStudioExtension.Dev15","Microsoft.VisualCpp.MFC.X64","Microsoft.VisualCpp.ATL.Headers","Microsoft.VisualStudio.Component.VC.CMake.Project","Microsoft.VisualStudio.VC.CMake","Microsoft.VisualStudio.VC.CMake.Project","Microsoft.VisualStudio.Component.Windows10SDK.17763","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","MLGen","Microsoft.VisualStudio.Graphics.Analyzer","Microsoft.VisualStudio.Component.TestTools.Core","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.NuGet.Licenses","SQLCommon","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualCpp.Tools.HostX64.TargetARM","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualCpp.HTMLHelpWorkshop.Msi","Microsoft.Icecap.Collection.Msi.Resources","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.VCTip.hostX64.targetARM","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.Graphics.Appid","Microsoft.VisualCpp.ATL.Source","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.Debugger.ImmersiveActivateHelper.Msi","Microsoft.VisualStudio.Debugger.JustInTime","Microsoft.DiagnosticsHub.CpuSampling","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualCpp.Tools.HostX64.TargetARM.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.Component.MSBuild","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.WebToolsExtensions","Microsoft.VisualCpp.Tools.Hostx86.Targetarm64","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualCpp.VCTip.hostX86.targetARM64","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualCpp.Tools.HostX86.TargetARM64.Resources","Microsoft.VisualStudio.RazorExtension","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualCpp.MFC.Source","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.Graphics.Viewers","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.MFC.Redist.X86","Microsoft.VisualStudio.WebToolsExtensions.Chip","Microsoft.DiagnosticsHub.Runtime.Resources","Microsoft.DiagnosticsHub.CpuSampling.Targeted","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.Component.VC.DiagnosticTools","Microsoft.VisualCpp.MFC.Redist.X64","Microsoft.VisualStudio.PackageGroup.TestTools.Native","Microsoft.VisualStudio.Graphics.Viewers.Resources","Microsoft.VisualCpp.MFC.MBCS","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Component.TextTemplating","Win10SDK_10.0.17763","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualCpp.MFC.MBCS.X64","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.Graphics.EnableTools","Microsoft.VisualStudio.Graphics.Appid.Resources","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualCpp.MFC.Headers","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.Graphics.Analyzer.Targeted","Microsoft.VisualCpp.CRT.Headers","Microsoft.DiagnosticsHub.Runtime.Targeted","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetARM64","Microsoft.VisualCpp.VCTip.hostX64.targetARM64","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.Icecap.Collection.Msi","Microsoft.VisualCpp.ATL.X86","Microsoft.VisualCpp.Tools.HostX64.TargetARM64.Resources","Microsoft.VisualStudio.Component.VC.ATLMFC","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.Icecap.Collection.Msi.Resources.Targeted","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualStudio.Component.Graphics.Tools","Microsoft.VisualStudio.WebTools.Resources","Microsoft.VisualCpp.ATL.X64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualStudio.Component.Graphics.Win81","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.Icecap.Analysis.Resources.Targeted","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.MFC.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.JavaScript.LanguageService","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.CredentialProvider","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.Component.NuGet","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualCpp.PGO.Headers","Microsoft.DiagnosticsHub.Collection","Microsoft.Icecap.Collection.Msi.Targeted","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualStudio.Branding.Community","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.WebToolsExtensions.Common","Microsoft.VisualStudio.WebTools.MSBuild","Microsoft.VisualStudio.NuGet.Core","Microsoft.DiagnosticsHub.Collection.Service","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.DiaSymReader.Native","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Component.Roslyn.LanguageServices","Microsoft.DiagnosticsHub.Collection.StopService.Install","Microsoft.VisualStudio.InteractiveWindow","Microsoft.PackageGroup.DiagnosticsHub.Platform","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.CodeAnalysis.ExpressionEvaluator.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.Debugger.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","sqlsysclrtypes","Microsoft.VisualStudio.ProTools","Component.Microsoft.VisualStudio.RazorExtension","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.Build.Dependencies","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualStudio.VC.Ide.ATL.Resources","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.Debugger.Managed","Microsoft.VisualStudio.Workload.NativeDesktop","Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest","Microsoft.VisualStudio.Debugger.JustInTime.Msi","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","sqlsysclrtypes","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.WebTools","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.TeamFoundation.OfficeIntegration.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.JavaScript.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.TestAdapterForGoogleTest","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.Component.Windows10SDK.17134","Microsoft.VisualStudio.PackageGroup.Core","PortableFacades","Microsoft.DiaSymReader","Microsoft.DiagnosticsHub.Runtime","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.Community","Microsoft.TeamFoundation.OfficeIntegration","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualCpp.Tools.Common.UtilsPrereq","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.ServiceHub","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.TeamExplorer","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents.Resources","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.GraphProvider","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents","Microsoft.CodeAnalysis.VisualStudio.Setup.Interactive.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup.Resources","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.NuGet.Build.Tasks","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.Build","Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.ATL","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.Workload.CoreEditor","Microsoft.VisualStudio.MinShell.Interop","Microsoft.Build.FileTracker.Msi","Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core","Microsoft.MSHtml","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.Devenv.Msi","Microsoft.VisualStudio.Component.VC.ATL","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.CoreEditor","Win10SDK_10.0.17134","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.Component.Debugger.JustInTime","Microsoft.VisualStudio.VC.Ide.MFC","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.PackageGroup.TeamExplorer","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.Devenv","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualStudio.Devenv.Resources","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.MefHosting","Microsoft.DiagnosticsHub.Collection.StopService.Uninstall","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualCpp.MFC.X86","Microsoft.VisualStudio.Log.Resources","Microsoft.Icecap.Analysis.Targeted","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.Devenv.Config","Microsoft.VisualStudio.MinShell.Resources","Microsoft.VisualStudio.Initializer","Microsoft.Net.PackageGroup.4.6.Redist"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Express.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Express.txt deleted file mode 100644 index c4b3b5f2b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Express.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress","version":"15.9.28307.858","packages":["Microsoft.VisualStudio.Product.WDExpress","Microsoft.VisualStudio.Workload.WDExpress","Microsoft.VisualStudio.Component.Windows10SDK.17763","MLGen","Win10SDK_10.0.17763","Microsoft.VisualStudio.Component.Windows10SDK.14393","Win10SDK_10.0.14393.795","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.Component.VC.Tools.ARM64","Microsoft.VisualStudio.VC.MSBuild.Arm64","Microsoft.VisualCpp.CRT.Redist.ARM64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.ARM64","Microsoft.VisualCpp.CRT.ARM64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ARM64.Store","Microsoft.VisualCpp.CRT.ARM64.Desktop","Microsoft.VisualCpp.Tools.Hostx86.Targetarm64","Microsoft.VisualCpp.VCTip.hostX86.targetARM64","Microsoft.VisualCpp.Tools.HostX86.TargetARM64.Resources","Microsoft.VisualStudio.Component.VC.Tools.ARM","Microsoft.VisualCpp.Tools.Hostx86.Targetarm","Microsoft.VisualCpp.VCTip.hostX86.targetARM","Microsoft.VisualCpp.Tools.HostX86.TargetARM.Resources","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.arm.OneCore.Desktop","Microsoft.VisualCpp.CRT.arm.OneCore.Desktop","Microsoft.VisualCpp.CRT.arm.Store","Microsoft.VisualCpp.CRT.arm.Desktop","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.JavaScript.LanguageService","Microsoft.VisualStudio.JavaScript.LanguageService.Resources","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualStudio.Component.VC.CLI.Support","Microsoft.VisualCpp.CLI.X86","Microsoft.VisualCpp.CLI.X64","Microsoft.VisualCpp.CLI.Source","Microsoft.VisualCpp.CLI.ARM64","Microsoft.VisualCpp.CLI.ARM","Microsoft.VisualStudio.VC.Templates.CLR","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Templates.CLR.Resources","Microsoft.Component.VC.Runtime.OSSupport","Microsoft.Windows.UniversalCRT.Tools.Msi","Microsoft.Windows.UniversalCRT.Tools.Msi","Microsoft.Windows.UniversalCRT.ExtensionSDK.Msi","Microsoft.Windows.UniversalCRT.HeadersLibsSources.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.Component.HelpViewer","Microsoft.HelpViewer","Microsoft.VisualStudio.Help.Configuration.Msi","Microsoft.VisualStudio.Component.SQL.DataSources","Microsoft.VisualStudio.Component.SQL.SSDT","Microsoft.VisualStudio.Component.SQL.CMDUtils","sqlcmdlnutils","Microsoft.VisualStudio.Component.Common.Azure.Tools","Microsoft.VisualStudio.Azure.CommonAzureTools","SSDT","Microsoft.VisualStudio.Component.SQL.ADAL","sql_adalsql","Microsoft.VisualStudio.Component.NuGet","Microsoft.CredentialProvider","Microsoft.VisualStudio.NuGet.Licenses","Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime","Microsoft.VisualStudio.Component.SQL.NCLI","sqllocaldb","sqlncli","Microsoft.VisualStudio.Component.EntityFramework","Microsoft.VisualStudio.PackageGroup.DslRuntime","Microsoft.VisualStudio.Dsl.Core","Microsoft.VisualStudio.Dsl.GraphObject","Microsoft.VisualStudio.Dsl.Core.Resources","Microsoft.VisualStudio.EntityFrameworkTools","Microsoft.VisualStudio.EntityFrameworkTools.Msi","Microsoft.VisualStudio.Component.Roslyn.LanguageServices","Microsoft.VisualStudio.InteractiveWindow","Microsoft.DiaSymReader.Native","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents.Resources","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents","Microsoft.CodeAnalysis.VisualStudio.Setup.Interactive.Resources","Microsoft.Net.ComponentGroup.TargetingPacks.Common","Microsoft.Net.Component.4.6.TargetingPack","Microsoft.Net.4.6.TargetingPack","Microsoft.Net.Component.4.5.2.TargetingPack","Microsoft.Net.4.5.2.TargetingPack","Microsoft.Net.Component.4.5.1.TargetingPack","Microsoft.Net.4.5.1.TargetingPack","Microsoft.Net.Component.4.5.TargetingPack","Microsoft.Net.4.5.TargetingPack","Microsoft.Net.Component.4.TargetingPack","Microsoft.Net.4.TargetingPack","Microsoft.Net.ComponentGroup.DevelopmentPrerequisites","Microsoft.Net.Component.4.6.1.TargetingPack","Microsoft.Net.4.6.1.TargetingPack","Microsoft.Net.Cumulative.TargetingPack.Resources","Microsoft.Net.Component.4.6.1.SDK","Microsoft.Net.4.6.1.SDK","Microsoft.VisualStudio.Component.TextTemplating","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualStudio.Component.VisualStudioData","Microsoft.VisualStudio.Component.SQL.CLR","Microsoft.VisualStudio.ProTools","sqlsysclrtypes","sqlsysclrtypes","SQLCommon","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.XamlDiagnostics","Microsoft.VisualStudio.XamlDiagnostics.Resources","Microsoft.VisualStudio.XamlDesigner","Microsoft.VisualStudio.XamlDesigner.Resources","Microsoft.VisualStudio.XamlDesigner.Executables","Microsoft.VisualStudio.XamlShared","Microsoft.VisualStudio.XamlShared.Resources","Microsoft.VisualStudio.PackageGroup.TestTools.Managed","Microsoft.VisualStudio.PackageGroup.IntelliTrace.Core","Microsoft.IntelliTrace.Core","Microsoft.IntelliTrace.Core.Targeted","Microsoft.IntelliTrace.ProfilerProxy.Msi.x64","Microsoft.IntelliTrace.ProfilerProxy.Msi","Microsoft.VisualStudio.NuGet.Core","Microsoft.VisualStudio.TestWindow.SourceBasedTestDiscovery","Microsoft.VisualStudio.TestWindow.Dotnet","Microsoft.VisualStudio.TestTools.TestGeneration","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.PackageGroup.TestTools.Enterprise","Microsoft.VisualStudio.PackageGroup.TestTools.MSTestV2.Managed","Microsoft.VisualStudio.TestTools.MSTestV2.WizardExtension.UnitTest","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","Microsoft.Component.ClickOnce","Microsoft.VisualStudio.PackageGroup.ClickOnce.MSBuild","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.ClickOnce.SignTool.Msi","Microsoft.SQL.ClickOnceBootstrapper.Msi","Microsoft.Net.ClickOnceBootstrapper","Microsoft.ClickOnce.BootStrapper.Msi.Resources","Microsoft.ClickOnce.BootStrapper.Msi","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.CodeAnalysis.VisualStudio.Setup.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.CodeAnalysis.ExpressionEvaluator.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.ClickOnce.Resources","Microsoft.VisualStudio.ClickOnce","Microsoft.Component.MSBuild","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.VisualStudio.TemplateEngine","Microsoft.VisualStudio.WebToolsExtensions.Common","Microsoft.NET.Sdk","Microsoft.VisualStudio.PackageGroup.TestTools.Templates.Managed","Microsoft.VisualStudio.TestTools.Templates.Managed","Microsoft.VisualStudio.TestTools.Templates.Managed.Resources","Microsoft.VisualStudio.Templates.VB.MSTestv2.Desktop.UnitTest","Microsoft.VisualStudio.Templates.CS.MSTestv2.Desktop.UnitTest","Microsoft.VisualStudio.Templates.VB.Wpf","Microsoft.VisualStudio.Templates.VB.Wpf.Resources","Microsoft.VisualStudio.Templates.VB.Winforms","Microsoft.VisualStudio.Templates.VB.ManagedCore","Microsoft.VisualStudio.Templates.VB.Shared","Microsoft.VisualStudio.Templates.VB.Shared.Resources","Microsoft.VisualStudio.Templates.VB.ManagedCore.Resources","Microsoft.VisualStudio.Templates.CS.GettingStarted.Desktop.Package","Microsoft.VisualStudio.Templates.GetStarted.Desktop.Setup","Microsoft.VisualStudio.Templates.CS.GettingStarted.Console.Package","Microsoft.VisualStudio.Templates.GetStarted.Resources","Microsoft.VisualStudio.Templates.GetStarted.Common.Setup","Microsoft.VisualStudio.Templates.GetStarted.Console.Setup","Microsoft.VisualStudio.Templates.CS.Wpf","Microsoft.VisualStudio.Templates.CS.Wpf.Resources","Microsoft.VisualStudio.Templates.CS.Winforms","Microsoft.VisualStudio.Templates.CS.ManagedCore","Microsoft.VisualStudio.Templates.CS.Shared","Microsoft.VisualStudio.Templates.Editorconfig.Wizard.Setup","Templates.Editorconfig.SolutionFile.Setup","Microsoft.VisualStudio.Templates.CS.Shared.Resources","Microsoft.VisualStudio.Templates.CS.ManagedCore.Resources","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.PackageGroup.CoreEditor","PortableFacades","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Build","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer","Microsoft.TeamFoundation.OfficeIntegration","Microsoft.TeamFoundation.OfficeIntegration.Resources","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.WDExpress","Microsoft.VisualStudio.WDExpress.Resources","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.MinShell.Resources","Microsoft.Net.PackageGroup.4.6.Redist","Microsoft.VisualStudio.Branding.WDExpress"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Unusable.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Unusable.txt deleted file mode 100644 index fc0a257f4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2017_Unusable.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildToolsUnusable","version":"15.9.28307.665","packages":["Microsoft.VisualStudio.Product.BuildTools","Microsoft.VisualStudio.Component.Windows10SDK.17134","Win10SDK_10.0.17134","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.Workload.MSBuildTools","Microsoft.VisualStudio.Component.CoreBuildTools","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.BuildTools.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Component.MSBuild","Microsoft.PythonTools.BuildCore.Vsix","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.Net.4.6.1.FullRedist.NonThreshold","Microsoft.Windows.UniversalCRT.Msu.81","Microsoft.VisualStudio.NativeImageSupport","Microsoft.Build"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_BuildTools_minimal.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_BuildTools_minimal.txt deleted file mode 100644 index f07d25416..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_BuildTools_minimal.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools","version":"16.1.28922.388","packages":["Microsoft.VisualStudio.Product.BuildTools","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.CodeSense.Community","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Platform.CallHierarchy","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer.Common","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.OpenFolder.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Platform.NavigateTo","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VisualC.Logging","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.VCPkgDatabase","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Agent","Microsoft.VisualStudio.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Concord","Microsoft.VisualStudio.VC.Ide.Debugger.Concord.Resources","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.DiaSymReader","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Concord.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed.Resources","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.PerfLib","Microsoft.VisualStudio.Debugger.Package.DiagHub.Client.VSx86","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.VisualStudio.Editors","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Platform.Editor","Microsoft.VisualStudio.Debugger.Concord","Microsoft.VisualStudio.Debugger.Concord.Resources","Microsoft.VisualStudio.Debugger.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.VisualStudio.Component.Windows10SDK.17134","Win10SDK_10.0.17134","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.VC.MSBuild.x86.v142","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.X64.v142","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM.v142","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.Workload.MSBuildTools","Microsoft.VisualStudio.Component.CoreBuildTools","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.BuildTools.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Component.MSBuild","Microsoft.PythonTools.BuildCore.Vsix","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.7.2.Redist","Microsoft.VisualStudio.NativeImageSupport","Microsoft.Build","Microsoft.VisualStudio.PackageGroup.NuGet","Microsoft.VisualStudio.NuGet.BuildTools"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_Community_workload.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_Community_workload.txt deleted file mode 100644 index 50071c25f..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_Community_workload.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community","version":"16.1.28922.388","packages":["Microsoft.VisualStudio.Workload.NativeDesktop","Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForGoogleTest","Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest","Microsoft.VisualStudio.Component.VC.ATL","Microsoft.VisualStudio.VC.Ide.ATL","Microsoft.VisualStudio.VC.Ide.ATL.Resources","Microsoft.VisualCpp.ATL.X86","Microsoft.VisualCpp.ATL.X64","Microsoft.VisualCpp.ATL.Source","Microsoft.VisualCpp.ATL.Headers","Microsoft.VisualStudio.Component.VC.CMake.Project","Microsoft.VisualStudio.VC.CMake","Microsoft.VisualStudio.VC.CMake.Project","Microsoft.VisualStudio.VC.ExternalBuildFramework","Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core","Microsoft.VisualStudio.PackageGroup.TestTools.Native","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.VC.UnitTest.Desktop.Build.Core","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.Component.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.ImmersiveActivateHelper.Msi","Microsoft.VisualStudio.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.JustInTime.Msi","Microsoft.VisualStudio.Component.Windows10SDK.17763","Win10SDK_10.0.17763","Microsoft.VisualStudio.Component.VC.DiagnosticTools","Microsoft.VisualStudio.Component.Graphics.Tools","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.Graphics.Viewers","Microsoft.VisualStudio.Graphics.Viewers.Resources","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Analyzer","Microsoft.VisualStudio.Graphics.Analyzer.Targeted","Microsoft.VisualStudio.Graphics.Analyzer.Resources","Microsoft.VisualStudio.Graphics.Appid","Microsoft.VisualStudio.Graphics.Appid.Resources","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.VC.MSBuild.X64.v142","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM.v142","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.x86.v142","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.VCPkgDatabase","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Component.Microsoft.VisualStudio.LiveShare","Microsoft.VisualStudio.LiveShare","Microsoft.Icecap.Analysis","Microsoft.Icecap.Analysis.Targeted","Microsoft.Icecap.Analysis.Resources","Microsoft.Icecap.Analysis.Resources.Targeted","Microsoft.Icecap.Collection.Msi","Microsoft.Icecap.Collection.Msi.Targeted","Microsoft.Icecap.Collection.Msi.Resources","Microsoft.Icecap.Collection.Msi.Resources.Targeted","Microsoft.DiagnosticsHub.Instrumentation","Microsoft.DiagnosticsHub.CpuSampling.ExternalDependencies","Microsoft.DiagnosticsHub.CpuSampling","Microsoft.DiagnosticsHub.CpuSampling.Targeted","Microsoft.PackageGroup.DiagnosticsHub.Platform","Microsoft.DiagnosticsHub.Runtime.ExternalDependencies","Microsoft.DiagnosticsHub.Runtime.ExternalDependencies.Targeted","Microsoft.DiagnosticsHub.Collection.ExternalDependencies.x64","Microsoft.DiagnosticsHub.Collection.StopService.Uninstall","Microsoft.DiagnosticsHub.Runtime","Microsoft.DiagnosticsHub.Runtime.Targeted","Microsoft.DiagnosticsHub.Collection","Microsoft.DiagnosticsHub.Collection.Service","Microsoft.DiagnosticsHub.Collection.StopService.Install","Microsoft.VisualStudio.Component.IntelliCode","Microsoft.VisualStudio.IntelliCode","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","Microsoft.VisualStudio.LiveShareApi","Microsoft.VisualStudio.Component.TextTemplating","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.Component.MSBuild","Microsoft.NuGet.Build.Tasks","Microsoft.DiagnosticsHub.KB2882822.Win7","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions","Microsoft.VisualStudio.ProTools","sqlsysclrtypes","sqlsysclrtypes","SQLCommon","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.WebToolsExtensions","Microsoft.VisualStudio.WebTools","Microsoft.VisualStudio.WebTools.Resources","Microsoft.VisualStudio.WebTools.MSBuild","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.VisualC.Logging","Microsoft.WebTools.Shared","Microsoft.WebTools.DotNet.Core.ItemTemplates","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.Windows.UniversalCRT.Msu.7","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers","Microsoft.VisualStudio.Component.NuGet","Microsoft.CredentialProvider","Microsoft.VisualStudio.NuGet.PowershellBindingRedirect","Microsoft.VisualStudio.NuGet.Licenses","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.CodeSense.Community","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Agent","Microsoft.VisualStudio.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Concord","Microsoft.VisualStudio.VC.Ide.Debugger.Concord.Resources","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Concord.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed.Resources","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.DbgHelp.Win8","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.DbgHelp.Win8","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.Debugger.Package.DiagHub.Client.VSx86","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.DbgHelp.Win8","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Concord","Microsoft.VisualStudio.Debugger.Concord.Resources","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Platform.CallHierarchy","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.Devenv.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.Product.Community","Microsoft.VisualStudio.Workload.CoreEditor","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualCpp.Tools.Common.UtilsPrereq","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Build","Microsoft.VisualStudio.PackageGroup.NuGet","Microsoft.VisualStudio.NuGet.Core","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer.Common","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.OpenFolder.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.Devenv","Microsoft.VisualStudio.Devenv.Resources","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Platform.NavigateTo","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.PerfLib","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Platform.Editor","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.Devenv.Config","Microsoft.VisualStudio.MinShell.Resources","Microsoft.Net.PackageGroup.4.7.2.Redist","Microsoft.Net.4.7.2.FullRedist","Microsoft.VisualStudio.Branding.Community"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_Preview.txt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_Preview.txt deleted file mode 100644 index 806509e7c..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/VS_2019_Preview.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview","version":"16.0.28608.199","packages":["Microsoft.VisualStudio.Product.Enterprise","Microsoft.VisualStudio.Workload.NativeDesktop","Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForGoogleTest","Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest","Microsoft.VisualStudio.Component.VC.ATL","Microsoft.VisualStudio.VC.Ide.ATL","Microsoft.VisualStudio.VC.Ide.ATL.Resources","Microsoft.VisualCpp.ATL.X86","Microsoft.VisualCpp.ATL.X64","Microsoft.VisualCpp.ATL.Source","Microsoft.VisualCpp.ATL.Headers","Microsoft.VisualStudio.Component.VC.CMake.Project","Microsoft.VisualStudio.VC.CMake","Microsoft.VisualStudio.VC.CMake.Project","Microsoft.VisualStudio.VC.ExternalBuildFramework","Microsoft.VisualStudio.Component.VC.DiagnosticTools","Microsoft.VisualStudio.Component.Graphics.Tools","Microsoft.VisualStudio.Graphics.Viewers","Microsoft.VisualStudio.Graphics.Viewers.Resources","Microsoft.VisualStudio.Graphics.EnableTools","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Analyzer","Microsoft.VisualStudio.Graphics.Analyzer.Targeted","Microsoft.VisualStudio.Graphics.Analyzer.Resources","Microsoft.VisualStudio.Graphics.Appid","Microsoft.VisualStudio.Graphics.Appid.Resources","Microsoft.VisualStudio.Component.Windows10SDK.17763","Win10SDK_10.0.17763","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core","Microsoft.VisualStudio.PackageGroup.TestTools.Native","Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native","Microsoft.VisualStudio.Component.ClassDesigner","Microsoft.VisualStudio.ClassDesigner","Microsoft.VisualStudio.ClassDesigner.Resources","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.VC.UnitTest.Desktop.Build.Core","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.VC.MSBuild.X64.v142","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM.v142","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.x86.v142","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.VCPkgDatabase","Microsoft.VisualStudio.VC.Ide.Progression.Enterprise","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualStudio.Component.CodeMap","Microsoft.VisualStudio.Component.GraphDocument","Microsoft.VisualStudio.Vmp","Microsoft.VisualStudio.GraphDocument","Microsoft.VisualStudio.GraphDocument.Resources","Microsoft.VisualStudio.CodeMap","Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime","Microsoft.VisualStudio.Component.SQL.NCLI","sqllocaldb","sqlncli","Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions","Microsoft.VisualStudio.WebToolsExtensions","Microsoft.VisualStudio.WebTools","Microsoft.VisualStudio.WebTools.Resources","Microsoft.VisualStudio.WebTools.MSBuild","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.Component.NuGet","Microsoft.CredentialProvider","Component.Microsoft.VisualStudio.LiveShare","Microsoft.VisualStudio.LiveShare","Microsoft.VisualStudio.Component.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.ImmersiveActivateHelper.Msi","Microsoft.VisualStudio.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.JustInTime.Msi","Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd","Microsoft.IntelliTrace.DiagnosticsHubAgent.Targeted","Microsoft.IntelliTrace.Debugger","Microsoft.IntelliTrace.Debugger.Targeted","Microsoft.IntelliTrace.FrontEnd","Microsoft.DiagnosticsHub.Instrumentation","Microsoft.DiagnosticsHub.CpuSampling","Microsoft.DiagnosticsHub.CpuSampling.Targeted","Microsoft.PackageGroup.DiagnosticsHub.Platform","Microsoft.DiagnosticsHub.Collection.StopService.Uninstall","Microsoft.DiagnosticsHub.Runtime","Microsoft.DiagnosticsHub.Runtime.Targeted","Microsoft.DiagnosticsHub.Runtime.Resources","Microsoft.DiagnosticsHub.Collection","Microsoft.DiagnosticsHub.Collection.Service","Microsoft.DiagnosticsHub.Collection.StopService.Install","Microsoft.VisualStudio.Dsl.GraphObject","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.NuGet.Licenses","Microsoft.WebTools.Shared","Microsoft.VisualStudio.WebToolsExtensions.DotNet.Core.ItemTemplates","Microsoft.VisualStudio.Component.TextTemplating","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualStudio.ProTools","sqlsysclrtypes","sqlsysclrtypes","SQLCommon","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.NuGet.Core","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.PackageGroup.IntelliTrace.Core","Microsoft.IntelliTrace.Core","Microsoft.IntelliTrace.Core.Concord","Microsoft.IntelliTrace.Core.Targeted","Microsoft.IntelliTrace.ProfilerProxy.Msi.x64","Microsoft.IntelliTrace.ProfilerProxy.Msi","Microsoft.VisualStudio.TestTools.DynamicCodeCoverage","Microsoft.VisualStudio.TestTools.CodeCoverage.Msi","Microsoft.VisualStudio.TestTools.CodeCoverage","Microsoft.Icecap.Analysis","Microsoft.Icecap.Analysis.Targeted","Microsoft.Icecap.Analysis.Resources","Microsoft.Icecap.Analysis.Resources.Targeted","Microsoft.Icecap.Collection.Msi","Microsoft.Icecap.Collection.Msi.Targeted","Microsoft.Icecap.Collection.Msi.Resources","Microsoft.Icecap.Collection.Msi.Resources.Targeted","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Remote","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Premium","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","Microsoft.VisualStudio.TestTools.NE.Msi.Targeted","Microsoft.VisualStudio.TestTools.NetworkEmulation","Microsoft.VisualStudio.TestTools.DataCollectors","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.CodeSense","Microsoft.VisualStudio.CodeSense.Community","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Agent","Microsoft.VisualStudio.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Concord","Microsoft.VisualStudio.VC.Ide.Debugger.Concord.Resources","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed.Resources","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.Debugger.Package.DiagHub.Client.VSx86","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Concord","Microsoft.VisualStudio.Debugger.Concord.Resources","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.ProfessionalCore","Microsoft.VisualStudio.Professional","Microsoft.VisualStudio.Professional.Msi","Microsoft.VisualStudio.PackageGroup.EnterpriseCore","Microsoft.VisualStudio.Enterprise.Msi","Microsoft.VisualStudio.Enterprise","Microsoft.ShDocVw","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Platform.CallHierarchy","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.Devenv.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.Component.MSBuild","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers","Microsoft.VisualStudio.Workload.CoreEditor","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualCpp.Tools.Common.UtilsPrereq","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Build","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer.Common","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.Devenv","Microsoft.VisualStudio.Devenv.Resources","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Platform.NavigateTo","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.Platform.Search","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Platform.Editor","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.Devenv.Config","Microsoft.VisualStudio.MinShell.Resources","Microsoft.Net.PackageGroup.4.7.2.Redist","Microsoft.VisualStudio.Branding.Enterprise"]}] diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/ca-bundle.crt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/ca-bundle.crt deleted file mode 100644 index fb1dea98a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/ca-bundle.crt +++ /dev/null @@ -1,40 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD -VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n -TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv -bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMBkxFzAV -BgNVBAMMDnN0cm9uZ2xvb3AuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAwOYI7OZ2FX/YjRgLZoDQlbPc5UZXU/j0e1wwiJNPtPEax9Y5Uoza0Pnt -Ikzkc2SfvQ+IJrhXo385tI0W5juuqbHnE7UrjUuPjUX6NHevkxcs/flmjan5wnZM -cPsGhH71WDuUEEflvZihf2Se2x+xgZtMhc5XGmVmRuZFYKvkgUhA2/w8/QrK+jPT -n9QRJxZjWNh2RBdC1B7u4jffSmOSUljYFH1I2eTeY+Rdi6YUIYSU9gEoZxsv3Tia -SomfMF5jt2Mouo6MzA+IhLvvFjcrcph1Qxgi9RkfdCMMd+Ipm9YWELkyG1bDRpQy -0iyHD4gvVsAqz1Y2KdRSdc3Kt+nTqwIDAQABoxkwFzAVBgNVHREEDjAMhwQAAAAA -hwR/AAABMA0GCSqGSIb3DQEBBQUAA4IBAQAhy4J0hML3NgmDRHdL5/iTucBe22Mf -jJjg2aifD1S187dHm+Il4qZNO2plWwAhN0h704f+8wpsaALxUvBIu6nvlvcMP5PH -jGN5JLe2Km3UaPvYOQU2SgacLilu+uBcIo2JSHLV6O7ziqUj5Gior6YxDLCtEZie -Ea8aX5/YjuACtEMJ1JjRqjgkM66XAoUe0E8onOK3FgTIO3tGoTJwRp0zS50pFuP0 -PsZtT04ck6mmXEXXknNoAyBCvPypfms9OHqcUIW9fiQnrGbS/Ri4QSQYj0DtFk/1 -na4fY1gf3zTHxH8259b/TOOaPfTnCEsOQtjUrWNR4xhmVZ+HJy4yytUW ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDbzCCAlcCAmm6MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlVTMQswCQYD -VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n -TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv -bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMH0xCzAJ -BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZ -MBcGA1UECgwQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRow -GAYDVQQDDBFjYS5zdHJvbmdsb29wLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANfj86jkvvYDjHBgiqWhk9Cj+bqiMq3MqnV0CBO4iuK33Fo6XssE -H+yVdXlIBFbFe6t655MdBVOR2Sfj7WqNh96vhu6PyDHiwcQlTaiLU6nhIed1J4Wv -lvnJHFmp8Wbtx5AgLT4UYu03ftvXEl2DLi3vhSL2tRM1ebXHB/KPbRWkb25DPX0P -foOHot3f2dgNe2x6kponf7E/QDmAu3s7Nlkfh+ryDhgGU7wocXEhXbprNqRqOGNo -xbXgUI+/9XDxYT/7Gn5LF/fPjtN+aB0SKMnTsDhprVlZie83mlqJ46fOOrR+vrsQ -mi/1m/TadrARtZoIExC/cQRdVM05EK4tUa8CAwEAATANBgkqhkiG9w0BAQsFAAOC -AQEAQ7k5WhyhDTIGYCNzRnrMHWSzGqa1y4tJMW06wafJNRqTm1cthq1ibc6Hfq5a -K10K0qMcgauRTfQ1MWrVCTW/KnJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae -KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ -YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n -VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ -uGZtfEvhbNm6m2i4UNmpCXxUZQ== ------END CERTIFICATE----- diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/ca.crt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/ca.crt deleted file mode 100644 index aaf97575b..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/ca.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDZDCCAkwCCQCAzfCLqrJvuTANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsMCG5vZGUt -Z3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEGJ1aWxkQG5v -ZGVqcy5vcmcwHhcNMTkwNjIyMDYyMjMzWhcNMjIwNDExMDYyMjMzWjB0MQswCQYD -VQQGEwJVUzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsM -CG5vZGUtZ3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEGJ1 -aWxkQG5vZGVqcy5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDS -CHjvtVW4HdbbUwZ/ZV9s6U4x0KSoyNQrsCZjB8kRpFPe50DS5mfmu2SNBGYKRgzk -4QEEwFB9N2o8YTWsCefSRl6ti4ToPZqulU4hhRKYrEGtMJcRzi3IN7s200JaO3UH -01Su8ruO0NESb5zEU1Ykfh8Lub8TGEAINmgI61d/5d5Aq3kDjUHQJt1Ekw03Ylnu -juQyCGZxLxnngu0mIvwzyL/UeeUgsfQLzvppUk6In7tC1zzMjSPWo0c8qu6KvrW4 -bKYnkZkzdQifzbpO5ERMEsh5HWq0uHa6+dgcVHFvlhdqF4Uat87ygNplVf0txsZB -MNVqbz1k6xkZYMnzDoydAgMBAAEwDQYJKoZIhvcNAQELBQADggEBADspZGtKpWxy -J1W3FA1aeQhMvequQTcMRz4avkm4K4HfTdV1iVD4CbvdezBphouBlyLVLDFJP7RZ -m7dBJVgBwnxufoFLne8cR2MGqDRoySbFT1AtDJdxabE6Fg+QGUpgOQfeBJ6ANlSB -+qJ+HG4QA+Ouh5hxz9mgYwkIsMUABHiwENdZ/kT8Edw4xKgd3uH0YP4iiePMD66c -rzW3uXH5J1jnKgBlpxtog4P6dHCcoq+PZJ17W5bdXNyqC1LPzQqniZ2BNcEZ4ix3 -slAZAOWD1zLLGJhBPMV1fa0sHNBWc6oicr3YK/IDb0cp9kiLvnUu1pHy+LWQGqtC -rceJuGsnJEQ= ------END CERTIFICATE----- diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/nodedir/include/node/config.gypi b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/nodedir/include/node/config.gypi deleted file mode 100644 index e76753408..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/nodedir/include/node/config.gypi +++ /dev/null @@ -1,6 +0,0 @@ -# Test configuration -{ - 'variables': { - 'build_with_electron': true - } -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/server.crt b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/server.crt deleted file mode 100644 index 5d0c440e0..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/server.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDYjCCAkoCCQCSlmGR7KzZGTANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsMCG5vZGUt -Z3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEGJ1aWxkQG5v -ZGVqcy5vcmcwHhcNMTkwNjIyMDYyNTU1WhcNMjkwNjE5MDYyNTU1WjByMQswCQYD -VQQGEwJVUzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsM -CG5vZGUtZ3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEWDmJ1 -aWxkQGlvanMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6S1E -2WchgmbJYqCnpN7310ZgHjIOqeJe6MpSue2u6z6mTNd5izgvQNaANmn3xLFCS5zs -uZaTvdPYPkcmSQzb1YcZSUYnAxZifjYARc6kb5GSBl3q+O70ELyFrimXfZ4JI+bd -IG9KiHY17DlvZZZj/csGYVWWg0mkeH3O5LPX6/DXQVh/9+gZ02/cdIBCAtZHQwqx -7tF/qZA/kD4GZNFpU1DYHzf9H6g9htoCqmNHQWrV2T9yFybt6mbZp9kglBmyKYCc -7hmQnb7N/mHn1yIuwhBsirCJTfKH86gN81u8M3+SVHA2VUHDllcNhpDWlmInXA+I -tHdGZHCp95ohqpCPgQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCdvYj6CD0ZLwT2 -3t1r+deC3TJuHlNVSeKeT7wIfFnh2FW5riGV0q/w6eXPLTHjuiS6YmpAAbdNUgX/ -sq64FqI2RLpX6pgY5yB0SKopMcJxMLKqmF4zHpIHxtYN5EmN3PR0vehneBR/nZ2T -3ikvWD5JeXlm7Dfw+tjijdxM/sEoDWErGup4mMKMd1s5s830p+ITJUa50d0DLFdH -mqPSbUZF8mMPwGJd+nu1Ht3gTLtK7+gYJgGtXMJmGC0Qg77EJHDB2NbotgDGNmSU -1H9BpAeFHHIcbh2Rr7kkTvnh/c03vFe+CsDZmezcmRpRzW1fKj3YbfqBxU4XwJrL -a5T/N9xU ------END CERTIFICATE----- diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/server.key b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/server.key deleted file mode 100644 index a8447391e..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/server.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA6S1E2WchgmbJYqCnpN7310ZgHjIOqeJe6MpSue2u6z6mTNd5 -izgvQNaANmn3xLFCS5zsuZaTvdPYPkcmSQzb1YcZSUYnAxZifjYARc6kb5GSBl3q -+O70ELyFrimXfZ4JI+bdIG9KiHY17DlvZZZj/csGYVWWg0mkeH3O5LPX6/DXQVh/ -9+gZ02/cdIBCAtZHQwqx7tF/qZA/kD4GZNFpU1DYHzf9H6g9htoCqmNHQWrV2T9y -Fybt6mbZp9kglBmyKYCc7hmQnb7N/mHn1yIuwhBsirCJTfKH86gN81u8M3+SVHA2 -VUHDllcNhpDWlmInXA+ItHdGZHCp95ohqpCPgQIDAQABAoIBABW8R4ewalo6dJlB -+n6O3jFt+PW3mtBRLqGqgm2cb0q0a1IMX+MPWLBFjmwEErl+AH0F4rcmBx2Ryr17 -amEy1qcf0caXyHksNAApznqzWXag7iizxnxv4cZRnHBwphNqkNWM5p3oYd04j6w2 -amDg1O9KZozaKo6QZclpiMiezwjKG+PVZLT8p7afswjv+yDWPDByhlcGiye9QD1T -VuZ0QCoXp6N/8JxW0gdkLp9NqFvGeGFzJ5h6L+d7A6BWw8akXrBRHHcKkyvVYBfd -myhSzSK4FPFMaxaEY/65FlVSyAO6ezGm3Umx4g7mkFjLdwKWaIOjkBkPeFgl3Pp4 -7Lo5X3UCgYEA/FrrIwmEU5ayulBVScEMKeavu5eNY4r0Sqbpov2oyTdYe8G49Pzy -ryMXfunY43moLKpajGwgTKRGvdqFtK08AAkaCssiAPkP3rZuZvMTF4sLo/vlWrjP -3er+tUqj22BzXi5XV0BAvH8Y3TL8KQ3he/8JxDvkC811/DQ9Y/Da3U8CgYEA7Itw -UM37URma08Bj9VTMoL9ZCyURewX+ZLDb2+O8sXGXJs28i1RkE6PTBlnRmedn+Jjk -byzQ5Cs5wA5uMbhYTA7kgXOs1bvgQqmlLmyL6FfHkucoMhr2Di7VeGf4OxE26JZ8 -JdY4+1MOyI3A2rR8WU+GmHxy0ay4K2xe6W0vsi8CgYBoGLEKIPDe8jkDtgOYivOT -jT9MaLXALB+dc8DIpU4swpHTaxP6qyUIrbcReTEolJSU6Ci16BxiwRkVU8D3yMYJ -VbfSX/zE3fh37FUaToa/nXHN0SjJBZdpeXhcHE//PIgaf48zxKNvnhYJmPB/luQ+ -m/PRaMsnOzfCM2JniYEe7QKBgGwjnxhB4tgDtaWCue/pcZc3gzS2IJS2e8N6mzie -l6Ajhu+FdOHZldrotUuc+la61OxwsVYmDeWR4VftAPGYDj3PPSX1RRl9R5wSRGLB -2wBASQvew6CMdNqtDIh8N56BUzHnwh/mHKzBHuwO6hDSHFsUITtLAY7bwGKRq55Z -fUmfAoGBANOYFyoJoDLcl+Jd750lyqfCifcGtkRdmZMtrPXaYnD8ZGme9vz1vsK/ -4iUkV3mi7Z9s1LXMa/tPPfKdVhCM1PXost3/si0+u1Bz5yKqEPXlyy2ltpIVyGu8 -yiy7y75asp8Iii/1cgtwyp9+VeSif8wJ+MHQoGdGxvAQP80R3EjF ------END RSA PRIVATE KEY----- diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/test-charmap.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/test-charmap.py deleted file mode 100644 index 63aa77bb4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/fixtures/test-charmap.py +++ /dev/null @@ -1,31 +0,0 @@ -import sys -import locale - -try: - reload(sys) -except NameError: # Python 3 - pass - - -def main(): - encoding = locale.getdefaultlocale()[1] - if not encoding: - return False - - try: - sys.setdefaultencoding(encoding) - except AttributeError: # Python 3 - pass - - textmap = { - "cp936": "\u4e2d\u6587", - "cp1252": "Lat\u012Bna", - "cp932": "\u306b\u307b\u3093\u3054", - } - if encoding in textmap: - print(textmap[encoding]) - return True - - -if __name__ == "__main__": - print(main()) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/process-exec-sync.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/process-exec-sync.js deleted file mode 100644 index 21763bc26..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/process-exec-sync.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const childProcess = require('child_process') - -function startsWith (str, search, pos) { - if (String.prototype.startsWith) { - return str.startsWith(search, pos) - } - - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search -} - -function processExecSync (file, args, options) { - var child, error, timeout, tmpdir, command - command = makeCommand(file, args) - - /* - this function emulates child_process.execSync for legacy node <= 0.10.x - derived from https://github.com/gvarsanyi/sync-exec/blob/master/js/sync-exec.js - */ - - options = options || {} - // init timeout - timeout = Date.now() + options.timeout - // init tmpdir - var osTempBase = '/tmp' - var os = determineOS() - osTempBase = '/tmp' - - if (process.env.TMP) { - osTempBase = process.env.TMP - } - - if (osTempBase[osTempBase.length - 1] !== '/') { - osTempBase += '/' - } - - tmpdir = osTempBase + 'processExecSync.' + Date.now() + Math.random() - fs.mkdirSync(tmpdir) - - // init command - if (os === 'linux') { - command = '(' + command + ' > ' + tmpdir + '/stdout 2> ' + tmpdir + - '/stderr); echo $? > ' + tmpdir + '/status' - } else { - command = '(' + command + ' > ' + tmpdir + '/stdout 2> ' + tmpdir + - '/stderr) | echo %errorlevel% > ' + tmpdir + '/status | exit' - } - - // init child - child = childProcess.exec(command, options) - - var maxTry = 100000 // increases the test time by 6 seconds on win-2016-node-0.10 - var tryCount = 0 - while (tryCount < maxTry) { - try { - var x = fs.readFileSync(tmpdir + '/status') - if (x.toString() === '0') { - break - } - } catch (ignore) {} - tryCount++ - if (Date.now() > timeout) { - error = child - break - } - } - - ['stdout', 'stderr', 'status'].forEach(function (file) { - child[file] = fs.readFileSync(tmpdir + '/' + file, options.encoding) - setTimeout(unlinkFile, 500, tmpdir + '/' + file) - }) - - child.status = Number(child.status) - if (child.status !== 0) { - error = child - } - - try { - fs.rmdirSync(tmpdir) - } catch (ignore) {} - if (error) { - throw error - } - return child.stdout -} - -function makeCommand (file, args) { - var command, quote - command = file - if (args.length > 0) { - for (var i in args) { - command = command + ' ' - if (args[i][0] === '-') { - command = command + args[i] - } else { - if (!quote) { - command = command + '"' - quote = true - } - command = command + args[i] - if (quote) { - if (args.length === (parseInt(i) + 1)) { - command = command + '"' - } - } - } - } - } - return command -} - -function determineOS () { - var os = '' - var tmpVar = '' - if (process.env.OSTYPE) { - tmpVar = process.env.OSTYPE - } else if (process.env.OS) { - tmpVar = process.env.OS - } else { - // default is linux - tmpVar = 'linux' - } - - if (startsWith(tmpVar, 'linux')) { - os = 'linux' - } - if (startsWith(tmpVar, 'win')) { - os = 'win' - } - - return os -} - -function unlinkFile (file) { - fs.unlinkSync(file) -} - -module.exports = processExecSync diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/simple-proxy.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/simple-proxy.js deleted file mode 100644 index cb0dfcfec..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/simple-proxy.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -const http = require('http') -const https = require('https') -const server = http.createServer(handler) -const port = +process.argv[2] -const prefix = process.argv[3] -const upstream = process.argv[4] -var calls = 0 - -server.listen(port) - -function handler (req, res) { - if (req.url.indexOf(prefix) !== 0) { - throw new Error('request url [' + req.url + '] does not start with [' + prefix + ']') - } - - var upstreamUrl = upstream + req.url.substring(prefix.length) - https.get(upstreamUrl, function (ures) { - ures.on('end', function () { - if (++calls === 2) { - server.close() - } - }) - ures.pipe(res) - }) -} diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-addon.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-addon.js deleted file mode 100644 index f79eff73c..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-addon.js +++ /dev/null @@ -1,150 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const fs = require('graceful-fs') -const childProcess = require('child_process') -const os = require('os') -const addonPath = path.resolve(__dirname, 'node_modules', 'hello_world') -const nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js') -const execFileSync = childProcess.execFileSync || require('./process-exec-sync') -const execFile = childProcess.execFile - -function runHello (hostProcess) { - if (!hostProcess) { - hostProcess = process.execPath - } - var testCode = "console.log(require('hello_world').hello())" - return execFileSync(hostProcess, ['-e', testCode], { cwd: __dirname }).toString() -} - -function getEncoding () { - var code = 'import locale;print(locale.getdefaultlocale()[1])' - return execFileSync('python', ['-c', code]).toString().trim() -} - -function checkCharmapValid () { - var data - try { - data = execFileSync('python', ['fixtures/test-charmap.py'], - { cwd: __dirname }) - } catch (err) { - return false - } - var lines = data.toString().trim().split('\n') - return lines.pop() === 'True' -} - -test('build simple addon', function (t) { - t.plan(3) - - // Set the loglevel otherwise the output disappears when run via 'npm test' - var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - var logLines = stderr.toString().trim().split(/\r?\n/) - var lastLine = logLines[logLines.length - 1] - t.strictEqual(err, null) - t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') - t.strictEqual(runHello().trim(), 'world') - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') -}) - -test('build simple addon in path with non-ascii characters', function (t) { - t.plan(1) - - if (!checkCharmapValid()) { - return t.skip('python console app can\'t encode non-ascii character.') - } - - var testDirNames = { - cp936: '文件夹', - cp1252: 'Latīna', - cp932: 'フォルダ' - } - // Select non-ascii characters by current encoding - var testDirName = testDirNames[getEncoding()] - // If encoding is UTF-8 or other then no need to test - if (!testDirName) { - return t.skip('no need to test') - } - - t.plan(3) - - var data - var configPath = path.join(addonPath, 'build', 'config.gypi') - try { - data = fs.readFileSync(configPath, 'utf8') - } catch (err) { - t.error(err) - return - } - var config = JSON.parse(data.replace(/#.+\n/, '')) - var nodeDir = config.variables.nodedir - var testNodeDir = path.join(addonPath, testDirName) - // Create symbol link to path with non-ascii characters - try { - fs.symlinkSync(nodeDir, testNodeDir, 'dir') - } catch (err) { - switch (err.code) { - case 'EEXIST': break - case 'EPERM': - t.error(err, 'Please try to running console as an administrator') - return - default: - t.error(err) - return - } - } - - var cmd = [ - nodeGyp, - 'rebuild', - '-C', - addonPath, - '--loglevel=verbose', - '-nodedir=' + testNodeDir - ] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - try { - fs.unlink(testNodeDir) - } catch (err) { - t.error(err) - } - - var logLines = stderr.toString().trim().split(/\r?\n/) - var lastLine = logLines[logLines.length - 1] - t.strictEqual(err, null) - t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') - t.strictEqual(runHello().trim(), 'world') - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') -}) - -test('addon works with renamed host executable', function (t) { - // No `fs.copyFileSync` before node8. - if (process.version.substr(1).split('.')[0] < 8) { - t.skip('skipping test for old node version') - t.end() - return - } - - t.plan(3) - - var notNodePath = path.join(os.tmpdir(), 'notnode' + path.extname(process.execPath)) - fs.copyFileSync(process.execPath, notNodePath) - - var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - var logLines = stderr.toString().trim().split(/\r?\n/) - var lastLine = logLines[logLines.length - 1] - t.strictEqual(err, null) - t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') - t.strictEqual(runHello(notNodePath).trim(), 'world') - fs.unlinkSync(notNodePath) - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-configure-python.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-configure-python.js deleted file mode 100644 index 4290e7af1..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-configure-python.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const devDir = require('./common').devDir() -const gyp = require('../lib/node-gyp') -const requireInject = require('require-inject') -const configure = requireInject('../lib/configure', { - 'graceful-fs': { - openSync: function () { return 0 }, - closeSync: function () { }, - writeFile: function (file, data, cb) { cb() }, - stat: function (file, cb) { cb(null, {}) }, - mkdir: function (dir, options, cb) { cb() }, - promises: { - writeFile: function (file, data) { return Promise.resolve(null) } - } - } -}) - -const EXPECTED_PYPATH = path.join(__dirname, '..', 'gyp', 'pylib') -const SEPARATOR = process.platform === 'win32' ? ';' : ':' -const SPAWN_RESULT = { on: function () { } } - -require('npmlog').level = 'warn' - -test('configure PYTHONPATH with no existing env', function (t) { - t.plan(1) - - delete process.env.PYTHONPATH - - var prog = gyp() - prog.parseArgv([]) - prog.spawn = function () { - t.equal(process.env.PYTHONPATH, EXPECTED_PYPATH) - return SPAWN_RESULT - } - prog.devDir = devDir - configure(prog, [], t.fail) -}) - -test('configure PYTHONPATH with existing env of one dir', function (t) { - t.plan(2) - - var existingPath = path.join('a', 'b') - process.env.PYTHONPATH = existingPath - - var prog = gyp() - prog.parseArgv([]) - prog.spawn = function () { - t.equal(process.env.PYTHONPATH, [EXPECTED_PYPATH, existingPath].join(SEPARATOR)) - - var dirs = process.env.PYTHONPATH.split(SEPARATOR) - t.deepEqual(dirs, [EXPECTED_PYPATH, existingPath]) - - return SPAWN_RESULT - } - prog.devDir = devDir - configure(prog, [], t.fail) -}) - -test('configure PYTHONPATH with existing env of multiple dirs', function (t) { - t.plan(2) - - var pythonDir1 = path.join('a', 'b') - var pythonDir2 = path.join('b', 'c') - var existingPath = [pythonDir1, pythonDir2].join(SEPARATOR) - process.env.PYTHONPATH = existingPath - - var prog = gyp() - prog.parseArgv([]) - prog.spawn = function () { - t.equal(process.env.PYTHONPATH, [EXPECTED_PYPATH, existingPath].join(SEPARATOR)) - - var dirs = process.env.PYTHONPATH.split(SEPARATOR) - t.deepEqual(dirs, [EXPECTED_PYPATH, pythonDir1, pythonDir2]) - - return SPAWN_RESULT - } - prog.devDir = devDir - configure(prog, [], t.fail) -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-create-config-gypi.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-create-config-gypi.js deleted file mode 100644 index eeac73fab..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-create-config-gypi.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -const path = require('path') -const { test } = require('tap') -const gyp = require('../lib/node-gyp') -const createConfigGypi = require('../lib/create-config-gypi') -const { parseConfigGypi, getCurrentConfigGypi } = createConfigGypi.test - -test('config.gypi with no options', async function (t) { - t.plan(2) - - const prog = gyp() - prog.parseArgv([]) - - const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) - t.equal(config.target_defaults.default_configuration, 'Release') - t.equal(config.variables.target_arch, process.arch) -}) - -test('config.gypi with --debug', async function (t) { - t.plan(1) - - const prog = gyp() - prog.parseArgv(['_', '_', '--debug']) - - const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) - t.equal(config.target_defaults.default_configuration, 'Debug') -}) - -test('config.gypi with custom options', async function (t) { - t.plan(1) - - const prog = gyp() - prog.parseArgv(['_', '_', '--shared-libxml2']) - - const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) - t.equal(config.variables.shared_libxml2, true) -}) - -test('config.gypi with nodedir', async function (t) { - t.plan(1) - - const nodeDir = path.join(__dirname, 'fixtures', 'nodedir') - - const prog = gyp() - prog.parseArgv(['_', '_', `--nodedir=${nodeDir}`]) - - const config = await getCurrentConfigGypi({ gyp: prog, nodeDir, vsInfo: {} }) - t.equal(config.variables.build_with_electron, true) -}) - -test('config.gypi with --force-process-config', async function (t) { - t.plan(1) - - const nodeDir = path.join(__dirname, 'fixtures', 'nodedir') - - const prog = gyp() - prog.parseArgv(['_', '_', '--force-process-config', `--nodedir=${nodeDir}`]) - - const config = await getCurrentConfigGypi({ gyp: prog, nodeDir, vsInfo: {} }) - t.equal(config.variables.build_with_electron, undefined) -}) - -test('config.gypi parsing', function (t) { - t.plan(1) - - const str = "# Some comments\n{'variables': {'multiline': 'A'\n'B'}}" - const config = parseConfigGypi(str) - t.deepEqual(config, { variables: { multiline: 'AB' } }) -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-download.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-download.js deleted file mode 100644 index 71a3c0d09..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-download.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict' - -const { test } = require('tap') -const fs = require('fs') -const path = require('path') -const util = require('util') -const http = require('http') -const https = require('https') -const install = require('../lib/install') -const semver = require('semver') -const devDir = require('./common').devDir() -const rimraf = require('rimraf') -const gyp = require('../lib/node-gyp') -const log = require('npmlog') - -log.level = 'warn' - -test('download over http', async (t) => { - t.plan(2) - - const server = http.createServer((req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('ok') - }) - - t.tearDown(() => new Promise((resolve) => server.close(resolve))) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - const gyp = { - opts: {}, - version: '42' - } - const url = `http://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'ok') -}) - -test('download over https with custom ca', async (t) => { - t.plan(3) - - const cafile = path.join(__dirname, '/fixtures/ca.crt') - const [cert, key, ca] = await Promise.all([ - fs.promises.readFile(path.join(__dirname, 'fixtures/server.crt'), 'utf8'), - fs.promises.readFile(path.join(__dirname, 'fixtures/server.key'), 'utf8'), - install.test.readCAFile(cafile) - ]) - - t.strictEqual(ca.length, 1) - - const options = { ca: ca, cert: cert, key: key } - const server = https.createServer(options, (req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('ok') - }) - - t.tearDown(() => new Promise((resolve) => server.close(resolve))) - - server.on('clientError', (err) => { throw err }) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - const gyp = { - opts: { cafile }, - version: '42' - } - const url = `https://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'ok') -}) - -test('download over http with proxy', async (t) => { - t.plan(2) - - const server = http.createServer((_, res) => { - res.end('ok') - }) - - const pserver = http.createServer((req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('proxy ok') - }) - - t.tearDown(() => Promise.all([ - new Promise((resolve) => server.close(resolve)), - new Promise((resolve) => pserver.close(resolve)) - ])) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - await new Promise((resolve) => pserver.listen(port + 1, host, resolve)) - const gyp = { - opts: { - proxy: `http://${host}:${port + 1}`, - noproxy: 'bad' - }, - version: '42' - } - const url = `http://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'proxy ok') -}) - -test('download over http with noproxy', async (t) => { - t.plan(2) - - const server = http.createServer((req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('ok') - }) - - const pserver = http.createServer((_, res) => { - res.end('proxy ok') - }) - - t.tearDown(() => Promise.all([ - new Promise((resolve) => server.close(resolve)), - new Promise((resolve) => pserver.close(resolve)) - ])) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - await new Promise((resolve) => pserver.listen(port + 1, host, resolve)) - const gyp = { - opts: { - proxy: `http://${host}:${port + 1}`, - noproxy: host - }, - version: '42' - } - const url = `http://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'ok') -}) - -test('download with missing cafile', async (t) => { - t.plan(1) - const gyp = { - opts: { cafile: 'no.such.file' } - } - try { - await install.test.download(gyp, {}, 'http://bad/') - } catch (e) { - t.ok(/no.such.file/.test(e.message)) - } -}) - -test('check certificate splitting', async (t) => { - const cas = await install.test.readCAFile(path.join(__dirname, 'fixtures/ca-bundle.crt')) - t.plan(2) - t.strictEqual(cas.length, 2) - t.notStrictEqual(cas[0], cas[1]) -}) - -// only run this test if we are running a version of Node with predictable version path behavior - -test('download headers (actual)', async (t) => { - if (process.env.FAST_TEST || - process.release.name !== 'node' || - semver.prerelease(process.version) !== null || - semver.satisfies(process.version, '<10')) { - return t.skip('Skipping actual download of headers due to test environment configuration') - } - - t.plan(12) - - const expectedDir = path.join(devDir, process.version.replace(/^v/, '')) - await util.promisify(rimraf)(expectedDir) - - const prog = gyp() - prog.parseArgv([]) - prog.devDir = devDir - log.level = 'warn' - await util.promisify(install)(prog, []) - - const data = await fs.promises.readFile(path.join(expectedDir, 'installVersion'), 'utf8') - t.strictEqual(data, '9\n', 'correct installVersion') - - const list = await fs.promises.readdir(path.join(expectedDir, 'include/node')) - t.ok(list.includes('common.gypi')) - t.ok(list.includes('config.gypi')) - t.ok(list.includes('node.h')) - t.ok(list.includes('node_version.h')) - t.ok(list.includes('openssl')) - t.ok(list.includes('uv')) - t.ok(list.includes('uv.h')) - t.ok(list.includes('v8-platform.h')) - t.ok(list.includes('v8.h')) - t.ok(list.includes('zlib.h')) - - const lines = (await fs.promises.readFile(path.join(expectedDir, 'include/node/node_version.h'), 'utf8')).split('\n') - - // extract the 3 version parts from the defines to build a valid version string and - // and check them against our current env version - const version = ['major', 'minor', 'patch'].reduce((version, type) => { - const re = new RegExp(`^#define\\sNODE_${type.toUpperCase()}_VERSION`) - const line = lines.find((l) => re.test(l)) - const i = line ? parseInt(line.replace(/^[^0-9]+([0-9]+).*$/, '$1'), 10) : 'ERROR' - return `${version}${type !== 'major' ? '.' : 'v'}${i}` - }, '') - - t.strictEqual(version, process.version) -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-accessible-sync.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-accessible-sync.js deleted file mode 100644 index 0a2e584c4..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-accessible-sync.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const requireInject = require('require-inject') -const configure = requireInject('../lib/configure', { - 'graceful-fs': { - closeSync: function () { return undefined }, - openSync: function (path) { - if (readableFiles.some(function (f) { return f === path })) { - return 0 - } else { - var error = new Error('ENOENT - not found') - throw error - } - } - } -}) - -const dir = path.sep + 'testdir' -const readableFile = 'readable_file' -const anotherReadableFile = 'another_readable_file' -const readableFileInDir = 'somedir' + path.sep + readableFile -const readableFiles = [ - path.resolve(dir, readableFile), - path.resolve(dir, anotherReadableFile), - path.resolve(dir, readableFileInDir) -] - -test('find accessible - empty array', function (t) { - t.plan(1) - - var candidates = [] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, undefined) -}) - -test('find accessible - single item array, readable', function (t) { - t.plan(1) - - var candidates = [readableFile] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, readableFile)) -}) - -test('find accessible - single item array, readable in subdir', function (t) { - t.plan(1) - - var candidates = [readableFileInDir] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, readableFileInDir)) -}) - -test('find accessible - single item array, unreadable', function (t) { - t.plan(1) - - var candidates = ['unreadable_file'] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, undefined) -}) - -test('find accessible - multi item array, no matches', function (t) { - t.plan(1) - - var candidates = ['non_existent_file', 'unreadable_file'] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, undefined) -}) - -test('find accessible - multi item array, single match', function (t) { - t.plan(1) - - var candidates = ['non_existent_file', readableFile] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, readableFile)) -}) - -test('find accessible - multi item array, return first match', function (t) { - t.plan(1) - - var candidates = ['non_existent_file', anotherReadableFile, readableFile] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, anotherReadableFile)) -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-node-directory.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-node-directory.js deleted file mode 100644 index f1380d162..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-node-directory.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const findNodeDirectory = require('../lib/find-node-directory') - -const platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix'] - -// we should find the directory based on the directory -// the script is running in and it should match the layout -// in a build tree where npm is installed in -// .... /deps/npm -test('test find-node-directory - node install', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - t.equal( - findNodeDirectory('/x/deps/npm/node_modules/node-gyp/lib', processObj), - path.join('/x')) - } -}) - -// we should find the directory based on the directory -// the script is running in and it should match the layout -// in an installed tree where npm is installed in -// .... /lib/node_modules/npm or .../node_modules/npm -// depending on the patform -test('test find-node-directory - node build', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - if (platforms[next] === 'win32') { - t.equal( - findNodeDirectory('/y/node_modules/npm/node_modules/node-gyp/lib', - processObj), path.join('/y')) - } else { - t.equal( - findNodeDirectory('/y/lib/node_modules/npm/node_modules/node-gyp/lib', - processObj), path.join('/y')) - } - } -}) - -// we should find the directory based on the execPath -// for node and match because it was in the bin directory -test('test find-node-directory - node in bin directory', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - t.equal( - findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), - path.join('/x/y')) - } -}) - -// we should find the directory based on the execPath -// for node and match because it was in the Release directory -test('test find-node-directory - node in build release dir', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj - if (platforms[next] === 'win32') { - processObj = { execPath: '/x/y/Release/node', platform: platforms[next] } - } else { - processObj = { - execPath: '/x/y/out/Release/node', - platform: platforms[next] - } - } - - t.equal( - findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), - path.join('/x/y')) - } -}) - -// we should find the directory based on the execPath -// for node and match because it was in the Debug directory -test('test find-node-directory - node in Debug release dir', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj - if (platforms[next] === 'win32') { - processObj = { execPath: '/a/b/Debug/node', platform: platforms[next] } - } else { - processObj = { execPath: '/a/b/out/Debug/node', platform: platforms[next] } - } - - t.equal( - findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), - path.join('/a/b')) - } -}) - -// we should not find it as it will not match based on the execPath nor -// the directory from which the script is running -test('test find-node-directory - not found', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/z/y', platform: next } - t.equal(findNodeDirectory('/a/b/c/d', processObj), '') - } -}) - -// we should find the directory based on the directory -// the script is running in and it should match the layout -// in a build tree where npm is installed in -// .... /deps/npm -// same test as above but make sure additional directory entries -// don't cause an issue -test('test find-node-directory - node install', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - t.equal( - findNodeDirectory('/x/y/z/a/b/c/deps/npm/node_modules/node-gyp/lib', - processObj), path.join('/x/y/z/a/b/c')) - } -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-python.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-python.js deleted file mode 100644 index 67d0b2664..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-python.js +++ /dev/null @@ -1,226 +0,0 @@ -'use strict' - -delete process.env.PYTHON - -const test = require('tap').test -const findPython = require('../lib/find-python') -const execFile = require('child_process').execFile -const PythonFinder = findPython.test.PythonFinder - -require('npmlog').level = 'warn' - -test('find python', function (t) { - t.plan(4) - - findPython.test.findPython(null, function (err, found) { - t.strictEqual(err, null) - var proc = execFile(found, ['-V'], function (err, stdout, stderr) { - t.strictEqual(err, null) - t.ok(/Python 3/.test(stdout)) - t.strictEqual(stderr, '') - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') - }) -}) - -function poison (object, property) { - function fail () { - console.error(Error(`Property ${property} should not have been accessed.`)) - process.abort() - } - var descriptor = { - configurable: false, - enumerable: false, - get: fail, - set: fail - } - Object.defineProperty(object, property, descriptor) -} - -function TestPythonFinder () { - PythonFinder.apply(this, arguments) -} -TestPythonFinder.prototype = Object.create(PythonFinder.prototype) -// Silence npmlog - remove for debugging -TestPythonFinder.prototype.log = { - silly: () => {}, - verbose: () => {}, - info: () => {}, - warn: () => {}, - error: () => {} -} -delete TestPythonFinder.prototype.env.NODE_GYP_FORCE_PYTHON - -test('find python - python', function (t) { - t.plan(6) - - var f = new TestPythonFinder('python', done) - f.execFile = function (program, args, opts, cb) { - f.execFile = function (program, args, opts, cb) { - poison(f, 'execFile') - t.strictEqual(program, '/path/python') - t.ok(/sys\.version_info/.test(args[1])) - cb(null, '3.9.1') - } - t.strictEqual(program, - process.platform === 'win32' ? '"python"' : 'python') - t.ok(/sys\.executable/.test(args[1])) - cb(null, '/path/python') - } - f.findPython() - - function done (err, python) { - t.strictEqual(err, null) - t.strictEqual(python, '/path/python') - } -}) - -test('find python - python too old', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(null, '/path/python') - } else if (/sys\.version_info/.test(args[args.length - 1])) { - cb(null, '2.3.4') - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not supported/i.test(f.errorLog)) - } -}) - -test('find python - no python', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (/sys\.version_info/.test(args[args.length - 1])) { - cb(new Error('not a Python executable')) - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not in PATH/.test(f.errorLog)) - } -}) - -test('find python - no python2, no python, unix', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.checkPyLauncher = t.fail - f.win = false - - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not in PATH/.test(f.errorLog)) - } -}) - -test('find python - no python, use python launcher', function (t) { - t.plan(4) - - var f = new TestPythonFinder(null, done) - f.win = true - - f.execFile = function (program, args, opts, cb) { - if (program === 'py.exe') { - t.notEqual(args.indexOf('-3'), -1) - t.notEqual(args.indexOf('-c'), -1) - return cb(null, 'Z:\\snake.exe') - } - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (f.winDefaultLocations.includes(program)) { - cb(new Error('not found')) - } else if (/sys\.version_info/.test(args[args.length - 1])) { - if (program === 'Z:\\snake.exe') { - cb(null, '3.9.0') - } else { - t.fail() - } - } else { - t.fail() - } - } - f.findPython() - - function done (err, python) { - t.strictEqual(err, null) - t.strictEqual(python, 'Z:\\snake.exe') - } -}) - -test('find python - no python, no python launcher, good guess', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.win = true - const expectedProgram = f.winDefaultLocations[0] - - f.execFile = function (program, args, opts, cb) { - if (program === 'py.exe') { - return cb(new Error('not found')) - } - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (program === expectedProgram && - /sys\.version_info/.test(args[args.length - 1])) { - cb(null, '3.7.3') - } else { - t.fail() - } - } - f.findPython() - - function done (err, python) { - t.strictEqual(err, null) - t.ok(python === expectedProgram) - } -}) - -test('find python - no python, no python launcher, bad guess', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.win = true - - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (/sys\.version_info/.test(args[args.length - 1])) { - cb(new Error('not a Python executable')) - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not in PATH/.test(f.errorLog)) - } -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-visualstudio.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-visualstudio.js deleted file mode 100644 index 1327cf884..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-find-visualstudio.js +++ /dev/null @@ -1,676 +0,0 @@ -'use strict' - -const test = require('tap').test -const fs = require('fs') -const path = require('path') -const findVisualStudio = require('../lib/find-visualstudio') -const VisualStudioFinder = findVisualStudio.test.VisualStudioFinder - -const semverV1 = { major: 1, minor: 0, patch: 0 } - -delete process.env.VCINSTALLDIR - -function poison (object, property) { - function fail () { - console.error(Error(`Property ${property} should not have been accessed.`)) - process.abort() - } - var descriptor = { - configurable: false, - enumerable: false, - get: fail, - set: fail - } - Object.defineProperty(object, property, descriptor) -} - -function TestVisualStudioFinder () { VisualStudioFinder.apply(this, arguments) } -TestVisualStudioFinder.prototype = Object.create(VisualStudioFinder.prototype) -// Silence npmlog - remove for debugging -TestVisualStudioFinder.prototype.log = { - silly: () => {}, - verbose: () => {}, - info: () => {}, - warn: () => {}, - error: () => {} -} - -test('VS2013', function (t) { - t.plan(4) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\MSBuild12\\MSBuild.exe', - path: 'C:\\VS2013', - sdk: null, - toolset: 'v120', - version: '12.0', - versionMajor: 12, - versionMinor: 0, - versionYear: 2013 - }) - }) - - finder.findVisualStudio2017OrNewer = (cb) => { - finder.parseData(new Error(), '', '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - continue - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\VS2013\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\12.0\\MSBuildToolsPath': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\MSBuild12\\') - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } - finder.findVisualStudio() -}) - -test('VS2013 should not be found on new node versions', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder({ - major: 10, - minor: 0, - patch: 0 - }, null, (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', 'VS_2017_Unusable.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - continue - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } - finder.findVisualStudio() -}) - -test('VS2015', function (t) { - t.plan(4) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\MSBuild14\\MSBuild.exe', - path: 'C:\\VS2015', - sdk: null, - toolset: 'v140', - version: '14.0', - versionMajor: 14, - versionMinor: 0, - versionYear: 2015 - }) - }) - - finder.findVisualStudio2017OrNewer = (cb) => { - finder.parseData(new Error(), '', '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\VS2015\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\14.0\\MSBuildToolsPath': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\MSBuild14\\') - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } - finder.findVisualStudio() -}) - -test('error from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(new Error(), '', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('empty output from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, '', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('output from PowerShell not JSON', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, 'AAAABBBB', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('wrong JSON from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, '{}', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('empty JSON from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, '[]', '', (info) => { - t.ok(/find .* Visual Studio/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('future version', function (t) { - t.plan(3) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, JSON.stringify([{ - packages: [ - 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', - 'Microsoft.VisualStudio.Component.Windows10SDK.17763', - 'Microsoft.VisualStudio.VC.MSBuild.Base' - ], - path: 'C:\\VS', - version: '9999.9999.9999.9999' - }]), '', (info) => { - t.ok(/unknown version/i.test(finder.errorLog[0]), 'expect error') - t.ok(/find .* Visual Studio/i.test(finder.errorLog[1]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('single unusable VS2017', function (t) { - t.plan(3) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - const file = path.join(__dirname, 'fixtures', 'VS_2017_Unusable.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', (info) => { - t.ok(/checking/i.test(finder.errorLog[0]), 'expect error') - t.ok(/find .* Visual Studio/i.test(finder.errorLog[2]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('minimal VS2017 Build Tools', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\' + - 'BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools', - sdk: '10.0.17134.0', - toolset: 'v141', - version: '15.9.28307.665', - versionMajor: 15, - versionMinor: 9, - versionYear: 2017 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2017_BuildTools_minimal.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2017 Community with C++ workload', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\' + - 'Community\\MSBuild\\15.0\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community', - sdk: '10.0.17763.0', - toolset: 'v141', - version: '15.9.28307.665', - versionMajor: 15, - versionMinor: 9, - versionYear: 2017 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2017_Community_workload.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2017 Express', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\' + - 'WDExpress\\MSBuild\\15.0\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress', - sdk: '10.0.17763.0', - toolset: 'v141', - version: '15.9.28307.858', - versionMajor: 15, - versionMinor: 9, - versionYear: 2017 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', 'VS_2017_Express.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2019 Preview with C++ workload', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + - 'Preview\\MSBuild\\Current\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview', - sdk: '10.0.17763.0', - toolset: 'v142', - version: '16.0.28608.199', - versionMajor: 16, - versionMinor: 0, - versionYear: 2019 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2019_Preview.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('minimal VS2019 Build Tools', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + - 'BuildTools\\MSBuild\\Current\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools', - sdk: '10.0.17134.0', - toolset: 'v142', - version: '16.1.28922.388', - versionMajor: 16, - versionMinor: 1, - versionYear: 2019 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2019_BuildTools_minimal.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2019 Community with C++ workload', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + - 'Community\\MSBuild\\Current\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community', - sdk: '10.0.17763.0', - toolset: 'v142', - version: '16.1.28922.388', - versionMajor: 16, - versionMinor: 1, - versionYear: 2019 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2019_Community_workload.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -function allVsVersions (t, finder) { - finder.findVisualStudio2017OrNewer = (cb) => { - const data0 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_Unusable.txt'))) - const data1 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_BuildTools_minimal.txt'))) - const data2 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_Community_workload.txt'))) - const data3 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_Express.txt'))) - const data4 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2019_Preview.txt'))) - const data5 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2019_BuildTools_minimal.txt'))) - const data6 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2019_Community_workload.txt'))) - const data = JSON.stringify(data0.concat(data1, data2, data3, data4, - data5, data6)) - finder.parseData(null, data, '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0': - continue - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0': - return cb(null, 'C:\\VS2013\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\12.0\\MSBuildToolsPath': - return cb(null, 'C:\\MSBuild12\\') - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - return cb(null, 'C:\\VS2015\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\14.0\\MSBuildToolsPath': - return cb(null, 'C:\\MSBuild14\\') - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } -} - -test('fail when looking for invalid path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, 'AABB', (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2013 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2013', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2013) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2013 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2013', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2013') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2015 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2015', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2015) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2015 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2015', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2015') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2017 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2017', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2017) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2017 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2019 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2019', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2019) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2019 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('msvs_version match should be case insensitive', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, - 'c:\\program files (x86)\\microsoft visual studio\\2019\\BUILDTOOLS', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('latest version should be found by default', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2019) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a usable VS Command Prompt', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = 'C:\\VS2015\\VC' - // VSINSTALLDIR is not defined on Visual C++ Build Tools 2015 - delete process.env.VSINSTALLDIR - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2015') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('VCINSTALLDIR match should be case insensitive', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = - 'c:\\program files (x86)\\microsoft visual studio\\2019\\BUILDTOOLS\\VC' - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a unusable VS Command Prompt', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildToolsUnusable\\VC' - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a VS Command Prompt with matching msvs_version', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = 'C:\\VS2015\\VC' - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2015', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2015') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a VS Command Prompt with mismatched msvs_version', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC' - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2015', - (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-install.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-install.js deleted file mode 100644 index 5039dc992..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-install.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' - -const { test } = require('tap') -const { test: { install } } = require('../lib/install') -const log = require('npmlog') - -log.level = 'error' // we expect a warning - -test('EACCES retry once', async (t) => { - t.plan(3) - - const fs = { - promises: { - stat (_) { - const err = new Error() - err.code = 'EACCES' - t.ok(true) - throw err - } - } - } - - const Gyp = { - devDir: __dirname, - opts: { - ensure: true - }, - commands: { - install (argv, cb) { - install(fs, Gyp, argv).then(cb, cb) - }, - remove (_, cb) { - cb() - } - } - } - - try { - await install(fs, Gyp, []) - } catch (err) { - t.ok(true) - if (/"pre" versions of node cannot be installed/.test(err.message)) { - t.ok(true) - } - } -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-options.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-options.js deleted file mode 100644 index b2ac62c87..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-options.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' - -const test = require('tap').test -const gyp = require('../lib/node-gyp') - -test('options in environment', (t) => { - t.plan(1) - - // `npm test` dumps a ton of npm_config_* variables in the environment. - Object.keys(process.env) - .filter((key) => /^npm_config_/.test(key)) - .forEach((key) => { delete process.env[key] }) - - // in some platforms, certain keys are stubborn and cannot be removed - const keys = Object.keys(process.env) - .filter((key) => /^npm_config_/.test(key)) - .map((key) => key.substring('npm_config_'.length)) - .concat('argv', 'x') - - // Zero-length keys should get filtered out. - process.env.npm_config_ = '42' - // Other keys should get added. - process.env.npm_config_x = '42' - // Except loglevel. - process.env.npm_config_loglevel = 'debug' - - const g = gyp() - g.parseArgv(['rebuild']) // Also sets opts.argv. - - t.deepEqual(Object.keys(g.opts).sort(), keys.sort()) -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-process-release.js b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-process-release.js deleted file mode 100644 index c3ee0703c..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/test/test-process-release.js +++ /dev/null @@ -1,434 +0,0 @@ -'use strict' - -const test = require('tap').test -const processRelease = require('../lib/process-release') - -test('test process release - process.version = 0.8.20', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.8.20', null) - - t.equal(release.semver.version, '0.8.20') - delete release.semver - - t.deepEqual(release, { - version: '0.8.20', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.8.20/', - tarballUrl: 'https://nodejs.org/dist/v0.8.20/node-v0.8.20.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.8.20/SHASUMS256.txt', - versionDir: '0.8.20', - ia32: { libUrl: 'https://nodejs.org/dist/v0.8.20/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.8.20/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.8.20/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -test('test process release - process.version = 0.10.21', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.10.21', null) - - t.equal(release.semver.version, '0.10.21') - delete release.semver - - t.deepEqual(release, { - version: '0.10.21', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.21/', - tarballUrl: 'https://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.21/SHASUMS256.txt', - versionDir: '0.10.21', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.21/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.21/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.21/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// prior to -headers.tar.gz -test('test process release - process.version = 0.12.9', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.12.9', null) - - t.equal(release.semver.version, '0.12.9') - delete release.semver - - t.deepEqual(release, { - version: '0.12.9', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.12.9/', - tarballUrl: 'https://nodejs.org/dist/v0.12.9/node-v0.12.9.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.12.9/SHASUMS256.txt', - versionDir: '0.12.9', - ia32: { libUrl: 'https://nodejs.org/dist/v0.12.9/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.12.9/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.12.9/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// prior to -headers.tar.gz -test('test process release - process.version = 0.10.41', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.10.41', null) - - t.equal(release.semver.version, '0.10.41') - delete release.semver - - t.deepEqual(release, { - version: '0.10.41', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.41/', - tarballUrl: 'https://nodejs.org/dist/v0.10.41/node-v0.10.41.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.41/SHASUMS256.txt', - versionDir: '0.10.41', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.41/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.41/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.41/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// has -headers.tar.gz -test('test process release - process.release ~ node@0.10.42', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.10.42', null) - - t.equal(release.semver.version, '0.10.42') - delete release.semver - - t.deepEqual(release, { - version: '0.10.42', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.42/', - tarballUrl: 'https://nodejs.org/dist/v0.10.42/node-v0.10.42-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.42/SHASUMS256.txt', - versionDir: '0.10.42', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.42/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.42/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.42/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// has -headers.tar.gz -test('test process release - process.release ~ node@0.12.10', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.12.10', null) - - t.equal(release.semver.version, '0.12.10') - delete release.semver - - t.deepEqual(release, { - version: '0.12.10', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.12.10/', - tarballUrl: 'https://nodejs.org/dist/v0.12.10/node-v0.12.10-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.12.10/SHASUMS256.txt', - versionDir: '0.12.10', - ia32: { libUrl: 'https://nodejs.org/dist/v0.12.10/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.12.10/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.12.10/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v4.1.23/', - tarballUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v4.1.23/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'https://nodejs.org/dist/v4.1.23/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v4.1.23/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v4.1.23/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23 / corp build', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'https://some.custom.location/', - tarballUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://some.custom.location/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'https://some.custom.location/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://some.custom.location/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://some.custom.location/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@12.8.0 Windows', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v12.8.0', { - name: 'node', - sourceUrl: 'https://nodejs.org/download/release/v12.8.0/node-v12.8.0.tar.gz', - headersUrl: 'https://nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - libUrl: 'https://nodejs.org/download/release/v12.8.0/win-x64/node.lib' - }) - - t.equal(release.semver.version, '12.8.0') - delete release.semver - - t.deepEqual(release, { - version: '12.8.0', - name: 'node', - baseUrl: 'https://nodejs.org/download/release/v12.8.0/', - tarballUrl: 'https://nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/release/v12.8.0/SHASUMS256.txt', - versionDir: '12.8.0', - ia32: { libUrl: 'https://nodejs.org/download/release/v12.8.0/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/release/v12.8.0/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/release/v12.8.0/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@12.8.0 Windows ARM64', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v12.8.0', { - name: 'node', - sourceUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/node-v12.8.0.tar.gz', - headersUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-arm64/node.lib' - }) - - t.equal(release.semver.version, '12.8.0') - delete release.semver - - t.deepEqual(release, { - version: '12.8.0', - name: 'node', - baseUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/', - tarballUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - shasumsUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/SHASUMS256.txt', - versionDir: '12.8.0', - ia32: { libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23 --target=0.10.40', function (t) { - t.plan(2) - - var release = processRelease([], { opts: { target: '0.10.40' } }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '0.10.40') - delete release.semver - - t.deepEqual(release, { - version: '0.10.40', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.40/', - tarballUrl: 'https://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.40/SHASUMS256.txt', - versionDir: '0.10.40', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.40/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.40/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.40/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23 --dist-url=https://foo.bar/baz', function (t) { - t.plan(2) - - var release = processRelease([], { opts: { 'dist-url': 'https://foo.bar/baz' } }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'https://foo.bar/baz/v4.1.23/', - tarballUrl: 'https://foo.bar/baz/v4.1.23/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://foo.bar/baz/v4.1.23/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'https://foo.bar/baz/v4.1.23/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://foo.bar/baz/v4.1.23/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://foo.bar/baz/v4.1.23/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ frankenstein@4.1.23', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'frankenstein', - headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'frankenstein', - baseUrl: 'https://frankensteinjs.org/dist/v4.1.23/', - tarballUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://frankensteinjs.org/dist/v4.1.23/SHASUMS256.txt', - versionDir: 'frankenstein-4.1.23', - ia32: { libUrl: 'https://frankensteinjs.org/dist/v4.1.23/win-x86/frankenstein.lib', libPath: 'win-x86/frankenstein.lib' }, - x64: { libUrl: 'https://frankensteinjs.org/dist/v4.1.23/win-x64/frankenstein.lib', libPath: 'win-x64/frankenstein.lib' }, - arm64: { libUrl: 'https://frankensteinjs.org/dist/v4.1.23/win-arm64/frankenstein.lib', libPath: 'win-arm64/frankenstein.lib' } - }) -}) - -test('test process release - process.release ~ frankenstein@4.1.23 --dist-url=http://foo.bar/baz/', function (t) { - t.plan(2) - - var release = processRelease([], { opts: { 'dist-url': 'http://foo.bar/baz/' } }, 'v4.1.23', { - name: 'frankenstein', - headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'frankenstein', - baseUrl: 'http://foo.bar/baz/v4.1.23/', - tarballUrl: 'http://foo.bar/baz/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', - shasumsUrl: 'http://foo.bar/baz/v4.1.23/SHASUMS256.txt', - versionDir: 'frankenstein-4.1.23', - ia32: { libUrl: 'http://foo.bar/baz/v4.1.23/win-x86/frankenstein.lib', libPath: 'win-x86/frankenstein.lib' }, - x64: { libUrl: 'http://foo.bar/baz/v4.1.23/win-x64/frankenstein.lib', libPath: 'win-x64/frankenstein.lib' }, - arm64: { libUrl: 'http://foo.bar/baz/v4.1.23/win-arm64/frankenstein.lib', libPath: 'win-arm64/frankenstein.lib' } - }) -}) - -test('test process release - process.release ~ node@4.0.0-rc.4', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.0.0-rc.4', { - name: 'node', - headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.0.0-rc.4') - delete release.semver - - t.deepEqual(release, { - version: '4.0.0-rc.4', - name: 'node', - baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', - tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', - versionDir: '4.0.0-rc.4', - ia32: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.0.0-rc.4 passed as argv[0]', function (t) { - t.plan(2) - - // note the missing 'v' on the arg, it should normalise when checking - // whether we're on the default or not - var release = processRelease(['4.0.0-rc.4'], { opts: {} }, 'v4.0.0-rc.4', { - name: 'node', - headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.0.0-rc.4') - delete release.semver - - t.deepEqual(release, { - version: '4.0.0-rc.4', - name: 'node', - baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', - tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', - versionDir: '4.0.0-rc.4', - ia32: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.0.0-rc.4 - bogus string passed as argv[0]', function (t) { - t.plan(2) - - // additional arguments can be passed in on the commandline that should be ignored if they - // are not specifying a valid version @ position 0 - var release = processRelease(['this is no version!'], { opts: {} }, 'v4.0.0-rc.4', { - name: 'node', - headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.0.0-rc.4') - delete release.semver - - t.deepEqual(release, { - version: '4.0.0-rc.4', - name: 'node', - baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', - tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', - versionDir: '4.0.0-rc.4', - ia32: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - NODEJS_ORG_MIRROR', function (t) { - t.plan(2) - - process.env.NODEJS_ORG_MIRROR = 'http://foo.bar' - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'http://foo.bar/v4.1.23/', - tarballUrl: 'http://foo.bar/v4.1.23/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'http://foo.bar/v4.1.23/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'http://foo.bar/v4.1.23/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'http://foo.bar/v4.1.23/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'http://foo.bar/v4.1.23/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) - - delete process.env.NODEJS_ORG_MIRROR -}) diff --git a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/update-gyp.py b/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/update-gyp.py deleted file mode 100755 index bb84f071a..000000000 --- a/.yarn/unplugged/node-gyp-npm-8.4.1-13c90a9c9b/node_modules/node-gyp/update-gyp.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import shutil -import subprocess -import tarfile -import tempfile -import urllib.request - -BASE_URL = "https://github.com/nodejs/gyp-next/archive/" -CHECKOUT_PATH = os.path.dirname(os.path.realpath(__file__)) -CHECKOUT_GYP_PATH = os.path.join(CHECKOUT_PATH, "gyp") - -parser = argparse.ArgumentParser() -parser.add_argument("tag", help="gyp tag to update to") -args = parser.parse_args() - -tar_url = BASE_URL + args.tag + ".tar.gz" - -changed_files = subprocess.check_output(["git", "diff", "--name-only"]).strip() -if changed_files: - raise Exception("Can't update gyp while you have uncommitted changes in node-gyp") - -with tempfile.TemporaryDirectory() as tmp_dir: - tar_file = os.path.join(tmp_dir, "gyp.tar.gz") - unzip_target = os.path.join(tmp_dir, "gyp") - with open(tar_file, "wb") as f: - print("Downloading gyp-next@" + args.tag + " into temporary directory...") - print("From: " + tar_url) - with urllib.request.urlopen(tar_url) as in_file: - f.write(in_file.read()) - - print("Unzipping...") - with tarfile.open(tar_file, "r:gz") as tar_ref: - tar_ref.extractall(unzip_target) - - print("Moving to current checkout (" + CHECKOUT_PATH + ")...") - if os.path.exists(CHECKOUT_GYP_PATH): - shutil.rmtree(CHECKOUT_GYP_PATH) - shutil.move( - os.path.join(unzip_target, os.listdir(unzip_target)[0]), CHECKOUT_GYP_PATH - ) - -subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH) -subprocess.check_output(["git", "commit", "-m", "feat(gyp): update gyp to " + args.tag]) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index c6b213d7b..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,52 +0,0 @@ - - -Please look thru your error log for the string `gyp info using node-gyp@` and if the version number is less than the [current release of node-gyp](https://github.com/nodejs/node-gyp/releases) then __please upgrade__ using the instructions at https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md and try your command again. - -Requests for help with [`node-sass` are very common](https://github.com/nodejs/node-gyp/issues?q=label%3A%22Node+Sass+--%3E+Dart+Sass%22). Please be aware that this package is deprecated, you should seek alternatives and avoid opening new issues about it here. - -* **Node Version**: -* **Platform**: -* **Compiler**: -* **Module**: - -
Verbose output (from npm or node-gyp): - -``` -Paste your log here, between the backticks. It can be: - - npm --verbose output, - - or contents of npm-debug.log, - - or output of node-gyp rebuild --verbose. -Include the command you were trying to run. - -This should look like this: - ->npm --verbose -npm info it worked if it ends with ok -npm verb cli [ -npm verb cli 'C:\\...\\node\\13.9.0\\x64\\node.exe', -npm verb cli 'C:\\...\\node\\13.9.0\\x64\\node_modules\\npm\\bin\\npm-cli.js', -npm verb cli '--verbose' -npm verb cli ] -npm info using npm@6.13.7 -npm info using node@v13.9.0 - -Usage: npm -(...) -``` - -
- - diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/PULL_REQUEST_TEMPLATE.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index bcc4bb1a0..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ - - -##### Checklist - - -- [ ] `npm install && npm test` passes -- [ ] tests are included -- [ ] documentation is changed or added -- [ ] commit message follows [commit guidelines](https://github.com/googleapis/release-please#how-should-i-write-my-commits) - -##### Description of change - - diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/release-please.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/release-please.yml deleted file mode 100644 index c3057c3a3..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/release-please.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: release-please - -on: - push: - branches: - - main - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v2 - id: release - with: - package-name: node-gyp - release-type: node - changelog-types: > - [{"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"bin","section":"Core","hidden":false}, - {"type":"gyp","section":"Core","hidden":false}, - {"type":"lib","section":"Core","hidden":false}, - {"type":"src","section":"Core","hidden":false}, - {"type":"test","section":"Tests","hidden":false}, - {"type":"build","section":"Core","hidden":false}, - {"type":"clean","section":"Core","hidden":false}, - {"type":"configure","section":"Core","hidden":false}, - {"type":"install","section":"Core","hidden":false}, - {"type":"list","section":"Core","hidden":false}, - {"type":"rebuild","section":"Core","hidden":false}, - {"type":"remove","section":"Core","hidden":false}, - {"type":"deps","section":"Core","hidden":false}, - {"type":"python","section":"Core","hidden":false}, - {"type":"lin","section":"Core","hidden":false}, - {"type":"linux","section":"Core","hidden":false}, - {"type":"mac","section":"Core","hidden":false}, - {"type":"macos","section":"Core","hidden":false}, - {"type":"win","section":"Core","hidden":false}, - {"type":"windows","section":"Core","hidden":false}, - {"type":"zos","section":"Core","hidden":false}, - {"type":"doc","section":"Doc","hidden":false}, - {"type":"docs","section":"Doc","hidden":false}, - {"type":"readme","section":"Doc","hidden":false}, - {"type":"chore","section":"Miscellaneous","hidden":false}, - {"type":"refactor","section":"Miscellaneous","hidden":false}, - {"type":"ci","section":"Miscellaneous","hidden":false}, - {"type":"meta","section":"Miscellaneous","hidden":false}] - - # Standard Conventional Commits: `feat` and `fix` - # node-gyp subdirectories: `bin`, `gyp`, `lib`, `src`, `test` - # node-gyp subcommands: `build`, `clean`, `configure`, `install`, `list`, `rebuild`, `remove` - # Core abstract category: `deps` - # Languages/platforms: `python`, `lin`, `linux`, `mac`, `macos`, `win`, `window`, `zos` - # Documentation: `doc`, `docs`, `readme` - # Standard Conventional Commits: `chore` (under "Miscellaneous") - # Miscellaneous abstract categories: `refactor`, `ci`, `meta` diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/tests.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/tests.yml deleted file mode 100644 index 8f34d4e11..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/tests.yml +++ /dev/null @@ -1,52 +0,0 @@ -# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources -# TODO: Line 48, enable pytest --doctest-modules - -name: Tests -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - Tests: - strategy: - fail-fast: false - max-parallel: 15 - matrix: - node: [14.x, 16.x, 18.x] - python: ["3.7", "3.9", "3.11"] - os: [macos-latest, ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - name: Use Python ${{ matrix.python }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - env: - PYTHON_VERSION: ${{ matrix.python }} # Why do this? - - name: Install Dependencies - run: | - npm install --no-progress - pip install flake8 pytest - - name: Set Windows environment - if: startsWith(matrix.os, 'windows') - run: | - echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV - echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV - - name: Lint Python - if: startsWith(matrix.os, 'ubuntu') - run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics - - name: Run Python tests - run: python -m pytest - # - name: Run doctests with pytest - # run: python -m pytest --doctest-modules - - name: Environment Information - run: npx envinfo - - name: Run Node tests - run: npm test diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/visual-studio.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/visual-studio.yml deleted file mode 100644 index 12125e544..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.github/workflows/visual-studio.yml +++ /dev/null @@ -1,33 +0,0 @@ -# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources - -name: visual-studio -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - visual-studio: - strategy: - fail-fast: false - max-parallel: 8 - matrix: - os: [windows-latest] - msvs-version: [2016, 2019, 2022] # https://github.com/actions/virtual-environments/tree/main/images/win - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Install Dependencies - run: | - npm install --no-progress - # npm audit fix --force - - name: Set Windows environment - if: startsWith(matrix.os, 'windows') - run: | - echo 'GYP_MSVS_VERSION=${{ matrix.msvs-version }}' >> $Env:GITHUB_ENV - echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV - - name: Environment Information - run: npx envinfo - - name: Run Node tests - run: npm test diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.ready b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/CHANGELOG.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/CHANGELOG.md deleted file mode 100644 index 413152151..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/CHANGELOG.md +++ /dev/null @@ -1,796 +0,0 @@ -# Changelog - -### [9.3.1](https://www.github.com/nodejs/node-gyp/compare/v9.3.0...v9.3.1) (2022-12-16) - - -### Bug Fixes - -* increase node 12 support to ^12.13 ([#2771](https://www.github.com/nodejs/node-gyp/issues/2771)) ([888efb9](https://www.github.com/nodejs/node-gyp/commit/888efb9055857afee6a6b54550722cf9ae3ee323)) - - -### Miscellaneous - -* update python test matrix ([#2774](https://www.github.com/nodejs/node-gyp/issues/2774)) ([38f01fa](https://www.github.com/nodejs/node-gyp/commit/38f01fa57d10fdb3db7697121d957bc2e0e96508)) - -## [9.3.0](https://www.github.com/nodejs/node-gyp/compare/v9.2.0...v9.3.0) (2022-10-10) - - -### Features - -* **gyp:** update gyp to v0.14.0 ([#2749](https://www.github.com/nodejs/node-gyp/issues/2749)) ([713b8dc](https://www.github.com/nodejs/node-gyp/commit/713b8dcdbf44532ca9453a127da266386cc737f8)) -* remove support for VS2015 in Node.js >=19 ([#2746](https://www.github.com/nodejs/node-gyp/issues/2746)) ([131d1a4](https://www.github.com/nodejs/node-gyp/commit/131d1a463baf034a04154bcda753a8295f112a34)) -* support IBM Open XL C/C++ on z/OS ([#2743](https://www.github.com/nodejs/node-gyp/issues/2743)) ([7d0c83d](https://www.github.com/nodejs/node-gyp/commit/7d0c83d2a95aca743dff972826d0da26203acfc4)) - -## [9.2.0](https://www.github.com/nodejs/node-gyp/compare/v9.1.0...v9.2.0) (2022-10-02) - - -### Features - -* Add proper support for IBM i ([a26494f](https://www.github.com/nodejs/node-gyp/commit/a26494fbb8883d9ef784503979e115dec3e2791e)) -* **gyp:** update gyp to v0.13.0 ([3e2a532](https://www.github.com/nodejs/node-gyp/commit/3e2a5324f1c24f3a04bca04cf54fe23d5c4d5e50)) - - -### Bug Fixes - -* node.js debugger adds stderr (but exit code is 0) -> shouldn't throw ([#2719](https://www.github.com/nodejs/node-gyp/issues/2719)) ([c379a74](https://www.github.com/nodejs/node-gyp/commit/c379a744c65c7ab07c2c3193d9c7e8f25ae1b05e)) - - -### Core - -* enable support for zoslib on z/OS ([#2600](https://www.github.com/nodejs/node-gyp/issues/2600)) ([83c0a12](https://www.github.com/nodejs/node-gyp/commit/83c0a12bf23b4cbf3125d41f9e2d4201db76c9ae)) - - -### Miscellaneous - -* update dependency - nopt@6.0.0 ([#2707](https://www.github.com/nodejs/node-gyp/issues/2707)) ([8958ecf](https://www.github.com/nodejs/node-gyp/commit/8958ecf2bb719227bbcbf155891c3186ee219a2e)) - -## [9.1.0](https://www.github.com/nodejs/node-gyp/compare/v9.0.0...v9.1.0) (2022-07-13) - - -### Features - -* Update function getSDK() to support Windows 11 SDK ([#2565](https://www.github.com/nodejs/node-gyp/issues/2565)) ([ea8520e](https://www.github.com/nodejs/node-gyp/commit/ea8520e3855374bd15b6d001fe112d58a8d7d737)) - - -### Bug Fixes - -* extend tap timeout length to allow for slow CI ([6f74c76](https://www.github.com/nodejs/node-gyp/commit/6f74c762fe3c19bdd20245cb5c02e2dfa65d9451)) -* new ca & server certs, bundle in .js file and unpack for testing ([147e3d3](https://www.github.com/nodejs/node-gyp/commit/147e3d34f44a97deb7aa507207680cf0f4e662a2)) -* re-label ([#2689](https://www.github.com/nodejs/node-gyp/issues/2689)) ([f0b7863](https://www.github.com/nodejs/node-gyp/commit/f0b7863dadfa365afc173025ae95351aec79abd9)) -* typo on readme ([bf81cd4](https://www.github.com/nodejs/node-gyp/commit/bf81cd452b931dd4dfa82762c23dd530a075d992)) - - -### Doc - -* update docs/README.md with latest version number ([62d2815](https://www.github.com/nodejs/node-gyp/commit/62d28151bf8266a34e1bcceeb25b4e6e2ae5ca5d)) - - -### Core - -* update due to rename of primary branch ([ca1f068](https://www.github.com/nodejs/node-gyp/commit/ca1f0681a5567ca8cd51acebccd37a633f19bc6a)) - - -### Tests - -* Try msvs-version: [2016, 2019, 2022] ([#2700](https://www.github.com/nodejs/node-gyp/issues/2700)) ([68b5b5b](https://www.github.com/nodejs/node-gyp/commit/68b5b5be9c94ac20c55e88654ff6f55234d7130a)) -* Upgrade GitHub Actions ([#2623](https://www.github.com/nodejs/node-gyp/issues/2623)) ([245cd5b](https://www.github.com/nodejs/node-gyp/commit/245cd5bbe4441d4f05e88f2fa20a86425419b6af)) -* Upgrade GitHub Actions ([#2701](https://www.github.com/nodejs/node-gyp/issues/2701)) ([1c64ca7](https://www.github.com/nodejs/node-gyp/commit/1c64ca7f4702c6eb43ecd16fbd67b5d939041621)) - -## [9.0.0](https://www.github.com/nodejs/node-gyp/compare/v8.4.1...v9.0.0) (2022-02-24) - - -### ⚠ BREAKING CHANGES - -* increase "engines" to "node" : "^12.22 || ^14.13 || >=16" (#2601) - -### Bug Fixes - -* _ in npm_config_ env variables ([eef4eef](https://www.github.com/nodejs/node-gyp/commit/eef4eefccb13ff6a32db862709ee5b2d4edf7e95)) -* update make-fetch-happen to a minimum of 10.0.3 ([839e414](https://www.github.com/nodejs/node-gyp/commit/839e414b63790c815a4a370d0feee8f24a94d40f)) - - -### Miscellaneous - -* add minimal SECURITY.md ([#2560](https://www.github.com/nodejs/node-gyp/issues/2560)) ([c2a1850](https://www.github.com/nodejs/node-gyp/commit/c2a185056e2e589b520fbc0bcc59c2935cd07ede)) - - -### Doc - -* Add notes/disclaimers for upgrading the copy of node-gyp that npm uses ([#2585](https://www.github.com/nodejs/node-gyp/issues/2585)) ([faf6d48](https://www.github.com/nodejs/node-gyp/commit/faf6d48f8a77c08a313baf9332358c4b1231c73c)) -* Rename and update Common-issues.md --> docs/README.md ([#2567](https://www.github.com/nodejs/node-gyp/issues/2567)) ([2ef5fb8](https://www.github.com/nodejs/node-gyp/commit/2ef5fb86277c4d81baffc0b9f642a8d86be1bfa5)) -* rephrase explanation of which node-gyp is used by npm ([#2587](https://www.github.com/nodejs/node-gyp/issues/2587)) ([a2f2988](https://www.github.com/nodejs/node-gyp/commit/a2f298870692022302fa27a1d42363c4a72df407)) -* title match content ([#2574](https://www.github.com/nodejs/node-gyp/issues/2574)) ([6e8f93b](https://www.github.com/nodejs/node-gyp/commit/6e8f93be0443f2649d4effa7bc773a9da06a33b4)) -* Update Python versions ([#2571](https://www.github.com/nodejs/node-gyp/issues/2571)) ([e069f13](https://www.github.com/nodejs/node-gyp/commit/e069f13658a8bfb5fd60f74708cf8be0856d92e3)) - - -### Core - -* add lib.target as path for searching libnode on z/OS ([1d499dd](https://www.github.com/nodejs/node-gyp/commit/1d499dd5606f39de2d34fa822fd0fa5ce17fbd06)) -* increase "engines" to "node" : "^12.22 || ^14.13 || >=16" ([#2601](https://www.github.com/nodejs/node-gyp/issues/2601)) ([6562f92](https://www.github.com/nodejs/node-gyp/commit/6562f92a6f2e67aeae081ddf5272ff117f1fab07)) -* make-fetch-happen@10.0.1 ([78f6660](https://www.github.com/nodejs/node-gyp/commit/78f66604e0df480d4f36a8fa4f3618c046a6fbdc)) - -### [8.4.1](https://www.github.com/nodejs/node-gyp/compare/v8.4.0...v8.4.1) (2021-11-19) - - -### Bug Fixes - -* windows command missing space ([#2553](https://www.github.com/nodejs/node-gyp/issues/2553)) ([cc37b88](https://www.github.com/nodejs/node-gyp/commit/cc37b880690706d3c5d04d5a68c76c392a0a23ed)) - - -### Doc - -* fix typo in powershell node-gyp update ([787cf7f](https://www.github.com/nodejs/node-gyp/commit/787cf7f8e5ddd5039e02b64ace6b7b15e06fe0a4)) - - -### Core - -* npmlog@6.0.0 ([8083f6b](https://www.github.com/nodejs/node-gyp/commit/8083f6b855bd7f3326af04c5f5269fc28d7f2508)) - -## [8.4.0](https://www.github.com/nodejs/node-gyp/compare/v8.3.0...v8.4.0) (2021-11-05) - - -### Features - -* build with config.gypi from node headers ([a27dc08](https://www.github.com/nodejs/node-gyp/commit/a27dc08696911c6d81e76cc228697243069103c1)) -* support vs2022 ([#2533](https://www.github.com/nodejs/node-gyp/issues/2533)) ([5a00387](https://www.github.com/nodejs/node-gyp/commit/5a00387e5f8018264a1822f6c4d5dbf425f21cf6)) - -## [8.3.0](https://www.github.com/nodejs/node-gyp/compare/v8.2.0...v8.3.0) (2021-10-11) - - -### Features - -* **gyp:** update gyp to v0.10.0 ([#2521](https://www.github.com/nodejs/node-gyp/issues/2521)) ([5585792](https://www.github.com/nodejs/node-gyp/commit/5585792922a97f0629f143c560efd74470eae87f)) - - -### Tests - -* Python 3.10 was release on Oct. 4th ([#2504](https://www.github.com/nodejs/node-gyp/issues/2504)) ([0a67dcd](https://www.github.com/nodejs/node-gyp/commit/0a67dcd1307f3560495219253241eafcbf4e2a69)) - - -### Miscellaneous - -* **deps:** bump make-fetch-happen from 8.0.14 to 9.1.0 ([b05b4fe](https://www.github.com/nodejs/node-gyp/commit/b05b4fe9891f718f40edf547e9b50e982826d48a)) -* refactor the creation of config.gypi file ([f2ad87f](https://www.github.com/nodejs/node-gyp/commit/f2ad87ff65f98ad66daa7225ad59d99b759a2b07)) - -## [8.2.0](https://www.github.com/nodejs/node-gyp/compare/v8.1.0...v8.2.0) (2021-08-23) - - -### Features - -* **gyp:** update gyp to v0.9.6 ([#2481](https://www.github.com/nodejs/node-gyp/issues/2481)) ([ed9a9ed](https://www.github.com/nodejs/node-gyp/commit/ed9a9ed653a17c84afa3c327161992d0da7d0cea)) - - -### Bug Fixes - -* add error arg back into catch block for older Node.js users ([5cde818](https://www.github.com/nodejs/node-gyp/commit/5cde818aac715477e9e9747966bb6b4c4ed070a8)) -* change default gyp update message ([#2420](https://www.github.com/nodejs/node-gyp/issues/2420)) ([cfd12ff](https://www.github.com/nodejs/node-gyp/commit/cfd12ff3bb0eb4525173413ef6a94b3cd8398cad)) -* doc how to update node-gyp independently from npm ([c8c0af7](https://www.github.com/nodejs/node-gyp/commit/c8c0af72e78141a02b5da4cd4d704838333a90bd)) -* missing spaces ([f0882b1](https://www.github.com/nodejs/node-gyp/commit/f0882b1264b2fa701adbc81a3be0b3cba80e333d)) - - -### Core - -* deep-copy process.config during configure ([#2368](https://www.github.com/nodejs/node-gyp/issues/2368)) ([5f1a06c](https://www.github.com/nodejs/node-gyp/commit/5f1a06c50f3b0c3d292f64948f85a004cfcc5c87)) - - -### Miscellaneous - -* **deps:** bump tar from 6.1.0 to 6.1.2 ([#2474](https://www.github.com/nodejs/node-gyp/issues/2474)) ([ec15a3e](https://www.github.com/nodejs/node-gyp/commit/ec15a3e5012004172713c11eebcc9d852d32d380)) -* fix typos discovered by codespell ([#2442](https://www.github.com/nodejs/node-gyp/issues/2442)) ([2d0ce55](https://www.github.com/nodejs/node-gyp/commit/2d0ce5595e232a3fc7c562cdf39efb77e2312cc1)) -* GitHub Actions Test on node: [12.x, 14.x, 16.x] ([#2439](https://www.github.com/nodejs/node-gyp/issues/2439)) ([b7bccdb](https://www.github.com/nodejs/node-gyp/commit/b7bccdb527d93b0bb0ce99713f083ce2985fe85c)) - - -### Doc - -* correct link to "binding.gyp files out in the wild" ([#2483](https://www.github.com/nodejs/node-gyp/issues/2483)) ([660dd7b](https://www.github.com/nodejs/node-gyp/commit/660dd7b2a822c184be8027b300e68be67b366772)) -* **wiki:** Add a link to the node-midi binding.gyp file. ([b354711](https://www.github.com/nodejs/node-gyp/commit/b3547115f6e356358138310e857c7f1ec627a8a7)) -* **wiki:** add bcrypt ([e199cfa](https://www.github.com/nodejs/node-gyp/commit/e199cfa8fc6161492d2a6ade2190510d0ebf7c0f)) -* **wiki:** Add helpful information ([4eda827](https://www.github.com/nodejs/node-gyp/commit/4eda8275c03dae6d2f5c40f3c1dbe930d84b0f2b)) -* **wiki:** Add node-canvas ([13a9553](https://www.github.com/nodejs/node-gyp/commit/13a955317b39caf98fd1f412d8d3f41599e979fd)) -* **wiki:** Add node-openvg-canvas and node-openvg. ([61f709e](https://www.github.com/nodejs/node-gyp/commit/61f709ec4d9f256a6467e9ff84430a48eeb629d1)) -* **wiki:** add one more example ([77f3632](https://www.github.com/nodejs/node-gyp/commit/77f363272930d3d4d24fd3973be22e6237128fcc)) -* **wiki:** add topcube, node-osmium, and node-osrm ([1a75d2b](https://www.github.com/nodejs/node-gyp/commit/1a75d2bf2f562ba50846893a516e111cfbb50885)) -* **wiki:** Added details for properly fixing ([3d4d9d5](https://www.github.com/nodejs/node-gyp/commit/3d4d9d52d6b5b49de06bb0bb5b68e2686d2b7ebd)) -* **wiki:** Added Ghostscript4JS ([bf4bed1](https://www.github.com/nodejs/node-gyp/commit/bf4bed1b96a7d22fba6f97f4552ad09f32ac3737)) -* **wiki:** added levelup ([1575bce](https://www.github.com/nodejs/node-gyp/commit/1575bce3a53db628bfb023fd6f3258fdf98c3195)) -* **wiki:** Added nk-mysql (nodamysql) ([5b4f2d0](https://www.github.com/nodejs/node-gyp/commit/5b4f2d0e1d5d3eadfd03aaf9c1668340f76c4bea)) -* **wiki:** Added nk-xrm-installer .gyp references, including .py scripts for providing complete reference to examples of fetching source via http, extracting, and moving files (as opposed to copying) ([ceb3088](https://www.github.com/nodejs/node-gyp/commit/ceb30885b74f6789374ef52267b84767be93ebe4)) -* **wiki:** Added tip about resolving frustrating LNK1181 error ([e64798d](https://www.github.com/nodejs/node-gyp/commit/e64798de8cac6031ad598a86d7599e81b4d20b17)) -* **wiki:** ADDED: Node.js binding to OpenCV ([e2dc777](https://www.github.com/nodejs/node-gyp/commit/e2dc77730b09d7ee8682d7713a7603a2d7aacabd)) -* **wiki:** Adding link to node-cryptopp's gyp file ([875adbe](https://www.github.com/nodejs/node-gyp/commit/875adbe2a4669fa5f2be0250ffbf98fb55e800fd)) -* **wiki:** Adding the sharp library to the list ([9dce0e4](https://www.github.com/nodejs/node-gyp/commit/9dce0e41650c3fa973e6135a79632d022c662a1d)) -* **wiki:** Adds node-fann ([23e3d48](https://www.github.com/nodejs/node-gyp/commit/23e3d485ed894ba7c631e9c062f5e366b50c416c)) -* **wiki:** Adds node-inotify and v8-profiler ([b6e542f](https://www.github.com/nodejs/node-gyp/commit/b6e542f644dbbfe22b88524ec500696e06ee4af7)) -* **wiki:** Bumping Python version from 2.3 to 2.7 as per the node-gyp readme ([55ebd6e](https://www.github.com/nodejs/node-gyp/commit/55ebd6ebacde975bf84f7bf4d8c66e64cc7cd0da)) -* **wiki:** C++ build tools version upgraded ([5b899b7](https://www.github.com/nodejs/node-gyp/commit/5b899b70db729c392ced7c98e8e17590c6499fc3)) -* **wiki:** change bcrypt url to binding.gyp file ([e11bdd8](https://www.github.com/nodejs/node-gyp/commit/e11bdd84de6144492d3eb327d67cbf2d62da1a76)) -* **wiki:** Clarification + direct link to VS2010 ([531c724](https://www.github.com/nodejs/node-gyp/commit/531c724561d947b5d870de8d52dd8c3c51c5ec2d)) -* **wiki:** Correcting the link to node-osmium ([fae7516](https://www.github.com/nodejs/node-gyp/commit/fae7516a1d2829b6e234eaded74fb112ebd79a05)) -* **wiki:** Created "binding.gyp" files out in the wild (markdown) ([d4fd143](https://www.github.com/nodejs/node-gyp/commit/d4fd14355bbe57f229f082f47bb2b3670868203f)) -* **wiki:** Created Common issues (markdown) ([a38299e](https://www.github.com/nodejs/node-gyp/commit/a38299ea340ceb0e732c6dc6a1b4760257644839)) -* **wiki:** Created Error: "pre" versions of node cannot be installed (markdown) ([98bc80d](https://www.github.com/nodejs/node-gyp/commit/98bc80d7a62ba70c881f3c39d94f804322e57852)) -* **wiki:** Created Linking to OpenSSL (markdown) ([c46d00d](https://www.github.com/nodejs/node-gyp/commit/c46d00d83bac5173dea8bbbb175a1a7de74fdaca)) -* **wiki:** Created Updating npm's bundled node gyp (markdown) ([e0ac8d1](https://www.github.com/nodejs/node-gyp/commit/e0ac8d15af46aadd1c220599e63199b154a514e6)) -* **wiki:** Created use of undeclared identifier 'TypedArray' (markdown) ([65ba711](https://www.github.com/nodejs/node-gyp/commit/65ba71139e9b7f64ac823e575ee9dbf17d937ce4)) -* **wiki:** Created Visual Studio 2010 Setup (markdown) ([5b80e83](https://www.github.com/nodejs/node-gyp/commit/5b80e834c8f79dda9fb2770a876ff3cf649c06f3)) -* **wiki:** Created Visual studio 2012 setup (markdown) ([becef31](https://www.github.com/nodejs/node-gyp/commit/becef316b6c46a33e783667720ee074a0141d1a5)) -* **wiki:** Destroyed Visual Studio 2010 Setup (markdown) ([93423b4](https://www.github.com/nodejs/node-gyp/commit/93423b43606de9664aeb79635825f5e9941ec9bc)) -* **wiki:** Destroyed Visual studio 2012 setup (markdown) ([3601508](https://www.github.com/nodejs/node-gyp/commit/3601508bb10fa05da0ddc7e70d57e4b4dd679657)) -* **wiki:** Different commands for Windows npm v6 vs. v7 ([0fce46b](https://www.github.com/nodejs/node-gyp/commit/0fce46b53340c85e8091cde347d5ed23a443c82f)) -* **wiki:** Drop in favor of ([9285ff6](https://www.github.com/nodejs/node-gyp/commit/9285ff6e451c52c070a05f05f0a9602621d91d53)) -* **wiki:** Explicit link to Visual C++ 2010 Express ([378c363](https://www.github.com/nodejs/node-gyp/commit/378c3632f02c096ed819ec8f2611c65bef0c0554)) -* **wiki:** fix link to gyp file used to build libsqlite3 ([54db8d7](https://www.github.com/nodejs/node-gyp/commit/54db8d7ac33e3f98220960b5d86cfa18a75b53cb)) -* **wiki:** Fix link to node-zipfile ([92e49a8](https://www.github.com/nodejs/node-gyp/commit/92e49a858ed69cb4847a26a5676ab56ef5e2de33)) -* **wiki:** fixed node-serialport link ([954ee53](https://www.github.com/nodejs/node-gyp/commit/954ee530b3972d1db591fce32368e4e31b5a25d8)) -* **wiki:** I highly missing it in common issue as every windows biggner face that issue ([d617fae](https://www.github.com/nodejs/node-gyp/commit/d617faee29c40871ca5c8f93efd0ce929a40d541)) -* **wiki:** if ouns that the -h did not help. I founs on github that there was support for visual studio 2015, while i couldn't install node-red beacuse it kept telling me the key 2015 was missing. looking in he gyp python code i found the local file was bot up t dat with the github repo. updating took several efforts before i tried to drop the -g option. ([408b72f](https://www.github.com/nodejs/node-gyp/commit/408b72f561329408daeb17834436e381406efcc8)) -* **wiki:** If permissions error, please try and then the command. ([ee8e1c1](https://www.github.com/nodejs/node-gyp/commit/ee8e1c1e5334096d58e0d6bca6c006f2ee9c88cb)) -* **wiki:** Improve Unix instructions ([c3e5487](https://www.github.com/nodejs/node-gyp/commit/c3e548736645b535ea5bce613d74ca3e98598243)) -* **wiki:** link to docs/ from README ([b52e487](https://www.github.com/nodejs/node-gyp/commit/b52e487eac1eb421573d1e67114a242eeff45a00)) -* **wiki:** Lower case L ([3aa2c6b](https://www.github.com/nodejs/node-gyp/commit/3aa2c6bdb07971b87505e32e32548d75264bd19f)) -* **wiki:** Make changes discussed in https://github.com/nodejs/node-gyp/issues/2416 ([1dcad87](https://www.github.com/nodejs/node-gyp/commit/1dcad873539027511a5f0243baf770ea90f6f4e2)) -* **wiki:** move wiki docs into doc/ ([f0a4835](https://www.github.com/nodejs/node-gyp/commit/f0a48355d86534ec3bdabcdb3ce3340fa2e17f39)) -* **wiki:** node-sass in the wild ([d310a73](https://www.github.com/nodejs/node-gyp/commit/d310a73d64d0065050377baac7047472f7424a1b)) -* **wiki:** node-srs was a 404 ([bbca21a](https://www.github.com/nodejs/node-gyp/commit/bbca21a1e1ede4c473aff365ca71989a5bda7b57)) -* **wiki:** Note: VS2010 seems to be no longer available! VS2013 or nothing! ([7b5dcaf](https://www.github.com/nodejs/node-gyp/commit/7b5dcafafccdceae4b8f2b53ac9081a694b6ade8)) -* **wiki:** safer doc names, remove unnecessary TypedArray doc ([161c235](https://www.github.com/nodejs/node-gyp/commit/161c2353ef5b562f4acfb2fd77608fcbd0800fc0)) -* **wiki:** sorry, forgot to mention a specific windows version. ([d69dffc](https://www.github.com/nodejs/node-gyp/commit/d69dffc16c2b1e3c60dcb5d1c35a49270ba22a35)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([7444b47](https://www.github.com/nodejs/node-gyp/commit/7444b47a7caac1e14d1da474a7fcfcf88d328017)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d766b74](https://www.github.com/nodejs/node-gyp/commit/d766b7427851e6c2edc02e2504a7be9be7e330c0)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d319b0e](https://www.github.com/nodejs/node-gyp/commit/d319b0e98c7085de8e51bc5595eba4264b99a7d5)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3c6692d](https://www.github.com/nodejs/node-gyp/commit/3c6692d538f0ce973869aa237118b7d2483feccd)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([93392d5](https://www.github.com/nodejs/node-gyp/commit/93392d559ce6f250b9c7fe8177e6c88603809dc1)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([8841158](https://www.github.com/nodejs/node-gyp/commit/88411588f300e9b7c00fe516ecd977a1feeeb15c)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([81bfa1f](https://www.github.com/nodejs/node-gyp/commit/81bfa1f1b63d522a9f8a9ae9ca0c7ae90fe75140)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d1cd237](https://www.github.com/nodejs/node-gyp/commit/d1cd237bad06fa507adb354b9e2181a14dc63d24)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3de9e17](https://www.github.com/nodejs/node-gyp/commit/3de9e17e0b8a387eafe7bd18d0ec1e3191d118e8)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([a9b7096](https://www.github.com/nodejs/node-gyp/commit/a9b70968fb956eab3b95672048b94350e1565ca3)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([3236069](https://www.github.com/nodejs/node-gyp/commit/3236069689e7e0eb15b324fce74ab58158956f98)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([1462755](https://www.github.com/nodejs/node-gyp/commit/14627556966e5d513bdb8e5208f0e1300f68991f)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([7ab1337](https://www.github.com/nodejs/node-gyp/commit/7ab133752a6c402bb96dcd3d671d73e03e9487ad)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([640895d](https://www.github.com/nodejs/node-gyp/commit/640895d36b7448c646a3b850c1e159106f83c724)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([ced8c96](https://www.github.com/nodejs/node-gyp/commit/ced8c968457f285ab8989c291d28173d7730833c)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([27b883a](https://www.github.com/nodejs/node-gyp/commit/27b883a350ad0db6b9130d7b996f35855ec34c7a)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([d29fb13](https://www.github.com/nodejs/node-gyp/commit/d29fb134f1c4b9dd729ba95f2979e69e0934809f)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([2765891](https://www.github.com/nodejs/node-gyp/commit/27658913e6220cf0371b4b73e25a0e4ab11108a1)) -* **wiki:** Updated "binding.gyp" files out in the wild (markdown) ([dc97766](https://www.github.com/nodejs/node-gyp/commit/dc9776648d432bca6775c176641f16da14522d4c)) -* **wiki:** Updated Error: "pre" versions of node cannot be installed (markdown) ([e9f8b33](https://www.github.com/nodejs/node-gyp/commit/e9f8b33d1f87d04f22cb09a814d7c55d0fa38446)) -* **wiki:** Updated Home (markdown) ([3407109](https://www.github.com/nodejs/node-gyp/commit/3407109325cf7ba1e925656b9eb75feffab0557c)) -* **wiki:** Updated Home (markdown) ([6e392bc](https://www.github.com/nodejs/node-gyp/commit/6e392bcdd3dd1691773e6e16e1dffc35931b81e0)) -* **wiki:** Updated Home (markdown) ([65efe32](https://www.github.com/nodejs/node-gyp/commit/65efe32ccb8d446ce569453364f922dd9d27c945)) -* **wiki:** Updated Home (markdown) ([ea28f09](https://www.github.com/nodejs/node-gyp/commit/ea28f0947af91fa638be355143f5df89d2e431c8)) -* **wiki:** Updated Home (markdown) ([0e37ff4](https://www.github.com/nodejs/node-gyp/commit/0e37ff48b306c12149661b375895741d3d710da7)) -* **wiki:** Updated Home (markdown) ([b398ef4](https://www.github.com/nodejs/node-gyp/commit/b398ef46f660d2b1506508550dadfb4c35639e4b)) -* **wiki:** Updated Linking to OpenSSL (markdown) ([8919028](https://www.github.com/nodejs/node-gyp/commit/8919028921fd304f08044098434f0dc6071fb7cf)) -* **wiki:** Updated Linking to OpenSSL (markdown) ([c00eb77](https://www.github.com/nodejs/node-gyp/commit/c00eb778fc7dc27e4dab3a9219035ea20458b33b)) -* **wiki:** Updated node-levelup to node-leveldown (broken links) ([59668bb](https://www.github.com/nodejs/node-gyp/commit/59668bb0b904feccf3c09afa2fd37378c77af967)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([d314854](https://www.github.com/nodejs/node-gyp/commit/d31485415ef69d46effa6090c95698341965de1b)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([11858b0](https://www.github.com/nodejs/node-gyp/commit/11858b0655d1eee00c62ad628e719d4378803d14)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([33561e9](https://www.github.com/nodejs/node-gyp/commit/33561e9cbf5f4eb46111318503c77df2c6eb484a)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([4a7f2d0](https://www.github.com/nodejs/node-gyp/commit/4a7f2d0d869a65c99a78504976567017edadf657)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([979a706](https://www.github.com/nodejs/node-gyp/commit/979a7063b950c088a7f4896fc3a48e1d00dfd231)) -* **wiki:** Updated Updating npm's bundled node gyp (markdown) ([e50e04d](https://www.github.com/nodejs/node-gyp/commit/e50e04d7b6a3754ea0aa11fe8cef491b3bc5bdd4)) - -## [8.1.0](https://www.github.com/nodejs/node-gyp/compare/v8.0.0...v8.1.0) (2021-05-28) - - -### Features - -* **gyp:** update gyp to v0.9.1 ([#2402](https://www.github.com/nodejs/node-gyp/issues/2402)) ([814b1b0](https://www.github.com/nodejs/node-gyp/commit/814b1b0eda102afb9fc87e81638a9cf5b650bb10)) - - -### Miscellaneous - -* add `release-please-action` for automated releases ([#2395](https://www.github.com/nodejs/node-gyp/issues/2395)) ([07e9d7c](https://www.github.com/nodejs/node-gyp/commit/07e9d7c7ee80ba119ea760c635f72fd8e7efe198)) - - -### Core - -* fail gracefully if we can't find the username ([#2375](https://www.github.com/nodejs/node-gyp/issues/2375)) ([fca4795](https://www.github.com/nodejs/node-gyp/commit/fca4795512c67dc8420aaa0d913b5b89a4b147f3)) -* log as yes/no whether build dir was created ([#2370](https://www.github.com/nodejs/node-gyp/issues/2370)) ([245dee5](https://www.github.com/nodejs/node-gyp/commit/245dee5b62581309946872ae253226ea3a42c0e3)) - - -### Doc - -* fix v8.0.0 release date ([4b83c3d](https://www.github.com/nodejs/node-gyp/commit/4b83c3de7300457919d53f26d96ea9ad6f6bedd8)) -* remove redundant version info ([#2403](https://www.github.com/nodejs/node-gyp/issues/2403)) ([1423670](https://www.github.com/nodejs/node-gyp/commit/14236709de64b100a424396b91a5115639daa0ef)) -* Update README.md Visual Studio Community page polski to auto ([#2371](https://www.github.com/nodejs/node-gyp/issues/2371)) ([1b4697a](https://www.github.com/nodejs/node-gyp/commit/1b4697abf69ef574a48faf832a7098f4c6c224a5)) - -## v8.0.0 2021-04-03 - -* [[`0d8a6f1b19`](https://github.com/nodejs/node-gyp/commit/0d8a6f1b19)] - **ci**: update actions/setup-node to v2 (#2302) (Sora Morimoto) [#2302](https://github.com/nodejs/node-gyp/pull/2302) -* [[`15a5c7d45b`](https://github.com/nodejs/node-gyp/commit/15a5c7d45b)] - **ci**: migrate deprecated grammar (#2285) (Jiawen Geng) [#2285](https://github.com/nodejs/node-gyp/pull/2285) -* [[`06ddde27f9`](https://github.com/nodejs/node-gyp/commit/06ddde27f9)] - **deps**: sync mutual dependencies with npm (DeeDeeG) [#2348](https://github.com/nodejs/node-gyp/pull/2348) -* [[`a5fd1f41e3`](https://github.com/nodejs/node-gyp/commit/a5fd1f41e3)] - **doc**: add downloads badge (#2352) (Jiawen Geng) [#2352](https://github.com/nodejs/node-gyp/pull/2352) -* [[`cc1cbce056`](https://github.com/nodejs/node-gyp/commit/cc1cbce056)] - **doc**: update macOS\_Catalina.md (#2293) (iMrLopez) [#2293](https://github.com/nodejs/node-gyp/pull/2293) -* [[`6287118fc4`](https://github.com/nodejs/node-gyp/commit/6287118fc4)] - **doc**: updated README.md to copy easily (#2281) (மனோஜ்குமார் பழனிச்சாமி) [#2281](https://github.com/nodejs/node-gyp/pull/2281) -* [[`66c0f04467`](https://github.com/nodejs/node-gyp/commit/66c0f04467)] - **doc**: add missing `sudo` to Catalina doc (Karl Horky) [#2244](https://github.com/nodejs/node-gyp/pull/2244) -* [[`0da2e0140d`](https://github.com/nodejs/node-gyp/commit/0da2e0140d)] - **gyp**: update gyp to v0.8.1 (#2355) (DeeDeeG) [#2355](https://github.com/nodejs/node-gyp/pull/2355) -* [[`0093ec8646`](https://github.com/nodejs/node-gyp/commit/0093ec8646)] - **gyp**: Improve our flake8 linting tests (Christian Clauss) [#2356](https://github.com/nodejs/node-gyp/pull/2356) -* [[`a78b584236`](https://github.com/nodejs/node-gyp/commit/a78b584236)] - **(SEMVER-MAJOR)** **gyp**: remove support for Python 2 (#2300) (Christian Clauss) [#2300](https://github.com/nodejs/node-gyp/pull/2300) -* [[`c3c510d89e`](https://github.com/nodejs/node-gyp/commit/c3c510d89e)] - **gyp**: update gyp to v0.8.0 (#2318) (Christian Clauss) [#2318](https://github.com/nodejs/node-gyp/pull/2318) -* [[`9e1397c52e`](https://github.com/nodejs/node-gyp/commit/9e1397c52e)] - **(SEMVER-MAJOR)** **gyp**: update gyp to v0.7.0 (#2284) (Jiawen Geng) [#2284](https://github.com/nodejs/node-gyp/pull/2284) -* [[`1bd18f3e77`](https://github.com/nodejs/node-gyp/commit/1bd18f3e77)] - **(SEMVER-MAJOR)** **lib**: drop Python 2 support in find-python.js (#2333) (DeeDeeG) [#2333](https://github.com/nodejs/node-gyp/pull/2333) -* [[`e81602ef55`](https://github.com/nodejs/node-gyp/commit/e81602ef55)] - **(SEMVER-MAJOR)** **lib**: migrate requests to fetch (#2220) (Matias Lopez) [#2220](https://github.com/nodejs/node-gyp/pull/2220) -* [[`392b7760b4`](https://github.com/nodejs/node-gyp/commit/392b7760b4)] - **lib**: avoid changing process.config (#2322) (Michaël Zasso) [#2322](https://github.com/nodejs/node-gyp/pull/2322) - -## v7.1.2 2020-10-17 - -* [[`096e3aded5`](https://github.com/nodejs/node-gyp/commit/096e3aded5)] - **gyp**: update gyp to 0.6.2 (Myles Borins) [#2241](https://github.com/nodejs/node-gyp/pull/2241) -* [[`54f97cd243`](https://github.com/nodejs/node-gyp/commit/54f97cd243)] - **doc**: add cmd to reset `xcode-select` to initial state (Valera Rozuvan) [#2235](https://github.com/nodejs/node-gyp/pull/2235) - -## v7.1.1 2020-10-15 - -This release restores the location of shared library builds to the pre-v7 -location. In v7.0.0 until this release, shared library outputs were placed -in a lib.target subdirectory inside the build/{Release,Debug} directory for -builds using `make` (Linux, etc.). This is inconsistent with macOS (Xcode) -behavior and previous node-gyp behavior so has been reverted. -We consider this a bug-fix rather than semver-major change. - -* [[`18bf2d1d38`](https://github.com/nodejs/node-gyp/commit/18bf2d1d38)] - **deps**: update deps to match npm@7 (Rod Vagg) [#2240](https://github.com/nodejs/node-gyp/pull/2240) -* [[`ee6a837cb7`](https://github.com/nodejs/node-gyp/commit/ee6a837cb7)] - **gyp**: update gyp to 0.6.1 (Rod Vagg) [#2238](https://github.com/nodejs/node-gyp/pull/2238) -* [[`3e7f8ccafc`](https://github.com/nodejs/node-gyp/commit/3e7f8ccafc)] - **lib**: better log message when ps fails (Martin Midtgaard) [#2229](https://github.com/nodejs/node-gyp/pull/2229) -* [[`7fb314339f`](https://github.com/nodejs/node-gyp/commit/7fb314339f)] - **test**: GitHub Actions: Test on Python 3.9 (Christian Clauss) [#2230](https://github.com/nodejs/node-gyp/pull/2230) -* [[`754996b9ec`](https://github.com/nodejs/node-gyp/commit/754996b9ec)] - **doc**: replace status badges with new Actions badge (Rod Vagg) [#2218](https://github.com/nodejs/node-gyp/pull/2218) -* [[`2317dc400c`](https://github.com/nodejs/node-gyp/commit/2317dc400c)] - **ci**: switch to GitHub Actions (Shelley Vohr) [#2210](https://github.com/nodejs/node-gyp/pull/2210) -* [[`2cca9b74f7`](https://github.com/nodejs/node-gyp/commit/2cca9b74f7)] - **doc**: drop the --production flag for installing windows-build-tools (DeeDeeG) [#2206](https://github.com/nodejs/node-gyp/pull/2206) - -## v7.1.0 2020-08-12 - -* [[`aaf33c3029`](https://github.com/nodejs/node-gyp/commit/aaf33c3029)] - **build**: add update-gyp script (Samuel Attard) [#2167](https://github.com/nodejs/node-gyp/pull/2167) -* * [[`3baa4e4172`](https://github.com/nodejs/node-gyp/commit/3baa4e4172)] - **(SEMVER-MINOR)** **gyp**: update gyp to 0.4.0 (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) -* * [[`f461d56c53`](https://github.com/nodejs/node-gyp/commit/f461d56c53)] - **(SEMVER-MINOR)** **build**: support apple silicon (arm64 darwin) builds (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) -* * [[`ee6fa7d3bc`](https://github.com/nodejs/node-gyp/commit/ee6fa7d3bc)] - **docs**: note that node-gyp@7 should solve Catalina CLT issues (Rod Vagg) [#2156](https://github.com/nodejs/node-gyp/pull/2156) -* * [[`4fc8ff179d`](https://github.com/nodejs/node-gyp/commit/4fc8ff179d)] - **doc**: silence curl for macOS Catalina acid test (Chia Wei Ong) [#2150](https://github.com/nodejs/node-gyp/pull/2150) -* * [[`7857cb2eb1`](https://github.com/nodejs/node-gyp/commit/7857cb2eb1)] - **deps**: increase "engines" to "node" : "\>= 10.12.0" (DeeDeeG) [#2153](https://github.com/nodejs/node-gyp/pull/2153) - -## v7.0.0 2020-06-03 - -* [[`e18a61afc1`](https://github.com/nodejs/node-gyp/commit/e18a61afc1)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) -* [[`4937722cf5`](https://github.com/nodejs/node-gyp/commit/4937722cf5)] - **(SEMVER-MAJOR)** **deps**: replace mkdirp with {recursive} mkdir (Rod Vagg) [#2123](https://github.com/nodejs/node-gyp/pull/2123) -* [[`d45438a047`](https://github.com/nodejs/node-gyp/commit/d45438a047)] - **(SEMVER-MAJOR)** **deps**: update deps, match to npm@7 (Rod Vagg) [#2126](https://github.com/nodejs/node-gyp/pull/2126) -* [[`ba4f34b7d6`](https://github.com/nodejs/node-gyp/commit/ba4f34b7d6)] - **doc**: update catalina xcode clt download link (Dario Vladovic) [#2133](https://github.com/nodejs/node-gyp/pull/2133) -* [[`f7bfce96ed`](https://github.com/nodejs/node-gyp/commit/f7bfce96ed)] - **doc**: update acid test and introduce curl|bash test script (Dario Vladovic) [#2105](https://github.com/nodejs/node-gyp/pull/2105) -* [[`e529f3309d`](https://github.com/nodejs/node-gyp/commit/e529f3309d)] - **doc**: update README to reflect upgrade to gyp-next (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) -* [[`9aed6286a3`](https://github.com/nodejs/node-gyp/commit/9aed6286a3)] - **doc**: give more attention to Catalina issues doc (Matheus Marchini) [#2134](https://github.com/nodejs/node-gyp/pull/2134) -* [[`963f2a7b48`](https://github.com/nodejs/node-gyp/commit/963f2a7b48)] - **doc**: improve Catalina discoverability for search engines (Matheus Marchini) [#2135](https://github.com/nodejs/node-gyp/pull/2135) -* [[`7b75af349b`](https://github.com/nodejs/node-gyp/commit/7b75af349b)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) -* [[`4f23c7bee2`](https://github.com/nodejs/node-gyp/commit/4f23c7bee2)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) -* [[`473cfa283f`](https://github.com/nodejs/node-gyp/commit/473cfa283f)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) -* [[`e7402b4a7c`](https://github.com/nodejs/node-gyp/commit/e7402b4a7c)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) -* [[`35de45984f`](https://github.com/nodejs/node-gyp/commit/35de45984f)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) -* [[`48642191f5`](https://github.com/nodejs/node-gyp/commit/48642191f5)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) -* [[`ae5b150051`](https://github.com/nodejs/node-gyp/commit/ae5b150051)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) -* [[`d1dea13fe4`](https://github.com/nodejs/node-gyp/commit/d1dea13fe4)] - **doc**: fix changelog 6.1.0 release year to be 2020 (Quentin Vernot) [#2021](https://github.com/nodejs/node-gyp/pull/2021) -* [[`6356117b08`](https://github.com/nodejs/node-gyp/commit/6356117b08)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) -* [[`a6b76a8b48`](https://github.com/nodejs/node-gyp/commit/a6b76a8b48)] - **gyp**: update gyp to 0.2.1 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) -* [[`ebc34ec823`](https://github.com/nodejs/node-gyp/commit/ebc34ec823)] - **gyp**: update gyp to 0.2.0 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) -* [[`972780bde7`](https://github.com/nodejs/node-gyp/commit/972780bde7)] - **(SEMVER-MAJOR)** **gyp**: sync code base with nodejs repo (#1975) (Michaël Zasso) [#1975](https://github.com/nodejs/node-gyp/pull/1975) -* [[`c255ffbf6a`](https://github.com/nodejs/node-gyp/commit/c255ffbf6a)] - **lib**: drop "-2" flag for "py.exe" launcher (DeeDeeG) [#2131](https://github.com/nodejs/node-gyp/pull/2131) -* [[`1f7e1e93b5`](https://github.com/nodejs/node-gyp/commit/1f7e1e93b5)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) -* [[`741ab096d5`](https://github.com/nodejs/node-gyp/commit/741ab096d5)] - **test**: remove support for EOL versions of Node.js (Shelley Vohr) -* [[`ca86ef2539`](https://github.com/nodejs/node-gyp/commit/ca86ef2539)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) - -## v6.1.0 2020-01-08 - -* [[`9a7dd16b76`](https://github.com/nodejs/node-gyp/commit/9a7dd16b76)] - **doc**: remove backticks from Python version list (Rod Vagg) [#2011](https://github.com/nodejs/node-gyp/pull/2011) -* [[`26cd6eaea6`](https://github.com/nodejs/node-gyp/commit/26cd6eaea6)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) -* [[`312c12ef4f`](https://github.com/nodejs/node-gyp/commit/312c12ef4f)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) -* [[`f7b6b6b77b`](https://github.com/nodejs/node-gyp/commit/f7b6b6b77b)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) -* [[`6b8f2652dd`](https://github.com/nodejs/node-gyp/commit/6b8f2652dd)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) -* [[`20aa0b44f7`](https://github.com/nodejs/node-gyp/commit/20aa0b44f7)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) -* [[`14f2a07a39`](https://github.com/nodejs/node-gyp/commit/14f2a07a39)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) -* [[`f242ce4d2c`](https://github.com/nodejs/node-gyp/commit/f242ce4d2c)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) -* [[`3bcba2a01a`](https://github.com/nodejs/node-gyp/commit/3bcba2a01a)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) -* [[`470cc2178e`](https://github.com/nodejs/node-gyp/commit/470cc2178e)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) -* [[`31ecc8421d`](https://github.com/nodejs/node-gyp/commit/31ecc8421d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) -* [[`5a729e86ee`](https://github.com/nodejs/node-gyp/commit/5a729e86ee)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) -* [[`345c70e56d`](https://github.com/nodejs/node-gyp/commit/345c70e56d)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`d6a7e0e1fb`](https://github.com/nodejs/node-gyp/commit/d6a7e0e1fb)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`5a64e9bd32`](https://github.com/nodejs/node-gyp/commit/5a64e9bd32)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) -* [[`04da736d38`](https://github.com/nodejs/node-gyp/commit/04da736d38)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) -* [[`0670e5189d`](https://github.com/nodejs/node-gyp/commit/0670e5189d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) -* [[`c506a6a150`](https://github.com/nodejs/node-gyp/commit/c506a6a150)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) - -## v6.0.1 2019-11-01 - -* [[`8ec2e681d5`](https://github.com/nodejs/node-gyp/commit/8ec2e681d5)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) -* [[`1b11be63cc`](https://github.com/nodejs/node-gyp/commit/1b11be63cc)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) -* [[`c0282daa48`](https://github.com/nodejs/node-gyp/commit/c0282daa48)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) -* [[`d8e09a1b6a`](https://github.com/nodejs/node-gyp/commit/d8e09a1b6a)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) -* [[`9c0f3404f0`](https://github.com/nodejs/node-gyp/commit/9c0f3404f0)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) -* [[`bb2eb72a3f`](https://github.com/nodejs/node-gyp/commit/bb2eb72a3f)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) -* [[`f0693413d9`](https://github.com/nodejs/node-gyp/commit/f0693413d9)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) -* [[`c60c22de58`](https://github.com/nodejs/node-gyp/commit/c60c22de58)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) -* [[`b91718eefc`](https://github.com/nodejs/node-gyp/commit/b91718eefc)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) -* [[`3538a317b6`](https://github.com/nodejs/node-gyp/commit/3538a317b6)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) -* [[`4fff8458c0`](https://github.com/nodejs/node-gyp/commit/4fff8458c0)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`60e4488f08`](https://github.com/nodejs/node-gyp/commit/60e4488f08)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`032db2a2d0`](https://github.com/nodejs/node-gyp/commit/032db2a2d0)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) -* [[`5a83630c33`](https://github.com/nodejs/node-gyp/commit/5a83630c33)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) - -## v6.0.0 2019-10-04 - -* [[`dd0e97ef0b`](https://github.com/nodejs/node-gyp/commit/dd0e97ef0b)] - **(SEMVER-MAJOR)** **lib**: try to find `python` after `python3` (Sam Roberts) [#1907](https://github.com/nodejs/node-gyp/pull/1907) -* [[`f60ed47d14`](https://github.com/nodejs/node-gyp/commit/f60ed47d14)] - **travis**: add Python 3.5 and 3.6 tests on Linux (Christian Clauss) [#1903](https://github.com/nodejs/node-gyp/pull/1903) -* [[`c763ca1838`](https://github.com/nodejs/node-gyp/commit/c763ca1838)] - **(SEMVER-MAJOR)** **doc**: Declare that node-gyp is Python 3 compatible (cclauss) [#1811](https://github.com/nodejs/node-gyp/pull/1811) -* [[`3d1c60ab81`](https://github.com/nodejs/node-gyp/commit/3d1c60ab81)] - **(SEMVER-MAJOR)** **lib**: accept Python 3 by default (João Reis) [#1844](https://github.com/nodejs/node-gyp/pull/1844) -* [[`c6e3b65a23`](https://github.com/nodejs/node-gyp/commit/c6e3b65a23)] - **(SEMVER-MAJOR)** **lib**: raise the minimum Python version from 2.6 to 2.7 (cclauss) [#1818](https://github.com/nodejs/node-gyp/pull/1818) - -## v5.1.1 2020-05-25 - -* [[`bdd3a79abe`](https://github.com/nodejs/node-gyp/commit/bdd3a79abe)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) -* [[`1f2ba75bc0`](https://github.com/nodejs/node-gyp/commit/1f2ba75bc0)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) -* [[`c106d915f5`](https://github.com/nodejs/node-gyp/commit/c106d915f5)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) -* [[`9a6fea92e2`](https://github.com/nodejs/node-gyp/commit/9a6fea92e2)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) -* [[`59b0b1add8`](https://github.com/nodejs/node-gyp/commit/59b0b1add8)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) -* [[`bb8d0e7b10`](https://github.com/nodejs/node-gyp/commit/bb8d0e7b10)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) -* [[`fb2e80d4e3`](https://github.com/nodejs/node-gyp/commit/fb2e80d4e3)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) -* [[`251d9c885c`](https://github.com/nodejs/node-gyp/commit/251d9c885c)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) -* [[`2b6fc3c8d6`](https://github.com/nodejs/node-gyp/commit/2b6fc3c8d6)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) -* [[`a876ae58ad`](https://github.com/nodejs/node-gyp/commit/a876ae58ad)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) - -## v5.1.0 2020-02-05 - -* [[`f37a8b40d0`](https://github.com/nodejs/node-gyp/commit/f37a8b40d0)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) -* [[`cb3f6aae5e`](https://github.com/nodejs/node-gyp/commit/cb3f6aae5e)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) -* [[`0607596a4c`](https://github.com/nodejs/node-gyp/commit/0607596a4c)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) -* [[`0d5a415a14`](https://github.com/nodejs/node-gyp/commit/0d5a415a14)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) -* [[`103740cd95`](https://github.com/nodejs/node-gyp/commit/103740cd95)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) -* [[`278dcddbdd`](https://github.com/nodejs/node-gyp/commit/278dcddbdd)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) -* [[`1694907bbf`](https://github.com/nodejs/node-gyp/commit/1694907bbf)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) -* [[`a3f1143514`](https://github.com/nodejs/node-gyp/commit/a3f1143514)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) -* [[`52365819c7`](https://github.com/nodejs/node-gyp/commit/52365819c7)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) -* [[`bc509c511d`](https://github.com/nodejs/node-gyp/commit/bc509c511d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) -* [[`91ee26dd48`](https://github.com/nodejs/node-gyp/commit/91ee26dd48)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) -* [[`0923f344c9`](https://github.com/nodejs/node-gyp/commit/0923f344c9)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`32c8744b34`](https://github.com/nodejs/node-gyp/commit/32c8744b34)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) -* [[`fd4b1351e4`](https://github.com/nodejs/node-gyp/commit/fd4b1351e4)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) - -## v5.0.7 2019-12-16 - -Republish of v5.0.6 with unnecessary tarball removed from pack file. - -## v5.0.6 2019-12-16 - -* [[`cdec00286f`](https://github.com/nodejs/node-gyp/commit/cdec00286f)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) -* [[`b7c8233ef2`](https://github.com/nodejs/node-gyp/commit/b7c8233ef2)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) -* [[`e12b00ab0a`](https://github.com/nodejs/node-gyp/commit/e12b00ab0a)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) -* [[`70b9890c0d`](https://github.com/nodejs/node-gyp/commit/70b9890c0d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) -* [[`4029fa8629`](https://github.com/nodejs/node-gyp/commit/4029fa8629)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) -* [[`fe8b02cc8b`](https://github.com/nodejs/node-gyp/commit/fe8b02cc8b)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) -* [[`8ea47ce365`](https://github.com/nodejs/node-gyp/commit/8ea47ce365)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) -* [[`c7229716ba`](https://github.com/nodejs/node-gyp/commit/c7229716ba)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) -* [[`2a18b2a0f8`](https://github.com/nodejs/node-gyp/commit/2a18b2a0f8)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) -* [[`70f391e844`](https://github.com/nodejs/node-gyp/commit/70f391e844)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) -* [[`9f4f0fa34e`](https://github.com/nodejs/node-gyp/commit/9f4f0fa34e)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) -* [[`7cf507906d`](https://github.com/nodejs/node-gyp/commit/7cf507906d)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) -* [[`ad0d182c01`](https://github.com/nodejs/node-gyp/commit/ad0d182c01)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) -* [[`1553081ed6`](https://github.com/nodejs/node-gyp/commit/1553081ed6)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) -* [[`0705cae9aa`](https://github.com/nodejs/node-gyp/commit/0705cae9aa)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`7bfdb6f5bf`](https://github.com/nodejs/node-gyp/commit/7bfdb6f5bf)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) -* [[`7edf7658fa`](https://github.com/nodejs/node-gyp/commit/7edf7658fa)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) -* [[`69056d04fe`](https://github.com/nodejs/node-gyp/commit/69056d04fe)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) - -## v5.0.5 2019-10-04 - -* [[`3891391746`](https://github.com/nodejs/node-gyp/commit/3891391746)] - **doc**: reconcile README with Python 3 compat changes (Rod Vagg) [#1911](https://github.com/nodejs/node-gyp/pull/1911) -* [[`07f81f1920`](https://github.com/nodejs/node-gyp/commit/07f81f1920)] - **lib**: accept Python 3 after Python 2 (Sam Roberts) [#1910](https://github.com/nodejs/node-gyp/pull/1910) -* [[`04ce59f4a2`](https://github.com/nodejs/node-gyp/commit/04ce59f4a2)] - **doc**: clarify Python configuration, etc (Sam Roberts) [#1908](https://github.com/nodejs/node-gyp/pull/1908) -* [[`01c46ee3df`](https://github.com/nodejs/node-gyp/commit/01c46ee3df)] - **gyp**: add \_\_lt\_\_ to MSVSSolutionEntry (João Reis) [#1904](https://github.com/nodejs/node-gyp/pull/1904) -* [[`735d961b99`](https://github.com/nodejs/node-gyp/commit/735d961b99)] - **win**: support VS 2017 Desktop Express (João Reis) [#1902](https://github.com/nodejs/node-gyp/pull/1902) -* [[`3834156a92`](https://github.com/nodejs/node-gyp/commit/3834156a92)] - **test**: add Python 3.5 and 3.6 tests on Linux (cclauss) [#1909](https://github.com/nodejs/node-gyp/pull/1909) -* [[`1196e990d8`](https://github.com/nodejs/node-gyp/commit/1196e990d8)] - **src**: update to standard@14 (Rod Vagg) [#1899](https://github.com/nodejs/node-gyp/pull/1899) -* [[`53ee7dfe89`](https://github.com/nodejs/node-gyp/commit/53ee7dfe89)] - **gyp**: fix undefined name: cflags --\> ldflags (Christian Clauss) [#1901](https://github.com/nodejs/node-gyp/pull/1901) -* [[`5871dcf6c9`](https://github.com/nodejs/node-gyp/commit/5871dcf6c9)] - **src,win**: add support for fetching arm64 node.lib (Richard Townsend) [#1875](https://github.com/nodejs/node-gyp/pull/1875) - -## v5.0.4 2019-09-27 - -* [[`1236869ffc`](https://github.com/nodejs/node-gyp/commit/1236869ffc)] - **gyp**: modify XcodeVersion() to convert "4.2" to "0420" and "10.0" to "1000" (Christian Clauss) [#1895](https://github.com/nodejs/node-gyp/pull/1895) -* [[`36638afe48`](https://github.com/nodejs/node-gyp/commit/36638afe48)] - **gyp**: more decode stdout on Python 3 (cclauss) [#1894](https://github.com/nodejs/node-gyp/pull/1894) -* [[`f753c167c5`](https://github.com/nodejs/node-gyp/commit/f753c167c5)] - **gyp**: decode stdout on Python 3 (cclauss) [#1890](https://github.com/nodejs/node-gyp/pull/1890) -* [[`60a4083523`](https://github.com/nodejs/node-gyp/commit/60a4083523)] - **doc**: update xcode install instructions to match Node's BUILDING (Nhan Khong) [#1884](https://github.com/nodejs/node-gyp/pull/1884) -* [[`19dbc9ac32`](https://github.com/nodejs/node-gyp/commit/19dbc9ac32)] - **deps**: update tar to 4.4.12 (Matheus Marchini) [#1889](https://github.com/nodejs/node-gyp/pull/1889) -* [[`5f3ed92181`](https://github.com/nodejs/node-gyp/commit/5f3ed92181)] - **bin**: fix the usage instructions (Halit Ogunc) [#1888](https://github.com/nodejs/node-gyp/pull/1888) -* [[`aab118edf1`](https://github.com/nodejs/node-gyp/commit/aab118edf1)] - **lib**: adding keep-alive header to download requests (Milad Farazmand) [#1863](https://github.com/nodejs/node-gyp/pull/1863) -* [[`1186e89326`](https://github.com/nodejs/node-gyp/commit/1186e89326)] - **lib**: ignore non-critical os.userInfo() failures (Rod Vagg) [#1835](https://github.com/nodejs/node-gyp/pull/1835) -* [[`785e527c3d`](https://github.com/nodejs/node-gyp/commit/785e527c3d)] - **doc**: fix missing argument for setting python path (lagorsse) [#1802](https://github.com/nodejs/node-gyp/pull/1802) -* [[`a97615196c`](https://github.com/nodejs/node-gyp/commit/a97615196c)] - **gyp**: rm semicolons (Python != JavaScript) (MattIPv4) [#1858](https://github.com/nodejs/node-gyp/pull/1858) -* [[`06019bac24`](https://github.com/nodejs/node-gyp/commit/06019bac24)] - **gyp**: assorted typo fixes (XhmikosR) [#1853](https://github.com/nodejs/node-gyp/pull/1853) -* [[`3f4972c1ca`](https://github.com/nodejs/node-gyp/commit/3f4972c1ca)] - **gyp**: use "is" when comparing to None (Vladyslav Burzakovskyy) [#1860](https://github.com/nodejs/node-gyp/pull/1860) -* [[`1cb4708073`](https://github.com/nodejs/node-gyp/commit/1cb4708073)] - **src,win**: improve unmanaged handling (Peter Sabath) [#1852](https://github.com/nodejs/node-gyp/pull/1852) -* [[`5553cd910e`](https://github.com/nodejs/node-gyp/commit/5553cd910e)] - **gyp**: improve Windows+Cygwin compatibility (Jose Quijada) [#1817](https://github.com/nodejs/node-gyp/pull/1817) -* [[`8bcb1fbb43`](https://github.com/nodejs/node-gyp/commit/8bcb1fbb43)] - **gyp**: Python 3 Windows fixes (João Reis) [#1843](https://github.com/nodejs/node-gyp/pull/1843) -* [[`2e24d0a326`](https://github.com/nodejs/node-gyp/commit/2e24d0a326)] - **test**: accept Python 3 in test-find-python.js (João Reis) [#1843](https://github.com/nodejs/node-gyp/pull/1843) -* [[`1267b4dc1c`](https://github.com/nodejs/node-gyp/commit/1267b4dc1c)] - **build**: add test run Python 3.7 on macOS (Christian Clauss) [#1843](https://github.com/nodejs/node-gyp/pull/1843) -* [[`da1b031aa3`](https://github.com/nodejs/node-gyp/commit/da1b031aa3)] - **build**: import StringIO on Python 2 and Python 3 (Christian Clauss) [#1836](https://github.com/nodejs/node-gyp/pull/1836) -* [[`fa0ed4aa42`](https://github.com/nodejs/node-gyp/commit/fa0ed4aa42)] - **build**: more Python 3 compat, replace compile with ast (cclauss) [#1820](https://github.com/nodejs/node-gyp/pull/1820) -* [[`18d5c7c9d0`](https://github.com/nodejs/node-gyp/commit/18d5c7c9d0)] - **win,src**: update win\_delay\_load\_hook.cc to work with /clr (Ivan Petrovic) [#1819](https://github.com/nodejs/node-gyp/pull/1819) - -## v5.0.3 2019-07-17 - -* [[`66ad305775`](https://github.com/nodejs/node-gyp/commit/66ad305775)] - **python**: accept Python 3 conditionally (João Reis) [#1815](https://github.com/nodejs/node-gyp/pull/1815) -* [[`7e7fce3fed`](https://github.com/nodejs/node-gyp/commit/7e7fce3fed)] - **python**: move Python detection to its own file (João Reis) [#1815](https://github.com/nodejs/node-gyp/pull/1815) -* [[`e40c99e283`](https://github.com/nodejs/node-gyp/commit/e40c99e283)] - **src**: implement standard.js linting (Rod Vagg) [#1794](https://github.com/nodejs/node-gyp/pull/1794) -* [[`bb92c761a9`](https://github.com/nodejs/node-gyp/commit/bb92c761a9)] - **test**: add Node.js 6 on Windows to Travis CI (João Reis) [#1812](https://github.com/nodejs/node-gyp/pull/1812) -* [[`7fd924079f`](https://github.com/nodejs/node-gyp/commit/7fd924079f)] - **test**: increase tap timeout (João Reis) [#1812](https://github.com/nodejs/node-gyp/pull/1812) -* [[`7e8127068f`](https://github.com/nodejs/node-gyp/commit/7e8127068f)] - **test**: cover supported node versions with travis (Rod Vagg) [#1809](https://github.com/nodejs/node-gyp/pull/1809) -* [[`24109148df`](https://github.com/nodejs/node-gyp/commit/24109148df)] - **test**: downgrade to tap@^12 for continued Node 6 support (Rod Vagg) [#1808](https://github.com/nodejs/node-gyp/pull/1808) -* [[`656117cc4a`](https://github.com/nodejs/node-gyp/commit/656117cc4a)] - **win**: make VS path match case-insensitive (João Reis) [#1806](https://github.com/nodejs/node-gyp/pull/1806) - -## v5.0.2 2019-06-27 - -* [[`2761afbf73`](https://github.com/nodejs/node-gyp/commit/2761afbf73)] - **build,test**: add duplicate symbol test (Gabriel Schulhof) [#1689](https://github.com/nodejs/node-gyp/pull/1689) -* [[`82f129d6de`](https://github.com/nodejs/node-gyp/commit/82f129d6de)] - **gyp**: replace optparse to argparse (KiYugadgeter) [#1591](https://github.com/nodejs/node-gyp/pull/1591) -* [[`afaaa29c61`](https://github.com/nodejs/node-gyp/commit/afaaa29c61)] - **gyp**: remove from \_\_future\_\_ import with\_statement (cclauss) [#1799](https://github.com/nodejs/node-gyp/pull/1799) -* [[`a991f633d6`](https://github.com/nodejs/node-gyp/commit/a991f633d6)] - **gyp**: fix the remaining Python 3 issues (cclauss) [#1793](https://github.com/nodejs/node-gyp/pull/1793) -* [[`f952b08f84`](https://github.com/nodejs/node-gyp/commit/f952b08f84)] - **gyp**: move from \_\_future\_\_ import to the top of the file (cclauss) [#1789](https://github.com/nodejs/node-gyp/pull/1789) -* [[`4f4a677dfa`](https://github.com/nodejs/node-gyp/commit/4f4a677dfa)] - **gyp**: use different default compiler for z/OS (Shuowang (Wayne) Zhang) [#1768](https://github.com/nodejs/node-gyp/pull/1768) -* [[`03683f09d6`](https://github.com/nodejs/node-gyp/commit/03683f09d6)] - **lib**: code de-duplication (Pavel Medvedev) [#965](https://github.com/nodejs/node-gyp/pull/965) -* [[`611bc3c89f`](https://github.com/nodejs/node-gyp/commit/611bc3c89f)] - **lib**: add .json suffix for explicit require (Rod Vagg) [#1787](https://github.com/nodejs/node-gyp/pull/1787) -* [[`d3478d7b0b`](https://github.com/nodejs/node-gyp/commit/d3478d7b0b)] - **meta**: add to .gitignore (Refael Ackermann) [#1573](https://github.com/nodejs/node-gyp/pull/1573) -* [[`7a9a038e9e`](https://github.com/nodejs/node-gyp/commit/7a9a038e9e)] - **test**: add parallel test runs on macOS and Windows (cclauss) [#1800](https://github.com/nodejs/node-gyp/pull/1800) -* [[`7dd7f2b2a2`](https://github.com/nodejs/node-gyp/commit/7dd7f2b2a2)] - **test**: fix Python syntax error in test-adding.js (cclauss) [#1793](https://github.com/nodejs/node-gyp/pull/1793) -* [[`395f843de0`](https://github.com/nodejs/node-gyp/commit/395f843de0)] - **test**: replace self-signed cert with 'localhost' (Rod Vagg) [#1795](https://github.com/nodejs/node-gyp/pull/1795) -* [[`a52c6eb9e8`](https://github.com/nodejs/node-gyp/commit/a52c6eb9e8)] - **test**: migrate from tape to tap (Rod Vagg) [#1795](https://github.com/nodejs/node-gyp/pull/1795) -* [[`ec2eb44a30`](https://github.com/nodejs/node-gyp/commit/ec2eb44a30)] - **test**: use Nan in duplicate\_symbols (Gabriel Schulhof) [#1689](https://github.com/nodejs/node-gyp/pull/1689) -* [[`1597c84aad`](https://github.com/nodejs/node-gyp/commit/1597c84aad)] - **test**: use Travis CI to run tests on every pull request (cclauss) [#1752](https://github.com/nodejs/node-gyp/pull/1752) -* [[`dd9bf929ac`](https://github.com/nodejs/node-gyp/commit/dd9bf929ac)] - **zos**: update compiler options (Shuowang (Wayne) Zhang) [#1768](https://github.com/nodejs/node-gyp/pull/1768) - -## v5.0.1 2019-06-20 - -* [[`e3861722ed`](https://github.com/nodejs/node-gyp/commit/e3861722ed)] - **doc**: document --jobs max (David Sanders) [#1770](https://github.com/nodejs/node-gyp/pull/1770) -* [[`1cfdb28886`](https://github.com/nodejs/node-gyp/commit/1cfdb28886)] - **lib**: reintroduce support for iojs file naming for releases \>= 1 && \< 4 (Samuel Attard) [#1777](https://github.com/nodejs/node-gyp/pull/1777) - -## v5.0.0 2019-06-13 - -* [[`8a83972743`](https://github.com/nodejs/node-gyp/commit/8a83972743)] - **(SEMVER-MAJOR)** **bin**: follow XDG OS conventions for storing data (Selwyn) [#1570](https://github.com/nodejs/node-gyp/pull/1570) -* [[`9e46872ea3`](https://github.com/nodejs/node-gyp/commit/9e46872ea3)] - **bin,lib**: remove extra comments/lines/spaces (Jon Moss) [#1508](https://github.com/nodejs/node-gyp/pull/1508) -* [[`8098ebdeb4`](https://github.com/nodejs/node-gyp/commit/8098ebdeb4)] - **deps**: replace `osenv` dependency with native `os` (Selwyn) -* [[`f83b457e03`](https://github.com/nodejs/node-gyp/commit/f83b457e03)] - **deps**: bump request to 2.8.7, fixes heok/hawk issues (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) -* [[`323cee7323`](https://github.com/nodejs/node-gyp/commit/323cee7323)] - **deps**: pin `request` version range (Refael Ackermann) [#1300](https://github.com/nodejs/node-gyp/pull/1300) -* [[`c515912d08`](https://github.com/nodejs/node-gyp/commit/c515912d08)] - **doc**: improve issue template (Bartosz Sosnowski) [#1618](https://github.com/nodejs/node-gyp/pull/1618) -* [[`cca2d66727`](https://github.com/nodejs/node-gyp/commit/cca2d66727)] - **doc**: python info needs own header (Taylor D. Lee) [#1245](https://github.com/nodejs/node-gyp/pull/1245) -* [[`3e64c780f5`](https://github.com/nodejs/node-gyp/commit/3e64c780f5)] - **doc**: lint README.md (Jon Moss) [#1498](https://github.com/nodejs/node-gyp/pull/1498) -* [[`a20faedc91`](https://github.com/nodejs/node-gyp/commit/a20faedc91)] - **(SEMVER-MAJOR)** **gyp**: enable MARMASM items only on new VS versions (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`721eb691cf`](https://github.com/nodejs/node-gyp/commit/721eb691cf)] - **gyp**: teach MSVS generator about MARMASM Items (Jon Kunkee) [#1679](https://github.com/nodejs/node-gyp/pull/1679) -* [[`91744bfecc`](https://github.com/nodejs/node-gyp/commit/91744bfecc)] - **gyp**: add support for Windows on Arm (Richard Townsend) [#1739](https://github.com/nodejs/node-gyp/pull/1739) -* [[`a6e0a6c7ed`](https://github.com/nodejs/node-gyp/commit/a6e0a6c7ed)] - **gyp**: move compile\_commands\_json (Paul Maréchal) [#1661](https://github.com/nodejs/node-gyp/pull/1661) -* [[`92e8b52cee`](https://github.com/nodejs/node-gyp/commit/92e8b52cee)] - **gyp**: fix target --\> self.target (cclauss) -* [[`febdfa2137`](https://github.com/nodejs/node-gyp/commit/febdfa2137)] - **gyp**: fix sntex error (cclauss) [#1333](https://github.com/nodejs/node-gyp/pull/1333) -* [[`588d333c14`](https://github.com/nodejs/node-gyp/commit/588d333c14)] - **gyp**: \_winreg module was renamed to winreg in Python 3. (Craig Rodrigues) -* [[`98226d198c`](https://github.com/nodejs/node-gyp/commit/98226d198c)] - **gyp**: replace basestring with str, but only on Python 3. (Craig Rodrigues) -* [[`7535e4478e`](https://github.com/nodejs/node-gyp/commit/7535e4478e)] - **gyp**: replace deprecated functions (Craig Rodrigues) -* [[`2040cd21cc`](https://github.com/nodejs/node-gyp/commit/2040cd21cc)] - **gyp**: use print as a function, as specified in PEP 3105. (Craig Rodrigues) -* [[`abef93ded5`](https://github.com/nodejs/node-gyp/commit/abef93ded5)] - **gyp**: get ready for python 3 (cclauss) -* [[`43031fadcb`](https://github.com/nodejs/node-gyp/commit/43031fadcb)] - **python**: clean-up detection (João Reis) [#1582](https://github.com/nodejs/node-gyp/pull/1582) -* [[`49ab79d221`](https://github.com/nodejs/node-gyp/commit/49ab79d221)] - **python**: more informative error (Refael Ackermann) [#1269](https://github.com/nodejs/node-gyp/pull/1269) -* [[`997bc3c748`](https://github.com/nodejs/node-gyp/commit/997bc3c748)] - **readme**: add ARM64 info to MSVC setup instructions (Jon Kunkee) [#1655](https://github.com/nodejs/node-gyp/pull/1655) -* [[`788e767179`](https://github.com/nodejs/node-gyp/commit/788e767179)] - **test**: remove unused variable (João Reis) -* [[`6f5a408934`](https://github.com/nodejs/node-gyp/commit/6f5a408934)] - **tools**: fix usage of inherited -fPIC and -fPIE (Jens) [#1340](https://github.com/nodejs/node-gyp/pull/1340) -* [[`0efb8fb34b`](https://github.com/nodejs/node-gyp/commit/0efb8fb34b)] - **(SEMVER-MAJOR)** **win**: support running in VS Command Prompt (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`360ddbdf3a`](https://github.com/nodejs/node-gyp/commit/360ddbdf3a)] - **(SEMVER-MAJOR)** **win**: add support for Visual Studio 2019 (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`8f43f68275`](https://github.com/nodejs/node-gyp/commit/8f43f68275)] - **(SEMVER-MAJOR)** **win**: detect all VS versions in node-gyp (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`7fe4095974`](https://github.com/nodejs/node-gyp/commit/7fe4095974)] - **(SEMVER-MAJOR)** **win**: generic Visual Studio 2017 detection (João Reis) [#1762](https://github.com/nodejs/node-gyp/pull/1762) -* [[`7a71d68bce`](https://github.com/nodejs/node-gyp/commit/7a71d68bce)] - **win**: use msbuild from the configure stage (Bartosz Sosnowski) [#1654](https://github.com/nodejs/node-gyp/pull/1654) -* [[`d3b21220a0`](https://github.com/nodejs/node-gyp/commit/d3b21220a0)] - **win**: fix delay-load hook for electron 4 (Andy Dill) -* [[`81f3a92338`](https://github.com/nodejs/node-gyp/commit/81f3a92338)] - Update list of Node.js versions to test against. (Ben Noordhuis) [#1670](https://github.com/nodejs/node-gyp/pull/1670) -* [[`4748f6ab75`](https://github.com/nodejs/node-gyp/commit/4748f6ab75)] - Remove deprecated compatibility code. (Ben Noordhuis) [#1670](https://github.com/nodejs/node-gyp/pull/1670) -* [[`45e3221fd4`](https://github.com/nodejs/node-gyp/commit/45e3221fd4)] - Remove an outdated workaround for Python 2.4 (cclauss) [#1650](https://github.com/nodejs/node-gyp/pull/1650) -* [[`721dc7d314`](https://github.com/nodejs/node-gyp/commit/721dc7d314)] - Add ARM64 to MSBuild /Platform logic (Jon Kunkee) [#1655](https://github.com/nodejs/node-gyp/pull/1655) -* [[`a5b7410497`](https://github.com/nodejs/node-gyp/commit/a5b7410497)] - Add ESLint no-unused-vars rule (Jon Moss) [#1497](https://github.com/nodejs/node-gyp/pull/1497) - -## v4.0.0 2019-04-24 - -* [[`ceed5cbe10`](https://github.com/nodejs/node-gyp/commit/ceed5cbe10)] - **deps**: updated tar package version to 4.4.8 (Pobegaylo Maksim) [#1713](https://github.com/nodejs/node-gyp/pull/1713) -* [[`374519e066`](https://github.com/nodejs/node-gyp/commit/374519e066)] - **(SEMVER-MAJOR)** Upgrade to tar v3 (isaacs) [#1212](https://github.com/nodejs/node-gyp/pull/1212) -* [[`e6699d13cd`](https://github.com/nodejs/node-gyp/commit/e6699d13cd)] - **test**: fix addon test for Node.js 12 and V8 7.4 (Richard Lau) [#1705](https://github.com/nodejs/node-gyp/pull/1705) -* [[`0c6bf530a0`](https://github.com/nodejs/node-gyp/commit/0c6bf530a0)] - **lib**: use print() for python version detection (GreenAddress) [#1534](https://github.com/nodejs/node-gyp/pull/1534) - -## v3.8.0 2018-08-09 - -* [[`c5929cb4fe`](https://github.com/nodejs/node-gyp/commit/c5929cb4fe)] - **doc**: update Xcode preferences tab name. (Ivan Daniluk) [#1330](https://github.com/nodejs/node-gyp/pull/1330) -* [[`8b488da8b9`](https://github.com/nodejs/node-gyp/commit/8b488da8b9)] - **doc**: update link to commit guidelines (Jonas Hermsmeier) [#1456](https://github.com/nodejs/node-gyp/pull/1456) -* [[`b4fe8c16f9`](https://github.com/nodejs/node-gyp/commit/b4fe8c16f9)] - **doc**: fix visual studio links (Bartosz Sosnowski) [#1490](https://github.com/nodejs/node-gyp/pull/1490) -* [[`536759c7e9`](https://github.com/nodejs/node-gyp/commit/536759c7e9)] - **configure**: use sys.version\_info to get python version (Yang Guo) [#1504](https://github.com/nodejs/node-gyp/pull/1504) -* [[`94c39c604e`](https://github.com/nodejs/node-gyp/commit/94c39c604e)] - **gyp**: fix ninja build failure (GYP patch) (Daniel Bevenius) [nodejs/node#12484](https://github.com/nodejs/node/pull/12484) -* [[`e8ea74e0fa`](https://github.com/nodejs/node-gyp/commit/e8ea74e0fa)] - **tools**: patch gyp to avoid xcrun errors (Ujjwal Sharma) [nodejs/node#21520](https://github.com/nodejs/node/pull/21520) -* [[`ea9aff44f2`](https://github.com/nodejs/node-gyp/commit/ea9aff44f2)] - **tools**: fix "the the" typos in comments (Masashi Hirano) [nodejs/node#20716](https://github.com/nodejs/node/pull/20716) -* [[`207e5aa4fd`](https://github.com/nodejs/node-gyp/commit/207e5aa4fd)] - **gyp**: implement LD/LDXX for ninja and FIPS (Sam Roberts) -* [[`b416c5f4b7`](https://github.com/nodejs/node-gyp/commit/b416c5f4b7)] - **gyp**: enable cctest to use objects (gyp part) (Daniel Bevenius) [nodejs/node#12450](https://github.com/nodejs/node/pull/12450) -* [[`40692d016b`](https://github.com/nodejs/node-gyp/commit/40692d016b)] - **gyp**: add compile\_commands.json gyp generator (Ben Noordhuis) [nodejs/node#12450](https://github.com/nodejs/node/pull/12450) -* [[`fc3c4e2b10`](https://github.com/nodejs/node-gyp/commit/fc3c4e2b10)] - **gyp**: float gyp patch for long filenames (Anna Henningsen) [nodejs/node#7963](https://github.com/nodejs/node/pull/7963) -* [[`8aedbfdef6`](https://github.com/nodejs/node-gyp/commit/8aedbfdef6)] - **gyp**: backport GYP fix to fix AIX shared suffix (Stewart Addison) -* [[`6cd84b84fc`](https://github.com/nodejs/node-gyp/commit/6cd84b84fc)] - **test**: formatting and minor fixes for execFileSync replacement (Rod Vagg) [#1521](https://github.com/nodejs/node-gyp/pull/1521) -* [[`60e421363f`](https://github.com/nodejs/node-gyp/commit/60e421363f)] - **test**: added test/processExecSync.js for when execFileSync is not available. (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) -* [[`969447c5bd`](https://github.com/nodejs/node-gyp/commit/969447c5bd)] - **deps**: bump request to 2.8.7, fixes heok/hawk issues (Rohit Hazra) [#1492](https://github.com/nodejs/node-gyp/pull/1492) -* [[`340403ccfe`](https://github.com/nodejs/node-gyp/commit/340403ccfe)] - **win**: improve parsing of SDK version (Alessandro Vergani) [#1516](https://github.com/nodejs/node-gyp/pull/1516) - -## v3.7.0 2018-06-08 - -* [[`84cea7b30d`](https://github.com/nodejs/node-gyp/commit/84cea7b30d)] - Remove unused gyp test scripts. (Ben Noordhuis) [#1458](https://github.com/nodejs/node-gyp/pull/1458) -* [[`0540e4ec63`](https://github.com/nodejs/node-gyp/commit/0540e4ec63)] - **gyp**: escape spaces in filenames in make generator (Jeff Senn) [#1436](https://github.com/nodejs/node-gyp/pull/1436) -* [[`88fc6fa0ec`](https://github.com/nodejs/node-gyp/commit/88fc6fa0ec)] - Drop dependency on minimatch. (Brian Woodward) [#1158](https://github.com/nodejs/node-gyp/pull/1158) -* [[`1e203c5148`](https://github.com/nodejs/node-gyp/commit/1e203c5148)] - Fix include path when pointing to Node.js source (Richard Lau) [#1055](https://github.com/nodejs/node-gyp/pull/1055) -* [[`53d8cb967c`](https://github.com/nodejs/node-gyp/commit/53d8cb967c)] - Prefix build targets with /t: on Windows (Natalie Wolfe) [#1164](https://github.com/nodejs/node-gyp/pull/1164) -* [[`53a5f8ff38`](https://github.com/nodejs/node-gyp/commit/53a5f8ff38)] - **gyp**: add support for .mm files to msvs generator (Julien Racle) [#1167](https://github.com/nodejs/node-gyp/pull/1167) -* [[`dd8561e528`](https://github.com/nodejs/node-gyp/commit/dd8561e528)] - **zos**: don't use universal-new-lines mode (John Barboza) [#1451](https://github.com/nodejs/node-gyp/pull/1451) -* [[`e5a69010ed`](https://github.com/nodejs/node-gyp/commit/e5a69010ed)] - **zos**: add search locations for libnode.x (John Barboza) [#1451](https://github.com/nodejs/node-gyp/pull/1451) -* [[`79febace53`](https://github.com/nodejs/node-gyp/commit/79febace53)] - **doc**: update macOS information in README (Josh Parnham) [#1323](https://github.com/nodejs/node-gyp/pull/1323) -* [[`9425448945`](https://github.com/nodejs/node-gyp/commit/9425448945)] - **gyp**: don't print xcodebuild not found errors (Gibson Fahnestock) [#1370](https://github.com/nodejs/node-gyp/pull/1370) -* [[`6f1286f5b2`](https://github.com/nodejs/node-gyp/commit/6f1286f5b2)] - Fix infinite install loop. (Ben Noordhuis) [#1384](https://github.com/nodejs/node-gyp/pull/1384) -* [[`2580b9139e`](https://github.com/nodejs/node-gyp/commit/2580b9139e)] - Update `--nodedir` description in README. (Ben Noordhuis) [#1372](https://github.com/nodejs/node-gyp/pull/1372) -* [[`a61360391a`](https://github.com/nodejs/node-gyp/commit/a61360391a)] - Update README with another way to install on windows (JeffAtDeere) [#1352](https://github.com/nodejs/node-gyp/pull/1352) -* [[`47496bf6dc`](https://github.com/nodejs/node-gyp/commit/47496bf6dc)] - Fix IndexError when parsing GYP files. (Ben Noordhuis) [#1267](https://github.com/nodejs/node-gyp/pull/1267) -* [[`b2024dee7b`](https://github.com/nodejs/node-gyp/commit/b2024dee7b)] - **zos**: support platform (John Barboza) [#1276](https://github.com/nodejs/node-gyp/pull/1276) -* [[`90d86512f4`](https://github.com/nodejs/node-gyp/commit/90d86512f4)] - **win**: run PS with `-NoProfile` (Refael Ackermann) [#1292](https://github.com/nodejs/node-gyp/pull/1292) -* [[`2da5f86ef7`](https://github.com/nodejs/node-gyp/commit/2da5f86ef7)] - **doc**: add github PR and Issue templates (Gibson Fahnestock) [#1228](https://github.com/nodejs/node-gyp/pull/1228) -* [[`a46a770d68`](https://github.com/nodejs/node-gyp/commit/a46a770d68)] - **doc**: update proposed DCO and CoC (Mikeal Rogers) [#1229](https://github.com/nodejs/node-gyp/pull/1229) -* [[`7e803d58e0`](https://github.com/nodejs/node-gyp/commit/7e803d58e0)] - **doc**: headerify the Install instructions (Nick Schonning) [#1225](https://github.com/nodejs/node-gyp/pull/1225) -* [[`f27599193a`](https://github.com/nodejs/node-gyp/commit/f27599193a)] - **gyp**: update xml string encoding conversion (Liu Chao) [#1203](https://github.com/nodejs/node-gyp/pull/1203) -* [[`0a07e481f7`](https://github.com/nodejs/node-gyp/commit/0a07e481f7)] - **configure**: don't set ensure if tarball is set (Gibson Fahnestock) [#1220](https://github.com/nodejs/node-gyp/pull/1220) - -## v3.6.3 2018-06-08 - -* [[`90cd2e8da9`](https://github.com/nodejs/node-gyp/commit/90cd2e8da9)] - **gyp**: fix regex to match multi-digit versions (Jonas Hermsmeier) [#1455](https://github.com/nodejs/node-gyp/pull/1455) -* [[`7900122337`](https://github.com/nodejs/node-gyp/commit/7900122337)] - deps: pin `request` version range (Refael Ackerman) [#1300](https://github.com/nodejs/node-gyp/pull/1300) - -## v3.6.2 2017-06-01 - -* [[`72afdd62cd`](https://github.com/nodejs/node-gyp/commit/72afdd62cd)] - **build**: rename copyNodeLib() to doBuild() (Liu Chao) [#1206](https://github.com/nodejs/node-gyp/pull/1206) -* [[`bad903ac70`](https://github.com/nodejs/node-gyp/commit/bad903ac70)] - **win**: more robust parsing of SDK version (Refael Ackermann) [#1198](https://github.com/nodejs/node-gyp/pull/1198) -* [[`241752f381`](https://github.com/nodejs/node-gyp/commit/241752f381)] - Log dist-url. (Ben Noordhuis) [#1170](https://github.com/nodejs/node-gyp/pull/1170) -* [[`386746c7d1`](https://github.com/nodejs/node-gyp/commit/386746c7d1)] - **configure**: use full path in node_lib_file GYP var (Pavel Medvedev) [#964](https://github.com/nodejs/node-gyp/pull/964) -* [[`0913b2dd99`](https://github.com/nodejs/node-gyp/commit/0913b2dd99)] - **build, win**: use target_arch to link with node.lib (Pavel Medvedev) [#964](https://github.com/nodejs/node-gyp/pull/964) -* [[`c307b302f7`](https://github.com/nodejs/node-gyp/commit/c307b302f7)] - **doc**: blorb about setting `npm_config_OPTION_NAME` (Refael Ackermann) [#1185](https://github.com/nodejs/node-gyp/pull/1185) - -## v3.6.1 2017-04-30 - -* [[`49801716c2`](https://github.com/nodejs/node-gyp/commit/49801716c2)] - **test**: fix test-find-python on v0.10.x buildbot. (Ben Noordhuis) [#1172](https://github.com/nodejs/node-gyp/pull/1172) -* [[`a83a3801fc`](https://github.com/nodejs/node-gyp/commit/a83a3801fc)] - **test**: fix test/test-configure-python on AIX (Richard Lau) [#1131](https://github.com/nodejs/node-gyp/pull/1131) -* [[`8a767145c9`](https://github.com/nodejs/node-gyp/commit/8a767145c9)] - **gyp**: Revert quote_cmd workaround (Kunal Pathak) [#1153](https://github.com/nodejs/node-gyp/pull/1153) -* [[`c09cf7671e`](https://github.com/nodejs/node-gyp/commit/c09cf7671e)] - **doc**: add a note for using `configure` on Windows (Vse Mozhet Byt) [#1152](https://github.com/nodejs/node-gyp/pull/1152) -* [[`da9cb5f411`](https://github.com/nodejs/node-gyp/commit/da9cb5f411)] - Delete superfluous .patch files. (Ben Noordhuis) [#1122](https://github.com/nodejs/node-gyp/pull/1122) - -## v3.6.0 2017-03-16 - -* [[`ae141e1906`](https://github.com/nodejs/node-gyp/commit/ae141e1906)] - **win**: find and setup for VS2017 (Refael Ackermann) [#1130](https://github.com/nodejs/node-gyp/pull/1130) -* [[`ec5fc36a80`](https://github.com/nodejs/node-gyp/commit/ec5fc36a80)] - Add support to build node.js with chakracore for ARM. (Kunal Pathak) [#873](https://github.com/nodejs/node-gyp/pull/873) -* [[`a04ea3051a`](https://github.com/nodejs/node-gyp/commit/a04ea3051a)] - Add support to build node.js with chakracore. (Kunal Pathak) [#873](https://github.com/nodejs/node-gyp/pull/873) -* [[`93d7fa83c8`](https://github.com/nodejs/node-gyp/commit/93d7fa83c8)] - Upgrade semver dependency. (Ben Noordhuis) [#1107](https://github.com/nodejs/node-gyp/pull/1107) -* [[`ff9a6fadfd`](https://github.com/nodejs/node-gyp/commit/ff9a6fadfd)] - Update link of gyp as Google code is shutting down (Peter Dave Hello) [#1061](https://github.com/nodejs/node-gyp/pull/1061) - -## v3.5.0 2017-01-10 - -* [[`762d19a39e`](https://github.com/nodejs/node-gyp/commit/762d19a39e)] - \[doc\] merge History.md and CHANGELOG.md (Rod Vagg) -* [[`80fc5c3d31`](https://github.com/nodejs/node-gyp/commit/80fc5c3d31)] - Fix deprecated dependency warning (Simone Primarosa) [#1069](https://github.com/nodejs/node-gyp/pull/1069) -* [[`05c44944fd`](https://github.com/nodejs/node-gyp/commit/05c44944fd)] - Open the build file with universal-newlines mode (Guy Margalit) [#1053](https://github.com/nodejs/node-gyp/pull/1053) -* [[`37ae7be114`](https://github.com/nodejs/node-gyp/commit/37ae7be114)] - Try python launcher when stock python is python 3. (Ben Noordhuis) [#992](https://github.com/nodejs/node-gyp/pull/992) -* [[`e3778d9907`](https://github.com/nodejs/node-gyp/commit/e3778d9907)] - Add lots of findPython() tests. (Ben Noordhuis) [#992](https://github.com/nodejs/node-gyp/pull/992) -* [[`afc766adf6`](https://github.com/nodejs/node-gyp/commit/afc766adf6)] - Unset executable bit for .bat files (Pavel Medvedev) [#969](https://github.com/nodejs/node-gyp/pull/969) -* [[`ddac348991`](https://github.com/nodejs/node-gyp/commit/ddac348991)] - Use push on PYTHONPATH and add tests (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) -* [[`b182a19042`](https://github.com/nodejs/node-gyp/commit/b182a19042)] - ***Revert*** "add "path-array" dep" (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) -* [[`7c08b85c5a`](https://github.com/nodejs/node-gyp/commit/7c08b85c5a)] - ***Revert*** "**configure**: use "path-array" for PYTHONPATH" (Michael Hart) [#990](https://github.com/nodejs/node-gyp/pull/990) -* [[`9c8d275526`](https://github.com/nodejs/node-gyp/commit/9c8d275526)] - Add --devdir flag. (Ben Noordhuis) [#916](https://github.com/nodejs/node-gyp/pull/916) -* [[`f6eab1f9e4`](https://github.com/nodejs/node-gyp/commit/f6eab1f9e4)] - **doc**: add windows-build-tools to readme (Felix Rieseberg) [#970](https://github.com/nodejs/node-gyp/pull/970) - -## v3.4.0 2016-06-28 - -* [[`ce5fd04e94`](https://github.com/nodejs/node-gyp/commit/ce5fd04e94)] - **deps**: update minimatch version (delphiactual) [#961](https://github.com/nodejs/node-gyp/pull/961) -* [[`77383ddd85`](https://github.com/nodejs/node-gyp/commit/77383ddd85)] - Replace fs.accessSync call to fs.statSync (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) -* [[`0dba4bda57`](https://github.com/nodejs/node-gyp/commit/0dba4bda57)] - **test**: add simple addon test (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) -* [[`c4344b3889`](https://github.com/nodejs/node-gyp/commit/c4344b3889)] - **doc**: add --target option to README (Gibson Fahnestock) [#958](https://github.com/nodejs/node-gyp/pull/958) -* [[`cc778e9215`](https://github.com/nodejs/node-gyp/commit/cc778e9215)] - Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. (Ben Noordhuis) [#915](https://github.com/nodejs/node-gyp/pull/915) -* [[`af35b2ad32`](https://github.com/nodejs/node-gyp/commit/af35b2ad32)] - Move VC++ Build Tools to Build Tools landing page. (Andrew Pardoe) [#953](https://github.com/nodejs/node-gyp/pull/953) -* [[`f31482e226`](https://github.com/nodejs/node-gyp/commit/f31482e226)] - **win**: work around __pfnDliNotifyHook2 type change (Alexis Campailla) [#952](https://github.com/nodejs/node-gyp/pull/952) -* [[`3df8222fa5`](https://github.com/nodejs/node-gyp/commit/3df8222fa5)] - Allow for npmlog@3.x (Rebecca Turner) [#950](https://github.com/nodejs/node-gyp/pull/950) -* [[`a4fa07b390`](https://github.com/nodejs/node-gyp/commit/a4fa07b390)] - More verbose error on locating msbuild.exe failure. (Mateusz Jaworski) [#930](https://github.com/nodejs/node-gyp/pull/930) -* [[`4ee31329e0`](https://github.com/nodejs/node-gyp/commit/4ee31329e0)] - **doc**: add command options to README.md (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) -* [[`c8c7ca86b9`](https://github.com/nodejs/node-gyp/commit/c8c7ca86b9)] - Add --silent option for zero output. (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) -* [[`ac29d23a7c`](https://github.com/nodejs/node-gyp/commit/ac29d23a7c)] - Upgrade to glob@7.0.3. (Ben Noordhuis) [#943](https://github.com/nodejs/node-gyp/pull/943) -* [[`15fd56be3d`](https://github.com/nodejs/node-gyp/commit/15fd56be3d)] - Enable V8 deprecation warnings for native modules (Matt Loring) [#920](https://github.com/nodejs/node-gyp/pull/920) -* [[`7f1c1b960c`](https://github.com/nodejs/node-gyp/commit/7f1c1b960c)] - **gyp**: improvements for android generator (Robert Chiras) [#935](https://github.com/nodejs/node-gyp/pull/935) -* [[`088082766c`](https://github.com/nodejs/node-gyp/commit/088082766c)] - Update Windows install instructions (Sara Itani) [#867](https://github.com/nodejs/node-gyp/pull/867) -* [[`625c1515f9`](https://github.com/nodejs/node-gyp/commit/625c1515f9)] - **gyp**: inherit CC/CXX for CC/CXX.host (Johan Bergström) [#908](https://github.com/nodejs/node-gyp/pull/908) -* [[`3bcb1720e4`](https://github.com/nodejs/node-gyp/commit/3bcb1720e4)] - Add support for the Python launcher on Windows (Patrick Westerhoff) [#894](https://github.com/nodejs/node-gyp/pull/894 - -## v3.3.1 2016-03-04 - -* [[`a981ef847a`](https://github.com/nodejs/node-gyp/commit/a981ef847a)] - **gyp**: fix android generator (Robert Chiras) [#889](https://github.com/nodejs/node-gyp/pull/889) - -## v3.3.0 2016-02-16 - -* [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) -* [[`d1e4cc4b62`](https://github.com/nodejs/node-gyp/commit/d1e4cc4b62)] - **(SEMVER-MINOR)** Download headers tarball for ~0.12.10 || ~0.10.42 (Rod Vagg) [#877](https://github.com/nodejs/node-gyp/pull/877) -* [[`6e28ad1bea`](https://github.com/nodejs/node-gyp/commit/6e28ad1bea)] - Allow for npmlog@2.x (Rebecca Turner) [#861](https://github.com/nodejs/node-gyp/pull/861) -* [[`07371e5812`](https://github.com/nodejs/node-gyp/commit/07371e5812)] - Use -fPIC for NetBSD. (Marcin Cieślak) [#856](https://github.com/nodejs/node-gyp/pull/856) -* [[`8c4b0ffa50`](https://github.com/nodejs/node-gyp/commit/8c4b0ffa50)] - **(SEMVER-MINOR)** Add --cafile command line option. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) -* [[`b3ad43498e`](https://github.com/nodejs/node-gyp/commit/b3ad43498e)] - **(SEMVER-MINOR)** Make download() function testable. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) - -## v3.2.1 2015-12-03 - -* [[`ab89b477c4`](https://github.com/nodejs/node-gyp/commit/ab89b477c4)] - Upgrade gyp to b3cef02. (Ben Noordhuis) [#831](https://github.com/nodejs/node-gyp/pull/831) -* [[`90078ecb17`](https://github.com/nodejs/node-gyp/commit/90078ecb17)] - Define WIN32_LEAN_AND_MEAN conditionally. (Ben Noordhuis) [#824](https://github.com/nodejs/node-gyp/pull/824) - -## v3.2.0 2015-11-25 - -* [[`268f1ca4c7`](https://github.com/nodejs/node-gyp/commit/268f1ca4c7)] - Use result of `which` when searching for python. (Refael Ackermann) [#668](https://github.com/nodejs/node-gyp/pull/668) -* [[`817ed9bd78`](https://github.com/nodejs/node-gyp/commit/817ed9bd78)] - Add test for python executable search logic. (Ben Noordhuis) [#756](https://github.com/nodejs/node-gyp/pull/756) -* [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) -* [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) -* [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) -* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) - -## v3.1.0 2015-11-14 - -* [[`9049241f91`](https://github.com/nodejs/node-gyp/commit/9049241f91)] - **gyp**: don't use links at all, just copy the files instead (Nathan Zadoks) -* [[`8ef90348d1`](https://github.com/nodejs/node-gyp/commit/8ef90348d1)] - **gyp**: apply https://codereview.chromium.org/11361103/ (Nathan Rajlich) -* [[`a2ed0df84e`](https://github.com/nodejs/node-gyp/commit/a2ed0df84e)] - **gyp**: always install into $PRODUCT_DIR (Nathan Rajlich) -* [[`cc8b2fa83e`](https://github.com/nodejs/node-gyp/commit/cc8b2fa83e)] - Update gyp to b3cef02. (Imran Iqbal) [#781](https://github.com/nodejs/node-gyp/pull/781) -* [[`f5d86eb84e`](https://github.com/nodejs/node-gyp/commit/f5d86eb84e)] - Update to tar@2.0.0. (Edgar Muentes) [#797](https://github.com/nodejs/node-gyp/pull/797) -* [[`2ac7de02c4`](https://github.com/nodejs/node-gyp/commit/2ac7de02c4)] - Fix infinite loop with zero-length options. (Ben Noordhuis) [#745](https://github.com/nodejs/node-gyp/pull/745) -* [[`101bed639b`](https://github.com/nodejs/node-gyp/commit/101bed639b)] - This platform value came from debian package, and now the value (Jérémy Lal) [#738](https://github.com/nodejs/node-gyp/pull/738) - -## v3.0.3 2015-09-14 - -* [[`ad827cda30`](https://github.com/nodejs/node-gyp/commit/ad827cda30)] - tarballUrl global and && when checking for iojs (Lars-Magnus Skog) [#729](https://github.com/nodejs/node-gyp/pull/729) - -## v3.0.2 2015-09-12 - -* [[`6e8c3bf3c6`](https://github.com/nodejs/node-gyp/commit/6e8c3bf3c6)] - add back support for passing additional cmdline args (Rod Vagg) [#723](https://github.com/nodejs/node-gyp/pull/723) -* [[`ff82f2f3b9`](https://github.com/nodejs/node-gyp/commit/ff82f2f3b9)] - fixed broken link in docs to Visual Studio 2013 download (simon-p-r) [#722](https://github.com/nodejs/node-gyp/pull/722) - -## v3.0.1 2015-09-08 - -* [[`846337e36b`](https://github.com/nodejs/node-gyp/commit/846337e36b)] - normalise versions for target == this comparison (Rod Vagg) [#716](https://github.com/nodejs/node-gyp/pull/716) - -## v3.0.0 2015-09-08 - -* [[`9720d0373c`](https://github.com/nodejs/node-gyp/commit/9720d0373c)] - remove node_modules from tree (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`6dcf220db7`](https://github.com/nodejs/node-gyp/commit/6dcf220db7)] - test version major directly, don't use semver.satisfies() (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`938dd18d1c`](https://github.com/nodejs/node-gyp/commit/938dd18d1c)] - refactor for clarity, fix dist-url, add env var dist-url functionality (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`9e9df66a06`](https://github.com/nodejs/node-gyp/commit/9e9df66a06)] - use process.release, make aware of io.js & node v4 differences (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) -* [[`1ea7ed01f4`](https://github.com/nodejs/node-gyp/commit/1ea7ed01f4)] - **deps**: update graceful-fs dependency to the latest (Sakthipriyan Vairamani) [#714](https://github.com/nodejs/node-gyp/pull/714) -* [[`0fbc387b35`](https://github.com/nodejs/node-gyp/commit/0fbc387b35)] - Update repository URLs. (Ben Noordhuis) [#715](https://github.com/nodejs/node-gyp/pull/715) -* [[`bbedb8868b`](https://github.com/nodejs/node-gyp/commit/bbedb8868b)] - **(SEMVER-MAJOR)** **win**: enable delay-load hook by default (Jeremiah Senkpiel) [#708](https://github.com/nodejs/node-gyp/pull/708) -* [[`85ed107565`](https://github.com/nodejs/node-gyp/commit/85ed107565)] - Merge pull request #664 from othiym23/othiym23/allow-semver-5 (Nathan Rajlich) -* [[`0c720d234c`](https://github.com/nodejs/node-gyp/commit/0c720d234c)] - allow semver@5 (Forrest L Norvell) - -## 2.0.2 / 2015-07-14 - - * Use HTTPS for dist url (#656, @SonicHedgehog) - * Merge pull request #648 from nevosegal/master - * Merge pull request #650 from magic890/patch-1 - * Updated Installation section on README - * Updated link to gyp user documentation - * Fix download error message spelling (#643, @tomxtobin) - * Merge pull request #637 from lygstate/master - * Set NODE_GYP_DIR for addon.gypi to setting absolute path for - src/win_delay_load_hook.c, and fixes of the long relative path issue on Win32. - Fixes #636 (#637, @lygstate). - -## 2.0.1 / 2015-05-28 - - * configure: try/catch the semver range.test() call - * README: update for visual studio 2013 (#510, @samccone) - -## 2.0.0 / 2015-05-24 - - * configure: check for python2 executable by default, fallback to python - * configure: don't clobber existing $PYTHONPATH - * configure: use "path-array" for PYTHONPATH - * gyp: fix for non-acsii userprofile name on Windows - * gyp: always install into $PRODUCT_DIR - * gyp: apply https://codereview.chromium.org/11361103/ - * gyp: don't use links at all, just copy the files instead - * gyp: update gyp to e1c8fcf7 - * Updated README.md with updated Windows build info - * Show URL when a download fails - * package: add a "license" field - * move HMODULE m declaration to top - * Only add "-undefined dynamic_lookup" to loadable_module targets - * win: optionally allow node.exe/iojs.exe to be renamed - * Avoid downloading shasums if using tarPath - * Add target name preprocessor define: `NODE_GYP_MODULE_NAME` - * Show better error message in case of bad network settings diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/CONTRIBUTING.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/CONTRIBUTING.md deleted file mode 100644 index c1c50eab4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/CONTRIBUTING.md +++ /dev/null @@ -1,34 +0,0 @@ -# Contributing to node-gyp - -## Code of Conduct - -Please read the -[Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) -which explains the minimum behavior expectations for node-gyp contributors. - - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/LICENSE b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/LICENSE deleted file mode 100644 index 2ea4dc5ef..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/README.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/README.md deleted file mode 100644 index 7636ad548..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/README.md +++ /dev/null @@ -1,258 +0,0 @@ -# `node-gyp` - Node.js native addon build tool - -[![Build Status](https://github.com/nodejs/node-gyp/workflows/Tests/badge.svg?branch=master)](https://github.com/nodejs/node-gyp/actions?query=workflow%3ATests+branch%3Amaster) -![npm](https://img.shields.io/npm/dm/node-gyp) - -`node-gyp` is a cross-platform command-line tool written in Node.js for -compiling native addon modules for Node.js. It contains a vendored copy of the -[gyp-next](https://github.com/nodejs/gyp-next) project that was previously used -by the Chromium team, extended to support the development of Node.js native addons. - -Note that `node-gyp` is _not_ used to build Node.js itself. - -Multiple target versions of Node.js are supported (i.e. `0.8`, ..., `4`, `5`, `6`, -etc.), regardless of what version of Node.js is actually installed on your system -(`node-gyp` downloads the necessary development files or headers for the target version). - -## Features - - * The same build commands work on any of the supported platforms - * Supports the targeting of different versions of Node.js - -## Installation - -You can install `node-gyp` using `npm`: - -``` bash -npm install -g node-gyp -``` - -Depending on your operating system, you will need to install: - -### On Unix - - * Python v3.7, v3.8, v3.9, or v3.10 - * `make` - * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org) - -### On macOS - -**ATTENTION**: If your Mac has been _upgraded_ to macOS Catalina (10.15) or higher, please read [macOS_Catalina.md](macOS_Catalina.md). - - * Python v3.7, v3.8, v3.9, or v3.10 - * `XCode Command Line Tools` which will install `clang`, `clang++`, and `make`. - * Install the `XCode Command Line Tools` standalone by running `xcode-select --install`. -- OR -- - * Alternatively, if you already have the [full Xcode installed](https://developer.apple.com/xcode/download/), you can install the Command Line Tools under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. - - -### On Windows - -Install the current version of Python from the [Microsoft Store package](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5). - -Install tools and configuration manually: - * Install Visual C++ Build Environment: [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools) - (using "Visual C++ build tools" workload) or [Visual Studio Community](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) - (using the "Desktop development with C++" workload) - * Launch cmd, `npm config set msvs_version 2017` - - If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips. - - To target native ARM64 Node.js on Windows 10 on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64". - -### Configuring Python Dependency - -`node-gyp` requires that you have installed a compatible version of Python, one of: v3.7, v3.8, -v3.9, or v3.10. If you have multiple Python versions installed, you can identify which Python -version `node-gyp` should use in one of the following ways: - -1. by setting the `--python` command-line option, e.g.: - -``` bash -node-gyp --python /path/to/executable/python -``` - -2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of -Python installed, then you can set `npm`'s 'python' config key to the appropriate -value: - -``` bash -npm config set python /path/to/executable/python -``` - -3. If the `PYTHON` environment variable is set to the path of a Python executable, -then that version will be used, if it is a compatible version. - -4. If the `NODE_GYP_FORCE_PYTHON` environment variable is set to the path of a -Python executable, it will be used instead of any of the other configured or -builtin Python search paths. If it's not a compatible version, no further -searching will be done. - -### Build for Third Party Node.js Runtimes - -When building modules for third party Node.js runtimes like Electron, which have -different build configurations from the official Node.js distribution, you -should use `--dist-url` or `--nodedir` flags to specify the headers of the -runtime to build for. - -Also when `--dist-url` or `--nodedir` flags are passed, node-gyp will use the -`config.gypi` shipped in the headers distribution to generate build -configurations, which is different from the default mode that would use the -`process.config` object of the running Node.js instance. - -Some old versions of Electron shipped malformed `config.gypi` in their headers -distributions, and you might need to pass `--force-process-config` to node-gyp -to work around configuration errors. - -## How to Use - -To compile your native addon, first go to its root directory: - -``` bash -cd my_node_addon -``` - -The next step is to generate the appropriate project build files for the current -platform. Use `configure` for that: - -``` bash -node-gyp configure -``` - -Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015` -needs to be added (not needed when run by npm as configured above): -``` bash -node-gyp configure --msvs_version=2015 -``` - -__Note__: The `configure` step looks for a `binding.gyp` file in the current -directory to process. See below for instructions on creating a `binding.gyp` file. - -Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file -(on Windows) in the `build/` directory. Next, invoke the `build` command: - -``` bash -node-gyp build -``` - -Now you have your compiled `.node` bindings file! The compiled bindings end up -in `build/Debug/` or `build/Release/`, depending on the build mode. At this point, -you can require the `.node` file with Node.js and run your tests! - -__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or -`-d`) switch when running either the `configure`, `build` or `rebuild` commands. - -## The `binding.gyp` file - -A `binding.gyp` file describes the configuration to build your module, in a -JSON-like format. This file gets placed in the root of your package, alongside -`package.json`. - -A barebones `gyp` file appropriate for building a Node.js addon could look like: - -```python -{ - "targets": [ - { - "target_name": "binding", - "sources": [ "src/binding.cc" ] - } - ] -} -``` - -## Further reading - -The **[docs](./docs/)** directory contains additional documentation on specific node-gyp topics that may be useful if you are experiencing problems installing or building addons using node-gyp. - -Some additional resources for Node.js native addons and writing `gyp` configuration files: - - * ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative) - * ["Hello World" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world) - * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md) - * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md) - * [*"binding.gyp" files out in the wild* wiki page](./docs/binding.gyp-files-in-the-wild.md) - -## Commands - -`node-gyp` responds to the following commands: - -| **Command** | **Description** -|:--------------|:--------------------------------------------------------------- -| `help` | Shows the help dialog -| `build` | Invokes `make`/`msbuild.exe` and builds the native addon -| `clean` | Removes the `build` directory if it exists -| `configure` | Generates project build files for the current platform -| `rebuild` | Runs `clean`, `configure` and `build` all in a row -| `install` | Installs Node.js header files for the given version -| `list` | Lists the currently installed Node.js header versions -| `remove` | Removes the Node.js header files for the given version - - -## Command Options - -`node-gyp` accepts the following command options: - -| **Command** | **Description** -|:----------------------------------|:------------------------------------------ -| `-j n`, `--jobs n` | Run `make` in parallel. The value `max` will use all available CPU cores -| `--target=v6.2.1` | Node.js version to build for (default is `process.version`) -| `--silly`, `--loglevel=silly` | Log all progress to console -| `--verbose`, `--loglevel=verbose` | Log most progress to console -| `--silent`, `--loglevel=silent` | Don't log anything to console -| `debug`, `--debug` | Make Debug build (default is `Release`) -| `--release`, `--no-debug` | Make Release build -| `-C $dir`, `--directory=$dir` | Run command in different directory -| `--make=$make` | Override `make` command (e.g. `gmake`) -| `--thin=yes` | Enable thin static libraries -| `--arch=$arch` | Set target architecture (e.g. ia32) -| `--tarball=$path` | Get headers from a local tarball -| `--devdir=$path` | SDK download directory (default is OS cache directory) -| `--ensure` | Don't reinstall headers if already present -| `--dist-url=$url` | Download header tarball from custom URL -| `--proxy=$url` | Set HTTP(S) proxy for downloading header tarball -| `--noproxy=$urls` | Set urls to ignore proxies when downloading header tarball -| `--cafile=$cafile` | Override default CA chain (to download tarball) -| `--nodedir=$path` | Set the path to the node source code -| `--python=$path` | Set path to the Python binary -| `--msvs_version=$version` | Set Visual Studio version (Windows only) -| `--solution=$solution` | Set Visual Studio Solution version (Windows only) -| `--force-process-config` | Force using runtime's `process.config` object to generate `config.gypi` file - -## Configuration - -### Environment variables - -Use the form `npm_config_OPTION_NAME` for any of the command options listed -above (dashes in option names should be replaced by underscores). - -For example, to set `devdir` equal to `/tmp/.gyp`, you would: - -Run this on Unix: - -```bash -export npm_config_devdir=/tmp/.gyp -``` - -Or this on Windows: - -```console -set npm_config_devdir=c:\temp\.gyp -``` - -### `npm` configuration - -Use the form `OPTION_NAME` for any of the command options listed above. - -For example, to set `devdir` equal to `/tmp/.gyp`, you would run: - -```bash -npm config set [--global] devdir /tmp/.gyp -``` - -**Note:** Configuration set via `npm` will only be used when `node-gyp` -is run via `npm`, not when `node-gyp` is run directly. - -## License - -`node-gyp` is available under the MIT license. See the [LICENSE -file](LICENSE) for details. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/SECURITY.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/SECURITY.md deleted file mode 100644 index 1e168d76e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/SECURITY.md +++ /dev/null @@ -1,2 +0,0 @@ -If you believe you have found a security issue in the software in this -repository, please consult https://github.com/nodejs/node/blob/HEAD/SECURITY.md. \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi deleted file mode 100644 index b4ac369ac..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi +++ /dev/null @@ -1,204 +0,0 @@ -{ - 'variables' : { - 'node_engine_include_dir%': 'deps/v8/include', - 'node_host_binary%': 'node', - 'node_with_ltcg%': 'true', - }, - 'target_defaults': { - 'type': 'loadable_module', - 'win_delay_load_hook': 'true', - 'product_prefix': '', - - 'conditions': [ - [ 'node_engine=="chakracore"', { - 'variables': { - 'node_engine_include_dir%': 'deps/chakrashim/include' - }, - }] - ], - - 'include_dirs': [ - '<(node_root_dir)/include/node', - '<(node_root_dir)/src', - '<(node_root_dir)/deps/openssl/config', - '<(node_root_dir)/deps/openssl/openssl/include', - '<(node_root_dir)/deps/uv/include', - '<(node_root_dir)/deps/zlib', - '<(node_root_dir)/<(node_engine_include_dir)' - ], - 'defines!': [ - 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. - 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. - ], - 'defines': [ - 'NODE_GYP_MODULE_NAME=>(_target_name)', - 'USING_UV_SHARED=1', - 'USING_V8_SHARED=1', - # Warn when using deprecated V8 APIs. - 'V8_DEPRECATION_WARNINGS=1' - ], - - 'target_conditions': [ - ['_type=="loadable_module"', { - 'product_extension': 'node', - 'defines': [ - 'BUILDING_NODE_EXTENSION' - ], - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-undefined dynamic_lookup' - ], - }, - }], - - ['_type=="static_library"', { - # set to `1` to *disable* the -T thin archive 'ld' flag. - # older linkers don't support this flag. - 'standalone_static_library': '<(standalone_static_library)' - }], - - ['_type!="executable"', { - 'conditions': [ - [ 'OS=="android"', { - 'cflags!': [ '-fPIE' ], - }] - ] - }], - - ['_win_delay_load_hook=="true"', { - # If the addon specifies `'win_delay_load_hook': 'true'` in its - # binding.gyp, link a delay-load hook into the DLL. This hook ensures - # that the addon will work regardless of whether the node/iojs binary - # is named node.exe, iojs.exe, or something else. - 'conditions': [ - [ 'OS=="win"', { - 'defines': [ 'HOST_BINARY=\"<(node_host_binary)<(EXECUTABLE_SUFFIX)\"', ], - 'sources': [ - '<(node_gyp_dir)/src/win_delay_load_hook.cc', - ], - 'msvs_settings': { - 'VCLinkerTool': { - 'DelayLoadDLLs': [ '<(node_host_binary)<(EXECUTABLE_SUFFIX)' ], - # Don't print a linker warning when no imports from either .exe - # are used. - 'AdditionalOptions': [ '/ignore:4199' ], - }, - }, - }], - ], - }], - ], - - 'conditions': [ - [ 'OS=="mac"', { - 'defines': [ - '_DARWIN_USE_64_BIT_INODE=1' - ], - 'xcode_settings': { - 'DYLIB_INSTALL_NAME_BASE': '@rpath' - }, - }], - [ 'OS=="aix"', { - 'ldflags': [ - '-Wl,-bimport:<(node_exp_file)' - ], - }], - [ 'OS=="os400"', { - 'ldflags': [ - '-Wl,-bimport:<(node_exp_file)' - ], - }], - [ 'OS=="zos"', { - 'conditions': [ - [ '"' - # needs to have dll-interface to be used by - # clients of class 'node::ObjectWrap' - 4251 - ], - }, { - # OS!="win" - 'defines': [ - '_LARGEFILE_SOURCE', - '_FILE_OFFSET_BITS=64' - ], - }], - [ 'OS in "freebsd openbsd netbsd solaris android" or \ - (OS=="linux" and target_arch!="ia32")', { - 'cflags': [ '-fPIC' ], - }], - ] - } -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/bin/node-gyp.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/bin/node-gyp.js deleted file mode 100755 index 8652ea21e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/bin/node-gyp.js +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -process.title = 'node-gyp' - -const envPaths = require('env-paths') -const gyp = require('../') -const log = require('npmlog') -const os = require('os') - -/** - * Process and execute the selected commands. - */ - -const prog = gyp() -var completed = false -prog.parseArgv(process.argv) -prog.devDir = prog.opts.devdir - -var homeDir = os.homedir() -if (prog.devDir) { - prog.devDir = prog.devDir.replace(/^~/, homeDir) -} else if (homeDir) { - prog.devDir = envPaths('node-gyp', { suffix: '' }).cache -} else { - throw new Error( - "node-gyp requires that the user's home directory is specified " + - 'in either of the environmental variables HOME or USERPROFILE. ' + - 'Overide with: --devdir /path/to/.node-gyp') -} - -if (prog.todo.length === 0) { - if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) { - console.log('v%s', prog.version) - } else { - console.log('%s', prog.usage()) - } - process.exit(0) -} - -log.info('it worked if it ends with', 'ok') -log.verbose('cli', process.argv) -log.info('using', 'node-gyp@%s', prog.version) -log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch) - -/** - * Change dir if -C/--directory was passed. - */ - -var dir = prog.opts.directory -if (dir) { - var fs = require('fs') - try { - var stat = fs.statSync(dir) - if (stat.isDirectory()) { - log.info('chdir', dir) - process.chdir(dir) - } else { - log.warn('chdir', dir + ' is not a directory') - } - } catch (e) { - if (e.code === 'ENOENT') { - log.warn('chdir', dir + ' is not a directory') - } else { - log.warn('chdir', 'error during chdir() "%s"', e.message) - } - } -} - -function run () { - var command = prog.todo.shift() - if (!command) { - // done! - completed = true - log.info('ok') - return - } - - prog.commands[command.name](command.args, function (err) { - if (err) { - log.error(command.name + ' error') - log.error('stack', err.stack) - errorMessage() - log.error('not ok') - return process.exit(1) - } - if (command.name === 'list') { - var versions = arguments[1] - if (versions.length > 0) { - versions.forEach(function (version) { - console.log(version) - }) - } else { - console.log('No node development files installed. Use `node-gyp install` to install a version.') - } - } else if (arguments.length >= 2) { - console.log.apply(console, [].slice.call(arguments, 1)) - } - - // now run the next command in the queue - process.nextTick(run) - }) -} - -process.on('exit', function (code) { - if (!completed && !code) { - log.error('Completion callback never invoked!') - issueMessage() - process.exit(6) - } -}) - -process.on('uncaughtException', function (err) { - log.error('UNCAUGHT EXCEPTION') - log.error('stack', err.stack) - issueMessage() - process.exit(7) -}) - -function errorMessage () { - // copied from npm's lib/utils/error-handler.js - var os = require('os') - log.error('System', os.type() + ' ' + os.release()) - log.error('command', process.argv - .map(JSON.stringify).join(' ')) - log.error('cwd', process.cwd()) - log.error('node -v', process.version) - log.error('node-gyp -v', 'v' + prog.package.version) -} - -function issueMessage () { - errorMessage() - log.error('', ['Node-gyp failed to build your package.', - 'Try to update npm and/or node-gyp and if it does not help file an issue with the package author.' - ].join('\n')) -} - -// start running the given commands! -run() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Error-pre-versions-of-node-cannot-be-installed.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Error-pre-versions-of-node-cannot-be-installed.md deleted file mode 100644 index c1e1158d7..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Error-pre-versions-of-node-cannot-be-installed.md +++ /dev/null @@ -1,94 +0,0 @@ -When using `node-gyp` you might see an error like this when attempting to compile/install a node.js native addon: - -``` -$ npm install bcrypt -npm http GET https://registry.npmjs.org/bcrypt/0.7.5 -npm http 304 https://registry.npmjs.org/bcrypt/0.7.5 -npm http GET https://registry.npmjs.org/bindings/1.0.0 -npm http 304 https://registry.npmjs.org/bindings/1.0.0 - -> bcrypt@0.7.5 install /home/ubuntu/public/song-swap/node_modules/bcrypt -> node-gyp rebuild - -gyp ERR! configure error -gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead -gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:69:16) -gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:56:37) -gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:219:20) -gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:105:9 -gyp ERR! stack at ChildProcess.exithandler (child_process.js:630:7) -gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17) -gyp ERR! stack at maybeClose (child_process.js:730:16) -gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:5) -gyp ERR! System Linux 3.5.0-21-generic -gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" -gyp ERR! cwd /home/ubuntu/public/song-swap/node_modules/bcrypt -gyp ERR! node -v v0.11.2-pre -gyp ERR! node-gyp -v v0.9.5 -gyp ERR! not ok -npm ERR! bcrypt@0.7.5 install: `node-gyp rebuild` -npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1 -npm ERR! -npm ERR! Failed at the bcrypt@0.7.5 install script. -npm ERR! This is most likely a problem with the bcrypt package, -npm ERR! not with npm itself. -npm ERR! Tell the author that this fails on your system: -npm ERR! node-gyp rebuild -npm ERR! You can get their info via: -npm ERR! npm owner ls bcrypt -npm ERR! There is likely additional logging output above. - -npm ERR! System Linux 3.5.0-21-generic -npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "bcrypt" -npm ERR! cwd /home/ubuntu/public/song-swap -npm ERR! node -v v0.11.2-pre -npm ERR! npm -v 1.2.18 -npm ERR! code ELIFECYCLE -npm ERR! -npm ERR! Additional logging details can be found in: -npm ERR! /home/ubuntu/public/song-swap/npm-debug.log -npm ERR! not ok code 0 -``` - -The main error here is: - -``` -Error: "pre" versions of node cannot be installed, use the --nodedir flag instead -``` - -This error is caused when you attempt to compile a native addon using a version of node.js with `-pre` at the end of the version number: - -``` bash -$ node -v -v0.10.4-pre -``` - -## How to avoid (the short answer) - -To avoid this error completely just use a stable release of node.js. i.e. `v0.10.4`, and __not__ `v0.10.4-pre`. - -## How to fix (the long answer) - -This error happens because `node-gyp` does not know what header files were used to compile your "pre" version of node, and therefore it needs you to specify the node source code directory path using the `--nodedir` flag. - -For example, if I compiled my development ("pre") version of node.js using the source code in `/Users/nrajlich/node`, then I could invoke `node-gyp` like: - -``` bash -$ node-gyp rebuild --nodedir=/Users/nrajlich/node -``` - -Or install an native addon through `npm` like: - -``` bash -$ npm install bcrypt --nodedir=/Users/nrajlich/node -``` - -### Always use `--nodedir` - -__Note:__ This is for advanced users who use `-pre` versions of node more often than tagged releases. - -If you're invoking `node-gyp` through `npm`, then you can leverage `npm`'s configuration system and not have to specify the `--nodedir` flag all the time: - -``` bash -$ npm config set nodedir /Users/nrajlich/node -``` \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Force-npm-to-use-global-node-gyp.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Force-npm-to-use-global-node-gyp.md deleted file mode 100644 index c6304e490..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Force-npm-to-use-global-node-gyp.md +++ /dev/null @@ -1,47 +0,0 @@ -# Force npm to use global installed node-gyp - -**Note: These instructions only work with npm 6 or older. For a solution that works with npm 8 (or older), see [Updating-npm-bundled-node-gyp.md](Updating-npm-bundled-node-gyp.md).** - -[Many issues](https://github.com/nodejs/node-gyp/labels/ERR%21%20node-gyp%20-v%20%3C%3D%20v5.1.0) are opened by users who are -not running a [current version of node-gyp](https://github.com/nodejs/node-gyp/releases). - -npm bundles its own, internal, copy of node-gyp located at `npm/node_modules`, within npm's private dependencies which are separate from *globally* accessible packages. Therefore this internal copy of node-gyp is independent from any globally installed copy of node-gyp that -may have been installed via `npm install -g node-gyp`. - -So npm's internal copy of node-gyp **isn't** stored inside *global* `node_modules` and thus isn't available for use as a standalone package. npm uses it's *internal* copy of `node-gyp` to automatically build native addons. - -When you install a _new_ version of node-gyp outside of npm, it'll go into your *global* `node_modules`, but not under the `npm/node_modules` (where internal copy of node-gyp is stored). So it will get into your `$PATH` and you will be able to use this globally installed version (**but not internal node-gyp of npm**) as any other globally installed package. - -The catch is that npm **won't** use global version unless you tell it to, it'll keep on using the **internal one**. You need to instruct it to by setting the `node_gyp` config variable (which goes into your `~/.npmrc`). You do this by running the `npm config set` command as below. Then npm will use the command in the path you supply whenever it needs to build a native addon. - -**Important**: You also need to remember to unset this when you upgrade npm with a newer version of node-gyp, or you have to manually keep your globally installed node-gyp to date. See "Undo" below. - -## Linux and macOS -``` -npm install --global node-gyp@latest -npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js -``` - -`sudo` may be required for the first command if you get a permission error. - -## Windows - -### Windows Command Prompt -``` -npm install --global node-gyp@latest -for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js" -``` - -### Powershell -``` -npm install --global node-gyp@latest -npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"} -``` - -## Undo -**Beware** if you don't unset the `node_gyp` config option, npm will continue to use the globally installed version of node-gyp rather than the one it ships with, which may end up being newer. - -``` -npm config delete node_gyp -npm uninstall --global node-gyp -``` diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Home.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Home.md deleted file mode 100644 index fe099868b..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Home.md +++ /dev/null @@ -1,7 +0,0 @@ -Welcome to the node-gyp wiki! - - * [["binding.gyp" files out in the wild]] - * [[Linking to OpenSSL]] - * [[Common Issues]] - * [[Updating npm's bundled node-gyp]] - * [[Error: "pre" versions of node cannot be installed]] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Linking-to-OpenSSL.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Linking-to-OpenSSL.md deleted file mode 100644 index ec8092999..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Linking-to-OpenSSL.md +++ /dev/null @@ -1,86 +0,0 @@ -A handful of native addons require linking to OpenSSL in one way or another. This introduces a small challenge since node will sometimes bundle OpenSSL statically (the default for node >= v0.8.x), or sometimes dynamically link to the system OpenSSL (default for node <= v0.6.x). - -Good native addons should account for both scenarios. It's recommended that you use the `binding.gyp` file provided below as a starting-point for any addon that needs to use OpenSSL: - -``` python -{ - 'variables': { - # node v0.6.x doesn't give us its build variables, - # but on Unix it was only possible to use the system OpenSSL library, - # so default the variable to "true", v0.8.x node and up will overwrite it. - 'node_shared_openssl%': 'true' - }, - 'targets': [ - { - 'target_name': 'binding', - 'sources': [ - 'src/binding.cc' - ], - 'conditions': [ - ['node_shared_openssl=="false"', { - # so when "node_shared_openssl" is "false", then OpenSSL has been - # bundled into the node executable. So we need to include the same - # header files that were used when building node. - 'include_dirs': [ - '<(node_root_dir)/deps/openssl/openssl/include' - ], - "conditions" : [ - ["target_arch=='ia32'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] - }], - ["target_arch=='x64'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] - }], - ["target_arch=='arm'", { - "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] - }] - ] - }] - ] - } - ] -} -``` - -This ensures that when OpenSSL is statically linked into `node` then, the bundled OpenSSL headers are included, but when the system OpenSSL is in use, then only those headers will be used. - -## Windows? - -As you can see this baseline `binding.gyp` file only accounts for the Unix scenario. Currently on Windows the situation is a little less ideal. On Windows, OpenSSL is _always_ statically compiled into the `node` executable, so ideally it would be possible to use that copy of OpenSSL when building native addons. - -Unfortunately it doesn't seem like that is possible at the moment, as there would need to be tweaks made to the generated `node.lib` file to include the openssl glue functions, or a new `openssl.lib` file would need to be created during the node build. I'm not sure which is the easiest/most feasible. - -In the meantime, one possible solution is using another copy of OpenSSL, which is what [`node-bcrypt`](https://github.com/ncb000gt/node.bcrypt.js) currently does. Adding something like this to your `binding.gyp` file's `"conditions"` block would enable this: - -``` python - [ 'OS=="win"', { - 'conditions': [ - # "openssl_root" is the directory on Windows of the OpenSSL files. - # Check the "target_arch" variable to set good default values for - # both 64-bit and 32-bit builds of the module. - ['target_arch=="x64"', { - 'variables': { - 'openssl_root%': 'C:/OpenSSL-Win64' - }, - }, { - 'variables': { - 'openssl_root%': 'C:/OpenSSL-Win32' - }, - }], - ], - 'libraries': [ - '-l<(openssl_root)/lib/libeay32.lib', - ], - 'include_dirs': [ - '<(openssl_root)/include', - ], - }] -``` - -Now you can direct your users to install OpenSSL on Windows from here (be sure to tell them to install the 64-bit version if they're compiling against a 64-bit version of node): http://slproweb.com/products/Win32OpenSSL.html - -Also note that both `node-gyp` and `npm` allow you to overwrite that default `openssl_root` variable on the command line: - -``` bash -$ node-gyp rebuild --openssl-root="C:\Users\Nathan\Desktop\openssl" -``` \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/README.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/README.md deleted file mode 100644 index 702796090..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/README.md +++ /dev/null @@ -1,11 +0,0 @@ -## Versions of `node-gyp` that are earlier than v9.x.x - -Please look thru your error log for the string `gyp info using node-gyp@` and if that version number is less than the [current release of node-gyp](https://github.com/nodejs/node-gyp/releases) then __please upgrade__ using [these instructions](https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md) and then try your command again. - -## `node-sass` is deprecated - -Please be aware that the package [`node-sass` is deprecated](https://github.com/sass/node-sass#node-sass) so you should actively seek alternatives. Please avoid opening new `node-sass` issues on this repo. You can try `npm install --global node-sass@latest` but we [cannot help much](https://github.com/nodejs/node-gyp/issues?q=is%3Aissue+label%3A%22Node+Sass+--%3E+Dart+Sass%22+) here. - -## Issues finding the installed Visual Studio - -In cmd, [`npm config set msvs_version 20xx`](https://github.com/nodejs/node-gyp#on-windows) with ___xx___ matching your locally installed version of Visual Studio. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md deleted file mode 100644 index 5759add3f..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md +++ /dev/null @@ -1,72 +0,0 @@ -# Updating the npm-bundled version of node-gyp - -**Note: These instructions are (only) tested and known to work with npm 8 and older.** - -**Note: These instructions will be undone if you reinstall or upgrade npm or node! For a more permanent (and simpler) solution, see [Force-npm-to-use-global-node-gyp.md](Force-npm-to-use-global-node-gyp.md). (npm 6 or older only!)** - -[Many issues](https://github.com/nodejs/node-gyp/issues?q=label%3A"ERR!+node-gyp+-v+<%3D+v9.x.x") are opened by users who are -not running a [current version of node-gyp](https://github.com/nodejs/node-gyp/releases). - -`npm` bundles its own, internal, copy of `node-gyp`. This internal copy is independent of any globally installed copy of node-gyp that -may have been installed via `npm install -g node-gyp`. - -This means that while `node-gyp` doesn't get installed into your `$PATH` by default, npm still keeps its own copy to invoke when you -attempt to `npm install` a native add-on. - -Sometimes, you may need to update npm's internal node-gyp to a newer version than what is installed. A simple `npm install -g node-gyp` -_won't_ do the trick since npm will still continue to use its internal copy over the global one. - -So instead: - -## Version of npm - -We need to start by knowing your version of `npm`: -```bash -npm --version -``` - -## Linux, macOS, Solaris, etc. - -Unix is easy. Just run the following command. - -If your npm is version ___7 or 8___, do: -```bash -$ npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest -``` - -Else if your npm is version ___less than 7___, do: -```bash -$ npm explore npm/node_modules/npm-lifecycle -g -- npm install node-gyp@latest -``` - -If the command fails with a permissions error, please try `sudo` and then the command. - -## Windows - -Windows is a bit trickier, since `npm` might be installed to the "Program Files" directory, which needs admin privileges in order to -modify on current Windows. Therefore, run the following commands __inside a `cmd.exe` started with "Run as Administrator"__: - -First we need to find the location of `node`. If you don't already know the location that `node.exe` got installed to, then run: -```bash -$ where node -``` - -Now `cd` to the directory that `node.exe` is contained in e.g.: -```bash -$ cd "C:\Program Files\nodejs" -``` - -If your npm version is ___7 or 8___, do: -```bash -cd node_modules\npm\node_modules\@npmcli\run-script -``` - -Else if your npm version is ___less than 7___, do: -```bash -cd node_modules\npm\node_modules\npm-lifecycle -``` - -Finish by running: -```bash -$ npm install node-gyp@latest -``` diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/binding.gyp-files-in-the-wild.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/binding.gyp-files-in-the-wild.md deleted file mode 100644 index 795d2fd2e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/docs/binding.gyp-files-in-the-wild.md +++ /dev/null @@ -1,49 +0,0 @@ -This page contains links to some examples of existing `binding.gyp` files that other node modules are using. Take a look at them for inspiration. - -To add to this page, just add the link to the project's `binding.gyp` file below: - - * [ons](https://github.com/XadillaX/aliyun-ons/blob/master/binding.gyp) - * [thmclrx](https://github.com/XadillaX/thmclrx/blob/master/binding.gyp) - * [libxmljs](https://github.com/polotek/libxmljs/blob/master/binding.gyp) - * [node-buffertools](https://github.com/bnoordhuis/node-buffertools/blob/master/binding.gyp) - * [node-canvas](https://github.com/LearnBoost/node-canvas/blob/master/binding.gyp) - * [node-ffi](https://github.com/rbranson/node-ffi/blob/master/binding.gyp) + [libffi](https://github.com/rbranson/node-ffi/blob/master/deps/libffi/libffi.gyp) - * [node-time](https://github.com/TooTallNate/node-time/blob/master/binding.gyp) - * [node-sass](https://github.com/sass/node-sass/blob/master/binding.gyp) + [libsass](https://github.com/sass/node-sass/blob/master/src/libsass.gyp) - * [node-serialport](https://github.com/voodootikigod/node-serialport/blob/master/binding.gyp) - * [node-weak](https://github.com/TooTallNate/node-weak/blob/master/binding.gyp) - * [pty.js](https://github.com/chjj/pty.js/blob/master/binding.gyp) - * [ref](https://github.com/TooTallNate/ref/blob/master/binding.gyp) - * [appjs](https://github.com/milani/appjs/blob/master/binding.gyp) - * [nwm](https://github.com/mixu/nwm/blob/master/binding.gyp) - * [bcrypt](https://github.com/ncb000gt/node.bcrypt.js/blob/master/binding.gyp) - * [nk-mysql](https://github.com/mmod/nodamysql/blob/master/binding.gyp) - * [nk-xrm-installer](https://github.com/mmod/nk-xrm-installer/blob/master/binding.gyp) + [includable.gypi](https://github.com/mmod/nk-xrm-installer/blob/master/includable.gypi) + [unpack.py](https://github.com/mmod/nk-xrm-installer/blob/master/unpack.py) + [disburse.py](https://github.com/mmod/nk-xrm-installer/blob/master/disburse.py) - .py files above provide complete reference for examples of fetching source via http, extracting, and moving files. - * [node-memwatch](https://github.com/lloyd/node-memwatch/blob/master/binding.gyp) - * [node-ip2location](https://github.com/bolgovr/node-ip2location/blob/master/binding.gyp) - * [node-midi](https://github.com/justinlatimer/node-midi/blob/master/binding.gyp) - * [node-sqlite3](https://github.com/developmentseed/node-sqlite3/blob/master/binding.gyp) + [libsqlite3](https://github.com/developmentseed/node-sqlite3/blob/master/deps/sqlite3.gyp) - * [node-zipfile](https://github.com/mapbox/node-zipfile/blob/master/binding.gyp) - * [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/binding.gyp) - * [node-inotify](https://github.com/c4milo/node-inotify/blob/master/binding.gyp) - * [v8-profiler](https://github.com/c4milo/v8-profiler/blob/master/binding.gyp) - * [airtunes](https://github.com/radioline/node_airtunes/blob/master/binding.gyp) - * [node-fann](https://github.com/c4milo/node-fann/blob/master/binding.gyp) - * [node-talib](https://github.com/oransel/node-talib/blob/master/binding.gyp) - * [node-leveldown](https://github.com/rvagg/node-leveldown/blob/master/binding.gyp) + [leveldb.gyp](https://github.com/rvagg/node-leveldown/blob/master/deps/leveldb/leveldb.gyp) + [snappy.gyp](https://github.com/rvagg/node-leveldown/blob/master/deps/snappy/snappy.gyp) - * [node-expat](https://github.com/astro/node-expat/blob/master/binding.gyp) + [libexpat](https://github.com/astro/node-expat/blob/master/deps/libexpat/libexpat.gyp) - * [node-openvg-canvas](https://github.com/luismreis/node-openvg-canvas/blob/master/binding.gyp) + [node-openvg](https://github.com/luismreis/node-openvg/blob/master/binding.gyp) - * [node-cryptopp](https://github.com/BatikhSouri/node-cryptopp/blob/master/binding.gyp) - * [topcube](https://github.com/creationix/topcube/blob/master/binding.gyp) - * [node-osmium](https://github.com/osmcode/node-osmium/blob/master/binding.gyp) - * [node-osrm](https://github.com/DennisOSRM/node-osrm) - * [node-oracle](https://github.com/joeferner/node-oracle/blob/master/binding.gyp) - * [node-process-list](https://github.com/ReklatsMasters/node-process-list/blob/master/binding.gyp) - * [node-nanomsg](https://github.com/nickdesaulniers/node-nanomsg/blob/master/binding.gyp) - * [Ghostscript4JS](https://github.com/NickNaso/ghostscript4js/blob/master/binding.gyp) - * [nodecv](https://github.com/xudafeng/nodecv/blob/master/binding.gyp) - * [magick-cli](https://github.com/NickNaso/magick-cli/blob/master/binding.gyp) - * [sharp](https://github.com/lovell/sharp/blob/master/binding.gyp) - * [krb5](https://github.com/adaltas/node-krb5/blob/master/binding.gyp) - * [node-heapdump](https://github.com/bnoordhuis/node-heapdump/blob/master/binding.gyp) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.flake8 b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.flake8 deleted file mode 100644 index ea0c7680e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.flake8 +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -max-complexity = 101 -max-line-length = 88 -extend-ignore = E203 # whitespace before ':' to agree with psf/black diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml deleted file mode 100644 index aad135027..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml +++ /dev/null @@ -1,36 +0,0 @@ -# TODO: Enable os: windows-latest -# TODO: Enable pytest --doctest-modules - -name: Python_tests -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - workflow_dispatch: -jobs: - Python_tests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - max-parallel: 8 - matrix: - os: [macos-latest, ubuntu-latest] # , windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - pip install --editable ".[dev]" - - run: ./gyp -V && ./gyp --version && gyp -V && gyp --version - - name: Lint with flake8 - run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics - - name: Test with pytest - run: pytest - # - name: Run doctests with pytest - # run: pytest --doctest-modules diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml deleted file mode 100644 index 7cc1f9e07..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: node-gyp integration -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - workflow_dispatch: -jobs: - integration: - strategy: - fail-fast: false - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - python: ["3.7", "3.10"] - - runs-on: ${{ matrix.os }} - steps: - - name: Clone gyp-next - uses: actions/checkout@v3 - with: - path: gyp-next - - name: Clone nodejs/node-gyp - uses: actions/checkout@v3 - with: - repository: nodejs/node-gyp - path: node-gyp - - uses: actions/setup-node@v3 - with: - node-version: 14.x - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - cd node-gyp - npm install --no-progress - - name: Replace gyp in node-gyp - shell: bash - run: | - rm -rf node-gyp/gyp - cp -r gyp-next node-gyp/gyp - - name: Run tests - run: | - cd node-gyp - npm test diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml deleted file mode 100644 index 4e6c9548f..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Node.js Windows integration - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - workflow_dispatch: - -jobs: - build-windows: - runs-on: windows-2019 - steps: - - name: Clone gyp-next - uses: actions/checkout@v3 - with: - path: gyp-next - - name: Clone nodejs/node - uses: actions/checkout@v3 - with: - repository: nodejs/node - path: node - - name: Install deps - run: choco install nasm - - name: Replace gyp in Node.js - run: | - rm -Recurse node/tools/gyp - cp -Recurse gyp-next node/tools/gyp - - name: Build Node.js - run: | - cd node - ./vcbuild.bat diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/release-please.yml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/release-please.yml deleted file mode 100644 index 665c4c48f..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/.github/workflows/release-please.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - push: - branches: - - main - -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - release-type: python - package-name: gyp-next - bump-minor-pre-major: true diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/AUTHORS b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/AUTHORS deleted file mode 100644 index f49a357b9..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/AUTHORS +++ /dev/null @@ -1,16 +0,0 @@ -# Names should be added to this file like so: -# Name or Organization - -Google Inc. <*@google.com> -Bloomberg Finance L.P. <*@bloomberg.net> -IBM Inc. <*@*.ibm.com> -Yandex LLC <*@yandex-team.ru> - -Steven Knight -Ryan Norton -David J. Sankel -Eric N. Vander Weele -Tom Freudenberg -Julien Brianceau -Refael Ackermann -Ujjwal Sharma diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CHANGELOG.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CHANGELOG.md deleted file mode 100644 index 4b4968f6a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CHANGELOG.md +++ /dev/null @@ -1,233 +0,0 @@ -# Changelog - -## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08) - - -### Features - -* Add command line argument for `gyp --version` ([#164](https://github.com/nodejs/gyp-next/issues/164)) ([5c9f4d0](https://github.com/nodejs/gyp-next/commit/5c9f4d05678dd855e18ed2327219e5d18e5374db)) -* ninja build for iOS ([#174](https://github.com/nodejs/gyp-next/issues/174)) ([b6f2714](https://github.com/nodejs/gyp-next/commit/b6f271424e0033d7ed54d437706695af2ba7a1bf)) -* **zos:** support IBM Open XL C/C++ & PL/I compilers on z/OS ([#178](https://github.com/nodejs/gyp-next/issues/178)) ([43a7211](https://github.com/nodejs/gyp-next/commit/43a72110ae3fafb13c9625cc7a969624b27cda47)) - - -### Bug Fixes - -* lock windows env ([#163](https://github.com/nodejs/gyp-next/issues/163)) ([44bd0dd](https://github.com/nodejs/gyp-next/commit/44bd0ddc93ea0b5770a44dd326a2e4ae62c21442)) -* move configuration information into pyproject.toml ([#176](https://github.com/nodejs/gyp-next/issues/176)) ([d69d8ec](https://github.com/nodejs/gyp-next/commit/d69d8ece6dbff7af4f2ea073c9fd170baf8cb7f7)) -* node.js debugger adds stderr (but exit code is 0) -> shouldn't throw ([#179](https://github.com/nodejs/gyp-next/issues/179)) ([1a457d9](https://github.com/nodejs/gyp-next/commit/1a457d9ed08cfd30c9fa551bc5cf0d90fb583787)) - -## [0.13.0](https://www.github.com/nodejs/gyp-next/compare/v0.12.1...v0.13.0) (2022-05-11) - - -### Features - -* add PRODUCT_DIR_ABS variable ([#151](https://www.github.com/nodejs/gyp-next/issues/151)) ([80d2626](https://www.github.com/nodejs/gyp-next/commit/80d26263581db829b61b312a7bdb5cc791df7824)) - - -### Bug Fixes - -* execvp: printf: Argument list too long ([#147](https://www.github.com/nodejs/gyp-next/issues/147)) ([c4e14f3](https://www.github.com/nodejs/gyp-next/commit/c4e14f301673fadbac3ab7882d0b5f4d02530cb9)) - -### [0.12.1](https://www.github.com/nodejs/gyp-next/compare/v0.12.0...v0.12.1) (2022-04-06) - - -### Bug Fixes - -* **msvs:** avoid fixing path for arguments with "=" ([#143](https://www.github.com/nodejs/gyp-next/issues/143)) ([7e8f16e](https://www.github.com/nodejs/gyp-next/commit/7e8f16eb165e042e64bec98fa6c2a0232a42c26b)) - -## [0.12.0](https://www.github.com/nodejs/gyp-next/compare/v0.11.0...v0.12.0) (2022-04-04) - - -### Features - -* support building shared libraries on z/OS ([#137](https://www.github.com/nodejs/gyp-next/issues/137)) ([293bcfa](https://www.github.com/nodejs/gyp-next/commit/293bcfa4c25c6adb743377adafc45a80fee492c6)) - -## [0.11.0](https://www.github.com/nodejs/gyp-next/compare/v0.10.1...v0.11.0) (2022-03-04) - - -### Features - -* Add proper support for IBM i ([#140](https://www.github.com/nodejs/gyp-next/issues/140)) ([fdda4a3](https://www.github.com/nodejs/gyp-next/commit/fdda4a3038b8a7042ad960ce7a223687c24a21b1)) - -### [0.10.1](https://www.github.com/nodejs/gyp-next/compare/v0.10.0...v0.10.1) (2021-11-24) - - -### Bug Fixes - -* **make:** only generate makefile for multiple toolsets if requested ([#133](https://www.github.com/nodejs/gyp-next/issues/133)) ([f463a77](https://www.github.com/nodejs/gyp-next/commit/f463a77705973289ea38fec1b244c922ac438e26)) - -## [0.10.0](https://www.github.com/nodejs/gyp-next/compare/v0.9.6...v0.10.0) (2021-08-26) - - -### Features - -* **msvs:** add support for Visual Studio 2022 ([#124](https://www.github.com/nodejs/gyp-next/issues/124)) ([4bd9215](https://www.github.com/nodejs/gyp-next/commit/4bd9215c44d300f06e916aec1d6327c22b78272d)) - -### [0.9.6](https://www.github.com/nodejs/gyp-next/compare/v0.9.5...v0.9.6) (2021-08-23) - - -### Bug Fixes - -* align flake8 test ([#122](https://www.github.com/nodejs/gyp-next/issues/122)) ([f1faa8d](https://www.github.com/nodejs/gyp-next/commit/f1faa8d3081e1a47e917ff910892f00dff16cf8a)) -* **msvs:** fix paths again in action command arguments ([#121](https://www.github.com/nodejs/gyp-next/issues/121)) ([7159dfb](https://www.github.com/nodejs/gyp-next/commit/7159dfbc5758c9ec717e215f2c36daf482c846a1)) - -### [0.9.5](https://www.github.com/nodejs/gyp-next/compare/v0.9.4...v0.9.5) (2021-08-18) - - -### Bug Fixes - -* add python 3.6 to node-gyp integration test ([3462d4c](https://www.github.com/nodejs/gyp-next/commit/3462d4ce3c31cce747513dc7ca9760c81d57c60e)) -* revert for windows compatibility ([d078e7d](https://www.github.com/nodejs/gyp-next/commit/d078e7d7ae080ddae243188f6415f940376a7368)) -* support msvs_quote_cmd in ninja generator ([#117](https://www.github.com/nodejs/gyp-next/issues/117)) ([46486ac](https://www.github.com/nodejs/gyp-next/commit/46486ac6e9329529d51061e006a5b39631e46729)) - -### [0.9.4](https://www.github.com/nodejs/gyp-next/compare/v0.9.3...v0.9.4) (2021-08-09) - - -### Bug Fixes - -* .S is an extension for asm file on Windows ([#115](https://www.github.com/nodejs/gyp-next/issues/115)) ([d2fad44](https://www.github.com/nodejs/gyp-next/commit/d2fad44ef3a79ca8900f1307060153ded57053fc)) - -### [0.9.3](https://www.github.com/nodejs/gyp-next/compare/v0.9.2...v0.9.3) (2021-07-07) - - -### Bug Fixes - -* build failure with ninja and Python 3 on Windows ([#113](https://www.github.com/nodejs/gyp-next/issues/113)) ([c172d10](https://www.github.com/nodejs/gyp-next/commit/c172d105deff5db4244e583942215918fa80dd3c)) - -### [0.9.2](https://www.github.com/nodejs/gyp-next/compare/v0.9.1...v0.9.2) (2021-05-21) - - -### Bug Fixes - -* add support of utf8 encoding ([#105](https://www.github.com/nodejs/gyp-next/issues/105)) ([4d0f93c](https://www.github.com/nodejs/gyp-next/commit/4d0f93c249286d1f0c0f665f5fe7346119f98cf1)) - -### [0.9.1](https://www.github.com/nodejs/gyp-next/compare/v0.9.0...v0.9.1) (2021-05-14) - - -### Bug Fixes - -* py lint ([3b6a8ee](https://www.github.com/nodejs/gyp-next/commit/3b6a8ee7a66193a8a6867eba9e1d2b70bdf04402)) - -## [0.9.0](https://www.github.com/nodejs/gyp-next/compare/v0.8.1...v0.9.0) (2021-05-13) - - -### Features - -* use LDFLAGS_host for host toolset ([#98](https://www.github.com/nodejs/gyp-next/issues/98)) ([bea5c7b](https://www.github.com/nodejs/gyp-next/commit/bea5c7bd67d6ad32acbdce79767a5481c70675a2)) - - -### Bug Fixes - -* msvs.py: remove overindentation ([#102](https://www.github.com/nodejs/gyp-next/issues/102)) ([3f83e99](https://www.github.com/nodejs/gyp-next/commit/3f83e99056d004d9579ceb786e06b624ddc36529)) -* update gyp.el to change case to cl-case ([#93](https://www.github.com/nodejs/gyp-next/issues/93)) ([13d5b66](https://www.github.com/nodejs/gyp-next/commit/13d5b66aab35985af9c2fb1174fdc6e1c1407ecc)) - -### [0.8.1](https://www.github.com/nodejs/gyp-next/compare/v0.8.0...v0.8.1) (2021-02-18) - - -### Bug Fixes - -* update shebang lines from python to python3 ([#94](https://www.github.com/nodejs/gyp-next/issues/94)) ([a1b0d41](https://www.github.com/nodejs/gyp-next/commit/a1b0d4171a8049a4ab7a614202063dec332f2df4)) - -## [0.8.0](https://www.github.com/nodejs/gyp-next/compare/v0.7.0...v0.8.0) (2021-01-15) - - -### ⚠ BREAKING CHANGES - -* remove support for Python 2 - -### Bug Fixes - -* revert posix build job ([#86](https://www.github.com/nodejs/gyp-next/issues/86)) ([39dc34f](https://www.github.com/nodejs/gyp-next/commit/39dc34f0799c074624005fb9bbccf6e028607f9d)) - - -### gyp - -* Remove support for Python 2 ([#88](https://www.github.com/nodejs/gyp-next/issues/88)) ([22e4654](https://www.github.com/nodejs/gyp-next/commit/22e465426fd892403c95534229af819a99c3f8dc)) - -## [0.7.0](https://www.github.com/nodejs/gyp-next/compare/v0.6.2...v0.7.0) (2020-12-17) - - -### ⚠ BREAKING CHANGES - -* **msvs:** On Windows, arguments passed to the "action" commands are no longer transformed to replace slashes with backslashes. - -### Features - -* **xcode:** --cross-compiling overrides arch-specific settings ([973bae0](https://www.github.com/nodejs/gyp-next/commit/973bae0b7b08be7b680ecae9565fbd04b3e0787d)) - - -### Bug Fixes - -* **msvs:** do not fix paths in action command arguments ([fc22f83](https://www.github.com/nodejs/gyp-next/commit/fc22f8335e2016da4aae4f4233074bd651d2faea)) -* cmake on python 3 ([fd61f5f](https://www.github.com/nodejs/gyp-next/commit/fd61f5faa5275ec8fc98e3c7868c0dd46f109540)) -* ValueError: invalid mode: 'rU' while trying to load binding.gyp ([d0504e6](https://www.github.com/nodejs/gyp-next/commit/d0504e6700ce48f44957a4d5891b142a60be946f)) -* xcode cmake parsing ([eefe8d1](https://www.github.com/nodejs/gyp-next/commit/eefe8d10e99863bc4ac7e2ed32facd608d400d4b)) - -### [0.6.2](https://www.github.com/nodejs/gyp-next/compare/v0.6.1...v0.6.2) (2020-10-16) - - -### Bug Fixes - -* do not rewrite absolute paths to avoid long paths ([#74](https://www.github.com/nodejs/gyp-next/issues/74)) ([c2ccc1a](https://www.github.com/nodejs/gyp-next/commit/c2ccc1a81f7f94433a94f4d01a2e820db4c4331a)) -* only include MARMASM when toolset is target ([5a2794a](https://www.github.com/nodejs/gyp-next/commit/5a2794aefb58f0c00404ff042b61740bc8b8d5cd)) - -### [0.6.1](https://github.com/nodejs/gyp-next/compare/v0.6.0...v0.6.1) (2020-10-14) - - -### Bug Fixes - -* Correctly rename object files for absolute paths in MSVS generator. - -## [0.6.0](https://github.com/nodejs/gyp-next/compare/v0.5.0...v0.6.0) (2020-10-13) - - -### Features - -* The Makefile generator will now output shared libraries directly to the product directory on all platforms (previously only macOS). - -## [0.5.0](https://github.com/nodejs/gyp-next/compare/v0.4.0...v0.5.0) (2020-09-30) - - -### Features - -* Extended compile_commands_json generator to consider more file extensions than just `c` and `cc`. `cpp` and `cxx` are now supported. -* Source files with duplicate basenames are now supported. - -### Removed - -* The `--no-duplicate-basename-check` option was removed. -* The `msvs_enable_marmasm` configuration option was removed in favor of auto-inclusion of the "marmasm" sections for Windows on ARM. - -## [0.4.0](https://github.com/nodejs/gyp-next/compare/v0.3.0...v0.4.0) (2020-07-14) - - -### Features - -* Added support for passing arbitrary architectures to Xcode builds, enables `arm64` builds. - -### Bug Fixes - -* Fixed a bug on Solaris where copying archives failed. - -## [0.3.0](https://github.com/nodejs/gyp-next/compare/v0.2.1...v0.3.0) (2020-06-06) - - -### Features - -* Added support for MSVC cross-compilation. This allows compilation on x64 for a Windows ARM target. - -### Bug Fixes - -* Fixed XCode CLT version detection on macOS Catalina. - -### [0.2.1](https://github.com/nodejs/gyp-next/compare/v0.2.0...v0.2.1) (2020-05-05) - - -### Bug Fixes - -* Relicensed to Node.js contributors. -* Fixed Windows bug introduced in v0.2.0. - -## [0.2.0](https://github.com/nodejs/gyp-next/releases/tag/v0.2.0) (2020-04-06) - -This is the first release of this project, based on https://chromium.googlesource.com/external/gyp with changes made over the years in Node.js and node-gyp. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md deleted file mode 100644 index d724027fd..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,4 +0,0 @@ -# Code of Conduct - -* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md) -* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/HEAD/Moderation-Policy.md) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CONTRIBUTING.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CONTRIBUTING.md deleted file mode 100644 index 1a0bcde2b..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/CONTRIBUTING.md +++ /dev/null @@ -1,32 +0,0 @@ -# Contributing to gyp-next - -## Code of Conduct - -This project is bound to the [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md). - - -## Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/LICENSE b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/LICENSE deleted file mode 100644 index c6944c5e4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2020 Node.js contributors. All rights reserved. -Copyright (c) 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/README.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/README.md deleted file mode 100644 index 9ffc2b21e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/README.md +++ /dev/null @@ -1,7 +0,0 @@ -GYP can Generate Your Projects. -=================================== - -Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline. - -__gyp-next__ is [released](https://github.com/nodejs/gyp-next/releases) to the [__Python Packaging Index__](https://pypi.org/project/gyp-next) (PyPI) and can be installed with the command: -* `python3 -m pip install gyp-next` diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc deleted file mode 100644 index 8bca51081..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2013 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is used to generate an empty .pdb -- with a 4KB pagesize -- that is -// then used during the final link for modules that have large PDBs. Otherwise, -// the linker will generate a pdb with a page size of 1KB, which imposes a limit -// of 1GB on the .pdb. By generating an initial empty .pdb with the compiler -// (rather than the linker), this limit is avoided. With this in place PDBs may -// grow to 2GB. -// -// This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py. diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp deleted file mode 100755 index 1b8b9bdfb..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Copyright 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -set -e -base=$(dirname "$0") -exec python "${base}/gyp_main.py" "$@" diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp.bat b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp.bat deleted file mode 100755 index c0b4ca24e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp.bat +++ /dev/null @@ -1,5 +0,0 @@ -@rem Copyright (c) 2009 Google Inc. All rights reserved. -@rem Use of this source code is governed by a BSD-style license that can be -@rem found in the LICENSE file. - -@python "%~dp0gyp_main.py" %* diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py deleted file mode 100755 index f23dcdf88..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2009 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import sys -import subprocess - - -def IsCygwin(): - # Function copied from pylib/gyp/common.py - try: - out = subprocess.Popen( - "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - stdout, _ = out.communicate() - return "CYGWIN" in stdout.decode("utf-8") - except Exception: - return False - - -def UnixifyPath(path): - try: - if not IsCygwin(): - return path - out = subprocess.Popen( - ["cygpath", "-u", path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - stdout, _ = out.communicate() - return stdout.decode("utf-8") - except Exception: - return path - - -# Make sure we're using the version of pylib in this repo, not one installed -# elsewhere on the system. Also convert to Unix style path on Cygwin systems, -# else the 'gyp' library will not be found -path = UnixifyPath(sys.argv[0]) -sys.path.insert(0, os.path.join(os.path.dirname(path), "pylib")) -import gyp # noqa: E402 - -if __name__ == "__main__": - sys.exit(gyp.script_main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py deleted file mode 100644 index d6b189760..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +++ /dev/null @@ -1,367 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""New implementation of Visual Studio project generation.""" - -import hashlib -import os -import random -from operator import attrgetter - -import gyp.common - - -def cmp(x, y): - return (x > y) - (x < y) - - -# Initialize random number generator -random.seed() - -# GUIDs for project types -ENTRY_TYPE_GUIDS = { - "project": "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", - "folder": "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", -} - -# ------------------------------------------------------------------------------ -# Helper functions - - -def MakeGuid(name, seed="msvs_new"): - """Returns a GUID for the specified target name. - - Args: - name: Target name. - seed: Seed for MD5 hash. - Returns: - A GUID-line string calculated from the name and seed. - - This generates something which looks like a GUID, but depends only on the - name and seed. This means the same name/seed will always generate the same - GUID, so that projects and solutions which refer to each other can explicitly - determine the GUID to refer to explicitly. It also means that the GUID will - not change when the project for a target is rebuilt. - """ - # Calculate a MD5 signature for the seed and name. - d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper() - # Convert most of the signature to GUID form (discard the rest) - guid = ( - "{" - + d[:8] - + "-" - + d[8:12] - + "-" - + d[12:16] - + "-" - + d[16:20] - + "-" - + d[20:32] - + "}" - ) - return guid - - -# ------------------------------------------------------------------------------ - - -class MSVSSolutionEntry: - def __cmp__(self, other): - # Sort by name then guid (so things are in order on vs2008). - return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) - - -class MSVSFolder(MSVSSolutionEntry): - """Folder in a Visual Studio project or solution.""" - - def __init__(self, path, name=None, entries=None, guid=None, items=None): - """Initializes the folder. - - Args: - path: Full path to the folder. - name: Name of the folder. - entries: List of folder entries to nest inside this folder. May contain - Folder or Project objects. May be None, if the folder is empty. - guid: GUID to use for folder, if not None. - items: List of solution items to include in the folder project. May be - None, if the folder does not directly contain items. - """ - if name: - self.name = name - else: - # Use last layer. - self.name = os.path.basename(path) - - self.path = path - self.guid = guid - - # Copy passed lists (or set to empty lists) - self.entries = sorted(entries or [], key=attrgetter("path")) - self.items = list(items or []) - - self.entry_type_guid = ENTRY_TYPE_GUIDS["folder"] - - def get_guid(self): - if self.guid is None: - # Use consistent guids for folders (so things don't regenerate). - self.guid = MakeGuid(self.path, seed="msvs_folder") - return self.guid - - -# ------------------------------------------------------------------------------ - - -class MSVSProject(MSVSSolutionEntry): - """Visual Studio project.""" - - def __init__( - self, - path, - name=None, - dependencies=None, - guid=None, - spec=None, - build_file=None, - config_platform_overrides=None, - fixpath_prefix=None, - ): - """Initializes the project. - - Args: - path: Absolute path to the project file. - name: Name of project. If None, the name will be the same as the base - name of the project file. - dependencies: List of other Project objects this project is dependent - upon, if not None. - guid: GUID to use for project, if not None. - spec: Dictionary specifying how to build this project. - build_file: Filename of the .gyp file that the vcproj file comes from. - config_platform_overrides: optional dict of configuration platforms to - used in place of the default for this target. - fixpath_prefix: the path used to adjust the behavior of _fixpath - """ - self.path = path - self.guid = guid - self.spec = spec - self.build_file = build_file - # Use project filename if name not specified - self.name = name or os.path.splitext(os.path.basename(path))[0] - - # Copy passed lists (or set to empty lists) - self.dependencies = list(dependencies or []) - - self.entry_type_guid = ENTRY_TYPE_GUIDS["project"] - - if config_platform_overrides: - self.config_platform_overrides = config_platform_overrides - else: - self.config_platform_overrides = {} - self.fixpath_prefix = fixpath_prefix - self.msbuild_toolset = None - - def set_dependencies(self, dependencies): - self.dependencies = list(dependencies or []) - - def get_guid(self): - if self.guid is None: - # Set GUID from path - # TODO(rspangler): This is fragile. - # 1. We can't just use the project filename sans path, since there could - # be multiple projects with the same base name (for example, - # foo/unittest.vcproj and bar/unittest.vcproj). - # 2. The path needs to be relative to $SOURCE_ROOT, so that the project - # GUID is the same whether it's included from base/base.sln or - # foo/bar/baz/baz.sln. - # 3. The GUID needs to be the same each time this builder is invoked, so - # that we don't need to rebuild the solution when the project changes. - # 4. We should be able to handle pre-built project files by reading the - # GUID from the files. - self.guid = MakeGuid(self.name) - return self.guid - - def set_msbuild_toolset(self, msbuild_toolset): - self.msbuild_toolset = msbuild_toolset - - -# ------------------------------------------------------------------------------ - - -class MSVSSolution: - """Visual Studio solution.""" - - def __init__( - self, path, version, entries=None, variants=None, websiteProperties=True - ): - """Initializes the solution. - - Args: - path: Path to solution file. - version: Format version to emit. - entries: List of entries in solution. May contain Folder or Project - objects. May be None, if the folder is empty. - variants: List of build variant strings. If none, a default list will - be used. - websiteProperties: Flag to decide if the website properties section - is generated. - """ - self.path = path - self.websiteProperties = websiteProperties - self.version = version - - # Copy passed lists (or set to empty lists) - self.entries = list(entries or []) - - if variants: - # Copy passed list - self.variants = variants[:] - else: - # Use default - self.variants = ["Debug|Win32", "Release|Win32"] - # TODO(rspangler): Need to be able to handle a mapping of solution config - # to project config. Should we be able to handle variants being a dict, - # or add a separate variant_map variable? If it's a dict, we can't - # guarantee the order of variants since dict keys aren't ordered. - - # TODO(rspangler): Automatically write to disk for now; should delay until - # node-evaluation time. - self.Write() - - def Write(self, writer=gyp.common.WriteOnDiff): - """Writes the solution file to disk. - - Raises: - IndexError: An entry appears multiple times. - """ - # Walk the entry tree and collect all the folders and projects. - all_entries = set() - entries_to_check = self.entries[:] - while entries_to_check: - e = entries_to_check.pop(0) - - # If this entry has been visited, nothing to do. - if e in all_entries: - continue - - all_entries.add(e) - - # If this is a folder, check its entries too. - if isinstance(e, MSVSFolder): - entries_to_check += e.entries - - all_entries = sorted(all_entries, key=attrgetter("path")) - - # Open file and print header - f = writer(self.path) - f.write( - "Microsoft Visual Studio Solution File, " - "Format Version %s\r\n" % self.version.SolutionVersion() - ) - f.write("# %s\r\n" % self.version.Description()) - - # Project entries - sln_root = os.path.split(self.path)[0] - for e in all_entries: - relative_path = gyp.common.RelativePath(e.path, sln_root) - # msbuild does not accept an empty folder_name. - # use '.' in case relative_path is empty. - folder_name = relative_path.replace("/", "\\") or "." - f.write( - 'Project("%s") = "%s", "%s", "%s"\r\n' - % ( - e.entry_type_guid, # Entry type GUID - e.name, # Folder name - folder_name, # Folder name (again) - e.get_guid(), # Entry GUID - ) - ) - - # TODO(rspangler): Need a way to configure this stuff - if self.websiteProperties: - f.write( - "\tProjectSection(WebsiteProperties) = preProject\r\n" - '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' - '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' - "\tEndProjectSection\r\n" - ) - - if isinstance(e, MSVSFolder): - if e.items: - f.write("\tProjectSection(SolutionItems) = preProject\r\n") - for i in e.items: - f.write(f"\t\t{i} = {i}\r\n") - f.write("\tEndProjectSection\r\n") - - if isinstance(e, MSVSProject): - if e.dependencies: - f.write("\tProjectSection(ProjectDependencies) = postProject\r\n") - for d in e.dependencies: - f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n") - f.write("\tEndProjectSection\r\n") - - f.write("EndProject\r\n") - - # Global section - f.write("Global\r\n") - - # Configurations (variants) - f.write("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n") - for v in self.variants: - f.write(f"\t\t{v} = {v}\r\n") - f.write("\tEndGlobalSection\r\n") - - # Sort config guids for easier diffing of solution changes. - config_guids = [] - config_guids_overrides = {} - for e in all_entries: - if isinstance(e, MSVSProject): - config_guids.append(e.get_guid()) - config_guids_overrides[e.get_guid()] = e.config_platform_overrides - config_guids.sort() - - f.write("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n") - for g in config_guids: - for v in self.variants: - nv = config_guids_overrides[g].get(v, v) - # Pick which project configuration to build for this solution - # configuration. - f.write( - "\t\t%s.%s.ActiveCfg = %s\r\n" - % ( - g, # Project GUID - v, # Solution build configuration - nv, # Project build config for that solution config - ) - ) - - # Enable project in this solution configuration. - f.write( - "\t\t%s.%s.Build.0 = %s\r\n" - % ( - g, # Project GUID - v, # Solution build configuration - nv, # Project build config for that solution config - ) - ) - f.write("\tEndGlobalSection\r\n") - - # TODO(rspangler): Should be able to configure this stuff too (though I've - # never seen this be any different) - f.write("\tGlobalSection(SolutionProperties) = preSolution\r\n") - f.write("\t\tHideSolutionNode = FALSE\r\n") - f.write("\tEndGlobalSection\r\n") - - # Folder mappings - # Omit this section if there are no folders - if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): - f.write("\tGlobalSection(NestedProjects) = preSolution\r\n") - for e in all_entries: - if not isinstance(e, MSVSFolder): - continue # Does not apply to projects, only folders - for subentry in e.entries: - f.write(f"\t\t{subentry.get_guid()} = {e.get_guid()}\r\n") - f.write("\tEndGlobalSection\r\n") - - f.write("EndGlobal\r\n") - - f.close() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py deleted file mode 100644 index f0cfabe83..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Visual Studio project reader/writer.""" - -import gyp.easy_xml as easy_xml - -# ------------------------------------------------------------------------------ - - -class Tool: - """Visual Studio tool.""" - - def __init__(self, name, attrs=None): - """Initializes the tool. - - Args: - name: Tool name. - attrs: Dict of tool attributes; may be None. - """ - self._attrs = attrs or {} - self._attrs["Name"] = name - - def _GetSpecification(self): - """Creates an element for the tool. - - Returns: - A new xml.dom.Element for the tool. - """ - return ["Tool", self._attrs] - - -class Filter: - """Visual Studio filter - that is, a virtual folder.""" - - def __init__(self, name, contents=None): - """Initializes the folder. - - Args: - name: Filter (folder) name. - contents: List of filenames and/or Filter objects contained. - """ - self.name = name - self.contents = list(contents or []) - - -# ------------------------------------------------------------------------------ - - -class Writer: - """Visual Studio XML project writer.""" - - def __init__(self, project_path, version, name, guid=None, platforms=None): - """Initializes the project. - - Args: - project_path: Path to the project file. - version: Format version to emit. - name: Name of the project. - guid: GUID to use for project, if not None. - platforms: Array of string, the supported platforms. If null, ['Win32'] - """ - self.project_path = project_path - self.version = version - self.name = name - self.guid = guid - - # Default to Win32 for platforms. - if not platforms: - platforms = ["Win32"] - - # Initialize the specifications of the various sections. - self.platform_section = ["Platforms"] - for platform in platforms: - self.platform_section.append(["Platform", {"Name": platform}]) - self.tool_files_section = ["ToolFiles"] - self.configurations_section = ["Configurations"] - self.files_section = ["Files"] - - # Keep a dict keyed on filename to speed up access. - self.files_dict = dict() - - def AddToolFile(self, path): - """Adds a tool file to the project. - - Args: - path: Relative path from project to tool file. - """ - self.tool_files_section.append(["ToolFile", {"RelativePath": path}]) - - def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): - """Returns the specification for a configuration. - - Args: - config_type: Type of configuration node. - config_name: Configuration name. - attrs: Dict of configuration attributes; may be None. - tools: List of tools (strings or Tool objects); may be None. - Returns: - """ - # Handle defaults - if not attrs: - attrs = {} - if not tools: - tools = [] - - # Add configuration node and its attributes - node_attrs = attrs.copy() - node_attrs["Name"] = config_name - specification = [config_type, node_attrs] - - # Add tool nodes and their attributes - if tools: - for t in tools: - if isinstance(t, Tool): - specification.append(t._GetSpecification()) - else: - specification.append(Tool(t)._GetSpecification()) - return specification - - def AddConfig(self, name, attrs=None, tools=None): - """Adds a configuration to the project. - - Args: - name: Configuration name. - attrs: Dict of configuration attributes; may be None. - tools: List of tools (strings or Tool objects); may be None. - """ - spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools) - self.configurations_section.append(spec) - - def _AddFilesToNode(self, parent, files): - """Adds files and/or filters to the parent node. - - Args: - parent: Destination node - files: A list of Filter objects and/or relative paths to files. - - Will call itself recursively, if the files list contains Filter objects. - """ - for f in files: - if isinstance(f, Filter): - node = ["Filter", {"Name": f.name}] - self._AddFilesToNode(node, f.contents) - else: - node = ["File", {"RelativePath": f}] - self.files_dict[f] = node - parent.append(node) - - def AddFiles(self, files): - """Adds files to the project. - - Args: - files: A list of Filter objects and/or relative paths to files. - - This makes a copy of the file/filter tree at the time of this call. If you - later add files to a Filter object which was passed into a previous call - to AddFiles(), it will not be reflected in this project. - """ - self._AddFilesToNode(self.files_section, files) - # TODO(rspangler) This also doesn't handle adding files to an existing - # filter. That is, it doesn't merge the trees. - - def AddFileConfig(self, path, config, attrs=None, tools=None): - """Adds a configuration to a file. - - Args: - path: Relative path to the file. - config: Name of configuration to add. - attrs: Dict of configuration attributes; may be None. - tools: List of tools (strings or Tool objects); may be None. - - Raises: - ValueError: Relative path does not match any file added via AddFiles(). - """ - # Find the file node with the right relative path - parent = self.files_dict.get(path) - if not parent: - raise ValueError('AddFileConfig: file "%s" not in project.' % path) - - # Add the config to the file node - spec = self._GetSpecForConfiguration("FileConfiguration", config, attrs, tools) - parent.append(spec) - - def WriteIfChanged(self): - """Writes the project file.""" - # First create XML content definition - content = [ - "VisualStudioProject", - { - "ProjectType": "Visual C++", - "Version": self.version.ProjectVersion(), - "Name": self.name, - "ProjectGUID": self.guid, - "RootNamespace": self.name, - "Keyword": "Win32Proj", - }, - self.platform_section, - self.tool_files_section, - self.configurations_section, - ["References"], # empty section - self.files_section, - ["Globals"], # empty section - ] - easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252") diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py deleted file mode 100644 index e89a971a3..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +++ /dev/null @@ -1,1270 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -r"""Code to validate and convert settings of the Microsoft build tools. - -This file contains code to validate and convert settings of the Microsoft -build tools. The function ConvertToMSBuildSettings(), ValidateMSVSSettings(), -and ValidateMSBuildSettings() are the entry points. - -This file was created by comparing the projects created by Visual Studio 2008 -and Visual Studio 2010 for all available settings through the user interface. -The MSBuild schemas were also considered. They are typically found in the -MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild -""" - -import re -import sys - -# Dictionaries of settings validators. The key is the tool name, the value is -# a dictionary mapping setting names to validation functions. -_msvs_validators = {} -_msbuild_validators = {} - - -# A dictionary of settings converters. The key is the tool name, the value is -# a dictionary mapping setting names to conversion functions. -_msvs_to_msbuild_converters = {} - - -# Tool name mapping from MSVS to MSBuild. -_msbuild_name_of_tool = {} - - -class _Tool: - """Represents a tool used by MSVS or MSBuild. - - Attributes: - msvs_name: The name of the tool in MSVS. - msbuild_name: The name of the tool in MSBuild. - """ - - def __init__(self, msvs_name, msbuild_name): - self.msvs_name = msvs_name - self.msbuild_name = msbuild_name - - -def _AddTool(tool): - """Adds a tool to the four dictionaries used to process settings. - - This only defines the tool. Each setting also needs to be added. - - Args: - tool: The _Tool object to be added. - """ - _msvs_validators[tool.msvs_name] = {} - _msbuild_validators[tool.msbuild_name] = {} - _msvs_to_msbuild_converters[tool.msvs_name] = {} - _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name - - -def _GetMSBuildToolSettings(msbuild_settings, tool): - """Returns an MSBuild tool dictionary. Creates it if needed.""" - return msbuild_settings.setdefault(tool.msbuild_name, {}) - - -class _Type: - """Type of settings (Base class).""" - - def ValidateMSVS(self, value): - """Verifies that the value is legal for MSVS. - - Args: - value: the value to check for this type. - - Raises: - ValueError if value is not valid for MSVS. - """ - - def ValidateMSBuild(self, value): - """Verifies that the value is legal for MSBuild. - - Args: - value: the value to check for this type. - - Raises: - ValueError if value is not valid for MSBuild. - """ - - def ConvertToMSBuild(self, value): - """Returns the MSBuild equivalent of the MSVS value given. - - Args: - value: the MSVS value to convert. - - Returns: - the MSBuild equivalent. - - Raises: - ValueError if value is not valid. - """ - return value - - -class _String(_Type): - """A setting that's just a string.""" - - def ValidateMSVS(self, value): - if not isinstance(value, str): - raise ValueError("expected string; got %r" % value) - - def ValidateMSBuild(self, value): - if not isinstance(value, str): - raise ValueError("expected string; got %r" % value) - - def ConvertToMSBuild(self, value): - # Convert the macros - return ConvertVCMacrosToMSBuild(value) - - -class _StringList(_Type): - """A settings that's a list of strings.""" - - def ValidateMSVS(self, value): - if not isinstance(value, (list, str)): - raise ValueError("expected string list; got %r" % value) - - def ValidateMSBuild(self, value): - if not isinstance(value, (list, str)): - raise ValueError("expected string list; got %r" % value) - - def ConvertToMSBuild(self, value): - # Convert the macros - if isinstance(value, list): - return [ConvertVCMacrosToMSBuild(i) for i in value] - else: - return ConvertVCMacrosToMSBuild(value) - - -class _Boolean(_Type): - """Boolean settings, can have the values 'false' or 'true'.""" - - def _Validate(self, value): - if value != "true" and value != "false": - raise ValueError("expected bool; got %r" % value) - - def ValidateMSVS(self, value): - self._Validate(value) - - def ValidateMSBuild(self, value): - self._Validate(value) - - def ConvertToMSBuild(self, value): - self._Validate(value) - return value - - -class _Integer(_Type): - """Integer settings.""" - - def __init__(self, msbuild_base=10): - _Type.__init__(self) - self._msbuild_base = msbuild_base - - def ValidateMSVS(self, value): - # Try to convert, this will raise ValueError if invalid. - self.ConvertToMSBuild(value) - - def ValidateMSBuild(self, value): - # Try to convert, this will raise ValueError if invalid. - int(value, self._msbuild_base) - - def ConvertToMSBuild(self, value): - msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x" - return msbuild_format % int(value) - - -class _Enumeration(_Type): - """Type of settings that is an enumeration. - - In MSVS, the values are indexes like '0', '1', and '2'. - MSBuild uses text labels that are more representative, like 'Win32'. - - Constructor args: - label_list: an array of MSBuild labels that correspond to the MSVS index. - In the rare cases where MSVS has skipped an index value, None is - used in the array to indicate the unused spot. - new: an array of labels that are new to MSBuild. - """ - - def __init__(self, label_list, new=None): - _Type.__init__(self) - self._label_list = label_list - self._msbuild_values = {value for value in label_list if value is not None} - if new is not None: - self._msbuild_values.update(new) - - def ValidateMSVS(self, value): - # Try to convert. It will raise an exception if not valid. - self.ConvertToMSBuild(value) - - def ValidateMSBuild(self, value): - if value not in self._msbuild_values: - raise ValueError("unrecognized enumerated value %s" % value) - - def ConvertToMSBuild(self, value): - index = int(value) - if index < 0 or index >= len(self._label_list): - raise ValueError( - "index value (%d) not in expected range [0, %d)" - % (index, len(self._label_list)) - ) - label = self._label_list[index] - if label is None: - raise ValueError("converted value for %s not specified." % value) - return label - - -# Instantiate the various generic types. -_boolean = _Boolean() -_integer = _Integer() -# For now, we don't do any special validation on these types: -_string = _String() -_file_name = _String() -_folder_name = _String() -_file_list = _StringList() -_folder_list = _StringList() -_string_list = _StringList() -# Some boolean settings went from numerical values to boolean. The -# mapping is 0: default, 1: false, 2: true. -_newly_boolean = _Enumeration(["", "false", "true"]) - - -def _Same(tool, name, setting_type): - """Defines a setting that has the same name in MSVS and MSBuild. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - name: the name of the setting. - setting_type: the type of this setting. - """ - _Renamed(tool, name, name, setting_type) - - -def _Renamed(tool, msvs_name, msbuild_name, setting_type): - """Defines a setting for which the name has changed. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - msvs_name: the name of the MSVS setting. - msbuild_name: the name of the MSBuild setting. - setting_type: the type of this setting. - """ - - def _Translate(value, msbuild_settings): - msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value) - - _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS - _msbuild_validators[tool.msbuild_name][msbuild_name] = setting_type.ValidateMSBuild - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -def _Moved(tool, settings_name, msbuild_tool_name, setting_type): - _MovedAndRenamed( - tool, settings_name, msbuild_tool_name, settings_name, setting_type - ) - - -def _MovedAndRenamed( - tool, msvs_settings_name, msbuild_tool_name, msbuild_settings_name, setting_type -): - """Defines a setting that may have moved to a new section. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - msvs_settings_name: the MSVS name of the setting. - msbuild_tool_name: the name of the MSBuild tool to place the setting under. - msbuild_settings_name: the MSBuild name of the setting. - setting_type: the type of this setting. - """ - - def _Translate(value, msbuild_settings): - tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {}) - tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value) - - _msvs_validators[tool.msvs_name][msvs_settings_name] = setting_type.ValidateMSVS - validator = setting_type.ValidateMSBuild - _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator - _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate - - -def _MSVSOnly(tool, name, setting_type): - """Defines a setting that is only found in MSVS. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - name: the name of the setting. - setting_type: the type of this setting. - """ - - def _Translate(unused_value, unused_msbuild_settings): - # Since this is for MSVS only settings, no translation will happen. - pass - - _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS - _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate - - -def _MSBuildOnly(tool, name, setting_type): - """Defines a setting that is only found in MSBuild. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - name: the name of the setting. - setting_type: the type of this setting. - """ - - def _Translate(value, msbuild_settings): - # Let msbuild-only properties get translated as-is from msvs_settings. - tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {}) - tool_settings[name] = value - - _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild - _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate - - -def _ConvertedToAdditionalOption(tool, msvs_name, flag): - """Defines a setting that's handled via a command line option in MSBuild. - - Args: - tool: a dictionary that gives the names of the tool for MSVS and MSBuild. - msvs_name: the name of the MSVS setting that if 'true' becomes a flag - flag: the flag to insert at the end of the AdditionalOptions - """ - - def _Translate(value, msbuild_settings): - if value == "true": - tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - if "AdditionalOptions" in tool_settings: - new_flags = "{} {}".format(tool_settings["AdditionalOptions"], flag) - else: - new_flags = flag - tool_settings["AdditionalOptions"] = new_flags - - _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -def _CustomGeneratePreprocessedFile(tool, msvs_name): - def _Translate(value, msbuild_settings): - tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - if value == "0": - tool_settings["PreprocessToFile"] = "false" - tool_settings["PreprocessSuppressLineNumbers"] = "false" - elif value == "1": # /P - tool_settings["PreprocessToFile"] = "true" - tool_settings["PreprocessSuppressLineNumbers"] = "false" - elif value == "2": # /EP /P - tool_settings["PreprocessToFile"] = "true" - tool_settings["PreprocessSuppressLineNumbers"] = "true" - else: - raise ValueError("value must be one of [0, 1, 2]; got %s" % value) - - # Create a bogus validator that looks for '0', '1', or '2' - msvs_validator = _Enumeration(["a", "b", "c"]).ValidateMSVS - _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator - msbuild_validator = _boolean.ValidateMSBuild - msbuild_tool_validators = _msbuild_validators[tool.msbuild_name] - msbuild_tool_validators["PreprocessToFile"] = msbuild_validator - msbuild_tool_validators["PreprocessSuppressLineNumbers"] = msbuild_validator - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -fix_vc_macro_slashes_regex_list = ("IntDir", "OutDir") -fix_vc_macro_slashes_regex = re.compile( - r"(\$\((?:%s)\))(?:[\\/]+)" % "|".join(fix_vc_macro_slashes_regex_list) -) - -# Regular expression to detect keys that were generated by exclusion lists -_EXCLUDED_SUFFIX_RE = re.compile("^(.*)_excluded$") - - -def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr): - """Verify that 'setting' is valid if it is generated from an exclusion list. - - If the setting appears to be generated from an exclusion list, the root name - is checked. - - Args: - setting: A string that is the setting name to validate - settings: A dictionary where the keys are valid settings - error_msg: The message to emit in the event of error - stderr: The stream receiving the error messages. - """ - # This may be unrecognized because it's an exclusion list. If the - # setting name has the _excluded suffix, then check the root name. - unrecognized = True - m = re.match(_EXCLUDED_SUFFIX_RE, setting) - if m: - root_setting = m.group(1) - unrecognized = root_setting not in settings - - if unrecognized: - # We don't know this setting. Give a warning. - print(error_msg, file=stderr) - - -def FixVCMacroSlashes(s): - """Replace macros which have excessive following slashes. - - These macros are known to have a built-in trailing slash. Furthermore, many - scripts hiccup on processing paths with extra slashes in the middle. - - This list is probably not exhaustive. Add as needed. - """ - if "$" in s: - s = fix_vc_macro_slashes_regex.sub(r"\1", s) - return s - - -def ConvertVCMacrosToMSBuild(s): - """Convert the MSVS macros found in the string to the MSBuild equivalent. - - This list is probably not exhaustive. Add as needed. - """ - if "$" in s: - replace_map = { - "$(ConfigurationName)": "$(Configuration)", - "$(InputDir)": "%(RelativeDir)", - "$(InputExt)": "%(Extension)", - "$(InputFileName)": "%(Filename)%(Extension)", - "$(InputName)": "%(Filename)", - "$(InputPath)": "%(Identity)", - "$(ParentName)": "$(ProjectFileName)", - "$(PlatformName)": "$(Platform)", - "$(SafeInputName)": "%(Filename)", - } - for old, new in replace_map.items(): - s = s.replace(old, new) - s = FixVCMacroSlashes(s) - return s - - -def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr): - """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). - - Args: - msvs_settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - - Returns: - A dictionary of MSBuild settings. The key is either the MSBuild tool name - or the empty string (for the global settings). The values are themselves - dictionaries of settings and their values. - """ - msbuild_settings = {} - for msvs_tool_name, msvs_tool_settings in msvs_settings.items(): - if msvs_tool_name in _msvs_to_msbuild_converters: - msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name] - for msvs_setting, msvs_value in msvs_tool_settings.items(): - if msvs_setting in msvs_tool: - # Invoke the translation function. - try: - msvs_tool[msvs_setting](msvs_value, msbuild_settings) - except ValueError as e: - print( - "Warning: while converting %s/%s to MSBuild, " - "%s" % (msvs_tool_name, msvs_setting, e), - file=stderr, - ) - else: - _ValidateExclusionSetting( - msvs_setting, - msvs_tool, - ( - "Warning: unrecognized setting %s/%s " - "while converting to MSBuild." - % (msvs_tool_name, msvs_setting) - ), - stderr, - ) - else: - print( - "Warning: unrecognized tool %s while converting to " - "MSBuild." % msvs_tool_name, - file=stderr, - ) - return msbuild_settings - - -def ValidateMSVSSettings(settings, stderr=sys.stderr): - """Validates that the names of the settings are valid for MSVS. - - Args: - settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - """ - _ValidateSettings(_msvs_validators, settings, stderr) - - -def ValidateMSBuildSettings(settings, stderr=sys.stderr): - """Validates that the names of the settings are valid for MSBuild. - - Args: - settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - """ - _ValidateSettings(_msbuild_validators, settings, stderr) - - -def _ValidateSettings(validators, settings, stderr): - """Validates that the settings are valid for MSBuild or MSVS. - - We currently only validate the names of the settings, not their values. - - Args: - validators: A dictionary of tools and their validators. - settings: A dictionary. The key is the tool name. The values are - themselves dictionaries of settings and their values. - stderr: The stream receiving the error messages. - """ - for tool_name in settings: - if tool_name in validators: - tool_validators = validators[tool_name] - for setting, value in settings[tool_name].items(): - if setting in tool_validators: - try: - tool_validators[setting](value) - except ValueError as e: - print( - f"Warning: for {tool_name}/{setting}, {e}", - file=stderr, - ) - else: - _ValidateExclusionSetting( - setting, - tool_validators, - (f"Warning: unrecognized setting {tool_name}/{setting}"), - stderr, - ) - - else: - print("Warning: unrecognized tool %s" % (tool_name), file=stderr) - - -# MSVS and MBuild names of the tools. -_compile = _Tool("VCCLCompilerTool", "ClCompile") -_link = _Tool("VCLinkerTool", "Link") -_midl = _Tool("VCMIDLTool", "Midl") -_rc = _Tool("VCResourceCompilerTool", "ResourceCompile") -_lib = _Tool("VCLibrarianTool", "Lib") -_manifest = _Tool("VCManifestTool", "Manifest") -_masm = _Tool("MASM", "MASM") -_armasm = _Tool("ARMASM", "ARMASM") - - -_AddTool(_compile) -_AddTool(_link) -_AddTool(_midl) -_AddTool(_rc) -_AddTool(_lib) -_AddTool(_manifest) -_AddTool(_masm) -_AddTool(_armasm) -# Add sections only found in the MSBuild settings. -_msbuild_validators[""] = {} -_msbuild_validators["ProjectReference"] = {} -_msbuild_validators["ManifestResourceCompile"] = {} - -# Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and -# ClCompile in MSBuild. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\cl.xml" for -# the schema of the MSBuild ClCompile settings. - -# Options that have the same name in MSVS and MSBuild -_Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I -_Same(_compile, "AdditionalOptions", _string_list) -_Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI -_Same(_compile, "AssemblerListingLocation", _file_name) # /Fa -_Same(_compile, "BrowseInformationFile", _file_name) -_Same(_compile, "BufferSecurityCheck", _boolean) # /GS -_Same(_compile, "DisableLanguageExtensions", _boolean) # /Za -_Same(_compile, "DisableSpecificWarnings", _string_list) # /wd -_Same(_compile, "EnableFiberSafeOptimizations", _boolean) # /GT -_Same(_compile, "EnablePREfast", _boolean) # /analyze Visible='false' -_Same(_compile, "ExpandAttributedSource", _boolean) # /Fx -_Same(_compile, "FloatingPointExceptions", _boolean) # /fp:except -_Same(_compile, "ForceConformanceInForLoopScope", _boolean) # /Zc:forScope -_Same(_compile, "ForcedIncludeFiles", _file_list) # /FI -_Same(_compile, "ForcedUsingFiles", _file_list) # /FU -_Same(_compile, "GenerateXMLDocumentationFiles", _boolean) # /doc -_Same(_compile, "IgnoreStandardIncludePath", _boolean) # /X -_Same(_compile, "MinimalRebuild", _boolean) # /Gm -_Same(_compile, "OmitDefaultLibName", _boolean) # /Zl -_Same(_compile, "OmitFramePointers", _boolean) # /Oy -_Same(_compile, "PreprocessorDefinitions", _string_list) # /D -_Same(_compile, "ProgramDataBaseFileName", _file_name) # /Fd -_Same(_compile, "RuntimeTypeInfo", _boolean) # /GR -_Same(_compile, "ShowIncludes", _boolean) # /showIncludes -_Same(_compile, "SmallerTypeCheck", _boolean) # /RTCc -_Same(_compile, "StringPooling", _boolean) # /GF -_Same(_compile, "SuppressStartupBanner", _boolean) # /nologo -_Same(_compile, "TreatWChar_tAsBuiltInType", _boolean) # /Zc:wchar_t -_Same(_compile, "UndefineAllPreprocessorDefinitions", _boolean) # /u -_Same(_compile, "UndefinePreprocessorDefinitions", _string_list) # /U -_Same(_compile, "UseFullPaths", _boolean) # /FC -_Same(_compile, "WholeProgramOptimization", _boolean) # /GL -_Same(_compile, "XMLDocumentationFileName", _file_name) -_Same(_compile, "CompileAsWinRT", _boolean) # /ZW - -_Same( - _compile, - "AssemblerOutput", - _Enumeration( - [ - "NoListing", - "AssemblyCode", # /FA - "All", # /FAcs - "AssemblyAndMachineCode", # /FAc - "AssemblyAndSourceCode", - ] - ), -) # /FAs -_Same( - _compile, - "BasicRuntimeChecks", - _Enumeration( - [ - "Default", - "StackFrameRuntimeCheck", # /RTCs - "UninitializedLocalUsageCheck", # /RTCu - "EnableFastChecks", - ] - ), -) # /RTC1 -_Same( - _compile, "BrowseInformation", _Enumeration(["false", "true", "true"]) # /FR -) # /Fr -_Same( - _compile, - "CallingConvention", - _Enumeration(["Cdecl", "FastCall", "StdCall", "VectorCall"]), # /Gd # /Gr # /Gz -) # /Gv -_Same( - _compile, - "CompileAs", - _Enumeration(["Default", "CompileAsC", "CompileAsCpp"]), # /TC -) # /TP -_Same( - _compile, - "DebugInformationFormat", - _Enumeration( - [ - "", # Disabled - "OldStyle", # /Z7 - None, - "ProgramDatabase", # /Zi - "EditAndContinue", - ] - ), -) # /ZI -_Same( - _compile, - "EnableEnhancedInstructionSet", - _Enumeration( - [ - "NotSet", - "StreamingSIMDExtensions", # /arch:SSE - "StreamingSIMDExtensions2", # /arch:SSE2 - "AdvancedVectorExtensions", # /arch:AVX (vs2012+) - "NoExtensions", # /arch:IA32 (vs2012+) - # This one only exists in the new msbuild format. - "AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+) - ] - ), -) -_Same( - _compile, - "ErrorReporting", - _Enumeration( - [ - "None", # /errorReport:none - "Prompt", # /errorReport:prompt - "Queue", - ], # /errorReport:queue - new=["Send"], - ), -) # /errorReport:send" -_Same( - _compile, - "ExceptionHandling", - _Enumeration(["false", "Sync", "Async"], new=["SyncCThrow"]), # /EHsc # /EHa -) # /EHs -_Same( - _compile, "FavorSizeOrSpeed", _Enumeration(["Neither", "Speed", "Size"]) # /Ot -) # /Os -_Same( - _compile, - "FloatingPointModel", - _Enumeration(["Precise", "Strict", "Fast"]), # /fp:precise # /fp:strict -) # /fp:fast -_Same( - _compile, - "InlineFunctionExpansion", - _Enumeration( - ["Default", "OnlyExplicitInline", "AnySuitable"], # /Ob1 # /Ob2 - new=["Disabled"], - ), -) # /Ob0 -_Same( - _compile, - "Optimization", - _Enumeration(["Disabled", "MinSpace", "MaxSpeed", "Full"]), # /Od # /O1 # /O2 -) # /Ox -_Same( - _compile, - "RuntimeLibrary", - _Enumeration( - [ - "MultiThreaded", # /MT - "MultiThreadedDebug", # /MTd - "MultiThreadedDLL", # /MD - "MultiThreadedDebugDLL", - ] - ), -) # /MDd -_Same( - _compile, - "StructMemberAlignment", - _Enumeration( - [ - "Default", - "1Byte", # /Zp1 - "2Bytes", # /Zp2 - "4Bytes", # /Zp4 - "8Bytes", # /Zp8 - "16Bytes", - ] - ), -) # /Zp16 -_Same( - _compile, - "WarningLevel", - _Enumeration( - [ - "TurnOffAllWarnings", # /W0 - "Level1", # /W1 - "Level2", # /W2 - "Level3", # /W3 - "Level4", - ], # /W4 - new=["EnableAllWarnings"], - ), -) # /Wall - -# Options found in MSVS that have been renamed in MSBuild. -_Renamed( - _compile, "EnableFunctionLevelLinking", "FunctionLevelLinking", _boolean -) # /Gy -_Renamed(_compile, "EnableIntrinsicFunctions", "IntrinsicFunctions", _boolean) # /Oi -_Renamed(_compile, "KeepComments", "PreprocessKeepComments", _boolean) # /C -_Renamed(_compile, "ObjectFile", "ObjectFileName", _file_name) # /Fo -_Renamed(_compile, "OpenMP", "OpenMPSupport", _boolean) # /openmp -_Renamed( - _compile, "PrecompiledHeaderThrough", "PrecompiledHeaderFile", _file_name -) # Used with /Yc and /Yu -_Renamed( - _compile, "PrecompiledHeaderFile", "PrecompiledHeaderOutputFile", _file_name -) # /Fp -_Renamed( - _compile, - "UsePrecompiledHeader", - "PrecompiledHeader", - _Enumeration( - ["NotUsing", "Create", "Use"] # VS recognized '' for this value too. # /Yc - ), -) # /Yu -_Renamed(_compile, "WarnAsError", "TreatWarningAsError", _boolean) # /WX - -_ConvertedToAdditionalOption(_compile, "DefaultCharIsUnsigned", "/J") - -# MSVS options not found in MSBuild. -_MSVSOnly(_compile, "Detect64BitPortabilityProblems", _boolean) -_MSVSOnly(_compile, "UseUnicodeResponseFiles", _boolean) - -# MSBuild options not found in MSVS. -_MSBuildOnly(_compile, "BuildingInIDE", _boolean) -_MSBuildOnly( - _compile, "CompileAsManaged", _Enumeration([], new=["false", "true"]) -) # /clr -_MSBuildOnly(_compile, "CreateHotpatchableImage", _boolean) # /hotpatch -_MSBuildOnly(_compile, "MultiProcessorCompilation", _boolean) # /MP -_MSBuildOnly(_compile, "PreprocessOutputPath", _string) # /Fi -_MSBuildOnly(_compile, "ProcessorNumber", _integer) # the number of processors -_MSBuildOnly(_compile, "TrackerLogDirectory", _folder_name) -_MSBuildOnly(_compile, "TreatSpecificWarningsAsErrors", _string_list) # /we -_MSBuildOnly(_compile, "UseUnicodeForAssemblerListing", _boolean) # /FAu - -# Defines a setting that needs very customized processing -_CustomGeneratePreprocessedFile(_compile, "GeneratePreprocessedFile") - - -# Directives for converting MSVS VCLinkerTool to MSBuild Link. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\link.xml" for -# the schema of the MSBuild Link settings. - -# Options that have the same name in MSVS and MSBuild -_Same(_link, "AdditionalDependencies", _file_list) -_Same(_link, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH -# /MANIFESTDEPENDENCY: -_Same(_link, "AdditionalManifestDependencies", _file_list) -_Same(_link, "AdditionalOptions", _string_list) -_Same(_link, "AddModuleNamesToAssembly", _file_list) # /ASSEMBLYMODULE -_Same(_link, "AllowIsolation", _boolean) # /ALLOWISOLATION -_Same(_link, "AssemblyLinkResource", _file_list) # /ASSEMBLYLINKRESOURCE -_Same(_link, "BaseAddress", _string) # /BASE -_Same(_link, "CLRUnmanagedCodeCheck", _boolean) # /CLRUNMANAGEDCODECHECK -_Same(_link, "DelayLoadDLLs", _file_list) # /DELAYLOAD -_Same(_link, "DelaySign", _boolean) # /DELAYSIGN -_Same(_link, "EmbedManagedResourceFile", _file_list) # /ASSEMBLYRESOURCE -_Same(_link, "EnableUAC", _boolean) # /MANIFESTUAC -_Same(_link, "EntryPointSymbol", _string) # /ENTRY -_Same(_link, "ForceSymbolReferences", _file_list) # /INCLUDE -_Same(_link, "FunctionOrder", _file_name) # /ORDER -_Same(_link, "GenerateDebugInformation", _boolean) # /DEBUG -_Same(_link, "GenerateMapFile", _boolean) # /MAP -_Same(_link, "HeapCommitSize", _string) -_Same(_link, "HeapReserveSize", _string) # /HEAP -_Same(_link, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB -_Same(_link, "IgnoreEmbeddedIDL", _boolean) # /IGNOREIDL -_Same(_link, "ImportLibrary", _file_name) # /IMPLIB -_Same(_link, "KeyContainer", _file_name) # /KEYCONTAINER -_Same(_link, "KeyFile", _file_name) # /KEYFILE -_Same(_link, "ManifestFile", _file_name) # /ManifestFile -_Same(_link, "MapExports", _boolean) # /MAPINFO:EXPORTS -_Same(_link, "MapFileName", _file_name) -_Same(_link, "MergedIDLBaseFileName", _file_name) # /IDLOUT -_Same(_link, "MergeSections", _string) # /MERGE -_Same(_link, "MidlCommandFile", _file_name) # /MIDL -_Same(_link, "ModuleDefinitionFile", _file_name) # /DEF -_Same(_link, "OutputFile", _file_name) # /OUT -_Same(_link, "PerUserRedirection", _boolean) -_Same(_link, "Profile", _boolean) # /PROFILE -_Same(_link, "ProfileGuidedDatabase", _file_name) # /PGD -_Same(_link, "ProgramDatabaseFile", _file_name) # /PDB -_Same(_link, "RegisterOutput", _boolean) -_Same(_link, "SetChecksum", _boolean) # /RELEASE -_Same(_link, "StackCommitSize", _string) -_Same(_link, "StackReserveSize", _string) # /STACK -_Same(_link, "StripPrivateSymbols", _file_name) # /PDBSTRIPPED -_Same(_link, "SupportUnloadOfDelayLoadedDLL", _boolean) # /DELAY:UNLOAD -_Same(_link, "SuppressStartupBanner", _boolean) # /NOLOGO -_Same(_link, "SwapRunFromCD", _boolean) # /SWAPRUN:CD -_Same(_link, "TurnOffAssemblyGeneration", _boolean) # /NOASSEMBLY -_Same(_link, "TypeLibraryFile", _file_name) # /TLBOUT -_Same(_link, "TypeLibraryResourceID", _integer) # /TLBID -_Same(_link, "UACUIAccess", _boolean) # /uiAccess='true' -_Same(_link, "Version", _string) # /VERSION - -_Same(_link, "EnableCOMDATFolding", _newly_boolean) # /OPT:ICF -_Same(_link, "FixedBaseAddress", _newly_boolean) # /FIXED -_Same(_link, "LargeAddressAware", _newly_boolean) # /LARGEADDRESSAWARE -_Same(_link, "OptimizeReferences", _newly_boolean) # /OPT:REF -_Same(_link, "RandomizedBaseAddress", _newly_boolean) # /DYNAMICBASE -_Same(_link, "TerminalServerAware", _newly_boolean) # /TSAWARE - -_subsystem_enumeration = _Enumeration( - [ - "NotSet", - "Console", # /SUBSYSTEM:CONSOLE - "Windows", # /SUBSYSTEM:WINDOWS - "Native", # /SUBSYSTEM:NATIVE - "EFI Application", # /SUBSYSTEM:EFI_APPLICATION - "EFI Boot Service Driver", # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER - "EFI ROM", # /SUBSYSTEM:EFI_ROM - "EFI Runtime", # /SUBSYSTEM:EFI_RUNTIME_DRIVER - "WindowsCE", - ], # /SUBSYSTEM:WINDOWSCE - new=["POSIX"], -) # /SUBSYSTEM:POSIX - -_target_machine_enumeration = _Enumeration( - [ - "NotSet", - "MachineX86", # /MACHINE:X86 - None, - "MachineARM", # /MACHINE:ARM - "MachineEBC", # /MACHINE:EBC - "MachineIA64", # /MACHINE:IA64 - None, - "MachineMIPS", # /MACHINE:MIPS - "MachineMIPS16", # /MACHINE:MIPS16 - "MachineMIPSFPU", # /MACHINE:MIPSFPU - "MachineMIPSFPU16", # /MACHINE:MIPSFPU16 - None, - None, - None, - "MachineSH4", # /MACHINE:SH4 - None, - "MachineTHUMB", # /MACHINE:THUMB - "MachineX64", - ] -) # /MACHINE:X64 - -_Same( - _link, "AssemblyDebug", _Enumeration(["", "true", "false"]) # /ASSEMBLYDEBUG -) # /ASSEMBLYDEBUG:DISABLE -_Same( - _link, - "CLRImageType", - _Enumeration( - [ - "Default", - "ForceIJWImage", # /CLRIMAGETYPE:IJW - "ForcePureILImage", # /Switch="CLRIMAGETYPE:PURE - "ForceSafeILImage", - ] - ), -) # /Switch="CLRIMAGETYPE:SAFE -_Same( - _link, - "CLRThreadAttribute", - _Enumeration( - [ - "DefaultThreadingAttribute", # /CLRTHREADATTRIBUTE:NONE - "MTAThreadingAttribute", # /CLRTHREADATTRIBUTE:MTA - "STAThreadingAttribute", - ] - ), -) # /CLRTHREADATTRIBUTE:STA -_Same( - _link, - "DataExecutionPrevention", - _Enumeration(["", "false", "true"]), # /NXCOMPAT:NO -) # /NXCOMPAT -_Same( - _link, - "Driver", - _Enumeration(["NotSet", "Driver", "UpOnly", "WDM"]), # /Driver # /DRIVER:UPONLY -) # /DRIVER:WDM -_Same( - _link, - "LinkTimeCodeGeneration", - _Enumeration( - [ - "Default", - "UseLinkTimeCodeGeneration", # /LTCG - "PGInstrument", # /LTCG:PGInstrument - "PGOptimization", # /LTCG:PGOptimize - "PGUpdate", - ] - ), -) # /LTCG:PGUpdate -_Same( - _link, - "ShowProgress", - _Enumeration( - ["NotSet", "LinkVerbose", "LinkVerboseLib"], # /VERBOSE # /VERBOSE:Lib - new=[ - "LinkVerboseICF", # /VERBOSE:ICF - "LinkVerboseREF", # /VERBOSE:REF - "LinkVerboseSAFESEH", # /VERBOSE:SAFESEH - "LinkVerboseCLR", - ], - ), -) # /VERBOSE:CLR -_Same(_link, "SubSystem", _subsystem_enumeration) -_Same(_link, "TargetMachine", _target_machine_enumeration) -_Same( - _link, - "UACExecutionLevel", - _Enumeration( - [ - "AsInvoker", # /level='asInvoker' - "HighestAvailable", # /level='highestAvailable' - "RequireAdministrator", - ] - ), -) # /level='requireAdministrator' -_Same(_link, "MinimumRequiredVersion", _string) -_Same(_link, "TreatLinkerWarningAsErrors", _boolean) # /WX - - -# Options found in MSVS that have been renamed in MSBuild. -_Renamed( - _link, - "ErrorReporting", - "LinkErrorReporting", - _Enumeration( - [ - "NoErrorReport", # /ERRORREPORT:NONE - "PromptImmediately", # /ERRORREPORT:PROMPT - "QueueForNextLogin", - ], # /ERRORREPORT:QUEUE - new=["SendErrorReport"], - ), -) # /ERRORREPORT:SEND -_Renamed( - _link, "IgnoreDefaultLibraryNames", "IgnoreSpecificDefaultLibraries", _file_list -) # /NODEFAULTLIB -_Renamed(_link, "ResourceOnlyDLL", "NoEntryPoint", _boolean) # /NOENTRY -_Renamed(_link, "SwapRunFromNet", "SwapRunFromNET", _boolean) # /SWAPRUN:NET - -_Moved(_link, "GenerateManifest", "", _boolean) -_Moved(_link, "IgnoreImportLibrary", "", _boolean) -_Moved(_link, "LinkIncremental", "", _newly_boolean) -_Moved(_link, "LinkLibraryDependencies", "ProjectReference", _boolean) -_Moved(_link, "UseLibraryDependencyInputs", "ProjectReference", _boolean) - -# MSVS options not found in MSBuild. -_MSVSOnly(_link, "OptimizeForWindows98", _newly_boolean) -_MSVSOnly(_link, "UseUnicodeResponseFiles", _boolean) - -# MSBuild options not found in MSVS. -_MSBuildOnly(_link, "BuildingInIDE", _boolean) -_MSBuildOnly(_link, "ImageHasSafeExceptionHandlers", _boolean) # /SAFESEH -_MSBuildOnly(_link, "LinkDLL", _boolean) # /DLL Visible='false' -_MSBuildOnly(_link, "LinkStatus", _boolean) # /LTCG:STATUS -_MSBuildOnly(_link, "PreventDllBinding", _boolean) # /ALLOWBIND -_MSBuildOnly(_link, "SupportNobindOfDelayLoadedDLL", _boolean) # /DELAY:NOBIND -_MSBuildOnly(_link, "TrackerLogDirectory", _folder_name) -_MSBuildOnly(_link, "MSDOSStubFileName", _file_name) # /STUB Visible='false' -_MSBuildOnly(_link, "SectionAlignment", _integer) # /ALIGN -_MSBuildOnly(_link, "SpecifySectionAttributes", _string) # /SECTION -_MSBuildOnly( - _link, - "ForceFileOutput", - _Enumeration( - [], - new=[ - "Enabled", # /FORCE - # /FORCE:MULTIPLE - "MultiplyDefinedSymbolOnly", - "UndefinedSymbolOnly", - ], - ), -) # /FORCE:UNRESOLVED -_MSBuildOnly( - _link, - "CreateHotPatchableImage", - _Enumeration( - [], - new=[ - "Enabled", # /FUNCTIONPADMIN - "X86Image", # /FUNCTIONPADMIN:5 - "X64Image", # /FUNCTIONPADMIN:6 - "ItaniumImage", - ], - ), -) # /FUNCTIONPADMIN:16 -_MSBuildOnly( - _link, - "CLRSupportLastError", - _Enumeration( - [], - new=[ - "Enabled", # /CLRSupportLastError - "Disabled", # /CLRSupportLastError:NO - # /CLRSupportLastError:SYSTEMDLL - "SystemDlls", - ], - ), -) - - -# Directives for converting VCResourceCompilerTool to ResourceCompile. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\rc.xml" for -# the schema of the MSBuild ResourceCompile settings. - -_Same(_rc, "AdditionalOptions", _string_list) -_Same(_rc, "AdditionalIncludeDirectories", _folder_list) # /I -_Same(_rc, "Culture", _Integer(msbuild_base=16)) -_Same(_rc, "IgnoreStandardIncludePath", _boolean) # /X -_Same(_rc, "PreprocessorDefinitions", _string_list) # /D -_Same(_rc, "ResourceOutputFileName", _string) # /fo -_Same(_rc, "ShowProgress", _boolean) # /v -# There is no UI in VisualStudio 2008 to set the following properties. -# However they are found in CL and other tools. Include them here for -# completeness, as they are very likely to have the same usage pattern. -_Same(_rc, "SuppressStartupBanner", _boolean) # /nologo -_Same(_rc, "UndefinePreprocessorDefinitions", _string_list) # /u - -# MSBuild options not found in MSVS. -_MSBuildOnly(_rc, "NullTerminateStrings", _boolean) # /n -_MSBuildOnly(_rc, "TrackerLogDirectory", _folder_name) - - -# Directives for converting VCMIDLTool to Midl. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\midl.xml" for -# the schema of the MSBuild Midl settings. - -_Same(_midl, "AdditionalIncludeDirectories", _folder_list) # /I -_Same(_midl, "AdditionalOptions", _string_list) -_Same(_midl, "CPreprocessOptions", _string) # /cpp_opt -_Same(_midl, "ErrorCheckAllocations", _boolean) # /error allocation -_Same(_midl, "ErrorCheckBounds", _boolean) # /error bounds_check -_Same(_midl, "ErrorCheckEnumRange", _boolean) # /error enum -_Same(_midl, "ErrorCheckRefPointers", _boolean) # /error ref -_Same(_midl, "ErrorCheckStubData", _boolean) # /error stub_data -_Same(_midl, "GenerateStublessProxies", _boolean) # /Oicf -_Same(_midl, "GenerateTypeLibrary", _boolean) -_Same(_midl, "HeaderFileName", _file_name) # /h -_Same(_midl, "IgnoreStandardIncludePath", _boolean) # /no_def_idir -_Same(_midl, "InterfaceIdentifierFileName", _file_name) # /iid -_Same(_midl, "MkTypLibCompatible", _boolean) # /mktyplib203 -_Same(_midl, "OutputDirectory", _string) # /out -_Same(_midl, "PreprocessorDefinitions", _string_list) # /D -_Same(_midl, "ProxyFileName", _file_name) # /proxy -_Same(_midl, "RedirectOutputAndErrors", _file_name) # /o -_Same(_midl, "SuppressStartupBanner", _boolean) # /nologo -_Same(_midl, "TypeLibraryName", _file_name) # /tlb -_Same(_midl, "UndefinePreprocessorDefinitions", _string_list) # /U -_Same(_midl, "WarnAsError", _boolean) # /WX - -_Same( - _midl, - "DefaultCharType", - _Enumeration(["Unsigned", "Signed", "Ascii"]), # /char unsigned # /char signed -) # /char ascii7 -_Same( - _midl, - "TargetEnvironment", - _Enumeration( - [ - "NotSet", - "Win32", # /env win32 - "Itanium", # /env ia64 - "X64", # /env x64 - "ARM64", # /env arm64 - ] - ), -) -_Same( - _midl, - "EnableErrorChecks", - _Enumeration(["EnableCustom", "None", "All"]), # /error none -) # /error all -_Same( - _midl, - "StructMemberAlignment", - _Enumeration(["NotSet", "1", "2", "4", "8"]), # Zp1 # Zp2 # Zp4 -) # Zp8 -_Same( - _midl, - "WarningLevel", - _Enumeration(["0", "1", "2", "3", "4"]), # /W0 # /W1 # /W2 # /W3 -) # /W4 - -_Renamed(_midl, "DLLDataFileName", "DllDataFileName", _file_name) # /dlldata -_Renamed(_midl, "ValidateParameters", "ValidateAllParameters", _boolean) # /robust - -# MSBuild options not found in MSVS. -_MSBuildOnly(_midl, "ApplicationConfigurationMode", _boolean) # /app_config -_MSBuildOnly(_midl, "ClientStubFile", _file_name) # /cstub -_MSBuildOnly( - _midl, "GenerateClientFiles", _Enumeration([], new=["Stub", "None"]) # /client stub -) # /client none -_MSBuildOnly( - _midl, "GenerateServerFiles", _Enumeration([], new=["Stub", "None"]) # /client stub -) # /client none -_MSBuildOnly(_midl, "LocaleID", _integer) # /lcid DECIMAL -_MSBuildOnly(_midl, "ServerStubFile", _file_name) # /sstub -_MSBuildOnly(_midl, "SuppressCompilerWarnings", _boolean) # /no_warn -_MSBuildOnly(_midl, "TrackerLogDirectory", _folder_name) -_MSBuildOnly( - _midl, "TypeLibFormat", _Enumeration([], new=["NewFormat", "OldFormat"]) # /newtlb -) # /oldtlb - - -# Directives for converting VCLibrarianTool to Lib. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\lib.xml" for -# the schema of the MSBuild Lib settings. - -_Same(_lib, "AdditionalDependencies", _file_list) -_Same(_lib, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH -_Same(_lib, "AdditionalOptions", _string_list) -_Same(_lib, "ExportNamedFunctions", _string_list) # /EXPORT -_Same(_lib, "ForceSymbolReferences", _string) # /INCLUDE -_Same(_lib, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB -_Same(_lib, "IgnoreSpecificDefaultLibraries", _file_list) # /NODEFAULTLIB -_Same(_lib, "ModuleDefinitionFile", _file_name) # /DEF -_Same(_lib, "OutputFile", _file_name) # /OUT -_Same(_lib, "SuppressStartupBanner", _boolean) # /NOLOGO -_Same(_lib, "UseUnicodeResponseFiles", _boolean) -_Same(_lib, "LinkTimeCodeGeneration", _boolean) # /LTCG -_Same(_lib, "TargetMachine", _target_machine_enumeration) - -# TODO(jeanluc) _link defines the same value that gets moved to -# ProjectReference. We may want to validate that they are consistent. -_Moved(_lib, "LinkLibraryDependencies", "ProjectReference", _boolean) - -_MSBuildOnly(_lib, "DisplayLibrary", _string) # /LIST Visible='false' -_MSBuildOnly( - _lib, - "ErrorReporting", - _Enumeration( - [], - new=[ - "PromptImmediately", # /ERRORREPORT:PROMPT - "QueueForNextLogin", # /ERRORREPORT:QUEUE - "SendErrorReport", # /ERRORREPORT:SEND - "NoErrorReport", - ], - ), -) # /ERRORREPORT:NONE -_MSBuildOnly(_lib, "MinimumRequiredVersion", _string) -_MSBuildOnly(_lib, "Name", _file_name) # /NAME -_MSBuildOnly(_lib, "RemoveObjects", _file_list) # /REMOVE -_MSBuildOnly(_lib, "SubSystem", _subsystem_enumeration) -_MSBuildOnly(_lib, "TrackerLogDirectory", _folder_name) -_MSBuildOnly(_lib, "TreatLibWarningAsErrors", _boolean) # /WX -_MSBuildOnly(_lib, "Verbose", _boolean) - - -# Directives for converting VCManifestTool to Mt. -# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\mt.xml" for -# the schema of the MSBuild Lib settings. - -# Options that have the same name in MSVS and MSBuild -_Same(_manifest, "AdditionalManifestFiles", _file_list) # /manifest -_Same(_manifest, "AdditionalOptions", _string_list) -_Same(_manifest, "AssemblyIdentity", _string) # /identity: -_Same(_manifest, "ComponentFileName", _file_name) # /dll -_Same(_manifest, "GenerateCatalogFiles", _boolean) # /makecdfs -_Same(_manifest, "InputResourceManifests", _string) # /inputresource -_Same(_manifest, "OutputManifestFile", _file_name) # /out -_Same(_manifest, "RegistrarScriptFile", _file_name) # /rgs -_Same(_manifest, "ReplacementsFile", _file_name) # /replacements -_Same(_manifest, "SuppressStartupBanner", _boolean) # /nologo -_Same(_manifest, "TypeLibraryFile", _file_name) # /tlb: -_Same(_manifest, "UpdateFileHashes", _boolean) # /hashupdate -_Same(_manifest, "UpdateFileHashesSearchPath", _file_name) -_Same(_manifest, "VerboseOutput", _boolean) # /verbose - -# Options that have moved location. -_MovedAndRenamed( - _manifest, - "ManifestResourceFile", - "ManifestResourceCompile", - "ResourceOutputFileName", - _file_name, -) -_Moved(_manifest, "EmbedManifest", "", _boolean) - -# MSVS options not found in MSBuild. -_MSVSOnly(_manifest, "DependencyInformationFile", _file_name) -_MSVSOnly(_manifest, "UseFAT32Workaround", _boolean) -_MSVSOnly(_manifest, "UseUnicodeResponseFiles", _boolean) - -# MSBuild options not found in MSVS. -_MSBuildOnly(_manifest, "EnableDPIAwareness", _boolean) -_MSBuildOnly(_manifest, "GenerateCategoryTags", _boolean) # /category -_MSBuildOnly( - _manifest, "ManifestFromManagedAssembly", _file_name -) # /managedassemblyname -_MSBuildOnly(_manifest, "OutputResourceManifests", _string) # /outputresource -_MSBuildOnly(_manifest, "SuppressDependencyElement", _boolean) # /nodependency -_MSBuildOnly(_manifest, "TrackerLogDirectory", _folder_name) - - -# Directives for MASM. -# See "$(VCTargetsPath)\BuildCustomizations\masm.xml" for the schema of the -# MSBuild MASM settings. - -# Options that have the same name in MSVS and MSBuild. -_Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py deleted file mode 100755 index 6ca09687a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +++ /dev/null @@ -1,1547 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Unit tests for the MSVSSettings.py file.""" - -import unittest -import gyp.MSVSSettings as MSVSSettings - -from io import StringIO - - -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() - - def _ExpectedWarnings(self, expected): - """Compares recorded lines to expected warnings.""" - self.stderr.seek(0) - actual = self.stderr.read().split("\n") - actual = [line for line in actual if line] - self.assertEqual(sorted(expected), sorted(actual)) - - def testValidateMSVSSettings_tool_names(self): - """Tests that only MSVS tool names are allowed.""" - MSVSSettings.ValidateMSVSSettings( - { - "VCCLCompilerTool": {}, - "VCLinkerTool": {}, - "VCMIDLTool": {}, - "foo": {}, - "VCResourceCompilerTool": {}, - "VCLibrarianTool": {}, - "VCManifestTool": {}, - "ClCompile": {}, - }, - self.stderr, - ) - self._ExpectedWarnings( - ["Warning: unrecognized tool foo", "Warning: unrecognized tool ClCompile"] - ) - - def testValidateMSVSSettings_settings(self): - """Tests that for invalid MSVS settings.""" - MSVSSettings.ValidateMSVSSettings( - { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": ["string1", "string2"], - "AdditionalUsingDirectories": "folder1;folder2", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "0", - "BasicRuntimeChecks": "5", - "BrowseInformation": "fdkslj", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "CallingConvention": "-1", - "CompileAs": "1", - "DebugInformationFormat": "2", - "DefaultCharIsUnsigned": "true", - "Detect64BitPortabilityProblems": "true", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "string1;string2", - "EnableEnhancedInstructionSet": "1", - "EnableFiberSafeOptimizations": "true", - "EnableFunctionLevelLinking": "true", - "EnableIntrinsicFunctions": "true", - "EnablePREfast": "true", - "Enableprefast": "bogus", - "ErrorReporting": "1", - "ExceptionHandling": "1", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "1", - "FloatingPointExceptions": "true", - "FloatingPointModel": "1", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2", - "ForcedUsingFiles": "file1;file2", - "GeneratePreprocessedFile": "1", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "1", - "KeepComments": "true", - "MinimalRebuild": "true", - "ObjectFile": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMP": "true", - "Optimization": "1", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderThrough": "a_file_name", - "PreprocessorDefinitions": "string1;string2", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "1", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1", - "SuppressStartupBanner": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "string1;string2", - "UseFullPaths": "true", - "UsePrecompiledHeader": "1", - "UseUnicodeResponseFiles": "true", - "WarnAsError": "true", - "WarningLevel": "1", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - "ZZXYZ": "bogus", - }, - "VCLinkerTool": { - "AdditionalDependencies": "file1;file2", - "AdditionalDependencies_excluded": "file3", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalManifestDependencies": "file1;file2", - "AdditionalOptions": "a string1", - "AddModuleNamesToAssembly": "file1;file2", - "AllowIsolation": "true", - "AssemblyDebug": "2", - "AssemblyLinkResource": "file1;file2", - "BaseAddress": "a string1", - "CLRImageType": "2", - "CLRThreadAttribute": "2", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "2", - "DelayLoadDLLs": "file1;file2", - "DelaySign": "true", - "Driver": "2", - "EmbedManagedResourceFile": "file1;file2", - "EnableCOMDATFolding": "2", - "EnableUAC": "true", - "EntryPointSymbol": "a string1", - "ErrorReporting": "2", - "FixedBaseAddress": "2", - "ForceSymbolReferences": "file1;file2", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateManifest": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a string1", - "HeapReserveSize": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreDefaultLibraryNames": "file1;file2", - "IgnoreEmbeddedIDL": "true", - "IgnoreImportLibrary": "true", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "2", - "LinkIncremental": "2", - "LinkLibraryDependencies": "true", - "LinkTimeCodeGeneration": "2", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a string1", - "MidlCommandFile": "a_file_name", - "ModuleDefinitionFile": "a_file_name", - "OptimizeForWindows98": "1", - "OptimizeReferences": "2", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "2", - "RegisterOutput": "true", - "ResourceOnlyDLL": "true", - "SetChecksum": "true", - "ShowProgress": "2", - "StackCommitSize": "a string1", - "StackReserveSize": "a string1", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "2", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNet": "true", - "TargetMachine": "2", - "TerminalServerAware": "2", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "2", - "UACUIAccess": "true", - "UseLibraryDependencyInputs": "true", - "UseUnicodeResponseFiles": "true", - "Version": "a string1", - }, - "VCMIDLTool": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "CPreprocessOptions": "a string1", - "DefaultCharType": "1", - "DLLDataFileName": "a_file_name", - "EnableErrorChecks": "1", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "MkTypLibCompatible": "true", - "notgood": "bogus", - "OutputDirectory": "a string1", - "PreprocessorDefinitions": "string1;string2", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "StructMemberAlignment": "1", - "SuppressStartupBanner": "true", - "TargetEnvironment": "1", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "string1;string2", - "ValidateParameters": "true", - "WarnAsError": "true", - "WarningLevel": "1", - }, - "VCResourceCompilerTool": { - "AdditionalOptions": "a string1", - "AdditionalIncludeDirectories": "folder1;folder2", - "Culture": "1003", - "IgnoreStandardIncludePath": "true", - "notgood2": "bogus", - "PreprocessorDefinitions": "string1;string2", - "ResourceOutputFileName": "a string1", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "UndefinePreprocessorDefinitions": "string1;string2", - }, - "VCLibrarianTool": { - "AdditionalDependencies": "file1;file2", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "ExportNamedFunctions": "string1;string2", - "ForceSymbolReferences": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2", - "LinkLibraryDependencies": "true", - "ModuleDefinitionFile": "a_file_name", - "OutputFile": "a_file_name", - "SuppressStartupBanner": "true", - "UseUnicodeResponseFiles": "true", - }, - "VCManifestTool": { - "AdditionalManifestFiles": "file1;file2", - "AdditionalOptions": "a string1", - "AssemblyIdentity": "a string1", - "ComponentFileName": "a_file_name", - "DependencyInformationFile": "a_file_name", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "a string1", - "ManifestResourceFile": "a_file_name", - "OutputManifestFile": "a_file_name", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressStartupBanner": "true", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "truel", - "UpdateFileHashesSearchPath": "a_file_name", - "UseFAT32Workaround": "true", - "UseUnicodeResponseFiles": "true", - "VerboseOutput": "true", - }, - }, - self.stderr, - ) - self._ExpectedWarnings( - [ - "Warning: for VCCLCompilerTool/BasicRuntimeChecks, " - "index value (5) not in expected range [0, 4)", - "Warning: for VCCLCompilerTool/BrowseInformation, " - "invalid literal for int() with base 10: 'fdkslj'", - "Warning: for VCCLCompilerTool/CallingConvention, " - "index value (-1) not in expected range [0, 4)", - "Warning: for VCCLCompilerTool/DebugInformationFormat, " - "converted value for 2 not specified.", - "Warning: unrecognized setting VCCLCompilerTool/Enableprefast", - "Warning: unrecognized setting VCCLCompilerTool/ZZXYZ", - "Warning: for VCLinkerTool/TargetMachine, " - "converted value for 2 not specified.", - "Warning: unrecognized setting VCMIDLTool/notgood", - "Warning: unrecognized setting VCResourceCompilerTool/notgood2", - "Warning: for VCManifestTool/UpdateFileHashes, " - "expected bool; got 'truel'" - "", - ] - ) - - def testValidateMSBuildSettings_settings(self): - """Tests that for invalid MSBuild settings.""" - MSVSSettings.ValidateMSBuildSettings( - { - "ClCompile": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": ["string1", "string2"], - "AdditionalUsingDirectories": "folder1;folder2", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "NoListing", - "BasicRuntimeChecks": "StackFrameRuntimeCheck", - "BrowseInformation": "false", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "BuildingInIDE": "true", - "CallingConvention": "Cdecl", - "CompileAs": "CompileAsC", - "CompileAsManaged": "true", - "CreateHotpatchableImage": "true", - "DebugInformationFormat": "ProgramDatabase", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "string1;string2", - "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", - "EnableFiberSafeOptimizations": "true", - "EnablePREfast": "true", - "Enableprefast": "bogus", - "ErrorReporting": "Prompt", - "ExceptionHandling": "SyncCThrow", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "Neither", - "FloatingPointExceptions": "true", - "FloatingPointModel": "Precise", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2", - "ForcedUsingFiles": "file1;file2", - "FunctionLevelLinking": "false", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "OnlyExplicitInline", - "IntrinsicFunctions": "false", - "MinimalRebuild": "true", - "MultiProcessorCompilation": "true", - "ObjectFileName": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMPSupport": "true", - "Optimization": "Disabled", - "PrecompiledHeader": "NotUsing", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderOutputFile": "a_file_name", - "PreprocessKeepComments": "true", - "PreprocessorDefinitions": "string1;string2", - "PreprocessOutputPath": "a string1", - "PreprocessSuppressLineNumbers": "false", - "PreprocessToFile": "false", - "ProcessorNumber": "33", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "MultiThreaded", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1Byte", - "SuppressStartupBanner": "true", - "TrackerLogDirectory": "a_folder", - "TreatSpecificWarningsAsErrors": "string1;string2", - "TreatWarningAsError": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "string1;string2", - "UseFullPaths": "true", - "UseUnicodeForAssemblerListing": "true", - "WarningLevel": "TurnOffAllWarnings", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - "ZZXYZ": "bogus", - }, - "Link": { - "AdditionalDependencies": "file1;file2", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalManifestDependencies": "file1;file2", - "AdditionalOptions": "a string1", - "AddModuleNamesToAssembly": "file1;file2", - "AllowIsolation": "true", - "AssemblyDebug": "", - "AssemblyLinkResource": "file1;file2", - "BaseAddress": "a string1", - "BuildingInIDE": "true", - "CLRImageType": "ForceIJWImage", - "CLRSupportLastError": "Enabled", - "CLRThreadAttribute": "MTAThreadingAttribute", - "CLRUnmanagedCodeCheck": "true", - "CreateHotPatchableImage": "X86Image", - "DataExecutionPrevention": "false", - "DelayLoadDLLs": "file1;file2", - "DelaySign": "true", - "Driver": "NotSet", - "EmbedManagedResourceFile": "file1;file2", - "EnableCOMDATFolding": "false", - "EnableUAC": "true", - "EntryPointSymbol": "a string1", - "FixedBaseAddress": "false", - "ForceFileOutput": "Enabled", - "ForceSymbolReferences": "file1;file2", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a string1", - "HeapReserveSize": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreEmbeddedIDL": "true", - "IgnoreSpecificDefaultLibraries": "a_file_list", - "ImageHasSafeExceptionHandlers": "true", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "false", - "LinkDLL": "true", - "LinkErrorReporting": "SendErrorReport", - "LinkStatus": "true", - "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a string1", - "MidlCommandFile": "a_file_name", - "MinimumRequiredVersion": "a string1", - "ModuleDefinitionFile": "a_file_name", - "MSDOSStubFileName": "a_file_name", - "NoEntryPoint": "true", - "OptimizeReferences": "false", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "PreventDllBinding": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "false", - "RegisterOutput": "true", - "SectionAlignment": "33", - "SetChecksum": "true", - "ShowProgress": "LinkVerboseREF", - "SpecifySectionAttributes": "a string1", - "StackCommitSize": "a string1", - "StackReserveSize": "a string1", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "Console", - "SupportNobindOfDelayLoadedDLL": "true", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNET": "true", - "TargetMachine": "MachineX86", - "TerminalServerAware": "false", - "TrackerLogDirectory": "a_folder", - "TreatLinkerWarningAsErrors": "true", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "AsInvoker", - "UACUIAccess": "true", - "Version": "a string1", - }, - "ResourceCompile": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "Culture": "0x236", - "IgnoreStandardIncludePath": "true", - "NullTerminateStrings": "true", - "PreprocessorDefinitions": "string1;string2", - "ResourceOutputFileName": "a string1", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "TrackerLogDirectory": "a_folder", - "UndefinePreprocessorDefinitions": "string1;string2", - }, - "Midl": { - "AdditionalIncludeDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "ApplicationConfigurationMode": "true", - "ClientStubFile": "a_file_name", - "CPreprocessOptions": "a string1", - "DefaultCharType": "Signed", - "DllDataFileName": "a_file_name", - "EnableErrorChecks": "EnableCustom", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateClientFiles": "Stub", - "GenerateServerFiles": "None", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "LocaleID": "33", - "MkTypLibCompatible": "true", - "OutputDirectory": "a string1", - "PreprocessorDefinitions": "string1;string2", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "ServerStubFile": "a_file_name", - "StructMemberAlignment": "NotSet", - "SuppressCompilerWarnings": "true", - "SuppressStartupBanner": "true", - "TargetEnvironment": "Itanium", - "TrackerLogDirectory": "a_folder", - "TypeLibFormat": "NewFormat", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "string1;string2", - "ValidateAllParameters": "true", - "WarnAsError": "true", - "WarningLevel": "1", - }, - "Lib": { - "AdditionalDependencies": "file1;file2", - "AdditionalLibraryDirectories": "folder1;folder2", - "AdditionalOptions": "a string1", - "DisplayLibrary": "a string1", - "ErrorReporting": "PromptImmediately", - "ExportNamedFunctions": "string1;string2", - "ForceSymbolReferences": "a string1", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2", - "LinkTimeCodeGeneration": "true", - "MinimumRequiredVersion": "a string1", - "ModuleDefinitionFile": "a_file_name", - "Name": "a_file_name", - "OutputFile": "a_file_name", - "RemoveObjects": "file1;file2", - "SubSystem": "Console", - "SuppressStartupBanner": "true", - "TargetMachine": "MachineX86i", - "TrackerLogDirectory": "a_folder", - "TreatLibWarningAsErrors": "true", - "UseUnicodeResponseFiles": "true", - "Verbose": "true", - }, - "Manifest": { - "AdditionalManifestFiles": "file1;file2", - "AdditionalOptions": "a string1", - "AssemblyIdentity": "a string1", - "ComponentFileName": "a_file_name", - "EnableDPIAwareness": "fal", - "GenerateCatalogFiles": "truel", - "GenerateCategoryTags": "true", - "InputResourceManifests": "a string1", - "ManifestFromManagedAssembly": "a_file_name", - "notgood3": "bogus", - "OutputManifestFile": "a_file_name", - "OutputResourceManifests": "a string1", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressDependencyElement": "true", - "SuppressStartupBanner": "true", - "TrackerLogDirectory": "a_folder", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "a_file_name", - "VerboseOutput": "true", - }, - "ProjectReference": { - "LinkLibraryDependencies": "true", - "UseLibraryDependencyInputs": "true", - }, - "ManifestResourceCompile": {"ResourceOutputFileName": "a_file_name"}, - "": { - "EmbedManifest": "true", - "GenerateManifest": "true", - "IgnoreImportLibrary": "true", - "LinkIncremental": "false", - }, - }, - self.stderr, - ) - self._ExpectedWarnings( - [ - "Warning: unrecognized setting ClCompile/Enableprefast", - "Warning: unrecognized setting ClCompile/ZZXYZ", - "Warning: unrecognized setting Manifest/notgood3", - "Warning: for Manifest/GenerateCatalogFiles, " - "expected bool; got 'truel'", - "Warning: for Lib/TargetMachine, unrecognized enumerated value " - "MachineX86i", - "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'", - ] - ) - - def testConvertToMSBuildSettings_empty(self): - """Tests an empty conversion.""" - msvs_settings = {} - expected_msbuild_settings = {} - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_minimal(self): - """Tests a minimal conversion.""" - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/foo", - "BasicRuntimeChecks": "0", - }, - "VCLinkerTool": { - "LinkTimeCodeGeneration": "1", - "ErrorReporting": "1", - "DataExecutionPrevention": "2", - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/foo", - "BasicRuntimeChecks": "Default", - }, - "Link": { - "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", - "LinkErrorReporting": "PromptImmediately", - "DataExecutionPrevention": "true", - }, - } - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_warnings(self): - """Tests conversion that generates warnings.""" - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "1", - "AdditionalOptions": "2", - # These are incorrect values: - "BasicRuntimeChecks": "12", - "BrowseInformation": "21", - "UsePrecompiledHeader": "13", - "GeneratePreprocessedFile": "14", - }, - "VCLinkerTool": { - # These are incorrect values: - "Driver": "10", - "LinkTimeCodeGeneration": "31", - "ErrorReporting": "21", - "FixedBaseAddress": "6", - }, - "VCResourceCompilerTool": { - # Custom - "Culture": "1003" - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "1", - "AdditionalOptions": "2", - }, - "Link": {}, - "ResourceCompile": { - # Custom - "Culture": "0x03eb" - }, - } - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings( - [ - "Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to " - "MSBuild, index value (12) not in expected range [0, 4)", - "Warning: while converting VCCLCompilerTool/BrowseInformation to " - "MSBuild, index value (21) not in expected range [0, 3)", - "Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to " - "MSBuild, index value (13) not in expected range [0, 3)", - "Warning: while converting " - "VCCLCompilerTool/GeneratePreprocessedFile to " - "MSBuild, value must be one of [0, 1, 2]; got 14", - "Warning: while converting VCLinkerTool/Driver to " - "MSBuild, index value (10) not in expected range [0, 4)", - "Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to " - "MSBuild, index value (31) not in expected range [0, 5)", - "Warning: while converting VCLinkerTool/ErrorReporting to " - "MSBuild, index value (21) not in expected range [0, 3)", - "Warning: while converting VCLinkerTool/FixedBaseAddress to " - "MSBuild, index value (6) not in expected range [0, 3)", - ] - ) - - def testConvertToMSBuildSettings_full_synthetic(self): - """Tests conversion of all the MSBuild settings.""" - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "AdditionalUsingDirectories": "folder1;folder2;folder3", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "0", - "BasicRuntimeChecks": "1", - "BrowseInformation": "2", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "CallingConvention": "0", - "CompileAs": "1", - "DebugInformationFormat": "4", - "DefaultCharIsUnsigned": "true", - "Detect64BitPortabilityProblems": "true", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "d1;d2;d3", - "EnableEnhancedInstructionSet": "0", - "EnableFiberSafeOptimizations": "true", - "EnableFunctionLevelLinking": "true", - "EnableIntrinsicFunctions": "true", - "EnablePREfast": "true", - "ErrorReporting": "1", - "ExceptionHandling": "2", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "0", - "FloatingPointExceptions": "true", - "FloatingPointModel": "1", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2;file3", - "ForcedUsingFiles": "file1;file2;file3", - "GeneratePreprocessedFile": "1", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "2", - "KeepComments": "true", - "MinimalRebuild": "true", - "ObjectFile": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMP": "true", - "Optimization": "3", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderThrough": "a_file_name", - "PreprocessorDefinitions": "d1;d2;d3", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "0", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1", - "SuppressStartupBanner": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "UseFullPaths": "true", - "UsePrecompiledHeader": "1", - "UseUnicodeResponseFiles": "true", - "WarnAsError": "true", - "WarningLevel": "2", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - }, - "VCLinkerTool": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", - "AdditionalManifestDependencies": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AddModuleNamesToAssembly": "file1;file2;file3", - "AllowIsolation": "true", - "AssemblyDebug": "0", - "AssemblyLinkResource": "file1;file2;file3", - "BaseAddress": "a_string", - "CLRImageType": "1", - "CLRThreadAttribute": "2", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "0", - "DelayLoadDLLs": "file1;file2;file3", - "DelaySign": "true", - "Driver": "1", - "EmbedManagedResourceFile": "file1;file2;file3", - "EnableCOMDATFolding": "0", - "EnableUAC": "true", - "EntryPointSymbol": "a_string", - "ErrorReporting": "0", - "FixedBaseAddress": "1", - "ForceSymbolReferences": "file1;file2;file3", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateManifest": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a_string", - "HeapReserveSize": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreDefaultLibraryNames": "file1;file2;file3", - "IgnoreEmbeddedIDL": "true", - "IgnoreImportLibrary": "true", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "2", - "LinkIncremental": "1", - "LinkLibraryDependencies": "true", - "LinkTimeCodeGeneration": "2", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a_string", - "MidlCommandFile": "a_file_name", - "ModuleDefinitionFile": "a_file_name", - "OptimizeForWindows98": "1", - "OptimizeReferences": "0", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "1", - "RegisterOutput": "true", - "ResourceOnlyDLL": "true", - "SetChecksum": "true", - "ShowProgress": "0", - "StackCommitSize": "a_string", - "StackReserveSize": "a_string", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "2", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNet": "true", - "TargetMachine": "3", - "TerminalServerAware": "2", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "1", - "UACUIAccess": "true", - "UseLibraryDependencyInputs": "false", - "UseUnicodeResponseFiles": "true", - "Version": "a_string", - }, - "VCResourceCompilerTool": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "Culture": "1003", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "d1;d2;d3", - "ResourceOutputFileName": "a_string", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - }, - "VCMIDLTool": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "CPreprocessOptions": "a_string", - "DefaultCharType": "0", - "DLLDataFileName": "a_file_name", - "EnableErrorChecks": "2", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "MkTypLibCompatible": "true", - "OutputDirectory": "a_string", - "PreprocessorDefinitions": "d1;d2;d3", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "StructMemberAlignment": "3", - "SuppressStartupBanner": "true", - "TargetEnvironment": "1", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "ValidateParameters": "true", - "WarnAsError": "true", - "WarningLevel": "4", - }, - "VCLibrarianTool": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "ExportNamedFunctions": "d1;d2;d3", - "ForceSymbolReferences": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2;file3", - "LinkLibraryDependencies": "true", - "ModuleDefinitionFile": "a_file_name", - "OutputFile": "a_file_name", - "SuppressStartupBanner": "true", - "UseUnicodeResponseFiles": "true", - }, - "VCManifestTool": { - "AdditionalManifestFiles": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AssemblyIdentity": "a_string", - "ComponentFileName": "a_file_name", - "DependencyInformationFile": "a_file_name", - "EmbedManifest": "true", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "a_string", - "ManifestResourceFile": "my_name", - "OutputManifestFile": "a_file_name", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressStartupBanner": "true", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "a_file_name", - "UseFAT32Workaround": "true", - "UseUnicodeResponseFiles": "true", - "VerboseOutput": "true", - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string /J", - "AdditionalUsingDirectories": "folder1;folder2;folder3", - "AssemblerListingLocation": "a_file_name", - "AssemblerOutput": "NoListing", - "BasicRuntimeChecks": "StackFrameRuntimeCheck", - "BrowseInformation": "true", - "BrowseInformationFile": "a_file_name", - "BufferSecurityCheck": "true", - "CallingConvention": "Cdecl", - "CompileAs": "CompileAsC", - "DebugInformationFormat": "EditAndContinue", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "d1;d2;d3", - "EnableEnhancedInstructionSet": "NotSet", - "EnableFiberSafeOptimizations": "true", - "EnablePREfast": "true", - "ErrorReporting": "Prompt", - "ExceptionHandling": "Async", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "Neither", - "FloatingPointExceptions": "true", - "FloatingPointModel": "Strict", - "ForceConformanceInForLoopScope": "true", - "ForcedIncludeFiles": "file1;file2;file3", - "ForcedUsingFiles": "file1;file2;file3", - "FunctionLevelLinking": "true", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "AnySuitable", - "IntrinsicFunctions": "true", - "MinimalRebuild": "true", - "ObjectFileName": "a_file_name", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMPSupport": "true", - "Optimization": "Full", - "PrecompiledHeader": "Create", - "PrecompiledHeaderFile": "a_file_name", - "PrecompiledHeaderOutputFile": "a_file_name", - "PreprocessKeepComments": "true", - "PreprocessorDefinitions": "d1;d2;d3", - "PreprocessSuppressLineNumbers": "false", - "PreprocessToFile": "true", - "ProgramDataBaseFileName": "a_file_name", - "RuntimeLibrary": "MultiThreaded", - "RuntimeTypeInfo": "true", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "1Byte", - "SuppressStartupBanner": "true", - "TreatWarningAsError": "true", - "TreatWChar_tAsBuiltInType": "true", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "UseFullPaths": "true", - "WarningLevel": "Level2", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "a_file_name", - }, - "Link": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalManifestDependencies": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AddModuleNamesToAssembly": "file1;file2;file3", - "AllowIsolation": "true", - "AssemblyDebug": "", - "AssemblyLinkResource": "file1;file2;file3", - "BaseAddress": "a_string", - "CLRImageType": "ForceIJWImage", - "CLRThreadAttribute": "STAThreadingAttribute", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "", - "DelayLoadDLLs": "file1;file2;file3", - "DelaySign": "true", - "Driver": "Driver", - "EmbedManagedResourceFile": "file1;file2;file3", - "EnableCOMDATFolding": "", - "EnableUAC": "true", - "EntryPointSymbol": "a_string", - "FixedBaseAddress": "false", - "ForceSymbolReferences": "file1;file2;file3", - "FunctionOrder": "a_file_name", - "GenerateDebugInformation": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "a_string", - "HeapReserveSize": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreEmbeddedIDL": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2;file3", - "ImportLibrary": "a_file_name", - "KeyContainer": "a_file_name", - "KeyFile": "a_file_name", - "LargeAddressAware": "true", - "LinkErrorReporting": "NoErrorReport", - "LinkTimeCodeGeneration": "PGInstrument", - "ManifestFile": "a_file_name", - "MapExports": "true", - "MapFileName": "a_file_name", - "MergedIDLBaseFileName": "a_file_name", - "MergeSections": "a_string", - "MidlCommandFile": "a_file_name", - "ModuleDefinitionFile": "a_file_name", - "NoEntryPoint": "true", - "OptimizeReferences": "", - "OutputFile": "a_file_name", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "a_file_name", - "ProgramDatabaseFile": "a_file_name", - "RandomizedBaseAddress": "false", - "RegisterOutput": "true", - "SetChecksum": "true", - "ShowProgress": "NotSet", - "StackCommitSize": "a_string", - "StackReserveSize": "a_string", - "StripPrivateSymbols": "a_file_name", - "SubSystem": "Windows", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "true", - "SwapRunFromCD": "true", - "SwapRunFromNET": "true", - "TargetMachine": "MachineARM", - "TerminalServerAware": "true", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "a_file_name", - "TypeLibraryResourceID": "33", - "UACExecutionLevel": "HighestAvailable", - "UACUIAccess": "true", - "Version": "a_string", - }, - "ResourceCompile": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "Culture": "0x03eb", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "d1;d2;d3", - "ResourceOutputFileName": "a_string", - "ShowProgress": "true", - "SuppressStartupBanner": "true", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - }, - "Midl": { - "AdditionalIncludeDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "CPreprocessOptions": "a_string", - "DefaultCharType": "Unsigned", - "DllDataFileName": "a_file_name", - "EnableErrorChecks": "All", - "ErrorCheckAllocations": "true", - "ErrorCheckBounds": "true", - "ErrorCheckEnumRange": "true", - "ErrorCheckRefPointers": "true", - "ErrorCheckStubData": "true", - "GenerateStublessProxies": "true", - "GenerateTypeLibrary": "true", - "HeaderFileName": "a_file_name", - "IgnoreStandardIncludePath": "true", - "InterfaceIdentifierFileName": "a_file_name", - "MkTypLibCompatible": "true", - "OutputDirectory": "a_string", - "PreprocessorDefinitions": "d1;d2;d3", - "ProxyFileName": "a_file_name", - "RedirectOutputAndErrors": "a_file_name", - "StructMemberAlignment": "4", - "SuppressStartupBanner": "true", - "TargetEnvironment": "Win32", - "TypeLibraryName": "a_file_name", - "UndefinePreprocessorDefinitions": "d1;d2;d3", - "ValidateAllParameters": "true", - "WarnAsError": "true", - "WarningLevel": "4", - }, - "Lib": { - "AdditionalDependencies": "file1;file2;file3", - "AdditionalLibraryDirectories": "folder1;folder2;folder3", - "AdditionalOptions": "a_string", - "ExportNamedFunctions": "d1;d2;d3", - "ForceSymbolReferences": "a_string", - "IgnoreAllDefaultLibraries": "true", - "IgnoreSpecificDefaultLibraries": "file1;file2;file3", - "ModuleDefinitionFile": "a_file_name", - "OutputFile": "a_file_name", - "SuppressStartupBanner": "true", - "UseUnicodeResponseFiles": "true", - }, - "Manifest": { - "AdditionalManifestFiles": "file1;file2;file3", - "AdditionalOptions": "a_string", - "AssemblyIdentity": "a_string", - "ComponentFileName": "a_file_name", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "a_string", - "OutputManifestFile": "a_file_name", - "RegistrarScriptFile": "a_file_name", - "ReplacementsFile": "a_file_name", - "SuppressStartupBanner": "true", - "TypeLibraryFile": "a_file_name", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "a_file_name", - "VerboseOutput": "true", - }, - "ManifestResourceCompile": {"ResourceOutputFileName": "my_name"}, - "ProjectReference": { - "LinkLibraryDependencies": "true", - "UseLibraryDependencyInputs": "false", - }, - "": { - "EmbedManifest": "true", - "GenerateManifest": "true", - "IgnoreImportLibrary": "true", - "LinkIncremental": "false", - }, - } - self.maxDiff = 9999 # on failure display a long diff - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_actual(self): - """Tests the conversion of an actual project. - - A VS2008 project with most of the options defined was created through the - VS2008 IDE. It was then converted to VS2010. The tool settings found in - the .vcproj and .vcxproj files were converted to the two dictionaries - msvs_settings and expected_msbuild_settings. - - Note that for many settings, the VS2010 converter adds macros like - %(AdditionalIncludeDirectories) to make sure than inherited values are - included. Since the Gyp projects we generate do not use inheritance, - we removed these macros. They were: - ClCompile: - AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)' - AdditionalOptions: ' %(AdditionalOptions)' - AdditionalUsingDirectories: ';%(AdditionalUsingDirectories)' - DisableSpecificWarnings: ';%(DisableSpecificWarnings)', - ForcedIncludeFiles: ';%(ForcedIncludeFiles)', - ForcedUsingFiles: ';%(ForcedUsingFiles)', - PreprocessorDefinitions: ';%(PreprocessorDefinitions)', - UndefinePreprocessorDefinitions: - ';%(UndefinePreprocessorDefinitions)', - Link: - AdditionalDependencies: ';%(AdditionalDependencies)', - AdditionalLibraryDirectories: ';%(AdditionalLibraryDirectories)', - AdditionalManifestDependencies: - ';%(AdditionalManifestDependencies)', - AdditionalOptions: ' %(AdditionalOptions)', - AddModuleNamesToAssembly: ';%(AddModuleNamesToAssembly)', - AssemblyLinkResource: ';%(AssemblyLinkResource)', - DelayLoadDLLs: ';%(DelayLoadDLLs)', - EmbedManagedResourceFile: ';%(EmbedManagedResourceFile)', - ForceSymbolReferences: ';%(ForceSymbolReferences)', - IgnoreSpecificDefaultLibraries: - ';%(IgnoreSpecificDefaultLibraries)', - ResourceCompile: - AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)', - AdditionalOptions: ' %(AdditionalOptions)', - PreprocessorDefinitions: ';%(PreprocessorDefinitions)', - Manifest: - AdditionalManifestFiles: ';%(AdditionalManifestFiles)', - AdditionalOptions: ' %(AdditionalOptions)', - InputResourceManifests: ';%(InputResourceManifests)', - """ - msvs_settings = { - "VCCLCompilerTool": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/more", - "AdditionalUsingDirectories": "test", - "AssemblerListingLocation": "$(IntDir)\\a", - "AssemblerOutput": "1", - "BasicRuntimeChecks": "3", - "BrowseInformation": "1", - "BrowseInformationFile": "$(IntDir)\\e", - "BufferSecurityCheck": "false", - "CallingConvention": "1", - "CompileAs": "1", - "DebugInformationFormat": "4", - "DefaultCharIsUnsigned": "true", - "Detect64BitPortabilityProblems": "true", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "abc", - "EnableEnhancedInstructionSet": "1", - "EnableFiberSafeOptimizations": "true", - "EnableFunctionLevelLinking": "true", - "EnableIntrinsicFunctions": "true", - "EnablePREfast": "true", - "ErrorReporting": "2", - "ExceptionHandling": "2", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "2", - "FloatingPointExceptions": "true", - "FloatingPointModel": "1", - "ForceConformanceInForLoopScope": "false", - "ForcedIncludeFiles": "def", - "ForcedUsingFiles": "ge", - "GeneratePreprocessedFile": "2", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "1", - "KeepComments": "true", - "MinimalRebuild": "true", - "ObjectFile": "$(IntDir)\\b", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMP": "true", - "Optimization": "3", - "PrecompiledHeaderFile": "$(IntDir)\\$(TargetName).pche", - "PrecompiledHeaderThrough": "StdAfx.hd", - "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", - "ProgramDataBaseFileName": "$(IntDir)\\vc90b.pdb", - "RuntimeLibrary": "3", - "RuntimeTypeInfo": "false", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "3", - "SuppressStartupBanner": "false", - "TreatWChar_tAsBuiltInType": "false", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "wer", - "UseFullPaths": "true", - "UsePrecompiledHeader": "0", - "UseUnicodeResponseFiles": "false", - "WarnAsError": "true", - "WarningLevel": "3", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "$(IntDir)\\c", - }, - "VCLinkerTool": { - "AdditionalDependencies": "zx", - "AdditionalLibraryDirectories": "asd", - "AdditionalManifestDependencies": "s2", - "AdditionalOptions": "/mor2", - "AddModuleNamesToAssembly": "d1", - "AllowIsolation": "false", - "AssemblyDebug": "1", - "AssemblyLinkResource": "d5", - "BaseAddress": "23423", - "CLRImageType": "3", - "CLRThreadAttribute": "1", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "0", - "DelayLoadDLLs": "d4", - "DelaySign": "true", - "Driver": "2", - "EmbedManagedResourceFile": "d2", - "EnableCOMDATFolding": "1", - "EnableUAC": "false", - "EntryPointSymbol": "f5", - "ErrorReporting": "2", - "FixedBaseAddress": "1", - "ForceSymbolReferences": "d3", - "FunctionOrder": "fssdfsd", - "GenerateDebugInformation": "true", - "GenerateManifest": "false", - "GenerateMapFile": "true", - "HeapCommitSize": "13", - "HeapReserveSize": "12", - "IgnoreAllDefaultLibraries": "true", - "IgnoreDefaultLibraryNames": "flob;flok", - "IgnoreEmbeddedIDL": "true", - "IgnoreImportLibrary": "true", - "ImportLibrary": "f4", - "KeyContainer": "f7", - "KeyFile": "f6", - "LargeAddressAware": "2", - "LinkIncremental": "0", - "LinkLibraryDependencies": "false", - "LinkTimeCodeGeneration": "1", - "ManifestFile": "$(IntDir)\\$(TargetFileName).2intermediate.manifest", - "MapExports": "true", - "MapFileName": "d5", - "MergedIDLBaseFileName": "f2", - "MergeSections": "f5", - "MidlCommandFile": "f1", - "ModuleDefinitionFile": "sdsd", - "OptimizeForWindows98": "2", - "OptimizeReferences": "2", - "OutputFile": "$(OutDir)\\$(ProjectName)2.exe", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", - "ProgramDatabaseFile": "Flob.pdb", - "RandomizedBaseAddress": "1", - "RegisterOutput": "true", - "ResourceOnlyDLL": "true", - "SetChecksum": "false", - "ShowProgress": "1", - "StackCommitSize": "15", - "StackReserveSize": "14", - "StripPrivateSymbols": "d3", - "SubSystem": "1", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "false", - "SwapRunFromCD": "true", - "SwapRunFromNet": "true", - "TargetMachine": "1", - "TerminalServerAware": "1", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "f3", - "TypeLibraryResourceID": "12", - "UACExecutionLevel": "2", - "UACUIAccess": "true", - "UseLibraryDependencyInputs": "true", - "UseUnicodeResponseFiles": "false", - "Version": "333", - }, - "VCResourceCompilerTool": { - "AdditionalIncludeDirectories": "f3", - "AdditionalOptions": "/more3", - "Culture": "3084", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "_UNICODE;UNICODE2", - "ResourceOutputFileName": "$(IntDir)/$(InputName)3.res", - "ShowProgress": "true", - }, - "VCManifestTool": { - "AdditionalManifestFiles": "sfsdfsd", - "AdditionalOptions": "afdsdafsd", - "AssemblyIdentity": "sddfdsadfsa", - "ComponentFileName": "fsdfds", - "DependencyInformationFile": "$(IntDir)\\mt.depdfd", - "EmbedManifest": "false", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "asfsfdafs", - "ManifestResourceFile": - "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf", - "OutputManifestFile": "$(TargetPath).manifestdfs", - "RegistrarScriptFile": "sdfsfd", - "ReplacementsFile": "sdffsd", - "SuppressStartupBanner": "false", - "TypeLibraryFile": "sfsd", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "sfsd", - "UseFAT32Workaround": "true", - "UseUnicodeResponseFiles": "false", - "VerboseOutput": "true", - }, - } - expected_msbuild_settings = { - "ClCompile": { - "AdditionalIncludeDirectories": "dir1", - "AdditionalOptions": "/more /J", - "AdditionalUsingDirectories": "test", - "AssemblerListingLocation": "$(IntDir)a", - "AssemblerOutput": "AssemblyCode", - "BasicRuntimeChecks": "EnableFastChecks", - "BrowseInformation": "true", - "BrowseInformationFile": "$(IntDir)e", - "BufferSecurityCheck": "false", - "CallingConvention": "FastCall", - "CompileAs": "CompileAsC", - "DebugInformationFormat": "EditAndContinue", - "DisableLanguageExtensions": "true", - "DisableSpecificWarnings": "abc", - "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", - "EnableFiberSafeOptimizations": "true", - "EnablePREfast": "true", - "ErrorReporting": "Queue", - "ExceptionHandling": "Async", - "ExpandAttributedSource": "true", - "FavorSizeOrSpeed": "Size", - "FloatingPointExceptions": "true", - "FloatingPointModel": "Strict", - "ForceConformanceInForLoopScope": "false", - "ForcedIncludeFiles": "def", - "ForcedUsingFiles": "ge", - "FunctionLevelLinking": "true", - "GenerateXMLDocumentationFiles": "true", - "IgnoreStandardIncludePath": "true", - "InlineFunctionExpansion": "OnlyExplicitInline", - "IntrinsicFunctions": "true", - "MinimalRebuild": "true", - "ObjectFileName": "$(IntDir)b", - "OmitDefaultLibName": "true", - "OmitFramePointers": "true", - "OpenMPSupport": "true", - "Optimization": "Full", - "PrecompiledHeader": "NotUsing", # Actual conversion gives '' - "PrecompiledHeaderFile": "StdAfx.hd", - "PrecompiledHeaderOutputFile": "$(IntDir)$(TargetName).pche", - "PreprocessKeepComments": "true", - "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", - "PreprocessSuppressLineNumbers": "true", - "PreprocessToFile": "true", - "ProgramDataBaseFileName": "$(IntDir)vc90b.pdb", - "RuntimeLibrary": "MultiThreadedDebugDLL", - "RuntimeTypeInfo": "false", - "ShowIncludes": "true", - "SmallerTypeCheck": "true", - "StringPooling": "true", - "StructMemberAlignment": "4Bytes", - "SuppressStartupBanner": "false", - "TreatWarningAsError": "true", - "TreatWChar_tAsBuiltInType": "false", - "UndefineAllPreprocessorDefinitions": "true", - "UndefinePreprocessorDefinitions": "wer", - "UseFullPaths": "true", - "WarningLevel": "Level3", - "WholeProgramOptimization": "true", - "XMLDocumentationFileName": "$(IntDir)c", - }, - "Link": { - "AdditionalDependencies": "zx", - "AdditionalLibraryDirectories": "asd", - "AdditionalManifestDependencies": "s2", - "AdditionalOptions": "/mor2", - "AddModuleNamesToAssembly": "d1", - "AllowIsolation": "false", - "AssemblyDebug": "true", - "AssemblyLinkResource": "d5", - "BaseAddress": "23423", - "CLRImageType": "ForceSafeILImage", - "CLRThreadAttribute": "MTAThreadingAttribute", - "CLRUnmanagedCodeCheck": "true", - "DataExecutionPrevention": "", - "DelayLoadDLLs": "d4", - "DelaySign": "true", - "Driver": "UpOnly", - "EmbedManagedResourceFile": "d2", - "EnableCOMDATFolding": "false", - "EnableUAC": "false", - "EntryPointSymbol": "f5", - "FixedBaseAddress": "false", - "ForceSymbolReferences": "d3", - "FunctionOrder": "fssdfsd", - "GenerateDebugInformation": "true", - "GenerateMapFile": "true", - "HeapCommitSize": "13", - "HeapReserveSize": "12", - "IgnoreAllDefaultLibraries": "true", - "IgnoreEmbeddedIDL": "true", - "IgnoreSpecificDefaultLibraries": "flob;flok", - "ImportLibrary": "f4", - "KeyContainer": "f7", - "KeyFile": "f6", - "LargeAddressAware": "true", - "LinkErrorReporting": "QueueForNextLogin", - "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", - "ManifestFile": "$(IntDir)$(TargetFileName).2intermediate.manifest", - "MapExports": "true", - "MapFileName": "d5", - "MergedIDLBaseFileName": "f2", - "MergeSections": "f5", - "MidlCommandFile": "f1", - "ModuleDefinitionFile": "sdsd", - "NoEntryPoint": "true", - "OptimizeReferences": "true", - "OutputFile": "$(OutDir)$(ProjectName)2.exe", - "PerUserRedirection": "true", - "Profile": "true", - "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", - "ProgramDatabaseFile": "Flob.pdb", - "RandomizedBaseAddress": "false", - "RegisterOutput": "true", - "SetChecksum": "false", - "ShowProgress": "LinkVerbose", - "StackCommitSize": "15", - "StackReserveSize": "14", - "StripPrivateSymbols": "d3", - "SubSystem": "Console", - "SupportUnloadOfDelayLoadedDLL": "true", - "SuppressStartupBanner": "false", - "SwapRunFromCD": "true", - "SwapRunFromNET": "true", - "TargetMachine": "MachineX86", - "TerminalServerAware": "false", - "TurnOffAssemblyGeneration": "true", - "TypeLibraryFile": "f3", - "TypeLibraryResourceID": "12", - "UACExecutionLevel": "RequireAdministrator", - "UACUIAccess": "true", - "Version": "333", - }, - "ResourceCompile": { - "AdditionalIncludeDirectories": "f3", - "AdditionalOptions": "/more3", - "Culture": "0x0c0c", - "IgnoreStandardIncludePath": "true", - "PreprocessorDefinitions": "_UNICODE;UNICODE2", - "ResourceOutputFileName": "$(IntDir)%(Filename)3.res", - "ShowProgress": "true", - }, - "Manifest": { - "AdditionalManifestFiles": "sfsdfsd", - "AdditionalOptions": "afdsdafsd", - "AssemblyIdentity": "sddfdsadfsa", - "ComponentFileName": "fsdfds", - "GenerateCatalogFiles": "true", - "InputResourceManifests": "asfsfdafs", - "OutputManifestFile": "$(TargetPath).manifestdfs", - "RegistrarScriptFile": "sdfsfd", - "ReplacementsFile": "sdffsd", - "SuppressStartupBanner": "false", - "TypeLibraryFile": "sfsd", - "UpdateFileHashes": "true", - "UpdateFileHashesSearchPath": "sfsd", - "VerboseOutput": "true", - }, - "ProjectReference": { - "LinkLibraryDependencies": "false", - "UseLibraryDependencyInputs": "true", - }, - "": { - "EmbedManifest": "false", - "GenerateManifest": "false", - "IgnoreImportLibrary": "true", - "LinkIncremental": "", - }, - "ManifestResourceCompile": { - "ResourceOutputFileName": - "$(IntDir)$(TargetFileName).embed.manifest.resfdsf" - }, - } - self.maxDiff = 9999 # on failure display a long diff - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, self.stderr - ) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py deleted file mode 100644 index 2e5c811bd..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Visual Studio project reader/writer.""" - -import gyp.easy_xml as easy_xml - - -class Writer: - """Visual Studio XML tool file writer.""" - - def __init__(self, tool_file_path, name): - """Initializes the tool file. - - Args: - tool_file_path: Path to the tool file. - name: Name of the tool file. - """ - self.tool_file_path = tool_file_path - self.name = name - self.rules_section = ["Rules"] - - def AddCustomBuildRule( - self, name, cmd, description, additional_dependencies, outputs, extensions - ): - """Adds a rule to the tool file. - - Args: - name: Name of the rule. - description: Description of the rule. - cmd: Command line of the rule. - additional_dependencies: other files which may trigger the rule. - outputs: outputs of the rule. - extensions: extensions handled by the rule. - """ - rule = [ - "CustomBuildRule", - { - "Name": name, - "ExecutionDescription": description, - "CommandLine": cmd, - "Outputs": ";".join(outputs), - "FileExtensions": ";".join(extensions), - "AdditionalDependencies": ";".join(additional_dependencies), - }, - ] - self.rules_section.append(rule) - - def WriteIfChanged(self): - """Writes the tool file.""" - content = [ - "VisualStudioToolFile", - {"Version": "8.00", "Name": self.name}, - self.rules_section, - ] - easy_xml.WriteXmlIfChanged( - content, self.tool_file_path, encoding="Windows-1252" - ) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py deleted file mode 100644 index e580c00fb..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Visual Studio user preferences file writer.""" - -import os -import re -import socket # for gethostname - -import gyp.easy_xml as easy_xml - - -# ------------------------------------------------------------------------------ - - -def _FindCommandInPath(command): - """If there are no slashes in the command given, this function - searches the PATH env to find the given command, and converts it - to an absolute path. We have to do this because MSVS is looking - for an actual file to launch a debugger on, not just a command - line. Note that this happens at GYP time, so anything needing to - be built needs to have a full path.""" - if "/" in command or "\\" in command: - # If the command already has path elements (either relative or - # absolute), then assume it is constructed properly. - return command - else: - # Search through the path list and find an existing file that - # we can access. - paths = os.environ.get("PATH", "").split(os.pathsep) - for path in paths: - item = os.path.join(path, command) - if os.path.isfile(item) and os.access(item, os.X_OK): - return item - return command - - -def _QuoteWin32CommandLineArgs(args): - new_args = [] - for arg in args: - # Replace all double-quotes with double-double-quotes to escape - # them for cmd shell, and then quote the whole thing if there - # are any. - if arg.find('"') != -1: - arg = '""'.join(arg.split('"')) - arg = '"%s"' % arg - - # Otherwise, if there are any spaces, quote the whole arg. - elif re.search(r"[ \t\n]", arg): - arg = '"%s"' % arg - new_args.append(arg) - return new_args - - -class Writer: - """Visual Studio XML user user file writer.""" - - def __init__(self, user_file_path, version, name): - """Initializes the user file. - - Args: - user_file_path: Path to the user file. - version: Version info. - name: Name of the user file. - """ - self.user_file_path = user_file_path - self.version = version - self.name = name - self.configurations = {} - - def AddConfig(self, name): - """Adds a configuration to the project. - - Args: - name: Configuration name. - """ - self.configurations[name] = ["Configuration", {"Name": name}] - - def AddDebugSettings( - self, config_name, command, environment={}, working_directory="" - ): - """Adds a DebugSettings node to the user file for a particular config. - - Args: - command: command line to run. First element in the list is the - executable. All elements of the command will be quoted if - necessary. - working_directory: other files which may trigger the rule. (optional) - """ - command = _QuoteWin32CommandLineArgs(command) - - abs_command = _FindCommandInPath(command[0]) - - if environment and isinstance(environment, dict): - env_list = [f'{key}="{val}"' for (key, val) in environment.items()] - environment = " ".join(env_list) - else: - environment = "" - - n_cmd = [ - "DebugSettings", - { - "Command": abs_command, - "WorkingDirectory": working_directory, - "CommandArguments": " ".join(command[1:]), - "RemoteMachine": socket.gethostname(), - "Environment": environment, - "EnvironmentMerge": "true", - # Currently these are all "dummy" values that we're just setting - # in the default manner that MSVS does it. We could use some of - # these to add additional capabilities, I suppose, but they might - # not have parity with other platforms then. - "Attach": "false", - "DebuggerType": "3", # 'auto' debugger - "Remote": "1", - "RemoteCommand": "", - "HttpUrl": "", - "PDBPath": "", - "SQLDebugging": "", - "DebuggerFlavor": "0", - "MPIRunCommand": "", - "MPIRunArguments": "", - "MPIRunWorkingDirectory": "", - "ApplicationCommand": "", - "ApplicationArguments": "", - "ShimCommand": "", - "MPIAcceptMode": "", - "MPIAcceptFilter": "", - }, - ] - - # Find the config, and add it if it doesn't exist. - if config_name not in self.configurations: - self.AddConfig(config_name) - - # Add the DebugSettings onto the appropriate config. - self.configurations[config_name].append(n_cmd) - - def WriteIfChanged(self): - """Writes the user file.""" - configs = ["Configurations"] - for config, spec in sorted(self.configurations.items()): - configs.append(spec) - - content = [ - "VisualStudioUserFile", - {"Version": self.version.ProjectVersion(), "Name": self.name}, - configs, - ] - easy_xml.WriteXmlIfChanged( - content, self.user_file_path, encoding="Windows-1252" - ) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py deleted file mode 100644 index 36bb782bd..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +++ /dev/null @@ -1,271 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions shared amongst the Windows generators.""" - -import copy -import os - - -# A dictionary mapping supported target types to extensions. -TARGET_TYPE_EXT = { - "executable": "exe", - "loadable_module": "dll", - "shared_library": "dll", - "static_library": "lib", - "windows_driver": "sys", -} - - -def _GetLargePdbShimCcPath(): - """Returns the path of the large_pdb_shim.cc file.""" - this_dir = os.path.abspath(os.path.dirname(__file__)) - src_dir = os.path.abspath(os.path.join(this_dir, "..", "..")) - win_data_dir = os.path.join(src_dir, "data", "win") - large_pdb_shim_cc = os.path.join(win_data_dir, "large-pdb-shim.cc") - return large_pdb_shim_cc - - -def _DeepCopySomeKeys(in_dict, keys): - """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. - - Arguments: - in_dict: The dictionary to copy. - keys: The keys to be copied. If a key is in this list and doesn't exist in - |in_dict| this is not an error. - Returns: - The partially deep-copied dictionary. - """ - d = {} - for key in keys: - if key not in in_dict: - continue - d[key] = copy.deepcopy(in_dict[key]) - return d - - -def _SuffixName(name, suffix): - """Add a suffix to the end of a target. - - Arguments: - name: name of the target (foo#target) - suffix: the suffix to be added - Returns: - Target name with suffix added (foo_suffix#target) - """ - parts = name.rsplit("#", 1) - parts[0] = f"{parts[0]}_{suffix}" - return "#".join(parts) - - -def _ShardName(name, number): - """Add a shard number to the end of a target. - - Arguments: - name: name of the target (foo#target) - number: shard number - Returns: - Target name with shard added (foo_1#target) - """ - return _SuffixName(name, str(number)) - - -def ShardTargets(target_list, target_dicts): - """Shard some targets apart to work around the linkers limits. - - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - Returns: - Tuple of the new sharded versions of the inputs. - """ - # Gather the targets to shard, and how many pieces. - targets_to_shard = {} - for t in target_dicts: - shards = int(target_dicts[t].get("msvs_shard", 0)) - if shards: - targets_to_shard[t] = shards - # Shard target_list. - new_target_list = [] - for t in target_list: - if t in targets_to_shard: - for i in range(targets_to_shard[t]): - new_target_list.append(_ShardName(t, i)) - else: - new_target_list.append(t) - # Shard target_dict. - new_target_dicts = {} - for t in target_dicts: - if t in targets_to_shard: - for i in range(targets_to_shard[t]): - name = _ShardName(t, i) - new_target_dicts[name] = copy.copy(target_dicts[t]) - new_target_dicts[name]["target_name"] = _ShardName( - new_target_dicts[name]["target_name"], i - ) - sources = new_target_dicts[name].get("sources", []) - new_sources = [] - for pos in range(i, len(sources), targets_to_shard[t]): - new_sources.append(sources[pos]) - new_target_dicts[name]["sources"] = new_sources - else: - new_target_dicts[t] = target_dicts[t] - # Shard dependencies. - for t in sorted(new_target_dicts): - for deptype in ("dependencies", "dependencies_original"): - dependencies = copy.copy(new_target_dicts[t].get(deptype, [])) - new_dependencies = [] - for d in dependencies: - if d in targets_to_shard: - for i in range(targets_to_shard[d]): - new_dependencies.append(_ShardName(d, i)) - else: - new_dependencies.append(d) - new_target_dicts[t][deptype] = new_dependencies - - return (new_target_list, new_target_dicts) - - -def _GetPdbPath(target_dict, config_name, vars): - """Returns the path to the PDB file that will be generated by a given - configuration. - - The lookup proceeds as follows: - - Look for an explicit path in the VCLinkerTool configuration block. - - Look for an 'msvs_large_pdb_path' variable. - - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is - specified. - - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'. - - Arguments: - target_dict: The target dictionary to be searched. - config_name: The name of the configuration of interest. - vars: A dictionary of common GYP variables with generator-specific values. - Returns: - The path of the corresponding PDB file. - """ - config = target_dict["configurations"][config_name] - msvs = config.setdefault("msvs_settings", {}) - - linker = msvs.get("VCLinkerTool", {}) - - pdb_path = linker.get("ProgramDatabaseFile") - if pdb_path: - return pdb_path - - variables = target_dict.get("variables", {}) - pdb_path = variables.get("msvs_large_pdb_path", None) - if pdb_path: - return pdb_path - - pdb_base = target_dict.get("product_name", target_dict["target_name"]) - pdb_base = "{}.{}.pdb".format(pdb_base, TARGET_TYPE_EXT[target_dict["type"]]) - pdb_path = vars["PRODUCT_DIR"] + "/" + pdb_base - - return pdb_path - - -def InsertLargePdbShims(target_list, target_dicts, vars): - """Insert a shim target that forces the linker to use 4KB pagesize PDBs. - - This is a workaround for targets with PDBs greater than 1GB in size, the - limit for the 1KB pagesize PDBs created by the linker by default. - - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - vars: A dictionary of common GYP variables with generator-specific values. - Returns: - Tuple of the shimmed version of the inputs. - """ - # Determine which targets need shimming. - targets_to_shim = [] - for t in target_dicts: - target_dict = target_dicts[t] - - # We only want to shim targets that have msvs_large_pdb enabled. - if not int(target_dict.get("msvs_large_pdb", 0)): - continue - # This is intended for executable, shared_library and loadable_module - # targets where every configuration is set up to produce a PDB output. - # If any of these conditions is not true then the shim logic will fail - # below. - targets_to_shim.append(t) - - large_pdb_shim_cc = _GetLargePdbShimCcPath() - - for t in targets_to_shim: - target_dict = target_dicts[t] - target_name = target_dict.get("target_name") - - base_dict = _DeepCopySomeKeys( - target_dict, ["configurations", "default_configuration", "toolset"] - ) - - # This is the dict for copying the source file (part of the GYP tree) - # to the intermediate directory of the project. This is necessary because - # we can't always build a relative path to the shim source file (on Windows - # GYP and the project may be on different drives), and Ninja hates absolute - # paths (it ends up generating the .obj and .obj.d alongside the source - # file, polluting GYPs tree). - copy_suffix = "large_pdb_copy" - copy_target_name = target_name + "_" + copy_suffix - full_copy_target_name = _SuffixName(t, copy_suffix) - shim_cc_basename = os.path.basename(large_pdb_shim_cc) - shim_cc_dir = vars["SHARED_INTERMEDIATE_DIR"] + "/" + copy_target_name - shim_cc_path = shim_cc_dir + "/" + shim_cc_basename - copy_dict = copy.deepcopy(base_dict) - copy_dict["target_name"] = copy_target_name - copy_dict["type"] = "none" - copy_dict["sources"] = [large_pdb_shim_cc] - copy_dict["copies"] = [ - {"destination": shim_cc_dir, "files": [large_pdb_shim_cc]} - ] - - # This is the dict for the PDB generating shim target. It depends on the - # copy target. - shim_suffix = "large_pdb_shim" - shim_target_name = target_name + "_" + shim_suffix - full_shim_target_name = _SuffixName(t, shim_suffix) - shim_dict = copy.deepcopy(base_dict) - shim_dict["target_name"] = shim_target_name - shim_dict["type"] = "static_library" - shim_dict["sources"] = [shim_cc_path] - shim_dict["dependencies"] = [full_copy_target_name] - - # Set up the shim to output its PDB to the same location as the final linker - # target. - for config_name, config in shim_dict.get("configurations").items(): - pdb_path = _GetPdbPath(target_dict, config_name, vars) - - # A few keys that we don't want to propagate. - for key in ["msvs_precompiled_header", "msvs_precompiled_source", "test"]: - config.pop(key, None) - - msvs = config.setdefault("msvs_settings", {}) - - # Update the compiler directives in the shim target. - compiler = msvs.setdefault("VCCLCompilerTool", {}) - compiler["DebugInformationFormat"] = "3" - compiler["ProgramDataBaseFileName"] = pdb_path - - # Set the explicit PDB path in the appropriate configuration of the - # original target. - config = target_dict["configurations"][config_name] - msvs = config.setdefault("msvs_settings", {}) - linker = msvs.setdefault("VCLinkerTool", {}) - linker["GenerateDebugInformation"] = "true" - linker["ProgramDatabaseFile"] = pdb_path - - # Add the new targets. They must go to the beginning of the list so that - # the dependency generation works as expected in ninja. - target_list.insert(0, full_copy_target_name) - target_list.insert(0, full_shim_target_name) - target_dicts[full_copy_target_name] = copy_dict - target_dicts[full_shim_target_name] = shim_dict - - # Update the original target to depend on the shim target. - target_dict.setdefault("dependencies", []).append(full_shim_target_name) - - return (target_list, target_dicts) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py deleted file mode 100644 index 8d7f21e82..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +++ /dev/null @@ -1,574 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Handle version information related to Visual Stuio.""" - -import errno -import os -import re -import subprocess -import sys -import glob - - -def JoinPath(*args): - return os.path.normpath(os.path.join(*args)) - - -class VisualStudioVersion: - """Information regarding a version of Visual Studio.""" - - def __init__( - self, - short_name, - description, - solution_version, - project_version, - flat_sln, - uses_vcxproj, - path, - sdk_based, - default_toolset=None, - compatible_sdks=None, - ): - self.short_name = short_name - self.description = description - self.solution_version = solution_version - self.project_version = project_version - self.flat_sln = flat_sln - self.uses_vcxproj = uses_vcxproj - self.path = path - self.sdk_based = sdk_based - self.default_toolset = default_toolset - compatible_sdks = compatible_sdks or [] - compatible_sdks.sort(key=lambda v: float(v.replace("v", "")), reverse=True) - self.compatible_sdks = compatible_sdks - - def ShortName(self): - return self.short_name - - def Description(self): - """Get the full description of the version.""" - return self.description - - def SolutionVersion(self): - """Get the version number of the sln files.""" - return self.solution_version - - def ProjectVersion(self): - """Get the version number of the vcproj or vcxproj files.""" - return self.project_version - - def FlatSolution(self): - return self.flat_sln - - def UsesVcxproj(self): - """Returns true if this version uses a vcxproj file.""" - return self.uses_vcxproj - - def ProjectExtension(self): - """Returns the file extension for the project.""" - return self.uses_vcxproj and ".vcxproj" or ".vcproj" - - def Path(self): - """Returns the path to Visual Studio installation.""" - return self.path - - def ToolPath(self, tool): - """Returns the path to a given compiler tool. """ - return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) - - def DefaultToolset(self): - """Returns the msbuild toolset version that will be used in the absence - of a user override.""" - return self.default_toolset - - def _SetupScriptInternal(self, target_arch): - """Returns a command (with arguments) to be used to set up the - environment.""" - assert target_arch in ("x86", "x64"), "target_arch not supported" - # If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the - # depot_tools build tools and should run SetEnv.Cmd to set up the - # environment. The check for WindowsSDKDir alone is not sufficient because - # this is set by running vcvarsall.bat. - sdk_dir = os.environ.get("WindowsSDKDir", "") - setup_path = JoinPath(sdk_dir, "Bin", "SetEnv.Cmd") - if self.sdk_based and sdk_dir and os.path.exists(setup_path): - return [setup_path, "/" + target_arch] - - is_host_arch_x64 = ( - os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" - or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" - ) - - # For VS2017 (and newer) it's fairly easy - if self.short_name >= "2017": - script_path = JoinPath( - self.path, "VC", "Auxiliary", "Build", "vcvarsall.bat" - ) - - # Always use a native executable, cross-compiling if necessary. - host_arch = "amd64" if is_host_arch_x64 else "x86" - msvc_target_arch = "amd64" if target_arch == "x64" else "x86" - arg = host_arch - if host_arch != msvc_target_arch: - arg += "_" + msvc_target_arch - - return [script_path, arg] - - # We try to find the best version of the env setup batch. - vcvarsall = JoinPath(self.path, "VC", "vcvarsall.bat") - if target_arch == "x86": - if ( - self.short_name >= "2013" - and self.short_name[-1] != "e" - and is_host_arch_x64 - ): - # VS2013 and later, non-Express have a x64-x86 cross that we want - # to prefer. - return [vcvarsall, "amd64_x86"] - else: - # Otherwise, the standard x86 compiler. We don't use VC/vcvarsall.bat - # for x86 because vcvarsall calls vcvars32, which it can only find if - # VS??COMNTOOLS is set, which isn't guaranteed. - return [JoinPath(self.path, "Common7", "Tools", "vsvars32.bat")] - elif target_arch == "x64": - arg = "x86_amd64" - # Use the 64-on-64 compiler if we're not using an express edition and - # we're running on a 64bit OS. - if self.short_name[-1] != "e" and is_host_arch_x64: - arg = "amd64" - return [vcvarsall, arg] - - def SetupScript(self, target_arch): - script_data = self._SetupScriptInternal(target_arch) - script_path = script_data[0] - if not os.path.exists(script_path): - raise Exception( - "%s is missing - make sure VC++ tools are installed." % script_path - ) - return script_data - - -def _RegistryQueryBase(sysdir, key, value): - """Use reg.exe to read a particular key. - - While ideally we might use the win32 module, we would like gyp to be - python neutral, so for instance cygwin python lacks this module. - - Arguments: - sysdir: The system subdirectory to attempt to launch reg.exe from. - key: The registry key to read from. - value: The particular value to read. - Return: - stdout from reg.exe, or None for failure. - """ - # Skip if not on Windows or Python Win32 setup issue - if sys.platform not in ("win32", "cygwin"): - return None - # Setup params to pass to and attempt to launch reg.exe - cmd = [os.path.join(os.environ.get("WINDIR", ""), sysdir, "reg.exe"), "query", key] - if value: - cmd.extend(["/v", value]) - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid - # Note that the error text may be in [1] in some cases - text = p.communicate()[0].decode("utf-8") - # Check return code from reg.exe; officially 0==success and 1==error - if p.returncode: - return None - return text - - -def _RegistryQuery(key, value=None): - r"""Use reg.exe to read a particular key through _RegistryQueryBase. - - First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If - that fails, it falls back to System32. Sysnative is available on Vista and - up and available on Windows Server 2003 and XP through KB patch 942589. Note - that Sysnative will always fail if using 64-bit python due to it being a - virtual directory and System32 will work correctly in the first place. - - KB 942589 - http://support.microsoft.com/kb/942589/en-us. - - Arguments: - key: The registry key. - value: The particular registry value to read (optional). - Return: - stdout from reg.exe, or None for failure. - """ - text = None - try: - text = _RegistryQueryBase("Sysnative", key, value) - except OSError as e: - if e.errno == errno.ENOENT: - text = _RegistryQueryBase("System32", key, value) - else: - raise - return text - - -def _RegistryGetValueUsingWinReg(key, value): - """Use the _winreg module to obtain the value of a registry key. - - Args: - key: The registry key. - value: The particular registry value to read. - Return: - contents of the registry key's value, or None on failure. Throws - ImportError if winreg is unavailable. - """ - from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx - try: - root, subkey = key.split("\\", 1) - assert root == "HKLM" # Only need HKLM for now. - with OpenKey(HKEY_LOCAL_MACHINE, subkey) as hkey: - return QueryValueEx(hkey, value)[0] - except OSError: - return None - - -def _RegistryGetValue(key, value): - """Use _winreg or reg.exe to obtain the value of a registry key. - - Using _winreg is preferable because it solves an issue on some corporate - environments where access to reg.exe is locked down. However, we still need - to fallback to reg.exe for the case where the _winreg module is not available - (for example in cygwin python). - - Args: - key: The registry key. - value: The particular registry value to read. - Return: - contents of the registry key's value, or None on failure. - """ - try: - return _RegistryGetValueUsingWinReg(key, value) - except ImportError: - pass - - # Fallback to reg.exe if we fail to import _winreg. - text = _RegistryQuery(key, value) - if not text: - return None - # Extract value. - match = re.search(r"REG_\w+\s+([^\r]+)\r\n", text) - if not match: - return None - return match.group(1) - - -def _CreateVersion(name, path, sdk_based=False): - """Sets up MSVS project generation. - - Setup is based off the GYP_MSVS_VERSION environment variable or whatever is - autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is - passed in that doesn't match a value in versions python will throw a error. - """ - if path: - path = os.path.normpath(path) - versions = { - "2022": VisualStudioVersion( - "2022", - "Visual Studio 2022", - solution_version="12.00", - project_version="17.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v143", - compatible_sdks=["v8.1", "v10.0"], - ), - "2019": VisualStudioVersion( - "2019", - "Visual Studio 2019", - solution_version="12.00", - project_version="16.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v142", - compatible_sdks=["v8.1", "v10.0"], - ), - "2017": VisualStudioVersion( - "2017", - "Visual Studio 2017", - solution_version="12.00", - project_version="15.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v141", - compatible_sdks=["v8.1", "v10.0"], - ), - "2015": VisualStudioVersion( - "2015", - "Visual Studio 2015", - solution_version="12.00", - project_version="14.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v140", - ), - "2013": VisualStudioVersion( - "2013", - "Visual Studio 2013", - solution_version="13.00", - project_version="12.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v120", - ), - "2013e": VisualStudioVersion( - "2013e", - "Visual Studio 2013", - solution_version="13.00", - project_version="12.0", - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v120", - ), - "2012": VisualStudioVersion( - "2012", - "Visual Studio 2012", - solution_version="12.00", - project_version="4.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v110", - ), - "2012e": VisualStudioVersion( - "2012e", - "Visual Studio 2012", - solution_version="12.00", - project_version="4.0", - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset="v110", - ), - "2010": VisualStudioVersion( - "2010", - "Visual Studio 2010", - solution_version="11.00", - project_version="4.0", - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - ), - "2010e": VisualStudioVersion( - "2010e", - "Visual C++ Express 2010", - solution_version="11.00", - project_version="4.0", - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - ), - "2008": VisualStudioVersion( - "2008", - "Visual Studio 2008", - solution_version="10.00", - project_version="9.00", - flat_sln=False, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - "2008e": VisualStudioVersion( - "2008e", - "Visual Studio 2008", - solution_version="10.00", - project_version="9.00", - flat_sln=True, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - "2005": VisualStudioVersion( - "2005", - "Visual Studio 2005", - solution_version="9.00", - project_version="8.00", - flat_sln=False, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - "2005e": VisualStudioVersion( - "2005e", - "Visual Studio 2005", - solution_version="9.00", - project_version="8.00", - flat_sln=True, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based, - ), - } - return versions[str(name)] - - -def _ConvertToCygpath(path): - """Convert to cygwin path if we are using cygwin.""" - if sys.platform == "cygwin": - p = subprocess.Popen(["cygpath", path], stdout=subprocess.PIPE) - path = p.communicate()[0].decode("utf-8").strip() - return path - - -def _DetectVisualStudioVersions(versions_to_check, force_express): - """Collect the list of installed visual studio versions. - - Returns: - A list of visual studio versions installed in descending order of - usage preference. - Base this on the registry and a quick check if devenv.exe exists. - Possibilities are: - 2005(e) - Visual Studio 2005 (8) - 2008(e) - Visual Studio 2008 (9) - 2010(e) - Visual Studio 2010 (10) - 2012(e) - Visual Studio 2012 (11) - 2013(e) - Visual Studio 2013 (12) - 2015 - Visual Studio 2015 (14) - 2017 - Visual Studio 2017 (15) - 2019 - Visual Studio 2019 (16) - 2022 - Visual Studio 2022 (17) - Where (e) is e for express editions of MSVS and blank otherwise. - """ - version_to_year = { - "8.0": "2005", - "9.0": "2008", - "10.0": "2010", - "11.0": "2012", - "12.0": "2013", - "14.0": "2015", - "15.0": "2017", - "16.0": "2019", - "17.0": "2022", - } - versions = [] - for version in versions_to_check: - # Old method of searching for which VS version is installed - # We don't use the 2010-encouraged-way because we also want to get the - # path to the binaries, which it doesn't offer. - keys = [ - r"HKLM\Software\Microsoft\VisualStudio\%s" % version, - r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s" % version, - r"HKLM\Software\Microsoft\VCExpress\%s" % version, - r"HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s" % version, - ] - for index in range(len(keys)): - path = _RegistryGetValue(keys[index], "InstallDir") - if not path: - continue - path = _ConvertToCygpath(path) - # Check for full. - full_path = os.path.join(path, "devenv.exe") - express_path = os.path.join(path, "*express.exe") - if not force_express and os.path.exists(full_path): - # Add this one. - versions.append( - _CreateVersion( - version_to_year[version], os.path.join(path, "..", "..") - ) - ) - # Check for express. - elif glob.glob(express_path): - # Add this one. - versions.append( - _CreateVersion( - version_to_year[version] + "e", os.path.join(path, "..", "..") - ) - ) - - # The old method above does not work when only SDK is installed. - keys = [ - r"HKLM\Software\Microsoft\VisualStudio\SxS\VC7", - r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7", - r"HKLM\Software\Microsoft\VisualStudio\SxS\VS7", - r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7", - ] - for index in range(len(keys)): - path = _RegistryGetValue(keys[index], version) - if not path: - continue - path = _ConvertToCygpath(path) - if version == "15.0": - if os.path.exists(path): - versions.append(_CreateVersion("2017", path)) - elif version != "14.0": # There is no Express edition for 2015. - versions.append( - _CreateVersion( - version_to_year[version] + "e", - os.path.join(path, ".."), - sdk_based=True, - ) - ) - - return versions - - -def SelectVisualStudioVersion(version="auto", allow_fallback=True): - """Select which version of Visual Studio projects to generate. - - Arguments: - version: Hook to allow caller to force a particular version (vs auto). - Returns: - An object representing a visual studio project format version. - """ - # In auto mode, check environment variable for override. - if version == "auto": - version = os.environ.get("GYP_MSVS_VERSION", "auto") - version_map = { - "auto": ("17.0", "16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"), - "2005": ("8.0",), - "2005e": ("8.0",), - "2008": ("9.0",), - "2008e": ("9.0",), - "2010": ("10.0",), - "2010e": ("10.0",), - "2012": ("11.0",), - "2012e": ("11.0",), - "2013": ("12.0",), - "2013e": ("12.0",), - "2015": ("14.0",), - "2017": ("15.0",), - "2019": ("16.0",), - "2022": ("17.0",), - } - override_path = os.environ.get("GYP_MSVS_OVERRIDE_PATH") - if override_path: - msvs_version = os.environ.get("GYP_MSVS_VERSION") - if not msvs_version: - raise ValueError( - "GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be " - "set to a particular version (e.g. 2010e)." - ) - return _CreateVersion(msvs_version, override_path, sdk_based=True) - version = str(version) - versions = _DetectVisualStudioVersions(version_map[version], "e" in version) - if not versions: - if not allow_fallback: - raise ValueError("Could not locate Visual Studio installation.") - if version == "auto": - # Default to 2005 if we couldn't find anything - return _CreateVersion("2005", None) - else: - return _CreateVersion(version, None) - return versions[0] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__init__.py deleted file mode 100755 index 2aa39d031..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +++ /dev/null @@ -1,690 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import copy -import gyp.input -import argparse -import os.path -import re -import shlex -import sys -import traceback -from gyp.common import GypError - - -# Default debug modes for GYP -debug = {} - -# List of "official" debug modes, but you can use anything you like. -DEBUG_GENERAL = "general" -DEBUG_VARIABLES = "variables" -DEBUG_INCLUDES = "includes" - - -def DebugOutput(mode, message, *args): - if "all" in gyp.debug or mode in gyp.debug: - ctx = ("unknown", 0, "unknown") - try: - f = traceback.extract_stack(limit=2) - if f: - ctx = f[0][:3] - except Exception: - pass - if args: - message %= args - print( - "%s:%s:%d:%s %s" - % (mode.upper(), os.path.basename(ctx[0]), ctx[1], ctx[2], message) - ) - - -def FindBuildFiles(): - extension = ".gyp" - files = os.listdir(os.getcwd()) - build_files = [] - for file in files: - if file.endswith(extension): - build_files.append(file) - return build_files - - -def Load( - build_files, - format, - default_variables={}, - includes=[], - depth=".", - params=None, - check=False, - circular_check=True, -): - """ - Loads one or more specified build files. - default_variables and includes will be copied before use. - Returns the generator for the specified format and the - data returned by loading the specified build files. - """ - if params is None: - params = {} - - if "-" in format: - format, params["flavor"] = format.split("-", 1) - - default_variables = copy.copy(default_variables) - - # Default variables provided by this program and its modules should be - # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, - # avoiding collisions with user and automatic variables. - default_variables["GENERATOR"] = format - default_variables["GENERATOR_FLAVOR"] = params.get("flavor", "") - - # Format can be a custom python file, or by default the name of a module - # within gyp.generator. - if format.endswith(".py"): - generator_name = os.path.splitext(format)[0] - path, generator_name = os.path.split(generator_name) - - # Make sure the path to the custom generator is in sys.path - # Don't worry about removing it once we are done. Keeping the path - # to each generator that is used in sys.path is likely harmless and - # arguably a good idea. - path = os.path.abspath(path) - if path not in sys.path: - sys.path.insert(0, path) - else: - generator_name = "gyp.generator." + format - - # These parameters are passed in order (as opposed to by key) - # because ActivePython cannot handle key parameters to __import__. - generator = __import__(generator_name, globals(), locals(), generator_name) - for (key, val) in generator.generator_default_variables.items(): - default_variables.setdefault(key, val) - - output_dir = params["options"].generator_output or params["options"].toplevel_dir - if default_variables["GENERATOR"] == "ninja": - default_variables.setdefault( - "PRODUCT_DIR_ABS", - os.path.join(output_dir, "out", default_variables["build_type"]), - ) - else: - default_variables.setdefault( - "PRODUCT_DIR_ABS", - os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]), - ) - - # Give the generator the opportunity to set additional variables based on - # the params it will receive in the output phase. - if getattr(generator, "CalculateVariables", None): - generator.CalculateVariables(default_variables, params) - - # Give the generator the opportunity to set generator_input_info based on - # the params it will receive in the output phase. - if getattr(generator, "CalculateGeneratorInputInfo", None): - generator.CalculateGeneratorInputInfo(params) - - # Fetch the generator specific info that gets fed to input, we use getattr - # so we can default things and the generators only have to provide what - # they need. - generator_input_info = { - "non_configuration_keys": getattr( - generator, "generator_additional_non_configuration_keys", [] - ), - "path_sections": getattr(generator, "generator_additional_path_sections", []), - "extra_sources_for_rules": getattr( - generator, "generator_extra_sources_for_rules", [] - ), - "generator_supports_multiple_toolsets": getattr( - generator, "generator_supports_multiple_toolsets", False - ), - "generator_wants_static_library_dependencies_adjusted": getattr( - generator, "generator_wants_static_library_dependencies_adjusted", True - ), - "generator_wants_sorted_dependencies": getattr( - generator, "generator_wants_sorted_dependencies", False - ), - "generator_filelist_paths": getattr( - generator, "generator_filelist_paths", None - ), - } - - # Process the input specific to this generator. - result = gyp.input.Load( - build_files, - default_variables, - includes[:], - depth, - generator_input_info, - check, - circular_check, - params["parallel"], - params["root_targets"], - ) - return [generator] + result - - -def NameValueListToDict(name_value_list): - """ - Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary - of the pairs. If a string is simply NAME, then the value in the dictionary - is set to True. If VALUE can be converted to an integer, it is. - """ - result = {} - for item in name_value_list: - tokens = item.split("=", 1) - if len(tokens) == 2: - # If we can make it an int, use that, otherwise, use the string. - try: - token_value = int(tokens[1]) - except ValueError: - token_value = tokens[1] - # Set the variable to the supplied value. - result[tokens[0]] = token_value - else: - # No value supplied, treat it as a boolean and set it. - result[tokens[0]] = True - return result - - -def ShlexEnv(env_name): - flags = os.environ.get(env_name, []) - if flags: - flags = shlex.split(flags) - return flags - - -def FormatOpt(opt, value): - if opt.startswith("--"): - return f"{opt}={value}" - return opt + value - - -def RegenerateAppendFlag(flag, values, predicate, env_name, options): - """Regenerate a list of command line flags, for an option of action='append'. - - The |env_name|, if given, is checked in the environment and used to generate - an initial list of options, then the options that were specified on the - command line (given in |values|) are appended. This matches the handling of - environment variables and command line flags where command line flags override - the environment, while not requiring the environment to be set when the flags - are used again. - """ - flags = [] - if options.use_environment and env_name: - for flag_value in ShlexEnv(env_name): - value = FormatOpt(flag, predicate(flag_value)) - if value in flags: - flags.remove(value) - flags.append(value) - if values: - for flag_value in values: - flags.append(FormatOpt(flag, predicate(flag_value))) - return flags - - -def RegenerateFlags(options): - """Given a parsed options object, and taking the environment variables into - account, returns a list of flags that should regenerate an equivalent options - object (even in the absence of the environment variables.) - - Any path options will be normalized relative to depth. - - The format flag is not included, as it is assumed the calling generator will - set that as appropriate. - """ - - def FixPath(path): - path = gyp.common.FixIfRelativePath(path, options.depth) - if not path: - return os.path.curdir - return path - - def Noop(value): - return value - - # We always want to ignore the environment when regenerating, to avoid - # duplicate or changed flags in the environment at the time of regeneration. - flags = ["--ignore-environment"] - for name, metadata in options._regeneration_metadata.items(): - opt = metadata["opt"] - value = getattr(options, name) - value_predicate = metadata["type"] == "path" and FixPath or Noop - action = metadata["action"] - env_name = metadata["env_name"] - if action == "append": - flags.extend( - RegenerateAppendFlag(opt, value, value_predicate, env_name, options) - ) - elif action in ("store", None): # None is a synonym for 'store'. - if value: - flags.append(FormatOpt(opt, value_predicate(value))) - elif options.use_environment and env_name and os.environ.get(env_name): - flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) - elif action in ("store_true", "store_false"): - if (action == "store_true" and value) or ( - action == "store_false" and not value - ): - flags.append(opt) - elif options.use_environment and env_name: - print( - "Warning: environment regeneration unimplemented " - "for %s flag %r env_name %r" % (action, opt, env_name), - file=sys.stderr, - ) - else: - print( - "Warning: regeneration unimplemented for action %r " - "flag %r" % (action, opt), - file=sys.stderr, - ) - - return flags - - -class RegeneratableOptionParser(argparse.ArgumentParser): - def __init__(self, usage): - self.__regeneratable_options = {} - argparse.ArgumentParser.__init__(self, usage=usage) - - def add_argument(self, *args, **kw): - """Add an option to the parser. - - This accepts the same arguments as ArgumentParser.add_argument, plus the - following: - regenerate: can be set to False to prevent this option from being included - in regeneration. - env_name: name of environment variable that additional values for this - option come from. - type: adds type='path', to tell the regenerator that the values of - this option need to be made relative to options.depth - """ - env_name = kw.pop("env_name", None) - if "dest" in kw and kw.pop("regenerate", True): - dest = kw["dest"] - - # The path type is needed for regenerating, for optparse we can just treat - # it as a string. - type = kw.get("type") - if type == "path": - kw["type"] = str - - self.__regeneratable_options[dest] = { - "action": kw.get("action"), - "type": type, - "env_name": env_name, - "opt": args[0], - } - - argparse.ArgumentParser.add_argument(self, *args, **kw) - - def parse_args(self, *args): - values, args = argparse.ArgumentParser.parse_known_args(self, *args) - values._regeneration_metadata = self.__regeneratable_options - return values, args - - -def gyp_main(args): - my_name = os.path.basename(sys.argv[0]) - usage = "usage: %(prog)s [options ...] [build_file ...]" - - parser = RegeneratableOptionParser(usage=usage.replace("%s", "%(prog)s")) - parser.add_argument( - "--build", - dest="configs", - action="append", - help="configuration for build after project generation", - ) - parser.add_argument( - "--check", dest="check", action="store_true", help="check format of gyp files" - ) - parser.add_argument( - "--config-dir", - dest="config_dir", - action="store", - env_name="GYP_CONFIG_DIR", - default=None, - help="The location for configuration files like " "include.gypi.", - ) - parser.add_argument( - "-d", - "--debug", - dest="debug", - metavar="DEBUGMODE", - action="append", - default=[], - help="turn on a debugging " - 'mode for debugging GYP. Supported modes are "variables", ' - '"includes" and "general" or "all" for all of them.', - ) - parser.add_argument( - "-D", - dest="defines", - action="append", - metavar="VAR=VAL", - env_name="GYP_DEFINES", - help="sets variable VAR to value VAL", - ) - parser.add_argument( - "--depth", - dest="depth", - metavar="PATH", - type="path", - help="set DEPTH gyp variable to a relative path to PATH", - ) - parser.add_argument( - "-f", - "--format", - dest="formats", - action="append", - env_name="GYP_GENERATORS", - regenerate=False, - help="output formats to generate", - ) - parser.add_argument( - "-G", - dest="generator_flags", - action="append", - default=[], - metavar="FLAG=VAL", - env_name="GYP_GENERATOR_FLAGS", - help="sets generator flag FLAG to VAL", - ) - parser.add_argument( - "--generator-output", - dest="generator_output", - action="store", - default=None, - metavar="DIR", - type="path", - env_name="GYP_GENERATOR_OUTPUT", - help="puts generated build files under DIR", - ) - parser.add_argument( - "--ignore-environment", - dest="use_environment", - action="store_false", - default=True, - regenerate=False, - help="do not read options from environment variables", - ) - parser.add_argument( - "-I", - "--include", - dest="includes", - action="append", - metavar="INCLUDE", - type="path", - help="files to include in all loaded .gyp files", - ) - # --no-circular-check disables the check for circular relationships between - # .gyp files. These relationships should not exist, but they've only been - # observed to be harmful with the Xcode generator. Chromium's .gyp files - # currently have some circular relationships on non-Mac platforms, so this - # option allows the strict behavior to be used on Macs and the lenient - # behavior to be used elsewhere. - # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. - parser.add_argument( - "--no-circular-check", - dest="circular_check", - action="store_false", - default=True, - regenerate=False, - help="don't check for circular relationships between files", - ) - parser.add_argument( - "--no-parallel", - action="store_true", - default=False, - help="Disable multiprocessing", - ) - parser.add_argument( - "-S", - "--suffix", - dest="suffix", - default="", - help="suffix to add to generated files", - ) - parser.add_argument( - "--toplevel-dir", - dest="toplevel_dir", - action="store", - default=None, - metavar="DIR", - type="path", - help="directory to use as the root of the source tree", - ) - parser.add_argument( - "-R", - "--root-target", - dest="root_targets", - action="append", - metavar="TARGET", - help="include only TARGET and its deep dependencies", - ) - parser.add_argument( - "-V", - "--version", - dest="version", - action="store_true", - help="Show the version and exit.", - ) - - options, build_files_arg = parser.parse_args(args) - if options.version: - import pkg_resources - print(f"v{pkg_resources.get_distribution('gyp-next').version}") - return 0 - build_files = build_files_arg - - # Set up the configuration directory (defaults to ~/.gyp) - if not options.config_dir: - home = None - home_dot_gyp = None - if options.use_environment: - home_dot_gyp = os.environ.get("GYP_CONFIG_DIR", None) - if home_dot_gyp: - home_dot_gyp = os.path.expanduser(home_dot_gyp) - - if not home_dot_gyp: - home_vars = ["HOME"] - if sys.platform in ("cygwin", "win32"): - home_vars.append("USERPROFILE") - for home_var in home_vars: - home = os.getenv(home_var) - if home: - home_dot_gyp = os.path.join(home, ".gyp") - if not os.path.exists(home_dot_gyp): - home_dot_gyp = None - else: - break - else: - home_dot_gyp = os.path.expanduser(options.config_dir) - - if home_dot_gyp and not os.path.exists(home_dot_gyp): - home_dot_gyp = None - - if not options.formats: - # If no format was given on the command line, then check the env variable. - generate_formats = [] - if options.use_environment: - generate_formats = os.environ.get("GYP_GENERATORS", []) - if generate_formats: - generate_formats = re.split(r"[\s,]", generate_formats) - if generate_formats: - options.formats = generate_formats - else: - # Nothing in the variable, default based on platform. - if sys.platform == "darwin": - options.formats = ["xcode"] - elif sys.platform in ("win32", "cygwin"): - options.formats = ["msvs"] - else: - options.formats = ["make"] - - if not options.generator_output and options.use_environment: - g_o = os.environ.get("GYP_GENERATOR_OUTPUT") - if g_o: - options.generator_output = g_o - - options.parallel = not options.no_parallel - - for mode in options.debug: - gyp.debug[mode] = 1 - - # Do an extra check to avoid work when we're not debugging. - if DEBUG_GENERAL in gyp.debug: - DebugOutput(DEBUG_GENERAL, "running with these options:") - for option, value in sorted(options.__dict__.items()): - if option[0] == "_": - continue - if isinstance(value, str): - DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) - else: - DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) - - if not build_files: - build_files = FindBuildFiles() - if not build_files: - raise GypError((usage + "\n\n%s: error: no build_file") % (my_name, my_name)) - - # TODO(mark): Chromium-specific hack! - # For Chromium, the gyp "depth" variable should always be a relative path - # to Chromium's top-level "src" directory. If no depth variable was set - # on the command line, try to find a "src" directory by looking at the - # absolute path to each build file's directory. The first "src" component - # found will be treated as though it were the path used for --depth. - if not options.depth: - for build_file in build_files: - build_file_dir = os.path.abspath(os.path.dirname(build_file)) - build_file_dir_components = build_file_dir.split(os.path.sep) - components_len = len(build_file_dir_components) - for index in range(components_len - 1, -1, -1): - if build_file_dir_components[index] == "src": - options.depth = os.path.sep.join(build_file_dir_components) - break - del build_file_dir_components[index] - - # If the inner loop found something, break without advancing to another - # build file. - if options.depth: - break - - if not options.depth: - raise GypError( - "Could not automatically locate src directory. This is" - "a temporary Chromium feature that will be removed. Use" - "--depth as a workaround." - ) - - # If toplevel-dir is not set, we assume that depth is the root of our source - # tree. - if not options.toplevel_dir: - options.toplevel_dir = options.depth - - # -D on the command line sets variable defaults - D isn't just for define, - # it's for default. Perhaps there should be a way to force (-F?) a - # variable's value so that it can't be overridden by anything else. - cmdline_default_variables = {} - defines = [] - if options.use_environment: - defines += ShlexEnv("GYP_DEFINES") - if options.defines: - defines += options.defines - cmdline_default_variables = NameValueListToDict(defines) - if DEBUG_GENERAL in gyp.debug: - DebugOutput( - DEBUG_GENERAL, "cmdline_default_variables: %s", cmdline_default_variables - ) - - # Set up includes. - includes = [] - - # If ~/.gyp/include.gypi exists, it'll be forcibly included into every - # .gyp file that's loaded, before anything else is included. - if home_dot_gyp: - default_include = os.path.join(home_dot_gyp, "include.gypi") - if os.path.exists(default_include): - print("Using overrides found in " + default_include) - includes.append(default_include) - - # Command-line --include files come after the default include. - if options.includes: - includes.extend(options.includes) - - # Generator flags should be prefixed with the target generator since they - # are global across all generator runs. - gen_flags = [] - if options.use_environment: - gen_flags += ShlexEnv("GYP_GENERATOR_FLAGS") - if options.generator_flags: - gen_flags += options.generator_flags - generator_flags = NameValueListToDict(gen_flags) - if DEBUG_GENERAL in gyp.debug.keys(): - DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) - - # Generate all requested formats (use a set in case we got one format request - # twice) - for format in set(options.formats): - params = { - "options": options, - "build_files": build_files, - "generator_flags": generator_flags, - "cwd": os.getcwd(), - "build_files_arg": build_files_arg, - "gyp_binary": sys.argv[0], - "home_dot_gyp": home_dot_gyp, - "parallel": options.parallel, - "root_targets": options.root_targets, - "target_arch": cmdline_default_variables.get("target_arch", ""), - } - - # Start with the default variables from the command line. - [generator, flat_list, targets, data] = Load( - build_files, - format, - cmdline_default_variables, - includes, - options.depth, - params, - options.check, - options.circular_check, - ) - - # TODO(mark): Pass |data| for now because the generator needs a list of - # build files that came in. In the future, maybe it should just accept - # a list, and not the whole data dict. - # NOTE: flat_list is the flattened dependency graph specifying the order - # that targets may be built. Build systems that operate serially or that - # need to have dependencies defined before dependents reference them should - # generate targets in the order specified in flat_list. - generator.GenerateOutput(flat_list, targets, data, params) - - if options.configs: - valid_configs = targets[flat_list[0]]["configurations"] - for conf in options.configs: - if conf not in valid_configs: - raise GypError("Invalid config specified via --build: %s" % conf) - generator.PerformBuild(data, options.configs, params) - - # Done - return 0 - - -def main(args): - try: - return gyp_main(args) - except GypError as e: - sys.stderr.write("gyp: %s\n" % e) - return 1 - - -# NOTE: setuptools generated console_scripts calls function with no arguments -def script_main(): - return main(sys.argv[1:]) - - -if __name__ == "__main__": - sys.exit(script_main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSUtil.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSUtil.cpython-311.pyc deleted file mode 100644 index d99a1068b..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSUtil.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSVersion.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSVersion.cpython-311.pyc deleted file mode 100644 index 3dbe867a7..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/MSVSVersion.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/__init__.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index a5063d3bc..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/common.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/common.cpython-311.pyc deleted file mode 100644 index 5a3b64644..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/common.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/input.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/input.cpython-311.pyc deleted file mode 100644 index 56731a846..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/input.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/msvs_emulation.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/msvs_emulation.cpython-311.pyc deleted file mode 100644 index c7755ca6a..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/msvs_emulation.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/ninja_syntax.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/ninja_syntax.cpython-311.pyc deleted file mode 100644 index a89fae33d..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/ninja_syntax.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/simple_copy.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/simple_copy.cpython-311.pyc deleted file mode 100644 index 8cce7d6b4..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/simple_copy.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_emulation.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_emulation.cpython-311.pyc deleted file mode 100644 index 739a51921..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_emulation.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_ninja.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_ninja.cpython-311.pyc deleted file mode 100644 index 87c46be1b..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_ninja.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcodeproj_file.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcodeproj_file.cpython-311.pyc deleted file mode 100644 index f15652a0b..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcodeproj_file.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/common.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/common.py deleted file mode 100644 index d77adee8a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/common.py +++ /dev/null @@ -1,661 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import errno -import filecmp -import os.path -import re -import tempfile -import sys -import subprocess - -from collections.abc import MutableSet - - -# A minimal memoizing decorator. It'll blow up if the args aren't immutable, -# among other "problems". -class memoize: - def __init__(self, func): - self.func = func - self.cache = {} - - def __call__(self, *args): - try: - return self.cache[args] - except KeyError: - result = self.func(*args) - self.cache[args] = result - return result - - -class GypError(Exception): - """Error class representing an error, which is to be presented - to the user. The main entry point will catch and display this. - """ - - pass - - -def ExceptionAppend(e, msg): - """Append a message to the given exception's message.""" - if not e.args: - e.args = (msg,) - elif len(e.args) == 1: - e.args = (str(e.args[0]) + " " + msg,) - else: - e.args = (str(e.args[0]) + " " + msg,) + e.args[1:] - - -def FindQualifiedTargets(target, qualified_list): - """ - Given a list of qualified targets, return the qualified targets for the - specified |target|. - """ - return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] - - -def ParseQualifiedTarget(target): - # Splits a qualified target into a build file, target name and toolset. - - # NOTE: rsplit is used to disambiguate the Windows drive letter separator. - target_split = target.rsplit(":", 1) - if len(target_split) == 2: - [build_file, target] = target_split - else: - build_file = None - - target_split = target.rsplit("#", 1) - if len(target_split) == 2: - [target, toolset] = target_split - else: - toolset = None - - return [build_file, target, toolset] - - -def ResolveTarget(build_file, target, toolset): - # This function resolves a target into a canonical form: - # - a fully defined build file, either absolute or relative to the current - # directory - # - a target name - # - a toolset - # - # build_file is the file relative to which 'target' is defined. - # target is the qualified target. - # toolset is the default toolset for that target. - [parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target) - - if parsed_build_file: - if build_file: - # If a relative path, parsed_build_file is relative to the directory - # containing build_file. If build_file is not in the current directory, - # parsed_build_file is not a usable path as-is. Resolve it by - # interpreting it as relative to build_file. If parsed_build_file is - # absolute, it is usable as a path regardless of the current directory, - # and os.path.join will return it as-is. - build_file = os.path.normpath( - os.path.join(os.path.dirname(build_file), parsed_build_file) - ) - # Further (to handle cases like ../cwd), make it relative to cwd) - if not os.path.isabs(build_file): - build_file = RelativePath(build_file, ".") - else: - build_file = parsed_build_file - - if parsed_toolset: - toolset = parsed_toolset - - return [build_file, target, toolset] - - -def BuildFile(fully_qualified_target): - # Extracts the build file from the fully qualified target. - return ParseQualifiedTarget(fully_qualified_target)[0] - - -def GetEnvironFallback(var_list, default): - """Look up a key in the environment, with fallback to secondary keys - and finally falling back to a default value.""" - for var in var_list: - if var in os.environ: - return os.environ[var] - return default - - -def QualifiedTarget(build_file, target, toolset): - # "Qualified" means the file that a target was defined in and the target - # name, separated by a colon, suffixed by a # and the toolset name: - # /path/to/file.gyp:target_name#toolset - fully_qualified = build_file + ":" + target - if toolset: - fully_qualified = fully_qualified + "#" + toolset - return fully_qualified - - -@memoize -def RelativePath(path, relative_to, follow_path_symlink=True): - # Assuming both |path| and |relative_to| are relative to the current - # directory, returns a relative path that identifies path relative to - # relative_to. - # If |follow_symlink_path| is true (default) and |path| is a symlink, then - # this method returns a path to the real file represented by |path|. If it is - # false, this method returns a path to the symlink. If |path| is not a - # symlink, this option has no effect. - - # Convert to normalized (and therefore absolute paths). - if follow_path_symlink: - path = os.path.realpath(path) - else: - path = os.path.abspath(path) - relative_to = os.path.realpath(relative_to) - - # On Windows, we can't create a relative path to a different drive, so just - # use the absolute path. - if sys.platform == "win32": - if ( - os.path.splitdrive(path)[0].lower() - != os.path.splitdrive(relative_to)[0].lower() - ): - return path - - # Split the paths into components. - path_split = path.split(os.path.sep) - relative_to_split = relative_to.split(os.path.sep) - - # Determine how much of the prefix the two paths share. - prefix_len = len(os.path.commonprefix([path_split, relative_to_split])) - - # Put enough ".." components to back up out of relative_to to the common - # prefix, and then append the part of path_split after the common prefix. - relative_split = [os.path.pardir] * ( - len(relative_to_split) - prefix_len - ) + path_split[prefix_len:] - - if len(relative_split) == 0: - # The paths were the same. - return "" - - # Turn it back into a string and we're done. - return os.path.join(*relative_split) - - -@memoize -def InvertRelativePath(path, toplevel_dir=None): - """Given a path like foo/bar that is relative to toplevel_dir, return - the inverse relative path back to the toplevel_dir. - - E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path))) - should always produce the empty string, unless the path contains symlinks. - """ - if not path: - return path - toplevel_dir = "." if toplevel_dir is None else toplevel_dir - return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) - - -def FixIfRelativePath(path, relative_to): - # Like RelativePath but returns |path| unchanged if it is absolute. - if os.path.isabs(path): - return path - return RelativePath(path, relative_to) - - -def UnrelativePath(path, relative_to): - # Assuming that |relative_to| is relative to the current directory, and |path| - # is a path relative to the dirname of |relative_to|, returns a path that - # identifies |path| relative to the current directory. - rel_dir = os.path.dirname(relative_to) - return os.path.normpath(os.path.join(rel_dir, path)) - - -# re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at -# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02 -# and the documentation for various shells. - -# _quote is a pattern that should match any argument that needs to be quoted -# with double-quotes by EncodePOSIXShellArgument. It matches the following -# characters appearing anywhere in an argument: -# \t, \n, space parameter separators -# # comments -# $ expansions (quoted to always expand within one argument) -# % called out by IEEE 1003.1 XCU.2.2 -# & job control -# ' quoting -# (, ) subshell execution -# *, ?, [ pathname expansion -# ; command delimiter -# <, >, | redirection -# = assignment -# {, } brace expansion (bash) -# ~ tilde expansion -# It also matches the empty string, because "" (or '') is the only way to -# represent an empty string literal argument to a POSIX shell. -# -# This does not match the characters in _escape, because those need to be -# backslash-escaped regardless of whether they appear in a double-quoted -# string. -_quote = re.compile("[\t\n #$%&'()*;<=>?[{|}~]|^$") - -# _escape is a pattern that should match any character that needs to be -# escaped with a backslash, whether or not the argument matched the _quote -# pattern. _escape is used with re.sub to backslash anything in _escape's -# first match group, hence the (parentheses) in the regular expression. -# -# _escape matches the following characters appearing anywhere in an argument: -# " to prevent POSIX shells from interpreting this character for quoting -# \ to prevent POSIX shells from interpreting this character for escaping -# ` to prevent POSIX shells from interpreting this character for command -# substitution -# Missing from this list is $, because the desired behavior of -# EncodePOSIXShellArgument is to permit parameter (variable) expansion. -# -# Also missing from this list is !, which bash will interpret as the history -# expansion character when history is enabled. bash does not enable history -# by default in non-interactive shells, so this is not thought to be a problem. -# ! was omitted from this list because bash interprets "\!" as a literal string -# including the backslash character (avoiding history expansion but retaining -# the backslash), which would not be correct for argument encoding. Handling -# this case properly would also be problematic because bash allows the history -# character to be changed with the histchars shell variable. Fortunately, -# as history is not enabled in non-interactive shells and -# EncodePOSIXShellArgument is only expected to encode for non-interactive -# shells, there is no room for error here by ignoring !. -_escape = re.compile(r'(["\\`])') - - -def EncodePOSIXShellArgument(argument): - """Encodes |argument| suitably for consumption by POSIX shells. - - argument may be quoted and escaped as necessary to ensure that POSIX shells - treat the returned value as a literal representing the argument passed to - this function. Parameter (variable) expansions beginning with $ are allowed - to remain intact without escaping the $, to allow the argument to contain - references to variables to be expanded by the shell. - """ - - if not isinstance(argument, str): - argument = str(argument) - - if _quote.search(argument): - quote = '"' - else: - quote = "" - - encoded = quote + re.sub(_escape, r"\\\1", argument) + quote - - return encoded - - -def EncodePOSIXShellList(list): - """Encodes |list| suitably for consumption by POSIX shells. - - Returns EncodePOSIXShellArgument for each item in list, and joins them - together using the space character as an argument separator. - """ - - encoded_arguments = [] - for argument in list: - encoded_arguments.append(EncodePOSIXShellArgument(argument)) - return " ".join(encoded_arguments) - - -def DeepDependencyTargets(target_dicts, roots): - """Returns the recursive list of target dependencies.""" - dependencies = set() - pending = set(roots) - while pending: - # Pluck out one. - r = pending.pop() - # Skip if visited already. - if r in dependencies: - continue - # Add it. - dependencies.add(r) - # Add its children. - spec = target_dicts[r] - pending.update(set(spec.get("dependencies", []))) - pending.update(set(spec.get("dependencies_original", []))) - return list(dependencies - set(roots)) - - -def BuildFileTargets(target_list, build_file): - """From a target_list, returns the subset from the specified build_file. - """ - return [p for p in target_list if BuildFile(p) == build_file] - - -def AllTargets(target_list, target_dicts, build_file): - """Returns all targets (direct and dependencies) for the specified build_file. - """ - bftargets = BuildFileTargets(target_list, build_file) - deptargets = DeepDependencyTargets(target_dicts, bftargets) - return bftargets + deptargets - - -def WriteOnDiff(filename): - """Write to a file only if the new contents differ. - - Arguments: - filename: name of the file to potentially write to. - Returns: - A file like object which will write to temporary file and only overwrite - the target if it differs (on close). - """ - - class Writer: - """Wrapper around file which only covers the target if it differs.""" - - def __init__(self): - # On Cygwin remove the "dir" argument - # `C:` prefixed paths are treated as relative, - # consequently ending up with current dir "/cygdrive/c/..." - # being prefixed to those, which was - # obviously a non-existent path, - # for example: "/cygdrive/c//C:\". - # For more details see: - # https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp - base_temp_dir = "" if IsCygwin() else os.path.dirname(filename) - # Pick temporary file. - tmp_fd, self.tmp_path = tempfile.mkstemp( - suffix=".tmp", - prefix=os.path.split(filename)[1] + ".gyp.", - dir=base_temp_dir, - ) - try: - self.tmp_file = os.fdopen(tmp_fd, "wb") - except Exception: - # Don't leave turds behind. - os.unlink(self.tmp_path) - raise - - def __getattr__(self, attrname): - # Delegate everything else to self.tmp_file - return getattr(self.tmp_file, attrname) - - def close(self): - try: - # Close tmp file. - self.tmp_file.close() - # Determine if different. - same = False - try: - same = filecmp.cmp(self.tmp_path, filename, False) - except OSError as e: - if e.errno != errno.ENOENT: - raise - - if same: - # The new file is identical to the old one, just get rid of the new - # one. - os.unlink(self.tmp_path) - else: - # The new file is different from the old one, - # or there is no old one. - # Rename the new file to the permanent name. - # - # tempfile.mkstemp uses an overly restrictive mode, resulting in a - # file that can only be read by the owner, regardless of the umask. - # There's no reason to not respect the umask here, - # which means that an extra hoop is required - # to fetch it and reset the new file's mode. - # - # No way to get the umask without setting a new one? Set a safe one - # and then set it back to the old value. - umask = os.umask(0o77) - os.umask(umask) - os.chmod(self.tmp_path, 0o666 & ~umask) - if sys.platform == "win32" and os.path.exists(filename): - # NOTE: on windows (but not cygwin) rename will not replace an - # existing file, so it must be preceded with a remove. - # Sadly there is no way to make the switch atomic. - os.remove(filename) - os.rename(self.tmp_path, filename) - except Exception: - # Don't leave turds behind. - os.unlink(self.tmp_path) - raise - - def write(self, s): - self.tmp_file.write(s.encode("utf-8")) - - return Writer() - - -def EnsureDirExists(path): - """Make sure the directory for |path| exists.""" - try: - os.makedirs(os.path.dirname(path)) - except OSError: - pass - - -def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" - flavors = { - "cygwin": "win", - "win32": "win", - "darwin": "mac", - } - - if "flavor" in params: - return params["flavor"] - if sys.platform in flavors: - return flavors[sys.platform] - if sys.platform.startswith("sunos"): - return "solaris" - if sys.platform.startswith(("dragonfly", "freebsd")): - return "freebsd" - if sys.platform.startswith("openbsd"): - return "openbsd" - if sys.platform.startswith("netbsd"): - return "netbsd" - if sys.platform.startswith("aix"): - return "aix" - if sys.platform.startswith(("os390", "zos")): - return "zos" - if sys.platform == "os400": - return "os400" - - return "linux" - - -def CopyTool(flavor, out_path, generator_flags={}): - """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it - to |out_path|.""" - # aix and solaris just need flock emulation. mac and win use more complicated - # support scripts. - prefix = { - "aix": "flock", - "os400": "flock", - "solaris": "flock", - "mac": "mac", - "ios": "mac", - "win": "win", - }.get(flavor, None) - if not prefix: - return - - # Slurp input file. - source_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "%s_tool.py" % prefix - ) - with open(source_path) as source_file: - source = source_file.readlines() - - # Set custom header flags. - header = "# Generated by gyp. Do not edit.\n" - mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) - if flavor == "mac" and mac_toolchain_dir: - header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" % mac_toolchain_dir - - # Add header and write it out. - tool_path = os.path.join(out_path, "gyp-%s-tool" % prefix) - with open(tool_path, "w") as tool_file: - tool_file.write("".join([source[0], header] + source[1:])) - - # Make file executable. - os.chmod(tool_path, 0o755) - - -# From Alex Martelli, -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 -# ASPN: Python Cookbook: Remove duplicates from a sequence -# First comment, dated 2001/10/13. -# (Also in the printed Python Cookbook.) - - -def uniquer(seq, idfun=lambda x: x): - seen = {} - result = [] - for item in seq: - marker = idfun(item) - if marker in seen: - continue - seen[marker] = 1 - result.append(item) - return result - - -# Based on http://code.activestate.com/recipes/576694/. -class OrderedSet(MutableSet): - def __init__(self, iterable=None): - self.end = end = [] - end += [None, end, end] # sentinel node for doubly linked list - self.map = {} # key --> [key, prev, next] - if iterable is not None: - self |= iterable - - def __len__(self): - return len(self.map) - - def __contains__(self, key): - return key in self.map - - def add(self, key): - if key not in self.map: - end = self.end - curr = end[1] - curr[2] = end[1] = self.map[key] = [key, curr, end] - - def discard(self, key): - if key in self.map: - key, prev_item, next_item = self.map.pop(key) - prev_item[2] = next_item - next_item[1] = prev_item - - def __iter__(self): - end = self.end - curr = end[2] - while curr is not end: - yield curr[0] - curr = curr[2] - - def __reversed__(self): - end = self.end - curr = end[1] - while curr is not end: - yield curr[0] - curr = curr[1] - - # The second argument is an addition that causes a pylint warning. - def pop(self, last=True): # pylint: disable=W0221 - if not self: - raise KeyError("set is empty") - key = self.end[1][0] if last else self.end[2][0] - self.discard(key) - return key - - def __repr__(self): - if not self: - return f"{self.__class__.__name__}()" - return f"{self.__class__.__name__}({list(self)!r})" - - def __eq__(self, other): - if isinstance(other, OrderedSet): - return len(self) == len(other) and list(self) == list(other) - return set(self) == set(other) - - # Extensions to the recipe. - def update(self, iterable): - for i in iterable: - if i not in self: - self.add(i) - - -class CycleError(Exception): - """An exception raised when an unexpected cycle is detected.""" - - def __init__(self, nodes): - self.nodes = nodes - - def __str__(self): - return "CycleError: cycle involving: " + str(self.nodes) - - -def TopologicallySorted(graph, get_edges): - r"""Topologically sort based on a user provided edge definition. - - Args: - graph: A list of node names. - get_edges: A function mapping from node name to a hashable collection - of node names which this node has outgoing edges to. - Returns: - A list containing all of the node in graph in topological order. - It is assumed that calling get_edges once for each node and caching is - cheaper than repeatedly calling get_edges. - Raises: - CycleError in the event of a cycle. - Example: - graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'} - def GetEdges(node): - return re.findall(r'\$\(([^))]\)', graph[node]) - print TopologicallySorted(graph.keys(), GetEdges) - ==> - ['a', 'c', b'] - """ - get_edges = memoize(get_edges) - visited = set() - visiting = set() - ordered_nodes = [] - - def Visit(node): - if node in visiting: - raise CycleError(visiting) - if node in visited: - return - visited.add(node) - visiting.add(node) - for neighbor in get_edges(node): - Visit(neighbor) - visiting.remove(node) - ordered_nodes.insert(0, node) - - for node in sorted(graph): - Visit(node) - return ordered_nodes - - -def CrossCompileRequested(): - # TODO: figure out how to not build extra host objects in the - # non-cross-compile case when this is enabled, and enable unconditionally. - return ( - os.environ.get("GYP_CROSSCOMPILE") - or os.environ.get("AR_host") - or os.environ.get("CC_host") - or os.environ.get("CXX_host") - or os.environ.get("AR_target") - or os.environ.get("CC_target") - or os.environ.get("CXX_target") - ) - - -def IsCygwin(): - try: - out = subprocess.Popen( - "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - stdout = out.communicate()[0].decode("utf-8") - return "CYGWIN" in str(stdout) - except Exception: - return False diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/common_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/common_test.py deleted file mode 100755 index 05344085a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Unit tests for the common.py file.""" - -import gyp.common -import unittest -import sys - - -class TestTopologicallySorted(unittest.TestCase): - def test_Valid(self): - """Test that sorting works on a valid graph with one possible order.""" - graph = { - "a": ["b", "c"], - "b": [], - "c": ["d"], - "d": ["b"], - } - - def GetEdge(node): - return tuple(graph[node]) - - self.assertEqual( - gyp.common.TopologicallySorted(graph.keys(), GetEdge), ["a", "c", "d", "b"] - ) - - def test_Cycle(self): - """Test that an exception is thrown on a cyclic graph.""" - graph = { - "a": ["b"], - "b": ["c"], - "c": ["d"], - "d": ["a"], - } - - def GetEdge(node): - return tuple(graph[node]) - - self.assertRaises( - gyp.common.CycleError, gyp.common.TopologicallySorted, graph.keys(), GetEdge - ) - - -class TestGetFlavor(unittest.TestCase): - """Test that gyp.common.GetFlavor works as intended""" - - original_platform = "" - - def setUp(self): - self.original_platform = sys.platform - - def tearDown(self): - sys.platform = self.original_platform - - def assertFlavor(self, expected, argument, param): - sys.platform = argument - self.assertEqual(expected, gyp.common.GetFlavor(param)) - - def test_platform_default(self): - self.assertFlavor("freebsd", "freebsd9", {}) - self.assertFlavor("freebsd", "freebsd10", {}) - self.assertFlavor("openbsd", "openbsd5", {}) - self.assertFlavor("solaris", "sunos5", {}) - self.assertFlavor("solaris", "sunos", {}) - self.assertFlavor("linux", "linux2", {}) - self.assertFlavor("linux", "linux3", {}) - self.assertFlavor("linux", "linux", {}) - - def test_param(self): - self.assertFlavor("foobar", "linux2", {"flavor": "foobar"}) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py deleted file mode 100644 index bda1a4746..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +++ /dev/null @@ -1,165 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import sys -import re -import os -import locale -from functools import reduce - - -def XmlToString(content, encoding="utf-8", pretty=False): - """ Writes the XML content to disk, touching the file only if it has changed. - - Visual Studio files have a lot of pre-defined structures. This function makes - it easy to represent these structures as Python data structures, instead of - having to create a lot of function calls. - - Each XML element of the content is represented as a list composed of: - 1. The name of the element, a string, - 2. The attributes of the element, a dictionary (optional), and - 3+. The content of the element, if any. Strings are simple text nodes and - lists are child elements. - - Example 1: - - becomes - ['test'] - - Example 2: - - This is - it! - - - becomes - ['myelement', {'a':'value1', 'b':'value2'}, - ['childtype', 'This is'], - ['childtype', 'it!'], - ] - - Args: - content: The structured content to be converted. - encoding: The encoding to report on the first XML line. - pretty: True if we want pretty printing with indents and new lines. - - Returns: - The XML content as a string. - """ - # We create a huge list of all the elements of the file. - xml_parts = ['' % encoding] - if pretty: - xml_parts.append("\n") - _ConstructContentList(xml_parts, content, pretty) - - # Convert it to a string - return "".join(xml_parts) - - -def _ConstructContentList(xml_parts, specification, pretty, level=0): - """ Appends the XML parts corresponding to the specification. - - Args: - xml_parts: A list of XML parts to be appended to. - specification: The specification of the element. See EasyXml docs. - pretty: True if we want pretty printing with indents and new lines. - level: Indentation level. - """ - # The first item in a specification is the name of the element. - if pretty: - indentation = " " * level - new_line = "\n" - else: - indentation = "" - new_line = "" - name = specification[0] - if not isinstance(name, str): - raise Exception( - "The first item of an EasyXml specification should be " - "a string. Specification was " + str(specification) - ) - xml_parts.append(indentation + "<" + name) - - # Optionally in second position is a dictionary of the attributes. - rest = specification[1:] - if rest and isinstance(rest[0], dict): - for at, val in sorted(rest[0].items()): - xml_parts.append(f' {at}="{_XmlEscape(val, attr=True)}"') - rest = rest[1:] - if rest: - xml_parts.append(">") - all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) - multi_line = not all_strings - if multi_line and new_line: - xml_parts.append(new_line) - for child_spec in rest: - # If it's a string, append a text node. - # Otherwise recurse over that child definition - if isinstance(child_spec, str): - xml_parts.append(_XmlEscape(child_spec)) - else: - _ConstructContentList(xml_parts, child_spec, pretty, level + 1) - if multi_line and indentation: - xml_parts.append(indentation) - xml_parts.append(f"{new_line}") - else: - xml_parts.append("/>%s" % new_line) - - -def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, - win32=(sys.platform == "win32")): - """ Writes the XML content to disk, touching the file only if it has changed. - - Args: - content: The structured content to be written. - path: Location of the file. - encoding: The encoding to report on the first line of the XML file. - pretty: True if we want pretty printing with indents and new lines. - """ - xml_string = XmlToString(content, encoding, pretty) - if win32 and os.linesep != "\r\n": - xml_string = xml_string.replace("\n", "\r\n") - - default_encoding = locale.getdefaultlocale()[1] - if default_encoding and default_encoding.upper() != encoding.upper(): - xml_string = xml_string.encode(encoding) - - # Get the old content - try: - with open(path) as file: - existing = file.read() - except OSError: - existing = None - - # It has changed, write it - if existing != xml_string: - with open(path, "wb") as file: - file.write(xml_string) - - -_xml_escape_map = { - '"': """, - "'": "'", - "<": "<", - ">": ">", - "&": "&", - "\n": " ", - "\r": " ", -} - - -_xml_escape_re = re.compile("(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) - - -def _XmlEscape(value, attr=False): - """ Escape a string for inclusion in XML.""" - - def replace(match): - m = match.string[match.start() : match.end()] - # don't replace single quotes in attrs - if attr and m == "'": - return m - return _xml_escape_map[m] - - return _xml_escape_re.sub(replace, value) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py deleted file mode 100755 index 342f693a3..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the easy_xml.py file. """ - -import gyp.easy_xml as easy_xml -import unittest - -from io import StringIO - - -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() - - def test_EasyXml_simple(self): - self.assertEqual( - easy_xml.XmlToString(["test"]), - '', - ) - - self.assertEqual( - easy_xml.XmlToString(["test"], encoding="Windows-1252"), - '', - ) - - def test_EasyXml_simple_with_attributes(self): - self.assertEqual( - easy_xml.XmlToString(["test2", {"a": "value1", "b": "value2"}]), - '', - ) - - def test_EasyXml_escaping(self): - original = "'\"\r&\nfoo" - converted = "<test>'" & foo" - converted_apos = converted.replace("'", "'") - self.assertEqual( - easy_xml.XmlToString(["test3", {"a": original}, original]), - '%s' - % (converted, converted_apos), - ) - - def test_EasyXml_pretty(self): - self.assertEqual( - easy_xml.XmlToString( - ["test3", ["GrandParent", ["Parent1", ["Child"]], ["Parent2"]]], - pretty=True, - ), - '\n' - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n", - ) - - def test_EasyXml_complex(self): - # We want to create: - target = ( - '' - "" - '' - "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}" - "Win32Proj" - "automated_ui_tests" - "" - '' - "' - "Application" - "Unicode" - "" - "" - ) - - xml = easy_xml.XmlToString( - [ - "Project", - [ - "PropertyGroup", - {"Label": "Globals"}, - ["ProjectGuid", "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}"], - ["Keyword", "Win32Proj"], - ["RootNamespace", "automated_ui_tests"], - ], - ["Import", {"Project": "$(VCTargetsPath)\\Microsoft.Cpp.props"}], - [ - "PropertyGroup", - { - "Condition": "'$(Configuration)|$(Platform)'=='Debug|Win32'", - "Label": "Configuration", - }, - ["ConfigurationType", "Application"], - ["CharacterSet", "Unicode"], - ], - ] - ) - self.assertEqual(xml, target) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py deleted file mode 100755 index 0754aff26..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""These functions are executed via gyp-flock-tool when using the Makefile -generator. Used on systems that don't have a built-in flock.""" - -import fcntl -import os -import struct -import subprocess -import sys - - -def main(args): - executor = FlockTool() - executor.Dispatch(args) - - -class FlockTool: - """This class emulates the 'flock' command.""" - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace("-", "") - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - # Note that the stock python on SunOS has a bug - # where fcntl.flock(fd, LOCK_EX) always fails - # with EBADF, that's why we use this F_SETLK - # hack instead. - fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - if sys.platform.startswith("aix") or sys.platform == "os400": - # Python on AIX is compiled with LARGEFILE support, which changes the - # struct size. - op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - else: - op = struct.pack("hhllhhl", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - fcntl.fcntl(fd, fcntl.F_SETLK, op) - return subprocess.call(cmd_list) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/__init__.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index f10c6c69b..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/make.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/make.cpython-311.pyc deleted file mode 100644 index e04c53f4c..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/make.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/ninja.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/ninja.cpython-311.pyc deleted file mode 100644 index c908ad3dd..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/ninja.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/xcode.cpython-311.pyc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/xcode.cpython-311.pyc deleted file mode 100644 index 4705115b7..000000000 Binary files a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/xcode.cpython-311.pyc and /dev/null differ diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py deleted file mode 100644 index f15df00c3..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +++ /dev/null @@ -1,808 +0,0 @@ -# Copyright (c) 2014 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" -This script is intended for use as a GYP_GENERATOR. It takes as input (by way of -the generator flag config_path) the path of a json file that dictates the files -and targets to search for. The following keys are supported: -files: list of paths (relative) of the files to search for. -test_targets: unqualified target names to search for. Any target in this list -that depends upon a file in |files| is output regardless of the type of target -or chain of dependencies. -additional_compile_targets: Unqualified targets to search for in addition to -test_targets. Targets in the combined list that depend upon a file in |files| -are not necessarily output. For example, if the target is of type none then the -target is not output (but one of the descendants of the target will be). - -The following is output: -error: only supplied if there is an error. -compile_targets: minimal set of targets that directly or indirectly (for - targets of type none) depend on the files in |files| and is one of the - supplied targets or a target that one of the supplied targets depends on. - The expectation is this set of targets is passed into a build step. This list - always contains the output of test_targets as well. -test_targets: set of targets from the supplied |test_targets| that either - directly or indirectly depend upon a file in |files|. This list if useful - if additional processing needs to be done for certain targets after the - build, such as running tests. -status: outputs one of three values: none of the supplied files were found, - one of the include files changed so that it should be assumed everything - changed (in this case test_targets and compile_targets are not output) or at - least one file was found. -invalid_targets: list of supplied targets that were not found. - -Example: -Consider a graph like the following: - A D - / \ -B C -A depends upon both B and C, A is of type none and B and C are executables. -D is an executable, has no dependencies and nothing depends on it. -If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and -files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then -the following is output: -|compile_targets| = ["B"] B must built as it depends upon the changed file b.cc -and the supplied target A depends upon it. A is not output as a build_target -as it is of type none with no rules and actions. -|test_targets| = ["B"] B directly depends upon the change file b.cc. - -Even though the file d.cc, which D depends upon, has changed D is not output -as it was not supplied by way of |additional_compile_targets| or |test_targets|. - -If the generator flag analyzer_output_path is specified, output is written -there. Otherwise output is written to stdout. - -In Gyp the "all" target is shorthand for the root targets in the files passed -to gyp. For example, if file "a.gyp" contains targets "a1" and -"a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency -on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2". -Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not -directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp -then the "all" target includes "b1" and "b2". -""" - - -import gyp.common -import json -import os -import posixpath - -debug = False - -found_dependency_string = "Found dependency" -no_dependency_string = "No dependencies" -# Status when it should be assumed that everything has changed. -all_changed_string = "Found dependency (all)" - -# MatchStatus is used indicate if and how a target depends upon the supplied -# sources. -# The target's sources contain one of the supplied paths. -MATCH_STATUS_MATCHES = 1 -# The target has a dependency on another target that contains one of the -# supplied paths. -MATCH_STATUS_MATCHES_BY_DEPENDENCY = 2 -# The target's sources weren't in the supplied paths and none of the target's -# dependencies depend upon a target that matched. -MATCH_STATUS_DOESNT_MATCH = 3 -# The target doesn't contain the source, but the dependent targets have not yet -# been visited to determine a more specific status yet. -MATCH_STATUS_TBD = 4 - -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - -generator_wants_static_library_dependencies_adjusted = False - -generator_default_variables = {} -for dirname in [ - "INTERMEDIATE_DIR", - "SHARED_INTERMEDIATE_DIR", - "PRODUCT_DIR", - "LIB_DIR", - "SHARED_LIB_DIR", -]: - generator_default_variables[dirname] = "!!!" - -for unused in [ - "RULE_INPUT_PATH", - "RULE_INPUT_ROOT", - "RULE_INPUT_NAME", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "CONFIGURATION_NAME", -]: - generator_default_variables[unused] = "" - - -def _ToGypPath(path): - """Converts a path to the format used by gyp.""" - if os.sep == "\\" and os.altsep == "/": - return path.replace("\\", "/") - return path - - -def _ResolveParent(path, base_path_components): - """Resolves |path|, which starts with at least one '../'. Returns an empty - string if the path shouldn't be considered. See _AddSources() for a - description of |base_path_components|.""" - depth = 0 - while path.startswith("../"): - depth += 1 - path = path[3:] - # Relative includes may go outside the source tree. For example, an action may - # have inputs in /usr/include, which are not in the source tree. - if depth > len(base_path_components): - return "" - if depth == len(base_path_components): - return path - return ( - "/".join(base_path_components[0 : len(base_path_components) - depth]) - + "/" - + path - ) - - -def _AddSources(sources, base_path, base_path_components, result): - """Extracts valid sources from |sources| and adds them to |result|. Each - source file is relative to |base_path|, but may contain '..'. To make - resolving '..' easier |base_path_components| contains each of the - directories in |base_path|. Additionally each source may contain variables. - Such sources are ignored as it is assumed dependencies on them are expressed - and tracked in some other means.""" - # NOTE: gyp paths are always posix style. - for source in sources: - if not len(source) or source.startswith("!!!") or source.startswith("$"): - continue - # variable expansion may lead to //. - org_source = source - source = source[0] + source[1:].replace("//", "/") - if source.startswith("../"): - source = _ResolveParent(source, base_path_components) - if len(source): - result.append(source) - continue - result.append(base_path + source) - if debug: - print("AddSource", org_source, result[len(result) - 1]) - - -def _ExtractSourcesFromAction(action, base_path, base_path_components, results): - if "inputs" in action: - _AddSources(action["inputs"], base_path, base_path_components, results) - - -def _ToLocalPath(toplevel_dir, path): - """Converts |path| to a path relative to |toplevel_dir|.""" - if path == toplevel_dir: - return "" - if path.startswith(toplevel_dir + "/"): - return path[len(toplevel_dir) + len("/") :] - return path - - -def _ExtractSources(target, target_dict, toplevel_dir): - # |target| is either absolute or relative and in the format of the OS. Gyp - # source paths are always posix. Convert |target| to a posix path relative to - # |toplevel_dir_|. This is done to make it easy to build source paths. - base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target))) - base_path_components = base_path.split("/") - - # Add a trailing '/' so that _AddSources() can easily build paths. - if len(base_path): - base_path += "/" - - if debug: - print("ExtractSources", target, base_path) - - results = [] - if "sources" in target_dict: - _AddSources(target_dict["sources"], base_path, base_path_components, results) - # Include the inputs from any actions. Any changes to these affect the - # resulting output. - if "actions" in target_dict: - for action in target_dict["actions"]: - _ExtractSourcesFromAction(action, base_path, base_path_components, results) - if "rules" in target_dict: - for rule in target_dict["rules"]: - _ExtractSourcesFromAction(rule, base_path, base_path_components, results) - - return results - - -class Target: - """Holds information about a particular target: - deps: set of Targets this Target depends upon. This is not recursive, only the - direct dependent Targets. - match_status: one of the MatchStatus values. - back_deps: set of Targets that have a dependency on this Target. - visited: used during iteration to indicate whether we've visited this target. - This is used for two iterations, once in building the set of Targets and - again in _GetBuildTargets(). - name: fully qualified name of the target. - requires_build: True if the target type is such that it needs to be built. - See _DoesTargetTypeRequireBuild for details. - added_to_compile_targets: used when determining if the target was added to the - set of targets that needs to be built. - in_roots: true if this target is a descendant of one of the root nodes. - is_executable: true if the type of target is executable. - is_static_library: true if the type of target is static_library. - is_or_has_linked_ancestor: true if the target does a link (eg executable), or - if there is a target in back_deps that does a link.""" - - def __init__(self, name): - self.deps = set() - self.match_status = MATCH_STATUS_TBD - self.back_deps = set() - self.name = name - # TODO(sky): I don't like hanging this off Target. This state is specific - # to certain functions and should be isolated there. - self.visited = False - self.requires_build = False - self.added_to_compile_targets = False - self.in_roots = False - self.is_executable = False - self.is_static_library = False - self.is_or_has_linked_ancestor = False - - -class Config: - """Details what we're looking for - files: set of files to search for - targets: see file description for details.""" - - def __init__(self): - self.files = [] - self.targets = set() - self.additional_compile_target_names = set() - self.test_target_names = set() - - def Init(self, params): - """Initializes Config. This is a separate method as it raises an exception - if there is a parse error.""" - generator_flags = params.get("generator_flags", {}) - config_path = generator_flags.get("config_path", None) - if not config_path: - return - try: - f = open(config_path) - config = json.load(f) - f.close() - except OSError: - raise Exception("Unable to open file " + config_path) - except ValueError as e: - raise Exception("Unable to parse config file " + config_path + str(e)) - if not isinstance(config, dict): - raise Exception("config_path must be a JSON file containing a dictionary") - self.files = config.get("files", []) - self.additional_compile_target_names = set( - config.get("additional_compile_targets", []) - ) - self.test_target_names = set(config.get("test_targets", [])) - - -def _WasBuildFileModified(build_file, data, files, toplevel_dir): - """Returns true if the build file |build_file| is either in |files| or - one of the files included by |build_file| is in |files|. |toplevel_dir| is - the root of the source tree.""" - if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files: - if debug: - print("gyp file modified", build_file) - return True - - # First element of included_files is the file itself. - if len(data[build_file]["included_files"]) <= 1: - return False - - for include_file in data[build_file]["included_files"][1:]: - # |included_files| are relative to the directory of the |build_file|. - rel_include_file = _ToGypPath( - gyp.common.UnrelativePath(include_file, build_file) - ) - if _ToLocalPath(toplevel_dir, rel_include_file) in files: - if debug: - print( - "included gyp file modified, gyp_file=", - build_file, - "included file=", - rel_include_file, - ) - return True - return False - - -def _GetOrCreateTargetByName(targets, target_name): - """Creates or returns the Target at targets[target_name]. If there is no - Target for |target_name| one is created. Returns a tuple of whether a new - Target was created and the Target.""" - if target_name in targets: - return False, targets[target_name] - target = Target(target_name) - targets[target_name] = target - return True, target - - -def _DoesTargetTypeRequireBuild(target_dict): - """Returns true if the target type is such that it needs to be built.""" - # If a 'none' target has rules or actions we assume it requires a build. - return bool( - target_dict["type"] != "none" - or target_dict.get("actions") - or target_dict.get("rules") - ) - - -def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, build_files): - """Returns a tuple of the following: - . A dictionary mapping from fully qualified name to Target. - . A list of the targets that have a source file in |files|. - . Targets that constitute the 'all' target. See description at top of file - for details on the 'all' target. - This sets the |match_status| of the targets that contain any of the source - files in |files| to MATCH_STATUS_MATCHES. - |toplevel_dir| is the root of the source tree.""" - # Maps from target name to Target. - name_to_target = {} - - # Targets that matched. - matching_targets = [] - - # Queue of targets to visit. - targets_to_visit = target_list[:] - - # Maps from build file to a boolean indicating whether the build file is in - # |files|. - build_file_in_files = {} - - # Root targets across all files. - roots = set() - - # Set of Targets in |build_files|. - build_file_targets = set() - - while len(targets_to_visit) > 0: - target_name = targets_to_visit.pop() - created_target, target = _GetOrCreateTargetByName(name_to_target, target_name) - if created_target: - roots.add(target) - elif target.visited: - continue - - target.visited = True - target.requires_build = _DoesTargetTypeRequireBuild(target_dicts[target_name]) - target_type = target_dicts[target_name]["type"] - target.is_executable = target_type == "executable" - target.is_static_library = target_type == "static_library" - target.is_or_has_linked_ancestor = ( - target_type == "executable" or target_type == "shared_library" - ) - - build_file = gyp.common.ParseQualifiedTarget(target_name)[0] - if build_file not in build_file_in_files: - build_file_in_files[build_file] = _WasBuildFileModified( - build_file, data, files, toplevel_dir - ) - - if build_file in build_files: - build_file_targets.add(target) - - # If a build file (or any of its included files) is modified we assume all - # targets in the file are modified. - if build_file_in_files[build_file]: - print("matching target from modified build file", target_name) - target.match_status = MATCH_STATUS_MATCHES - matching_targets.append(target) - else: - sources = _ExtractSources( - target_name, target_dicts[target_name], toplevel_dir - ) - for source in sources: - if _ToGypPath(os.path.normpath(source)) in files: - print("target", target_name, "matches", source) - target.match_status = MATCH_STATUS_MATCHES - matching_targets.append(target) - break - - # Add dependencies to visit as well as updating back pointers for deps. - for dep in target_dicts[target_name].get("dependencies", []): - targets_to_visit.append(dep) - - created_dep_target, dep_target = _GetOrCreateTargetByName( - name_to_target, dep - ) - if not created_dep_target: - roots.discard(dep_target) - - target.deps.add(dep_target) - dep_target.back_deps.add(target) - - return name_to_target, matching_targets, roots & build_file_targets - - -def _GetUnqualifiedToTargetMapping(all_targets, to_find): - """Returns a tuple of the following: - . mapping (dictionary) from unqualified name to Target for all the - Targets in |to_find|. - . any target names not found. If this is empty all targets were found.""" - result = {} - if not to_find: - return {}, [] - to_find = set(to_find) - for target_name in all_targets.keys(): - extracted = gyp.common.ParseQualifiedTarget(target_name) - if len(extracted) > 1 and extracted[1] in to_find: - to_find.remove(extracted[1]) - result[extracted[1]] = all_targets[target_name] - if not to_find: - return result, [] - return result, [x for x in to_find] - - -def _DoesTargetDependOnMatchingTargets(target): - """Returns true if |target| or any of its dependencies is one of the - targets containing the files supplied as input to analyzer. This updates - |matches| of the Targets as it recurses. - target: the Target to look for.""" - if target.match_status == MATCH_STATUS_DOESNT_MATCH: - return False - if ( - target.match_status == MATCH_STATUS_MATCHES - or target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY - ): - return True - for dep in target.deps: - if _DoesTargetDependOnMatchingTargets(dep): - target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY - print("\t", target.name, "matches by dep", dep.name) - return True - target.match_status = MATCH_STATUS_DOESNT_MATCH - return False - - -def _GetTargetsDependingOnMatchingTargets(possible_targets): - """Returns the list of Targets in |possible_targets| that depend (either - directly on indirectly) on at least one of the targets containing the files - supplied as input to analyzer. - possible_targets: targets to search from.""" - found = [] - print("Targets that matched by dependency:") - for target in possible_targets: - if _DoesTargetDependOnMatchingTargets(target): - found.append(target) - return found - - -def _AddCompileTargets(target, roots, add_if_no_ancestor, result): - """Recurses through all targets that depend on |target|, adding all targets - that need to be built (and are in |roots|) to |result|. - roots: set of root targets. - add_if_no_ancestor: If true and there are no ancestors of |target| then add - |target| to |result|. |target| must still be in |roots|. - result: targets that need to be built are added here.""" - if target.visited: - return - - target.visited = True - target.in_roots = target in roots - - for back_dep_target in target.back_deps: - _AddCompileTargets(back_dep_target, roots, False, result) - target.added_to_compile_targets |= back_dep_target.added_to_compile_targets - target.in_roots |= back_dep_target.in_roots - target.is_or_has_linked_ancestor |= back_dep_target.is_or_has_linked_ancestor - - # Always add 'executable' targets. Even though they may be built by other - # targets that depend upon them it makes detection of what is going to be - # built easier. - # And always add static_libraries that have no dependencies on them from - # linkables. This is necessary as the other dependencies on them may be - # static libraries themselves, which are not compile time dependencies. - if target.in_roots and ( - target.is_executable - or ( - not target.added_to_compile_targets - and (add_if_no_ancestor or target.requires_build) - ) - or ( - target.is_static_library - and add_if_no_ancestor - and not target.is_or_has_linked_ancestor - ) - ): - print( - "\t\tadding to compile targets", - target.name, - "executable", - target.is_executable, - "added_to_compile_targets", - target.added_to_compile_targets, - "add_if_no_ancestor", - add_if_no_ancestor, - "requires_build", - target.requires_build, - "is_static_library", - target.is_static_library, - "is_or_has_linked_ancestor", - target.is_or_has_linked_ancestor, - ) - result.add(target) - target.added_to_compile_targets = True - - -def _GetCompileTargets(matching_targets, supplied_targets): - """Returns the set of Targets that require a build. - matching_targets: targets that changed and need to be built. - supplied_targets: set of targets supplied to analyzer to search from.""" - result = set() - for target in matching_targets: - print("finding compile targets for match", target.name) - _AddCompileTargets(target, supplied_targets, True, result) - return result - - -def _WriteOutput(params, **values): - """Writes the output, either to stdout or a file is specified.""" - if "error" in values: - print("Error:", values["error"]) - if "status" in values: - print(values["status"]) - if "targets" in values: - values["targets"].sort() - print("Supplied targets that depend on changed files:") - for target in values["targets"]: - print("\t", target) - if "invalid_targets" in values: - values["invalid_targets"].sort() - print("The following targets were not found:") - for target in values["invalid_targets"]: - print("\t", target) - if "build_targets" in values: - values["build_targets"].sort() - print("Targets that require a build:") - for target in values["build_targets"]: - print("\t", target) - if "compile_targets" in values: - values["compile_targets"].sort() - print("Targets that need to be built:") - for target in values["compile_targets"]: - print("\t", target) - if "test_targets" in values: - values["test_targets"].sort() - print("Test targets:") - for target in values["test_targets"]: - print("\t", target) - - output_path = params.get("generator_flags", {}).get("analyzer_output_path", None) - if not output_path: - print(json.dumps(values)) - return - try: - f = open(output_path, "w") - f.write(json.dumps(values) + "\n") - f.close() - except OSError as e: - print("Error writing to output file", output_path, str(e)) - - -def _WasGypIncludeFileModified(params, files): - """Returns true if one of the files in |files| is in the set of included - files.""" - if params["options"].includes: - for include in params["options"].includes: - if _ToGypPath(os.path.normpath(include)) in files: - print("Include file modified, assuming all changed", include) - return True - return False - - -def _NamesNotIn(names, mapping): - """Returns a list of the values in |names| that are not in |mapping|.""" - return [name for name in names if name not in mapping] - - -def _LookupTargets(names, mapping): - """Returns a list of the mapping[name] for each value in |names| that is in - |mapping|.""" - return [mapping[name] for name in names if name in mapping] - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - flavor = gyp.common.GetFlavor(params) - if flavor == "mac": - default_variables.setdefault("OS", "mac") - elif flavor == "win": - default_variables.setdefault("OS", "win") - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - else: - operating_system = flavor - if flavor == "android": - operating_system = "linux" # Keep this legacy behavior for now. - default_variables.setdefault("OS", operating_system) - - -class TargetCalculator: - """Calculates the matching test_targets and matching compile_targets.""" - - def __init__( - self, - files, - additional_compile_target_names, - test_target_names, - data, - target_list, - target_dicts, - toplevel_dir, - build_files, - ): - self._additional_compile_target_names = set(additional_compile_target_names) - self._test_target_names = set(test_target_names) - ( - self._name_to_target, - self._changed_targets, - self._root_targets, - ) = _GenerateTargets( - data, target_list, target_dicts, toplevel_dir, frozenset(files), build_files - ) - ( - self._unqualified_mapping, - self.invalid_targets, - ) = _GetUnqualifiedToTargetMapping( - self._name_to_target, self._supplied_target_names_no_all() - ) - - def _supplied_target_names(self): - return self._additional_compile_target_names | self._test_target_names - - def _supplied_target_names_no_all(self): - """Returns the supplied test targets without 'all'.""" - result = self._supplied_target_names() - result.discard("all") - return result - - def is_build_impacted(self): - """Returns true if the supplied files impact the build at all.""" - return self._changed_targets - - def find_matching_test_target_names(self): - """Returns the set of output test targets.""" - assert self.is_build_impacted() - # Find the test targets first. 'all' is special cased to mean all the - # root targets. To deal with all the supplied |test_targets| are expanded - # to include the root targets during lookup. If any of the root targets - # match, we remove it and replace it with 'all'. - test_target_names_no_all = set(self._test_target_names) - test_target_names_no_all.discard("all") - test_targets_no_all = _LookupTargets( - test_target_names_no_all, self._unqualified_mapping - ) - test_target_names_contains_all = "all" in self._test_target_names - if test_target_names_contains_all: - test_targets = [ - x for x in (set(test_targets_no_all) | set(self._root_targets)) - ] - else: - test_targets = [x for x in test_targets_no_all] - print("supplied test_targets") - for target_name in self._test_target_names: - print("\t", target_name) - print("found test_targets") - for target in test_targets: - print("\t", target.name) - print("searching for matching test targets") - matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) - matching_test_targets_contains_all = test_target_names_contains_all and set( - matching_test_targets - ) & set(self._root_targets) - if matching_test_targets_contains_all: - # Remove any of the targets for all that were not explicitly supplied, - # 'all' is subsequentely added to the matching names below. - matching_test_targets = [ - x for x in (set(matching_test_targets) & set(test_targets_no_all)) - ] - print("matched test_targets") - for target in matching_test_targets: - print("\t", target.name) - matching_target_names = [ - gyp.common.ParseQualifiedTarget(target.name)[1] - for target in matching_test_targets - ] - if matching_test_targets_contains_all: - matching_target_names.append("all") - print("\tall") - return matching_target_names - - def find_matching_compile_target_names(self): - """Returns the set of output compile targets.""" - assert self.is_build_impacted() - # Compile targets are found by searching up from changed targets. - # Reset the visited status for _GetBuildTargets. - for target in self._name_to_target.values(): - target.visited = False - - supplied_targets = _LookupTargets( - self._supplied_target_names_no_all(), self._unqualified_mapping - ) - if "all" in self._supplied_target_names(): - supplied_targets = [ - x for x in (set(supplied_targets) | set(self._root_targets)) - ] - print("Supplied test_targets & compile_targets") - for target in supplied_targets: - print("\t", target.name) - print("Finding compile targets") - compile_targets = _GetCompileTargets(self._changed_targets, supplied_targets) - return [ - gyp.common.ParseQualifiedTarget(target.name)[1] - for target in compile_targets - ] - - -def GenerateOutput(target_list, target_dicts, data, params): - """Called by gyp as the final stage. Outputs results.""" - config = Config() - try: - config.Init(params) - - if not config.files: - raise Exception( - "Must specify files to analyze via config_path generator " "flag" - ) - - toplevel_dir = _ToGypPath(os.path.abspath(params["options"].toplevel_dir)) - if debug: - print("toplevel_dir", toplevel_dir) - - if _WasGypIncludeFileModified(params, config.files): - result_dict = { - "status": all_changed_string, - "test_targets": list(config.test_target_names), - "compile_targets": list( - config.additional_compile_target_names | config.test_target_names - ), - } - _WriteOutput(params, **result_dict) - return - - calculator = TargetCalculator( - config.files, - config.additional_compile_target_names, - config.test_target_names, - data, - target_list, - target_dicts, - toplevel_dir, - params["build_files"], - ) - if not calculator.is_build_impacted(): - result_dict = { - "status": no_dependency_string, - "test_targets": [], - "compile_targets": [], - } - if calculator.invalid_targets: - result_dict["invalid_targets"] = calculator.invalid_targets - _WriteOutput(params, **result_dict) - return - - test_target_names = calculator.find_matching_test_target_names() - compile_target_names = calculator.find_matching_compile_target_names() - found_at_least_one_target = compile_target_names or test_target_names - result_dict = { - "test_targets": test_target_names, - "status": found_dependency_string - if found_at_least_one_target - else no_dependency_string, - "compile_targets": list(set(compile_target_names) | set(test_target_names)), - } - if calculator.invalid_targets: - result_dict["invalid_targets"] = calculator.invalid_targets - _WriteOutput(params, **result_dict) - - except Exception as e: - _WriteOutput(params, error=str(e)) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py deleted file mode 100644 index cdf1a4832..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +++ /dev/null @@ -1,1173 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Notes: -# -# This generates makefiles suitable for inclusion into the Android build system -# via an Android.mk file. It is based on make.py, the standard makefile -# generator. -# -# The code below generates a separate .mk file for each target, but -# all are sourced by the top-level GypAndroid.mk. This means that all -# variables in .mk-files clobber one another, and furthermore that any -# variables set potentially clash with other Android build system variables. -# Try to avoid setting global variables where possible. - - -import gyp -import gyp.common -import gyp.generator.make as make # Reuse global functions from make backend. -import os -import re -import subprocess - -generator_default_variables = { - "OS": "android", - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_SUFFIX": ".so", - "INTERMEDIATE_DIR": "$(gyp_intermediate_dir)", - "SHARED_INTERMEDIATE_DIR": "$(gyp_shared_intermediate_dir)", - "PRODUCT_DIR": "$(gyp_shared_intermediate_dir)", - "SHARED_LIB_DIR": "$(builddir)/lib.$(TOOLSET)", - "LIB_DIR": "$(obj).$(TOOLSET)", - "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. - "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. - "RULE_INPUT_PATH": "$(RULE_SOURCES)", - "RULE_INPUT_EXT": "$(suffix $<)", - "RULE_INPUT_NAME": "$(notdir $<)", - "CONFIGURATION_NAME": "$(GYP_CONFIGURATION)", -} - -# Make supports multiple toolsets -generator_supports_multiple_toolsets = True - - -# Generator-specific gyp specs. -generator_additional_non_configuration_keys = [ - # Boolean to declare that this target does not want its name mangled. - "android_unmangled_name", - # Map of android build system variables to set. - "aosp_build_settings", -] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] - - -ALL_MODULES_FOOTER = """\ -# "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from -# all the included sub-makefiles. This is just here to clarify. -gyp_all_modules: -""" - -header = """\ -# This file is generated by gyp; do not edit. - -""" - -# Map gyp target types to Android module classes. -MODULE_CLASSES = { - "static_library": "STATIC_LIBRARIES", - "shared_library": "SHARED_LIBRARIES", - "executable": "EXECUTABLES", -} - - -def IsCPPExtension(ext): - return make.COMPILABLE_EXTENSIONS.get(ext) == "cxx" - - -def Sourceify(path): - """Convert a path to its source directory form. The Android backend does not - support options.generator_output, so this function is a noop.""" - return path - - -# Map from qualified target to path to output. -# For Android, the target of these maps is a tuple ('static', 'modulename'), -# ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string, -# since we link by module. -target_outputs = {} -# Map from qualified target to any linkable output. A subset -# of target_outputs. E.g. when mybinary depends on liba, we want to -# include liba in the linker line; when otherbinary depends on -# mybinary, we just want to build mybinary first. -target_link_deps = {} - - -class AndroidMkWriter: - """AndroidMkWriter packages up the writing of one target-specific Android.mk. - - Its only real entry point is Write(), and is mostly used for namespacing. - """ - - def __init__(self, android_top_dir): - self.android_top_dir = android_top_dir - - def Write( - self, - qualified_target, - relative_target, - base_path, - output_filename, - spec, - configs, - part_of_all, - write_alias_target, - sdk_version, - ): - """The main entry point: writes a .mk file for a single target. - - Arguments: - qualified_target: target we're generating - relative_target: qualified target name relative to the root - base_path: path relative to source root we're building in, used to resolve - target-relative paths - output_filename: output .mk file name to write - spec, configs: gyp info - part_of_all: flag indicating this target is part of 'all' - write_alias_target: flag indicating whether to create short aliases for - this target - sdk_version: what to emit for LOCAL_SDK_VERSION in output - """ - gyp.common.EnsureDirExists(output_filename) - - self.fp = open(output_filename, "w") - - self.fp.write(header) - - self.qualified_target = qualified_target - self.relative_target = relative_target - self.path = base_path - self.target = spec["target_name"] - self.type = spec["type"] - self.toolset = spec["toolset"] - - deps, link_deps = self.ComputeDeps(spec) - - # Some of the generation below can add extra output, sources, or - # link dependencies. All of the out params of the functions that - # follow use names like extra_foo. - extra_outputs = [] - extra_sources = [] - - self.android_class = MODULE_CLASSES.get(self.type, "GYP") - self.android_module = self.ComputeAndroidModule(spec) - (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) - self.output = self.output_binary = self.ComputeOutput(spec) - - # Standard header. - self.WriteLn("include $(CLEAR_VARS)\n") - - # Module class and name. - self.WriteLn("LOCAL_MODULE_CLASS := " + self.android_class) - self.WriteLn("LOCAL_MODULE := " + self.android_module) - # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE. - # The library module classes fail if the stem is set. ComputeOutputParts - # makes sure that stem == modulename in these cases. - if self.android_stem != self.android_module: - self.WriteLn("LOCAL_MODULE_STEM := " + self.android_stem) - self.WriteLn("LOCAL_MODULE_SUFFIX := " + self.android_suffix) - if self.toolset == "host": - self.WriteLn("LOCAL_IS_HOST_MODULE := true") - self.WriteLn("LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)") - elif sdk_version > 0: - self.WriteLn( - "LOCAL_MODULE_TARGET_ARCH := " "$(TARGET_$(GYP_VAR_PREFIX)ARCH)" - ) - self.WriteLn("LOCAL_SDK_VERSION := %s" % sdk_version) - - # Grab output directories; needed for Actions and Rules. - if self.toolset == "host": - self.WriteLn( - "gyp_intermediate_dir := " - "$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))" - ) - else: - self.WriteLn( - "gyp_intermediate_dir := " - "$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))" - ) - self.WriteLn( - "gyp_shared_intermediate_dir := " - "$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))" - ) - self.WriteLn() - - # List files this target depends on so that actions/rules/copies/sources - # can depend on the list. - # TODO: doesn't pull in things through transitive link deps; needed? - target_dependencies = [x[1] for x in deps if x[0] == "path"] - self.WriteLn("# Make sure our deps are built first.") - self.WriteList( - target_dependencies, "GYP_TARGET_DEPENDENCIES", local_pathify=True - ) - - # Actions must come first, since they can generate more OBJs for use below. - if "actions" in spec: - self.WriteActions(spec["actions"], extra_sources, extra_outputs) - - # Rules must be early like actions. - if "rules" in spec: - self.WriteRules(spec["rules"], extra_sources, extra_outputs) - - if "copies" in spec: - self.WriteCopies(spec["copies"], extra_outputs) - - # GYP generated outputs. - self.WriteList(extra_outputs, "GYP_GENERATED_OUTPUTS", local_pathify=True) - - # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend - # on both our dependency targets and our generated files. - self.WriteLn("# Make sure our deps and generated files are built first.") - self.WriteLn( - "LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) " - "$(GYP_GENERATED_OUTPUTS)" - ) - self.WriteLn() - - # Sources. - if spec.get("sources", []) or extra_sources: - self.WriteSources(spec, configs, extra_sources) - - self.WriteTarget( - spec, configs, deps, link_deps, part_of_all, write_alias_target - ) - - # Update global list of target outputs, used in dependency tracking. - target_outputs[qualified_target] = ("path", self.output_binary) - - # Update global list of link dependencies. - if self.type == "static_library": - target_link_deps[qualified_target] = ("static", self.android_module) - elif self.type == "shared_library": - target_link_deps[qualified_target] = ("shared", self.android_module) - - self.fp.close() - return self.android_module - - def WriteActions(self, actions, extra_sources, extra_outputs): - """Write Makefile code for any 'actions' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - actions (used to make other pieces dependent on these - actions) - """ - for action in actions: - name = make.StringToMakefileVariable( - "{}_{}".format(self.relative_target, action["action_name"]) - ) - self.WriteLn('### Rules for action "%s":' % action["action_name"]) - inputs = action["inputs"] - outputs = action["outputs"] - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set() - for out in outputs: - if not out.startswith("$"): - print( - 'WARNING: Action for target "%s" writes output to local path ' - '"%s".' % (self.target, out) - ) - dir = os.path.split(out)[0] - if dir: - dirs.add(dir) - if int(action.get("process_outputs_as_sources", False)): - extra_sources += outputs - - # Prepare the actual command. - command = gyp.common.EncodePOSIXShellList(action["action"]) - if "message" in action: - quiet_cmd = "Gyp action: %s ($@)" % action["message"] - else: - quiet_cmd = "Gyp action: %s ($@)" % name - if len(dirs) > 0: - command = "mkdir -p %s" % " ".join(dirs) + "; " + command - - cd_action = "cd $(gyp_local_path)/%s; " % self.path - command = cd_action + command - - # The makefile rules are all relative to the top dir, but the gyp actions - # are defined relative to their containing dir. This replaces the gyp_* - # variables for the action rule with an absolute version so that the - # output goes in the right place. - # Only write the gyp_* rules for the "primary" output (:1); - # it's superfluous for the "extra outputs", and this avoids accidentally - # writing duplicate dummy rules for those outputs. - main_output = make.QuoteSpaces(self.LocalPathify(outputs[0])) - self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) - self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) - self.WriteLn( - "%s: gyp_intermediate_dir := " - "$(abspath $(gyp_intermediate_dir))" % main_output - ) - self.WriteLn( - "%s: gyp_shared_intermediate_dir := " - "$(abspath $(gyp_shared_intermediate_dir))" % main_output - ) - - # Android's envsetup.sh adds a number of directories to the path including - # the built host binary directory. This causes actions/rules invoked by - # gyp to sometimes use these instead of system versions, e.g. bison. - # The built host binaries may not be suitable, and can cause errors. - # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable - # set by envsetup. - self.WriteLn( - "%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))" - % main_output - ) - - # Don't allow spaces in input/output filenames, but make an exception for - # filenames which start with '$(' since it's okay for there to be spaces - # inside of make function/macro invocations. - for input in inputs: - if not input.startswith("$(") and " " in input: - raise gyp.common.GypError( - 'Action input filename "%s" in target %s contains a space' - % (input, self.target) - ) - for output in outputs: - if not output.startswith("$(") and " " in output: - raise gyp.common.GypError( - 'Action output filename "%s" in target %s contains a space' - % (output, self.target) - ) - - self.WriteLn( - "%s: %s $(GYP_TARGET_DEPENDENCIES)" - % (main_output, " ".join(map(self.LocalPathify, inputs))) - ) - self.WriteLn('\t@echo "%s"' % quiet_cmd) - self.WriteLn("\t$(hide)%s\n" % command) - for output in outputs[1:]: - # Make each output depend on the main output, with an empty command - # to force make to notice that the mtime has changed. - self.WriteLn(f"{self.LocalPathify(output)}: {main_output} ;") - - extra_outputs += outputs - self.WriteLn() - - self.WriteLn() - - def WriteRules(self, rules, extra_sources, extra_outputs): - """Write Makefile code for any 'rules' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - rules (used to make other pieces dependent on these rules) - """ - if len(rules) == 0: - return - - for rule in rules: - if len(rule.get("rule_sources", [])) == 0: - continue - name = make.StringToMakefileVariable( - "{}_{}".format(self.relative_target, rule["rule_name"]) - ) - self.WriteLn('\n### Generated for rule "%s":' % name) - self.WriteLn('# "%s":' % rule) - - inputs = rule.get("inputs") - for rule_source in rule.get("rule_sources", []): - (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = os.path.splitext( - rule_source_basename - ) - - outputs = [ - self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) - for out in rule["outputs"] - ] - - dirs = set() - for out in outputs: - if not out.startswith("$"): - print( - "WARNING: Rule for target %s writes output to local path %s" - % (self.target, out) - ) - dir = os.path.dirname(out) - if dir: - dirs.add(dir) - extra_outputs += outputs - if int(rule.get("process_outputs_as_sources", False)): - extra_sources.extend(outputs) - - components = [] - for component in rule["action"]: - component = self.ExpandInputRoot( - component, rule_source_root, rule_source_dirname - ) - if "$(RULE_SOURCES)" in component: - component = component.replace("$(RULE_SOURCES)", rule_source) - components.append(component) - - command = gyp.common.EncodePOSIXShellList(components) - cd_action = "cd $(gyp_local_path)/%s; " % self.path - command = cd_action + command - if dirs: - command = "mkdir -p %s" % " ".join(dirs) + "; " + command - - # We set up a rule to build the first output, and then set up - # a rule for each additional output to depend on the first. - outputs = map(self.LocalPathify, outputs) - main_output = outputs[0] - self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) - self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) - self.WriteLn( - "%s: gyp_intermediate_dir := " - "$(abspath $(gyp_intermediate_dir))" % main_output - ) - self.WriteLn( - "%s: gyp_shared_intermediate_dir := " - "$(abspath $(gyp_shared_intermediate_dir))" % main_output - ) - - # See explanation in WriteActions. - self.WriteLn( - "%s: export PATH := " - "$(subst $(ANDROID_BUILD_PATHS),,$(PATH))" % main_output - ) - - main_output_deps = self.LocalPathify(rule_source) - if inputs: - main_output_deps += " " - main_output_deps += " ".join([self.LocalPathify(f) for f in inputs]) - - self.WriteLn( - "%s: %s $(GYP_TARGET_DEPENDENCIES)" - % (main_output, main_output_deps) - ) - self.WriteLn("\t%s\n" % command) - for output in outputs[1:]: - # Make each output depend on the main output, with an empty command - # to force make to notice that the mtime has changed. - self.WriteLn(f"{output}: {main_output} ;") - self.WriteLn() - - self.WriteLn() - - def WriteCopies(self, copies, extra_outputs): - """Write Makefile code for any 'copies' from the gyp input. - - extra_outputs: a list that will be filled in with any outputs of this action - (used to make other pieces dependent on this action) - """ - self.WriteLn("### Generated for copy rule.") - - variable = make.StringToMakefileVariable(self.relative_target + "_copies") - outputs = [] - for copy in copies: - for path in copy["files"]: - # The Android build system does not allow generation of files into the - # source tree. The destination should start with a variable, which will - # typically be $(gyp_intermediate_dir) or - # $(gyp_shared_intermediate_dir). Note that we can't use an assertion - # because some of the gyp tests depend on this. - if not copy["destination"].startswith("$"): - print( - "WARNING: Copy rule for target %s writes output to " - "local path %s" % (self.target, copy["destination"]) - ) - - # LocalPathify() calls normpath, stripping trailing slashes. - path = Sourceify(self.LocalPathify(path)) - filename = os.path.split(path)[1] - output = Sourceify( - self.LocalPathify(os.path.join(copy["destination"], filename)) - ) - - self.WriteLn(f"{output}: {path} $(GYP_TARGET_DEPENDENCIES) | $(ACP)") - self.WriteLn("\t@echo Copying: $@") - self.WriteLn("\t$(hide) mkdir -p $(dir $@)") - self.WriteLn("\t$(hide) $(ACP) -rpf $< $@") - self.WriteLn() - outputs.append(output) - self.WriteLn( - "{} = {}".format(variable, " ".join(map(make.QuoteSpaces, outputs))) - ) - extra_outputs.append("$(%s)" % variable) - self.WriteLn() - - def WriteSourceFlags(self, spec, configs): - """Write out the flags and include paths used to compile source files for - the current target. - - Args: - spec, configs: input from gyp. - """ - for configname, config in sorted(configs.items()): - extracted_includes = [] - - self.WriteLn("\n# Flags passed to both C and C++ files.") - cflags, includes_from_cflags = self.ExtractIncludesFromCFlags( - config.get("cflags", []) + config.get("cflags_c", []) - ) - extracted_includes.extend(includes_from_cflags) - self.WriteList(cflags, "MY_CFLAGS_%s" % configname) - - self.WriteList( - config.get("defines"), - "MY_DEFS_%s" % configname, - prefix="-D", - quoter=make.EscapeCppDefine, - ) - - self.WriteLn("\n# Include paths placed before CFLAGS/CPPFLAGS") - includes = list(config.get("include_dirs", [])) - includes.extend(extracted_includes) - includes = map(Sourceify, map(self.LocalPathify, includes)) - includes = self.NormalizeIncludePaths(includes) - self.WriteList(includes, "LOCAL_C_INCLUDES_%s" % configname) - - self.WriteLn("\n# Flags passed to only C++ (and not C) files.") - self.WriteList(config.get("cflags_cc"), "LOCAL_CPPFLAGS_%s" % configname) - - self.WriteLn( - "\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) " - "$(MY_DEFS_$(GYP_CONFIGURATION))" - ) - # Undefine ANDROID for host modules - # TODO: the source code should not use macro ANDROID to tell if it's host - # or target module. - if self.toolset == "host": - self.WriteLn("# Undefine ANDROID for host modules") - self.WriteLn("LOCAL_CFLAGS += -UANDROID") - self.WriteLn( - "LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) " - "$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))" - ) - self.WriteLn("LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))") - # Android uses separate flags for assembly file invocations, but gyp expects - # the same CFLAGS to be applied: - self.WriteLn("LOCAL_ASFLAGS := $(LOCAL_CFLAGS)") - - def WriteSources(self, spec, configs, extra_sources): - """Write Makefile code for any 'sources' from the gyp input. - These are source files necessary to build the current target. - We need to handle shared_intermediate directory source files as - a special case by copying them to the intermediate directory and - treating them as a generated sources. Otherwise the Android build - rules won't pick them up. - - Args: - spec, configs: input from gyp. - extra_sources: Sources generated from Actions or Rules. - """ - sources = filter(make.Compilable, spec.get("sources", [])) - generated_not_sources = [x for x in extra_sources if not make.Compilable(x)] - extra_sources = filter(make.Compilable, extra_sources) - - # Determine and output the C++ extension used by these sources. - # We simply find the first C++ file and use that extension. - all_sources = sources + extra_sources - local_cpp_extension = ".cpp" - for source in all_sources: - (root, ext) = os.path.splitext(source) - if IsCPPExtension(ext): - local_cpp_extension = ext - break - if local_cpp_extension != ".cpp": - self.WriteLn("LOCAL_CPP_EXTENSION := %s" % local_cpp_extension) - - # We need to move any non-generated sources that are coming from the - # shared intermediate directory out of LOCAL_SRC_FILES and put them - # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files - # that don't match our local_cpp_extension, since Android will only - # generate Makefile rules for a single LOCAL_CPP_EXTENSION. - local_files = [] - for source in sources: - (root, ext) = os.path.splitext(source) - if "$(gyp_shared_intermediate_dir)" in source: - extra_sources.append(source) - elif "$(gyp_intermediate_dir)" in source: - extra_sources.append(source) - elif IsCPPExtension(ext) and ext != local_cpp_extension: - extra_sources.append(source) - else: - local_files.append(os.path.normpath(os.path.join(self.path, source))) - - # For any generated source, if it is coming from the shared intermediate - # directory then we add a Make rule to copy them to the local intermediate - # directory first. This is because the Android LOCAL_GENERATED_SOURCES - # must be in the local module intermediate directory for the compile rules - # to work properly. If the file has the wrong C++ extension, then we add - # a rule to copy that to intermediates and use the new version. - final_generated_sources = [] - # If a source file gets copied, we still need to add the original source - # directory as header search path, for GCC searches headers in the - # directory that contains the source file by default. - origin_src_dirs = [] - for source in extra_sources: - local_file = source - if "$(gyp_intermediate_dir)/" not in local_file: - basename = os.path.basename(local_file) - local_file = "$(gyp_intermediate_dir)/" + basename - (root, ext) = os.path.splitext(local_file) - if IsCPPExtension(ext) and ext != local_cpp_extension: - local_file = root + local_cpp_extension - if local_file != source: - self.WriteLn(f"{local_file}: {self.LocalPathify(source)}") - self.WriteLn("\tmkdir -p $(@D); cp $< $@") - origin_src_dirs.append(os.path.dirname(source)) - final_generated_sources.append(local_file) - - # We add back in all of the non-compilable stuff to make sure that the - # make rules have dependencies on them. - final_generated_sources.extend(generated_not_sources) - self.WriteList(final_generated_sources, "LOCAL_GENERATED_SOURCES") - - origin_src_dirs = gyp.common.uniquer(origin_src_dirs) - origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs)) - self.WriteList(origin_src_dirs, "GYP_COPIED_SOURCE_ORIGIN_DIRS") - - self.WriteList(local_files, "LOCAL_SRC_FILES") - - # Write out the flags used to compile the source; this must be done last - # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path. - self.WriteSourceFlags(spec, configs) - - def ComputeAndroidModule(self, spec): - """Return the Android module name used for a gyp spec. - - We use the complete qualified target name to avoid collisions between - duplicate targets in different directories. We also add a suffix to - distinguish gyp-generated module names. - """ - - if int(spec.get("android_unmangled_name", 0)): - assert self.type != "shared_library" or self.target.startswith("lib") - return self.target - - if self.type == "shared_library": - # For reasons of convention, the Android build system requires that all - # shared library modules are named 'libfoo' when generating -l flags. - prefix = "lib_" - else: - prefix = "" - - if spec["toolset"] == "host": - suffix = "_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp" - else: - suffix = "_gyp" - - if self.path: - middle = make.StringToMakefileVariable(f"{self.path}_{self.target}") - else: - middle = make.StringToMakefileVariable(self.target) - - return "".join([prefix, middle, suffix]) - - def ComputeOutputParts(self, spec): - """Return the 'output basename' of a gyp spec, split into filename + ext. - - Android libraries must be named the same thing as their module name, - otherwise the linker can't find them, so product_name and so on must be - ignored if we are building a library, and the "lib" prepending is - not done for Android. - """ - assert self.type != "loadable_module" # TODO: not supported? - - target = spec["target_name"] - target_prefix = "" - target_ext = "" - if self.type == "static_library": - target = self.ComputeAndroidModule(spec) - target_ext = ".a" - elif self.type == "shared_library": - target = self.ComputeAndroidModule(spec) - target_ext = ".so" - elif self.type == "none": - target_ext = ".stamp" - elif self.type != "executable": - print( - "ERROR: What output file should be generated?", - "type", - self.type, - "target", - target, - ) - - if self.type != "static_library" and self.type != "shared_library": - target_prefix = spec.get("product_prefix", target_prefix) - target = spec.get("product_name", target) - product_ext = spec.get("product_extension") - if product_ext: - target_ext = "." + product_ext - - target_stem = target_prefix + target - return (target_stem, target_ext) - - def ComputeOutputBasename(self, spec): - """Return the 'output basename' of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - 'libfoobar.so' - """ - return "".join(self.ComputeOutputParts(spec)) - - def ComputeOutput(self, spec): - """Return the 'output' (full output path) of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - '$(obj)/baz/libfoobar.so' - """ - if self.type == "executable": - # We install host executables into shared_intermediate_dir so they can be - # run by gyp rules that refer to PRODUCT_DIR. - path = "$(gyp_shared_intermediate_dir)" - elif self.type == "shared_library": - if self.toolset == "host": - path = "$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)" - else: - path = "$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)" - else: - # Other targets just get built into their intermediate dir. - if self.toolset == "host": - path = ( - "$(call intermediates-dir-for,%s,%s,true,," - "$(GYP_HOST_VAR_PREFIX))" - % (self.android_class, self.android_module) - ) - else: - path = "$(call intermediates-dir-for,{},{},,,$(GYP_VAR_PREFIX))".format( - self.android_class, - self.android_module, - ) - - assert spec.get("product_dir") is None # TODO: not supported? - return os.path.join(path, self.ComputeOutputBasename(spec)) - - def NormalizeIncludePaths(self, include_paths): - """Normalize include_paths. - Convert absolute paths to relative to the Android top directory. - - Args: - include_paths: A list of unprocessed include paths. - Returns: - A list of normalized include paths. - """ - normalized = [] - for path in include_paths: - if path[0] == "/": - path = gyp.common.RelativePath(path, self.android_top_dir) - normalized.append(path) - return normalized - - def ExtractIncludesFromCFlags(self, cflags): - """Extract includes "-I..." out from cflags - - Args: - cflags: A list of compiler flags, which may be mixed with "-I.." - Returns: - A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. - """ - clean_cflags = [] - include_paths = [] - for flag in cflags: - if flag.startswith("-I"): - include_paths.append(flag[2:]) - else: - clean_cflags.append(flag) - - return (clean_cflags, include_paths) - - def FilterLibraries(self, libraries): - """Filter the 'libraries' key to separate things that shouldn't be ldflags. - - Library entries that look like filenames should be converted to android - module names instead of being passed to the linker as flags. - - Args: - libraries: the value of spec.get('libraries') - Returns: - A tuple (static_lib_modules, dynamic_lib_modules, ldflags) - """ - static_lib_modules = [] - dynamic_lib_modules = [] - ldflags = [] - for libs in libraries: - # Libs can have multiple words. - for lib in libs.split(): - # Filter the system libraries, which are added by default by the Android - # build system. - if ( - lib == "-lc" - or lib == "-lstdc++" - or lib == "-lm" - or lib.endswith("libgcc.a") - ): - continue - match = re.search(r"([^/]+)\.a$", lib) - if match: - static_lib_modules.append(match.group(1)) - continue - match = re.search(r"([^/]+)\.so$", lib) - if match: - dynamic_lib_modules.append(match.group(1)) - continue - if lib.startswith("-l"): - ldflags.append(lib) - return (static_lib_modules, dynamic_lib_modules, ldflags) - - def ComputeDeps(self, spec): - """Compute the dependencies of a gyp spec. - - Returns a tuple (deps, link_deps), where each is a list of - filenames that will need to be put in front of make for either - building (deps) or linking (link_deps). - """ - deps = [] - link_deps = [] - if "dependencies" in spec: - deps.extend( - [ - target_outputs[dep] - for dep in spec["dependencies"] - if target_outputs[dep] - ] - ) - for dep in spec["dependencies"]: - if dep in target_link_deps: - link_deps.append(target_link_deps[dep]) - deps.extend(link_deps) - return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) - - def WriteTargetFlags(self, spec, configs, link_deps): - """Write Makefile code to specify the link flags and library dependencies. - - spec, configs: input from gyp. - link_deps: link dependency list; see ComputeDeps() - """ - # Libraries (i.e. -lfoo) - # These must be included even for static libraries as some of them provide - # implicit include paths through the build system. - libraries = gyp.common.uniquer(spec.get("libraries", [])) - static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries) - - if self.type != "static_library": - for configname, config in sorted(configs.items()): - ldflags = list(config.get("ldflags", [])) - self.WriteLn("") - self.WriteList(ldflags, "LOCAL_LDFLAGS_%s" % configname) - self.WriteList(ldflags_libs, "LOCAL_GYP_LIBS") - self.WriteLn( - "LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) " - "$(LOCAL_GYP_LIBS)" - ) - - # Link dependencies (i.e. other gyp targets this target depends on) - # These need not be included for static libraries as within the gyp build - # we do not use the implicit include path mechanism. - if self.type != "static_library": - static_link_deps = [x[1] for x in link_deps if x[0] == "static"] - shared_link_deps = [x[1] for x in link_deps if x[0] == "shared"] - else: - static_link_deps = [] - shared_link_deps = [] - - # Only write the lists if they are non-empty. - if static_libs or static_link_deps: - self.WriteLn("") - self.WriteList(static_libs + static_link_deps, "LOCAL_STATIC_LIBRARIES") - self.WriteLn("# Enable grouping to fix circular references") - self.WriteLn("LOCAL_GROUP_STATIC_LIBRARIES := true") - if dynamic_libs or shared_link_deps: - self.WriteLn("") - self.WriteList(dynamic_libs + shared_link_deps, "LOCAL_SHARED_LIBRARIES") - - def WriteTarget( - self, spec, configs, deps, link_deps, part_of_all, write_alias_target - ): - """Write Makefile code to produce the final target of the gyp spec. - - spec, configs: input from gyp. - deps, link_deps: dependency lists; see ComputeDeps() - part_of_all: flag indicating this target is part of 'all' - write_alias_target: flag indicating whether to create short aliases for this - target - """ - self.WriteLn("### Rules for final target.") - - if self.type != "none": - self.WriteTargetFlags(spec, configs, link_deps) - - settings = spec.get("aosp_build_settings", {}) - if settings: - self.WriteLn("### Set directly by aosp_build_settings.") - for k, v in settings.items(): - if isinstance(v, list): - self.WriteList(v, k) - else: - self.WriteLn(f"{k} := {make.QuoteIfNecessary(v)}") - self.WriteLn("") - - # Add to the set of targets which represent the gyp 'all' target. We use the - # name 'gyp_all_modules' as the Android build system doesn't allow the use - # of the Make target 'all' and because 'all_modules' is the equivalent of - # the Make target 'all' on Android. - if part_of_all and write_alias_target: - self.WriteLn('# Add target alias to "gyp_all_modules" target.') - self.WriteLn(".PHONY: gyp_all_modules") - self.WriteLn("gyp_all_modules: %s" % self.android_module) - self.WriteLn("") - - # Add an alias from the gyp target name to the Android module name. This - # simplifies manual builds of the target, and is required by the test - # framework. - if self.target != self.android_module and write_alias_target: - self.WriteLn("# Alias gyp target name.") - self.WriteLn(".PHONY: %s" % self.target) - self.WriteLn(f"{self.target}: {self.android_module}") - self.WriteLn("") - - # Add the command to trigger build of the target type depending - # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY - # NOTE: This has to come last! - modifier = "" - if self.toolset == "host": - modifier = "HOST_" - if self.type == "static_library": - self.WriteLn("include $(BUILD_%sSTATIC_LIBRARY)" % modifier) - elif self.type == "shared_library": - self.WriteLn("LOCAL_PRELINK_MODULE := false") - self.WriteLn("include $(BUILD_%sSHARED_LIBRARY)" % modifier) - elif self.type == "executable": - self.WriteLn("LOCAL_CXX_STL := libc++_static") - # Executables are for build and test purposes only, so they're installed - # to a directory that doesn't get included in the system image. - self.WriteLn("LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)") - self.WriteLn("include $(BUILD_%sEXECUTABLE)" % modifier) - else: - self.WriteLn("LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp") - self.WriteLn("LOCAL_UNINSTALLABLE_MODULE := true") - if self.toolset == "target": - self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)") - else: - self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)") - self.WriteLn() - self.WriteLn("include $(BUILD_SYSTEM)/base_rules.mk") - self.WriteLn() - self.WriteLn("$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)") - self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"') - self.WriteLn("\t$(hide) mkdir -p $(dir $@)") - self.WriteLn("\t$(hide) touch $@") - self.WriteLn() - self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX :=") - - def WriteList( - self, - value_list, - variable=None, - prefix="", - quoter=make.QuoteIfNecessary, - local_pathify=False, - ): - """Write a variable definition that is a list of values. - - E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out - foo = blaha blahb - but in a pretty-printed style. - """ - values = "" - if value_list: - value_list = [quoter(prefix + value) for value in value_list] - if local_pathify: - value_list = [self.LocalPathify(value) for value in value_list] - values = " \\\n\t" + " \\\n\t".join(value_list) - self.fp.write(f"{variable} :={values}\n\n") - - def WriteLn(self, text=""): - self.fp.write(text + "\n") - - def LocalPathify(self, path): - """Convert a subdirectory-relative path into a normalized path which starts - with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). - Absolute paths, or paths that contain variables, are just normalized.""" - if "$(" in path or os.path.isabs(path): - # path is not a file in the project tree in this case, but calling - # normpath is still important for trimming trailing slashes. - return os.path.normpath(path) - local_path = os.path.join("$(LOCAL_PATH)", self.path, path) - local_path = os.path.normpath(local_path) - # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) - # - i.e. that the resulting path is still inside the project tree. The - # path may legitimately have ended up containing just $(LOCAL_PATH), though, - # so we don't look for a slash. - assert local_path.startswith( - "$(LOCAL_PATH)" - ), f"Path {path} attempts to escape from gyp path {self.path} !)" - return local_path - - def ExpandInputRoot(self, template, expansion, dirname): - if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: - return template - path = template % { - "INPUT_ROOT": expansion, - "INPUT_DIRNAME": dirname, - } - return os.path.normpath(path) - - -def PerformBuild(data, configurations, params): - # The android backend only supports the default configuration. - options = params["options"] - makefile = os.path.abspath(os.path.join(options.toplevel_dir, "GypAndroid.mk")) - env = dict(os.environ) - env["ONE_SHOT_MAKEFILE"] = makefile - arguments = ["make", "-C", os.environ["ANDROID_BUILD_TOP"], "gyp_all_modules"] - print("Building: %s" % arguments) - subprocess.check_call(arguments, env=env) - - -def GenerateOutput(target_list, target_dicts, data, params): - options = params["options"] - generator_flags = params.get("generator_flags", {}) - limit_to_target_all = generator_flags.get("limit_to_target_all", False) - write_alias_targets = generator_flags.get("write_alias_targets", True) - sdk_version = generator_flags.get("aosp_sdk_version", 0) - android_top_dir = os.environ.get("ANDROID_BUILD_TOP") - assert android_top_dir, "$ANDROID_BUILD_TOP not set; you need to run lunch." - - def CalculateMakefilePath(build_file, base_name): - """Determine where to write a Makefile for a given gyp file.""" - # Paths in gyp files are relative to the .gyp file, but we want - # paths relative to the source root for the master makefile. Grab - # the path of the .gyp file as the base to relativize against. - # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". - base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) - # We write the file in the base_path directory. - output_file = os.path.join(options.depth, base_path, base_name) - assert ( - not options.generator_output - ), "The Android backend does not support options.generator_output." - base_path = gyp.common.RelativePath( - os.path.dirname(build_file), options.toplevel_dir - ) - return base_path, output_file - - # TODO: search for the first non-'Default' target. This can go - # away when we add verification that all targets have the - # necessary configurations. - default_configuration = None - for target in target_list: - spec = target_dicts[target] - if spec["default_configuration"] != "Default": - default_configuration = spec["default_configuration"] - break - if not default_configuration: - default_configuration = "Default" - - makefile_name = "GypAndroid" + options.suffix + ".mk" - makefile_path = os.path.join(options.toplevel_dir, makefile_name) - assert ( - not options.generator_output - ), "The Android backend does not support options.generator_output." - gyp.common.EnsureDirExists(makefile_path) - root_makefile = open(makefile_path, "w") - - root_makefile.write(header) - - # We set LOCAL_PATH just once, here, to the top of the project tree. This - # allows all the other paths we use to be relative to the Android.mk file, - # as the Android build system expects. - root_makefile.write("\nLOCAL_PATH := $(call my-dir)\n") - - # Find the list of targets that derive from the gyp file(s) being built. - needed_targets = set() - for build_file in params["build_files"]: - for target in gyp.common.AllTargets(target_list, target_dicts, build_file): - needed_targets.add(target) - - build_files = set() - include_list = set() - android_modules = {} - for qualified_target in target_list: - build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) - relative_build_file = gyp.common.RelativePath(build_file, options.toplevel_dir) - build_files.add(relative_build_file) - included_files = data[build_file]["included_files"] - for included_file in included_files: - # The included_files entries are relative to the dir of the build file - # that included them, so we have to undo that and then make them relative - # to the root dir. - relative_include_file = gyp.common.RelativePath( - gyp.common.UnrelativePath(included_file, build_file), - options.toplevel_dir, - ) - abs_include_file = os.path.abspath(relative_include_file) - # If the include file is from the ~/.gyp dir, we should use absolute path - # so that relocating the src dir doesn't break the path. - if params["home_dot_gyp"] and abs_include_file.startswith( - params["home_dot_gyp"] - ): - build_files.add(abs_include_file) - else: - build_files.add(relative_include_file) - - base_path, output_file = CalculateMakefilePath( - build_file, target + "." + toolset + options.suffix + ".mk" - ) - - spec = target_dicts[qualified_target] - configs = spec["configurations"] - - part_of_all = qualified_target in needed_targets - if limit_to_target_all and not part_of_all: - continue - - relative_target = gyp.common.QualifiedTarget( - relative_build_file, target, toolset - ) - writer = AndroidMkWriter(android_top_dir) - android_module = writer.Write( - qualified_target, - relative_target, - base_path, - output_file, - spec, - configs, - part_of_all=part_of_all, - write_alias_target=write_alias_targets, - sdk_version=sdk_version, - ) - if android_module in android_modules: - print( - "ERROR: Android module names must be unique. The following " - "targets both generate Android module name %s.\n %s\n %s" - % (android_module, android_modules[android_module], qualified_target) - ) - return - android_modules[android_module] = qualified_target - - # Our root_makefile lives at the source root. Compute the relative path - # from there to the output_file for including. - mkfile_rel_path = gyp.common.RelativePath( - output_file, os.path.dirname(makefile_path) - ) - include_list.add(mkfile_rel_path) - - root_makefile.write("GYP_CONFIGURATION ?= %s\n" % default_configuration) - root_makefile.write("GYP_VAR_PREFIX ?=\n") - root_makefile.write("GYP_HOST_VAR_PREFIX ?=\n") - root_makefile.write("GYP_HOST_MULTILIB ?= first\n") - - # Write out the sorted list of includes. - root_makefile.write("\n") - for include_file in sorted(include_list): - root_makefile.write("include $(LOCAL_PATH)/" + include_file + "\n") - root_makefile.write("\n") - - if write_alias_targets: - root_makefile.write(ALL_MODULES_FOOTER) - - root_makefile.close() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py deleted file mode 100644 index c95d18415..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +++ /dev/null @@ -1,1321 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""cmake output module - -This module is under development and should be considered experimental. - -This module produces cmake (2.8.8+) input as its output. One CMakeLists.txt is -created for each configuration. - -This module's original purpose was to support editing in IDEs like KDevelop -which use CMake for project management. It is also possible to use CMake to -generate projects for other IDEs such as eclipse cdt and code::blocks. QtCreator -will convert the CMakeLists.txt to a code::blocks cbp for the editor to read, -but build using CMake. As a result QtCreator editor is unaware of compiler -defines. The generated CMakeLists.txt can also be used to build on Linux. There -is currently no support for building on platforms other than Linux. - -The generated CMakeLists.txt should properly compile all projects. However, -there is a mismatch between gyp and cmake with regard to linking. All attempts -are made to work around this, but CMake sometimes sees -Wl,--start-group as a -library and incorrectly repeats it. As a result the output of this generator -should not be relied on for building. - -When using with kdevelop, use version 4.4+. Previous versions of kdevelop will -not be able to find the header file directories described in the generated -CMakeLists.txt file. -""" - - -import multiprocessing -import os -import signal -import subprocess -import gyp.common -import gyp.xcode_emulation - -_maketrans = str.maketrans - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_PREFIX": "lib", - "SHARED_LIB_SUFFIX": ".so", - "SHARED_LIB_DIR": "${builddir}/lib.${TOOLSET}", - "LIB_DIR": "${obj}.${TOOLSET}", - "INTERMEDIATE_DIR": "${obj}.${TOOLSET}/${TARGET}/geni", - "SHARED_INTERMEDIATE_DIR": "${obj}/gen", - "PRODUCT_DIR": "${builddir}", - "RULE_INPUT_PATH": "${RULE_INPUT_PATH}", - "RULE_INPUT_DIRNAME": "${RULE_INPUT_DIRNAME}", - "RULE_INPUT_NAME": "${RULE_INPUT_NAME}", - "RULE_INPUT_ROOT": "${RULE_INPUT_ROOT}", - "RULE_INPUT_EXT": "${RULE_INPUT_EXT}", - "CONFIGURATION_NAME": "${configuration}", -} - -FULL_PATH_VARS = ("${CMAKE_CURRENT_LIST_DIR}", "${builddir}", "${obj}") - -generator_supports_multiple_toolsets = True -generator_wants_static_library_dependencies_adjusted = True - -COMPILABLE_EXTENSIONS = { - ".c": "cc", - ".cc": "cxx", - ".cpp": "cxx", - ".cxx": "cxx", - ".s": "s", # cc - ".S": "s", # cc -} - - -def RemovePrefix(a, prefix): - """Returns 'a' without 'prefix' if it starts with 'prefix'.""" - return a[len(prefix) :] if a.startswith(prefix) else a - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - - -def Compilable(filename): - """Return true if the file is compilable (should be in OBJS).""" - return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS) - - -def Linkable(filename): - """Return true if the file is linkable (should be on the link line).""" - return filename.endswith(".o") - - -def NormjoinPathForceCMakeSource(base_path, rel_path): - """Resolves rel_path against base_path and returns the result. - - If rel_path is an absolute path it is returned unchanged. - Otherwise it is resolved against base_path and normalized. - If the result is a relative path, it is forced to be relative to the - CMakeLists.txt. - """ - if os.path.isabs(rel_path): - return rel_path - if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): - return rel_path - # TODO: do we need to check base_path for absolute variables as well? - return os.path.join( - "${CMAKE_CURRENT_LIST_DIR}", os.path.normpath(os.path.join(base_path, rel_path)) - ) - - -def NormjoinPath(base_path, rel_path): - """Resolves rel_path against base_path and returns the result. - TODO: what is this really used for? - If rel_path begins with '$' it is returned unchanged. - Otherwise it is resolved against base_path if relative, then normalized. - """ - if rel_path.startswith("$") and not rel_path.startswith("${configuration}"): - return rel_path - return os.path.normpath(os.path.join(base_path, rel_path)) - - -def CMakeStringEscape(a): - """Escapes the string 'a' for use inside a CMake string. - - This means escaping - '\' otherwise it may be seen as modifying the next character - '"' otherwise it will end the string - ';' otherwise the string becomes a list - - The following do not need to be escaped - '#' when the lexer is in string state, this does not start a comment - - The following are yet unknown - '$' generator variables (like ${obj}) must not be escaped, - but text $ should be escaped - what is wanted is to know which $ come from generator variables - """ - return a.replace("\\", "\\\\").replace(";", "\\;").replace('"', '\\"') - - -def SetFileProperty(output, source_name, property_name, values, sep): - """Given a set of source file, sets the given property on them.""" - output.write("set_source_files_properties(") - output.write(source_name) - output.write(" PROPERTIES ") - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetFilesProperty(output, variable, property_name, values, sep): - """Given a set of source files, sets the given property on them.""" - output.write("set_source_files_properties(") - WriteVariable(output, variable) - output.write(" PROPERTIES ") - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetTargetProperty(output, target_name, property_name, values, sep=""): - """Given a target, sets the given property.""" - output.write("set_target_properties(") - output.write(target_name) - output.write(" PROPERTIES ") - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetVariable(output, variable_name, value): - """Sets a CMake variable.""" - output.write("set(") - output.write(variable_name) - output.write(' "') - output.write(CMakeStringEscape(value)) - output.write('")\n') - - -def SetVariableList(output, variable_name, values): - """Sets a CMake variable to a list.""" - if not values: - return SetVariable(output, variable_name, "") - if len(values) == 1: - return SetVariable(output, variable_name, values[0]) - output.write("list(APPEND ") - output.write(variable_name) - output.write('\n "') - output.write('"\n "'.join([CMakeStringEscape(value) for value in values])) - output.write('")\n') - - -def UnsetVariable(output, variable_name): - """Unsets a CMake variable.""" - output.write("unset(") - output.write(variable_name) - output.write(")\n") - - -def WriteVariable(output, variable_name, prepend=None): - if prepend: - output.write(prepend) - output.write("${") - output.write(variable_name) - output.write("}") - - -class CMakeTargetType: - def __init__(self, command, modifier, property_modifier): - self.command = command - self.modifier = modifier - self.property_modifier = property_modifier - - -cmake_target_type_from_gyp_target_type = { - "executable": CMakeTargetType("add_executable", None, "RUNTIME"), - "static_library": CMakeTargetType("add_library", "STATIC", "ARCHIVE"), - "shared_library": CMakeTargetType("add_library", "SHARED", "LIBRARY"), - "loadable_module": CMakeTargetType("add_library", "MODULE", "LIBRARY"), - "none": CMakeTargetType("add_custom_target", "SOURCES", None), -} - - -def StringToCMakeTargetName(a): - """Converts the given string 'a' to a valid CMake target name. - - All invalid characters are replaced by '_'. - Invalid for cmake: ' ', '/', '(', ')', '"' - Invalid for make: ':' - Invalid for unknown reasons but cause failures: '.' - """ - return a.translate(_maketrans(' /():."', "_______")) - - -def WriteActions(target_name, actions, extra_sources, extra_deps, path_to_gyp, output): - """Write CMake for the 'actions' in the target. - - Args: - target_name: the name of the CMake target being generated. - actions: the Gyp 'actions' dict for this target. - extra_sources: [(, )] to append with generated source files. - extra_deps: [] to append with generated targets. - path_to_gyp: relative path from CMakeLists.txt being generated to - the Gyp file in which the target being generated is defined. - """ - for action in actions: - action_name = StringToCMakeTargetName(action["action_name"]) - action_target_name = f"{target_name}__{action_name}" - - inputs = action["inputs"] - inputs_name = action_target_name + "__input" - SetVariableList( - output, - inputs_name, - [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], - ) - - outputs = action["outputs"] - cmake_outputs = [ - NormjoinPathForceCMakeSource(path_to_gyp, out) for out in outputs - ] - outputs_name = action_target_name + "__output" - SetVariableList(output, outputs_name, cmake_outputs) - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = {dir for dir in (os.path.dirname(o) for o in outputs) if dir} - - if int(action.get("process_outputs_as_sources", False)): - extra_sources.extend(zip(cmake_outputs, outputs)) - - # add_custom_command - output.write("add_custom_command(OUTPUT ") - WriteVariable(output, outputs_name) - output.write("\n") - - if len(dirs) > 0: - for directory in dirs: - output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") - output.write(directory) - output.write("\n") - - output.write(" COMMAND ") - output.write(gyp.common.EncodePOSIXShellList(action["action"])) - output.write("\n") - - output.write(" DEPENDS ") - WriteVariable(output, inputs_name) - output.write("\n") - - output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") - output.write(path_to_gyp) - output.write("\n") - - output.write(" COMMENT ") - if "message" in action: - output.write(action["message"]) - else: - output.write(action_target_name) - output.write("\n") - - output.write(" VERBATIM\n") - output.write(")\n") - - # add_custom_target - output.write("add_custom_target(") - output.write(action_target_name) - output.write("\n DEPENDS ") - WriteVariable(output, outputs_name) - output.write("\n SOURCES ") - WriteVariable(output, inputs_name) - output.write("\n)\n") - - extra_deps.append(action_target_name) - - -def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source): - if rel_path.startswith(("${RULE_INPUT_PATH}", "${RULE_INPUT_DIRNAME}")): - if any([rule_source.startswith(var) for var in FULL_PATH_VARS]): - return rel_path - return NormjoinPathForceCMakeSource(base_path, rel_path) - - -def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp, output): - """Write CMake for the 'rules' in the target. - - Args: - target_name: the name of the CMake target being generated. - actions: the Gyp 'actions' dict for this target. - extra_sources: [(, )] to append with generated source files. - extra_deps: [] to append with generated targets. - path_to_gyp: relative path from CMakeLists.txt being generated to - the Gyp file in which the target being generated is defined. - """ - for rule in rules: - rule_name = StringToCMakeTargetName(target_name + "__" + rule["rule_name"]) - - inputs = rule.get("inputs", []) - inputs_name = rule_name + "__input" - SetVariableList( - output, - inputs_name, - [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], - ) - outputs = rule["outputs"] - var_outputs = [] - - for count, rule_source in enumerate(rule.get("rule_sources", [])): - action_name = rule_name + "_" + str(count) - - rule_source_dirname, rule_source_basename = os.path.split(rule_source) - rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename) - - SetVariable(output, "RULE_INPUT_PATH", rule_source) - SetVariable(output, "RULE_INPUT_DIRNAME", rule_source_dirname) - SetVariable(output, "RULE_INPUT_NAME", rule_source_basename) - SetVariable(output, "RULE_INPUT_ROOT", rule_source_root) - SetVariable(output, "RULE_INPUT_EXT", rule_source_ext) - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = {dir for dir in (os.path.dirname(o) for o in outputs) if dir} - - # Create variables for the output, as 'local' variable will be unset. - these_outputs = [] - for output_index, out in enumerate(outputs): - output_name = action_name + "_" + str(output_index) - SetVariable( - output, - output_name, - NormjoinRulePathForceCMakeSource(path_to_gyp, out, rule_source), - ) - if int(rule.get("process_outputs_as_sources", False)): - extra_sources.append(("${" + output_name + "}", out)) - these_outputs.append("${" + output_name + "}") - var_outputs.append("${" + output_name + "}") - - # add_custom_command - output.write("add_custom_command(OUTPUT\n") - for out in these_outputs: - output.write(" ") - output.write(out) - output.write("\n") - - for directory in dirs: - output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") - output.write(directory) - output.write("\n") - - output.write(" COMMAND ") - output.write(gyp.common.EncodePOSIXShellList(rule["action"])) - output.write("\n") - - output.write(" DEPENDS ") - WriteVariable(output, inputs_name) - output.write(" ") - output.write(NormjoinPath(path_to_gyp, rule_source)) - output.write("\n") - - # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. - # The cwd is the current build directory. - output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") - output.write(path_to_gyp) - output.write("\n") - - output.write(" COMMENT ") - if "message" in rule: - output.write(rule["message"]) - else: - output.write(action_name) - output.write("\n") - - output.write(" VERBATIM\n") - output.write(")\n") - - UnsetVariable(output, "RULE_INPUT_PATH") - UnsetVariable(output, "RULE_INPUT_DIRNAME") - UnsetVariable(output, "RULE_INPUT_NAME") - UnsetVariable(output, "RULE_INPUT_ROOT") - UnsetVariable(output, "RULE_INPUT_EXT") - - # add_custom_target - output.write("add_custom_target(") - output.write(rule_name) - output.write(" DEPENDS\n") - for out in var_outputs: - output.write(" ") - output.write(out) - output.write("\n") - output.write("SOURCES ") - WriteVariable(output, inputs_name) - output.write("\n") - for rule_source in rule.get("rule_sources", []): - output.write(" ") - output.write(NormjoinPath(path_to_gyp, rule_source)) - output.write("\n") - output.write(")\n") - - extra_deps.append(rule_name) - - -def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output): - """Write CMake for the 'copies' in the target. - - Args: - target_name: the name of the CMake target being generated. - actions: the Gyp 'actions' dict for this target. - extra_deps: [] to append with generated targets. - path_to_gyp: relative path from CMakeLists.txt being generated to - the Gyp file in which the target being generated is defined. - """ - copy_name = target_name + "__copies" - - # CMake gets upset with custom targets with OUTPUT which specify no output. - have_copies = any(copy["files"] for copy in copies) - if not have_copies: - output.write("add_custom_target(") - output.write(copy_name) - output.write(")\n") - extra_deps.append(copy_name) - return - - class Copy: - def __init__(self, ext, command): - self.cmake_inputs = [] - self.cmake_outputs = [] - self.gyp_inputs = [] - self.gyp_outputs = [] - self.ext = ext - self.inputs_name = None - self.outputs_name = None - self.command = command - - file_copy = Copy("", "copy") - dir_copy = Copy("_dirs", "copy_directory") - - for copy in copies: - files = copy["files"] - destination = copy["destination"] - for src in files: - path = os.path.normpath(src) - basename = os.path.split(path)[1] - dst = os.path.join(destination, basename) - - copy = file_copy if os.path.basename(src) else dir_copy - - copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) - copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) - copy.gyp_inputs.append(src) - copy.gyp_outputs.append(dst) - - for copy in (file_copy, dir_copy): - if copy.cmake_inputs: - copy.inputs_name = copy_name + "__input" + copy.ext - SetVariableList(output, copy.inputs_name, copy.cmake_inputs) - - copy.outputs_name = copy_name + "__output" + copy.ext - SetVariableList(output, copy.outputs_name, copy.cmake_outputs) - - # add_custom_command - output.write("add_custom_command(\n") - - output.write("OUTPUT") - for copy in (file_copy, dir_copy): - if copy.outputs_name: - WriteVariable(output, copy.outputs_name, " ") - output.write("\n") - - for copy in (file_copy, dir_copy): - for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs): - # 'cmake -E copy src dst' will create the 'dst' directory if needed. - output.write("COMMAND ${CMAKE_COMMAND} -E %s " % copy.command) - output.write(src) - output.write(" ") - output.write(dst) - output.write("\n") - - output.write("DEPENDS") - for copy in (file_copy, dir_copy): - if copy.inputs_name: - WriteVariable(output, copy.inputs_name, " ") - output.write("\n") - - output.write("WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") - output.write(path_to_gyp) - output.write("\n") - - output.write("COMMENT Copying for ") - output.write(target_name) - output.write("\n") - - output.write("VERBATIM\n") - output.write(")\n") - - # add_custom_target - output.write("add_custom_target(") - output.write(copy_name) - output.write("\n DEPENDS") - for copy in (file_copy, dir_copy): - if copy.outputs_name: - WriteVariable(output, copy.outputs_name, " ") - output.write("\n SOURCES") - if file_copy.inputs_name: - WriteVariable(output, file_copy.inputs_name, " ") - output.write("\n)\n") - - extra_deps.append(copy_name) - - -def CreateCMakeTargetBaseName(qualified_target): - """This is the name we would like the target to have.""" - _, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( - qualified_target - ) - cmake_target_base_name = gyp_target_name - if gyp_target_toolset and gyp_target_toolset != "target": - cmake_target_base_name += "_" + gyp_target_toolset - return StringToCMakeTargetName(cmake_target_base_name) - - -def CreateCMakeTargetFullName(qualified_target): - """An unambiguous name for the target.""" - gyp_file, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( - qualified_target - ) - cmake_target_full_name = gyp_file + ":" + gyp_target_name - if gyp_target_toolset and gyp_target_toolset != "target": - cmake_target_full_name += "_" + gyp_target_toolset - return StringToCMakeTargetName(cmake_target_full_name) - - -class CMakeNamer: - """Converts Gyp target names into CMake target names. - - CMake requires that target names be globally unique. One way to ensure - this is to fully qualify the names of the targets. Unfortunately, this - ends up with all targets looking like "chrome_chrome_gyp_chrome" instead - of just "chrome". If this generator were only interested in building, it - would be possible to fully qualify all target names, then create - unqualified target names which depend on all qualified targets which - should have had that name. This is more or less what the 'make' generator - does with aliases. However, one goal of this generator is to create CMake - files for use with IDEs, and fully qualified names are not as user - friendly. - - Since target name collision is rare, we do the above only when required. - - Toolset variants are always qualified from the base, as this is required for - building. However, it also makes sense for an IDE, as it is possible for - defines to be different. - """ - - def __init__(self, target_list): - self.cmake_target_base_names_conficting = set() - - cmake_target_base_names_seen = set() - for qualified_target in target_list: - cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target) - - if cmake_target_base_name not in cmake_target_base_names_seen: - cmake_target_base_names_seen.add(cmake_target_base_name) - else: - self.cmake_target_base_names_conficting.add(cmake_target_base_name) - - def CreateCMakeTargetName(self, qualified_target): - base_name = CreateCMakeTargetBaseName(qualified_target) - if base_name in self.cmake_target_base_names_conficting: - return CreateCMakeTargetFullName(qualified_target) - return base_name - - -def WriteTarget( - namer, - qualified_target, - target_dicts, - build_dir, - config_to_use, - options, - generator_flags, - all_qualified_targets, - flavor, - output, -): - # The make generator does this always. - # TODO: It would be nice to be able to tell CMake all dependencies. - circular_libs = generator_flags.get("circular", True) - - if not generator_flags.get("standalone", False): - output.write("\n#") - output.write(qualified_target) - output.write("\n") - - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir) - rel_gyp_dir = os.path.dirname(rel_gyp_file) - - # Relative path from build dir to top dir. - build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - # Relative path from build dir to gyp dir. - build_to_gyp = os.path.join(build_to_top, rel_gyp_dir) - - path_from_cmakelists_to_gyp = build_to_gyp - - spec = target_dicts.get(qualified_target, {}) - config = spec.get("configurations", {}).get(config_to_use, {}) - - xcode_settings = None - if flavor == "mac": - xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - - target_name = spec.get("target_name", "") - target_type = spec.get("type", "") - target_toolset = spec.get("toolset") - - cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) - if cmake_target_type is None: - print( - "Target %s has unknown target type %s, skipping." - % (target_name, target_type) - ) - return - - SetVariable(output, "TARGET", target_name) - SetVariable(output, "TOOLSET", target_toolset) - - cmake_target_name = namer.CreateCMakeTargetName(qualified_target) - - extra_sources = [] - extra_deps = [] - - # Actions must come first, since they can generate more OBJs for use below. - if "actions" in spec: - WriteActions( - cmake_target_name, - spec["actions"], - extra_sources, - extra_deps, - path_from_cmakelists_to_gyp, - output, - ) - - # Rules must be early like actions. - if "rules" in spec: - WriteRules( - cmake_target_name, - spec["rules"], - extra_sources, - extra_deps, - path_from_cmakelists_to_gyp, - output, - ) - - # Copies - if "copies" in spec: - WriteCopies( - cmake_target_name, - spec["copies"], - extra_deps, - path_from_cmakelists_to_gyp, - output, - ) - - # Target and sources - srcs = spec.get("sources", []) - - # Gyp separates the sheep from the goats based on file extensions. - # A full separation is done here because of flag handing (see below). - s_sources = [] - c_sources = [] - cxx_sources = [] - linkable_sources = [] - other_sources = [] - for src in srcs: - _, ext = os.path.splitext(src) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src) - - if src_type == "s": - s_sources.append(src_norm_path) - elif src_type == "cc": - c_sources.append(src_norm_path) - elif src_type == "cxx": - cxx_sources.append(src_norm_path) - elif Linkable(ext): - linkable_sources.append(src_norm_path) - else: - other_sources.append(src_norm_path) - - for extra_source in extra_sources: - src, real_source = extra_source - _, ext = os.path.splitext(real_source) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - - if src_type == "s": - s_sources.append(src) - elif src_type == "cc": - c_sources.append(src) - elif src_type == "cxx": - cxx_sources.append(src) - elif Linkable(ext): - linkable_sources.append(src) - else: - other_sources.append(src) - - s_sources_name = None - if s_sources: - s_sources_name = cmake_target_name + "__asm_srcs" - SetVariableList(output, s_sources_name, s_sources) - - c_sources_name = None - if c_sources: - c_sources_name = cmake_target_name + "__c_srcs" - SetVariableList(output, c_sources_name, c_sources) - - cxx_sources_name = None - if cxx_sources: - cxx_sources_name = cmake_target_name + "__cxx_srcs" - SetVariableList(output, cxx_sources_name, cxx_sources) - - linkable_sources_name = None - if linkable_sources: - linkable_sources_name = cmake_target_name + "__linkable_srcs" - SetVariableList(output, linkable_sources_name, linkable_sources) - - other_sources_name = None - if other_sources: - other_sources_name = cmake_target_name + "__other_srcs" - SetVariableList(output, other_sources_name, other_sources) - - # CMake gets upset when executable targets provide no sources. - # http://www.cmake.org/pipermail/cmake/2010-July/038461.html - dummy_sources_name = None - has_sources = ( - s_sources_name - or c_sources_name - or cxx_sources_name - or linkable_sources_name - or other_sources_name - ) - if target_type == "executable" and not has_sources: - dummy_sources_name = cmake_target_name + "__dummy_srcs" - SetVariable( - output, dummy_sources_name, "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c" - ) - output.write('if(NOT EXISTS "') - WriteVariable(output, dummy_sources_name) - output.write('")\n') - output.write(' file(WRITE "') - WriteVariable(output, dummy_sources_name) - output.write('" "")\n') - output.write("endif()\n") - - # CMake is opposed to setting linker directories and considers the practice - # of setting linker directories dangerous. Instead, it favors the use of - # find_library and passing absolute paths to target_link_libraries. - # However, CMake does provide the command link_directories, which adds - # link directories to targets defined after it is called. - # As a result, link_directories must come before the target definition. - # CMake unfortunately has no means of removing entries from LINK_DIRECTORIES. - library_dirs = config.get("library_dirs") - if library_dirs is not None: - output.write("link_directories(") - for library_dir in library_dirs: - output.write(" ") - output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir)) - output.write("\n") - output.write(")\n") - - output.write(cmake_target_type.command) - output.write("(") - output.write(cmake_target_name) - - if cmake_target_type.modifier is not None: - output.write(" ") - output.write(cmake_target_type.modifier) - - if s_sources_name: - WriteVariable(output, s_sources_name, " ") - if c_sources_name: - WriteVariable(output, c_sources_name, " ") - if cxx_sources_name: - WriteVariable(output, cxx_sources_name, " ") - if linkable_sources_name: - WriteVariable(output, linkable_sources_name, " ") - if other_sources_name: - WriteVariable(output, other_sources_name, " ") - if dummy_sources_name: - WriteVariable(output, dummy_sources_name, " ") - - output.write(")\n") - - # Let CMake know if the 'all' target should depend on this target. - exclude_from_all = ( - "TRUE" if qualified_target not in all_qualified_targets else "FALSE" - ) - SetTargetProperty(output, cmake_target_name, "EXCLUDE_FROM_ALL", exclude_from_all) - for extra_target_name in extra_deps: - SetTargetProperty( - output, extra_target_name, "EXCLUDE_FROM_ALL", exclude_from_all - ) - - # Output name and location. - if target_type != "none": - # Link as 'C' if there are no other files - if not c_sources and not cxx_sources: - SetTargetProperty(output, cmake_target_name, "LINKER_LANGUAGE", ["C"]) - - # Mark uncompiled sources as uncompiled. - if other_sources_name: - output.write("set_source_files_properties(") - WriteVariable(output, other_sources_name, "") - output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') - - # Mark object sources as linkable. - if linkable_sources_name: - output.write("set_source_files_properties(") - WriteVariable(output, other_sources_name, "") - output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') - - # Output directory - target_output_directory = spec.get("product_dir") - if target_output_directory is None: - if target_type in ("executable", "loadable_module"): - target_output_directory = generator_default_variables["PRODUCT_DIR"] - elif target_type == "shared_library": - target_output_directory = "${builddir}/lib.${TOOLSET}" - elif spec.get("standalone_static_library", False): - target_output_directory = generator_default_variables["PRODUCT_DIR"] - else: - base_path = gyp.common.RelativePath( - os.path.dirname(gyp_file), options.toplevel_dir - ) - target_output_directory = "${obj}.${TOOLSET}" - target_output_directory = os.path.join( - target_output_directory, base_path - ) - - cmake_target_output_directory = NormjoinPathForceCMakeSource( - path_from_cmakelists_to_gyp, target_output_directory - ) - SetTargetProperty( - output, - cmake_target_name, - cmake_target_type.property_modifier + "_OUTPUT_DIRECTORY", - cmake_target_output_directory, - ) - - # Output name - default_product_prefix = "" - default_product_name = target_name - default_product_ext = "" - if target_type == "static_library": - static_library_prefix = generator_default_variables["STATIC_LIB_PREFIX"] - default_product_name = RemovePrefix( - default_product_name, static_library_prefix - ) - default_product_prefix = static_library_prefix - default_product_ext = generator_default_variables["STATIC_LIB_SUFFIX"] - - elif target_type in ("loadable_module", "shared_library"): - shared_library_prefix = generator_default_variables["SHARED_LIB_PREFIX"] - default_product_name = RemovePrefix( - default_product_name, shared_library_prefix - ) - default_product_prefix = shared_library_prefix - default_product_ext = generator_default_variables["SHARED_LIB_SUFFIX"] - - elif target_type != "executable": - print( - "ERROR: What output file should be generated?", - "type", - target_type, - "target", - target_name, - ) - - product_prefix = spec.get("product_prefix", default_product_prefix) - product_name = spec.get("product_name", default_product_name) - product_ext = spec.get("product_extension") - if product_ext: - product_ext = "." + product_ext - else: - product_ext = default_product_ext - - SetTargetProperty(output, cmake_target_name, "PREFIX", product_prefix) - SetTargetProperty( - output, - cmake_target_name, - cmake_target_type.property_modifier + "_OUTPUT_NAME", - product_name, - ) - SetTargetProperty(output, cmake_target_name, "SUFFIX", product_ext) - - # Make the output of this target referenceable as a source. - cmake_target_output_basename = product_prefix + product_name + product_ext - cmake_target_output = os.path.join( - cmake_target_output_directory, cmake_target_output_basename - ) - SetFileProperty(output, cmake_target_output, "GENERATED", ["TRUE"], "") - - # Includes - includes = config.get("include_dirs") - if includes: - # This (target include directories) is what requires CMake 2.8.8 - includes_name = cmake_target_name + "__include_dirs" - SetVariableList( - output, - includes_name, - [ - NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) - for include in includes - ], - ) - output.write("set_property(TARGET ") - output.write(cmake_target_name) - output.write(" APPEND PROPERTY INCLUDE_DIRECTORIES ") - WriteVariable(output, includes_name, "") - output.write(")\n") - - # Defines - defines = config.get("defines") - if defines is not None: - SetTargetProperty( - output, cmake_target_name, "COMPILE_DEFINITIONS", defines, ";" - ) - - # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 - # CMake currently does not have target C and CXX flags. - # So, instead of doing... - - # cflags_c = config.get('cflags_c') - # if cflags_c is not None: - # SetTargetProperty(output, cmake_target_name, - # 'C_COMPILE_FLAGS', cflags_c, ' ') - - # cflags_cc = config.get('cflags_cc') - # if cflags_cc is not None: - # SetTargetProperty(output, cmake_target_name, - # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') - - # Instead we must... - cflags = config.get("cflags", []) - cflags_c = config.get("cflags_c", []) - cflags_cxx = config.get("cflags_cc", []) - if xcode_settings: - cflags = xcode_settings.GetCflags(config_to_use) - cflags_c = xcode_settings.GetCflagsC(config_to_use) - cflags_cxx = xcode_settings.GetCflagsCC(config_to_use) - # cflags_objc = xcode_settings.GetCflagsObjC(config_to_use) - # cflags_objcc = xcode_settings.GetCflagsObjCC(config_to_use) - - if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): - SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", cflags, " ") - - elif c_sources and not (s_sources or cxx_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") - - elif cxx_sources and not (s_sources or c_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") - - else: - # TODO: This is broken, one cannot generally set properties on files, - # as other targets may require different properties on the same files. - if s_sources and cflags: - SetFilesProperty(output, s_sources_name, "COMPILE_FLAGS", cflags, " ") - - if c_sources and (cflags or cflags_c): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetFilesProperty(output, c_sources_name, "COMPILE_FLAGS", flags, " ") - - if cxx_sources and (cflags or cflags_cxx): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetFilesProperty(output, cxx_sources_name, "COMPILE_FLAGS", flags, " ") - - # Linker flags - ldflags = config.get("ldflags") - if ldflags is not None: - SetTargetProperty(output, cmake_target_name, "LINK_FLAGS", ldflags, " ") - - # XCode settings - xcode_settings = config.get("xcode_settings", {}) - for xcode_setting, xcode_value in xcode_settings.items(): - SetTargetProperty( - output, - cmake_target_name, - "XCODE_ATTRIBUTE_%s" % xcode_setting, - xcode_value, - "" if isinstance(xcode_value, str) else " ", - ) - - # Note on Dependencies and Libraries: - # CMake wants to handle link order, resolving the link line up front. - # Gyp does not retain or enforce specifying enough information to do so. - # So do as other gyp generators and use --start-group and --end-group. - # Give CMake as little information as possible so that it doesn't mess it up. - - # Dependencies - rawDeps = spec.get("dependencies", []) - - static_deps = [] - shared_deps = [] - other_deps = [] - for rawDep in rawDeps: - dep_cmake_name = namer.CreateCMakeTargetName(rawDep) - dep_spec = target_dicts.get(rawDep, {}) - dep_target_type = dep_spec.get("type", None) - - if dep_target_type == "static_library": - static_deps.append(dep_cmake_name) - elif dep_target_type == "shared_library": - shared_deps.append(dep_cmake_name) - else: - other_deps.append(dep_cmake_name) - - # ensure all external dependencies are complete before internal dependencies - # extra_deps currently only depend on their own deps, so otherwise run early - if static_deps or shared_deps or other_deps: - for extra_dep in extra_deps: - output.write("add_dependencies(") - output.write(extra_dep) - output.write("\n") - for deps in (static_deps, shared_deps, other_deps): - for dep in gyp.common.uniquer(deps): - output.write(" ") - output.write(dep) - output.write("\n") - output.write(")\n") - - linkable = target_type in ("executable", "loadable_module", "shared_library") - other_deps.extend(extra_deps) - if other_deps or (not linkable and (static_deps or shared_deps)): - output.write("add_dependencies(") - output.write(cmake_target_name) - output.write("\n") - for dep in gyp.common.uniquer(other_deps): - output.write(" ") - output.write(dep) - output.write("\n") - if not linkable: - for deps in (static_deps, shared_deps): - for lib_dep in gyp.common.uniquer(deps): - output.write(" ") - output.write(lib_dep) - output.write("\n") - output.write(")\n") - - # Libraries - if linkable: - external_libs = [lib for lib in spec.get("libraries", []) if len(lib) > 0] - if external_libs or static_deps or shared_deps: - output.write("target_link_libraries(") - output.write(cmake_target_name) - output.write("\n") - if static_deps: - write_group = circular_libs and len(static_deps) > 1 and flavor != "mac" - if write_group: - output.write("-Wl,--start-group\n") - for dep in gyp.common.uniquer(static_deps): - output.write(" ") - output.write(dep) - output.write("\n") - if write_group: - output.write("-Wl,--end-group\n") - if shared_deps: - for dep in gyp.common.uniquer(shared_deps): - output.write(" ") - output.write(dep) - output.write("\n") - if external_libs: - for lib in gyp.common.uniquer(external_libs): - output.write(' "') - output.write(RemovePrefix(lib, "$(SDKROOT)")) - output.write('"\n') - - output.write(")\n") - - UnsetVariable(output, "TOOLSET") - UnsetVariable(output, "TARGET") - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, config_to_use): - options = params["options"] - generator_flags = params["generator_flags"] - flavor = gyp.common.GetFlavor(params) - - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to cmake easier, cmake doesn't put anything here. - # Each Gyp configuration creates a different CMakeLists.txt file - # to avoid incompatibilities between Gyp and CMake configurations. - generator_dir = os.path.relpath(options.generator_output or ".") - - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get("output_dir", "out") - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath(os.path.join(generator_dir, output_dir, config_to_use)) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - - output_file = os.path.join(toplevel_build, "CMakeLists.txt") - gyp.common.EnsureDirExists(output_file) - - output = open(output_file, "w") - output.write("cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n") - output.write("cmake_policy(VERSION 2.8.8)\n") - - gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) - output.write("project(") - output.write(project_target) - output.write(")\n") - - SetVariable(output, "configuration", config_to_use) - - ar = None - cc = None - cxx = None - - make_global_settings = data[gyp_file].get("make_global_settings", []) - build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - for key, value in make_global_settings: - if key == "AR": - ar = os.path.join(build_to_top, value) - if key == "CC": - cc = os.path.join(build_to_top, value) - if key == "CXX": - cxx = os.path.join(build_to_top, value) - - ar = gyp.common.GetEnvironFallback(["AR_target", "AR"], ar) - cc = gyp.common.GetEnvironFallback(["CC_target", "CC"], cc) - cxx = gyp.common.GetEnvironFallback(["CXX_target", "CXX"], cxx) - - if ar: - SetVariable(output, "CMAKE_AR", ar) - if cc: - SetVariable(output, "CMAKE_C_COMPILER", cc) - if cxx: - SetVariable(output, "CMAKE_CXX_COMPILER", cxx) - - # The following appears to be as-yet undocumented. - # http://public.kitware.com/Bug/view.php?id=8392 - output.write("enable_language(ASM)\n") - # ASM-ATT does not support .S files. - # output.write('enable_language(ASM-ATT)\n') - - if cc: - SetVariable(output, "CMAKE_ASM_COMPILER", cc) - - SetVariable(output, "builddir", "${CMAKE_CURRENT_BINARY_DIR}") - SetVariable(output, "obj", "${builddir}/obj") - output.write("\n") - - # TODO: Undocumented/unsupported (the CMake Java generator depends on it). - # CMake by default names the object resulting from foo.c to be foo.c.o. - # Gyp traditionally names the object resulting from foo.c foo.o. - # This should be irrelevant, but some targets extract .o files from .a - # and depend on the name of the extracted .o files. - output.write("set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n") - output.write("set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n") - output.write("\n") - - # Force ninja to use rsp files. Otherwise link and ar lines can get too long, - # resulting in 'Argument list too long' errors. - # However, rsp files don't work correctly on Mac. - if flavor != "mac": - output.write("set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n") - output.write("\n") - - namer = CMakeNamer(target_list) - - # The list of targets upon which the 'all' target should depend. - # CMake has it's own implicit 'all' target, one is not created explicitly. - all_qualified_targets = set() - for build_file in params["build_files"]: - for qualified_target in gyp.common.AllTargets( - target_list, target_dicts, os.path.normpath(build_file) - ): - all_qualified_targets.add(qualified_target) - - for qualified_target in target_list: - if flavor == "mac": - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - spec = target_dicts[qualified_target] - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[gyp_file], spec) - - WriteTarget( - namer, - qualified_target, - target_dicts, - build_dir, - config_to_use, - options, - generator_flags, - all_qualified_targets, - flavor, - output, - ) - - output.close() - - -def PerformBuild(data, configurations, params): - options = params["options"] - generator_flags = params["generator_flags"] - - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to cmake easier, cmake doesn't put anything here. - generator_dir = os.path.relpath(options.generator_output or ".") - - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get("output_dir", "out") - - for config_name in configurations: - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath( - os.path.join(generator_dir, output_dir, config_name) - ) - arguments = ["cmake", "-G", "Ninja"] - print(f"Generating [{config_name}]: {arguments}") - subprocess.check_call(arguments, cwd=build_dir) - - arguments = ["ninja", "-C", build_dir] - print(f"Building [{config_name}]: {arguments}") - subprocess.check_call(arguments) - - -def CallGenerateOutputForConfig(arglist): - # Ignore the interrupt signal so that the parent process catches it and - # kills all multiprocessing children. - signal.signal(signal.SIGINT, signal.SIG_IGN) - - target_list, target_dicts, data, params, config_name = arglist - GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) - - -def GenerateOutput(target_list, target_dicts, data, params): - user_config = params.get("generator_flags", {}).get("config", None) - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) - else: - config_names = target_dicts[target_list[0]]["configurations"] - if params["parallel"]: - try: - pool = multiprocessing.Pool(len(config_names)) - arglists = [] - for config_name in config_names: - arglists.append( - (target_list, target_dicts, data, params, config_name) - ) - pool.map(CallGenerateOutputForConfig, arglists) - except KeyboardInterrupt as e: - pool.terminate() - raise e - else: - for config_name in config_names: - GenerateOutputForConfig( - target_list, target_dicts, data, params, config_name - ) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py deleted file mode 100644 index f330a04de..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (c) 2016 Ben Noordhuis . All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import gyp.common -import gyp.xcode_emulation -import json -import os - -generator_additional_non_configuration_keys = [] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] -generator_filelist_paths = None -generator_supports_multiple_toolsets = True -generator_wants_sorted_dependencies = False - -# Lifted from make.py. The actual values don't matter much. -generator_default_variables = { - "CONFIGURATION_NAME": "$(BUILDTYPE)", - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", - "PRODUCT_DIR": "$(builddir)", - "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", - "RULE_INPUT_EXT": "$(suffix $<)", - "RULE_INPUT_NAME": "$(notdir $<)", - "RULE_INPUT_PATH": "$(abspath $<)", - "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", - "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", -} - - -def IsMac(params): - return "mac" == gyp.common.GetFlavor(params) - - -def CalculateVariables(default_variables, params): - default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - - -def AddCommandsForTarget(cwd, target, params, per_config_commands): - output_dir = params["generator_flags"].get("output_dir", "out") - for configuration_name, configuration in target["configurations"].items(): - if IsMac(params): - xcode_settings = gyp.xcode_emulation.XcodeSettings(target) - cflags = xcode_settings.GetCflags(configuration_name) - cflags_c = xcode_settings.GetCflagsC(configuration_name) - cflags_cc = xcode_settings.GetCflagsCC(configuration_name) - else: - cflags = configuration.get("cflags", []) - cflags_c = configuration.get("cflags_c", []) - cflags_cc = configuration.get("cflags_cc", []) - - cflags_c = cflags + cflags_c - cflags_cc = cflags + cflags_cc - - defines = configuration.get("defines", []) - defines = ["-D" + s for s in defines] - - # TODO(bnoordhuis) Handle generated source files. - extensions = (".c", ".cc", ".cpp", ".cxx") - sources = [s for s in target.get("sources", []) if s.endswith(extensions)] - - def resolve(filename): - return os.path.abspath(os.path.join(cwd, filename)) - - # TODO(bnoordhuis) Handle generated header files. - include_dirs = configuration.get("include_dirs", []) - include_dirs = [s for s in include_dirs if not s.startswith("$(obj)")] - includes = ["-I" + resolve(s) for s in include_dirs] - - defines = gyp.common.EncodePOSIXShellList(defines) - includes = gyp.common.EncodePOSIXShellList(includes) - cflags_c = gyp.common.EncodePOSIXShellList(cflags_c) - cflags_cc = gyp.common.EncodePOSIXShellList(cflags_cc) - - commands = per_config_commands.setdefault(configuration_name, []) - for source in sources: - file = resolve(source) - isc = source.endswith(".c") - cc = "cc" if isc else "c++" - cflags = cflags_c if isc else cflags_cc - command = " ".join( - ( - cc, - defines, - includes, - cflags, - "-c", - gyp.common.EncodePOSIXShellArgument(file), - ) - ) - commands.append(dict(command=command, directory=output_dir, file=file)) - - -def GenerateOutput(target_list, target_dicts, data, params): - per_config_commands = {} - for qualified_target, target in target_dicts.items(): - build_file, target_name, toolset = gyp.common.ParseQualifiedTarget( - qualified_target - ) - if IsMac(params): - settings = data[build_file] - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(settings, target) - cwd = os.path.dirname(build_file) - AddCommandsForTarget(cwd, target, params, per_config_commands) - - output_dir = params["generator_flags"].get("output_dir", "out") - for configuration_name, commands in per_config_commands.items(): - filename = os.path.join(output_dir, configuration_name, "compile_commands.json") - gyp.common.EnsureDirExists(filename) - fp = open(filename, "w") - json.dump(commands, fp=fp, indent=0, check_circular=False) - - -def PerformBuild(data, configurations, params): - pass diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py deleted file mode 100644 index 99d5c1fd6..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import os -import gyp -import gyp.common -import gyp.msvs_emulation -import json - -generator_supports_multiple_toolsets = True - -generator_wants_static_library_dependencies_adjusted = False - -generator_filelist_paths = {} - -generator_default_variables = {} -for dirname in [ - "INTERMEDIATE_DIR", - "SHARED_INTERMEDIATE_DIR", - "PRODUCT_DIR", - "LIB_DIR", - "SHARED_LIB_DIR", -]: - # Some gyp steps fail if these are empty(!). - generator_default_variables[dirname] = "dir" -for unused in [ - "RULE_INPUT_PATH", - "RULE_INPUT_ROOT", - "RULE_INPUT_NAME", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "CONFIGURATION_NAME", -]: - generator_default_variables[unused] = "" - - -def CalculateVariables(default_variables, params): - generator_flags = params.get("generator_flags", {}) - for key, val in generator_flags.items(): - default_variables.setdefault(key, val) - default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - - flavor = gyp.common.GetFlavor(params) - if flavor == "win": - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - - -def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get("generator_flags", {}) - if generator_flags.get("adjust_static_libraries", False): - global generator_wants_static_library_dependencies_adjusted - generator_wants_static_library_dependencies_adjusted = True - - toplevel = params["options"].toplevel_dir - generator_dir = os.path.relpath(params["options"].generator_output or ".") - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get("output_dir", "out") - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, generator_dir, output_dir, "gypfiles") - ) - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def GenerateOutput(target_list, target_dicts, data, params): - # Map of target -> list of targets it depends on. - edges = {} - - # Queue of targets to visit. - targets_to_visit = target_list[:] - - while len(targets_to_visit) > 0: - target = targets_to_visit.pop() - if target in edges: - continue - edges[target] = [] - - for dep in target_dicts[target].get("dependencies", []): - edges[target].append(dep) - targets_to_visit.append(dep) - - try: - filepath = params["generator_flags"]["output_dir"] - except KeyError: - filepath = "." - filename = os.path.join(filepath, "dump.json") - f = open(filename, "w") - json.dump(edges, f) - f.close() - print("Wrote json to %s." % filename) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py deleted file mode 100644 index 1ff0dc83a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +++ /dev/null @@ -1,464 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""GYP backend that generates Eclipse CDT settings files. - -This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML -files that can be imported into an Eclipse CDT project. The XML file contains a -list of include paths and symbols (i.e. defines). - -Because a full .cproject definition is not created by this generator, it's not -possible to properly define the include dirs and symbols for each file -individually. Instead, one set of includes/symbols is generated for the entire -project. This works fairly well (and is a vast improvement in general), but may -still result in a few indexer issues here and there. - -This generator has no automated tests, so expect it to be broken. -""" - -from xml.sax.saxutils import escape -import os.path -import subprocess -import gyp -import gyp.common -import gyp.msvs_emulation -import shlex -import xml.etree.cElementTree as ET - -generator_wants_static_library_dependencies_adjusted = False - -generator_default_variables = {} - -for dirname in ["INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR"]: - # Some gyp steps fail if these are empty(!), so we convert them to variables - generator_default_variables[dirname] = "$" + dirname - -for unused in [ - "RULE_INPUT_PATH", - "RULE_INPUT_ROOT", - "RULE_INPUT_NAME", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "CONFIGURATION_NAME", -]: - generator_default_variables[unused] = "" - -# Include dirs will occasionally use the SHARED_INTERMEDIATE_DIR variable as -# part of the path when dealing with generated headers. This value will be -# replaced dynamically for each configuration. -generator_default_variables["SHARED_INTERMEDIATE_DIR"] = "$SHARED_INTERMEDIATE_DIR" - - -def CalculateVariables(default_variables, params): - generator_flags = params.get("generator_flags", {}) - for key, val in generator_flags.items(): - default_variables.setdefault(key, val) - flavor = gyp.common.GetFlavor(params) - default_variables.setdefault("OS", flavor) - if flavor == "win": - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - - -def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get("generator_flags", {}) - if generator_flags.get("adjust_static_libraries", False): - global generator_wants_static_library_dependencies_adjusted - generator_wants_static_library_dependencies_adjusted = True - - -def GetAllIncludeDirectories( - target_list, - target_dicts, - shared_intermediate_dirs, - config_name, - params, - compiler_path, -): - """Calculate the set of include directories to be used. - - Returns: - A list including all the include_dir's specified for every target followed - by any include directories that were added as cflag compiler options. - """ - - gyp_includes_set = set() - compiler_includes_list = [] - - # Find compiler's default include dirs. - if compiler_path: - command = shlex.split(compiler_path) - command.extend(["-E", "-xc++", "-v", "-"]) - proc = subprocess.Popen( - args=command, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - output = proc.communicate()[1].decode("utf-8") - # Extract the list of include dirs from the output, which has this format: - # ... - # #include "..." search starts here: - # #include <...> search starts here: - # /usr/include/c++/4.6 - # /usr/local/include - # End of search list. - # ... - in_include_list = False - for line in output.splitlines(): - if line.startswith("#include"): - in_include_list = True - continue - if line.startswith("End of search list."): - break - if in_include_list: - include_dir = line.strip() - if include_dir not in compiler_includes_list: - compiler_includes_list.append(include_dir) - - flavor = gyp.common.GetFlavor(params) - if flavor == "win": - generator_flags = params.get("generator_flags", {}) - for target_name in target_list: - target = target_dicts[target_name] - if config_name in target["configurations"]: - config = target["configurations"][config_name] - - # Look for any include dirs that were explicitly added via cflags. This - # may be done in gyp files to force certain includes to come at the end. - # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and - # remove this. - if flavor == "win": - msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) - cflags = msvs_settings.GetCflags(config_name) - else: - cflags = config["cflags"] - for cflag in cflags: - if cflag.startswith("-I"): - include_dir = cflag[2:] - if include_dir not in compiler_includes_list: - compiler_includes_list.append(include_dir) - - # Find standard gyp include dirs. - if "include_dirs" in config: - include_dirs = config["include_dirs"] - for shared_intermediate_dir in shared_intermediate_dirs: - for include_dir in include_dirs: - include_dir = include_dir.replace( - "$SHARED_INTERMEDIATE_DIR", shared_intermediate_dir - ) - if not os.path.isabs(include_dir): - base_dir = os.path.dirname(target_name) - - include_dir = base_dir + "/" + include_dir - include_dir = os.path.abspath(include_dir) - - gyp_includes_set.add(include_dir) - - # Generate a list that has all the include dirs. - all_includes_list = list(gyp_includes_set) - all_includes_list.sort() - for compiler_include in compiler_includes_list: - if compiler_include not in gyp_includes_set: - all_includes_list.append(compiler_include) - - # All done. - return all_includes_list - - -def GetCompilerPath(target_list, data, options): - """Determine a command that can be used to invoke the compiler. - - Returns: - If this is a gyp project that has explicit make settings, try to determine - the compiler from that. Otherwise, see if a compiler was specified via the - CC_target environment variable. - """ - # First, see if the compiler is configured in make's settings. - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings_dict = data[build_file].get("make_global_settings", {}) - for key, value in make_global_settings_dict: - if key in ["CC", "CXX"]: - return os.path.join(options.toplevel_dir, value) - - # Check to see if the compiler was specified as an environment variable. - for key in ["CC_target", "CC", "CXX"]: - compiler = os.environ.get(key) - if compiler: - return compiler - - return "gcc" - - -def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path): - """Calculate the defines for a project. - - Returns: - A dict that includes explicit defines declared in gyp files along with all - of the default defines that the compiler uses. - """ - - # Get defines declared in the gyp files. - all_defines = {} - flavor = gyp.common.GetFlavor(params) - if flavor == "win": - generator_flags = params.get("generator_flags", {}) - for target_name in target_list: - target = target_dicts[target_name] - - if flavor == "win": - msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) - extra_defines = msvs_settings.GetComputedDefines(config_name) - else: - extra_defines = [] - if config_name in target["configurations"]: - config = target["configurations"][config_name] - target_defines = config["defines"] - else: - target_defines = [] - for define in target_defines + extra_defines: - split_define = define.split("=", 1) - if len(split_define) == 1: - split_define.append("1") - if split_define[0].strip() in all_defines: - # Already defined - continue - all_defines[split_define[0].strip()] = split_define[1].strip() - # Get default compiler defines (if possible). - if flavor == "win": - return all_defines # Default defines already processed in the loop above. - if compiler_path: - command = shlex.split(compiler_path) - command.extend(["-E", "-dM", "-"]) - cpp_proc = subprocess.Popen( - args=command, cwd=".", stdin=subprocess.PIPE, stdout=subprocess.PIPE - ) - cpp_output = cpp_proc.communicate()[0].decode("utf-8") - cpp_lines = cpp_output.split("\n") - for cpp_line in cpp_lines: - if not cpp_line.strip(): - continue - cpp_line_parts = cpp_line.split(" ", 2) - key = cpp_line_parts[1] - if len(cpp_line_parts) >= 3: - val = cpp_line_parts[2] - else: - val = "1" - all_defines[key] = val - - return all_defines - - -def WriteIncludePaths(out, eclipse_langs, include_dirs): - """Write the includes section of a CDT settings export file.""" - - out.write( - '
\n' - ) - out.write(' \n') - for lang in eclipse_langs: - out.write(' \n' % lang) - for include_dir in include_dirs: - out.write( - ' %s\n' - % include_dir - ) - out.write(" \n") - out.write("
\n") - - -def WriteMacros(out, eclipse_langs, defines): - """Write the macros section of a CDT settings export file.""" - - out.write( - '
\n' - ) - out.write(' \n') - for lang in eclipse_langs: - out.write(' \n' % lang) - for key in sorted(defines): - out.write( - " %s%s\n" - % (escape(key), escape(defines[key])) - ) - out.write(" \n") - out.write("
\n") - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): - options = params["options"] - generator_flags = params.get("generator_flags", {}) - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.join(generator_flags.get("output_dir", "out"), config_name) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the - # SHARED_INTERMEDIATE_DIR. Include both possible locations. - shared_intermediate_dirs = [ - os.path.join(toplevel_build, "obj", "gen"), - os.path.join(toplevel_build, "gen"), - ] - - GenerateCdtSettingsFile( - target_list, - target_dicts, - data, - params, - config_name, - os.path.join(toplevel_build, "eclipse-cdt-settings.xml"), - options, - shared_intermediate_dirs, - ) - GenerateClasspathFile( - target_list, - target_dicts, - options.toplevel_dir, - toplevel_build, - os.path.join(toplevel_build, "eclipse-classpath.xml"), - ) - - -def GenerateCdtSettingsFile( - target_list, - target_dicts, - data, - params, - config_name, - out_name, - options, - shared_intermediate_dirs, -): - gyp.common.EnsureDirExists(out_name) - with open(out_name, "w") as out: - out.write('\n') - out.write("\n") - - eclipse_langs = [ - "C++ Source File", - "C Source File", - "Assembly Source File", - "GNU C++", - "GNU C", - "Assembly", - ] - compiler_path = GetCompilerPath(target_list, data, options) - include_dirs = GetAllIncludeDirectories( - target_list, - target_dicts, - shared_intermediate_dirs, - config_name, - params, - compiler_path, - ) - WriteIncludePaths(out, eclipse_langs, include_dirs) - defines = GetAllDefines( - target_list, target_dicts, data, config_name, params, compiler_path - ) - WriteMacros(out, eclipse_langs, defines) - - out.write("\n") - - -def GenerateClasspathFile( - target_list, target_dicts, toplevel_dir, toplevel_build, out_name -): - """Generates a classpath file suitable for symbol navigation and code - completion of Java code (such as in Android projects) by finding all - .java and .jar files used as action inputs.""" - gyp.common.EnsureDirExists(out_name) - result = ET.Element("classpath") - - def AddElements(kind, paths): - # First, we need to normalize the paths so they are all relative to the - # toplevel dir. - rel_paths = set() - for path in paths: - if os.path.isabs(path): - rel_paths.add(os.path.relpath(path, toplevel_dir)) - else: - rel_paths.add(path) - - for path in sorted(rel_paths): - entry_element = ET.SubElement(result, "classpathentry") - entry_element.set("kind", kind) - entry_element.set("path", path) - - AddElements("lib", GetJavaJars(target_list, target_dicts, toplevel_dir)) - AddElements("src", GetJavaSourceDirs(target_list, target_dicts, toplevel_dir)) - # Include the standard JRE container and a dummy out folder - AddElements("con", ["org.eclipse.jdt.launching.JRE_CONTAINER"]) - # Include a dummy out folder so that Eclipse doesn't use the default /bin - # folder in the root of the project. - AddElements("output", [os.path.join(toplevel_build, ".eclipse-java-build")]) - - ET.ElementTree(result).write(out_name) - - -def GetJavaJars(target_list, target_dicts, toplevel_dir): - """Generates a sequence of all .jars used as inputs.""" - for target_name in target_list: - target = target_dicts[target_name] - for action in target.get("actions", []): - for input_ in action["inputs"]: - if os.path.splitext(input_)[1] == ".jar" and not input_.startswith("$"): - if os.path.isabs(input_): - yield input_ - else: - yield os.path.join(os.path.dirname(target_name), input_) - - -def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir): - """Generates a sequence of all likely java package root directories.""" - for target_name in target_list: - target = target_dicts[target_name] - for action in target.get("actions", []): - for input_ in action["inputs"]: - if os.path.splitext(input_)[1] == ".java" and not input_.startswith( - "$" - ): - dir_ = os.path.dirname( - os.path.join(os.path.dirname(target_name), input_) - ) - # If there is a parent 'src' or 'java' folder, navigate up to it - - # these are canonical package root names in Chromium. This will - # break if 'src' or 'java' exists in the package structure. This - # could be further improved by inspecting the java file for the - # package name if this proves to be too fragile in practice. - parent_search = dir_ - while os.path.basename(parent_search) not in ["src", "java"]: - parent_search, _ = os.path.split(parent_search) - if not parent_search or parent_search == toplevel_dir: - # Didn't find a known root, just return the original path - yield dir_ - break - else: - yield parent_search - - -def GenerateOutput(target_list, target_dicts, data, params): - """Generate an XML settings file that can be imported into a CDT project.""" - - if params["options"].generator_output: - raise NotImplementedError("--generator_output not implemented for eclipse") - - user_config = params.get("generator_flags", {}).get("config", None) - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) - else: - config_names = target_dicts[target_list[0]]["configurations"] - for config_name in config_names: - GenerateOutputForConfig( - target_list, target_dicts, data, params, config_name - ) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py deleted file mode 100644 index 4171704c4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""gypd output module - -This module produces gyp input as its output. Output files are given the -.gypd extension to avoid overwriting the .gyp files that they are generated -from. Internal references to .gyp files (such as those found in -"dependencies" sections) are not adjusted to point to .gypd files instead; -unlike other paths, which are relative to the .gyp or .gypd file, such paths -are relative to the directory from which gyp was run to create the .gypd file. - -This generator module is intended to be a sample and a debugging aid, hence -the "d" for "debug" in .gypd. It is useful to inspect the results of the -various merges, expansions, and conditional evaluations performed by gyp -and to see a representation of what would be fed to a generator module. - -It's not advisable to rename .gypd files produced by this module to .gyp, -because they will have all merges, expansions, and evaluations already -performed and the relevant constructs not present in the output; paths to -dependencies may be wrong; and various sections that do not belong in .gyp -files such as such as "included_files" and "*_excluded" will be present. -Output will also be stripped of comments. This is not intended to be a -general-purpose gyp pretty-printer; for that, you probably just want to -run "pprint.pprint(eval(open('source.gyp').read()))", which will still strip -comments but won't do all of the other things done to this module's output. - -The specific formatting of the output generated by this module is subject -to change. -""" - - -import gyp.common -import pprint - - -# These variables should just be spit back out as variable references. -_generator_identity_variables = [ - "CONFIGURATION_NAME", - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "INTERMEDIATE_DIR", - "LIB_DIR", - "PRODUCT_DIR", - "RULE_INPUT_ROOT", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "RULE_INPUT_NAME", - "RULE_INPUT_PATH", - "SHARED_INTERMEDIATE_DIR", - "SHARED_LIB_DIR", - "SHARED_LIB_PREFIX", - "SHARED_LIB_SUFFIX", - "STATIC_LIB_PREFIX", - "STATIC_LIB_SUFFIX", -] - -# gypd doesn't define a default value for OS like many other generator -# modules. Specify "-D OS=whatever" on the command line to provide a value. -generator_default_variables = {} - -# gypd supports multiple toolsets -generator_supports_multiple_toolsets = True - -# TODO(mark): This always uses <, which isn't right. The input module should -# notify the generator to tell it which phase it is operating in, and this -# module should use < for the early phase and then switch to > for the late -# phase. Bonus points for carrying @ back into the output too. -for v in _generator_identity_variables: - generator_default_variables[v] = "<(%s)" % v - - -def GenerateOutput(target_list, target_dicts, data, params): - output_files = {} - for qualified_target in target_list: - [input_file, target] = gyp.common.ParseQualifiedTarget(qualified_target)[0:2] - - if input_file[-4:] != ".gyp": - continue - input_file_stem = input_file[:-4] - output_file = input_file_stem + params["options"].suffix + ".gypd" - - output_files[output_file] = output_files.get(output_file, input_file) - - for output_file, input_file in output_files.items(): - output = open(output_file, "w") - pprint.pprint(data[input_file], output) - output.close() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py deleted file mode 100644 index 82a07ddc6..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""gypsh output module - -gypsh is a GYP shell. It's not really a generator per se. All it does is -fire up an interactive Python session with a few local variables set to the -variables passed to the generator. Like gypd, it's intended as a debugging -aid, to facilitate the exploration of .gyp structures after being processed -by the input module. - -The expected usage is "gyp -f gypsh -D OS=desired_os". -""" - - -import code -import sys - - -# All of this stuff about generator variables was lovingly ripped from gypd.py. -# That module has a much better description of what's going on and why. -_generator_identity_variables = [ - "EXECUTABLE_PREFIX", - "EXECUTABLE_SUFFIX", - "INTERMEDIATE_DIR", - "PRODUCT_DIR", - "RULE_INPUT_ROOT", - "RULE_INPUT_DIRNAME", - "RULE_INPUT_EXT", - "RULE_INPUT_NAME", - "RULE_INPUT_PATH", - "SHARED_INTERMEDIATE_DIR", -] - -generator_default_variables = {} - -for v in _generator_identity_variables: - generator_default_variables[v] = "<(%s)" % v - - -def GenerateOutput(target_list, target_dicts, data, params): - locals = { - "target_list": target_list, - "target_dicts": target_dicts, - "data": data, - } - - # Use a banner that looks like the stock Python one and like what - # code.interact uses by default, but tack on something to indicate what - # locals are available, and identify gypsh. - banner = "Python {} on {}\nlocals.keys() = {}\ngypsh".format( - sys.version, - sys.platform, - repr(sorted(locals.keys())), - ) - - code.interact(banner, local=locals) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py deleted file mode 100644 index f1d01a629..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +++ /dev/null @@ -1,2717 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Notes: -# -# This is all roughly based on the Makefile system used by the Linux -# kernel, but is a non-recursive make -- we put the entire dependency -# graph in front of make and let it figure it out. -# -# The code below generates a separate .mk file for each target, but -# all are sourced by the top-level Makefile. This means that all -# variables in .mk-files clobber one another. Be careful to use := -# where appropriate for immediate evaluation, and similarly to watch -# that you're not relying on a variable value to last between different -# .mk files. -# -# TODOs: -# -# Global settings and utility functions are currently stuffed in the -# toplevel Makefile. It may make sense to generate some .mk files on -# the side to keep the files readable. - - -import os -import re -import subprocess -import gyp -import gyp.common -import gyp.xcode_emulation -from gyp.common import GetEnvironFallback - -import hashlib - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", - "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", - "PRODUCT_DIR": "$(builddir)", - "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. - "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. - "RULE_INPUT_PATH": "$(abspath $<)", - "RULE_INPUT_EXT": "$(suffix $<)", - "RULE_INPUT_NAME": "$(notdir $<)", - "CONFIGURATION_NAME": "$(BUILDTYPE)", -} - -# Make supports multiple toolsets -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - -# Request sorted dependencies in the order from dependents to dependencies. -generator_wants_sorted_dependencies = False - -# Placates pylint. -generator_additional_non_configuration_keys = [] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] -generator_filelist_paths = None - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - flavor = gyp.common.GetFlavor(params) - if flavor == "mac": - default_variables.setdefault("OS", "mac") - default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") - default_variables.setdefault( - "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - default_variables.setdefault( - "LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - - # Copy additional generator configuration data from Xcode, which is shared - # by the Mac Make generator. - import gyp.generator.xcode as xcode_generator - - global generator_additional_non_configuration_keys - generator_additional_non_configuration_keys = getattr( - xcode_generator, "generator_additional_non_configuration_keys", [] - ) - global generator_additional_path_sections - generator_additional_path_sections = getattr( - xcode_generator, "generator_additional_path_sections", [] - ) - global generator_extra_sources_for_rules - generator_extra_sources_for_rules = getattr( - xcode_generator, "generator_extra_sources_for_rules", [] - ) - COMPILABLE_EXTENSIONS.update({".m": "objc", ".mm": "objcxx"}) - else: - operating_system = flavor - if flavor == "android": - operating_system = "linux" # Keep this legacy behavior for now. - default_variables.setdefault("OS", operating_system) - if flavor == "aix": - default_variables.setdefault("SHARED_LIB_SUFFIX", ".a") - elif flavor == "zos": - default_variables.setdefault("SHARED_LIB_SUFFIX", ".x") - COMPILABLE_EXTENSIONS.update({".pli": "pli"}) - else: - default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") - default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") - default_variables.setdefault("LIB_DIR", "$(obj).$(TOOLSET)") - - -def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by - gyp).""" - generator_flags = params.get("generator_flags", {}) - android_ndk_version = generator_flags.get("android_ndk_version", None) - # Android NDK requires a strict link order. - if android_ndk_version: - global generator_wants_sorted_dependencies - generator_wants_sorted_dependencies = True - - output_dir = params["options"].generator_output or params["options"].toplevel_dir - builddir_name = generator_flags.get("output_dir", "out") - qualified_out_dir = os.path.normpath( - os.path.join(output_dir, builddir_name, "gypfiles") - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": params["options"].toplevel_dir, - "qualified_out_dir": qualified_out_dir, - } - - -# The .d checking code below uses these functions: -# wildcard, sort, foreach, shell, wordlist -# wildcard can handle spaces, the rest can't. -# Since I could find no way to make foreach work with spaces in filenames -# correctly, the .d files have spaces replaced with another character. The .d -# file for -# Chromium\ Framework.framework/foo -# is for example -# out/Release/.deps/out/Release/Chromium?Framework.framework/foo -# This is the replacement character. -SPACE_REPLACEMENT = "?" - - -LINK_COMMANDS_LINUX = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -# Due to circular dependencies between libraries :(, we wrap the -# special "figure out circular dependencies" flags around the entire -# input list during linking. -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group - -# Note: this does not handle spaces in paths -define xargs - $(1) $(word 1,$(2)) -$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2)))) -endef - -define write-to-file - @: >$(1) -$(call xargs,@printf "%s\\n" >>$(1),$(2)) -endef - -OBJ_FILE_LIST := ar-file-list - -define create_archive - rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` - $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) - $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) -endef - -define create_thin_archive - rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` - $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) - $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) -endef - -# We support two kinds of shared objects (.so): -# 1) shared_library, which is just bundling together many dependent libraries -# into a link line. -# 2) loadable_module, which is generating a module intended for dlopen(). -# -# They differ only slightly: -# In the former case, we want to package all dependent code into the .so. -# In the latter case, we want to package just the API exposed by the -# outermost module. -# This means shared_library uses --whole-archive, while loadable_module doesn't. -# (Note that --whole-archive is incompatible with the --start-group used in -# normal linking.) - -# Other shared-object link notes: -# - Set SONAME to the library filename so our binaries don't reference -# the local, absolute paths used on the link command-line. -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) -""" # noqa: E501 - -LINK_COMMANDS_MAC = """\ -quiet_cmd_alink = LIBTOOL-STATIC $@ -cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - -LINK_COMMANDS_ANDROID = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -# Note: this does not handle spaces in paths -define xargs - $(1) $(word 1,$(2)) -$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2)))) -endef - -define write-to-file - @: >$(1) -$(call xargs,@printf "%s\\n" >>$(1),$(2)) -endef - -OBJ_FILE_LIST := ar-file-list - -define create_archive - rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` - $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) - $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) -endef - -define create_thin_archive - rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` - $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) - $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) -endef - -# Due to circular dependencies between libraries :(, we wrap the -# special "figure out circular dependencies" flags around the entire -# input list during linking. -quiet_cmd_link = LINK($(TOOLSET)) $@ -quiet_cmd_link_host = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) -cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) - -# Other shared-object link notes: -# - Set SONAME to the library filename so our binaries don't reference -# the local, absolute paths used on the link command-line. -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) -quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - - -LINK_COMMANDS_AIX = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - - -LINK_COMMANDS_OS400 = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - - -LINK_COMMANDS_OS390 = """\ -quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) - -quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) - -quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) - -quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -""" # noqa: E501 - - -# Header of toplevel Makefile. -# This should go into the build tree, but it's easier to keep it here for now. -SHARED_HEADER = ( - """\ -# We borrow heavily from the kernel build setup, though we are simpler since -# we don't have Kconfig tweaking settings on us. - -# The implicit make rules have it looking for RCS files, among other things. -# We instead explicitly write all the rules we care about. -# It's even quicker (saves ~200ms) to pass -r on the command line. -MAKEFLAGS=-r - -# The source directory tree. -srcdir := %(srcdir)s -abs_srcdir := $(abspath $(srcdir)) - -# The name of the builddir. -builddir_name ?= %(builddir)s - -# The V=1 flag on command line makes us verbosely print command lines. -ifdef V - quiet= -else - quiet=quiet_ -endif - -# Specify BUILDTYPE=Release on the command line for a release build. -BUILDTYPE ?= %(default_configuration)s - -# Directory all our build output goes into. -# Note that this must be two directories beneath src/ for unit tests to pass, -# as they reach into the src/ directory for data with relative paths. -builddir ?= $(builddir_name)/$(BUILDTYPE) -abs_builddir := $(abspath $(builddir)) -depsdir := $(builddir)/.deps - -# Object output directory. -obj := $(builddir)/obj -abs_obj := $(abspath $(obj)) - -# We build up a list of every single one of the targets so we can slurp in the -# generated dependency rule Makefiles in one pass. -all_deps := - -%(make_global_settings)s - -CC.target ?= %(CC.target)s -CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) -CXX.target ?= %(CXX.target)s -CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) -LINK.target ?= %(LINK.target)s -LDFLAGS.target ?= $(LDFLAGS) -AR.target ?= $(AR) -PLI.target ?= %(PLI.target)s - -# C++ apps need to be linked with g++. -LINK ?= $(CXX.target) - -# TODO(evan): move all cross-compilation logic to gyp-time so we don't need -# to replicate this environment fallback in make as well. -CC.host ?= %(CC.host)s -CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) -CXX.host ?= %(CXX.host)s -CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) -LINK.host ?= %(LINK.host)s -LDFLAGS.host ?= $(LDFLAGS_host) -AR.host ?= %(AR.host)s -PLI.host ?= %(PLI.host)s - -# Define a dir function that can handle spaces. -# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions -# "leading spaces cannot appear in the text of the first argument as written. -# These characters can be put into the argument value by variable substitution." -empty := -space := $(empty) $(empty) - -# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces -replace_spaces = $(subst $(space),""" - + SPACE_REPLACEMENT - + """,$1) -unreplace_spaces = $(subst """ - + SPACE_REPLACEMENT - + """,$(space),$1) -dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) - -# Flags to make gcc output dependency info. Note that you need to be -# careful here to use the flags that ccache and distcc can understand. -# We write to a dep file on the side first and then rename at the end -# so we can't end up with a broken dep file. -depfile = $(depsdir)/$(call replace_spaces,$@).d -DEPFLAGS = %(makedep_args)s -MF $(depfile).raw - -# We have to fixup the deps output in a few ways. -# (1) the file output should mention the proper .o file. -# ccache or distcc lose the path to the target, so we convert a rule of -# the form: -# foobar.o: DEP1 DEP2 -# into -# path/to/foobar.o: DEP1 DEP2 -# (2) we want missing files not to cause us to fail to build. -# We want to rewrite -# foobar.o: DEP1 DEP2 \\ -# DEP3 -# to -# DEP1: -# DEP2: -# DEP3: -# so if the files are missing, they're just considered phony rules. -# We have to do some pretty insane escaping to get those backslashes -# and dollar signs past make, the shell, and sed at the same time. -# Doesn't work with spaces, but that's fine: .d files have spaces in -# their names replaced with other characters.""" - r""" -define fixup_dep -# The depfile may not exist if the input file didn't have any #includes. -touch $(depfile).raw -# Fixup path as in (1). -sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) -# Add extra rules as in (2). -# We remove slashes and replace spaces with new lines; -# remove blank lines; -# delete the first line and append a colon to the remaining lines. -sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ - grep -v '^$$' |\ - sed -e 1d -e 's|$$|:|' \ - >> $(depfile) -rm $(depfile).raw -endef -""" - """ -# Command definitions: -# - cmd_foo is the actual command to run; -# - quiet_cmd_foo is the brief-output summary of the command. - -quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c - -quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -%(extra_commands)s -quiet_cmd_touch = TOUCH $@ -cmd_touch = touch $@ - -quiet_cmd_copy = COPY $@ -# send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") - -quiet_cmd_symlink = SYMLINK $@ -cmd_symlink = ln -sf "$<" "$@" - -%(link_commands)s -""" # noqa: E501 - r""" -# Define an escape_quotes function to escape single quotes. -# This allows us to handle quotes properly as long as we always use -# use single quotes and escape_quotes. -escape_quotes = $(subst ','\'',$(1)) -# This comment is here just to include a ' to unconfuse syntax highlighting. -# Define an escape_vars function to escape '$' variable syntax. -# This allows us to read/write command lines with shell variables (e.g. -# $LD_LIBRARY_PATH), without triggering make substitution. -escape_vars = $(subst $$,$$$$,$(1)) -# Helper that expands to a shell command to echo a string exactly as it is in -# make. This uses printf instead of echo because printf's behaviour with respect -# to escape sequences is more portable than echo's across different shells -# (e.g., dash, bash). -exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))' -""" - """ -# Helper to compare the command we're about to run against the command -# we logged the last time we ran the command. Produces an empty -# string (false) when the commands match. -# Tricky point: Make has no string-equality test function. -# The kernel uses the following, but it seems like it would have false -# positives, where one string reordered its arguments. -# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\ -# $(filter-out $(cmd_$@), $(cmd_$(1)))) -# We instead substitute each for the empty string into the other, and -# say they're equal if both substitutions produce the empty string. -# .d files contain """ - + SPACE_REPLACEMENT - + """ instead of spaces, take that into account. -command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\ - $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) - -# Helper that is non-empty when a prerequisite changes. -# Normally make does this implicitly, but we force rules to always run -# so we can check their command lines. -# $? -- new prerequisites -# $| -- order-only dependencies -prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) - -# Helper that executes all postbuilds until one fails. -define do_postbuilds - @E=0;\\ - for p in $(POSTBUILDS); do\\ - eval $$p;\\ - E=$$?;\\ - if [ $$E -ne 0 ]; then\\ - break;\\ - fi;\\ - done;\\ - if [ $$E -ne 0 ]; then\\ - rm -rf "$@";\\ - exit $$E;\\ - fi -endef - -# do_cmd: run a command via the above cmd_foo names, if necessary. -# Should always run for a given target to handle command-line changes. -# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. -# Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains """ - + SPACE_REPLACEMENT - + """ for -# spaces already and dirx strips the """ - + SPACE_REPLACEMENT - + """ characters. -define do_cmd -$(if $(or $(command_changed),$(prereq_changed)), - @$(call exact_echo, $($(quiet)cmd_$(1))) - @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" - $(if $(findstring flock,$(word %(flock_index)d,$(cmd_$1))), - @$(cmd_$(1)) - @echo " $(quiet_cmd_$(1)): Finished", - @$(cmd_$(1)) - ) - @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) - @$(if $(2),$(fixup_dep)) - $(if $(and $(3), $(POSTBUILDS)), - $(call do_postbuilds) - ) -) -endef - -# Declare the "%(default_target)s" target first so it is the default, -# even though we don't have the deps yet. -.PHONY: %(default_target)s -%(default_target)s: - -# make looks for ways to re-generate included makefiles, but in our case, we -# don't have a direct way. Explicitly telling make that it has nothing to do -# for them makes it go faster. -%%.d: ; - -# Use FORCE_DO_CMD to force a target to run. Should be coupled with -# do_cmd. -.PHONY: FORCE_DO_CMD -FORCE_DO_CMD: - -""" # noqa: E501 -) - -SHARED_HEADER_MAC_COMMANDS = """ -quiet_cmd_objc = CXX($(TOOLSET)) $@ -cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< - -quiet_cmd_objcxx = CXX($(TOOLSET)) $@ -cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# Commands for precompiled header files. -quiet_cmd_pch_c = CXX($(TOOLSET)) $@ -cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ -cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< -quiet_cmd_pch_m = CXX($(TOOLSET)) $@ -cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< -quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ -cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< - -# gyp-mac-tool is written next to the root Makefile by gyp. -# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd -# already. -quiet_cmd_mac_tool = MACTOOL $(4) $< -cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" - -quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ -cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) - -quiet_cmd_infoplist = INFOPLIST $@ -cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" -""" # noqa: E501 - - -def WriteRootHeaderSuffixRules(writer): - extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) - - writer.write("# Suffix rules, putting all outputs into $(obj).\n") - for ext in extensions: - writer.write("$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n" % ext) - writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) - - writer.write("\n# Try building from generated source, too.\n") - for ext in extensions: - writer.write( - "$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n" % ext - ) - writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) - writer.write("\n") - for ext in extensions: - writer.write("$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n" % ext) - writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) - writer.write("\n") - - -SHARED_HEADER_OS390_COMMANDS = """ -PLIFLAGS.target ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS) -PLIFLAGS.host ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS) - -quiet_cmd_pli = PLI($(TOOLSET)) $@ -cmd_pli = $(PLI.$(TOOLSET)) $(GYP_PLIFLAGS) $(PLIFLAGS.$(TOOLSET)) -c $< && \ - if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi -""" - -SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\ -# Suffix rules, putting all outputs into $(obj). -""" - - -SHARED_HEADER_SUFFIX_RULES_COMMENT2 = """\ -# Try building from generated source, too. -""" - - -SHARED_FOOTER = """\ -# "all" is a concatenation of the "all" targets from all the included -# sub-makefiles. This is just here to clarify. -all: - -# Add in dependency-tracking rules. $(all_deps) is the list of every single -# target in our tree. Only consider the ones with .d (dependency) info: -d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) -ifneq ($(d_files),) - include $(d_files) -endif -""" - -header = """\ -# This file is generated by gyp; do not edit. - -""" - -# Maps every compilable file extension to the do_cmd that compiles it. -COMPILABLE_EXTENSIONS = { - ".c": "cc", - ".cc": "cxx", - ".cpp": "cxx", - ".cxx": "cxx", - ".s": "cc", - ".S": "cc", -} - - -def Compilable(filename): - """Return true if the file is compilable (should be in OBJS).""" - for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): - if res: - return True - return False - - -def Linkable(filename): - """Return true if the file is linkable (should be on the link line).""" - return filename.endswith(".o") - - -def Target(filename): - """Translate a compilable filename to its .o target.""" - return os.path.splitext(filename)[0] + ".o" - - -def EscapeShellArgument(s): - """Quotes an argument so that it will be interpreted literally by a POSIX - shell. Taken from - http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python - """ - return "'" + s.replace("'", "'\\''") + "'" - - -def EscapeMakeVariableExpansion(s): - """Make has its own variable expansion syntax using $. We must escape it for - string to be interpreted literally.""" - return s.replace("$", "$$") - - -def EscapeCppDefine(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = EscapeShellArgument(s) - s = EscapeMakeVariableExpansion(s) - # '#' characters must be escaped even embedded in a string, else Make will - # treat it as the start of a comment. - return s.replace("#", r"\#") - - -def QuoteIfNecessary(string): - """TODO: Should this ideally be replaced with one or more of the above - functions?""" - if '"' in string: - string = '"' + string.replace('"', '\\"') + '"' - return string - - -def StringToMakefileVariable(string): - """Convert a string to a value that is acceptable as a make variable name.""" - return re.sub("[^a-zA-Z0-9_]", "_", string) - - -srcdir_prefix = "" - - -def Sourceify(path): - """Convert a path to its source directory form.""" - if "$(" in path: - return path - if os.path.isabs(path): - return path - return srcdir_prefix + path - - -def QuoteSpaces(s, quote=r"\ "): - return s.replace(" ", quote) - - -def SourceifyAndQuoteSpaces(path): - """Convert a path to its source directory form and quote spaces.""" - return QuoteSpaces(Sourceify(path)) - - -# Map from qualified target to path to output. -target_outputs = {} -# Map from qualified target to any linkable output. A subset -# of target_outputs. E.g. when mybinary depends on liba, we want to -# include liba in the linker line; when otherbinary depends on -# mybinary, we just want to build mybinary first. -target_link_deps = {} - - -class MakefileWriter: - """MakefileWriter packages up the writing of one target-specific foobar.mk. - - Its only real entry point is Write(), and is mostly used for namespacing. - """ - - def __init__(self, generator_flags, flavor): - self.generator_flags = generator_flags - self.flavor = flavor - - self.suffix_rules_srcdir = {} - self.suffix_rules_objdir1 = {} - self.suffix_rules_objdir2 = {} - - # Generate suffix rules for all compilable extensions. - for ext in COMPILABLE_EXTENSIONS.keys(): - # Suffix rules for source folder. - self.suffix_rules_srcdir.update( - { - ext: ( - """\ -$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD -\t@$(call do_cmd,%s,1) -""" - % (ext, COMPILABLE_EXTENSIONS[ext]) - ) - } - ) - - # Suffix rules for generated source files. - self.suffix_rules_objdir1.update( - { - ext: ( - """\ -$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD -\t@$(call do_cmd,%s,1) -""" - % (ext, COMPILABLE_EXTENSIONS[ext]) - ) - } - ) - self.suffix_rules_objdir2.update( - { - ext: ( - """\ -$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD -\t@$(call do_cmd,%s,1) -""" - % (ext, COMPILABLE_EXTENSIONS[ext]) - ) - } - ) - - def Write( - self, qualified_target, base_path, output_filename, spec, configs, part_of_all - ): - """The main entry point: writes a .mk file for a single target. - - Arguments: - qualified_target: target we're generating - base_path: path relative to source root we're building in, used to resolve - target-relative paths - output_filename: output .mk file name to write - spec, configs: gyp info - part_of_all: flag indicating this target is part of 'all' - """ - gyp.common.EnsureDirExists(output_filename) - - self.fp = open(output_filename, "w") - - self.fp.write(header) - - self.qualified_target = qualified_target - self.path = base_path - self.target = spec["target_name"] - self.type = spec["type"] - self.toolset = spec["toolset"] - - self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) - if self.flavor == "mac": - self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - else: - self.xcode_settings = None - - deps, link_deps = self.ComputeDeps(spec) - - # Some of the generation below can add extra output, sources, or - # link dependencies. All of the out params of the functions that - # follow use names like extra_foo. - extra_outputs = [] - extra_sources = [] - extra_link_deps = [] - extra_mac_bundle_resources = [] - mac_bundle_deps = [] - - if self.is_mac_bundle: - self.output = self.ComputeMacBundleOutput(spec) - self.output_binary = self.ComputeMacBundleBinaryOutput(spec) - else: - self.output = self.output_binary = self.ComputeOutput(spec) - - self.is_standalone_static_library = bool( - spec.get("standalone_static_library", 0) - ) - self._INSTALLABLE_TARGETS = ("executable", "loadable_module", "shared_library") - if self.is_standalone_static_library or self.type in self._INSTALLABLE_TARGETS: - self.alias = os.path.basename(self.output) - install_path = self._InstallableTargetInstallPath() - else: - self.alias = self.output - install_path = self.output - - self.WriteLn("TOOLSET := " + self.toolset) - self.WriteLn("TARGET := " + self.target) - - # Actions must come first, since they can generate more OBJs for use below. - if "actions" in spec: - self.WriteActions( - spec["actions"], - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ) - - # Rules must be early like actions. - if "rules" in spec: - self.WriteRules( - spec["rules"], - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ) - - if "copies" in spec: - self.WriteCopies(spec["copies"], extra_outputs, part_of_all) - - # Bundle resources. - if self.is_mac_bundle: - all_mac_bundle_resources = ( - spec.get("mac_bundle_resources", []) + extra_mac_bundle_resources - ) - self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) - self.WriteMacInfoPlist(mac_bundle_deps) - - # Sources. - all_sources = spec.get("sources", []) + extra_sources - if all_sources: - self.WriteSources( - configs, - deps, - all_sources, - extra_outputs, - extra_link_deps, - part_of_all, - gyp.xcode_emulation.MacPrefixHeader( - self.xcode_settings, - lambda p: Sourceify(self.Absolutify(p)), - self.Pchify, - ), - ) - sources = [x for x in all_sources if Compilable(x)] - if sources: - self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) - extensions = {os.path.splitext(s)[1] for s in sources} - for ext in extensions: - if ext in self.suffix_rules_srcdir: - self.WriteLn(self.suffix_rules_srcdir[ext]) - self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) - for ext in extensions: - if ext in self.suffix_rules_objdir1: - self.WriteLn(self.suffix_rules_objdir1[ext]) - for ext in extensions: - if ext in self.suffix_rules_objdir2: - self.WriteLn(self.suffix_rules_objdir2[ext]) - self.WriteLn("# End of this set of suffix rules") - - # Add dependency from bundle to bundle binary. - if self.is_mac_bundle: - mac_bundle_deps.append(self.output_binary) - - self.WriteTarget( - spec, - configs, - deps, - extra_link_deps + link_deps, - mac_bundle_deps, - extra_outputs, - part_of_all, - ) - - # Update global list of target outputs, used in dependency tracking. - target_outputs[qualified_target] = install_path - - # Update global list of link dependencies. - if self.type in ("static_library", "shared_library"): - target_link_deps[qualified_target] = self.output_binary - - # Currently any versions have the same effect, but in future the behavior - # could be different. - if self.generator_flags.get("android_ndk_version", None): - self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) - - self.fp.close() - - def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): - """Write a "sub-project" Makefile. - - This is a small, wrapper Makefile that calls the top-level Makefile to build - the targets from a single gyp file (i.e. a sub-project). - - Arguments: - output_filename: sub-project Makefile name to write - makefile_path: path to the top-level Makefile - targets: list of "all" targets for this sub-project - build_dir: build output directory, relative to the sub-project - """ - gyp.common.EnsureDirExists(output_filename) - self.fp = open(output_filename, "w") - self.fp.write(header) - # For consistency with other builders, put sub-project build output in the - # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). - self.WriteLn( - "export builddir_name ?= %s" - % os.path.join(os.path.dirname(output_filename), build_dir) - ) - self.WriteLn(".PHONY: all") - self.WriteLn("all:") - if makefile_path: - makefile_path = " -C " + makefile_path - self.WriteLn("\t$(MAKE){} {}".format(makefile_path, " ".join(targets))) - self.fp.close() - - def WriteActions( - self, - actions, - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ): - """Write Makefile code for any 'actions' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - actions (used to make other pieces dependent on these - actions) - part_of_all: flag indicating this target is part of 'all' - """ - env = self.GetSortedXcodeEnv() - for action in actions: - name = StringToMakefileVariable( - "{}_{}".format(self.qualified_target, action["action_name"]) - ) - self.WriteLn('### Rules for action "%s":' % action["action_name"]) - inputs = action["inputs"] - outputs = action["outputs"] - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set() - for out in outputs: - dir = os.path.split(out)[0] - if dir: - dirs.add(dir) - if int(action.get("process_outputs_as_sources", False)): - extra_sources += outputs - if int(action.get("process_outputs_as_mac_bundle_resources", False)): - extra_mac_bundle_resources += outputs - - # Write the actual command. - action_commands = action["action"] - if self.flavor == "mac": - action_commands = [ - gyp.xcode_emulation.ExpandEnvVars(command, env) - for command in action_commands - ] - command = gyp.common.EncodePOSIXShellList(action_commands) - if "message" in action: - self.WriteLn( - "quiet_cmd_{} = ACTION {} $@".format(name, action["message"]) - ) - else: - self.WriteLn(f"quiet_cmd_{name} = ACTION {name} $@") - if len(dirs) > 0: - command = "mkdir -p %s" % " ".join(dirs) + "; " + command - - cd_action = "cd %s; " % Sourceify(self.path or ".") - - # command and cd_action get written to a toplevel variable called - # cmd_foo. Toplevel variables can't handle things that change per - # makefile like $(TARGET), so hardcode the target. - command = command.replace("$(TARGET)", self.target) - cd_action = cd_action.replace("$(TARGET)", self.target) - - # Set LD_LIBRARY_PATH in case the action runs an executable from this - # build which links to shared libs from this build. - # actions run on the host, so they should in theory only use host - # libraries, but until everything is made cross-compile safe, also use - # target libraries. - # TODO(piman): when everything is cross-compile safe, remove lib.target - if self.flavor == "zos" or self.flavor == "aix": - self.WriteLn( - "cmd_%s = LIBPATH=$(builddir)/lib.host:" - "$(builddir)/lib.target:$$LIBPATH; " - "export LIBPATH; " - "%s%s" % (name, cd_action, command) - ) - else: - self.WriteLn( - "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" - "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " - "export LD_LIBRARY_PATH; " - "%s%s" % (name, cd_action, command) - ) - self.WriteLn() - outputs = [self.Absolutify(o) for o in outputs] - # The makefile rules are all relative to the top dir, but the gyp actions - # are defined relative to their containing dir. This replaces the obj - # variable for the action rule with an absolute version so that the output - # goes in the right place. - # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); - # it's superfluous for the "extra outputs", and this avoids accidentally - # writing duplicate dummy rules for those outputs. - # Same for environment. - self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) - self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) - self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) - - for input in inputs: - assert " " not in input, ( - "Spaces in action input filenames not supported (%s)" % input - ) - for output in outputs: - assert " " not in output, ( - "Spaces in action output filenames not supported (%s)" % output - ) - - # See the comment in WriteCopies about expanding env vars. - outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] - inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] - - self.WriteDoCmd( - outputs, - [Sourceify(self.Absolutify(i)) for i in inputs], - part_of_all=part_of_all, - command=name, - ) - - # Stuff the outputs in a variable so we can refer to them later. - outputs_variable = "action_%s_outputs" % name - self.WriteLn("{} := {}".format(outputs_variable, " ".join(outputs))) - extra_outputs.append("$(%s)" % outputs_variable) - self.WriteLn() - - self.WriteLn() - - def WriteRules( - self, - rules, - extra_sources, - extra_outputs, - extra_mac_bundle_resources, - part_of_all, - ): - """Write Makefile code for any 'rules' from the gyp input. - - extra_sources: a list that will be filled in with newly generated source - files, if any - extra_outputs: a list that will be filled in with any outputs of these - rules (used to make other pieces dependent on these rules) - part_of_all: flag indicating this target is part of 'all' - """ - env = self.GetSortedXcodeEnv() - for rule in rules: - name = StringToMakefileVariable( - "{}_{}".format(self.qualified_target, rule["rule_name"]) - ) - count = 0 - self.WriteLn("### Generated for rule %s:" % name) - - all_outputs = [] - - for rule_source in rule.get("rule_sources", []): - dirs = set() - (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = os.path.splitext( - rule_source_basename - ) - - outputs = [ - self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) - for out in rule["outputs"] - ] - - for out in outputs: - dir = os.path.dirname(out) - if dir: - dirs.add(dir) - if int(rule.get("process_outputs_as_sources", False)): - extra_sources += outputs - if int(rule.get("process_outputs_as_mac_bundle_resources", False)): - extra_mac_bundle_resources += outputs - inputs = [ - Sourceify(self.Absolutify(i)) - for i in [rule_source] + rule.get("inputs", []) - ] - actions = ["$(call do_cmd,%s_%d)" % (name, count)] - - if name == "resources_grit": - # HACK: This is ugly. Grit intentionally doesn't touch the - # timestamp of its output file when the file doesn't change, - # which is fine in hash-based dependency systems like scons - # and forge, but not kosher in the make world. After some - # discussion, hacking around it here seems like the least - # amount of pain. - actions += ["@touch --no-create $@"] - - # See the comment in WriteCopies about expanding env vars. - outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] - inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] - - outputs = [self.Absolutify(o) for o in outputs] - all_outputs += outputs - # Only write the 'obj' and 'builddir' rules for the "primary" output - # (:1); it's superfluous for the "extra outputs", and this avoids - # accidentally writing duplicate dummy rules for those outputs. - self.WriteLn("%s: obj := $(abs_obj)" % outputs[0]) - self.WriteLn("%s: builddir := $(abs_builddir)" % outputs[0]) - self.WriteMakeRule( - outputs, inputs, actions, command="%s_%d" % (name, count) - ) - # Spaces in rule filenames are not supported, but rule variables have - # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). - # The spaces within the variables are valid, so remove the variables - # before checking. - variables_with_spaces = re.compile(r"\$\([^ ]* \$<\)") - for output in outputs: - output = re.sub(variables_with_spaces, "", output) - assert " " not in output, ( - "Spaces in rule filenames not yet supported (%s)" % output - ) - self.WriteLn("all_deps += %s" % " ".join(outputs)) - - action = [ - self.ExpandInputRoot(ac, rule_source_root, rule_source_dirname) - for ac in rule["action"] - ] - mkdirs = "" - if len(dirs) > 0: - mkdirs = "mkdir -p %s; " % " ".join(dirs) - cd_action = "cd %s; " % Sourceify(self.path or ".") - - # action, cd_action, and mkdirs get written to a toplevel variable - # called cmd_foo. Toplevel variables can't handle things that change - # per makefile like $(TARGET), so hardcode the target. - if self.flavor == "mac": - action = [ - gyp.xcode_emulation.ExpandEnvVars(command, env) - for command in action - ] - action = gyp.common.EncodePOSIXShellList(action) - action = action.replace("$(TARGET)", self.target) - cd_action = cd_action.replace("$(TARGET)", self.target) - mkdirs = mkdirs.replace("$(TARGET)", self.target) - - # Set LD_LIBRARY_PATH in case the rule runs an executable from this - # build which links to shared libs from this build. - # rules run on the host, so they should in theory only use host - # libraries, but until everything is made cross-compile safe, also use - # target libraries. - # TODO(piman): when everything is cross-compile safe, remove lib.target - self.WriteLn( - "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" - "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " - "export LD_LIBRARY_PATH; " - "%(cd_action)s%(mkdirs)s%(action)s" - % { - "action": action, - "cd_action": cd_action, - "count": count, - "mkdirs": mkdirs, - "name": name, - } - ) - self.WriteLn( - "quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@" - % {"count": count, "name": name} - ) - self.WriteLn() - count += 1 - - outputs_variable = "rule_%s_outputs" % name - self.WriteList(all_outputs, outputs_variable) - extra_outputs.append("$(%s)" % outputs_variable) - - self.WriteLn("### Finished generating for rule: %s" % name) - self.WriteLn() - self.WriteLn("### Finished generating for all rules") - self.WriteLn("") - - def WriteCopies(self, copies, extra_outputs, part_of_all): - """Write Makefile code for any 'copies' from the gyp input. - - extra_outputs: a list that will be filled in with any outputs of this action - (used to make other pieces dependent on this action) - part_of_all: flag indicating this target is part of 'all' - """ - self.WriteLn("### Generated for copy rule.") - - variable = StringToMakefileVariable(self.qualified_target + "_copies") - outputs = [] - for copy in copies: - for path in copy["files"]: - # Absolutify() may call normpath, and will strip trailing slashes. - path = Sourceify(self.Absolutify(path)) - filename = os.path.split(path)[1] - output = Sourceify( - self.Absolutify(os.path.join(copy["destination"], filename)) - ) - - # If the output path has variables in it, which happens in practice for - # 'copies', writing the environment as target-local doesn't work, - # because the variables are already needed for the target name. - # Copying the environment variables into global make variables doesn't - # work either, because then the .d files will potentially contain spaces - # after variable expansion, and .d file handling cannot handle spaces. - # As a workaround, manually expand variables at gyp time. Since 'copies' - # can't run scripts, there's no need to write the env then. - # WriteDoCmd() will escape spaces for .d files. - env = self.GetSortedXcodeEnv() - output = gyp.xcode_emulation.ExpandEnvVars(output, env) - path = gyp.xcode_emulation.ExpandEnvVars(path, env) - self.WriteDoCmd([output], [path], "copy", part_of_all) - outputs.append(output) - self.WriteLn( - "{} = {}".format(variable, " ".join(QuoteSpaces(o) for o in outputs)) - ) - extra_outputs.append("$(%s)" % variable) - self.WriteLn() - - def WriteMacBundleResources(self, resources, bundle_deps): - """Writes Makefile code for 'mac_bundle_resources'.""" - self.WriteLn("### Generated for mac_bundle_resources") - - for output, res in gyp.xcode_emulation.GetMacBundleResources( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - [Sourceify(self.Absolutify(r)) for r in resources], - ): - _, ext = os.path.splitext(output) - if ext != ".xcassets": - # Make does not supports '.xcassets' emulation. - self.WriteDoCmd( - [output], [res], "mac_tool,,,copy-bundle-resource", part_of_all=True - ) - bundle_deps.append(output) - - def WriteMacInfoPlist(self, bundle_deps): - """Write Makefile code for bundle Info.plist files.""" - info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - lambda p: Sourceify(self.Absolutify(p)), - ) - if not info_plist: - return - if defines: - # Create an intermediate file to store preprocessed results. - intermediate_plist = "$(obj).$(TOOLSET)/$(TARGET)/" + os.path.basename( - info_plist - ) - self.WriteList( - defines, - intermediate_plist + ": INFOPLIST_DEFINES", - "-D", - quoter=EscapeCppDefine, - ) - self.WriteMakeRule( - [intermediate_plist], - [info_plist], - [ - "$(call do_cmd,infoplist)", - # "Convert" the plist so that any weird whitespace changes from the - # preprocessor do not affect the XML parser in mac_tool. - "@plutil -convert xml1 $@ $@", - ], - ) - info_plist = intermediate_plist - # plists can contain envvars and substitute them into the file. - self.WriteSortedXcodeEnv( - out, self.GetSortedXcodeEnv(additional_settings=extra_env) - ) - self.WriteDoCmd( - [out], [info_plist], "mac_tool,,,copy-info-plist", part_of_all=True - ) - bundle_deps.append(out) - - def WriteSources( - self, - configs, - deps, - sources, - extra_outputs, - extra_link_deps, - part_of_all, - precompiled_header, - ): - """Write Makefile code for any 'sources' from the gyp input. - These are source files necessary to build the current target. - - configs, deps, sources: input from gyp. - extra_outputs: a list of extra outputs this action should be dependent on; - used to serialize action/rules before compilation - extra_link_deps: a list that will be filled in with any outputs of - compilation (to be used in link lines) - part_of_all: flag indicating this target is part of 'all' - """ - - # Write configuration-specific variables for CFLAGS, etc. - for configname in sorted(configs.keys()): - config = configs[configname] - self.WriteList( - config.get("defines"), - "DEFS_%s" % configname, - prefix="-D", - quoter=EscapeCppDefine, - ) - - if self.flavor == "mac": - cflags = self.xcode_settings.GetCflags( - configname, arch=config.get("xcode_configuration_platform") - ) - cflags_c = self.xcode_settings.GetCflagsC(configname) - cflags_cc = self.xcode_settings.GetCflagsCC(configname) - cflags_objc = self.xcode_settings.GetCflagsObjC(configname) - cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) - else: - cflags = config.get("cflags") - cflags_c = config.get("cflags_c") - cflags_cc = config.get("cflags_cc") - - self.WriteLn("# Flags passed to all source files.") - self.WriteList(cflags, "CFLAGS_%s" % configname) - self.WriteLn("# Flags passed to only C files.") - self.WriteList(cflags_c, "CFLAGS_C_%s" % configname) - self.WriteLn("# Flags passed to only C++ files.") - self.WriteList(cflags_cc, "CFLAGS_CC_%s" % configname) - if self.flavor == "mac": - self.WriteLn("# Flags passed to only ObjC files.") - self.WriteList(cflags_objc, "CFLAGS_OBJC_%s" % configname) - self.WriteLn("# Flags passed to only ObjC++ files.") - self.WriteList(cflags_objcc, "CFLAGS_OBJCC_%s" % configname) - includes = config.get("include_dirs") - if includes: - includes = [Sourceify(self.Absolutify(i)) for i in includes] - self.WriteList(includes, "INCS_%s" % configname, prefix="-I") - - compilable = list(filter(Compilable, sources)) - objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable] - self.WriteList(objs, "OBJS") - - for obj in objs: - assert " " not in obj, "Spaces in object filenames not supported (%s)" % obj - self.WriteLn( - "# Add to the list of files we specially track " "dependencies for." - ) - self.WriteLn("all_deps += $(OBJS)") - self.WriteLn() - - # Make sure our dependencies are built first. - if deps: - self.WriteMakeRule( - ["$(OBJS)"], - deps, - comment="Make sure our dependencies are built " "before any of us.", - order_only=True, - ) - - # Make sure the actions and rules run first. - # If they generate any extra headers etc., the per-.o file dep tracking - # will catch the proper rebuilds, so order only is still ok here. - if extra_outputs: - self.WriteMakeRule( - ["$(OBJS)"], - extra_outputs, - comment="Make sure our actions/rules run " "before any of us.", - order_only=True, - ) - - pchdeps = precompiled_header.GetObjDependencies(compilable, objs) - if pchdeps: - self.WriteLn("# Dependencies from obj files to their precompiled headers") - for source, obj, gch in pchdeps: - self.WriteLn(f"{obj}: {gch}") - self.WriteLn("# End precompiled header dependencies") - - if objs: - extra_link_deps.append("$(OBJS)") - self.WriteLn( - """\ -# CFLAGS et al overrides must be target-local. -# See "Target-specific Variable Values" in the GNU Make manual.""" - ) - self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") - self.WriteLn( - "$(OBJS): GYP_CFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("c") + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_C_$(BUILDTYPE))" - ) - self.WriteLn( - "$(OBJS): GYP_CXXFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("cc") + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_CC_$(BUILDTYPE))" - ) - if self.flavor == "mac": - self.WriteLn( - "$(OBJS): GYP_OBJCFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("m") - + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_C_$(BUILDTYPE)) " - "$(CFLAGS_OBJC_$(BUILDTYPE))" - ) - self.WriteLn( - "$(OBJS): GYP_OBJCXXFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude("mm") - + "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_CC_$(BUILDTYPE)) " - "$(CFLAGS_OBJCC_$(BUILDTYPE))" - ) - - self.WritePchTargets(precompiled_header.GetPchBuildCommands()) - - # If there are any object files in our input file list, link them into our - # output. - extra_link_deps += [source for source in sources if Linkable(source)] - - self.WriteLn() - - def WritePchTargets(self, pch_commands): - """Writes make rules to compile prefix headers.""" - if not pch_commands: - return - - for gch, lang_flag, lang, input in pch_commands: - extra_flags = { - "c": "$(CFLAGS_C_$(BUILDTYPE))", - "cc": "$(CFLAGS_CC_$(BUILDTYPE))", - "m": "$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))", - "mm": "$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))", - }[lang] - var_name = { - "c": "GYP_PCH_CFLAGS", - "cc": "GYP_PCH_CXXFLAGS", - "m": "GYP_PCH_OBJCFLAGS", - "mm": "GYP_PCH_OBJCXXFLAGS", - }[lang] - self.WriteLn( - f"{gch}: {var_name} := {lang_flag} " + "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "$(CFLAGS_$(BUILDTYPE)) " + extra_flags - ) - - self.WriteLn(f"{gch}: {input} FORCE_DO_CMD") - self.WriteLn("\t@$(call do_cmd,pch_%s,1)" % lang) - self.WriteLn("") - assert " " not in gch, "Spaces in gch filenames not supported (%s)" % gch - self.WriteLn("all_deps += %s" % gch) - self.WriteLn("") - - def ComputeOutputBasename(self, spec): - """Return the 'output basename' of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - 'libfoobar.so' - """ - assert not self.is_mac_bundle - - if self.flavor == "mac" and self.type in ( - "static_library", - "executable", - "shared_library", - "loadable_module", - ): - return self.xcode_settings.GetExecutablePath() - - target = spec["target_name"] - target_prefix = "" - target_ext = "" - if self.type == "static_library": - if target[:3] == "lib": - target = target[3:] - target_prefix = "lib" - target_ext = ".a" - elif self.type in ("loadable_module", "shared_library"): - if target[:3] == "lib": - target = target[3:] - target_prefix = "lib" - if self.flavor == "aix": - target_ext = ".a" - elif self.flavor == "zos": - target_ext = ".x" - else: - target_ext = ".so" - elif self.type == "none": - target = "%s.stamp" % target - elif self.type != "executable": - print( - "ERROR: What output file should be generated?", - "type", - self.type, - "target", - target, - ) - - target_prefix = spec.get("product_prefix", target_prefix) - target = spec.get("product_name", target) - product_ext = spec.get("product_extension") - if product_ext: - target_ext = "." + product_ext - - return target_prefix + target + target_ext - - def _InstallImmediately(self): - return ( - self.toolset == "target" - and self.flavor == "mac" - and self.type - in ("static_library", "executable", "shared_library", "loadable_module") - ) - - def ComputeOutput(self, spec): - """Return the 'output' (full output path) of a gyp spec. - - E.g., the loadable module 'foobar' in directory 'baz' will produce - '$(obj)/baz/libfoobar.so' - """ - assert not self.is_mac_bundle - - path = os.path.join("$(obj)." + self.toolset, self.path) - if self.type == "executable" or self._InstallImmediately(): - path = "$(builddir)" - path = spec.get("product_dir", path) - return os.path.join(path, self.ComputeOutputBasename(spec)) - - def ComputeMacBundleOutput(self, spec): - """Return the 'output' (full output path) to a bundle output directory.""" - assert self.is_mac_bundle - path = generator_default_variables["PRODUCT_DIR"] - return os.path.join(path, self.xcode_settings.GetWrapperName()) - - def ComputeMacBundleBinaryOutput(self, spec): - """Return the 'output' (full output path) to the binary in a bundle.""" - path = generator_default_variables["PRODUCT_DIR"] - return os.path.join(path, self.xcode_settings.GetExecutablePath()) - - def ComputeDeps(self, spec): - """Compute the dependencies of a gyp spec. - - Returns a tuple (deps, link_deps), where each is a list of - filenames that will need to be put in front of make for either - building (deps) or linking (link_deps). - """ - deps = [] - link_deps = [] - if "dependencies" in spec: - deps.extend( - [ - target_outputs[dep] - for dep in spec["dependencies"] - if target_outputs[dep] - ] - ) - for dep in spec["dependencies"]: - if dep in target_link_deps: - link_deps.append(target_link_deps[dep]) - deps.extend(link_deps) - # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? - # This hack makes it work: - # link_deps.extend(spec.get('libraries', [])) - return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) - - def GetSharedObjectFromSidedeck(self, sidedeck): - """Return the shared object files based on sidedeck""" - return re.sub(r"\.x$", ".so", sidedeck) - - def GetUnversionedSidedeckFromSidedeck(self, sidedeck): - """Return the shared object files based on sidedeck""" - return re.sub(r"\.\d+\.x$", ".x", sidedeck) - - def WriteDependencyOnExtraOutputs(self, target, extra_outputs): - self.WriteMakeRule( - [self.output_binary], - extra_outputs, - comment="Build our special outputs first.", - order_only=True, - ) - - def WriteTarget( - self, spec, configs, deps, link_deps, bundle_deps, extra_outputs, part_of_all - ): - """Write Makefile code to produce the final target of the gyp spec. - - spec, configs: input from gyp. - deps, link_deps: dependency lists; see ComputeDeps() - extra_outputs: any extra outputs that our target should depend on - part_of_all: flag indicating this target is part of 'all' - """ - - self.WriteLn("### Rules for final target.") - - if extra_outputs: - self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) - self.WriteMakeRule( - extra_outputs, - deps, - comment=("Preserve order dependency of " "special output on deps."), - order_only=True, - ) - - target_postbuilds = {} - if self.type != "none": - for configname in sorted(configs.keys()): - config = configs[configname] - if self.flavor == "mac": - ldflags = self.xcode_settings.GetLdflags( - configname, - generator_default_variables["PRODUCT_DIR"], - lambda p: Sourceify(self.Absolutify(p)), - arch=config.get("xcode_configuration_platform"), - ) - - # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. - gyp_to_build = gyp.common.InvertRelativePath(self.path) - target_postbuild = self.xcode_settings.AddImplicitPostbuilds( - configname, - QuoteSpaces( - os.path.normpath(os.path.join(gyp_to_build, self.output)) - ), - QuoteSpaces( - os.path.normpath( - os.path.join(gyp_to_build, self.output_binary) - ) - ), - ) - if target_postbuild: - target_postbuilds[configname] = target_postbuild - else: - ldflags = config.get("ldflags", []) - # Compute an rpath for this output if needed. - if any(dep.endswith(".so") or ".so." in dep for dep in deps): - # We want to get the literal string "$ORIGIN" - # into the link command, so we need lots of escaping. - ldflags.append(r"-Wl,-rpath=\$$ORIGIN/") - ldflags.append(r"-Wl,-rpath-link=\$(builddir)/") - library_dirs = config.get("library_dirs", []) - ldflags += [("-L%s" % library_dir) for library_dir in library_dirs] - self.WriteList(ldflags, "LDFLAGS_%s" % configname) - if self.flavor == "mac": - self.WriteList( - self.xcode_settings.GetLibtoolflags(configname), - "LIBTOOLFLAGS_%s" % configname, - ) - libraries = spec.get("libraries") - if libraries: - # Remove duplicate entries - libraries = gyp.common.uniquer(libraries) - if self.flavor == "mac": - libraries = self.xcode_settings.AdjustLibraries(libraries) - self.WriteList(libraries, "LIBS") - self.WriteLn( - "%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))" - % QuoteSpaces(self.output_binary) - ) - self.WriteLn("%s: LIBS := $(LIBS)" % QuoteSpaces(self.output_binary)) - - if self.flavor == "mac": - self.WriteLn( - "%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))" - % QuoteSpaces(self.output_binary) - ) - - # Postbuild actions. Like actions, but implicitly depend on the target's - # output. - postbuilds = [] - if self.flavor == "mac": - if target_postbuilds: - postbuilds.append("$(TARGET_POSTBUILDS_$(BUILDTYPE))") - postbuilds.extend(gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) - - if postbuilds: - # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), - # so we must output its definition first, since we declare variables - # using ":=". - self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) - - for configname in target_postbuilds: - self.WriteLn( - "%s: TARGET_POSTBUILDS_%s := %s" - % ( - QuoteSpaces(self.output), - configname, - gyp.common.EncodePOSIXShellList(target_postbuilds[configname]), - ) - ) - - # Postbuilds expect to be run in the gyp file's directory, so insert an - # implicit postbuild to cd to there. - postbuilds.insert(0, gyp.common.EncodePOSIXShellList(["cd", self.path])) - for i, postbuild in enumerate(postbuilds): - if not postbuild.startswith("$"): - postbuilds[i] = EscapeShellArgument(postbuild) - self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(self.output)) - self.WriteLn( - "%s: POSTBUILDS := %s" - % (QuoteSpaces(self.output), " ".join(postbuilds)) - ) - - # A bundle directory depends on its dependencies such as bundle resources - # and bundle binary. When all dependencies have been built, the bundle - # needs to be packaged. - if self.is_mac_bundle: - # If the framework doesn't contain a binary, then nothing depends - # on the actions -- make the framework depend on them directly too. - self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) - - # Bundle dependencies. Note that the code below adds actions to this - # target, so if you move these two lines, move the lines below as well. - self.WriteList([QuoteSpaces(dep) for dep in bundle_deps], "BUNDLE_DEPS") - self.WriteLn("%s: $(BUNDLE_DEPS)" % QuoteSpaces(self.output)) - - # After the framework is built, package it. Needs to happen before - # postbuilds, since postbuilds depend on this. - if self.type in ("shared_library", "loadable_module"): - self.WriteLn( - "\t@$(call do_cmd,mac_package_framework,,,%s)" - % self.xcode_settings.GetFrameworkVersion() - ) - - # Bundle postbuilds can depend on the whole bundle, so run them after - # the bundle is packaged, not already after the bundle binary is done. - if postbuilds: - self.WriteLn("\t@$(call do_postbuilds)") - postbuilds = [] # Don't write postbuilds for target's output. - - # Needed by test/mac/gyptest-rebuild.py. - self.WriteLn("\t@true # No-op, used by tests") - - # Since this target depends on binary and resources which are in - # nested subfolders, the framework directory will be older than - # its dependencies usually. To prevent this rule from executing - # on every build (expensive, especially with postbuilds), expliclity - # update the time on the framework directory. - self.WriteLn("\t@touch -c %s" % QuoteSpaces(self.output)) - - if postbuilds: - assert not self.is_mac_bundle, ( - "Postbuilds for bundles should be done " - "on the bundle, not the binary (target '%s')" % self.target - ) - assert "product_dir" not in spec, ( - "Postbuilds do not work with " "custom product_dir" - ) - - if self.type == "executable": - self.WriteLn( - "%s: LD_INPUTS := %s" - % ( - QuoteSpaces(self.output_binary), - " ".join(QuoteSpaces(dep) for dep in link_deps), - ) - ) - if self.toolset == "host" and self.flavor == "android": - self.WriteDoCmd( - [self.output_binary], - link_deps, - "link_host", - part_of_all, - postbuilds=postbuilds, - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "link", - part_of_all, - postbuilds=postbuilds, - ) - - elif self.type == "static_library": - for link_dep in link_deps: - assert " " not in link_dep, ( - "Spaces in alink input filenames not supported (%s)" % link_dep - ) - if ( - self.flavor not in ("mac", "openbsd", "netbsd", "win") - and not self.is_standalone_static_library - ): - if self.flavor in ("linux", "android"): - self.WriteMakeRule( - [self.output_binary], - link_deps, - actions=["$(call create_thin_archive,$@,$^)"], - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "alink_thin", - part_of_all, - postbuilds=postbuilds, - ) - else: - if self.flavor in ("linux", "android"): - self.WriteMakeRule( - [self.output_binary], - link_deps, - actions=["$(call create_archive,$@,$^)"], - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "alink", - part_of_all, - postbuilds=postbuilds, - ) - elif self.type == "shared_library": - self.WriteLn( - "%s: LD_INPUTS := %s" - % ( - QuoteSpaces(self.output_binary), - " ".join(QuoteSpaces(dep) for dep in link_deps), - ) - ) - self.WriteDoCmd( - [self.output_binary], - link_deps, - "solink", - part_of_all, - postbuilds=postbuilds, - ) - # z/OS has a .so target as well as a sidedeck .x target - if self.flavor == "zos": - self.WriteLn( - "%s: %s" - % ( - QuoteSpaces( - self.GetSharedObjectFromSidedeck(self.output_binary) - ), - QuoteSpaces(self.output_binary), - ) - ) - elif self.type == "loadable_module": - for link_dep in link_deps: - assert " " not in link_dep, ( - "Spaces in module input filenames not supported (%s)" % link_dep - ) - if self.toolset == "host" and self.flavor == "android": - self.WriteDoCmd( - [self.output_binary], - link_deps, - "solink_module_host", - part_of_all, - postbuilds=postbuilds, - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "solink_module", - part_of_all, - postbuilds=postbuilds, - ) - elif self.type == "none": - # Write a stamp line. - self.WriteDoCmd( - [self.output_binary], deps, "touch", part_of_all, postbuilds=postbuilds - ) - else: - print("WARNING: no output for", self.type, self.target) - - # Add an alias for each target (if there are any outputs). - # Installable target aliases are created below. - if (self.output and self.output != self.target) and ( - self.type not in self._INSTALLABLE_TARGETS - ): - self.WriteMakeRule( - [self.target], [self.output], comment="Add target alias", phony=True - ) - if part_of_all: - self.WriteMakeRule( - ["all"], - [self.target], - comment='Add target alias to "all" target.', - phony=True, - ) - - # Add special-case rules for our installable targets. - # 1) They need to install to the build dir or "product" dir. - # 2) They get shortcuts for building (e.g. "make chrome"). - # 3) They are part of "make all". - if self.type in self._INSTALLABLE_TARGETS or self.is_standalone_static_library: - if self.type == "shared_library": - file_desc = "shared library" - elif self.type == "static_library": - file_desc = "static library" - else: - file_desc = "executable" - install_path = self._InstallableTargetInstallPath() - installable_deps = [] - if self.flavor != "zos": - installable_deps.append(self.output) - if ( - self.flavor == "mac" - and "product_dir" not in spec - and self.toolset == "target" - ): - # On mac, products are created in install_path immediately. - assert install_path == self.output, "{} != {}".format( - install_path, - self.output, - ) - - # Point the target alias to the final binary output. - self.WriteMakeRule( - [self.target], [install_path], comment="Add target alias", phony=True - ) - if install_path != self.output: - assert not self.is_mac_bundle # See comment a few lines above. - self.WriteDoCmd( - [install_path], - [self.output], - "copy", - comment="Copy this to the %s output path." % file_desc, - part_of_all=part_of_all, - ) - if self.flavor != "zos": - installable_deps.append(install_path) - if self.flavor == "zos" and self.type == "shared_library": - # lib.target/libnode.so has a dependency on $(obj).target/libnode.so - self.WriteDoCmd( - [self.GetSharedObjectFromSidedeck(install_path)], - [self.GetSharedObjectFromSidedeck(self.output)], - "copy", - comment="Copy this to the %s output path." % file_desc, - part_of_all=part_of_all, - ) - # Create a symlink of libnode.x to libnode.version.x - self.WriteDoCmd( - [self.GetUnversionedSidedeckFromSidedeck(install_path)], - [install_path], - "symlink", - comment="Symlnk this to the %s output path." % file_desc, - part_of_all=part_of_all, - ) - # Place libnode.version.so and libnode.x symlink in lib.target dir - installable_deps.append(self.GetSharedObjectFromSidedeck(install_path)) - installable_deps.append( - self.GetUnversionedSidedeckFromSidedeck(install_path) - ) - if self.output != self.alias and self.alias != self.target: - self.WriteMakeRule( - [self.alias], - installable_deps, - comment="Short alias for building this %s." % file_desc, - phony=True, - ) - if self.flavor == "zos" and self.type == "shared_library": - # Make sure that .x symlink target is run - self.WriteMakeRule( - ["all"], - [ - self.GetUnversionedSidedeckFromSidedeck(install_path), - self.GetSharedObjectFromSidedeck(install_path), - ], - comment='Add %s to "all" target.' % file_desc, - phony=True, - ) - elif part_of_all: - self.WriteMakeRule( - ["all"], - [install_path], - comment='Add %s to "all" target.' % file_desc, - phony=True, - ) - - def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary): - """Write a variable definition that is a list of values. - - E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out - foo = blaha blahb - but in a pretty-printed style. - """ - values = "" - if value_list: - value_list = [quoter(prefix + value) for value in value_list] - values = " \\\n\t" + " \\\n\t".join(value_list) - self.fp.write(f"{variable} :={values}\n\n") - - def WriteDoCmd( - self, outputs, inputs, command, part_of_all, comment=None, postbuilds=False - ): - """Write a Makefile rule that uses do_cmd. - - This makes the outputs dependent on the command line that was run, - as well as support the V= make command line flag. - """ - suffix = "" - if postbuilds: - assert "," not in command - suffix = ",,1" # Tell do_cmd to honor $POSTBUILDS - self.WriteMakeRule( - outputs, - inputs, - actions=[f"$(call do_cmd,{command}{suffix})"], - comment=comment, - command=command, - force=True, - ) - # Add our outputs to the list of targets we read depfiles from. - # all_deps is only used for deps file reading, and for deps files we replace - # spaces with ? because escaping doesn't work with make's $(sort) and - # other functions. - outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] - self.WriteLn("all_deps += %s" % " ".join(outputs)) - - def WriteMakeRule( - self, - outputs, - inputs, - actions=None, - comment=None, - order_only=False, - force=False, - phony=False, - command=None, - ): - """Write a Makefile rule, with some extra tricks. - - outputs: a list of outputs for the rule (note: this is not directly - supported by make; see comments below) - inputs: a list of inputs for the rule - actions: a list of shell commands to run for the rule - comment: a comment to put in the Makefile above the rule (also useful - for making this Python script's code self-documenting) - order_only: if true, makes the dependency order-only - force: if true, include FORCE_DO_CMD as an order-only dep - phony: if true, the rule does not actually generate the named output, the - output is just a name to run the rule - command: (optional) command name to generate unambiguous labels - """ - outputs = [QuoteSpaces(o) for o in outputs] - inputs = [QuoteSpaces(i) for i in inputs] - - if comment: - self.WriteLn("# " + comment) - if phony: - self.WriteLn(".PHONY: " + " ".join(outputs)) - if actions: - self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) - force_append = " FORCE_DO_CMD" if force else "" - - if order_only: - # Order only rule: Just write a simple rule. - # TODO(evanm): just make order_only a list of deps instead of this hack. - self.WriteLn( - "{}: | {}{}".format(" ".join(outputs), " ".join(inputs), force_append) - ) - elif len(outputs) == 1: - # Regular rule, one output: Just write a simple rule. - self.WriteLn("{}: {}{}".format(outputs[0], " ".join(inputs), force_append)) - else: - # Regular rule, more than one output: Multiple outputs are tricky in - # make. We will write three rules: - # - All outputs depend on an intermediate file. - # - Make .INTERMEDIATE depend on the intermediate. - # - The intermediate file depends on the inputs and executes the - # actual command. - # - The intermediate recipe will 'touch' the intermediate file. - # - The multi-output rule will have an do-nothing recipe. - - # Hash the target name to avoid generating overlong filenames. - cmddigest = hashlib.sha1( - (command or self.target).encode("utf-8") - ).hexdigest() - intermediate = "%s.intermediate" % cmddigest - self.WriteLn("{}: {}".format(" ".join(outputs), intermediate)) - self.WriteLn("\t%s" % "@:") - self.WriteLn("{}: {}".format(".INTERMEDIATE", intermediate)) - self.WriteLn( - "{}: {}{}".format(intermediate, " ".join(inputs), force_append) - ) - actions.insert(0, "$(call do_cmd,touch)") - - if actions: - for action in actions: - self.WriteLn("\t%s" % action) - self.WriteLn() - - def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): - """Write a set of LOCAL_XXX definitions for Android NDK. - - These variable definitions will be used by Android NDK but do nothing for - non-Android applications. - - Arguments: - module_name: Android NDK module name, which must be unique among all - module names. - all_sources: A list of source files (will be filtered by Compilable). - link_deps: A list of link dependencies, which must be sorted in - the order from dependencies to dependents. - """ - if self.type not in ("executable", "shared_library", "static_library"): - return - - self.WriteLn("# Variable definitions for Android applications") - self.WriteLn("include $(CLEAR_VARS)") - self.WriteLn("LOCAL_MODULE := " + module_name) - self.WriteLn( - "LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) " - "$(DEFS_$(BUILDTYPE)) " - # LOCAL_CFLAGS is applied to both of C and C++. There is - # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C - # sources. - "$(CFLAGS_C_$(BUILDTYPE)) " - # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while - # LOCAL_C_INCLUDES does not expect it. So put it in - # LOCAL_CFLAGS. - "$(INCS_$(BUILDTYPE))" - ) - # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. - self.WriteLn("LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))") - self.WriteLn("LOCAL_C_INCLUDES :=") - self.WriteLn("LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)") - - # Detect the C++ extension. - cpp_ext = {".cc": 0, ".cpp": 0, ".cxx": 0} - default_cpp_ext = ".cpp" - for filename in all_sources: - ext = os.path.splitext(filename)[1] - if ext in cpp_ext: - cpp_ext[ext] += 1 - if cpp_ext[ext] > cpp_ext[default_cpp_ext]: - default_cpp_ext = ext - self.WriteLn("LOCAL_CPP_EXTENSION := " + default_cpp_ext) - - self.WriteList( - list(map(self.Absolutify, filter(Compilable, all_sources))), - "LOCAL_SRC_FILES", - ) - - # Filter out those which do not match prefix and suffix and produce - # the resulting list without prefix and suffix. - def DepsToModules(deps, prefix, suffix): - modules = [] - for filepath in deps: - filename = os.path.basename(filepath) - if filename.startswith(prefix) and filename.endswith(suffix): - modules.append(filename[len(prefix) : -len(suffix)]) - return modules - - # Retrieve the default value of 'SHARED_LIB_SUFFIX' - params = {"flavor": "linux"} - default_variables = {} - CalculateVariables(default_variables, params) - - self.WriteList( - DepsToModules( - link_deps, - generator_default_variables["SHARED_LIB_PREFIX"], - default_variables["SHARED_LIB_SUFFIX"], - ), - "LOCAL_SHARED_LIBRARIES", - ) - self.WriteList( - DepsToModules( - link_deps, - generator_default_variables["STATIC_LIB_PREFIX"], - generator_default_variables["STATIC_LIB_SUFFIX"], - ), - "LOCAL_STATIC_LIBRARIES", - ) - - if self.type == "executable": - self.WriteLn("include $(BUILD_EXECUTABLE)") - elif self.type == "shared_library": - self.WriteLn("include $(BUILD_SHARED_LIBRARY)") - elif self.type == "static_library": - self.WriteLn("include $(BUILD_STATIC_LIBRARY)") - self.WriteLn() - - def WriteLn(self, text=""): - self.fp.write(text + "\n") - - def GetSortedXcodeEnv(self, additional_settings=None): - return gyp.xcode_emulation.GetSortedXcodeEnv( - self.xcode_settings, - "$(abs_builddir)", - os.path.join("$(abs_srcdir)", self.path), - "$(BUILDTYPE)", - additional_settings, - ) - - def GetSortedXcodePostbuildEnv(self): - # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. - # TODO(thakis): It would be nice to have some general mechanism instead. - strip_save_file = self.xcode_settings.GetPerTargetSetting( - "CHROMIUM_STRIP_SAVE_FILE", "" - ) - # Even if strip_save_file is empty, explicitly write it. Else a postbuild - # might pick up an export from an earlier target. - return self.GetSortedXcodeEnv( - additional_settings={"CHROMIUM_STRIP_SAVE_FILE": strip_save_file} - ) - - def WriteSortedXcodeEnv(self, target, env): - for k, v in env: - # For - # foo := a\ b - # the escaped space does the right thing. For - # export foo := a\ b - # it does not -- the backslash is written to the env as literal character. - # So don't escape spaces in |env[k]|. - self.WriteLn(f"{QuoteSpaces(target)}: export {k} := {v}") - - def Objectify(self, path): - """Convert a path to its output directory form.""" - if "$(" in path: - path = path.replace("$(obj)/", "$(obj).%s/$(TARGET)/" % self.toolset) - if "$(obj)" not in path: - path = f"$(obj).{self.toolset}/$(TARGET)/{path}" - return path - - def Pchify(self, path, lang): - """Convert a prefix header path to its output directory form.""" - path = self.Absolutify(path) - if "$(" in path: - path = path.replace( - "$(obj)/", f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}" - ) - return path - return f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}/{path}" - - def Absolutify(self, path): - """Convert a subdirectory-relative path into a base-relative path. - Skips over paths that contain variables.""" - if "$(" in path: - # Don't call normpath in this case, as it might collapse the - # path too aggressively if it features '..'. However it's still - # important to strip trailing slashes. - return path.rstrip("/") - return os.path.normpath(os.path.join(self.path, path)) - - def ExpandInputRoot(self, template, expansion, dirname): - if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: - return template - path = template % { - "INPUT_ROOT": expansion, - "INPUT_DIRNAME": dirname, - } - return path - - def _InstallableTargetInstallPath(self): - """Returns the location of the final output for an installable target.""" - # Functionality removed for all platforms to match Xcode and hoist - # shared libraries into PRODUCT_DIR for users: - # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files - # rely on this. Emulate this behavior for mac. - # if self.type == "shared_library" and ( - # self.flavor != "mac" or self.toolset != "target" - # ): - # # Install all shared libs into a common directory (per toolset) for - # # convenient access with LD_LIBRARY_PATH. - # return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) - if self.flavor == "zos" and self.type == "shared_library": - return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) - - return "$(builddir)/" + self.alias - - -def WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files): - """Write the target to regenerate the Makefile.""" - options = params["options"] - build_files_args = [ - gyp.common.RelativePath(filename, options.toplevel_dir) - for filename in params["build_files_arg"] - ] - - gyp_binary = gyp.common.FixIfRelativePath( - params["gyp_binary"], options.toplevel_dir - ) - if not gyp_binary.startswith(os.sep): - gyp_binary = os.path.join(".", gyp_binary) - - root_makefile.write( - "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" - "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" - "%(makefile_name)s: %(deps)s\n" - "\t$(call do_cmd,regen_makefile)\n\n" - % { - "makefile_name": makefile_name, - "deps": " ".join(SourceifyAndQuoteSpaces(bf) for bf in build_files), - "cmd": gyp.common.EncodePOSIXShellList( - [gyp_binary, "-fmake"] + gyp.RegenerateFlags(options) + build_files_args - ), - } - ) - - -def PerformBuild(data, configurations, params): - options = params["options"] - for config in configurations: - arguments = ["make"] - if options.toplevel_dir and options.toplevel_dir != ".": - arguments += "-C", options.toplevel_dir - arguments.append("BUILDTYPE=" + config) - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def GenerateOutput(target_list, target_dicts, data, params): - options = params["options"] - flavor = gyp.common.GetFlavor(params) - generator_flags = params.get("generator_flags", {}) - builddir_name = generator_flags.get("output_dir", "out") - android_ndk_version = generator_flags.get("android_ndk_version", None) - default_target = generator_flags.get("default_target", "all") - - def CalculateMakefilePath(build_file, base_name): - """Determine where to write a Makefile for a given gyp file.""" - # Paths in gyp files are relative to the .gyp file, but we want - # paths relative to the source root for the master makefile. Grab - # the path of the .gyp file as the base to relativize against. - # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". - base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) - # We write the file in the base_path directory. - output_file = os.path.join(options.depth, base_path, base_name) - if options.generator_output: - output_file = os.path.join( - options.depth, options.generator_output, base_path, base_name - ) - base_path = gyp.common.RelativePath( - os.path.dirname(build_file), options.toplevel_dir - ) - return base_path, output_file - - # TODO: search for the first non-'Default' target. This can go - # away when we add verification that all targets have the - # necessary configurations. - default_configuration = None - toolsets = {target_dicts[target]["toolset"] for target in target_list} - for target in target_list: - spec = target_dicts[target] - if spec["default_configuration"] != "Default": - default_configuration = spec["default_configuration"] - break - if not default_configuration: - default_configuration = "Default" - - srcdir = "." - makefile_name = "Makefile" + options.suffix - makefile_path = os.path.join(options.toplevel_dir, makefile_name) - if options.generator_output: - global srcdir_prefix - makefile_path = os.path.join( - options.toplevel_dir, options.generator_output, makefile_name - ) - srcdir = gyp.common.RelativePath(srcdir, options.generator_output) - srcdir_prefix = "$(srcdir)/" - - flock_command = "flock" - copy_archive_arguments = "-af" - makedep_arguments = "-MMD" - header_params = { - "default_target": default_target, - "builddir": builddir_name, - "default_configuration": default_configuration, - "flock": flock_command, - "flock_index": 1, - "link_commands": LINK_COMMANDS_LINUX, - "extra_commands": "", - "srcdir": srcdir, - "copy_archive_args": copy_archive_arguments, - "makedep_args": makedep_arguments, - "CC.target": GetEnvironFallback(("CC_target", "CC"), "$(CC)"), - "AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"), - "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"), - "LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"), - "PLI.target": GetEnvironFallback(("PLI_target", "PLI"), "pli"), - "CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"), - "AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"), - "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"), - "LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"), - "PLI.host": GetEnvironFallback(("PLI_host", "PLI"), "pli"), - } - if flavor == "mac": - flock_command = "./gyp-mac-tool flock" - header_params.update( - { - "flock": flock_command, - "flock_index": 2, - "link_commands": LINK_COMMANDS_MAC, - "extra_commands": SHARED_HEADER_MAC_COMMANDS, - } - ) - elif flavor == "android": - header_params.update({"link_commands": LINK_COMMANDS_ANDROID}) - elif flavor == "zos": - copy_archive_arguments = "-fPR" - CC_target = GetEnvironFallback(("CC_target", "CC"), "njsc") - makedep_arguments = "-MMD" - if CC_target == "clang": - CC_host = GetEnvironFallback(("CC_host", "CC"), "clang") - CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "clang++") - CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "clang++") - elif CC_target == "ibm-clang64": - CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang64") - CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++64") - CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++64") - elif CC_target == "ibm-clang": - CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang") - CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++") - CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++") - else: - # Node.js versions prior to v18: - makedep_arguments = "-qmakedep=gcc" - CC_host = GetEnvironFallback(("CC_host", "CC"), "njsc") - CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "njsc++") - CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "njsc++") - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "makedep_args": makedep_arguments, - "link_commands": LINK_COMMANDS_OS390, - "extra_commands": SHARED_HEADER_OS390_COMMANDS, - "CC.target": CC_target, - "CXX.target": CXX_target, - "CC.host": CC_host, - "CXX.host": CXX_host, - } - ) - elif flavor == "solaris": - copy_archive_arguments = "-pPRf@" - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "flock": "./gyp-flock-tool flock", - "flock_index": 2, - } - ) - elif flavor == "freebsd": - # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. - header_params.update({"flock": "lockf"}) - elif flavor == "openbsd": - copy_archive_arguments = "-pPRf" - header_params.update({"copy_archive_args": copy_archive_arguments}) - elif flavor == "aix": - copy_archive_arguments = "-pPRf" - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "link_commands": LINK_COMMANDS_AIX, - "flock": "./gyp-flock-tool flock", - "flock_index": 2, - } - ) - elif flavor == "os400": - copy_archive_arguments = "-pPRf" - header_params.update( - { - "copy_archive_args": copy_archive_arguments, - "link_commands": LINK_COMMANDS_OS400, - "flock": "./gyp-flock-tool flock", - "flock_index": 2, - } - ) - - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings_array = data[build_file].get("make_global_settings", []) - wrappers = {} - for key, value in make_global_settings_array: - if key.endswith("_wrapper"): - wrappers[key[: -len("_wrapper")]] = "$(abspath %s)" % value - make_global_settings = "" - for key, value in make_global_settings_array: - if re.match(".*_wrapper", key): - continue - if value[0] != "$": - value = "$(abspath %s)" % value - wrapper = wrappers.get(key) - if wrapper: - value = f"{wrapper} {value}" - del wrappers[key] - if key in ("CC", "CC.host", "CXX", "CXX.host"): - make_global_settings += ( - "ifneq (,$(filter $(origin %s), undefined default))\n" % key - ) - # Let gyp-time envvars win over global settings. - env_key = key.replace(".", "_") # CC.host -> CC_host - if env_key in os.environ: - value = os.environ[env_key] - make_global_settings += f" {key} = {value}\n" - make_global_settings += "endif\n" - else: - make_global_settings += f"{key} ?= {value}\n" - # TODO(ukai): define cmd when only wrapper is specified in - # make_global_settings. - - header_params["make_global_settings"] = make_global_settings - - gyp.common.EnsureDirExists(makefile_path) - root_makefile = open(makefile_path, "w") - root_makefile.write(SHARED_HEADER % header_params) - # Currently any versions have the same effect, but in future the behavior - # could be different. - if android_ndk_version: - root_makefile.write( - "# Define LOCAL_PATH for build of Android applications.\n" - "LOCAL_PATH := $(call my-dir)\n" - "\n" - ) - for toolset in toolsets: - root_makefile.write("TOOLSET := %s\n" % toolset) - WriteRootHeaderSuffixRules(root_makefile) - - # Put build-time support tools next to the root Makefile. - dest_path = os.path.dirname(makefile_path) - gyp.common.CopyTool(flavor, dest_path) - - # Find the list of targets that derive from the gyp file(s) being built. - needed_targets = set() - for build_file in params["build_files"]: - for target in gyp.common.AllTargets(target_list, target_dicts, build_file): - needed_targets.add(target) - - build_files = set() - include_list = set() - for qualified_target in target_list: - build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) - - this_make_global_settings = data[build_file].get("make_global_settings", []) - assert make_global_settings_array == this_make_global_settings, ( - "make_global_settings needs to be the same for all targets " - f"{this_make_global_settings} vs. {make_global_settings}" - ) - - build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) - included_files = data[build_file]["included_files"] - for included_file in included_files: - # The included_files entries are relative to the dir of the build file - # that included them, so we have to undo that and then make them relative - # to the root dir. - relative_include_file = gyp.common.RelativePath( - gyp.common.UnrelativePath(included_file, build_file), - options.toplevel_dir, - ) - abs_include_file = os.path.abspath(relative_include_file) - # If the include file is from the ~/.gyp dir, we should use absolute path - # so that relocating the src dir doesn't break the path. - if params["home_dot_gyp"] and abs_include_file.startswith( - params["home_dot_gyp"] - ): - build_files.add(abs_include_file) - else: - build_files.add(relative_include_file) - - base_path, output_file = CalculateMakefilePath( - build_file, target + "." + toolset + options.suffix + ".mk" - ) - - spec = target_dicts[qualified_target] - configs = spec["configurations"] - - if flavor == "mac": - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - - writer = MakefileWriter(generator_flags, flavor) - writer.Write( - qualified_target, - base_path, - output_file, - spec, - configs, - part_of_all=qualified_target in needed_targets, - ) - - # Our root_makefile lives at the source root. Compute the relative path - # from there to the output_file for including. - mkfile_rel_path = gyp.common.RelativePath( - output_file, os.path.dirname(makefile_path) - ) - include_list.add(mkfile_rel_path) - - # Write out per-gyp (sub-project) Makefiles. - depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) - for build_file in build_files: - # The paths in build_files were relativized above, so undo that before - # testing against the non-relativized items in target_list and before - # calculating the Makefile path. - build_file = os.path.join(depth_rel_path, build_file) - gyp_targets = [ - target_dicts[qualified_target]["target_name"] - for qualified_target in target_list - if qualified_target.startswith(build_file) - and qualified_target in needed_targets - ] - # Only generate Makefiles for gyp files with targets. - if not gyp_targets: - continue - base_path, output_file = CalculateMakefilePath( - build_file, os.path.splitext(os.path.basename(build_file))[0] + ".Makefile" - ) - makefile_rel_path = gyp.common.RelativePath( - os.path.dirname(makefile_path), os.path.dirname(output_file) - ) - writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, builddir_name) - - # Write out the sorted list of includes. - root_makefile.write("\n") - for include_file in sorted(include_list): - # We wrap each .mk include in an if statement so users can tell make to - # not load a file by setting NO_LOAD. The below make code says, only - # load the .mk file if the .mk filename doesn't start with a token in - # NO_LOAD. - root_makefile.write( - "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" - " $(findstring $(join ^,$(prefix)),\\\n" - " $(join ^," + include_file + ")))),)\n" - ) - root_makefile.write(" include " + include_file + "\n") - root_makefile.write("endif\n") - root_makefile.write("\n") - - if not generator_flags.get("standalone") and generator_flags.get( - "auto_regeneration", True - ): - WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) - - root_makefile.write(SHARED_FOOTER) - - root_makefile.close() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py deleted file mode 100644 index fd9500578..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +++ /dev/null @@ -1,3981 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import ntpath -import os -import posixpath -import re -import subprocess -import sys - -from collections import OrderedDict - -import gyp.common -import gyp.easy_xml as easy_xml -import gyp.generator.ninja as ninja_generator -import gyp.MSVSNew as MSVSNew -import gyp.MSVSProject as MSVSProject -import gyp.MSVSSettings as MSVSSettings -import gyp.MSVSToolFile as MSVSToolFile -import gyp.MSVSUserFile as MSVSUserFile -import gyp.MSVSUtil as MSVSUtil -import gyp.MSVSVersion as MSVSVersion -from gyp.common import GypError -from gyp.common import OrderedSet - - -# Regular expression for validating Visual Studio GUIDs. If the GUID -# contains lowercase hex letters, MSVS will be fine. However, -# IncrediBuild BuildConsole will parse the solution file, but then -# silently skip building the target causing hard to track down errors. -# Note that this only happens with the BuildConsole, and does not occur -# if IncrediBuild is executed from inside Visual Studio. This regex -# validates that the string looks like a GUID with all uppercase hex -# letters. -VALID_MSVS_GUID_CHARS = re.compile(r"^[A-F0-9\-]+$") - -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - -generator_default_variables = { - "DRIVER_PREFIX": "", - "DRIVER_SUFFIX": ".sys", - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": ".exe", - "STATIC_LIB_PREFIX": "", - "SHARED_LIB_PREFIX": "", - "STATIC_LIB_SUFFIX": ".lib", - "SHARED_LIB_SUFFIX": ".dll", - "INTERMEDIATE_DIR": "$(IntDir)", - "SHARED_INTERMEDIATE_DIR": "$(OutDir)/obj/global_intermediate", - "OS": "win", - "PRODUCT_DIR": "$(OutDir)", - "LIB_DIR": "$(OutDir)lib", - "RULE_INPUT_ROOT": "$(InputName)", - "RULE_INPUT_DIRNAME": "$(InputDir)", - "RULE_INPUT_EXT": "$(InputExt)", - "RULE_INPUT_NAME": "$(InputFileName)", - "RULE_INPUT_PATH": "$(InputPath)", - "CONFIGURATION_NAME": "$(ConfigurationName)", -} - - -# The msvs specific sections that hold paths -generator_additional_path_sections = [ - "msvs_cygwin_dirs", - "msvs_props", -] - - -generator_additional_non_configuration_keys = [ - "msvs_cygwin_dirs", - "msvs_cygwin_shell", - "msvs_large_pdb", - "msvs_shard", - "msvs_external_builder", - "msvs_external_builder_out_dir", - "msvs_external_builder_build_cmd", - "msvs_external_builder_clean_cmd", - "msvs_external_builder_clcompile_cmd", - "msvs_enable_winrt", - "msvs_requires_importlibrary", - "msvs_enable_winphone", - "msvs_application_type_revision", - "msvs_target_platform_version", - "msvs_target_platform_minversion", -] - -generator_filelist_paths = None - -# List of precompiled header related keys. -precomp_keys = [ - "msvs_precompiled_header", - "msvs_precompiled_source", -] - - -cached_username = None - - -cached_domain = None - - -# TODO(gspencer): Switch the os.environ calls to be -# win32api.GetDomainName() and win32api.GetUserName() once the -# python version in depot_tools has been updated to work on Vista -# 64-bit. -def _GetDomainAndUserName(): - if sys.platform not in ("win32", "cygwin"): - return ("DOMAIN", "USERNAME") - global cached_username - global cached_domain - if not cached_domain or not cached_username: - domain = os.environ.get("USERDOMAIN") - username = os.environ.get("USERNAME") - if not domain or not username: - call = subprocess.Popen( - ["net", "config", "Workstation"], stdout=subprocess.PIPE - ) - config = call.communicate()[0].decode("utf-8") - username_re = re.compile(r"^User name\s+(\S+)", re.MULTILINE) - username_match = username_re.search(config) - if username_match: - username = username_match.group(1) - domain_re = re.compile(r"^Logon domain\s+(\S+)", re.MULTILINE) - domain_match = domain_re.search(config) - if domain_match: - domain = domain_match.group(1) - cached_domain = domain - cached_username = username - return (cached_domain, cached_username) - - -fixpath_prefix = None - - -def _NormalizedSource(source): - """Normalize the path. - - But not if that gets rid of a variable, as this may expand to something - larger than one directory. - - Arguments: - source: The path to be normalize.d - - Returns: - The normalized path. - """ - normalized = os.path.normpath(source) - if source.count("$") == normalized.count("$"): - source = normalized - return source - - -def _FixPath(path, separator="\\"): - """Convert paths to a form that will make sense in a vcproj file. - - Arguments: - path: The path to convert, may contain / etc. - Returns: - The path with all slashes made into backslashes. - """ - if ( - fixpath_prefix - and path - and not os.path.isabs(path) - and not path[0] == "$" - and not _IsWindowsAbsPath(path) - ): - path = os.path.join(fixpath_prefix, path) - if separator == "\\": - path = path.replace("/", "\\") - path = _NormalizedSource(path) - if separator == "/": - path = path.replace("\\", "/") - if path and path[-1] == separator: - path = path[:-1] - return path - - -def _IsWindowsAbsPath(path): - """ - On Cygwin systems Python needs a little help determining if a path - is an absolute Windows path or not, so that - it does not treat those as relative, which results in bad paths like: - '..\\C:\\\\some_source_code_file.cc' - """ - return path.startswith("c:") or path.startswith("C:") - - -def _FixPaths(paths, separator="\\"): - """Fix each of the paths of the list.""" - return [_FixPath(i, separator) for i in paths] - - -def _ConvertSourcesToFilterHierarchy( - sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None -): - """Converts a list split source file paths into a vcproj folder hierarchy. - - Arguments: - sources: A list of source file paths split. - prefix: A list of source file path layers meant to apply to each of sources. - excluded: A set of excluded files. - msvs_version: A MSVSVersion object. - - Returns: - A hierarchy of filenames and MSVSProject.Filter objects that matches the - layout of the source tree. - For example: - _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']], - prefix=['joe']) - --> - [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']), - MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])] - """ - if not prefix: - prefix = [] - result = [] - excluded_result = [] - folders = OrderedDict() - # Gather files into the final result, excluded, or folders. - for s in sources: - if len(s) == 1: - filename = _NormalizedSource("\\".join(prefix + s)) - if filename in excluded: - excluded_result.append(filename) - else: - result.append(filename) - elif msvs_version and not msvs_version.UsesVcxproj(): - # For MSVS 2008 and earlier, we need to process all files before walking - # the sub folders. - if not folders.get(s[0]): - folders[s[0]] = [] - folders[s[0]].append(s[1:]) - else: - contents = _ConvertSourcesToFilterHierarchy( - [s[1:]], - prefix + [s[0]], - excluded=excluded, - list_excluded=list_excluded, - msvs_version=msvs_version, - ) - contents = MSVSProject.Filter(s[0], contents=contents) - result.append(contents) - # Add a folder for excluded files. - if excluded_result and list_excluded: - excluded_folder = MSVSProject.Filter( - "_excluded_files", contents=excluded_result - ) - result.append(excluded_folder) - - if msvs_version and msvs_version.UsesVcxproj(): - return result - - # Populate all the folders. - for f in folders: - contents = _ConvertSourcesToFilterHierarchy( - folders[f], - prefix=prefix + [f], - excluded=excluded, - list_excluded=list_excluded, - msvs_version=msvs_version, - ) - contents = MSVSProject.Filter(f, contents=contents) - result.append(contents) - return result - - -def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False): - if not value: - return - _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset) - - -def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False): - # TODO(bradnelson): ugly hack, fix this more generally!!! - if "Directories" in setting or "Dependencies" in setting: - if type(value) == str: - value = value.replace("/", "\\") - else: - value = [i.replace("/", "\\") for i in value] - if not tools.get(tool_name): - tools[tool_name] = dict() - tool = tools[tool_name] - if "CompileAsWinRT" == setting: - return - if tool.get(setting): - if only_if_unset: - return - if type(tool[setting]) == list and type(value) == list: - tool[setting] += value - else: - raise TypeError( - 'Appending "%s" to a non-list setting "%s" for tool "%s" is ' - "not allowed, previous value: %s" - % (value, setting, tool_name, str(tool[setting])) - ) - else: - tool[setting] = value - - -def _ConfigTargetVersion(config_data): - return config_data.get("msvs_target_version", "Windows7") - - -def _ConfigPlatform(config_data): - return config_data.get("msvs_configuration_platform", "Win32") - - -def _ConfigBaseName(config_name, platform_name): - if config_name.endswith("_" + platform_name): - return config_name[0 : -len(platform_name) - 1] - else: - return config_name - - -def _ConfigFullName(config_name, config_data): - platform_name = _ConfigPlatform(config_data) - return f"{_ConfigBaseName(config_name, platform_name)}|{platform_name}" - - -def _ConfigWindowsTargetPlatformVersion(config_data, version): - target_ver = config_data.get("msvs_windows_target_platform_version") - if target_ver and re.match(r"^\d+", target_ver): - return target_ver - config_ver = config_data.get("msvs_windows_sdk_version") - vers = [config_ver] if config_ver else version.compatible_sdks - for ver in vers: - for key in [ - r"HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s", - r"HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s", - ]: - sdk_dir = MSVSVersion._RegistryGetValue(key % ver, "InstallationFolder") - if not sdk_dir: - continue - version = MSVSVersion._RegistryGetValue(key % ver, "ProductVersion") or "" - # Find a matching entry in sdk_dir\include. - expected_sdk_dir = r"%s\include" % sdk_dir - names = sorted( - ( - x - for x in ( - os.listdir(expected_sdk_dir) - if os.path.isdir(expected_sdk_dir) - else [] - ) - if x.startswith(version) - ), - reverse=True, - ) - if names: - return names[0] - else: - print( - "Warning: No include files found for detected " - "Windows SDK version %s" % (version), - file=sys.stdout, - ) - - -def _BuildCommandLineForRuleRaw( - spec, cmd, cygwin_shell, has_input_path, quote_cmd, do_setup_env -): - - if [x for x in cmd if "$(InputDir)" in x]: - input_dir_preamble = ( - "set INPUTDIR=$(InputDir)\n" - "if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n" - "set INPUTDIR=%INPUTDIR:~0,-1%\n" - ) - else: - input_dir_preamble = "" - - if cygwin_shell: - # Find path to cygwin. - cygwin_dir = _FixPath(spec.get("msvs_cygwin_dirs", ["."])[0]) - # Prepare command. - direct_cmd = cmd - direct_cmd = [ - i.replace("$(IntDir)", '`cygpath -m "${INTDIR}"`') for i in direct_cmd - ] - direct_cmd = [ - i.replace("$(OutDir)", '`cygpath -m "${OUTDIR}"`') for i in direct_cmd - ] - direct_cmd = [ - i.replace("$(InputDir)", '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd - ] - if has_input_path: - direct_cmd = [ - i.replace("$(InputPath)", '`cygpath -m "${INPUTPATH}"`') - for i in direct_cmd - ] - direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd] - # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd) - direct_cmd = " ".join(direct_cmd) - # TODO(quote): regularize quoting path names throughout the module - cmd = "" - if do_setup_env: - cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && ' - cmd += "set CYGWIN=nontsec&& " - if direct_cmd.find("NUMBER_OF_PROCESSORS") >= 0: - cmd += "set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& " - if direct_cmd.find("INTDIR") >= 0: - cmd += "set INTDIR=$(IntDir)&& " - if direct_cmd.find("OUTDIR") >= 0: - cmd += "set OUTDIR=$(OutDir)&& " - if has_input_path and direct_cmd.find("INPUTPATH") >= 0: - cmd += "set INPUTPATH=$(InputPath) && " - cmd += 'bash -c "%(cmd)s"' - cmd = cmd % {"cygwin_dir": cygwin_dir, "cmd": direct_cmd} - return input_dir_preamble + cmd - else: - # Convert cat --> type to mimic unix. - if cmd[0] == "cat": - command = ["type"] - else: - command = [cmd[0].replace("/", "\\")] - # Add call before command to ensure that commands can be tied together one - # after the other without aborting in Incredibuild, since IB makes a bat - # file out of the raw command string, and some commands (like python) are - # actually batch files themselves. - command.insert(0, "call") - # Fix the paths - # TODO(quote): This is a really ugly heuristic, and will miss path fixing - # for arguments like "--arg=path", arg=path, or "/opt:path". - # If the argument starts with a slash or dash, or contains an equal sign, - # it's probably a command line switch. - # Return the path with forward slashes because the command using it might - # not support backslashes. - arguments = [ - i if (i[:1] in "/-" or "=" in i) else _FixPath(i, "/") - for i in cmd[1:] - ] - arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments] - arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] - if quote_cmd: - # Support a mode for using cmd directly. - # Convert any paths to native form (first element is used directly). - # TODO(quote): regularize quoting path names throughout the module - arguments = ['"%s"' % i for i in arguments] - # Collapse into a single command. - return input_dir_preamble + " ".join(command + arguments) - - -def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env): - # Currently this weird argument munging is used to duplicate the way a - # python script would need to be run as part of the chrome tree. - # Eventually we should add some sort of rule_default option to set this - # per project. For now the behavior chrome needs is the default. - mcs = rule.get("msvs_cygwin_shell") - if mcs is None: - mcs = int(spec.get("msvs_cygwin_shell", 1)) - elif isinstance(mcs, str): - mcs = int(mcs) - quote_cmd = int(rule.get("msvs_quote_cmd", 1)) - return _BuildCommandLineForRuleRaw( - spec, rule["action"], mcs, has_input_path, quote_cmd, do_setup_env=do_setup_env - ) - - -def _AddActionStep(actions_dict, inputs, outputs, description, command): - """Merge action into an existing list of actions. - - Care must be taken so that actions which have overlapping inputs either don't - get assigned to the same input, or get collapsed into one. - - Arguments: - actions_dict: dictionary keyed on input name, which maps to a list of - dicts describing the actions attached to that input file. - inputs: list of inputs - outputs: list of outputs - description: description of the action - command: command line to execute - """ - # Require there to be at least one input (call sites will ensure this). - assert inputs - - action = { - "inputs": inputs, - "outputs": outputs, - "description": description, - "command": command, - } - - # Pick where to stick this action. - # While less than optimal in terms of build time, attach them to the first - # input for now. - chosen_input = inputs[0] - - # Add it there. - if chosen_input not in actions_dict: - actions_dict[chosen_input] = [] - actions_dict[chosen_input].append(action) - - -def _AddCustomBuildToolForMSVS( - p, spec, primary_input, inputs, outputs, description, cmd -): - """Add a custom build tool to execute something. - - Arguments: - p: the target project - spec: the target project dict - primary_input: input file to attach the build tool to - inputs: list of inputs - outputs: list of outputs - description: description of the action - cmd: command line to execute - """ - inputs = _FixPaths(inputs) - outputs = _FixPaths(outputs) - tool = MSVSProject.Tool( - "VCCustomBuildTool", - { - "Description": description, - "AdditionalDependencies": ";".join(inputs), - "Outputs": ";".join(outputs), - "CommandLine": cmd, - }, - ) - # Add to the properties of primary input for each config. - for config_name, c_data in spec["configurations"].items(): - p.AddFileConfig( - _FixPath(primary_input), _ConfigFullName(config_name, c_data), tools=[tool] - ) - - -def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): - """Add actions accumulated into an actions_dict, merging as needed. - - Arguments: - p: the target project - spec: the target project dict - actions_dict: dictionary keyed on input name, which maps to a list of - dicts describing the actions attached to that input file. - """ - for primary_input in actions_dict: - inputs = OrderedSet() - outputs = OrderedSet() - descriptions = [] - commands = [] - for action in actions_dict[primary_input]: - inputs.update(OrderedSet(action["inputs"])) - outputs.update(OrderedSet(action["outputs"])) - descriptions.append(action["description"]) - commands.append(action["command"]) - # Add the custom build step for one input file. - description = ", and also ".join(descriptions) - command = "\r\n".join(commands) - _AddCustomBuildToolForMSVS( - p, - spec, - primary_input=primary_input, - inputs=inputs, - outputs=outputs, - description=description, - cmd=command, - ) - - -def _RuleExpandPath(path, input_file): - """Given the input file to which a rule applied, string substitute a path. - - Arguments: - path: a path to string expand - input_file: the file to which the rule applied. - Returns: - The string substituted path. - """ - path = path.replace( - "$(InputName)", os.path.splitext(os.path.split(input_file)[1])[0] - ) - path = path.replace("$(InputDir)", os.path.dirname(input_file)) - path = path.replace( - "$(InputExt)", os.path.splitext(os.path.split(input_file)[1])[1] - ) - path = path.replace("$(InputFileName)", os.path.split(input_file)[1]) - path = path.replace("$(InputPath)", input_file) - return path - - -def _FindRuleTriggerFiles(rule, sources): - """Find the list of files which a particular rule applies to. - - Arguments: - rule: the rule in question - sources: the set of all known source files for this project - Returns: - The list of sources that trigger a particular rule. - """ - return rule.get("rule_sources", []) - - -def _RuleInputsAndOutputs(rule, trigger_file): - """Find the inputs and outputs generated by a rule. - - Arguments: - rule: the rule in question. - trigger_file: the main trigger for this rule. - Returns: - The pair of (inputs, outputs) involved in this rule. - """ - raw_inputs = _FixPaths(rule.get("inputs", [])) - raw_outputs = _FixPaths(rule.get("outputs", [])) - inputs = OrderedSet() - outputs = OrderedSet() - inputs.add(trigger_file) - for i in raw_inputs: - inputs.add(_RuleExpandPath(i, trigger_file)) - for o in raw_outputs: - outputs.add(_RuleExpandPath(o, trigger_file)) - return (inputs, outputs) - - -def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): - """Generate a native rules file. - - Arguments: - p: the target project - rules: the set of rules to include - output_dir: the directory in which the project/gyp resides - spec: the project dict - options: global generator options - """ - rules_filename = "{}{}.rules".format(spec["target_name"], options.suffix) - rules_file = MSVSToolFile.Writer( - os.path.join(output_dir, rules_filename), spec["target_name"] - ) - # Add each rule. - for r in rules: - rule_name = r["rule_name"] - rule_ext = r["extension"] - inputs = _FixPaths(r.get("inputs", [])) - outputs = _FixPaths(r.get("outputs", [])) - # Skip a rule with no action and no inputs. - if "action" not in r and not r.get("rule_sources", []): - continue - cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, do_setup_env=True) - rules_file.AddCustomBuildRule( - name=rule_name, - description=r.get("message", rule_name), - extensions=[rule_ext], - additional_dependencies=inputs, - outputs=outputs, - cmd=cmd, - ) - # Write out rules file. - rules_file.WriteIfChanged() - - # Add rules file to project. - p.AddToolFile(rules_filename) - - -def _Cygwinify(path): - path = path.replace("$(OutDir)", "$(OutDirCygwin)") - path = path.replace("$(IntDir)", "$(IntDirCygwin)") - return path - - -def _GenerateExternalRules(rules, output_dir, spec, sources, options, actions_to_add): - """Generate an external makefile to do a set of rules. - - Arguments: - rules: the list of rules to include - output_dir: path containing project and gyp files - spec: project specification data - sources: set of sources known - options: global generator options - actions_to_add: The list of actions we will add to. - """ - filename = "{}_rules{}.mk".format(spec["target_name"], options.suffix) - mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename)) - # Find cygwin style versions of some paths. - mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n') - mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n') - # Gather stuff needed to emit all: target. - all_inputs = OrderedSet() - all_outputs = OrderedSet() - all_output_dirs = OrderedSet() - first_outputs = [] - for rule in rules: - trigger_files = _FindRuleTriggerFiles(rule, sources) - for tf in trigger_files: - inputs, outputs = _RuleInputsAndOutputs(rule, tf) - all_inputs.update(OrderedSet(inputs)) - all_outputs.update(OrderedSet(outputs)) - # Only use one target from each rule as the dependency for - # 'all' so we don't try to build each rule multiple times. - first_outputs.append(list(outputs)[0]) - # Get the unique output directories for this rule. - output_dirs = [os.path.split(i)[0] for i in outputs] - for od in output_dirs: - all_output_dirs.add(od) - first_outputs_cyg = [_Cygwinify(i) for i in first_outputs] - # Write out all: target, including mkdir for each output directory. - mk_file.write("all: %s\n" % " ".join(first_outputs_cyg)) - for od in all_output_dirs: - if od: - mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od) - mk_file.write("\n") - # Define how each output is generated. - for rule in rules: - trigger_files = _FindRuleTriggerFiles(rule, sources) - for tf in trigger_files: - # Get all the inputs and outputs for this rule for this trigger file. - inputs, outputs = _RuleInputsAndOutputs(rule, tf) - inputs = [_Cygwinify(i) for i in inputs] - outputs = [_Cygwinify(i) for i in outputs] - # Prepare the command line for this rule. - cmd = [_RuleExpandPath(c, tf) for c in rule["action"]] - cmd = ['"%s"' % i for i in cmd] - cmd = " ".join(cmd) - # Add it to the makefile. - mk_file.write("{}: {}\n".format(" ".join(outputs), " ".join(inputs))) - mk_file.write("\t%s\n\n" % cmd) - # Close up the file. - mk_file.close() - - # Add makefile to list of sources. - sources.add(filename) - # Add a build action to call makefile. - cmd = [ - "make", - "OutDir=$(OutDir)", - "IntDir=$(IntDir)", - "-j", - "${NUMBER_OF_PROCESSORS_PLUS_1}", - "-f", - filename, - ] - cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True) - # Insert makefile as 0'th input, so it gets the action attached there, - # as this is easier to understand from in the IDE. - all_inputs = list(all_inputs) - all_inputs.insert(0, filename) - _AddActionStep( - actions_to_add, - inputs=_FixPaths(all_inputs), - outputs=_FixPaths(all_outputs), - description="Running external rules for %s" % spec["target_name"], - command=cmd, - ) - - -def _EscapeEnvironmentVariableExpansion(s): - """Escapes % characters. - - Escapes any % characters so that Windows-style environment variable - expansions will leave them alone. - See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile - to understand why we have to do this. - - Args: - s: The string to be escaped. - - Returns: - The escaped string. - """ # noqa: E731,E123,E501 - s = s.replace("%", "%%") - return s - - -quote_replacer_regex = re.compile(r'(\\*)"') - - -def _EscapeCommandLineArgumentForMSVS(s): - """Escapes a Windows command-line argument. - - So that the Win32 CommandLineToArgv function will turn the escaped result back - into the original string. - See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx - ("Parsing C++ Command-Line Arguments") to understand why we have to do - this. - - Args: - s: the string to be escaped. - Returns: - the escaped string. - """ - - def _Replace(match): - # For a literal quote, CommandLineToArgv requires an odd number of - # backslashes preceding it, and it produces half as many literal backslashes - # (rounded down). So we need to produce 2n+1 backslashes. - return 2 * match.group(1) + '\\"' - - # Escape all quotes so that they are interpreted literally. - s = quote_replacer_regex.sub(_Replace, s) - # Now add unescaped quotes so that any whitespace is interpreted literally. - s = '"' + s + '"' - return s - - -delimiters_replacer_regex = re.compile(r"(\\*)([,;]+)") - - -def _EscapeVCProjCommandLineArgListItem(s): - """Escapes command line arguments for MSVS. - - The VCProj format stores string lists in a single string using commas and - semi-colons as separators, which must be quoted if they are to be - interpreted literally. However, command-line arguments may already have - quotes, and the VCProj parser is ignorant of the backslash escaping - convention used by CommandLineToArgv, so the command-line quotes and the - VCProj quotes may not be the same quotes. So to store a general - command-line argument in a VCProj list, we need to parse the existing - quoting according to VCProj's convention and quote any delimiters that are - not already quoted by that convention. The quotes that we add will also be - seen by CommandLineToArgv, so if backslashes precede them then we also have - to escape those backslashes according to the CommandLineToArgv - convention. - - Args: - s: the string to be escaped. - Returns: - the escaped string. - """ - - def _Replace(match): - # For a non-literal quote, CommandLineToArgv requires an even number of - # backslashes preceding it, and it produces half as many literal - # backslashes. So we need to produce 2n backslashes. - return 2 * match.group(1) + '"' + match.group(2) + '"' - - segments = s.split('"') - # The unquoted segments are at the even-numbered indices. - for i in range(0, len(segments), 2): - segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i]) - # Concatenate back into a single string - s = '"'.join(segments) - if len(segments) % 2 == 0: - # String ends while still quoted according to VCProj's convention. This - # means the delimiter and the next list item that follow this one in the - # .vcproj file will be misinterpreted as part of this item. There is nothing - # we can do about this. Adding an extra quote would correct the problem in - # the VCProj but cause the same problem on the final command-line. Moving - # the item to the end of the list does works, but that's only possible if - # there's only one such item. Let's just warn the user. - print( - "Warning: MSVS may misinterpret the odd number of " + "quotes in " + s, - file=sys.stderr, - ) - return s - - -def _EscapeCppDefineForMSVS(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = _EscapeEnvironmentVariableExpansion(s) - s = _EscapeCommandLineArgumentForMSVS(s) - s = _EscapeVCProjCommandLineArgListItem(s) - # cl.exe replaces literal # characters with = in preprocessor definitions for - # some reason. Octal-encode to work around that. - s = s.replace("#", "\\%03o" % ord("#")) - return s - - -quote_replacer_regex2 = re.compile(r'(\\+)"') - - -def _EscapeCommandLineArgumentForMSBuild(s): - """Escapes a Windows command-line argument for use by MSBuild.""" - - def _Replace(match): - return (len(match.group(1)) / 2 * 4) * "\\" + '\\"' - - # Escape all quotes so that they are interpreted literally. - s = quote_replacer_regex2.sub(_Replace, s) - return s - - -def _EscapeMSBuildSpecialCharacters(s): - escape_dictionary = { - "%": "%25", - "$": "%24", - "@": "%40", - "'": "%27", - ";": "%3B", - "?": "%3F", - "*": "%2A", - } - result = "".join([escape_dictionary.get(c, c) for c in s]) - return result - - -def _EscapeCppDefineForMSBuild(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = _EscapeEnvironmentVariableExpansion(s) - s = _EscapeCommandLineArgumentForMSBuild(s) - s = _EscapeMSBuildSpecialCharacters(s) - # cl.exe replaces literal # characters with = in preprocessor definitions for - # some reason. Octal-encode to work around that. - s = s.replace("#", "\\%03o" % ord("#")) - return s - - -def _GenerateRulesForMSVS( - p, output_dir, options, spec, sources, excluded_sources, actions_to_add -): - """Generate all the rules for a particular project. - - Arguments: - p: the project - output_dir: directory to emit rules to - options: global options passed to the generator - spec: the specification for this project - sources: the set of all known source files in this project - excluded_sources: the set of sources excluded from normal processing - actions_to_add: deferred list of actions to add in - """ - rules = spec.get("rules", []) - rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] - rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] - - # Handle rules that use a native rules file. - if rules_native: - _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) - - # Handle external rules (non-native rules). - if rules_external: - _GenerateExternalRules( - rules_external, output_dir, spec, sources, options, actions_to_add - ) - _AdjustSourcesForRules(rules, sources, excluded_sources, False) - - -def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild): - # Add outputs generated by each rule (if applicable). - for rule in rules: - # Add in the outputs from this rule. - trigger_files = _FindRuleTriggerFiles(rule, sources) - for trigger_file in trigger_files: - # Remove trigger_file from excluded_sources to let the rule be triggered - # (e.g. rule trigger ax_enums.idl is added to excluded_sources - # because it's also in an action's inputs in the same project) - excluded_sources.discard(_FixPath(trigger_file)) - # Done if not processing outputs as sources. - if int(rule.get("process_outputs_as_sources", False)): - inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) - inputs = OrderedSet(_FixPaths(inputs)) - outputs = OrderedSet(_FixPaths(outputs)) - inputs.remove(_FixPath(trigger_file)) - sources.update(inputs) - if not is_msbuild: - excluded_sources.update(inputs) - sources.update(outputs) - - -def _FilterActionsFromExcluded(excluded_sources, actions_to_add): - """Take inputs with actions attached out of the list of exclusions. - - Arguments: - excluded_sources: list of source files not to be built. - actions_to_add: dict of actions keyed on source file they're attached to. - Returns: - excluded_sources with files that have actions attached removed. - """ - must_keep = OrderedSet(_FixPaths(actions_to_add.keys())) - return [s for s in excluded_sources if s not in must_keep] - - -def _GetDefaultConfiguration(spec): - return spec["configurations"][spec["default_configuration"]] - - -def _GetGuidOfProject(proj_path, spec): - """Get the guid for the project. - - Arguments: - proj_path: Path of the vcproj or vcxproj file to generate. - spec: The target dictionary containing the properties of the target. - Returns: - the guid. - Raises: - ValueError: if the specified GUID is invalid. - """ - # Pluck out the default configuration. - default_config = _GetDefaultConfiguration(spec) - # Decide the guid of the project. - guid = default_config.get("msvs_guid") - if guid: - if VALID_MSVS_GUID_CHARS.match(guid) is None: - raise ValueError( - 'Invalid MSVS guid: "%s". Must match regex: "%s".' - % (guid, VALID_MSVS_GUID_CHARS.pattern) - ) - guid = "{%s}" % guid - guid = guid or MSVSNew.MakeGuid(proj_path) - return guid - - -def _GetMsbuildToolsetOfProject(proj_path, spec, version): - """Get the platform toolset for the project. - - Arguments: - proj_path: Path of the vcproj or vcxproj file to generate. - spec: The target dictionary containing the properties of the target. - version: The MSVSVersion object. - Returns: - the platform toolset string or None. - """ - # Pluck out the default configuration. - default_config = _GetDefaultConfiguration(spec) - toolset = default_config.get("msbuild_toolset") - if not toolset and version.DefaultToolset(): - toolset = version.DefaultToolset() - if spec["type"] == "windows_driver": - toolset = "WindowsKernelModeDriver10.0" - return toolset - - -def _GenerateProject(project, options, version, generator_flags, spec): - """Generates a vcproj file. - - Arguments: - project: the MSVSProject object. - options: global generator options. - version: the MSVSVersion object. - generator_flags: dict of generator-specific flags. - Returns: - A list of source files that cannot be found on disk. - """ - default_config = _GetDefaultConfiguration(project.spec) - - # Skip emitting anything if told to with msvs_existing_vcproj option. - if default_config.get("msvs_existing_vcproj"): - return [] - - if version.UsesVcxproj(): - return _GenerateMSBuildProject(project, options, version, generator_flags, spec) - else: - return _GenerateMSVSProject(project, options, version, generator_flags) - - -def _GenerateMSVSProject(project, options, version, generator_flags): - """Generates a .vcproj file. It may create .rules and .user files too. - - Arguments: - project: The project object we will generate the file for. - options: Global options passed to the generator. - version: The VisualStudioVersion object. - generator_flags: dict of generator-specific flags. - """ - spec = project.spec - gyp.common.EnsureDirExists(project.path) - - platforms = _GetUniquePlatforms(spec) - p = MSVSProject.Writer( - project.path, version, spec["target_name"], project.guid, platforms - ) - - # Get directory project file is in. - project_dir = os.path.split(project.path)[0] - gyp_path = _NormalizedSource(project.build_file) - relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) - - config_type = _GetMSVSConfigurationType(spec, project.build_file) - for config_name, config in spec["configurations"].items(): - _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config) - - # Prepare list of sources and excluded sources. - gyp_file = os.path.split(project.build_file)[1] - sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) - - # Add rules. - actions_to_add = {} - _GenerateRulesForMSVS( - p, project_dir, options, spec, sources, excluded_sources, actions_to_add - ) - list_excluded = generator_flags.get("msvs_list_excluded_files", True) - sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, project_dir, sources, excluded_sources, list_excluded, version - ) - - # Add in files. - missing_sources = _VerifySourcesExist(sources, project_dir) - p.AddFiles(sources) - - _AddToolFilesToMSVS(p, spec) - _HandlePreCompiledHeaders(p, sources, spec) - _AddActions(actions_to_add, spec, relative_path_of_gyp_file) - _AddCopies(actions_to_add, spec) - _WriteMSVSUserFile(project.path, version, spec) - - # NOTE: this stanza must appear after all actions have been decided. - # Don't excluded sources with actions attached, or they won't run. - excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) - _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded) - _AddAccumulatedActionsToMSVS(p, spec, actions_to_add) - - # Write it out. - p.WriteIfChanged() - - return missing_sources - - -def _GetUniquePlatforms(spec): - """Returns the list of unique platforms for this spec, e.g ['win32', ...]. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - The MSVSUserFile object created. - """ - # Gather list of unique platforms. - platforms = OrderedSet() - for configuration in spec["configurations"]: - platforms.add(_ConfigPlatform(spec["configurations"][configuration])) - platforms = list(platforms) - return platforms - - -def _CreateMSVSUserFile(proj_path, version, spec): - """Generates a .user file for the user running this Gyp program. - - Arguments: - proj_path: The path of the project file being created. The .user file - shares the same path (with an appropriate suffix). - version: The VisualStudioVersion object. - spec: The target dictionary containing the properties of the target. - Returns: - The MSVSUserFile object created. - """ - (domain, username) = _GetDomainAndUserName() - vcuser_filename = ".".join([proj_path, domain, username, "user"]) - user_file = MSVSUserFile.Writer(vcuser_filename, version, spec["target_name"]) - return user_file - - -def _GetMSVSConfigurationType(spec, build_file): - """Returns the configuration type for this project. - - It's a number defined by Microsoft. May raise an exception. - - Args: - spec: The target dictionary containing the properties of the target. - build_file: The path of the gyp file. - Returns: - An integer, the configuration type. - """ - try: - config_type = { - "executable": "1", # .exe - "shared_library": "2", # .dll - "loadable_module": "2", # .dll - "static_library": "4", # .lib - "windows_driver": "5", # .sys - "none": "10", # Utility type - }[spec["type"]] - except KeyError: - if spec.get("type"): - raise GypError( - "Target type %s is not a valid target type for " - "target %s in %s." % (spec["type"], spec["target_name"], build_file) - ) - else: - raise GypError( - "Missing type field for target %s in %s." - % (spec["target_name"], build_file) - ) - return config_type - - -def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): - """Adds a configuration to the MSVS project. - - Many settings in a vcproj file are specific to a configuration. This - function the main part of the vcproj file that's configuration specific. - - Arguments: - p: The target project being generated. - spec: The target dictionary containing the properties of the target. - config_type: The configuration type, a number as defined by Microsoft. - config_name: The name of the configuration. - config: The dictionary that defines the special processing to be done - for this configuration. - """ - # Get the information for this configuration - include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs(config) - libraries = _GetLibraries(spec) - library_dirs = _GetLibraryDirs(config) - out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False) - defines = _GetDefines(config) - defines = [_EscapeCppDefineForMSVS(d) for d in defines] - disabled_warnings = _GetDisabledWarnings(config) - prebuild = config.get("msvs_prebuild") - postbuild = config.get("msvs_postbuild") - def_file = _GetModuleDefinition(spec) - precompiled_header = config.get("msvs_precompiled_header") - - # Prepare the list of tools as a dictionary. - tools = dict() - # Add in user specified msvs_settings. - msvs_settings = config.get("msvs_settings", {}) - MSVSSettings.ValidateMSVSSettings(msvs_settings) - - # Prevent default library inheritance from the environment. - _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", ["$(NOINHERIT)"]) - - for tool in msvs_settings: - settings = config["msvs_settings"][tool] - for setting in settings: - _ToolAppend(tools, tool, setting, settings[setting]) - # Add the information to the appropriate tool - _ToolAppend(tools, "VCCLCompilerTool", "AdditionalIncludeDirectories", include_dirs) - _ToolAppend(tools, "VCMIDLTool", "AdditionalIncludeDirectories", midl_include_dirs) - _ToolAppend( - tools, - "VCResourceCompilerTool", - "AdditionalIncludeDirectories", - resource_include_dirs, - ) - # Add in libraries. - _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", libraries) - _ToolAppend(tools, "VCLinkerTool", "AdditionalLibraryDirectories", library_dirs) - if out_file: - _ToolAppend(tools, vc_tool, "OutputFile", out_file, only_if_unset=True) - # Add defines. - _ToolAppend(tools, "VCCLCompilerTool", "PreprocessorDefinitions", defines) - _ToolAppend(tools, "VCResourceCompilerTool", "PreprocessorDefinitions", defines) - # Change program database directory to prevent collisions. - _ToolAppend( - tools, - "VCCLCompilerTool", - "ProgramDataBaseFileName", - "$(IntDir)$(ProjectName)\\vc80.pdb", - only_if_unset=True, - ) - # Add disabled warnings. - _ToolAppend(tools, "VCCLCompilerTool", "DisableSpecificWarnings", disabled_warnings) - # Add Pre-build. - _ToolAppend(tools, "VCPreBuildEventTool", "CommandLine", prebuild) - # Add Post-build. - _ToolAppend(tools, "VCPostBuildEventTool", "CommandLine", postbuild) - # Turn on precompiled headers if appropriate. - if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] - _ToolAppend(tools, "VCCLCompilerTool", "UsePrecompiledHeader", "2") - _ToolAppend( - tools, "VCCLCompilerTool", "PrecompiledHeaderThrough", precompiled_header - ) - _ToolAppend(tools, "VCCLCompilerTool", "ForcedIncludeFiles", precompiled_header) - # Loadable modules don't generate import libraries; - # tell dependent projects to not expect one. - if spec["type"] == "loadable_module": - _ToolAppend(tools, "VCLinkerTool", "IgnoreImportLibrary", "true") - # Set the module definition file if any. - if def_file: - _ToolAppend(tools, "VCLinkerTool", "ModuleDefinitionFile", def_file) - - _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name) - - -def _GetIncludeDirs(config): - """Returns the list of directories to be used for #include directives. - - Arguments: - config: The dictionary that defines the special processing to be done - for this configuration. - Returns: - The list of directory paths. - """ - # TODO(bradnelson): include_dirs should really be flexible enough not to - # require this sort of thing. - include_dirs = config.get("include_dirs", []) + config.get( - "msvs_system_include_dirs", [] - ) - midl_include_dirs = config.get("midl_include_dirs", []) + config.get( - "msvs_system_include_dirs", [] - ) - resource_include_dirs = config.get("resource_include_dirs", include_dirs) - include_dirs = _FixPaths(include_dirs) - midl_include_dirs = _FixPaths(midl_include_dirs) - resource_include_dirs = _FixPaths(resource_include_dirs) - return include_dirs, midl_include_dirs, resource_include_dirs - - -def _GetLibraryDirs(config): - """Returns the list of directories to be used for library search paths. - - Arguments: - config: The dictionary that defines the special processing to be done - for this configuration. - Returns: - The list of directory paths. - """ - - library_dirs = config.get("library_dirs", []) - library_dirs = _FixPaths(library_dirs) - return library_dirs - - -def _GetLibraries(spec): - """Returns the list of libraries for this configuration. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - The list of directory paths. - """ - libraries = spec.get("libraries", []) - # Strip out -l, as it is not used on windows (but is needed so we can pass - # in libraries that are assumed to be in the default library path). - # Also remove duplicate entries, leaving only the last duplicate, while - # preserving order. - found = OrderedSet() - unique_libraries_list = [] - for entry in reversed(libraries): - library = re.sub(r"^\-l", "", entry) - if not os.path.splitext(library)[1]: - library += ".lib" - if library not in found: - found.add(library) - unique_libraries_list.append(library) - unique_libraries_list.reverse() - return unique_libraries_list - - -def _GetOutputFilePathAndTool(spec, msbuild): - """Returns the path and tool to use for this target. - - Figures out the path of the file this spec will create and the name of - the VC tool that will create it. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - A triple of (file path, name of the vc tool, name of the msbuild tool) - """ - # Select a name for the output file. - out_file = "" - vc_tool = "" - msbuild_tool = "" - output_file_map = { - "executable": ("VCLinkerTool", "Link", "$(OutDir)", ".exe"), - "shared_library": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), - "loadable_module": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), - "windows_driver": ("VCLinkerTool", "Link", "$(OutDir)", ".sys"), - "static_library": ("VCLibrarianTool", "Lib", "$(OutDir)lib\\", ".lib"), - } - output_file_props = output_file_map.get(spec["type"]) - if output_file_props and int(spec.get("msvs_auto_output_file", 1)): - vc_tool, msbuild_tool, out_dir, suffix = output_file_props - if spec.get("standalone_static_library", 0): - out_dir = "$(OutDir)" - out_dir = spec.get("product_dir", out_dir) - product_extension = spec.get("product_extension") - if product_extension: - suffix = "." + product_extension - elif msbuild: - suffix = "$(TargetExt)" - prefix = spec.get("product_prefix", "") - product_name = spec.get("product_name", "$(ProjectName)") - out_file = ntpath.join(out_dir, prefix + product_name + suffix) - return out_file, vc_tool, msbuild_tool - - -def _GetOutputTargetExt(spec): - """Returns the extension for this target, including the dot - - If product_extension is specified, set target_extension to this to avoid - MSB8012, returns None otherwise. Ignores any target_extension settings in - the input files. - - Arguments: - spec: The target dictionary containing the properties of the target. - Returns: - A string with the extension, or None - """ - target_extension = spec.get("product_extension") - if target_extension: - return "." + target_extension - return None - - -def _GetDefines(config): - """Returns the list of preprocessor definitions for this configuration. - - Arguments: - config: The dictionary that defines the special processing to be done - for this configuration. - Returns: - The list of preprocessor definitions. - """ - defines = [] - for d in config.get("defines", []): - if type(d) == list: - fd = "=".join([str(dpart) for dpart in d]) - else: - fd = str(d) - defines.append(fd) - return defines - - -def _GetDisabledWarnings(config): - return [str(i) for i in config.get("msvs_disabled_warnings", [])] - - -def _GetModuleDefinition(spec): - def_file = "" - if spec["type"] in [ - "shared_library", - "loadable_module", - "executable", - "windows_driver", - ]: - def_files = [s for s in spec.get("sources", []) if s.endswith(".def")] - if len(def_files) == 1: - def_file = _FixPath(def_files[0]) - elif def_files: - raise ValueError( - "Multiple module definition files in one target, target %s lists " - "multiple .def files: %s" % (spec["target_name"], " ".join(def_files)) - ) - return def_file - - -def _ConvertToolsToExpectedForm(tools): - """Convert tools to a form expected by Visual Studio. - - Arguments: - tools: A dictionary of settings; the tool name is the key. - Returns: - A list of Tool objects. - """ - tool_list = [] - for tool, settings in tools.items(): - # Collapse settings with lists. - settings_fixed = {} - for setting, value in settings.items(): - if type(value) == list: - if ( - tool == "VCLinkerTool" and setting == "AdditionalDependencies" - ) or setting == "AdditionalOptions": - settings_fixed[setting] = " ".join(value) - else: - settings_fixed[setting] = ";".join(value) - else: - settings_fixed[setting] = value - # Add in this tool. - tool_list.append(MSVSProject.Tool(tool, settings_fixed)) - return tool_list - - -def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name): - """Add to the project file the configuration specified by config. - - Arguments: - p: The target project being generated. - spec: the target project dict. - tools: A dictionary of settings; the tool name is the key. - config: The dictionary that defines the special processing to be done - for this configuration. - config_type: The configuration type, a number as defined by Microsoft. - config_name: The name of the configuration. - """ - attributes = _GetMSVSAttributes(spec, config, config_type) - # Add in this configuration. - tool_list = _ConvertToolsToExpectedForm(tools) - p.AddConfig(_ConfigFullName(config_name, config), attrs=attributes, tools=tool_list) - - -def _GetMSVSAttributes(spec, config, config_type): - # Prepare configuration attributes. - prepared_attrs = {} - source_attrs = config.get("msvs_configuration_attributes", {}) - for a in source_attrs: - prepared_attrs[a] = source_attrs[a] - # Add props files. - vsprops_dirs = config.get("msvs_props", []) - vsprops_dirs = _FixPaths(vsprops_dirs) - if vsprops_dirs: - prepared_attrs["InheritedPropertySheets"] = ";".join(vsprops_dirs) - # Set configuration type. - prepared_attrs["ConfigurationType"] = config_type - output_dir = prepared_attrs.get( - "OutputDirectory", "$(SolutionDir)$(ConfigurationName)" - ) - prepared_attrs["OutputDirectory"] = _FixPath(output_dir) + "\\" - if "IntermediateDirectory" not in prepared_attrs: - intermediate = "$(ConfigurationName)\\obj\\$(ProjectName)" - prepared_attrs["IntermediateDirectory"] = _FixPath(intermediate) + "\\" - else: - intermediate = _FixPath(prepared_attrs["IntermediateDirectory"]) + "\\" - intermediate = MSVSSettings.FixVCMacroSlashes(intermediate) - prepared_attrs["IntermediateDirectory"] = intermediate - return prepared_attrs - - -def _AddNormalizedSources(sources_set, sources_array): - sources_set.update(_NormalizedSource(s) for s in sources_array) - - -def _PrepareListOfSources(spec, generator_flags, gyp_file): - """Prepare list of sources and excluded sources. - - Besides the sources specified directly in the spec, adds the gyp file so - that a change to it will cause a re-compile. Also adds appropriate sources - for actions and copies. Assumes later stage will un-exclude files which - have custom build steps attached. - - Arguments: - spec: The target dictionary containing the properties of the target. - gyp_file: The name of the gyp file. - Returns: - A pair of (list of sources, list of excluded sources). - The sources will be relative to the gyp file. - """ - sources = OrderedSet() - _AddNormalizedSources(sources, spec.get("sources", [])) - excluded_sources = OrderedSet() - # Add in the gyp file. - if not generator_flags.get("standalone"): - sources.add(gyp_file) - - # Add in 'action' inputs and outputs. - for a in spec.get("actions", []): - inputs = a["inputs"] - inputs = [_NormalizedSource(i) for i in inputs] - # Add all inputs to sources and excluded sources. - inputs = OrderedSet(inputs) - sources.update(inputs) - if not spec.get("msvs_external_builder"): - excluded_sources.update(inputs) - if int(a.get("process_outputs_as_sources", False)): - _AddNormalizedSources(sources, a.get("outputs", [])) - # Add in 'copies' inputs and outputs. - for cpy in spec.get("copies", []): - _AddNormalizedSources(sources, cpy.get("files", [])) - return (sources, excluded_sources) - - -def _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, gyp_dir, sources, excluded_sources, list_excluded, version -): - """Adjusts the list of sources and excluded sources. - - Also converts the sets to lists. - - Arguments: - spec: The target dictionary containing the properties of the target. - options: Global generator options. - gyp_dir: The path to the gyp file being processed. - sources: A set of sources to be included for this project. - excluded_sources: A set of sources to be excluded for this project. - version: A MSVSVersion object. - Returns: - A trio of (list of sources, list of excluded sources, - path of excluded IDL file) - """ - # Exclude excluded sources coming into the generator. - excluded_sources.update(OrderedSet(spec.get("sources_excluded", []))) - # Add excluded sources into sources for good measure. - sources.update(excluded_sources) - # Convert to proper windows form. - # NOTE: sources goes from being a set to a list here. - # NOTE: excluded_sources goes from being a set to a list here. - sources = _FixPaths(sources) - # Convert to proper windows form. - excluded_sources = _FixPaths(excluded_sources) - - excluded_idl = _IdlFilesHandledNonNatively(spec, sources) - - precompiled_related = _GetPrecompileRelatedFiles(spec) - # Find the excluded ones, minus the precompiled header related ones. - fully_excluded = [i for i in excluded_sources if i not in precompiled_related] - - # Convert to folders and the right slashes. - sources = [i.split("\\") for i in sources] - sources = _ConvertSourcesToFilterHierarchy( - sources, - excluded=fully_excluded, - list_excluded=list_excluded, - msvs_version=version, - ) - - # Prune filters with a single child to flatten ugly directory structures - # such as ../../src/modules/module1 etc. - if version.UsesVcxproj(): - while ( - all([isinstance(s, MSVSProject.Filter) for s in sources]) - and len({s.name for s in sources}) == 1 - ): - assert all([len(s.contents) == 1 for s in sources]) - sources = [s.contents[0] for s in sources] - else: - while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter): - sources = sources[0].contents - - return sources, excluded_sources, excluded_idl - - -def _IdlFilesHandledNonNatively(spec, sources): - # If any non-native rules use 'idl' as an extension exclude idl files. - # Gather a list here to use later. - using_idl = False - for rule in spec.get("rules", []): - if rule["extension"] == "idl" and int(rule.get("msvs_external_rule", 0)): - using_idl = True - break - if using_idl: - excluded_idl = [i for i in sources if i.endswith(".idl")] - else: - excluded_idl = [] - return excluded_idl - - -def _GetPrecompileRelatedFiles(spec): - # Gather a list of precompiled header related sources. - precompiled_related = [] - for _, config in spec["configurations"].items(): - for k in precomp_keys: - f = config.get(k) - if f: - precompiled_related.append(_FixPath(f)) - return precompiled_related - - -def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded): - exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) - for file_name, excluded_configs in exclusions.items(): - if not list_excluded and len(excluded_configs) == len(spec["configurations"]): - # If we're not listing excluded files, then they won't appear in the - # project, so don't try to configure them to be excluded. - pass - else: - for config_name, config in excluded_configs: - p.AddFileConfig( - file_name, - _ConfigFullName(config_name, config), - {"ExcludedFromBuild": "true"}, - ) - - -def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl): - exclusions = {} - # Exclude excluded sources from being built. - for f in excluded_sources: - excluded_configs = [] - for config_name, config in spec["configurations"].items(): - precomped = [_FixPath(config.get(i, "")) for i in precomp_keys] - # Don't do this for ones that are precompiled header related. - if f not in precomped: - excluded_configs.append((config_name, config)) - exclusions[f] = excluded_configs - # If any non-native rules use 'idl' as an extension exclude idl files. - # Exclude them now. - for f in excluded_idl: - excluded_configs = [] - for config_name, config in spec["configurations"].items(): - excluded_configs.append((config_name, config)) - exclusions[f] = excluded_configs - return exclusions - - -def _AddToolFilesToMSVS(p, spec): - # Add in tool files (rules). - tool_files = OrderedSet() - for _, config in spec["configurations"].items(): - for f in config.get("msvs_tool_files", []): - tool_files.add(f) - for f in tool_files: - p.AddToolFile(f) - - -def _HandlePreCompiledHeaders(p, sources, spec): - # Pre-compiled header source stubs need a different compiler flag - # (generate precompiled header) and any source file not of the same - # kind (i.e. C vs. C++) as the precompiled header source stub needs - # to have use of precompiled headers disabled. - extensions_excluded_from_precompile = [] - for config_name, config in spec["configurations"].items(): - source = config.get("msvs_precompiled_source") - if source: - source = _FixPath(source) - # UsePrecompiledHeader=1 for if using precompiled headers. - tool = MSVSProject.Tool("VCCLCompilerTool", {"UsePrecompiledHeader": "1"}) - p.AddFileConfig( - source, _ConfigFullName(config_name, config), {}, tools=[tool] - ) - basename, extension = os.path.splitext(source) - if extension == ".c": - extensions_excluded_from_precompile = [".cc", ".cpp", ".cxx"] - else: - extensions_excluded_from_precompile = [".c"] - - def DisableForSourceTree(source_tree): - for source in source_tree: - if isinstance(source, MSVSProject.Filter): - DisableForSourceTree(source.contents) - else: - basename, extension = os.path.splitext(source) - if extension in extensions_excluded_from_precompile: - for config_name, config in spec["configurations"].items(): - tool = MSVSProject.Tool( - "VCCLCompilerTool", - { - "UsePrecompiledHeader": "0", - "ForcedIncludeFiles": "$(NOINHERIT)", - }, - ) - p.AddFileConfig( - _FixPath(source), - _ConfigFullName(config_name, config), - {}, - tools=[tool], - ) - - # Do nothing if there was no precompiled source. - if extensions_excluded_from_precompile: - DisableForSourceTree(sources) - - -def _AddActions(actions_to_add, spec, relative_path_of_gyp_file): - # Add actions. - actions = spec.get("actions", []) - # Don't setup_env every time. When all the actions are run together in one - # batch file in VS, the PATH will grow too long. - # Membership in this set means that the cygwin environment has been set up, - # and does not need to be set up again. - have_setup_env = set() - for a in actions: - # Attach actions to the gyp file if nothing else is there. - inputs = a.get("inputs") or [relative_path_of_gyp_file] - attached_to = inputs[0] - need_setup_env = attached_to not in have_setup_env - cmd = _BuildCommandLineForRule( - spec, a, has_input_path=False, do_setup_env=need_setup_env - ) - have_setup_env.add(attached_to) - # Add the action. - _AddActionStep( - actions_to_add, - inputs=inputs, - outputs=a.get("outputs", []), - description=a.get("message", a["action_name"]), - command=cmd, - ) - - -def _WriteMSVSUserFile(project_path, version, spec): - # Add run_as and test targets. - if "run_as" in spec: - run_as = spec["run_as"] - action = run_as.get("action", []) - environment = run_as.get("environment", []) - working_directory = run_as.get("working_directory", ".") - elif int(spec.get("test", 0)): - action = ["$(TargetPath)", "--gtest_print_time"] - environment = [] - working_directory = "." - else: - return # Nothing to add - # Write out the user file. - user_file = _CreateMSVSUserFile(project_path, version, spec) - for config_name, c_data in spec["configurations"].items(): - user_file.AddDebugSettings( - _ConfigFullName(config_name, c_data), action, environment, working_directory - ) - user_file.WriteIfChanged() - - -def _AddCopies(actions_to_add, spec): - copies = _GetCopies(spec) - for inputs, outputs, cmd, description in copies: - _AddActionStep( - actions_to_add, - inputs=inputs, - outputs=outputs, - description=description, - command=cmd, - ) - - -def _GetCopies(spec): - copies = [] - # Add copies. - for cpy in spec.get("copies", []): - for src in cpy.get("files", []): - dst = os.path.join(cpy["destination"], os.path.basename(src)) - # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and - # outputs, so do the same for our generated command line. - if src.endswith("/"): - src_bare = src[:-1] - base_dir = posixpath.split(src_bare)[0] - outer_dir = posixpath.split(src_bare)[1] - fixed_dst = _FixPath(dst) - full_dst = f'"{fixed_dst}\\{outer_dir}\\"' - cmd = 'mkdir {} 2>nul & cd "{}" && xcopy /e /f /y "{}" {}'.format( - full_dst, - _FixPath(base_dir), - outer_dir, - full_dst, - ) - copies.append( - ( - [src], - ["dummy_copies", dst], - cmd, - f"Copying {src} to {fixed_dst}", - ) - ) - else: - fix_dst = _FixPath(cpy["destination"]) - cmd = 'mkdir "{}" 2>nul & set ERRORLEVEL=0 & copy /Y "{}" "{}"'.format( - fix_dst, - _FixPath(src), - _FixPath(dst), - ) - copies.append(([src], [dst], cmd, f"Copying {src} to {fix_dst}")) - return copies - - -def _GetPathDict(root, path): - # |path| will eventually be empty (in the recursive calls) if it was initially - # relative; otherwise it will eventually end up as '\', 'D:\', etc. - if not path or path.endswith(os.sep): - return root - parent, folder = os.path.split(path) - parent_dict = _GetPathDict(root, parent) - if folder not in parent_dict: - parent_dict[folder] = dict() - return parent_dict[folder] - - -def _DictsToFolders(base_path, bucket, flat): - # Convert to folders recursively. - children = [] - for folder, contents in bucket.items(): - if type(contents) == dict: - folder_children = _DictsToFolders( - os.path.join(base_path, folder), contents, flat - ) - if flat: - children += folder_children - else: - folder_children = MSVSNew.MSVSFolder( - os.path.join(base_path, folder), - name="(" + folder + ")", - entries=folder_children, - ) - children.append(folder_children) - else: - children.append(contents) - return children - - -def _CollapseSingles(parent, node): - # Recursively explorer the tree of dicts looking for projects which are - # the sole item in a folder which has the same name as the project. Bring - # such projects up one level. - if type(node) == dict and len(node) == 1 and next(iter(node)) == parent + ".vcproj": - return node[next(iter(node))] - if type(node) != dict: - return node - for child in node: - node[child] = _CollapseSingles(child, node[child]) - return node - - -def _GatherSolutionFolders(sln_projects, project_objects, flat): - root = {} - # Convert into a tree of dicts on path. - for p in sln_projects: - gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2] - if p.endswith("#host"): - target += "_host" - gyp_dir = os.path.dirname(gyp_file) - path_dict = _GetPathDict(root, gyp_dir) - path_dict[target + ".vcproj"] = project_objects[p] - # Walk down from the top until we hit a folder that has more than one entry. - # In practice, this strips the top-level "src/" dir from the hierarchy in - # the solution. - while len(root) == 1 and type(root[next(iter(root))]) == dict: - root = root[next(iter(root))] - # Collapse singles. - root = _CollapseSingles("", root) - # Merge buckets until everything is a root entry. - return _DictsToFolders("", root, flat) - - -def _GetPathOfProject(qualified_target, spec, options, msvs_version): - default_config = _GetDefaultConfiguration(spec) - proj_filename = default_config.get("msvs_existing_vcproj") - if not proj_filename: - proj_filename = spec["target_name"] - if spec["toolset"] == "host": - proj_filename += "_host" - proj_filename = proj_filename + options.suffix + msvs_version.ProjectExtension() - - build_file = gyp.common.BuildFile(qualified_target) - proj_path = os.path.join(os.path.dirname(build_file), proj_filename) - fix_prefix = None - if options.generator_output: - project_dir_path = os.path.dirname(os.path.abspath(proj_path)) - proj_path = os.path.join(options.generator_output, proj_path) - fix_prefix = gyp.common.RelativePath( - project_dir_path, os.path.dirname(proj_path) - ) - return proj_path, fix_prefix - - -def _GetPlatformOverridesOfProject(spec): - # Prepare a dict indicating which project configurations are used for which - # solution configurations for this target. - config_platform_overrides = {} - for config_name, c in spec["configurations"].items(): - config_fullname = _ConfigFullName(config_name, c) - platform = c.get("msvs_target_platform", _ConfigPlatform(c)) - fixed_config_fullname = "{}|{}".format( - _ConfigBaseName(config_name, _ConfigPlatform(c)), - platform, - ) - if spec["toolset"] == "host" and generator_supports_multiple_toolsets: - fixed_config_fullname = f"{config_name}|x64" - config_platform_overrides[config_fullname] = fixed_config_fullname - return config_platform_overrides - - -def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): - """Create a MSVSProject object for the targets found in target list. - - Arguments: - target_list: the list of targets to generate project objects for. - target_dicts: the dictionary of specifications. - options: global generator options. - msvs_version: the MSVSVersion object. - Returns: - A set of created projects, keyed by target. - """ - global fixpath_prefix - # Generate each project. - projects = {} - for qualified_target in target_list: - spec = target_dicts[qualified_target] - proj_path, fixpath_prefix = _GetPathOfProject( - qualified_target, spec, options, msvs_version - ) - guid = _GetGuidOfProject(proj_path, spec) - overrides = _GetPlatformOverridesOfProject(spec) - build_file = gyp.common.BuildFile(qualified_target) - # Create object for this project. - target_name = spec["target_name"] - if spec["toolset"] == "host": - target_name += "_host" - obj = MSVSNew.MSVSProject( - proj_path, - name=target_name, - guid=guid, - spec=spec, - build_file=build_file, - config_platform_overrides=overrides, - fixpath_prefix=fixpath_prefix, - ) - # Set project toolset if any (MS build only) - if msvs_version.UsesVcxproj(): - obj.set_msbuild_toolset( - _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version) - ) - projects[qualified_target] = obj - # Set all the dependencies, but not if we are using an external builder like - # ninja - for project in projects.values(): - if not project.spec.get("msvs_external_builder"): - deps = project.spec.get("dependencies", []) - deps = [projects[d] for d in deps] - project.set_dependencies(deps) - return projects - - -def _InitNinjaFlavor(params, target_list, target_dicts): - """Initialize targets for the ninja flavor. - - This sets up the necessary variables in the targets to generate msvs projects - that use ninja as an external builder. The variables in the spec are only set - if they have not been set. This allows individual specs to override the - default values initialized here. - Arguments: - params: Params provided to the generator. - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - """ - for qualified_target in target_list: - spec = target_dicts[qualified_target] - if spec.get("msvs_external_builder"): - # The spec explicitly defined an external builder, so don't change it. - continue - - path_to_ninja = spec.get("msvs_path_to_ninja", "ninja.exe") - - spec["msvs_external_builder"] = "ninja" - if not spec.get("msvs_external_builder_out_dir"): - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - gyp_dir = os.path.dirname(gyp_file) - configuration = "$(Configuration)" - if params.get("target_arch") == "x64": - configuration += "_x64" - if params.get("target_arch") == "arm64": - configuration += "_arm64" - spec["msvs_external_builder_out_dir"] = os.path.join( - gyp.common.RelativePath(params["options"].toplevel_dir, gyp_dir), - ninja_generator.ComputeOutputDir(params), - configuration, - ) - if not spec.get("msvs_external_builder_build_cmd"): - spec["msvs_external_builder_build_cmd"] = [ - path_to_ninja, - "-C", - "$(OutDir)", - "$(ProjectName)", - ] - if not spec.get("msvs_external_builder_clean_cmd"): - spec["msvs_external_builder_clean_cmd"] = [ - path_to_ninja, - "-C", - "$(OutDir)", - "-tclean", - "$(ProjectName)", - ] - - -def CalculateVariables(default_variables, params): - """Generated variables that require params to be known.""" - - generator_flags = params.get("generator_flags", {}) - - # Select project file format version (if unset, default to auto detecting). - msvs_version = MSVSVersion.SelectVisualStudioVersion( - generator_flags.get("msvs_version", "auto") - ) - # Stash msvs_version for later (so we don't have to probe the system twice). - params["msvs_version"] = msvs_version - - # Set a variable so conditions can be based on msvs_version. - default_variables["MSVS_VERSION"] = msvs_version.ShortName() - - # To determine processor word size on Windows, in addition to checking - # PROCESSOR_ARCHITECTURE (which reflects the word size of the current - # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which - # contains the actual word size of the system when running thru WOW64). - if ( - os.environ.get("PROCESSOR_ARCHITECTURE", "").find("64") >= 0 - or os.environ.get("PROCESSOR_ARCHITEW6432", "").find("64") >= 0 - ): - default_variables["MSVS_OS_BITS"] = 64 - else: - default_variables["MSVS_OS_BITS"] = 32 - - if gyp.common.GetFlavor(params) == "ninja": - default_variables["SHARED_INTERMEDIATE_DIR"] = "$(OutDir)gen" - - -def PerformBuild(data, configurations, params): - options = params["options"] - msvs_version = params["msvs_version"] - devenv = os.path.join(msvs_version.path, "Common7", "IDE", "devenv.com") - - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != ".gyp": - continue - sln_path = build_file_root + options.suffix + ".sln" - if options.generator_output: - sln_path = os.path.join(options.generator_output, sln_path) - - for config in configurations: - arguments = [devenv, sln_path, "/Build", config] - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def CalculateGeneratorInputInfo(params): - if params.get("flavor") == "ninja": - toplevel = params["options"].toplevel_dir - qualified_out_dir = os.path.normpath( - os.path.join( - toplevel, - ninja_generator.ComputeOutputDir(params), - "gypfiles-msvs-ninja", - ) - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def GenerateOutput(target_list, target_dicts, data, params): - """Generate .sln and .vcproj files. - - This is the entry point for this generator. - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - data: Dictionary containing per .gyp data. - """ - global fixpath_prefix - - options = params["options"] - - # Get the project file format version back out of where we stashed it in - # GeneratorCalculatedVariables. - msvs_version = params["msvs_version"] - - generator_flags = params.get("generator_flags", {}) - - # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT. - (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts) - - # Optionally use the large PDB workaround for targets marked with - # 'msvs_large_pdb': 1. - (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims( - target_list, target_dicts, generator_default_variables - ) - - # Optionally configure each spec to use ninja as the external builder. - if params.get("flavor") == "ninja": - _InitNinjaFlavor(params, target_list, target_dicts) - - # Prepare the set of configurations. - configs = set() - for qualified_target in target_list: - spec = target_dicts[qualified_target] - for config_name, config in spec["configurations"].items(): - config_name = _ConfigFullName(config_name, config) - configs.add(config_name) - if config_name == "Release|arm64": - configs.add("Release|x64") - configs = list(configs) - - # Figure out all the projects that will be generated and their guids - project_objects = _CreateProjectObjects( - target_list, target_dicts, options, msvs_version - ) - - # Generate each project. - missing_sources = [] - for project in project_objects.values(): - fixpath_prefix = project.fixpath_prefix - missing_sources.extend( - _GenerateProject(project, options, msvs_version, generator_flags, spec) - ) - fixpath_prefix = None - - for build_file in data: - # Validate build_file extension - target_only_configs = configs - if generator_supports_multiple_toolsets: - target_only_configs = [i for i in configs if i.endswith("arm64")] - if not build_file.endswith(".gyp"): - continue - sln_path = os.path.splitext(build_file)[0] + options.suffix + ".sln" - if options.generator_output: - sln_path = os.path.join(options.generator_output, sln_path) - # Get projects in the solution, and their dependents. - sln_projects = gyp.common.BuildFileTargets(target_list, build_file) - sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects) - # Create folder hierarchy. - root_entries = _GatherSolutionFolders( - sln_projects, project_objects, flat=msvs_version.FlatSolution() - ) - # Create solution. - sln = MSVSNew.MSVSSolution( - sln_path, - entries=root_entries, - variants=target_only_configs, - websiteProperties=False, - version=msvs_version, - ) - sln.Write() - - if missing_sources: - error_message = "Missing input files:\n" + "\n".join(set(missing_sources)) - if generator_flags.get("msvs_error_on_missing_sources", False): - raise GypError(error_message) - else: - print("Warning: " + error_message, file=sys.stdout) - - -def _GenerateMSBuildFiltersFile( - filters_path, - source_files, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, -): - """Generate the filters file. - - This file is used by Visual Studio to organize the presentation of source - files into folders. - - Arguments: - filters_path: The path of the file to be created. - source_files: The hierarchical structure of all the sources. - extension_to_rule_name: A dictionary mapping file extensions to rules. - """ - filter_group = [] - source_group = [] - _AppendFiltersForMSBuild( - "", - source_files, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - filter_group, - source_group, - ) - if filter_group: - content = [ - "Project", - { - "ToolsVersion": "4.0", - "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", - }, - ["ItemGroup"] + filter_group, - ["ItemGroup"] + source_group, - ] - easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True) - elif os.path.exists(filters_path): - # We don't need this filter anymore. Delete the old filter file. - os.unlink(filters_path) - - -def _AppendFiltersForMSBuild( - parent_filter_name, - sources, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - filter_group, - source_group, -): - """Creates the list of filters and sources to be added in the filter file. - - Args: - parent_filter_name: The name of the filter under which the sources are - found. - sources: The hierarchy of filters and sources to process. - extension_to_rule_name: A dictionary mapping file extensions to rules. - filter_group: The list to which filter entries will be appended. - source_group: The list to which source entries will be appended. - """ - for source in sources: - if isinstance(source, MSVSProject.Filter): - # We have a sub-filter. Create the name of that sub-filter. - if not parent_filter_name: - filter_name = source.name - else: - filter_name = f"{parent_filter_name}\\{source.name}" - # Add the filter to the group. - filter_group.append( - [ - "Filter", - {"Include": filter_name}, - ["UniqueIdentifier", MSVSNew.MakeGuid(source.name)], - ] - ) - # Recurse and add its dependents. - _AppendFiltersForMSBuild( - filter_name, - source.contents, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - filter_group, - source_group, - ) - else: - # It's a source. Create a source entry. - _, element = _MapFileToMsBuildSourceType( - source, rule_dependencies, extension_to_rule_name, platforms, toolset - ) - source_entry = [element, {"Include": source}] - # Specify the filter it is part of, if any. - if parent_filter_name: - source_entry.append(["Filter", parent_filter_name]) - source_group.append(source_entry) - - -def _MapFileToMsBuildSourceType( - source, rule_dependencies, extension_to_rule_name, platforms, toolset -): - """Returns the group and element type of the source file. - - Arguments: - source: The source file name. - extension_to_rule_name: A dictionary mapping file extensions to rules. - - Returns: - A pair of (group this file should be part of, the label of element) - """ - _, ext = os.path.splitext(source) - ext = ext.lower() - if ext in extension_to_rule_name: - group = "rule" - element = extension_to_rule_name[ext] - elif ext in [".cc", ".cpp", ".c", ".cxx", ".mm"]: - group = "compile" - element = "ClCompile" - elif ext in [".h", ".hxx"]: - group = "include" - element = "ClInclude" - elif ext == ".rc": - group = "resource" - element = "ResourceCompile" - elif ext in [".s", ".asm"]: - group = "masm" - element = "MASM" - if "arm64" in platforms and toolset == "target": - element = "MARMASM" - elif ext == ".idl": - group = "midl" - element = "Midl" - elif source in rule_dependencies: - group = "rule_dependency" - element = "CustomBuild" - else: - group = "none" - element = "None" - return (group, element) - - -def _GenerateRulesForMSBuild( - output_dir, - options, - spec, - sources, - excluded_sources, - props_files_of_rules, - targets_files_of_rules, - actions_to_add, - rule_dependencies, - extension_to_rule_name, -): - # MSBuild rules are implemented using three files: an XML file, a .targets - # file and a .props file. - # For more details see: - # https://devblogs.microsoft.com/cppblog/quick-help-on-vs2010-custom-build-rule/ - rules = spec.get("rules", []) - rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] - rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] - - msbuild_rules = [] - for rule in rules_native: - # Skip a rule with no action and no inputs. - if "action" not in rule and not rule.get("rule_sources", []): - continue - msbuild_rule = MSBuildRule(rule, spec) - msbuild_rules.append(msbuild_rule) - rule_dependencies.update(msbuild_rule.additional_dependencies.split(";")) - extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name - if msbuild_rules: - base = spec["target_name"] + options.suffix - props_name = base + ".props" - targets_name = base + ".targets" - xml_name = base + ".xml" - - props_files_of_rules.add(props_name) - targets_files_of_rules.add(targets_name) - - props_path = os.path.join(output_dir, props_name) - targets_path = os.path.join(output_dir, targets_name) - xml_path = os.path.join(output_dir, xml_name) - - _GenerateMSBuildRulePropsFile(props_path, msbuild_rules) - _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules) - _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules) - - if rules_external: - _GenerateExternalRules( - rules_external, output_dir, spec, sources, options, actions_to_add - ) - _AdjustSourcesForRules(rules, sources, excluded_sources, True) - - -class MSBuildRule: - """Used to store information used to generate an MSBuild rule. - - Attributes: - rule_name: The rule name, sanitized to use in XML. - target_name: The name of the target. - after_targets: The name of the AfterTargets element. - before_targets: The name of the BeforeTargets element. - depends_on: The name of the DependsOn element. - compute_output: The name of the ComputeOutput element. - dirs_to_make: The name of the DirsToMake element. - inputs: The name of the _inputs element. - tlog: The name of the _tlog element. - extension: The extension this rule applies to. - description: The message displayed when this rule is invoked. - additional_dependencies: A string listing additional dependencies. - outputs: The outputs of this rule. - command: The command used to run the rule. - """ - - def __init__(self, rule, spec): - self.display_name = rule["rule_name"] - # Assure that the rule name is only characters and numbers - self.rule_name = re.sub(r"\W", "_", self.display_name) - # Create the various element names, following the example set by the - # Visual Studio 2008 to 2010 conversion. I don't know if VS2010 - # is sensitive to the exact names. - self.target_name = "_" + self.rule_name - self.after_targets = self.rule_name + "AfterTargets" - self.before_targets = self.rule_name + "BeforeTargets" - self.depends_on = self.rule_name + "DependsOn" - self.compute_output = "Compute%sOutput" % self.rule_name - self.dirs_to_make = self.rule_name + "DirsToMake" - self.inputs = self.rule_name + "_inputs" - self.tlog = self.rule_name + "_tlog" - self.extension = rule["extension"] - if not self.extension.startswith("."): - self.extension = "." + self.extension - - self.description = MSVSSettings.ConvertVCMacrosToMSBuild( - rule.get("message", self.rule_name) - ) - old_additional_dependencies = _FixPaths(rule.get("inputs", [])) - self.additional_dependencies = ";".join( - [ - MSVSSettings.ConvertVCMacrosToMSBuild(i) - for i in old_additional_dependencies - ] - ) - old_outputs = _FixPaths(rule.get("outputs", [])) - self.outputs = ";".join( - [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_outputs] - ) - old_command = _BuildCommandLineForRule( - spec, rule, has_input_path=True, do_setup_env=True - ) - self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command) - - -def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules): - """Generate the .props file.""" - content = [ - "Project", - {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, - ] - for rule in msbuild_rules: - content.extend( - [ - [ - "PropertyGroup", - { - "Condition": "'$(%s)' == '' and '$(%s)' == '' and " - "'$(ConfigurationType)' != 'Makefile'" - % (rule.before_targets, rule.after_targets) - }, - [rule.before_targets, "Midl"], - [rule.after_targets, "CustomBuild"], - ], - [ - "PropertyGroup", - [ - rule.depends_on, - {"Condition": "'$(ConfigurationType)' != 'Makefile'"}, - "_SelectedFiles;$(%s)" % rule.depends_on, - ], - ], - [ - "ItemDefinitionGroup", - [ - rule.rule_name, - ["CommandLineTemplate", rule.command], - ["Outputs", rule.outputs], - ["ExecutionDescription", rule.description], - ["AdditionalDependencies", rule.additional_dependencies], - ], - ], - ] - ) - easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) - - -def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): - """Generate the .targets file.""" - content = [ - "Project", - {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, - ] - item_group = [ - "ItemGroup", - [ - "PropertyPageSchema", - {"Include": "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"}, - ], - ] - for rule in msbuild_rules: - item_group.append( - [ - "AvailableItemName", - {"Include": rule.rule_name}, - ["Targets", rule.target_name], - ] - ) - content.append(item_group) - - for rule in msbuild_rules: - content.append( - [ - "UsingTask", - { - "TaskName": rule.rule_name, - "TaskFactory": "XamlTaskFactory", - "AssemblyName": "Microsoft.Build.Tasks.v4.0", - }, - ["Task", "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"], - ] - ) - for rule in msbuild_rules: - rule_name = rule.rule_name - target_outputs = "%%(%s.Outputs)" % rule_name - target_inputs = ( - "%%(%s.Identity);%%(%s.AdditionalDependencies);" "$(MSBuildProjectFile)" - ) % (rule_name, rule_name) - rule_inputs = "%%(%s.Identity)" % rule_name - extension_condition = ( - "'%(Extension)'=='.obj' or " - "'%(Extension)'=='.res' or " - "'%(Extension)'=='.rsc' or " - "'%(Extension)'=='.lib'" - ) - remove_section = [ - "ItemGroup", - {"Condition": "'@(SelectedFiles)' != ''"}, - [ - rule_name, - { - "Remove": "@(%s)" % rule_name, - "Condition": "'%(Identity)' != '@(SelectedFiles)'", - }, - ], - ] - inputs_section = [ - "ItemGroup", - [rule.inputs, {"Include": "%%(%s.AdditionalDependencies)" % rule_name}], - ] - logging_section = [ - "ItemGroup", - [ - rule.tlog, - { - "Include": "%%(%s.Outputs)" % rule_name, - "Condition": ( - "'%%(%s.Outputs)' != '' and " - "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name) - ), - }, - ["Source", "@(%s, '|')" % rule_name], - ["Inputs", "@(%s -> '%%(Fullpath)', ';')" % rule.inputs], - ], - ] - message_section = [ - "Message", - {"Importance": "High", "Text": "%%(%s.ExecutionDescription)" % rule_name}, - ] - write_tlog_section = [ - "WriteLinesToFile", - { - "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule.tlog, rule.tlog), - "File": "$(IntDir)$(ProjectName).write.1.tlog", - "Lines": "^%%(%s.Source);@(%s->'%%(Fullpath)')" - % (rule.tlog, rule.tlog), - }, - ] - read_tlog_section = [ - "WriteLinesToFile", - { - "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule.tlog, rule.tlog), - "File": "$(IntDir)$(ProjectName).read.1.tlog", - "Lines": f"^%({rule.tlog}.Source);%({rule.tlog}.Inputs)", - }, - ] - command_and_input_section = [ - rule_name, - { - "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule_name, rule_name), - "EchoOff": "true", - "StandardOutputImportance": "High", - "StandardErrorImportance": "High", - "CommandLineTemplate": "%%(%s.CommandLineTemplate)" % rule_name, - "AdditionalOptions": "%%(%s.AdditionalOptions)" % rule_name, - "Inputs": rule_inputs, - }, - ] - content.extend( - [ - [ - "Target", - { - "Name": rule.target_name, - "BeforeTargets": "$(%s)" % rule.before_targets, - "AfterTargets": "$(%s)" % rule.after_targets, - "Condition": "'@(%s)' != ''" % rule_name, - "DependsOnTargets": "$(%s);%s" - % (rule.depends_on, rule.compute_output), - "Outputs": target_outputs, - "Inputs": target_inputs, - }, - remove_section, - inputs_section, - logging_section, - message_section, - write_tlog_section, - read_tlog_section, - command_and_input_section, - ], - [ - "PropertyGroup", - [ - "ComputeLinkInputsTargets", - "$(ComputeLinkInputsTargets);", - "%s;" % rule.compute_output, - ], - [ - "ComputeLibInputsTargets", - "$(ComputeLibInputsTargets);", - "%s;" % rule.compute_output, - ], - ], - [ - "Target", - { - "Name": rule.compute_output, - "Condition": "'@(%s)' != ''" % rule_name, - }, - [ - "ItemGroup", - [ - rule.dirs_to_make, - { - "Condition": "'@(%s)' != '' and " - "'%%(%s.ExcludedFromBuild)' != 'true'" - % (rule_name, rule_name), - "Include": "%%(%s.Outputs)" % rule_name, - }, - ], - [ - "Link", - { - "Include": "%%(%s.Identity)" % rule.dirs_to_make, - "Condition": extension_condition, - }, - ], - [ - "Lib", - { - "Include": "%%(%s.Identity)" % rule.dirs_to_make, - "Condition": extension_condition, - }, - ], - [ - "ImpLib", - { - "Include": "%%(%s.Identity)" % rule.dirs_to_make, - "Condition": extension_condition, - }, - ], - ], - [ - "MakeDir", - { - "Directories": ( - "@(%s->'%%(RootDir)%%(Directory)')" % rule.dirs_to_make - ) - }, - ], - ], - ] - ) - easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True) - - -def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules): - # Generate the .xml file - content = [ - "ProjectSchemaDefinitions", - { - "xmlns": ( - "clr-namespace:Microsoft.Build.Framework.XamlTypes;" - "assembly=Microsoft.Build.Framework" - ), - "xmlns:x": "http://schemas.microsoft.com/winfx/2006/xaml", - "xmlns:sys": "clr-namespace:System;assembly=mscorlib", - "xmlns:transformCallback": "Microsoft.Cpp.Dev10.ConvertPropertyCallback", - }, - ] - for rule in msbuild_rules: - content.extend( - [ - [ - "Rule", - { - "Name": rule.rule_name, - "PageTemplate": "tool", - "DisplayName": rule.display_name, - "Order": "200", - }, - [ - "Rule.DataSource", - [ - "DataSource", - {"Persistence": "ProjectFile", "ItemType": rule.rule_name}, - ], - ], - [ - "Rule.Categories", - [ - "Category", - {"Name": "General"}, - ["Category.DisplayName", ["sys:String", "General"]], - ], - [ - "Category", - {"Name": "Command Line", "Subtype": "CommandLine"}, - ["Category.DisplayName", ["sys:String", "Command Line"]], - ], - ], - [ - "StringListProperty", - { - "Name": "Inputs", - "Category": "Command Line", - "IsRequired": "true", - "Switch": " ", - }, - [ - "StringListProperty.DataSource", - [ - "DataSource", - { - "Persistence": "ProjectFile", - "ItemType": rule.rule_name, - "SourceType": "Item", - }, - ], - ], - ], - [ - "StringProperty", - { - "Name": "CommandLineTemplate", - "DisplayName": "Command Line", - "Visible": "False", - "IncludeInCommandLine": "False", - }, - ], - [ - "DynamicEnumProperty", - { - "Name": rule.before_targets, - "Category": "General", - "EnumProvider": "Targets", - "IncludeInCommandLine": "False", - }, - [ - "DynamicEnumProperty.DisplayName", - ["sys:String", "Execute Before"], - ], - [ - "DynamicEnumProperty.Description", - [ - "sys:String", - "Specifies the targets for the build customization" - " to run before.", - ], - ], - [ - "DynamicEnumProperty.ProviderSettings", - [ - "NameValuePair", - { - "Name": "Exclude", - "Value": "^%s|^Compute" % rule.before_targets, - }, - ], - ], - [ - "DynamicEnumProperty.DataSource", - [ - "DataSource", - { - "Persistence": "ProjectFile", - "HasConfigurationCondition": "true", - }, - ], - ], - ], - [ - "DynamicEnumProperty", - { - "Name": rule.after_targets, - "Category": "General", - "EnumProvider": "Targets", - "IncludeInCommandLine": "False", - }, - [ - "DynamicEnumProperty.DisplayName", - ["sys:String", "Execute After"], - ], - [ - "DynamicEnumProperty.Description", - [ - "sys:String", - ( - "Specifies the targets for the build customization" - " to run after." - ), - ], - ], - [ - "DynamicEnumProperty.ProviderSettings", - [ - "NameValuePair", - { - "Name": "Exclude", - "Value": "^%s|^Compute" % rule.after_targets, - }, - ], - ], - [ - "DynamicEnumProperty.DataSource", - [ - "DataSource", - { - "Persistence": "ProjectFile", - "ItemType": "", - "HasConfigurationCondition": "true", - }, - ], - ], - ], - [ - "StringListProperty", - { - "Name": "Outputs", - "DisplayName": "Outputs", - "Visible": "False", - "IncludeInCommandLine": "False", - }, - ], - [ - "StringProperty", - { - "Name": "ExecutionDescription", - "DisplayName": "Execution Description", - "Visible": "False", - "IncludeInCommandLine": "False", - }, - ], - [ - "StringListProperty", - { - "Name": "AdditionalDependencies", - "DisplayName": "Additional Dependencies", - "IncludeInCommandLine": "False", - "Visible": "false", - }, - ], - [ - "StringProperty", - { - "Subtype": "AdditionalOptions", - "Name": "AdditionalOptions", - "Category": "Command Line", - }, - [ - "StringProperty.DisplayName", - ["sys:String", "Additional Options"], - ], - [ - "StringProperty.Description", - ["sys:String", "Additional Options"], - ], - ], - ], - [ - "ItemType", - {"Name": rule.rule_name, "DisplayName": rule.display_name}, - ], - [ - "FileExtension", - {"Name": "*" + rule.extension, "ContentType": rule.rule_name}, - ], - [ - "ContentType", - { - "Name": rule.rule_name, - "DisplayName": "", - "ItemType": rule.rule_name, - }, - ], - ] - ) - easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True) - - -def _GetConfigurationAndPlatform(name, settings, spec): - configuration = name.rsplit("_", 1)[0] - platform = settings.get("msvs_configuration_platform", "Win32") - if spec["toolset"] == "host" and platform == "arm64": - platform = "x64" # Host-only tools are always built for x64 - return (configuration, platform) - - -def _GetConfigurationCondition(name, settings, spec): - return r"'$(Configuration)|$(Platform)'=='%s|%s'" % _GetConfigurationAndPlatform( - name, settings, spec - ) - - -def _GetMSBuildProjectConfigurations(configurations, spec): - group = ["ItemGroup", {"Label": "ProjectConfigurations"}] - for (name, settings) in sorted(configurations.items()): - configuration, platform = _GetConfigurationAndPlatform(name, settings, spec) - designation = f"{configuration}|{platform}" - group.append( - [ - "ProjectConfiguration", - {"Include": designation}, - ["Configuration", configuration], - ["Platform", platform], - ] - ) - return [group] - - -def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name): - namespace = os.path.splitext(gyp_file_name)[0] - properties = [ - [ - "PropertyGroup", - {"Label": "Globals"}, - ["ProjectGuid", guid], - ["Keyword", "Win32Proj"], - ["RootNamespace", namespace], - ["IgnoreWarnCompileDuplicatedFilename", "true"], - ] - ] - - if ( - os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" - or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" - ): - properties[0].append(["PreferredToolArchitecture", "x64"]) - - if spec.get("msvs_target_platform_version"): - target_platform_version = spec.get("msvs_target_platform_version") - properties[0].append(["WindowsTargetPlatformVersion", target_platform_version]) - if spec.get("msvs_target_platform_minversion"): - target_platform_minversion = spec.get("msvs_target_platform_minversion") - properties[0].append( - ["WindowsTargetPlatformMinVersion", target_platform_minversion] - ) - else: - properties[0].append( - ["WindowsTargetPlatformMinVersion", target_platform_version] - ) - - if spec.get("msvs_enable_winrt"): - properties[0].append(["DefaultLanguage", "en-US"]) - properties[0].append(["AppContainerApplication", "true"]) - if spec.get("msvs_application_type_revision"): - app_type_revision = spec.get("msvs_application_type_revision") - properties[0].append(["ApplicationTypeRevision", app_type_revision]) - else: - properties[0].append(["ApplicationTypeRevision", "8.1"]) - if spec.get("msvs_enable_winphone"): - properties[0].append(["ApplicationType", "Windows Phone"]) - else: - properties[0].append(["ApplicationType", "Windows Store"]) - - platform_name = None - msvs_windows_sdk_version = None - for configuration in spec["configurations"].values(): - platform_name = platform_name or _ConfigPlatform(configuration) - msvs_windows_sdk_version = ( - msvs_windows_sdk_version - or _ConfigWindowsTargetPlatformVersion(configuration, version) - ) - if platform_name and msvs_windows_sdk_version: - break - if msvs_windows_sdk_version: - properties[0].append( - ["WindowsTargetPlatformVersion", str(msvs_windows_sdk_version)] - ) - elif version.compatible_sdks: - raise GypError( - "%s requires any SDK of %s version, but none were found" - % (version.description, version.compatible_sdks) - ) - - if platform_name == "ARM": - properties[0].append(["WindowsSDKDesktopARMSupport", "true"]) - - return properties - - -def _GetMSBuildConfigurationDetails(spec, build_file): - properties = {} - for name, settings in spec["configurations"].items(): - msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file) - condition = _GetConfigurationCondition(name, settings, spec) - character_set = msbuild_attributes.get("CharacterSet") - config_type = msbuild_attributes.get("ConfigurationType") - _AddConditionalProperty(properties, condition, "ConfigurationType", config_type) - if config_type == "Driver": - _AddConditionalProperty(properties, condition, "DriverType", "WDM") - _AddConditionalProperty( - properties, condition, "TargetVersion", _ConfigTargetVersion(settings) - ) - if character_set: - if "msvs_enable_winrt" not in spec: - _AddConditionalProperty( - properties, condition, "CharacterSet", character_set - ) - return _GetMSBuildPropertyGroup(spec, "Configuration", properties) - - -def _GetMSBuildLocalProperties(msbuild_toolset): - # Currently the only local property we support is PlatformToolset - properties = {} - if msbuild_toolset: - properties = [ - [ - "PropertyGroup", - {"Label": "Locals"}, - ["PlatformToolset", msbuild_toolset], - ] - ] - return properties - - -def _GetMSBuildPropertySheets(configurations, spec): - user_props = r"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" - additional_props = {} - props_specified = False - for name, settings in sorted(configurations.items()): - configuration = _GetConfigurationCondition(name, settings, spec) - if "msbuild_props" in settings: - additional_props[configuration] = _FixPaths(settings["msbuild_props"]) - props_specified = True - else: - additional_props[configuration] = "" - - if not props_specified: - return [ - [ - "ImportGroup", - {"Label": "PropertySheets"}, - [ - "Import", - { - "Project": user_props, - "Condition": "exists('%s')" % user_props, - "Label": "LocalAppDataPlatform", - }, - ], - ] - ] - else: - sheets = [] - for condition, props in additional_props.items(): - import_group = [ - "ImportGroup", - {"Label": "PropertySheets", "Condition": condition}, - [ - "Import", - { - "Project": user_props, - "Condition": "exists('%s')" % user_props, - "Label": "LocalAppDataPlatform", - }, - ], - ] - for props_file in props: - import_group.append(["Import", {"Project": props_file}]) - sheets.append(import_group) - return sheets - - -def _ConvertMSVSBuildAttributes(spec, config, build_file): - config_type = _GetMSVSConfigurationType(spec, build_file) - msvs_attributes = _GetMSVSAttributes(spec, config, config_type) - msbuild_attributes = {} - for a in msvs_attributes: - if a in ["IntermediateDirectory", "OutputDirectory"]: - directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a]) - if not directory.endswith("\\"): - directory += "\\" - msbuild_attributes[a] = directory - elif a == "CharacterSet": - msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a]) - elif a == "ConfigurationType": - msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a]) - else: - print("Warning: Do not know how to convert MSVS attribute " + a) - return msbuild_attributes - - -def _ConvertMSVSCharacterSet(char_set): - if char_set.isdigit(): - char_set = {"0": "MultiByte", "1": "Unicode", "2": "MultiByte"}[char_set] - return char_set - - -def _ConvertMSVSConfigurationType(config_type): - if config_type.isdigit(): - config_type = { - "1": "Application", - "2": "DynamicLibrary", - "4": "StaticLibrary", - "5": "Driver", - "10": "Utility", - }[config_type] - return config_type - - -def _GetMSBuildAttributes(spec, config, build_file): - if "msbuild_configuration_attributes" not in config: - msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file) - - else: - config_type = _GetMSVSConfigurationType(spec, build_file) - config_type = _ConvertMSVSConfigurationType(config_type) - msbuild_attributes = config.get("msbuild_configuration_attributes", {}) - msbuild_attributes.setdefault("ConfigurationType", config_type) - output_dir = msbuild_attributes.get( - "OutputDirectory", "$(SolutionDir)$(Configuration)" - ) - msbuild_attributes["OutputDirectory"] = _FixPath(output_dir) + "\\" - if "IntermediateDirectory" not in msbuild_attributes: - intermediate = _FixPath("$(Configuration)") + "\\" - msbuild_attributes["IntermediateDirectory"] = intermediate - if "CharacterSet" in msbuild_attributes: - msbuild_attributes["CharacterSet"] = _ConvertMSVSCharacterSet( - msbuild_attributes["CharacterSet"] - ) - if "TargetName" not in msbuild_attributes: - prefix = spec.get("product_prefix", "") - product_name = spec.get("product_name", "$(ProjectName)") - target_name = prefix + product_name - msbuild_attributes["TargetName"] = target_name - if "TargetExt" not in msbuild_attributes and "product_extension" in spec: - ext = spec.get("product_extension") - msbuild_attributes["TargetExt"] = "." + ext - - if spec.get("msvs_external_builder"): - external_out_dir = spec.get("msvs_external_builder_out_dir", ".") - msbuild_attributes["OutputDirectory"] = _FixPath(external_out_dir) + "\\" - - # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' - # (depending on the tool used) to avoid MSB8012 warning. - msbuild_tool_map = { - "executable": "Link", - "shared_library": "Link", - "loadable_module": "Link", - "windows_driver": "Link", - "static_library": "Lib", - } - msbuild_tool = msbuild_tool_map.get(spec["type"]) - if msbuild_tool: - msbuild_settings = config["finalized_msbuild_settings"] - out_file = msbuild_settings[msbuild_tool].get("OutputFile") - if out_file: - msbuild_attributes["TargetPath"] = _FixPath(out_file) - target_ext = msbuild_settings[msbuild_tool].get("TargetExt") - if target_ext: - msbuild_attributes["TargetExt"] = target_ext - - return msbuild_attributes - - -def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): - # TODO(jeanluc) We could optimize out the following and do it only if - # there are actions. - # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'. - new_paths = [] - cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."])[0] - if cygwin_dirs: - cyg_path = "$(MSBuildProjectDirectory)\\%s\\bin\\" % _FixPath(cygwin_dirs) - new_paths.append(cyg_path) - # TODO(jeanluc) Change the convention to have both a cygwin_dir and a - # python_dir. - python_path = cyg_path.replace("cygwin\\bin", "python_26") - new_paths.append(python_path) - if new_paths: - new_paths = "$(ExecutablePath);" + ";".join(new_paths) - - properties = {} - for (name, configuration) in sorted(configurations.items()): - condition = _GetConfigurationCondition(name, configuration, spec) - attributes = _GetMSBuildAttributes(spec, configuration, build_file) - msbuild_settings = configuration["finalized_msbuild_settings"] - _AddConditionalProperty( - properties, condition, "IntDir", attributes["IntermediateDirectory"] - ) - _AddConditionalProperty( - properties, condition, "OutDir", attributes["OutputDirectory"] - ) - _AddConditionalProperty( - properties, condition, "TargetName", attributes["TargetName"] - ) - if "TargetExt" in attributes: - _AddConditionalProperty( - properties, condition, "TargetExt", attributes["TargetExt"] - ) - - if attributes.get("TargetPath"): - _AddConditionalProperty( - properties, condition, "TargetPath", attributes["TargetPath"] - ) - if attributes.get("TargetExt"): - _AddConditionalProperty( - properties, condition, "TargetExt", attributes["TargetExt"] - ) - - if new_paths: - _AddConditionalProperty(properties, condition, "ExecutablePath", new_paths) - tool_settings = msbuild_settings.get("", {}) - for name, value in sorted(tool_settings.items()): - formatted_value = _GetValueFormattedForMSBuild("", name, value) - _AddConditionalProperty(properties, condition, name, formatted_value) - return _GetMSBuildPropertyGroup(spec, None, properties) - - -def _AddConditionalProperty(properties, condition, name, value): - """Adds a property / conditional value pair to a dictionary. - - Arguments: - properties: The dictionary to be modified. The key is the name of the - property. The value is itself a dictionary; its key is the value and - the value a list of condition for which this value is true. - condition: The condition under which the named property has the value. - name: The name of the property. - value: The value of the property. - """ - if name not in properties: - properties[name] = {} - values = properties[name] - if value not in values: - values[value] = [] - conditions = values[value] - conditions.append(condition) - - -# Regex for msvs variable references ( i.e. $(FOO) ). -MSVS_VARIABLE_REFERENCE = re.compile(r"\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)") - - -def _GetMSBuildPropertyGroup(spec, label, properties): - """Returns a PropertyGroup definition for the specified properties. - - Arguments: - spec: The target project dict. - label: An optional label for the PropertyGroup. - properties: The dictionary to be converted. The key is the name of the - property. The value is itself a dictionary; its key is the value and - the value a list of condition for which this value is true. - """ - group = ["PropertyGroup"] - if label: - group.append({"Label": label}) - num_configurations = len(spec["configurations"]) - - def GetEdges(node): - # Use a definition of edges such that user_of_variable -> used_varible. - # This happens to be easier in this case, since a variable's - # definition contains all variables it references in a single string. - edges = set() - for value in sorted(properties[node].keys()): - # Add to edges all $(...) references to variables. - # - # Variable references that refer to names not in properties are excluded - # These can exist for instance to refer built in definitions like - # $(SolutionDir). - # - # Self references are ignored. Self reference is used in a few places to - # append to the default value. I.e. PATH=$(PATH);other_path - edges.update( - { - v - for v in MSVS_VARIABLE_REFERENCE.findall(value) - if v in properties and v != node - } - ) - return edges - - properties_ordered = gyp.common.TopologicallySorted(properties.keys(), GetEdges) - # Walk properties in the reverse of a topological sort on - # user_of_variable -> used_variable as this ensures variables are - # defined before they are used. - # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) - for name in reversed(properties_ordered): - values = properties[name] - for value, conditions in sorted(values.items()): - if len(conditions) == num_configurations: - # If the value is the same all configurations, - # just add one unconditional entry. - group.append([name, value]) - else: - for condition in conditions: - group.append([name, {"Condition": condition}, value]) - return [group] - - -def _GetMSBuildToolSettingsSections(spec, configurations): - groups = [] - for (name, configuration) in sorted(configurations.items()): - msbuild_settings = configuration["finalized_msbuild_settings"] - group = [ - "ItemDefinitionGroup", - {"Condition": _GetConfigurationCondition(name, configuration, spec)}, - ] - for tool_name, tool_settings in sorted(msbuild_settings.items()): - # Skip the tool named '' which is a holder of global settings handled - # by _GetMSBuildConfigurationGlobalProperties. - if tool_name: - if tool_settings: - tool = [tool_name] - for name, value in sorted(tool_settings.items()): - formatted_value = _GetValueFormattedForMSBuild( - tool_name, name, value - ) - tool.append([name, formatted_value]) - group.append(tool) - groups.append(group) - return groups - - -def _FinalizeMSBuildSettings(spec, configuration): - if "msbuild_settings" in configuration: - converted = False - msbuild_settings = configuration["msbuild_settings"] - MSVSSettings.ValidateMSBuildSettings(msbuild_settings) - else: - converted = True - msvs_settings = configuration.get("msvs_settings", {}) - msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings) - include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs( - configuration - ) - libraries = _GetLibraries(spec) - library_dirs = _GetLibraryDirs(configuration) - out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True) - target_ext = _GetOutputTargetExt(spec) - defines = _GetDefines(configuration) - if converted: - # Visual Studio 2010 has TR1 - defines = [d for d in defines if d != "_HAS_TR1=0"] - # Warn of ignored settings - ignored_settings = ["msvs_tool_files"] - for ignored_setting in ignored_settings: - value = configuration.get(ignored_setting) - if value: - print( - "Warning: The automatic conversion to MSBuild does not handle " - "%s. Ignoring setting of %s" % (ignored_setting, str(value)) - ) - - defines = [_EscapeCppDefineForMSBuild(d) for d in defines] - disabled_warnings = _GetDisabledWarnings(configuration) - prebuild = configuration.get("msvs_prebuild") - postbuild = configuration.get("msvs_postbuild") - def_file = _GetModuleDefinition(spec) - precompiled_header = configuration.get("msvs_precompiled_header") - - # Add the information to the appropriate tool - # TODO(jeanluc) We could optimize and generate these settings only if - # the corresponding files are found, e.g. don't generate ResourceCompile - # if you don't have any resources. - _ToolAppend( - msbuild_settings, "ClCompile", "AdditionalIncludeDirectories", include_dirs - ) - _ToolAppend( - msbuild_settings, "Midl", "AdditionalIncludeDirectories", midl_include_dirs - ) - _ToolAppend( - msbuild_settings, - "ResourceCompile", - "AdditionalIncludeDirectories", - resource_include_dirs, - ) - # Add in libraries, note that even for empty libraries, we want this - # set, to prevent inheriting default libraries from the environment. - _ToolSetOrAppend(msbuild_settings, "Link", "AdditionalDependencies", libraries) - _ToolAppend(msbuild_settings, "Link", "AdditionalLibraryDirectories", library_dirs) - if out_file: - _ToolAppend( - msbuild_settings, msbuild_tool, "OutputFile", out_file, only_if_unset=True - ) - if target_ext: - _ToolAppend( - msbuild_settings, msbuild_tool, "TargetExt", target_ext, only_if_unset=True - ) - # Add defines. - _ToolAppend(msbuild_settings, "ClCompile", "PreprocessorDefinitions", defines) - _ToolAppend(msbuild_settings, "ResourceCompile", "PreprocessorDefinitions", defines) - # Add disabled warnings. - _ToolAppend( - msbuild_settings, "ClCompile", "DisableSpecificWarnings", disabled_warnings - ) - # Turn on precompiled headers if appropriate. - if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] - _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use") - _ToolAppend( - msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header - ) - _ToolAppend( - msbuild_settings, "ClCompile", "ForcedIncludeFiles", [precompiled_header] - ) - else: - _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "NotUsing") - # Turn off WinRT compilation - _ToolAppend(msbuild_settings, "ClCompile", "CompileAsWinRT", "false") - # Turn on import libraries if appropriate - if spec.get("msvs_requires_importlibrary"): - _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "false") - # Loadable modules don't generate import libraries; - # tell dependent projects to not expect one. - if spec["type"] == "loadable_module": - _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "true") - # Set the module definition file if any. - if def_file: - _ToolAppend(msbuild_settings, "Link", "ModuleDefinitionFile", def_file) - configuration["finalized_msbuild_settings"] = msbuild_settings - if prebuild: - _ToolAppend(msbuild_settings, "PreBuildEvent", "Command", prebuild) - if postbuild: - _ToolAppend(msbuild_settings, "PostBuildEvent", "Command", postbuild) - - -def _GetValueFormattedForMSBuild(tool_name, name, value): - if type(value) == list: - # For some settings, VS2010 does not automatically extends the settings - # TODO(jeanluc) Is this what we want? - if name in [ - "AdditionalIncludeDirectories", - "AdditionalLibraryDirectories", - "AdditionalOptions", - "DelayLoadDLLs", - "DisableSpecificWarnings", - "PreprocessorDefinitions", - ]: - value.append("%%(%s)" % name) - # For most tools, entries in a list should be separated with ';' but some - # settings use a space. Check for those first. - exceptions = { - "ClCompile": ["AdditionalOptions"], - "Link": ["AdditionalOptions"], - "Lib": ["AdditionalOptions"], - } - if tool_name in exceptions and name in exceptions[tool_name]: - char = " " - else: - char = ";" - formatted_value = char.join( - [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value] - ) - else: - formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) - return formatted_value - - -def _VerifySourcesExist(sources, root_dir): - """Verifies that all source files exist on disk. - - Checks that all regular source files, i.e. not created at run time, - exist on disk. Missing files cause needless recompilation but no otherwise - visible errors. - - Arguments: - sources: A recursive list of Filter/file names. - root_dir: The root directory for the relative path names. - Returns: - A list of source files that cannot be found on disk. - """ - missing_sources = [] - for source in sources: - if isinstance(source, MSVSProject.Filter): - missing_sources.extend(_VerifySourcesExist(source.contents, root_dir)) - else: - if "$" not in source: - full_path = os.path.join(root_dir, source) - if not os.path.exists(full_path): - missing_sources.append(full_path) - return missing_sources - - -def _GetMSBuildSources( - spec, - sources, - exclusions, - rule_dependencies, - extension_to_rule_name, - actions_spec, - sources_handled_by_action, - list_excluded, -): - groups = [ - "none", - "masm", - "midl", - "include", - "compile", - "resource", - "rule", - "rule_dependency", - ] - grouped_sources = {} - for g in groups: - grouped_sources[g] = [] - - _AddSources2( - spec, - sources, - exclusions, - grouped_sources, - rule_dependencies, - extension_to_rule_name, - sources_handled_by_action, - list_excluded, - ) - sources = [] - for g in groups: - if grouped_sources[g]: - sources.append(["ItemGroup"] + grouped_sources[g]) - if actions_spec: - sources.append(["ItemGroup"] + actions_spec) - return sources - - -def _AddSources2( - spec, - sources, - exclusions, - grouped_sources, - rule_dependencies, - extension_to_rule_name, - sources_handled_by_action, - list_excluded, -): - extensions_excluded_from_precompile = [] - for source in sources: - if isinstance(source, MSVSProject.Filter): - _AddSources2( - spec, - source.contents, - exclusions, - grouped_sources, - rule_dependencies, - extension_to_rule_name, - sources_handled_by_action, - list_excluded, - ) - else: - if source not in sources_handled_by_action: - detail = [] - excluded_configurations = exclusions.get(source, []) - if len(excluded_configurations) == len(spec["configurations"]): - detail.append(["ExcludedFromBuild", "true"]) - else: - for config_name, configuration in sorted(excluded_configurations): - condition = _GetConfigurationCondition( - config_name, configuration - ) - detail.append( - ["ExcludedFromBuild", {"Condition": condition}, "true"] - ) - # Add precompile if needed - for config_name, configuration in spec["configurations"].items(): - precompiled_source = configuration.get( - "msvs_precompiled_source", "" - ) - if precompiled_source != "": - precompiled_source = _FixPath(precompiled_source) - if not extensions_excluded_from_precompile: - # If the precompiled header is generated by a C source, - # we must not try to use it for C++ sources, - # and vice versa. - basename, extension = os.path.splitext(precompiled_source) - if extension == ".c": - extensions_excluded_from_precompile = [ - ".cc", - ".cpp", - ".cxx", - ] - else: - extensions_excluded_from_precompile = [".c"] - - if precompiled_source == source: - condition = _GetConfigurationCondition( - config_name, configuration, spec - ) - detail.append( - ["PrecompiledHeader", {"Condition": condition}, "Create"] - ) - else: - # Turn off precompiled header usage for source files of a - # different type than the file that generated the - # precompiled header. - for extension in extensions_excluded_from_precompile: - if source.endswith(extension): - detail.append(["PrecompiledHeader", ""]) - detail.append(["ForcedIncludeFiles", ""]) - - group, element = _MapFileToMsBuildSourceType( - source, - rule_dependencies, - extension_to_rule_name, - _GetUniquePlatforms(spec), - spec["toolset"], - ) - if group == "compile" and not os.path.isabs(source): - # Add an value to support duplicate source - # file basenames, except for absolute paths to avoid paths - # with more than 260 characters. - file_name = os.path.splitext(source)[0] + ".obj" - if file_name.startswith("..\\"): - file_name = re.sub(r"^(\.\.\\)+", "", file_name) - elif file_name.startswith("$("): - file_name = re.sub(r"^\$\([^)]+\)\\", "", file_name) - detail.append(["ObjectFileName", "$(IntDir)\\" + file_name]) - grouped_sources[group].append([element, {"Include": source}] + detail) - - -def _GetMSBuildProjectReferences(project): - references = [] - if project.dependencies: - group = ["ItemGroup"] - added_dependency_set = set() - for dependency in project.dependencies: - dependency_spec = dependency.spec - should_skip_dep = False - if project.spec["toolset"] == "target": - if dependency_spec["toolset"] == "host": - if dependency_spec["type"] == "static_library": - should_skip_dep = True - if dependency.name.startswith("run_"): - should_skip_dep = False - if should_skip_dep: - continue - - canonical_name = dependency.name.replace("_host", "") - added_dependency_set.add(canonical_name) - guid = dependency.guid - project_dir = os.path.split(project.path)[0] - relative_path = gyp.common.RelativePath(dependency.path, project_dir) - project_ref = [ - "ProjectReference", - {"Include": relative_path}, - ["Project", guid], - ["ReferenceOutputAssembly", "false"], - ] - for config in dependency.spec.get("configurations", {}).values(): - if config.get("msvs_use_library_dependency_inputs", 0): - project_ref.append(["UseLibraryDependencyInputs", "true"]) - break - # If it's disabled in any config, turn it off in the reference. - if config.get("msvs_2010_disable_uldi_when_referenced", 0): - project_ref.append(["UseLibraryDependencyInputs", "false"]) - break - group.append(project_ref) - references.append(group) - return references - - -def _GenerateMSBuildProject(project, options, version, generator_flags, spec): - spec = project.spec - configurations = spec["configurations"] - toolset = spec["toolset"] - project_dir, project_file_name = os.path.split(project.path) - gyp.common.EnsureDirExists(project.path) - # Prepare list of sources and excluded sources. - - gyp_file = os.path.split(project.build_file)[1] - sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) - # Add rules. - actions_to_add = {} - props_files_of_rules = set() - targets_files_of_rules = set() - rule_dependencies = set() - extension_to_rule_name = {} - list_excluded = generator_flags.get("msvs_list_excluded_files", True) - platforms = _GetUniquePlatforms(spec) - - # Don't generate rules if we are using an external builder like ninja. - if not spec.get("msvs_external_builder"): - _GenerateRulesForMSBuild( - project_dir, - options, - spec, - sources, - excluded_sources, - props_files_of_rules, - targets_files_of_rules, - actions_to_add, - rule_dependencies, - extension_to_rule_name, - ) - else: - rules = spec.get("rules", []) - _AdjustSourcesForRules(rules, sources, excluded_sources, True) - - sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, project_dir, sources, excluded_sources, list_excluded, version - ) - - # Don't add actions if we are using an external builder like ninja. - if not spec.get("msvs_external_builder"): - _AddActions(actions_to_add, spec, project.build_file) - _AddCopies(actions_to_add, spec) - - # NOTE: this stanza must appear after all actions have been decided. - # Don't excluded sources with actions attached, or they won't run. - excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) - - exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) - actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild( - spec, actions_to_add - ) - - _GenerateMSBuildFiltersFile( - project.path + ".filters", - sources, - rule_dependencies, - extension_to_rule_name, - platforms, - toolset, - ) - missing_sources = _VerifySourcesExist(sources, project_dir) - - for configuration in configurations.values(): - _FinalizeMSBuildSettings(spec, configuration) - - # Add attributes to root element - - import_default_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.Default.props"}] - ] - import_cpp_props_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.props"}] - ] - import_cpp_targets_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.targets"}] - ] - import_masm_props_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.props"}] - ] - import_masm_targets_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.targets"}] - ] - import_marmasm_props_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.props"}] - ] - import_marmasm_targets_section = [ - ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.targets"}] - ] - macro_section = [["PropertyGroup", {"Label": "UserMacros"}]] - - content = [ - "Project", - { - "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", - "ToolsVersion": version.ProjectVersion(), - "DefaultTargets": "Build", - }, - ] - - content += _GetMSBuildProjectConfigurations(configurations, spec) - content += _GetMSBuildGlobalProperties( - spec, version, project.guid, project_file_name - ) - content += import_default_section - content += _GetMSBuildConfigurationDetails(spec, project.build_file) - if spec.get("msvs_enable_winphone"): - content += _GetMSBuildLocalProperties("v120_wp81") - else: - content += _GetMSBuildLocalProperties(project.msbuild_toolset) - content += import_cpp_props_section - content += import_masm_props_section - if "arm64" in platforms and toolset == "target": - content += import_marmasm_props_section - content += _GetMSBuildExtensions(props_files_of_rules) - content += _GetMSBuildPropertySheets(configurations, spec) - content += macro_section - content += _GetMSBuildConfigurationGlobalProperties( - spec, configurations, project.build_file - ) - content += _GetMSBuildToolSettingsSections(spec, configurations) - content += _GetMSBuildSources( - spec, - sources, - exclusions, - rule_dependencies, - extension_to_rule_name, - actions_spec, - sources_handled_by_action, - list_excluded, - ) - content += _GetMSBuildProjectReferences(project) - content += import_cpp_targets_section - content += import_masm_targets_section - if "arm64" in platforms and toolset == "target": - content += import_marmasm_targets_section - content += _GetMSBuildExtensionTargets(targets_files_of_rules) - - if spec.get("msvs_external_builder"): - content += _GetMSBuildExternalBuilderTargets(spec) - - # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS: - # has_run_as = _WriteMSVSUserFile(project.path, version, spec) - - easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True) - - return missing_sources - - -def _GetMSBuildExternalBuilderTargets(spec): - """Return a list of MSBuild targets for external builders. - - The "Build" and "Clean" targets are always generated. If the spec contains - 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also - be generated, to support building selected C/C++ files. - - Arguments: - spec: The gyp target spec. - Returns: - List of MSBuild 'Target' specs. - """ - build_cmd = _BuildCommandLineForRuleRaw( - spec, spec["msvs_external_builder_build_cmd"], False, False, False, False - ) - build_target = ["Target", {"Name": "Build"}] - build_target.append(["Exec", {"Command": build_cmd}]) - - clean_cmd = _BuildCommandLineForRuleRaw( - spec, spec["msvs_external_builder_clean_cmd"], False, False, False, False - ) - clean_target = ["Target", {"Name": "Clean"}] - clean_target.append(["Exec", {"Command": clean_cmd}]) - - targets = [build_target, clean_target] - - if spec.get("msvs_external_builder_clcompile_cmd"): - clcompile_cmd = _BuildCommandLineForRuleRaw( - spec, - spec["msvs_external_builder_clcompile_cmd"], - False, - False, - False, - False, - ) - clcompile_target = ["Target", {"Name": "ClCompile"}] - clcompile_target.append(["Exec", {"Command": clcompile_cmd}]) - targets.append(clcompile_target) - - return targets - - -def _GetMSBuildExtensions(props_files_of_rules): - extensions = ["ImportGroup", {"Label": "ExtensionSettings"}] - for props_file in props_files_of_rules: - extensions.append(["Import", {"Project": props_file}]) - return [extensions] - - -def _GetMSBuildExtensionTargets(targets_files_of_rules): - targets_node = ["ImportGroup", {"Label": "ExtensionTargets"}] - for targets_file in sorted(targets_files_of_rules): - targets_node.append(["Import", {"Project": targets_file}]) - return [targets_node] - - -def _GenerateActionsForMSBuild(spec, actions_to_add): - """Add actions accumulated into an actions_to_add, merging as needed. - - Arguments: - spec: the target project dict - actions_to_add: dictionary keyed on input name, which maps to a list of - dicts describing the actions attached to that input file. - - Returns: - A pair of (action specification, the sources handled by this action). - """ - sources_handled_by_action = OrderedSet() - actions_spec = [] - for primary_input, actions in actions_to_add.items(): - if generator_supports_multiple_toolsets: - primary_input = primary_input.replace(".exe", "_host.exe") - inputs = OrderedSet() - outputs = OrderedSet() - descriptions = [] - commands = [] - for action in actions: - - def fixup_host_exe(i): - if "$(OutDir)" in i: - i = i.replace(".exe", "_host.exe") - return i - - if generator_supports_multiple_toolsets: - action["inputs"] = [fixup_host_exe(i) for i in action["inputs"]] - inputs.update(OrderedSet(action["inputs"])) - outputs.update(OrderedSet(action["outputs"])) - descriptions.append(action["description"]) - cmd = action["command"] - if generator_supports_multiple_toolsets: - cmd = cmd.replace(".exe", "_host.exe") - # For most actions, add 'call' so that actions that invoke batch files - # return and continue executing. msbuild_use_call provides a way to - # disable this but I have not seen any adverse effect from doing that - # for everything. - if action.get("msbuild_use_call", True): - cmd = "call " + cmd - commands.append(cmd) - # Add the custom build action for one input file. - description = ", and also ".join(descriptions) - - # We can't join the commands simply with && because the command line will - # get too long. See also _AddActions: cygwin's setup_env mustn't be called - # for every invocation or the command that sets the PATH will grow too - # long. - command = "\r\n".join( - [c + "\r\nif %errorlevel% neq 0 exit /b %errorlevel%" for c in commands] - ) - _AddMSBuildAction( - spec, - primary_input, - inputs, - outputs, - command, - description, - sources_handled_by_action, - actions_spec, - ) - return actions_spec, sources_handled_by_action - - -def _AddMSBuildAction( - spec, - primary_input, - inputs, - outputs, - cmd, - description, - sources_handled_by_action, - actions_spec, -): - command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd) - primary_input = _FixPath(primary_input) - inputs_array = _FixPaths(inputs) - outputs_array = _FixPaths(outputs) - additional_inputs = ";".join([i for i in inputs_array if i != primary_input]) - outputs = ";".join(outputs_array) - sources_handled_by_action.add(primary_input) - action_spec = ["CustomBuild", {"Include": primary_input}] - action_spec.extend( - # TODO(jeanluc) 'Document' for all or just if as_sources? - [ - ["FileType", "Document"], - ["Command", command], - ["Message", description], - ["Outputs", outputs], - ] - ) - if additional_inputs: - action_spec.append(["AdditionalInputs", additional_inputs]) - actions_spec.append(action_spec) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py deleted file mode 100755 index e80b57f06..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the msvs.py file. """ - -import gyp.generator.msvs as msvs -import unittest - -from io import StringIO - - -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() - - def test_GetLibraries(self): - self.assertEqual(msvs._GetLibraries({}), []) - self.assertEqual(msvs._GetLibraries({"libraries": []}), []) - self.assertEqual( - msvs._GetLibraries({"other": "foo", "libraries": ["a.lib"]}), ["a.lib"] - ) - self.assertEqual(msvs._GetLibraries({"libraries": ["-la"]}), ["a.lib"]) - self.assertEqual( - msvs._GetLibraries( - { - "libraries": [ - "a.lib", - "b.lib", - "c.lib", - "-lb.lib", - "-lb.lib", - "d.lib", - "a.lib", - ] - } - ), - ["c.lib", "b.lib", "d.lib", "a.lib"], - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py deleted file mode 100644 index ca04ee13a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +++ /dev/null @@ -1,2936 +0,0 @@ -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import collections -import copy -import hashlib -import json -import multiprocessing -import os.path -import re -import signal -import subprocess -import sys -import gyp -import gyp.common -import gyp.msvs_emulation -import gyp.MSVSUtil as MSVSUtil -import gyp.xcode_emulation - -from io import StringIO - -from gyp.common import GetEnvironFallback -import gyp.ninja_syntax as ninja_syntax - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_PREFIX": "lib", - # Gyp expects the following variables to be expandable by the build - # system to the appropriate locations. Ninja prefers paths to be - # known at gyp time. To resolve this, introduce special - # variables starting with $! and $| (which begin with a $ so gyp knows it - # should be treated specially, but is otherwise an invalid - # ninja/shell variable) that are passed to gyp here but expanded - # before writing out into the target .ninja files; see - # ExpandSpecial. - # $! is used for variables that represent a path and that can only appear at - # the start of a string, while $| is used for variables that can appear - # anywhere in a string. - "INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR", - "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen", - "PRODUCT_DIR": "$!PRODUCT_DIR", - "CONFIGURATION_NAME": "$|CONFIGURATION_NAME", - # Special variables that may be used by gyp 'rule' targets. - # We generate definitions for these variables on the fly when processing a - # rule. - "RULE_INPUT_ROOT": "${root}", - "RULE_INPUT_DIRNAME": "${dirname}", - "RULE_INPUT_PATH": "${source}", - "RULE_INPUT_EXT": "${ext}", - "RULE_INPUT_NAME": "${name}", -} - -# Placates pylint. -generator_additional_non_configuration_keys = [] -generator_additional_path_sections = [] -generator_extra_sources_for_rules = [] -generator_filelist_paths = None - -generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() - - -def StripPrefix(arg, prefix): - if arg.startswith(prefix): - return arg[len(prefix) :] - return arg - - -def QuoteShellArgument(arg, flavor): - """Quote a string such that it will be interpreted as a single argument - by the shell.""" - # Rather than attempting to enumerate the bad shell characters, just - # allow common OK ones and quote anything else. - if re.match(r"^[a-zA-Z0-9_=.\\/-]+$", arg): - return arg # No quoting necessary. - if flavor == "win": - return gyp.msvs_emulation.QuoteForRspFile(arg) - return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" - - -def Define(d, flavor): - """Takes a preprocessor define and returns a -D parameter that's ninja- and - shell-escaped.""" - if flavor == "win": - # cl.exe replaces literal # characters with = in preprocessor definitions for - # some reason. Octal-encode to work around that. - d = d.replace("#", "\\%03o" % ord("#")) - return QuoteShellArgument(ninja_syntax.escape("-D" + d), flavor) - - -def AddArch(output, arch): - """Adds an arch string to an output path.""" - output, extension = os.path.splitext(output) - return f"{output}.{arch}{extension}" - - -class Target: - """Target represents the paths used within a single gyp target. - - Conceptually, building a single target A is a series of steps: - - 1) actions/rules/copies generates source/resources/etc. - 2) compiles generates .o files - 3) link generates a binary (library/executable) - 4) bundle merges the above in a mac bundle - - (Any of these steps can be optional.) - - From a build ordering perspective, a dependent target B could just - depend on the last output of this series of steps. - - But some dependent commands sometimes need to reach inside the box. - For example, when linking B it needs to get the path to the static - library generated by A. - - This object stores those paths. To keep things simple, member - variables only store concrete paths to single files, while methods - compute derived values like "the last output of the target". - """ - - def __init__(self, type): - # Gyp type ("static_library", etc.) of this target. - self.type = type - # File representing whether any input dependencies necessary for - # dependent actions have completed. - self.preaction_stamp = None - # File representing whether any input dependencies necessary for - # dependent compiles have completed. - self.precompile_stamp = None - # File representing the completion of actions/rules/copies, if any. - self.actions_stamp = None - # Path to the output of the link step, if any. - self.binary = None - # Path to the file representing the completion of building the bundle, - # if any. - self.bundle = None - # On Windows, incremental linking requires linking against all the .objs - # that compose a .lib (rather than the .lib itself). That list is stored - # here. In this case, we also need to save the compile_deps for the target, - # so that the target that directly depends on the .objs can also depend - # on those. - self.component_objs = None - self.compile_deps = None - # Windows only. The import .lib is the output of a build step, but - # because dependents only link against the lib (not both the lib and the - # dll) we keep track of the import library here. - self.import_lib = None - # Track if this target contains any C++ files, to decide if gcc or g++ - # should be used for linking. - self.uses_cpp = False - - def Linkable(self): - """Return true if this is a target that can be linked against.""" - return self.type in ("static_library", "shared_library") - - def UsesToc(self, flavor): - """Return true if the target should produce a restat rule based on a TOC - file.""" - # For bundles, the .TOC should be produced for the binary, not for - # FinalOutput(). But the naive approach would put the TOC file into the - # bundle, so don't do this for bundles for now. - if flavor == "win" or self.bundle: - return False - return self.type in ("shared_library", "loadable_module") - - def PreActionInput(self, flavor): - """Return the path, if any, that should be used as a dependency of - any dependent action step.""" - if self.UsesToc(flavor): - return self.FinalOutput() + ".TOC" - return self.FinalOutput() or self.preaction_stamp - - def PreCompileInput(self): - """Return the path, if any, that should be used as a dependency of - any dependent compile step.""" - return self.actions_stamp or self.precompile_stamp - - def FinalOutput(self): - """Return the last output of the target, which depends on all prior - steps.""" - return self.bundle or self.binary or self.actions_stamp - - -# A small discourse on paths as used within the Ninja build: -# All files we produce (both at gyp and at build time) appear in the -# build directory (e.g. out/Debug). -# -# Paths within a given .gyp file are always relative to the directory -# containing the .gyp file. Call these "gyp paths". This includes -# sources as well as the starting directory a given gyp rule/action -# expects to be run from. We call the path from the source root to -# the gyp file the "base directory" within the per-.gyp-file -# NinjaWriter code. -# -# All paths as written into the .ninja files are relative to the build -# directory. Call these paths "ninja paths". -# -# We translate between these two notions of paths with two helper -# functions: -# -# - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file) -# into the equivalent ninja path. -# -# - GypPathToUniqueOutput translates a gyp path into a ninja path to write -# an output file; the result can be namespaced such that it is unique -# to the input file name as well as the output target name. - - -class NinjaWriter: - def __init__( - self, - hash_for_rules, - target_outputs, - base_dir, - build_dir, - output_file, - toplevel_build, - output_file_name, - flavor, - toplevel_dir=None, - ): - """ - base_dir: path from source root to directory containing this gyp file, - by gyp semantics, all input paths are relative to this - build_dir: path from source root to build output - toplevel_dir: path to the toplevel directory - """ - - self.hash_for_rules = hash_for_rules - self.target_outputs = target_outputs - self.base_dir = base_dir - self.build_dir = build_dir - self.ninja = ninja_syntax.Writer(output_file) - self.toplevel_build = toplevel_build - self.output_file_name = output_file_name - - self.flavor = flavor - self.abs_build_dir = None - if toplevel_dir is not None: - self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, build_dir)) - self.obj_ext = ".obj" if flavor == "win" else ".o" - if flavor == "win": - # See docstring of msvs_emulation.GenerateEnvironmentFiles(). - self.win_env = {} - for arch in ("x86", "x64"): - self.win_env[arch] = "environment." + arch - - # Relative path from build output dir to base dir. - build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) - self.build_to_base = os.path.join(build_to_top, base_dir) - # Relative path from base dir to build dir. - base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) - self.base_to_build = os.path.join(base_to_top, build_dir) - - def ExpandSpecial(self, path, product_dir=None): - """Expand specials like $!PRODUCT_DIR in |path|. - - If |product_dir| is None, assumes the cwd is already the product - dir. Otherwise, |product_dir| is the relative path to the product - dir. - """ - - PRODUCT_DIR = "$!PRODUCT_DIR" - if PRODUCT_DIR in path: - if product_dir: - path = path.replace(PRODUCT_DIR, product_dir) - else: - path = path.replace(PRODUCT_DIR + "/", "") - path = path.replace(PRODUCT_DIR + "\\", "") - path = path.replace(PRODUCT_DIR, ".") - - INTERMEDIATE_DIR = "$!INTERMEDIATE_DIR" - if INTERMEDIATE_DIR in path: - int_dir = self.GypPathToUniqueOutput("gen") - # GypPathToUniqueOutput generates a path relative to the product dir, - # so insert product_dir in front if it is provided. - path = path.replace( - INTERMEDIATE_DIR, os.path.join(product_dir or "", int_dir) - ) - - CONFIGURATION_NAME = "$|CONFIGURATION_NAME" - path = path.replace(CONFIGURATION_NAME, self.config_name) - - return path - - def ExpandRuleVariables(self, path, root, dirname, source, ext, name): - if self.flavor == "win": - path = self.msvs_settings.ConvertVSMacros(path, config=self.config_name) - path = path.replace(generator_default_variables["RULE_INPUT_ROOT"], root) - path = path.replace(generator_default_variables["RULE_INPUT_DIRNAME"], dirname) - path = path.replace(generator_default_variables["RULE_INPUT_PATH"], source) - path = path.replace(generator_default_variables["RULE_INPUT_EXT"], ext) - path = path.replace(generator_default_variables["RULE_INPUT_NAME"], name) - return path - - def GypPathToNinja(self, path, env=None): - """Translate a gyp path to a ninja path, optionally expanding environment - variable references in |path| with |env|. - - See the above discourse on path conversions.""" - if env: - if self.flavor == "mac": - path = gyp.xcode_emulation.ExpandEnvVars(path, env) - elif self.flavor == "win": - path = gyp.msvs_emulation.ExpandMacros(path, env) - if path.startswith("$!"): - expanded = self.ExpandSpecial(path) - if self.flavor == "win": - expanded = os.path.normpath(expanded) - return expanded - if "$|" in path: - path = self.ExpandSpecial(path) - assert "$" not in path, path - return os.path.normpath(os.path.join(self.build_to_base, path)) - - def GypPathToUniqueOutput(self, path, qualified=True): - """Translate a gyp path to a ninja path for writing output. - - If qualified is True, qualify the resulting filename with the name - of the target. This is necessary when e.g. compiling the same - path twice for two separate output targets. - - See the above discourse on path conversions.""" - - path = self.ExpandSpecial(path) - assert not path.startswith("$"), path - - # Translate the path following this scheme: - # Input: foo/bar.gyp, target targ, references baz/out.o - # Output: obj/foo/baz/targ.out.o (if qualified) - # obj/foo/baz/out.o (otherwise) - # (and obj.host instead of obj for cross-compiles) - # - # Why this scheme and not some other one? - # 1) for a given input, you can compute all derived outputs by matching - # its path, even if the input is brought via a gyp file with '..'. - # 2) simple files like libraries and stamps have a simple filename. - - obj = "obj" - if self.toolset != "target": - obj += "." + self.toolset - - path_dir, path_basename = os.path.split(path) - assert not os.path.isabs(path_dir), ( - "'%s' can not be absolute path (see crbug.com/462153)." % path_dir - ) - - if qualified: - path_basename = self.name + "." + path_basename - return os.path.normpath( - os.path.join(obj, self.base_dir, path_dir, path_basename) - ) - - def WriteCollapsedDependencies(self, name, targets, order_only=None): - """Given a list of targets, return a path for a single file - representing the result of building all the targets or None. - - Uses a stamp file if necessary.""" - - assert targets == [item for item in targets if item], targets - if len(targets) == 0: - assert not order_only - return None - if len(targets) > 1 or order_only: - stamp = self.GypPathToUniqueOutput(name + ".stamp") - targets = self.ninja.build(stamp, "stamp", targets, order_only=order_only) - self.ninja.newline() - return targets[0] - - def _SubninjaNameForArch(self, arch): - output_file_base = os.path.splitext(self.output_file_name)[0] - return f"{output_file_base}.{arch}.ninja" - - def WriteSpec(self, spec, config_name, generator_flags): - """The main entry point for NinjaWriter: write the build rules for a spec. - - Returns a Target object, which represents the output paths for this spec. - Returns None if there are no outputs (e.g. a settings-only 'none' type - target).""" - - self.config_name = config_name - self.name = spec["target_name"] - self.toolset = spec["toolset"] - config = spec["configurations"][config_name] - self.target = Target(spec["type"]) - self.is_standalone_static_library = bool( - spec.get("standalone_static_library", 0) - ) - - self.target_rpath = generator_flags.get("target_rpath", r"\$$ORIGIN/lib/") - - self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) - self.xcode_settings = self.msvs_settings = None - if self.flavor == "mac": - self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) - if mac_toolchain_dir: - self.xcode_settings.mac_toolchain_dir = mac_toolchain_dir - - if self.flavor == "win": - self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, generator_flags) - arch = self.msvs_settings.GetArch(config_name) - self.ninja.variable("arch", self.win_env[arch]) - self.ninja.variable("cc", "$cl_" + arch) - self.ninja.variable("cxx", "$cl_" + arch) - self.ninja.variable("cc_host", "$cl_" + arch) - self.ninja.variable("cxx_host", "$cl_" + arch) - self.ninja.variable("asm", "$ml_" + arch) - - if self.flavor == "mac": - self.archs = self.xcode_settings.GetActiveArchs(config_name) - if len(self.archs) > 1: - self.arch_subninjas = { - arch: ninja_syntax.Writer( - OpenOutput( - os.path.join( - self.toplevel_build, self._SubninjaNameForArch(arch) - ), - "w", - ) - ) - for arch in self.archs - } - - # Compute predepends for all rules. - # actions_depends is the dependencies this target depends on before running - # any of its action/rule/copy steps. - # compile_depends is the dependencies this target depends on before running - # any of its compile steps. - actions_depends = [] - compile_depends = [] - # TODO(evan): it is rather confusing which things are lists and which - # are strings. Fix these. - if "dependencies" in spec: - for dep in spec["dependencies"]: - if dep in self.target_outputs: - target = self.target_outputs[dep] - actions_depends.append(target.PreActionInput(self.flavor)) - compile_depends.append(target.PreCompileInput()) - if target.uses_cpp: - self.target.uses_cpp = True - actions_depends = [item for item in actions_depends if item] - compile_depends = [item for item in compile_depends if item] - actions_depends = self.WriteCollapsedDependencies( - "actions_depends", actions_depends - ) - compile_depends = self.WriteCollapsedDependencies( - "compile_depends", compile_depends - ) - self.target.preaction_stamp = actions_depends - self.target.precompile_stamp = compile_depends - - # Write out actions, rules, and copies. These must happen before we - # compile any sources, so compute a list of predependencies for sources - # while we do it. - extra_sources = [] - mac_bundle_depends = [] - self.target.actions_stamp = self.WriteActionsRulesCopies( - spec, extra_sources, actions_depends, mac_bundle_depends - ) - - # If we have actions/rules/copies, we depend directly on those, but - # otherwise we depend on dependent target's actions/rules/copies etc. - # We never need to explicitly depend on previous target's link steps, - # because no compile ever depends on them. - compile_depends_stamp = self.target.actions_stamp or compile_depends - - # Write out the compilation steps, if any. - link_deps = [] - try: - sources = extra_sources + spec.get("sources", []) - except TypeError: - print("extra_sources: ", str(extra_sources)) - print('spec.get("sources"): ', str(spec.get("sources"))) - raise - if sources: - if self.flavor == "mac" and len(self.archs) > 1: - # Write subninja file containing compile and link commands scoped to - # a single arch if a fat binary is being built. - for arch in self.archs: - self.ninja.subninja(self._SubninjaNameForArch(arch)) - - pch = None - if self.flavor == "win": - gyp.msvs_emulation.VerifyMissingSources( - sources, self.abs_build_dir, generator_flags, self.GypPathToNinja - ) - pch = gyp.msvs_emulation.PrecompiledHeader( - self.msvs_settings, - config_name, - self.GypPathToNinja, - self.GypPathToUniqueOutput, - self.obj_ext, - ) - else: - pch = gyp.xcode_emulation.MacPrefixHeader( - self.xcode_settings, - self.GypPathToNinja, - lambda path, lang: self.GypPathToUniqueOutput(path + "-" + lang), - ) - link_deps = self.WriteSources( - self.ninja, - config_name, - config, - sources, - compile_depends_stamp, - pch, - spec, - ) - # Some actions/rules output 'sources' that are already object files. - obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] - if obj_outputs: - if self.flavor != "mac" or len(self.archs) == 1: - link_deps += [self.GypPathToNinja(o) for o in obj_outputs] - else: - print( - "Warning: Actions/rules writing object files don't work with " - "multiarch targets, dropping. (target %s)" % spec["target_name"] - ) - elif self.flavor == "mac" and len(self.archs) > 1: - link_deps = collections.defaultdict(list) - - compile_deps = self.target.actions_stamp or actions_depends - if self.flavor == "win" and self.target.type == "static_library": - self.target.component_objs = link_deps - self.target.compile_deps = compile_deps - - # Write out a link step, if needed. - output = None - is_empty_bundle = not link_deps and not mac_bundle_depends - if link_deps or self.target.actions_stamp or actions_depends: - output = self.WriteTarget( - spec, config_name, config, link_deps, compile_deps - ) - if self.is_mac_bundle: - mac_bundle_depends.append(output) - - # Bundle all of the above together, if needed. - if self.is_mac_bundle: - output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) - - if not output: - return None - - assert self.target.FinalOutput(), output - return self.target - - def _WinIdlRule(self, source, prebuild, outputs): - """Handle the implicit VS .idl rule for one source file. Fills |outputs| - with files that are generated.""" - outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( - source, self.config_name - ) - outdir = self.GypPathToNinja(outdir) - - def fix_path(path, rel=None): - path = os.path.join(outdir, path) - dirname, basename = os.path.split(source) - root, ext = os.path.splitext(basename) - path = self.ExpandRuleVariables(path, root, dirname, source, ext, basename) - if rel: - path = os.path.relpath(path, rel) - return path - - vars = [(name, fix_path(value, outdir)) for name, value in vars] - output = [fix_path(p) for p in output] - vars.append(("outdir", outdir)) - vars.append(("idlflags", flags)) - input = self.GypPathToNinja(source) - self.ninja.build(output, "idl", input, variables=vars, order_only=prebuild) - outputs.extend(output) - - def WriteWinIdlFiles(self, spec, prebuild): - """Writes rules to match MSVS's implicit idl handling.""" - assert self.flavor == "win" - if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): - return [] - outputs = [] - for source in filter(lambda x: x.endswith(".idl"), spec["sources"]): - self._WinIdlRule(source, prebuild, outputs) - return outputs - - def WriteActionsRulesCopies( - self, spec, extra_sources, prebuild, mac_bundle_depends - ): - """Write out the Actions, Rules, and Copies steps. Return a path - representing the outputs of these steps.""" - outputs = [] - if self.is_mac_bundle: - mac_bundle_resources = spec.get("mac_bundle_resources", [])[:] - else: - mac_bundle_resources = [] - extra_mac_bundle_resources = [] - - if "actions" in spec: - outputs += self.WriteActions( - spec["actions"], extra_sources, prebuild, extra_mac_bundle_resources - ) - if "rules" in spec: - outputs += self.WriteRules( - spec["rules"], - extra_sources, - prebuild, - mac_bundle_resources, - extra_mac_bundle_resources, - ) - if "copies" in spec: - outputs += self.WriteCopies(spec["copies"], prebuild, mac_bundle_depends) - - if "sources" in spec and self.flavor == "win": - outputs += self.WriteWinIdlFiles(spec, prebuild) - - if self.xcode_settings and self.xcode_settings.IsIosFramework(): - self.WriteiOSFrameworkHeaders(spec, outputs, prebuild) - - stamp = self.WriteCollapsedDependencies("actions_rules_copies", outputs) - - if self.is_mac_bundle: - xcassets = self.WriteMacBundleResources( - extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends - ) - partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) - self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) - - return stamp - - def GenerateDescription(self, verb, message, fallback): - """Generate and return a description of a build step. - - |verb| is the short summary, e.g. ACTION or RULE. - |message| is a hand-written description, or None if not available. - |fallback| is the gyp-level name of the step, usable as a fallback. - """ - if self.toolset != "target": - verb += "(%s)" % self.toolset - if message: - return f"{verb} {self.ExpandSpecial(message)}" - else: - return f"{verb} {self.name}: {fallback}" - - def WriteActions( - self, actions, extra_sources, prebuild, extra_mac_bundle_resources - ): - # Actions cd into the base directory. - env = self.GetToolchainEnv() - all_outputs = [] - for action in actions: - # First write out a rule for the action. - name = "{}_{}".format(action["action_name"], self.hash_for_rules) - description = self.GenerateDescription( - "ACTION", action.get("message", None), name - ) - win_shell_flags = ( - self.msvs_settings.GetRuleShellFlags(action) - if self.flavor == "win" - else None - ) - args = action["action"] - depfile = action.get("depfile", None) - if depfile: - depfile = self.ExpandSpecial(depfile, self.base_to_build) - pool = "console" if int(action.get("ninja_use_console", 0)) else None - rule_name, _ = self.WriteNewNinjaRule( - name, args, description, win_shell_flags, env, pool, depfile=depfile - ) - - inputs = [self.GypPathToNinja(i, env) for i in action["inputs"]] - if int(action.get("process_outputs_as_sources", False)): - extra_sources += action["outputs"] - if int(action.get("process_outputs_as_mac_bundle_resources", False)): - extra_mac_bundle_resources += action["outputs"] - outputs = [self.GypPathToNinja(o, env) for o in action["outputs"]] - - # Then write out an edge using the rule. - self.ninja.build(outputs, rule_name, inputs, order_only=prebuild) - all_outputs += outputs - - self.ninja.newline() - - return all_outputs - - def WriteRules( - self, - rules, - extra_sources, - prebuild, - mac_bundle_resources, - extra_mac_bundle_resources, - ): - env = self.GetToolchainEnv() - all_outputs = [] - for rule in rules: - # Skip a rule with no action and no inputs. - if "action" not in rule and not rule.get("rule_sources", []): - continue - - # First write out a rule for the rule action. - name = "{}_{}".format(rule["rule_name"], self.hash_for_rules) - - args = rule["action"] - description = self.GenerateDescription( - "RULE", - rule.get("message", None), - ("%s " + generator_default_variables["RULE_INPUT_PATH"]) % name, - ) - win_shell_flags = ( - self.msvs_settings.GetRuleShellFlags(rule) - if self.flavor == "win" - else None - ) - pool = "console" if int(rule.get("ninja_use_console", 0)) else None - rule_name, args = self.WriteNewNinjaRule( - name, args, description, win_shell_flags, env, pool - ) - - # TODO: if the command references the outputs directly, we should - # simplify it to just use $out. - - # Rules can potentially make use of some special variables which - # must vary per source file. - # Compute the list of variables we'll need to provide. - special_locals = ("source", "root", "dirname", "ext", "name") - needed_variables = {"source"} - for argument in args: - for var in special_locals: - if "${%s}" % var in argument: - needed_variables.add(var) - needed_variables = sorted(needed_variables) - - def cygwin_munge(path): - # pylint: disable=cell-var-from-loop - if win_shell_flags and win_shell_flags.cygwin: - return path.replace("\\", "/") - return path - - inputs = [self.GypPathToNinja(i, env) for i in rule.get("inputs", [])] - - # If there are n source files matching the rule, and m additional rule - # inputs, then adding 'inputs' to each build edge written below will - # write m * n inputs. Collapsing reduces this to m + n. - sources = rule.get("rule_sources", []) - num_inputs = len(inputs) - if prebuild: - num_inputs += 1 - if num_inputs > 2 and len(sources) > 2: - inputs = [ - self.WriteCollapsedDependencies( - rule["rule_name"], inputs, order_only=prebuild - ) - ] - prebuild = [] - - # For each source file, write an edge that generates all the outputs. - for source in sources: - source = os.path.normpath(source) - dirname, basename = os.path.split(source) - root, ext = os.path.splitext(basename) - - # Gather the list of inputs and outputs, expanding $vars if possible. - outputs = [ - self.ExpandRuleVariables(o, root, dirname, source, ext, basename) - for o in rule["outputs"] - ] - - if int(rule.get("process_outputs_as_sources", False)): - extra_sources += outputs - - was_mac_bundle_resource = source in mac_bundle_resources - if was_mac_bundle_resource or int( - rule.get("process_outputs_as_mac_bundle_resources", False) - ): - extra_mac_bundle_resources += outputs - # Note: This is n_resources * n_outputs_in_rule. - # Put to-be-removed items in a set and - # remove them all in a single pass - # if this becomes a performance issue. - if was_mac_bundle_resource: - mac_bundle_resources.remove(source) - - extra_bindings = [] - for var in needed_variables: - if var == "root": - extra_bindings.append(("root", cygwin_munge(root))) - elif var == "dirname": - # '$dirname' is a parameter to the rule action, which means - # it shouldn't be converted to a Ninja path. But we don't - # want $!PRODUCT_DIR in there either. - dirname_expanded = self.ExpandSpecial( - dirname, self.base_to_build - ) - extra_bindings.append( - ("dirname", cygwin_munge(dirname_expanded)) - ) - elif var == "source": - # '$source' is a parameter to the rule action, which means - # it shouldn't be converted to a Ninja path. But we don't - # want $!PRODUCT_DIR in there either. - source_expanded = self.ExpandSpecial(source, self.base_to_build) - extra_bindings.append(("source", cygwin_munge(source_expanded))) - elif var == "ext": - extra_bindings.append(("ext", ext)) - elif var == "name": - extra_bindings.append(("name", cygwin_munge(basename))) - else: - assert var is None, repr(var) - - outputs = [self.GypPathToNinja(o, env) for o in outputs] - if self.flavor == "win": - # WriteNewNinjaRule uses unique_name to create a rsp file on win. - extra_bindings.append( - ("unique_name", hashlib.md5(outputs[0]).hexdigest()) - ) - - self.ninja.build( - outputs, - rule_name, - self.GypPathToNinja(source), - implicit=inputs, - order_only=prebuild, - variables=extra_bindings, - ) - - all_outputs.extend(outputs) - - return all_outputs - - def WriteCopies(self, copies, prebuild, mac_bundle_depends): - outputs = [] - if self.xcode_settings: - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetToolchainEnv(additional_settings=extra_env) - else: - env = self.GetToolchainEnv() - for to_copy in copies: - for path in to_copy["files"]: - # Normalize the path so trailing slashes don't confuse us. - path = os.path.normpath(path) - basename = os.path.split(path)[1] - src = self.GypPathToNinja(path, env) - dst = self.GypPathToNinja( - os.path.join(to_copy["destination"], basename), env - ) - outputs += self.ninja.build(dst, "copy", src, order_only=prebuild) - if self.is_mac_bundle: - # gyp has mac_bundle_resources to copy things into a bundle's - # Resources folder, but there's no built-in way to copy files - # to other places in the bundle. - # Hence, some targets use copies for this. - # Check if this file is copied into the current bundle, - # and if so add it to the bundle depends so - # that dependent targets get rebuilt if the copy input changes. - if dst.startswith( - self.xcode_settings.GetBundleContentsFolderPath() - ): - mac_bundle_depends.append(dst) - - return outputs - - def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild): - """Prebuild steps to generate hmap files and copy headers to destination.""" - framework = self.ComputeMacBundleOutput() - all_sources = spec["sources"] - copy_headers = spec["mac_framework_headers"] - output = self.GypPathToUniqueOutput("headers.hmap") - self.xcode_settings.header_map_path = output - all_headers = map( - self.GypPathToNinja, filter(lambda x: x.endswith(".h"), all_sources) - ) - variables = [ - ("framework", framework), - ("copy_headers", map(self.GypPathToNinja, copy_headers)), - ] - outputs.extend( - self.ninja.build( - output, - "compile_ios_framework_headers", - all_headers, - variables=variables, - order_only=prebuild, - ) - ) - - def WriteMacBundleResources(self, resources, bundle_depends): - """Writes ninja edges for 'mac_bundle_resources'.""" - xcassets = [] - - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) - - for output, res in gyp.xcode_emulation.GetMacBundleResources( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - map(self.GypPathToNinja, resources), - ): - output = self.ExpandSpecial(output) - if os.path.splitext(output)[-1] != ".xcassets": - self.ninja.build( - output, - "mac_tool", - res, - variables=[ - ("mactool_cmd", "copy-bundle-resource"), - ("env", env), - ("binary", isBinary), - ], - ) - bundle_depends.append(output) - else: - xcassets.append(res) - return xcassets - - def WriteMacXCassets(self, xcassets, bundle_depends): - """Writes ninja edges for 'mac_bundle_resources' .xcassets files. - - This add an invocation of 'actool' via the 'mac_tool.py' helper script. - It assumes that the assets catalogs define at least one imageset and - thus an Assets.car file will be generated in the application resources - directory. If this is not the case, then the build will probably be done - at each invocation of ninja.""" - if not xcassets: - return - - extra_arguments = {} - settings_to_arg = { - "XCASSETS_APP_ICON": "app-icon", - "XCASSETS_LAUNCH_IMAGE": "launch-image", - } - settings = self.xcode_settings.xcode_settings[self.config_name] - for settings_key, arg_name in settings_to_arg.items(): - value = settings.get(settings_key) - if value: - extra_arguments[arg_name] = value - - partial_info_plist = None - if extra_arguments: - partial_info_plist = self.GypPathToUniqueOutput( - "assetcatalog_generated_info.plist" - ) - extra_arguments["output-partial-info-plist"] = partial_info_plist - - outputs = [] - outputs.append( - os.path.join(self.xcode_settings.GetBundleResourceFolder(), "Assets.car") - ) - if partial_info_plist: - outputs.append(partial_info_plist) - - keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - - bundle_depends.extend( - self.ninja.build( - outputs, - "compile_xcassets", - xcassets, - variables=[("env", env), ("keys", keys)], - ) - ) - return partial_info_plist - - def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): - """Write build rules for bundle Info.plist files.""" - info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( - generator_default_variables["PRODUCT_DIR"], - self.xcode_settings, - self.GypPathToNinja, - ) - if not info_plist: - return - out = self.ExpandSpecial(out) - if defines: - # Create an intermediate file to store preprocessed results. - intermediate_plist = self.GypPathToUniqueOutput( - os.path.basename(info_plist) - ) - defines = " ".join([Define(d, self.flavor) for d in defines]) - info_plist = self.ninja.build( - intermediate_plist, - "preprocess_infoplist", - info_plist, - variables=[("defines", defines)], - ) - - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - - if partial_info_plist: - intermediate_plist = self.GypPathToUniqueOutput("merged_info.plist") - info_plist = self.ninja.build( - intermediate_plist, "merge_infoplist", [partial_info_plist, info_plist] - ) - - keys = self.xcode_settings.GetExtraPlistItems(self.config_name) - keys = QuoteShellArgument(json.dumps(keys), self.flavor) - isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) - self.ninja.build( - out, - "copy_infoplist", - info_plist, - variables=[("env", env), ("keys", keys), ("binary", isBinary)], - ) - bundle_depends.append(out) - - def WriteSources( - self, - ninja_file, - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - ): - """Write build rules to compile all of |sources|.""" - if self.toolset == "host": - self.ninja.variable("ar", "$ar_host") - self.ninja.variable("cc", "$cc_host") - self.ninja.variable("cxx", "$cxx_host") - self.ninja.variable("ld", "$ld_host") - self.ninja.variable("ldxx", "$ldxx_host") - self.ninja.variable("nm", "$nm_host") - self.ninja.variable("readelf", "$readelf_host") - - if self.flavor != "mac" or len(self.archs) == 1: - return self.WriteSourcesForArch( - self.ninja, - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - ) - else: - return { - arch: self.WriteSourcesForArch( - self.arch_subninjas[arch], - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - arch=arch, - ) - for arch in self.archs - } - - def WriteSourcesForArch( - self, - ninja_file, - config_name, - config, - sources, - predepends, - precompiled_header, - spec, - arch=None, - ): - """Write build rules to compile all of |sources|.""" - - extra_defines = [] - if self.flavor == "mac": - cflags = self.xcode_settings.GetCflags(config_name, arch=arch) - cflags_c = self.xcode_settings.GetCflagsC(config_name) - cflags_cc = self.xcode_settings.GetCflagsCC(config_name) - cflags_objc = ["$cflags_c"] + self.xcode_settings.GetCflagsObjC(config_name) - cflags_objcc = ["$cflags_cc"] + self.xcode_settings.GetCflagsObjCC( - config_name - ) - elif self.flavor == "win": - asmflags = self.msvs_settings.GetAsmflags(config_name) - cflags = self.msvs_settings.GetCflags(config_name) - cflags_c = self.msvs_settings.GetCflagsC(config_name) - cflags_cc = self.msvs_settings.GetCflagsCC(config_name) - extra_defines = self.msvs_settings.GetComputedDefines(config_name) - # See comment at cc_command for why there's two .pdb files. - pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( - config_name, self.ExpandSpecial - ) - if not pdbpath_c: - obj = "obj" - if self.toolset != "target": - obj += "." + self.toolset - pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) - pdbpath_c = pdbpath + ".c.pdb" - pdbpath_cc = pdbpath + ".cc.pdb" - self.WriteVariableList(ninja_file, "pdbname_c", [pdbpath_c]) - self.WriteVariableList(ninja_file, "pdbname_cc", [pdbpath_cc]) - self.WriteVariableList(ninja_file, "pchprefix", [self.name]) - else: - cflags = config.get("cflags", []) - cflags_c = config.get("cflags_c", []) - cflags_cc = config.get("cflags_cc", []) - - # Respect environment variables related to build, but target-specific - # flags can still override them. - if self.toolset == "target": - cflags_c = ( - os.environ.get("CPPFLAGS", "").split() - + os.environ.get("CFLAGS", "").split() - + cflags_c - ) - cflags_cc = ( - os.environ.get("CPPFLAGS", "").split() - + os.environ.get("CXXFLAGS", "").split() - + cflags_cc - ) - elif self.toolset == "host": - cflags_c = ( - os.environ.get("CPPFLAGS_host", "").split() - + os.environ.get("CFLAGS_host", "").split() - + cflags_c - ) - cflags_cc = ( - os.environ.get("CPPFLAGS_host", "").split() - + os.environ.get("CXXFLAGS_host", "").split() - + cflags_cc - ) - - defines = config.get("defines", []) + extra_defines - self.WriteVariableList( - ninja_file, "defines", [Define(d, self.flavor) for d in defines] - ) - if self.flavor == "win": - self.WriteVariableList( - ninja_file, "asmflags", map(self.ExpandSpecial, asmflags) - ) - self.WriteVariableList( - ninja_file, - "rcflags", - [ - QuoteShellArgument(self.ExpandSpecial(f), self.flavor) - for f in self.msvs_settings.GetRcflags( - config_name, self.GypPathToNinja - ) - ], - ) - - include_dirs = config.get("include_dirs", []) - - env = self.GetToolchainEnv() - if self.flavor == "win": - include_dirs = self.msvs_settings.AdjustIncludeDirs( - include_dirs, config_name - ) - self.WriteVariableList( - ninja_file, - "includes", - [ - QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) - for i in include_dirs - ], - ) - - if self.flavor == "win": - midl_include_dirs = config.get("midl_include_dirs", []) - midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( - midl_include_dirs, config_name - ) - self.WriteVariableList( - ninja_file, - "midl_includes", - [ - QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) - for i in midl_include_dirs - ], - ) - - pch_commands = precompiled_header.GetPchBuildCommands(arch) - if self.flavor == "mac": - # Most targets use no precompiled headers, so only write these if needed. - for ext, var in [ - ("c", "cflags_pch_c"), - ("cc", "cflags_pch_cc"), - ("m", "cflags_pch_objc"), - ("mm", "cflags_pch_objcc"), - ]: - include = precompiled_header.GetInclude(ext, arch) - if include: - ninja_file.variable(var, include) - - arflags = config.get("arflags", []) - - self.WriteVariableList(ninja_file, "cflags", map(self.ExpandSpecial, cflags)) - self.WriteVariableList( - ninja_file, "cflags_c", map(self.ExpandSpecial, cflags_c) - ) - self.WriteVariableList( - ninja_file, "cflags_cc", map(self.ExpandSpecial, cflags_cc) - ) - if self.flavor == "mac": - self.WriteVariableList( - ninja_file, "cflags_objc", map(self.ExpandSpecial, cflags_objc) - ) - self.WriteVariableList( - ninja_file, "cflags_objcc", map(self.ExpandSpecial, cflags_objcc) - ) - self.WriteVariableList(ninja_file, "arflags", map(self.ExpandSpecial, arflags)) - ninja_file.newline() - outputs = [] - has_rc_source = False - for source in sources: - filename, ext = os.path.splitext(source) - ext = ext[1:] - obj_ext = self.obj_ext - if ext in ("cc", "cpp", "cxx"): - command = "cxx" - self.target.uses_cpp = True - elif ext == "c" or (ext == "S" and self.flavor != "win"): - command = "cc" - elif ext == "s" and self.flavor != "win": # Doesn't generate .o.d files. - command = "cc_s" - elif ( - self.flavor == "win" - and ext in ("asm", "S") - and not self.msvs_settings.HasExplicitAsmRules(spec) - ): - command = "asm" - # Add the _asm suffix as msvs is capable of handling .cc and - # .asm files of the same name without collision. - obj_ext = "_asm.obj" - elif self.flavor == "mac" and ext == "m": - command = "objc" - elif self.flavor == "mac" and ext == "mm": - command = "objcxx" - self.target.uses_cpp = True - elif self.flavor == "win" and ext == "rc": - command = "rc" - obj_ext = ".res" - has_rc_source = True - else: - # Ignore unhandled extensions. - continue - input = self.GypPathToNinja(source) - output = self.GypPathToUniqueOutput(filename + obj_ext) - if arch is not None: - output = AddArch(output, arch) - implicit = precompiled_header.GetObjDependencies([input], [output], arch) - variables = [] - if self.flavor == "win": - variables, output, implicit = precompiled_header.GetFlagsModifications( - input, - output, - implicit, - command, - cflags_c, - cflags_cc, - self.ExpandSpecial, - ) - ninja_file.build( - output, - command, - input, - implicit=[gch for _, _, gch in implicit], - order_only=predepends, - variables=variables, - ) - outputs.append(output) - - if has_rc_source: - resource_include_dirs = config.get("resource_include_dirs", include_dirs) - self.WriteVariableList( - ninja_file, - "resource_includes", - [ - QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) - for i in resource_include_dirs - ], - ) - - self.WritePchTargets(ninja_file, pch_commands) - - ninja_file.newline() - return outputs - - def WritePchTargets(self, ninja_file, pch_commands): - """Writes ninja rules to compile prefix headers.""" - if not pch_commands: - return - - for gch, lang_flag, lang, input in pch_commands: - var_name = { - "c": "cflags_pch_c", - "cc": "cflags_pch_cc", - "m": "cflags_pch_objc", - "mm": "cflags_pch_objcc", - }[lang] - - map = { - "c": "cc", - "cc": "cxx", - "m": "objc", - "mm": "objcxx", - } - cmd = map.get(lang) - ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) - - def WriteLink(self, spec, config_name, config, link_deps, compile_deps): - """Write out a link step. Fills out target.binary. """ - if self.flavor != "mac" or len(self.archs) == 1: - return self.WriteLinkForArch( - self.ninja, spec, config_name, config, link_deps, compile_deps - ) - else: - output = self.ComputeOutput(spec) - inputs = [ - self.WriteLinkForArch( - self.arch_subninjas[arch], - spec, - config_name, - config, - link_deps[arch], - compile_deps, - arch=arch, - ) - for arch in self.archs - ] - extra_bindings = [] - build_output = output - if not self.is_mac_bundle: - self.AppendPostbuildVariable(extra_bindings, spec, output, output) - - # TODO(yyanagisawa): more work needed to fix: - # https://code.google.com/p/gyp/issues/detail?id=411 - if ( - spec["type"] in ("shared_library", "loadable_module") - and not self.is_mac_bundle - ): - extra_bindings.append(("lib", output)) - self.ninja.build( - [output, output + ".TOC"], - "solipo", - inputs, - variables=extra_bindings, - ) - else: - self.ninja.build(build_output, "lipo", inputs, variables=extra_bindings) - return output - - def WriteLinkForArch( - self, ninja_file, spec, config_name, config, link_deps, compile_deps, arch=None - ): - """Write out a link step. Fills out target.binary. """ - command = { - "executable": "link", - "loadable_module": "solink_module", - "shared_library": "solink", - }[spec["type"]] - command_suffix = "" - - implicit_deps = set() - solibs = set() - order_deps = set() - - if compile_deps: - # Normally, the compiles of the target already depend on compile_deps, - # but a shared_library target might have no sources and only link together - # a few static_library deps, so the link step also needs to depend - # on compile_deps to make sure actions in the shared_library target - # get run before the link. - order_deps.add(compile_deps) - - if "dependencies" in spec: - # Two kinds of dependencies: - # - Linkable dependencies (like a .a or a .so): add them to the link line. - # - Non-linkable dependencies (like a rule that generates a file - # and writes a stamp file): add them to implicit_deps - extra_link_deps = set() - for dep in spec["dependencies"]: - target = self.target_outputs.get(dep) - if not target: - continue - linkable = target.Linkable() - if linkable: - new_deps = [] - if ( - self.flavor == "win" - and target.component_objs - and self.msvs_settings.IsUseLibraryDependencyInputs(config_name) - ): - new_deps = target.component_objs - if target.compile_deps: - order_deps.add(target.compile_deps) - elif self.flavor == "win" and target.import_lib: - new_deps = [target.import_lib] - elif target.UsesToc(self.flavor): - solibs.add(target.binary) - implicit_deps.add(target.binary + ".TOC") - else: - new_deps = [target.binary] - for new_dep in new_deps: - if new_dep not in extra_link_deps: - extra_link_deps.add(new_dep) - link_deps.append(new_dep) - - final_output = target.FinalOutput() - if not linkable or final_output != target.binary: - implicit_deps.add(final_output) - - extra_bindings = [] - if self.target.uses_cpp and self.flavor != "win": - extra_bindings.append(("ld", "$ldxx")) - - output = self.ComputeOutput(spec, arch) - if arch is None and not self.is_mac_bundle: - self.AppendPostbuildVariable(extra_bindings, spec, output, output) - - is_executable = spec["type"] == "executable" - # The ldflags config key is not used on mac or win. On those platforms - # linker flags are set via xcode_settings and msvs_settings, respectively. - if self.toolset == "target": - env_ldflags = os.environ.get("LDFLAGS", "").split() - elif self.toolset == "host": - env_ldflags = os.environ.get("LDFLAGS_host", "").split() - - if self.flavor == "mac": - ldflags = self.xcode_settings.GetLdflags( - config_name, - self.ExpandSpecial(generator_default_variables["PRODUCT_DIR"]), - self.GypPathToNinja, - arch, - ) - ldflags = env_ldflags + ldflags - elif self.flavor == "win": - manifest_base_name = self.GypPathToUniqueOutput( - self.ComputeOutputFileName(spec) - ) - ( - ldflags, - intermediate_manifest, - manifest_files, - ) = self.msvs_settings.GetLdflags( - config_name, - self.GypPathToNinja, - self.ExpandSpecial, - manifest_base_name, - output, - is_executable, - self.toplevel_build, - ) - ldflags = env_ldflags + ldflags - self.WriteVariableList(ninja_file, "manifests", manifest_files) - implicit_deps = implicit_deps.union(manifest_files) - if intermediate_manifest: - self.WriteVariableList( - ninja_file, "intermediatemanifest", [intermediate_manifest] - ) - command_suffix = _GetWinLinkRuleNameSuffix( - self.msvs_settings.IsEmbedManifest(config_name) - ) - def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) - if def_file: - implicit_deps.add(def_file) - else: - # Respect environment variables related to build, but target-specific - # flags can still override them. - ldflags = env_ldflags + config.get("ldflags", []) - if is_executable and len(solibs): - rpath = "lib/" - if self.toolset != "target": - rpath += self.toolset - ldflags.append(r"-Wl,-rpath=\$$ORIGIN/%s" % rpath) - else: - ldflags.append("-Wl,-rpath=%s" % self.target_rpath) - ldflags.append("-Wl,-rpath-link=%s" % rpath) - self.WriteVariableList(ninja_file, "ldflags", map(self.ExpandSpecial, ldflags)) - - library_dirs = config.get("library_dirs", []) - if self.flavor == "win": - library_dirs = [ - self.msvs_settings.ConvertVSMacros(library_dir, config_name) - for library_dir in library_dirs - ] - library_dirs = [ - "/LIBPATH:" - + QuoteShellArgument(self.GypPathToNinja(library_dir), self.flavor) - for library_dir in library_dirs - ] - else: - library_dirs = [ - QuoteShellArgument("-L" + self.GypPathToNinja(library_dir), self.flavor) - for library_dir in library_dirs - ] - - libraries = gyp.common.uniquer( - map(self.ExpandSpecial, spec.get("libraries", [])) - ) - if self.flavor == "mac": - libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) - elif self.flavor == "win": - libraries = self.msvs_settings.AdjustLibraries(libraries) - - self.WriteVariableList(ninja_file, "libs", library_dirs + libraries) - - linked_binary = output - - if command in ("solink", "solink_module"): - extra_bindings.append(("soname", os.path.split(output)[1])) - extra_bindings.append(("lib", gyp.common.EncodePOSIXShellArgument(output))) - if self.flavor != "win": - link_file_list = output - if self.is_mac_bundle: - # 'Dependency Framework.framework/Versions/A/Dependency Framework' - # -> 'Dependency Framework.framework.rsp' - link_file_list = self.xcode_settings.GetWrapperName() - if arch: - link_file_list += "." + arch - link_file_list += ".rsp" - # If an rspfile contains spaces, ninja surrounds the filename with - # quotes around it and then passes it to open(), creating a file with - # quotes in its name (and when looking for the rsp file, the name - # makes it through bash which strips the quotes) :-/ - link_file_list = link_file_list.replace(" ", "_") - extra_bindings.append( - ( - "link_file_list", - gyp.common.EncodePOSIXShellArgument(link_file_list), - ) - ) - if self.flavor == "win": - extra_bindings.append(("binary", output)) - if ( - "/NOENTRY" not in ldflags - and not self.msvs_settings.GetNoImportLibrary(config_name) - ): - self.target.import_lib = output + ".lib" - extra_bindings.append( - ("implibflag", "/IMPLIB:%s" % self.target.import_lib) - ) - pdbname = self.msvs_settings.GetPDBName( - config_name, self.ExpandSpecial, output + ".pdb" - ) - output = [output, self.target.import_lib] - if pdbname: - output.append(pdbname) - elif not self.is_mac_bundle: - output = [output, output + ".TOC"] - else: - command = command + "_notoc" - elif self.flavor == "win": - extra_bindings.append(("binary", output)) - pdbname = self.msvs_settings.GetPDBName( - config_name, self.ExpandSpecial, output + ".pdb" - ) - if pdbname: - output = [output, pdbname] - - if len(solibs): - extra_bindings.append( - ("solibs", gyp.common.EncodePOSIXShellList(sorted(solibs))) - ) - - ninja_file.build( - output, - command + command_suffix, - link_deps, - implicit=sorted(implicit_deps), - order_only=list(order_deps), - variables=extra_bindings, - ) - return linked_binary - - def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): - extra_link_deps = any( - self.target_outputs.get(dep).Linkable() - for dep in spec.get("dependencies", []) - if dep in self.target_outputs - ) - if spec["type"] == "none" or (not link_deps and not extra_link_deps): - # TODO(evan): don't call this function for 'none' target types, as - # it doesn't do anything, and we fake out a 'binary' with a stamp file. - self.target.binary = compile_deps - self.target.type = "none" - elif spec["type"] == "static_library": - self.target.binary = self.ComputeOutput(spec) - if ( - self.flavor not in ("ios", "mac", "netbsd", "openbsd", "win") - and not self.is_standalone_static_library - ): - self.ninja.build( - self.target.binary, "alink_thin", link_deps, order_only=compile_deps - ) - else: - variables = [] - if self.xcode_settings: - libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) - if libtool_flags: - variables.append(("libtool_flags", libtool_flags)) - if self.msvs_settings: - libflags = self.msvs_settings.GetLibFlags( - config_name, self.GypPathToNinja - ) - variables.append(("libflags", libflags)) - - if self.flavor != "mac" or len(self.archs) == 1: - self.AppendPostbuildVariable( - variables, spec, self.target.binary, self.target.binary - ) - self.ninja.build( - self.target.binary, - "alink", - link_deps, - order_only=compile_deps, - variables=variables, - ) - else: - inputs = [] - for arch in self.archs: - output = self.ComputeOutput(spec, arch) - self.arch_subninjas[arch].build( - output, - "alink", - link_deps[arch], - order_only=compile_deps, - variables=variables, - ) - inputs.append(output) - # TODO: It's not clear if - # libtool_flags should be passed to the alink - # call that combines single-arch .a files into a fat .a file. - self.AppendPostbuildVariable( - variables, spec, self.target.binary, self.target.binary - ) - self.ninja.build( - self.target.binary, - "alink", - inputs, - # FIXME: test proving order_only=compile_deps isn't - # needed. - variables=variables, - ) - else: - self.target.binary = self.WriteLink( - spec, config_name, config, link_deps, compile_deps - ) - return self.target.binary - - def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): - assert self.is_mac_bundle - package_framework = spec["type"] in ("shared_library", "loadable_module") - output = self.ComputeMacBundleOutput() - if is_empty: - output += ".stamp" - variables = [] - self.AppendPostbuildVariable( - variables, - spec, - output, - self.target.binary, - is_command_start=not package_framework, - ) - if package_framework and not is_empty: - if spec["type"] == "shared_library" and self.xcode_settings.isIOS: - self.ninja.build( - output, - "package_ios_framework", - mac_bundle_depends, - variables=variables, - ) - else: - variables.append(("version", self.xcode_settings.GetFrameworkVersion())) - self.ninja.build( - output, "package_framework", mac_bundle_depends, variables=variables - ) - else: - self.ninja.build(output, "stamp", mac_bundle_depends, variables=variables) - self.target.bundle = output - return output - - def GetToolchainEnv(self, additional_settings=None): - """Returns the variables toolchain would set for build steps.""" - env = self.GetSortedXcodeEnv(additional_settings=additional_settings) - if self.flavor == "win": - env = self.GetMsvsToolchainEnv(additional_settings=additional_settings) - return env - - def GetMsvsToolchainEnv(self, additional_settings=None): - """Returns the variables Visual Studio would set for build steps.""" - return self.msvs_settings.GetVSMacroEnv( - "$!PRODUCT_DIR", config=self.config_name - ) - - def GetSortedXcodeEnv(self, additional_settings=None): - """Returns the variables Xcode would set for build steps.""" - assert self.abs_build_dir - abs_build_dir = self.abs_build_dir - return gyp.xcode_emulation.GetSortedXcodeEnv( - self.xcode_settings, - abs_build_dir, - os.path.join(abs_build_dir, self.build_to_base), - self.config_name, - additional_settings, - ) - - def GetSortedXcodePostbuildEnv(self): - """Returns the variables Xcode would set for postbuild steps.""" - postbuild_settings = {} - # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. - # TODO(thakis): It would be nice to have some general mechanism instead. - strip_save_file = self.xcode_settings.GetPerTargetSetting( - "CHROMIUM_STRIP_SAVE_FILE" - ) - if strip_save_file: - postbuild_settings["CHROMIUM_STRIP_SAVE_FILE"] = strip_save_file - return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) - - def AppendPostbuildVariable( - self, variables, spec, output, binary, is_command_start=False - ): - """Adds a 'postbuild' variable if there is a postbuild for |output|.""" - postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) - if postbuild: - variables.append(("postbuilds", postbuild)) - - def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): - """Returns a shell command that runs all the postbuilds, and removes - |output| if any of them fails. If |is_command_start| is False, then the - returned string will start with ' && '.""" - if not self.xcode_settings or spec["type"] == "none" or not output: - return "" - output = QuoteShellArgument(output, self.flavor) - postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) - if output_binary is not None: - postbuilds = self.xcode_settings.AddImplicitPostbuilds( - self.config_name, - os.path.normpath(os.path.join(self.base_to_build, output)), - QuoteShellArgument( - os.path.normpath(os.path.join(self.base_to_build, output_binary)), - self.flavor, - ), - postbuilds, - quiet=True, - ) - - if not postbuilds: - return "" - # Postbuilds expect to be run in the gyp file's directory, so insert an - # implicit postbuild to cd to there. - postbuilds.insert( - 0, gyp.common.EncodePOSIXShellList(["cd", self.build_to_base]) - ) - env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) - # G will be non-null if any postbuild fails. Run all postbuilds in a - # subshell. - commands = ( - env - + " (" - + " && ".join([ninja_syntax.escape(command) for command in postbuilds]) - ) - command_string = ( - commands - + "); G=$$?; " - # Remove the final output if any postbuild failed. - "((exit $$G) || rm -rf %s) " % output - + "&& exit $$G)" - ) - if is_command_start: - return "(" + command_string + " && " - else: - return "$ && (" + command_string - - def ComputeExportEnvString(self, env): - """Given an environment, returns a string looking like - 'export FOO=foo; export BAR="${FOO} bar;' - that exports |env| to the shell.""" - export_str = [] - for k, v in env: - export_str.append( - "export %s=%s;" - % (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v))) - ) - return " ".join(export_str) - - def ComputeMacBundleOutput(self): - """Return the 'output' (full output path) to a bundle output directory.""" - assert self.is_mac_bundle - path = generator_default_variables["PRODUCT_DIR"] - return self.ExpandSpecial( - os.path.join(path, self.xcode_settings.GetWrapperName()) - ) - - def ComputeOutputFileName(self, spec, type=None): - """Compute the filename of the final output for the current target.""" - if not type: - type = spec["type"] - - default_variables = copy.copy(generator_default_variables) - CalculateVariables(default_variables, {"flavor": self.flavor}) - - # Compute filename prefix: the product prefix, or a default for - # the product type. - DEFAULT_PREFIX = { - "loadable_module": default_variables["SHARED_LIB_PREFIX"], - "shared_library": default_variables["SHARED_LIB_PREFIX"], - "static_library": default_variables["STATIC_LIB_PREFIX"], - "executable": default_variables["EXECUTABLE_PREFIX"], - } - prefix = spec.get("product_prefix", DEFAULT_PREFIX.get(type, "")) - - # Compute filename extension: the product extension, or a default - # for the product type. - DEFAULT_EXTENSION = { - "loadable_module": default_variables["SHARED_LIB_SUFFIX"], - "shared_library": default_variables["SHARED_LIB_SUFFIX"], - "static_library": default_variables["STATIC_LIB_SUFFIX"], - "executable": default_variables["EXECUTABLE_SUFFIX"], - } - extension = spec.get("product_extension") - if extension: - extension = "." + extension - else: - extension = DEFAULT_EXTENSION.get(type, "") - - if "product_name" in spec: - # If we were given an explicit name, use that. - target = spec["product_name"] - else: - # Otherwise, derive a name from the target name. - target = spec["target_name"] - if prefix == "lib": - # Snip out an extra 'lib' from libs if appropriate. - target = StripPrefix(target, "lib") - - if type in ( - "static_library", - "loadable_module", - "shared_library", - "executable", - ): - return f"{prefix}{target}{extension}" - elif type == "none": - return "%s.stamp" % target - else: - raise Exception("Unhandled output type %s" % type) - - def ComputeOutput(self, spec, arch=None): - """Compute the path for the final output of the spec.""" - type = spec["type"] - - if self.flavor == "win": - override = self.msvs_settings.GetOutputName( - self.config_name, self.ExpandSpecial - ) - if override: - return override - - if ( - arch is None - and self.flavor == "mac" - and type - in ("static_library", "executable", "shared_library", "loadable_module") - ): - filename = self.xcode_settings.GetExecutablePath() - else: - filename = self.ComputeOutputFileName(spec, type) - - if arch is None and "product_dir" in spec: - path = os.path.join(spec["product_dir"], filename) - return self.ExpandSpecial(path) - - # Some products go into the output root, libraries go into shared library - # dir, and everything else goes into the normal place. - type_in_output_root = ["executable", "loadable_module"] - if self.flavor == "mac" and self.toolset == "target": - type_in_output_root += ["shared_library", "static_library"] - elif self.flavor == "win" and self.toolset == "target": - type_in_output_root += ["shared_library"] - - if arch is not None: - # Make sure partial executables don't end up in a bundle or the regular - # output directory. - archdir = "arch" - if self.toolset != "target": - archdir = os.path.join("arch", "%s" % self.toolset) - return os.path.join(archdir, AddArch(filename, arch)) - elif type in type_in_output_root or self.is_standalone_static_library: - return filename - elif type == "shared_library": - libdir = "lib" - if self.toolset != "target": - libdir = os.path.join("lib", "%s" % self.toolset) - return os.path.join(libdir, filename) - else: - return self.GypPathToUniqueOutput(filename, qualified=False) - - def WriteVariableList(self, ninja_file, var, values): - assert not isinstance(values, str) - if values is None: - values = [] - ninja_file.variable(var, " ".join(values)) - - def WriteNewNinjaRule( - self, name, args, description, win_shell_flags, env, pool, depfile=None - ): - """Write out a new ninja "rule" statement for a given command. - - Returns the name of the new rule, and a copy of |args| with variables - expanded.""" - - if self.flavor == "win": - args = [ - self.msvs_settings.ConvertVSMacros( - arg, self.base_to_build, config=self.config_name - ) - for arg in args - ] - description = self.msvs_settings.ConvertVSMacros( - description, config=self.config_name - ) - elif self.flavor == "mac": - # |env| is an empty list on non-mac. - args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] - description = gyp.xcode_emulation.ExpandEnvVars(description, env) - - # TODO: we shouldn't need to qualify names; we do it because - # currently the ninja rule namespace is global, but it really - # should be scoped to the subninja. - rule_name = self.name - if self.toolset == "target": - rule_name += "." + self.toolset - rule_name += "." + name - rule_name = re.sub("[^a-zA-Z0-9_]", "_", rule_name) - - # Remove variable references, but not if they refer to the magic rule - # variables. This is not quite right, as it also protects these for - # actions, not just for rules where they are valid. Good enough. - protect = ["${root}", "${dirname}", "${source}", "${ext}", "${name}"] - protect = "(?!" + "|".join(map(re.escape, protect)) + ")" - description = re.sub(protect + r"\$", "_", description) - - # gyp dictates that commands are run from the base directory. - # cd into the directory before running, and adjust paths in - # the arguments to point to the proper locations. - rspfile = None - rspfile_content = None - args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] - if self.flavor == "win": - rspfile = rule_name + ".$unique_name.rsp" - # The cygwin case handles this inside the bash sub-shell. - run_in = "" if win_shell_flags.cygwin else " " + self.build_to_base - if win_shell_flags.cygwin: - rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( - args, self.build_to_base - ) - else: - rspfile_content = gyp.msvs_emulation.EncodeRspFileList( - args, win_shell_flags.quote) - command = ( - "%s gyp-win-tool action-wrapper $arch " % sys.executable - + rspfile - + run_in - ) - else: - env = self.ComputeExportEnvString(env) - command = gyp.common.EncodePOSIXShellList(args) - command = "cd %s; " % self.build_to_base + env + command - - # GYP rules/actions express being no-ops by not touching their outputs. - # Avoid executing downstream dependencies in this case by specifying - # restat=1 to ninja. - self.ninja.rule( - rule_name, - command, - description, - depfile=depfile, - restat=True, - pool=pool, - rspfile=rspfile, - rspfile_content=rspfile_content, - ) - self.ninja.newline() - - return rule_name, args - - -def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - global generator_additional_non_configuration_keys - global generator_additional_path_sections - flavor = gyp.common.GetFlavor(params) - if flavor == "mac": - default_variables.setdefault("OS", "mac") - default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") - default_variables.setdefault( - "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - default_variables.setdefault( - "LIB_DIR", generator_default_variables["PRODUCT_DIR"] - ) - - # Copy additional generator configuration data from Xcode, which is shared - # by the Mac Ninja generator. - import gyp.generator.xcode as xcode_generator - - generator_additional_non_configuration_keys = getattr( - xcode_generator, "generator_additional_non_configuration_keys", [] - ) - generator_additional_path_sections = getattr( - xcode_generator, "generator_additional_path_sections", [] - ) - global generator_extra_sources_for_rules - generator_extra_sources_for_rules = getattr( - xcode_generator, "generator_extra_sources_for_rules", [] - ) - elif flavor == "win": - exts = gyp.MSVSUtil.TARGET_TYPE_EXT - default_variables.setdefault("OS", "win") - default_variables["EXECUTABLE_SUFFIX"] = "." + exts["executable"] - default_variables["STATIC_LIB_PREFIX"] = "" - default_variables["STATIC_LIB_SUFFIX"] = "." + exts["static_library"] - default_variables["SHARED_LIB_PREFIX"] = "" - default_variables["SHARED_LIB_SUFFIX"] = "." + exts["shared_library"] - - # Copy additional generator configuration data from VS, which is shared - # by the Windows Ninja generator. - import gyp.generator.msvs as msvs_generator - - generator_additional_non_configuration_keys = getattr( - msvs_generator, "generator_additional_non_configuration_keys", [] - ) - generator_additional_path_sections = getattr( - msvs_generator, "generator_additional_path_sections", [] - ) - - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - else: - operating_system = flavor - if flavor == "android": - operating_system = "linux" # Keep this legacy behavior for now. - default_variables.setdefault("OS", operating_system) - default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") - default_variables.setdefault( - "SHARED_LIB_DIR", os.path.join("$!PRODUCT_DIR", "lib") - ) - default_variables.setdefault("LIB_DIR", os.path.join("$!PRODUCT_DIR", "obj")) - - -def ComputeOutputDir(params): - """Returns the path from the toplevel_dir to the build output directory.""" - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to ninja easier, ninja doesn't put anything here. - generator_dir = os.path.relpath(params["options"].generator_output or ".") - - # output_dir: relative path from generator_dir to the build directory. - output_dir = params.get("generator_flags", {}).get("output_dir", "out") - - # Relative path from source root to our output files. e.g. "out" - return os.path.normpath(os.path.join(generator_dir, output_dir)) - - -def CalculateGeneratorInputInfo(params): - """Called by __init__ to initialize generator values based on params.""" - # E.g. "out/gypfiles" - toplevel = params["options"].toplevel_dir - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, ComputeOutputDir(params), "gypfiles") - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def OpenOutput(path, mode="w"): - """Open |path| for writing, creating directories if necessary.""" - gyp.common.EnsureDirExists(path) - return open(path, mode) - - -def CommandWithWrapper(cmd, wrappers, prog): - wrapper = wrappers.get(cmd, "") - if wrapper: - return wrapper + " " + prog - return prog - - -def GetDefaultConcurrentLinks(): - """Returns a best-guess for a number of concurrent links.""" - pool_size = int(os.environ.get("GYP_LINK_CONCURRENCY", 0)) - if pool_size: - return pool_size - - if sys.platform in ("win32", "cygwin"): - import ctypes - - class MEMORYSTATUSEX(ctypes.Structure): - _fields_ = [ - ("dwLength", ctypes.c_ulong), - ("dwMemoryLoad", ctypes.c_ulong), - ("ullTotalPhys", ctypes.c_ulonglong), - ("ullAvailPhys", ctypes.c_ulonglong), - ("ullTotalPageFile", ctypes.c_ulonglong), - ("ullAvailPageFile", ctypes.c_ulonglong), - ("ullTotalVirtual", ctypes.c_ulonglong), - ("ullAvailVirtual", ctypes.c_ulonglong), - ("sullAvailExtendedVirtual", ctypes.c_ulonglong), - ] - - stat = MEMORYSTATUSEX() - stat.dwLength = ctypes.sizeof(stat) - ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) - - # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM - # on a 64 GiB machine. - mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GiB - hard_cap = max(1, int(os.environ.get("GYP_LINK_CONCURRENCY_MAX", 2 ** 32))) - return min(mem_limit, hard_cap) - elif sys.platform.startswith("linux"): - if os.path.exists("/proc/meminfo"): - with open("/proc/meminfo") as meminfo: - memtotal_re = re.compile(r"^MemTotal:\s*(\d*)\s*kB") - for line in meminfo: - match = memtotal_re.match(line) - if not match: - continue - # Allow 8Gb per link on Linux because Gold is quite memory hungry - return max(1, int(match.group(1)) // (8 * (2 ** 20))) - return 1 - elif sys.platform == "darwin": - try: - avail_bytes = int(subprocess.check_output(["sysctl", "-n", "hw.memsize"])) - # A static library debug build of Chromium's unit_tests takes ~2.7GB, so - # 4GB per ld process allows for some more bloat. - return max(1, avail_bytes // (4 * (2 ** 30))) # total / 4GB - except subprocess.CalledProcessError: - return 1 - else: - # TODO(scottmg): Implement this for other platforms. - return 1 - - -def _GetWinLinkRuleNameSuffix(embed_manifest): - """Returns the suffix used to select an appropriate linking rule depending on - whether the manifest embedding is enabled.""" - return "_embed" if embed_manifest else "" - - -def _AddWinLinkRules(master_ninja, embed_manifest): - """Adds link rules for Windows platform to |master_ninja|.""" - - def FullLinkCommand(ldcmd, out, binary_type): - resource_name = {"exe": "1", "dll": "2"}[binary_type] - return ( - "%(python)s gyp-win-tool link-with-manifests $arch %(embed)s " - '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' - "$manifests" - % { - "python": sys.executable, - "out": out, - "ldcmd": ldcmd, - "resname": resource_name, - "embed": embed_manifest, - } - ) - - rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) - use_separate_mspdbsrv = int(os.environ.get("GYP_USE_SEPARATE_MSPDBSRV", "0")) != 0 - dlldesc = "LINK%s(DLL) $binary" % rule_name_suffix.upper() - dllcmd = ( - "%s gyp-win-tool link-wrapper $arch %s " - "$ld /nologo $implibflag /DLL /OUT:$binary " - "@$binary.rsp" % (sys.executable, use_separate_mspdbsrv) - ) - dllcmd = FullLinkCommand(dllcmd, "$binary", "dll") - master_ninja.rule( - "solink" + rule_name_suffix, - description=dlldesc, - command=dllcmd, - rspfile="$binary.rsp", - rspfile_content="$libs $in_newline $ldflags", - restat=True, - pool="link_pool", - ) - master_ninja.rule( - "solink_module" + rule_name_suffix, - description=dlldesc, - command=dllcmd, - rspfile="$binary.rsp", - rspfile_content="$libs $in_newline $ldflags", - restat=True, - pool="link_pool", - ) - # Note that ldflags goes at the end so that it has the option of - # overriding default settings earlier in the command line. - exe_cmd = ( - "%s gyp-win-tool link-wrapper $arch %s " - "$ld /nologo /OUT:$binary @$binary.rsp" - % (sys.executable, use_separate_mspdbsrv) - ) - exe_cmd = FullLinkCommand(exe_cmd, "$binary", "exe") - master_ninja.rule( - "link" + rule_name_suffix, - description="LINK%s $binary" % rule_name_suffix.upper(), - command=exe_cmd, - rspfile="$binary.rsp", - rspfile_content="$in_newline $libs $ldflags", - pool="link_pool", - ) - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): - options = params["options"] - flavor = gyp.common.GetFlavor(params) - generator_flags = params.get("generator_flags", {}) - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath(os.path.join(ComputeOutputDir(params), config_name)) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - - master_ninja_file = OpenOutput(os.path.join(toplevel_build, "build.ninja")) - master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) - - # Put build-time support tools in out/{config_name}. - gyp.common.CopyTool(flavor, toplevel_build, generator_flags) - - # Grab make settings for CC/CXX. - # The rules are - # - The priority from low to high is gcc/g++, the 'make_global_settings' in - # gyp, the environment variable. - # - If there is no 'make_global_settings' for CC.host/CXX.host or - # 'CC_host'/'CXX_host' environment variable, cc_host/cxx_host should be set - # to cc/cxx. - if flavor == "win": - ar = "lib.exe" - # cc and cxx must be set to the correct architecture by overriding with one - # of cl_x86 or cl_x64 below. - cc = "UNSET" - cxx = "UNSET" - ld = "link.exe" - ld_host = "$ld" - else: - ar = "ar" - cc = "cc" - cxx = "c++" - ld = "$cc" - ldxx = "$cxx" - ld_host = "$cc_host" - ldxx_host = "$cxx_host" - - ar_host = ar - cc_host = None - cxx_host = None - cc_host_global_setting = None - cxx_host_global_setting = None - clang_cl = None - nm = "nm" - nm_host = "nm" - readelf = "readelf" - readelf_host = "readelf" - - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings = data[build_file].get("make_global_settings", []) - build_to_root = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - wrappers = {} - for key, value in make_global_settings: - if key == "AR": - ar = os.path.join(build_to_root, value) - if key == "AR.host": - ar_host = os.path.join(build_to_root, value) - if key == "CC": - cc = os.path.join(build_to_root, value) - if cc.endswith("clang-cl"): - clang_cl = cc - if key == "CXX": - cxx = os.path.join(build_to_root, value) - if key == "CC.host": - cc_host = os.path.join(build_to_root, value) - cc_host_global_setting = value - if key == "CXX.host": - cxx_host = os.path.join(build_to_root, value) - cxx_host_global_setting = value - if key == "LD": - ld = os.path.join(build_to_root, value) - if key == "LD.host": - ld_host = os.path.join(build_to_root, value) - if key == "LDXX": - ldxx = os.path.join(build_to_root, value) - if key == "LDXX.host": - ldxx_host = os.path.join(build_to_root, value) - if key == "NM": - nm = os.path.join(build_to_root, value) - if key == "NM.host": - nm_host = os.path.join(build_to_root, value) - if key == "READELF": - readelf = os.path.join(build_to_root, value) - if key == "READELF.host": - readelf_host = os.path.join(build_to_root, value) - if key.endswith("_wrapper"): - wrappers[key[: -len("_wrapper")]] = os.path.join(build_to_root, value) - - # Support wrappers from environment variables too. - for key, value in os.environ.items(): - if key.lower().endswith("_wrapper"): - key_prefix = key[: -len("_wrapper")] - key_prefix = re.sub(r"\.HOST$", ".host", key_prefix) - wrappers[key_prefix] = os.path.join(build_to_root, value) - - mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) - if mac_toolchain_dir: - wrappers["LINK"] = "export DEVELOPER_DIR='%s' &&" % mac_toolchain_dir - - if flavor == "win": - configs = [ - target_dicts[qualified_target]["configurations"][config_name] - for qualified_target in target_list - ] - shared_system_includes = None - if not generator_flags.get("ninja_use_custom_environment_files", 0): - shared_system_includes = gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( - configs, generator_flags - ) - cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( - toplevel_build, generator_flags, shared_system_includes, OpenOutput - ) - for arch, path in sorted(cl_paths.items()): - if clang_cl: - # If we have selected clang-cl, use that instead. - path = clang_cl - command = CommandWithWrapper( - "CC", wrappers, QuoteShellArgument(path, "win") - ) - if clang_cl: - # Use clang-cl to cross-compile for x86 or x86_64. - command += " -m32" if arch == "x86" else " -m64" - master_ninja.variable("cl_" + arch, command) - - cc = GetEnvironFallback(["CC_target", "CC"], cc) - master_ninja.variable("cc", CommandWithWrapper("CC", wrappers, cc)) - cxx = GetEnvironFallback(["CXX_target", "CXX"], cxx) - master_ninja.variable("cxx", CommandWithWrapper("CXX", wrappers, cxx)) - - if flavor == "win": - master_ninja.variable("ld", ld) - master_ninja.variable("idl", "midl.exe") - master_ninja.variable("ar", ar) - master_ninja.variable("rc", "rc.exe") - master_ninja.variable("ml_x86", "ml.exe") - master_ninja.variable("ml_x64", "ml64.exe") - master_ninja.variable("mt", "mt.exe") - else: - master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld)) - master_ninja.variable("ldxx", CommandWithWrapper("LINK", wrappers, ldxx)) - master_ninja.variable("ar", GetEnvironFallback(["AR_target", "AR"], ar)) - if flavor != "mac": - # Mac does not use readelf/nm for .TOC generation, so avoiding polluting - # the master ninja with extra unused variables. - master_ninja.variable("nm", GetEnvironFallback(["NM_target", "NM"], nm)) - master_ninja.variable( - "readelf", GetEnvironFallback(["READELF_target", "READELF"], readelf) - ) - - if generator_supports_multiple_toolsets: - if not cc_host: - cc_host = cc - if not cxx_host: - cxx_host = cxx - - master_ninja.variable("ar_host", GetEnvironFallback(["AR_host"], ar_host)) - master_ninja.variable("nm_host", GetEnvironFallback(["NM_host"], nm_host)) - master_ninja.variable( - "readelf_host", GetEnvironFallback(["READELF_host"], readelf_host) - ) - cc_host = GetEnvironFallback(["CC_host"], cc_host) - cxx_host = GetEnvironFallback(["CXX_host"], cxx_host) - - # The environment variable could be used in 'make_global_settings', like - # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. - if "$(CC)" in cc_host and cc_host_global_setting: - cc_host = cc_host_global_setting.replace("$(CC)", cc) - if "$(CXX)" in cxx_host and cxx_host_global_setting: - cxx_host = cxx_host_global_setting.replace("$(CXX)", cxx) - master_ninja.variable( - "cc_host", CommandWithWrapper("CC.host", wrappers, cc_host) - ) - master_ninja.variable( - "cxx_host", CommandWithWrapper("CXX.host", wrappers, cxx_host) - ) - if flavor == "win": - master_ninja.variable("ld_host", ld_host) - else: - master_ninja.variable( - "ld_host", CommandWithWrapper("LINK", wrappers, ld_host) - ) - master_ninja.variable( - "ldxx_host", CommandWithWrapper("LINK", wrappers, ldxx_host) - ) - - master_ninja.newline() - - master_ninja.pool("link_pool", depth=GetDefaultConcurrentLinks()) - master_ninja.newline() - - deps = "msvc" if flavor == "win" else "gcc" - - if flavor != "win": - master_ninja.rule( - "cc", - description="CC $out", - command=( - "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c " - "$cflags_pch_c -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - master_ninja.rule( - "cc_s", - description="CC $out", - command=( - "$cc $defines $includes $cflags $cflags_c " - "$cflags_pch_c -c $in -o $out" - ), - ) - master_ninja.rule( - "cxx", - description="CXX $out", - command=( - "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc " - "$cflags_pch_cc -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - else: - # TODO(scottmg) Separate pdb names is a test to see if it works around - # http://crbug.com/142362. It seems there's a race between the creation of - # the .pdb by the precompiled header step for .cc and the compilation of - # .c files. This should be handled by mspdbsrv, but rarely errors out with - # c1xx : fatal error C1033: cannot open program database - # By making the rules target separate pdb files this might be avoided. - cc_command = ( - "ninja -t msvc -e $arch " + "-- " - "$cc /nologo /showIncludes /FC " - "@$out.rsp /c $in /Fo$out /Fd$pdbname_c " - ) - cxx_command = ( - "ninja -t msvc -e $arch " + "-- " - "$cxx /nologo /showIncludes /FC " - "@$out.rsp /c $in /Fo$out /Fd$pdbname_cc " - ) - master_ninja.rule( - "cc", - description="CC $out", - command=cc_command, - rspfile="$out.rsp", - rspfile_content="$defines $includes $cflags $cflags_c", - deps=deps, - ) - master_ninja.rule( - "cxx", - description="CXX $out", - command=cxx_command, - rspfile="$out.rsp", - rspfile_content="$defines $includes $cflags $cflags_cc", - deps=deps, - ) - master_ninja.rule( - "idl", - description="IDL $in", - command=( - "%s gyp-win-tool midl-wrapper $arch $outdir " - "$tlb $h $dlldata $iid $proxy $in " - "$midl_includes $idlflags" % sys.executable - ), - ) - master_ninja.rule( - "rc", - description="RC $in", - # Note: $in must be last otherwise rc.exe complains. - command=( - "%s gyp-win-tool rc-wrapper " - "$arch $rc $defines $resource_includes $rcflags /fo$out $in" - % sys.executable - ), - ) - master_ninja.rule( - "asm", - description="ASM $out", - command=( - "%s gyp-win-tool asm-wrapper " - "$arch $asm $defines $includes $asmflags /c /Fo $out $in" - % sys.executable - ), - ) - - if flavor not in ("ios", "mac", "win"): - master_ninja.rule( - "alink", - description="AR $out", - command="rm -f $out && $ar rcs $arflags $out $in", - ) - master_ninja.rule( - "alink_thin", - description="AR $out", - command="rm -f $out && $ar rcsT $arflags $out $in", - ) - - # This allows targets that only need to depend on $lib's API to declare an - # order-only dependency on $lib.TOC and avoid relinking such downstream - # dependencies when $lib changes only in non-public ways. - # The resulting string leaves an uninterpolated %{suffix} which - # is used in the final substitution below. - mtime_preserving_solink_base = ( - "if [ ! -e $lib -o ! -e $lib.TOC ]; then " - "%(solink)s && %(extract_toc)s > $lib.TOC; else " - "%(solink)s && %(extract_toc)s > $lib.tmp && " - "if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; " - "fi; fi" - % { - "solink": "$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s", - "extract_toc": ( - "{ $readelf -d $lib | grep SONAME ; " - "$nm -gD -f p $lib | cut -f1-2 -d' '; }" - ), - } - ) - - master_ninja.rule( - "solink", - description="SOLINK $lib", - restat=True, - command=mtime_preserving_solink_base - % {"suffix": "@$link_file_list"}, # noqa: E501 - rspfile="$link_file_list", - rspfile_content=( - "-Wl,--whole-archive $in $solibs -Wl," "--no-whole-archive $libs" - ), - pool="link_pool", - ) - master_ninja.rule( - "solink_module", - description="SOLINK(module) $lib", - restat=True, - command=mtime_preserving_solink_base % {"suffix": "@$link_file_list"}, - rspfile="$link_file_list", - rspfile_content="-Wl,--start-group $in $solibs $libs -Wl,--end-group", - pool="link_pool", - ) - master_ninja.rule( - "link", - description="LINK $out", - command=( - "$ld $ldflags -o $out " - "-Wl,--start-group $in $solibs $libs -Wl,--end-group" - ), - pool="link_pool", - ) - elif flavor == "win": - master_ninja.rule( - "alink", - description="LIB $out", - command=( - "%s gyp-win-tool link-wrapper $arch False " - "$ar /nologo /ignore:4221 /OUT:$out @$out.rsp" % sys.executable - ), - rspfile="$out.rsp", - rspfile_content="$in_newline $libflags", - ) - _AddWinLinkRules(master_ninja, embed_manifest=True) - _AddWinLinkRules(master_ninja, embed_manifest=False) - else: - master_ninja.rule( - "objc", - description="OBJC $out", - command=( - "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc " - "$cflags_pch_objc -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - master_ninja.rule( - "objcxx", - description="OBJCXX $out", - command=( - "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc " - "$cflags_pch_objcc -c $in -o $out" - ), - depfile="$out.d", - deps=deps, - ) - master_ninja.rule( - "alink", - description="LIBTOOL-STATIC $out, POSTBUILDS", - command="rm -f $out && " - "./gyp-mac-tool filter-libtool libtool $libtool_flags " - "-static -o $out $in" - "$postbuilds", - ) - master_ninja.rule( - "lipo", - description="LIPO $out, POSTBUILDS", - command="rm -f $out && lipo -create $in -output $out$postbuilds", - ) - master_ninja.rule( - "solipo", - description="SOLIPO $out, POSTBUILDS", - command=( - "rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&" - "%(extract_toc)s > $lib.TOC" - % { - "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " - "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }" - } - ), - ) - - # Record the public interface of $lib in $lib.TOC. See the corresponding - # comment in the posix section above for details. - solink_base = "$ld %(type)s $ldflags -o $lib %(suffix)s" - mtime_preserving_solink_base = ( - "if [ ! -e $lib -o ! -e $lib.TOC ] || " - # Always force dependent targets to relink if this library - # reexports something. Handling this correctly would require - # recursive TOC dumping but this is rare in practice, so punt. - "otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then " - "%(solink)s && %(extract_toc)s > $lib.TOC; " - "else " - "%(solink)s && %(extract_toc)s > $lib.tmp && " - "if ! cmp -s $lib.tmp $lib.TOC; then " - "mv $lib.tmp $lib.TOC ; " - "fi; " - "fi" - % { - "solink": solink_base, - "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " - "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }", - } - ) - - solink_suffix = "@$link_file_list$postbuilds" - master_ninja.rule( - "solink", - description="SOLINK $lib, POSTBUILDS", - restat=True, - command=mtime_preserving_solink_base - % {"suffix": solink_suffix, "type": "-shared"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - master_ninja.rule( - "solink_notoc", - description="SOLINK $lib, POSTBUILDS", - restat=True, - command=solink_base % {"suffix": solink_suffix, "type": "-shared"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - - master_ninja.rule( - "solink_module", - description="SOLINK(module) $lib, POSTBUILDS", - restat=True, - command=mtime_preserving_solink_base - % {"suffix": solink_suffix, "type": "-bundle"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - master_ninja.rule( - "solink_module_notoc", - description="SOLINK(module) $lib, POSTBUILDS", - restat=True, - command=solink_base % {"suffix": solink_suffix, "type": "-bundle"}, - rspfile="$link_file_list", - rspfile_content="$in $solibs $libs", - pool="link_pool", - ) - - master_ninja.rule( - "link", - description="LINK $out, POSTBUILDS", - command=("$ld $ldflags -o $out " "$in $solibs $libs$postbuilds"), - pool="link_pool", - ) - master_ninja.rule( - "preprocess_infoplist", - description="PREPROCESS INFOPLIST $out", - command=( - "$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && " - "plutil -convert xml1 $out $out" - ), - ) - master_ninja.rule( - "copy_infoplist", - description="COPY INFOPLIST $in", - command="$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys", - ) - master_ninja.rule( - "merge_infoplist", - description="MERGE INFOPLISTS $in", - command="$env ./gyp-mac-tool merge-info-plist $out $in", - ) - master_ninja.rule( - "compile_xcassets", - description="COMPILE XCASSETS $in", - command="$env ./gyp-mac-tool compile-xcassets $keys $in", - ) - master_ninja.rule( - "compile_ios_framework_headers", - description="COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in", - command="$env ./gyp-mac-tool compile-ios-framework-header-map $out " - "$framework $in && $env ./gyp-mac-tool " - "copy-ios-framework-headers $framework $copy_headers", - ) - master_ninja.rule( - "mac_tool", - description="MACTOOL $mactool_cmd $in", - command="$env ./gyp-mac-tool $mactool_cmd $in $out $binary", - ) - master_ninja.rule( - "package_framework", - description="PACKAGE FRAMEWORK $out, POSTBUILDS", - command="./gyp-mac-tool package-framework $out $version$postbuilds " - "&& touch $out", - ) - master_ninja.rule( - "package_ios_framework", - description="PACKAGE IOS FRAMEWORK $out, POSTBUILDS", - command="./gyp-mac-tool package-ios-framework $out $postbuilds " - "&& touch $out", - ) - if flavor == "win": - master_ninja.rule( - "stamp", - description="STAMP $out", - command="%s gyp-win-tool stamp $out" % sys.executable, - ) - else: - master_ninja.rule( - "stamp", description="STAMP $out", command="${postbuilds}touch $out" - ) - if flavor == "win": - master_ninja.rule( - "copy", - description="COPY $in $out", - command="%s gyp-win-tool recursive-mirror $in $out" % sys.executable, - ) - elif flavor == "zos": - master_ninja.rule( - "copy", - description="COPY $in $out", - command="rm -rf $out && cp -fRP $in $out", - ) - else: - master_ninja.rule( - "copy", - description="COPY $in $out", - command="ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)", - ) - master_ninja.newline() - - all_targets = set() - for build_file in params["build_files"]: - for target in gyp.common.AllTargets( - target_list, target_dicts, os.path.normpath(build_file) - ): - all_targets.add(target) - all_outputs = set() - - # target_outputs is a map from qualified target name to a Target object. - target_outputs = {} - # target_short_names is a map from target short name to a list of Target - # objects. - target_short_names = {} - - # short name of targets that were skipped because they didn't contain anything - # interesting. - # NOTE: there may be overlap between this an non_empty_target_names. - empty_target_names = set() - - # Set of non-empty short target names. - # NOTE: there may be overlap between this an empty_target_names. - non_empty_target_names = set() - - for qualified_target in target_list: - # qualified_target is like: third_party/icu/icu.gyp:icui18n#target - build_file, name, toolset = gyp.common.ParseQualifiedTarget(qualified_target) - - this_make_global_settings = data[build_file].get("make_global_settings", []) - assert make_global_settings == this_make_global_settings, ( - "make_global_settings needs to be the same for all targets. " - f"{this_make_global_settings} vs. {make_global_settings}" - ) - - spec = target_dicts[qualified_target] - if flavor == "mac": - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - - # If build_file is a symlink, we must not follow it because there's a chance - # it could point to a path above toplevel_dir, and we cannot correctly deal - # with that case at the moment. - build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, False) - - qualified_target_for_hash = gyp.common.QualifiedTarget( - build_file, name, toolset - ) - qualified_target_for_hash = qualified_target_for_hash.encode("utf-8") - hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() - - base_path = os.path.dirname(build_file) - obj = "obj" - if toolset != "target": - obj += "." + toolset - output_file = os.path.join(obj, base_path, name + ".ninja") - - ninja_output = StringIO() - writer = NinjaWriter( - hash_for_rules, - target_outputs, - base_path, - build_dir, - ninja_output, - toplevel_build, - output_file, - flavor, - toplevel_dir=options.toplevel_dir, - ) - - target = writer.WriteSpec(spec, config_name, generator_flags) - - if ninja_output.tell() > 0: - # Only create files for ninja files that actually have contents. - with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: - ninja_file.write(ninja_output.getvalue()) - ninja_output.close() - master_ninja.subninja(output_file) - - if target: - if name != target.FinalOutput() and spec["toolset"] == "target": - target_short_names.setdefault(name, []).append(target) - target_outputs[qualified_target] = target - if qualified_target in all_targets: - all_outputs.add(target.FinalOutput()) - non_empty_target_names.add(name) - else: - empty_target_names.add(name) - - if target_short_names: - # Write a short name to build this target. This benefits both the - # "build chrome" case as well as the gyp tests, which expect to be - # able to run actions and build libraries by their short name. - master_ninja.newline() - master_ninja.comment("Short names for targets.") - for short_name in sorted(target_short_names): - master_ninja.build( - short_name, - "phony", - [x.FinalOutput() for x in target_short_names[short_name]], - ) - - # Write phony targets for any empty targets that weren't written yet. As - # short names are not necessarily unique only do this for short names that - # haven't already been output for another target. - empty_target_names = empty_target_names - non_empty_target_names - if empty_target_names: - master_ninja.newline() - master_ninja.comment("Empty targets (output for completeness).") - for name in sorted(empty_target_names): - master_ninja.build(name, "phony") - - if all_outputs: - master_ninja.newline() - master_ninja.build("all", "phony", sorted(all_outputs)) - master_ninja.default(generator_flags.get("default_target", "all")) - - master_ninja_file.close() - - -def PerformBuild(data, configurations, params): - options = params["options"] - for config in configurations: - builddir = os.path.join(options.toplevel_dir, "out", config) - arguments = ["ninja", "-C", builddir] - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def CallGenerateOutputForConfig(arglist): - # Ignore the interrupt signal so that the parent process catches it and - # kills all multiprocessing children. - signal.signal(signal.SIGINT, signal.SIG_IGN) - - (target_list, target_dicts, data, params, config_name) = arglist - GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) - - -def GenerateOutput(target_list, target_dicts, data, params): - # Update target_dicts for iOS device builds. - target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( - target_dicts - ) - - user_config = params.get("generator_flags", {}).get("config", None) - if gyp.common.GetFlavor(params) == "win": - target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) - target_list, target_dicts = MSVSUtil.InsertLargePdbShims( - target_list, target_dicts, generator_default_variables - ) - - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) - else: - config_names = target_dicts[target_list[0]]["configurations"] - if params["parallel"]: - try: - pool = multiprocessing.Pool(len(config_names)) - arglists = [] - for config_name in config_names: - arglists.append( - (target_list, target_dicts, data, params, config_name) - ) - pool.map(CallGenerateOutputForConfig, arglists) - except KeyboardInterrupt as e: - pool.terminate() - raise e - else: - for config_name in config_names: - GenerateOutputForConfig( - target_list, target_dicts, data, params, config_name - ) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py deleted file mode 100644 index 7d180685b..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the ninja.py file. """ - -import sys -import unittest - -import gyp.generator.ninja as ninja - - -class TestPrefixesAndSuffixes(unittest.TestCase): - def test_BinaryNamesWindows(self): - # These cannot run on non-Windows as they require a VS installation to - # correctly handle variable expansion. - if sys.platform.startswith("win"): - writer = ninja.NinjaWriter( - "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "win" - ) - spec = {"target_name": "wee"} - self.assertTrue( - writer.ComputeOutputFileName(spec, "executable").endswith(".exe") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "shared_library").endswith(".dll") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "static_library").endswith(".lib") - ) - - def test_BinaryNamesLinux(self): - writer = ninja.NinjaWriter( - "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "linux" - ) - spec = {"target_name": "wee"} - self.assertTrue("." not in writer.ComputeOutputFileName(spec, "executable")) - self.assertTrue( - writer.ComputeOutputFileName(spec, "shared_library").startswith("lib") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "static_library").startswith("lib") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "shared_library").endswith(".so") - ) - self.assertTrue( - writer.ComputeOutputFileName(spec, "static_library").endswith(".a") - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py deleted file mode 100644 index 2f4d17e51..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +++ /dev/null @@ -1,1394 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import filecmp -import gyp.common -import gyp.xcodeproj_file -import gyp.xcode_ninja -import errno -import os -import sys -import posixpath -import re -import shutil -import subprocess -import tempfile - - -# Project files generated by this module will use _intermediate_var as a -# custom Xcode setting whose value is a DerivedSources-like directory that's -# project-specific and configuration-specific. The normal choice, -# DERIVED_FILE_DIR, is target-specific, which is thought to be too restrictive -# as it is likely that multiple targets within a single project file will want -# to access the same set of generated files. The other option, -# PROJECT_DERIVED_FILE_DIR, is unsuitable because while it is project-specific, -# it is not configuration-specific. INTERMEDIATE_DIR is defined as -# $(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION). -_intermediate_var = "INTERMEDIATE_DIR" - -# SHARED_INTERMEDIATE_DIR is the same, except that it is shared among all -# targets that share the same BUILT_PRODUCTS_DIR. -_shared_intermediate_var = "SHARED_INTERMEDIATE_DIR" - -_library_search_paths_var = "LIBRARY_SEARCH_PATHS" - -generator_default_variables = { - "EXECUTABLE_PREFIX": "", - "EXECUTABLE_SUFFIX": "", - "STATIC_LIB_PREFIX": "lib", - "SHARED_LIB_PREFIX": "lib", - "STATIC_LIB_SUFFIX": ".a", - "SHARED_LIB_SUFFIX": ".dylib", - # INTERMEDIATE_DIR is a place for targets to build up intermediate products. - # It is specific to each build environment. It is only guaranteed to exist - # and be constant within the context of a project, corresponding to a single - # input file. Some build environments may allow their intermediate directory - # to be shared on a wider scale, but this is not guaranteed. - "INTERMEDIATE_DIR": "$(%s)" % _intermediate_var, - "OS": "mac", - "PRODUCT_DIR": "$(BUILT_PRODUCTS_DIR)", - "LIB_DIR": "$(BUILT_PRODUCTS_DIR)", - "RULE_INPUT_ROOT": "$(INPUT_FILE_BASE)", - "RULE_INPUT_EXT": "$(INPUT_FILE_SUFFIX)", - "RULE_INPUT_NAME": "$(INPUT_FILE_NAME)", - "RULE_INPUT_PATH": "$(INPUT_FILE_PATH)", - "RULE_INPUT_DIRNAME": "$(INPUT_FILE_DIRNAME)", - "SHARED_INTERMEDIATE_DIR": "$(%s)" % _shared_intermediate_var, - "CONFIGURATION_NAME": "$(CONFIGURATION)", -} - -# The Xcode-specific sections that hold paths. -generator_additional_path_sections = [ - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", - # 'mac_framework_dirs', input already handles _dirs endings. -] - -# The Xcode-specific keys that exist on targets and aren't moved down to -# configurations. -generator_additional_non_configuration_keys = [ - "ios_app_extension", - "ios_watch_app", - "ios_watchkit_extension", - "mac_bundle", - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", - "mac_xctest_bundle", - "mac_xcuitest_bundle", - "xcode_create_dependents_test_runner", -] - -# We want to let any rules apply to files that are resources also. -generator_extra_sources_for_rules = [ - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", -] - -generator_filelist_paths = None - -# Xcode's standard set of library directories, which don't need to be duplicated -# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. -xcode_standard_library_dirs = frozenset( - ["$(SDKROOT)/usr/lib", "$(SDKROOT)/usr/local/lib"] -) - - -def CreateXCConfigurationList(configuration_names): - xccl = gyp.xcodeproj_file.XCConfigurationList({"buildConfigurations": []}) - if len(configuration_names) == 0: - configuration_names = ["Default"] - for configuration_name in configuration_names: - xcbc = gyp.xcodeproj_file.XCBuildConfiguration({"name": configuration_name}) - xccl.AppendProperty("buildConfigurations", xcbc) - xccl.SetProperty("defaultConfigurationName", configuration_names[0]) - return xccl - - -class XcodeProject: - def __init__(self, gyp_path, path, build_file_dict): - self.gyp_path = gyp_path - self.path = path - self.project = gyp.xcodeproj_file.PBXProject(path=path) - projectDirPath = gyp.common.RelativePath( - os.path.dirname(os.path.abspath(self.gyp_path)), - os.path.dirname(path) or ".", - ) - self.project.SetProperty("projectDirPath", projectDirPath) - self.project_file = gyp.xcodeproj_file.XCProjectFile( - {"rootObject": self.project} - ) - self.build_file_dict = build_file_dict - - # TODO(mark): add destructor that cleans up self.path if created_dir is - # True and things didn't complete successfully. Or do something even - # better with "try"? - self.created_dir = False - try: - os.makedirs(self.path) - self.created_dir = True - except OSError as e: - if e.errno != errno.EEXIST: - raise - - def Finalize1(self, xcode_targets, serialize_all_tests): - # Collect a list of all of the build configuration names used by the - # various targets in the file. It is very heavily advised to keep each - # target in an entire project (even across multiple project files) using - # the same set of configuration names. - configurations = [] - for xct in self.project.GetProperty("targets"): - xccl = xct.GetProperty("buildConfigurationList") - xcbcs = xccl.GetProperty("buildConfigurations") - for xcbc in xcbcs: - name = xcbc.GetProperty("name") - if name not in configurations: - configurations.append(name) - - # Replace the XCConfigurationList attached to the PBXProject object with - # a new one specifying all of the configuration names used by the various - # targets. - try: - xccl = CreateXCConfigurationList(configurations) - self.project.SetProperty("buildConfigurationList", xccl) - except Exception: - sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path) - raise - - # The need for this setting is explained above where _intermediate_var is - # defined. The comments below about wanting to avoid project-wide build - # settings apply here too, but this needs to be set on a project-wide basis - # so that files relative to the _intermediate_var setting can be displayed - # properly in the Xcode UI. - # - # Note that for configuration-relative files such as anything relative to - # _intermediate_var, for the purposes of UI tree view display, Xcode will - # only resolve the configuration name once, when the project file is - # opened. If the active build configuration is changed, the project file - # must be closed and reopened if it is desired for the tree view to update. - # This is filed as Apple radar 6588391. - xccl.SetBuildSetting( - _intermediate_var, "$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)" - ) - xccl.SetBuildSetting( - _shared_intermediate_var, "$(SYMROOT)/DerivedSources/$(CONFIGURATION)" - ) - - # Set user-specified project-wide build settings and config files. This - # is intended to be used very sparingly. Really, almost everything should - # go into target-specific build settings sections. The project-wide - # settings are only intended to be used in cases where Xcode attempts to - # resolve variable references in a project context as opposed to a target - # context, such as when resolving sourceTree references while building up - # the tree tree view for UI display. - # Any values set globally are applied to all configurations, then any - # per-configuration values are applied. - for xck, xcv in self.build_file_dict.get("xcode_settings", {}).items(): - xccl.SetBuildSetting(xck, xcv) - if "xcode_config_file" in self.build_file_dict: - config_ref = self.project.AddOrGetFileInRootGroup( - self.build_file_dict["xcode_config_file"] - ) - xccl.SetBaseConfiguration(config_ref) - build_file_configurations = self.build_file_dict.get("configurations", {}) - if build_file_configurations: - for config_name in configurations: - build_file_configuration_named = build_file_configurations.get( - config_name, {} - ) - if build_file_configuration_named: - xcc = xccl.ConfigurationNamed(config_name) - for xck, xcv in build_file_configuration_named.get( - "xcode_settings", {} - ).items(): - xcc.SetBuildSetting(xck, xcv) - if "xcode_config_file" in build_file_configuration_named: - config_ref = self.project.AddOrGetFileInRootGroup( - build_file_configurations[config_name]["xcode_config_file"] - ) - xcc.SetBaseConfiguration(config_ref) - - # Sort the targets based on how they appeared in the input. - # TODO(mark): Like a lot of other things here, this assumes internal - # knowledge of PBXProject - in this case, of its "targets" property. - - # ordinary_targets are ordinary targets that are already in the project - # file. run_test_targets are the targets that run unittests and should be - # used for the Run All Tests target. support_targets are the action/rule - # targets used by GYP file targets, just kept for the assert check. - ordinary_targets = [] - run_test_targets = [] - support_targets = [] - - # targets is full list of targets in the project. - targets = [] - - # does the it define it's own "all"? - has_custom_all = False - - # targets_for_all is the list of ordinary_targets that should be listed - # in this project's "All" target. It includes each non_runtest_target - # that does not have suppress_wildcard set. - targets_for_all = [] - - for target in self.build_file_dict["targets"]: - target_name = target["target_name"] - toolset = target["toolset"] - qualified_target = gyp.common.QualifiedTarget( - self.gyp_path, target_name, toolset - ) - xcode_target = xcode_targets[qualified_target] - # Make sure that the target being added to the sorted list is already in - # the unsorted list. - assert xcode_target in self.project._properties["targets"] - targets.append(xcode_target) - ordinary_targets.append(xcode_target) - if xcode_target.support_target: - support_targets.append(xcode_target.support_target) - targets.append(xcode_target.support_target) - - if not int(target.get("suppress_wildcard", False)): - targets_for_all.append(xcode_target) - - if target_name.lower() == "all": - has_custom_all = True - - # If this target has a 'run_as' attribute, add its target to the - # targets, and add it to the test targets. - if target.get("run_as"): - # Make a target to run something. It should have one - # dependency, the parent xcode target. - xccl = CreateXCConfigurationList(configurations) - run_target = gyp.xcodeproj_file.PBXAggregateTarget( - { - "name": "Run " + target_name, - "productName": xcode_target.GetProperty("productName"), - "buildConfigurationList": xccl, - }, - parent=self.project, - ) - run_target.AddDependency(xcode_target) - - command = target["run_as"] - script = "" - if command.get("working_directory"): - script = ( - script - + 'cd "%s"\n' - % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - command.get("working_directory") - ) - ) - - if command.get("environment"): - script = ( - script - + "\n".join( - [ - 'export %s="%s"' - % ( - key, - gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - val - ), - ) - for (key, val) in command.get("environment").items() - ] - ) - + "\n" - ) - - # Some test end up using sockets, files on disk, etc. and can get - # confused if more then one test runs at a time. The generator - # flag 'xcode_serialize_all_test_runs' controls the forcing of all - # tests serially. It defaults to True. To get serial runs this - # little bit of python does the same as the linux flock utility to - # make sure only one runs at a time. - command_prefix = "" - if serialize_all_tests: - command_prefix = """python -c "import fcntl, subprocess, sys -file = open('$TMPDIR/GYP_serialize_test_runs', 'a') -fcntl.flock(file.fileno(), fcntl.LOCK_EX) -sys.exit(subprocess.call(sys.argv[1:]))" """ - - # If we were unable to exec for some reason, we want to exit - # with an error, and fixup variable references to be shell - # syntax instead of xcode syntax. - script = ( - script - + "exec " - + command_prefix - + "%s\nexit 1\n" - % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - gyp.common.EncodePOSIXShellList(command.get("action")) - ) - ) - - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - {"shellScript": script, "showEnvVarsInLog": 0} - ) - run_target.AppendProperty("buildPhases", ssbp) - - # Add the run target to the project file. - targets.append(run_target) - run_test_targets.append(run_target) - xcode_target.test_runner = run_target - - # Make sure that the list of targets being replaced is the same length as - # the one replacing it, but allow for the added test runner targets. - assert len(self.project._properties["targets"]) == len(ordinary_targets) + len( - support_targets - ) - - self.project._properties["targets"] = targets - - # Get rid of unnecessary levels of depth in groups like the Source group. - self.project.RootGroupsTakeOverOnlyChildren(True) - - # Sort the groups nicely. Do this after sorting the targets, because the - # Products group is sorted based on the order of the targets. - self.project.SortGroups() - - # Create an "All" target if there's more than one target in this project - # file and the project didn't define its own "All" target. Put a generated - # "All" target first so that people opening up the project for the first - # time will build everything by default. - if len(targets_for_all) > 1 and not has_custom_all: - xccl = CreateXCConfigurationList(configurations) - all_target = gyp.xcodeproj_file.PBXAggregateTarget( - {"buildConfigurationList": xccl, "name": "All"}, parent=self.project - ) - - for target in targets_for_all: - all_target.AddDependency(target) - - # TODO(mark): This is evil because it relies on internal knowledge of - # PBXProject._properties. It's important to get the "All" target first, - # though. - self.project._properties["targets"].insert(0, all_target) - - # The same, but for run_test_targets. - if len(run_test_targets) > 1: - xccl = CreateXCConfigurationList(configurations) - run_all_tests_target = gyp.xcodeproj_file.PBXAggregateTarget( - {"buildConfigurationList": xccl, "name": "Run All Tests"}, - parent=self.project, - ) - for run_test_target in run_test_targets: - run_all_tests_target.AddDependency(run_test_target) - - # Insert after the "All" target, which must exist if there is more than - # one run_test_target. - self.project._properties["targets"].insert(1, run_all_tests_target) - - def Finalize2(self, xcode_targets, xcode_target_to_target_dict): - # Finalize2 needs to happen in a separate step because the process of - # updating references to other projects depends on the ordering of targets - # within remote project files. Finalize1 is responsible for sorting duty, - # and once all project files are sorted, Finalize2 can come in and update - # these references. - - # To support making a "test runner" target that will run all the tests - # that are direct dependents of any given target, we look for - # xcode_create_dependents_test_runner being set on an Aggregate target, - # and generate a second target that will run the tests runners found under - # the marked target. - for bf_tgt in self.build_file_dict["targets"]: - if int(bf_tgt.get("xcode_create_dependents_test_runner", 0)): - tgt_name = bf_tgt["target_name"] - toolset = bf_tgt["toolset"] - qualified_target = gyp.common.QualifiedTarget( - self.gyp_path, tgt_name, toolset - ) - xcode_target = xcode_targets[qualified_target] - if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): - # Collect all the run test targets. - all_run_tests = [] - pbxtds = xcode_target.GetProperty("dependencies") - for pbxtd in pbxtds: - pbxcip = pbxtd.GetProperty("targetProxy") - dependency_xct = pbxcip.GetProperty("remoteGlobalIDString") - if hasattr(dependency_xct, "test_runner"): - all_run_tests.append(dependency_xct.test_runner) - - # Directly depend on all the runners as they depend on the target - # that builds them. - if len(all_run_tests) > 0: - run_all_target = gyp.xcodeproj_file.PBXAggregateTarget( - { - "name": "Run %s Tests" % tgt_name, - "productName": tgt_name, - }, - parent=self.project, - ) - for run_test_target in all_run_tests: - run_all_target.AddDependency(run_test_target) - - # Insert the test runner after the related target. - idx = self.project._properties["targets"].index(xcode_target) - self.project._properties["targets"].insert( - idx + 1, run_all_target - ) - - # Update all references to other projects, to make sure that the lists of - # remote products are complete. Otherwise, Xcode will fill them in when - # it opens the project file, which will result in unnecessary diffs. - # TODO(mark): This is evil because it relies on internal knowledge of - # PBXProject._other_pbxprojects. - for other_pbxproject in self.project._other_pbxprojects.keys(): - self.project.AddOrGetProjectReference(other_pbxproject) - - self.project.SortRemoteProductReferences() - - # Give everything an ID. - self.project_file.ComputeIDs() - - # Make sure that no two objects in the project file have the same ID. If - # multiple objects wind up with the same ID, upon loading the file, Xcode - # will only recognize one object (the last one in the file?) and the - # results are unpredictable. - self.project_file.EnsureNoIDCollisions() - - def Write(self): - # Write the project file to a temporary location first. Xcode watches for - # changes to the project file and presents a UI sheet offering to reload - # the project when it does change. However, in some cases, especially when - # multiple projects are open or when Xcode is busy, things don't work so - # seamlessly. Sometimes, Xcode is able to detect that a project file has - # changed but can't unload it because something else is referencing it. - # To mitigate this problem, and to avoid even having Xcode present the UI - # sheet when an open project is rewritten for inconsequential changes, the - # project file is written to a temporary file in the xcodeproj directory - # first. The new temporary file is then compared to the existing project - # file, if any. If they differ, the new file replaces the old; otherwise, - # the new project file is simply deleted. Xcode properly detects a file - # being renamed over an open project file as a change and so it remains - # able to present the "project file changed" sheet under this system. - # Writing to a temporary file first also avoids the possible problem of - # Xcode rereading an incomplete project file. - (output_fd, new_pbxproj_path) = tempfile.mkstemp( - suffix=".tmp", prefix="project.pbxproj.gyp.", dir=self.path - ) - - try: - output_file = os.fdopen(output_fd, "w") - - self.project_file.Print(output_file) - output_file.close() - - pbxproj_path = os.path.join(self.path, "project.pbxproj") - - same = False - try: - same = filecmp.cmp(pbxproj_path, new_pbxproj_path, False) - except OSError as e: - if e.errno != errno.ENOENT: - raise - - if same: - # The new file is identical to the old one, just get rid of the new - # one. - os.unlink(new_pbxproj_path) - else: - # The new file is different from the old one, or there is no old one. - # Rename the new file to the permanent name. - # - # tempfile.mkstemp uses an overly restrictive mode, resulting in a - # file that can only be read by the owner, regardless of the umask. - # There's no reason to not respect the umask here, which means that - # an extra hoop is required to fetch it and reset the new file's mode. - # - # No way to get the umask without setting a new one? Set a safe one - # and then set it back to the old value. - umask = os.umask(0o77) - os.umask(umask) - - os.chmod(new_pbxproj_path, 0o666 & ~umask) - os.rename(new_pbxproj_path, pbxproj_path) - - except Exception: - # Don't leave turds behind. In fact, if this code was responsible for - # creating the xcodeproj directory, get rid of that too. - os.unlink(new_pbxproj_path) - if self.created_dir: - shutil.rmtree(self.path, True) - raise - - -def AddSourceToTarget(source, type, pbxp, xct): - # TODO(mark): Perhaps source_extensions and library_extensions can be made a - # little bit fancier. - source_extensions = ["c", "cc", "cpp", "cxx", "m", "mm", "s", "swift"] - - # .o is conceptually more of a "source" than a "library," but Xcode thinks - # of "sources" as things to compile and "libraries" (or "frameworks") as - # things to link with. Adding an object file to an Xcode target's frameworks - # phase works properly. - library_extensions = ["a", "dylib", "framework", "o"] - - basename = posixpath.basename(source) - (root, ext) = posixpath.splitext(basename) - if ext: - ext = ext[1:].lower() - - if ext in source_extensions and type != "none": - xct.SourcesPhase().AddFile(source) - elif ext in library_extensions and type != "none": - xct.FrameworksPhase().AddFile(source) - else: - # Files that aren't added to a sources or frameworks build phase can still - # go into the project file, just not as part of a build phase. - pbxp.AddOrGetFileInRootGroup(source) - - -def AddResourceToTarget(resource, pbxp, xct): - # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call - # where it's used. - xct.ResourcesPhase().AddFile(resource) - - -def AddHeaderToTarget(header, pbxp, xct, is_public): - # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call - # where it's used. - settings = "{ATTRIBUTES = (%s, ); }" % ("Private", "Public")[is_public] - xct.HeadersPhase().AddFile(header, settings) - - -_xcode_variable_re = re.compile(r"(\$\((.*?)\))") - - -def ExpandXcodeVariables(string, expansions): - """Expands Xcode-style $(VARIABLES) in string per the expansions dict. - - In some rare cases, it is appropriate to expand Xcode variables when a - project file is generated. For any substring $(VAR) in string, if VAR is a - key in the expansions dict, $(VAR) will be replaced with expansions[VAR]. - Any $(VAR) substring in string for which VAR is not a key in the expansions - dict will remain in the returned string. - """ - - matches = _xcode_variable_re.findall(string) - if matches is None: - return string - - matches.reverse() - for match in matches: - (to_replace, variable) = match - if variable not in expansions: - continue - - replacement = expansions[variable] - string = re.sub(re.escape(to_replace), replacement, string) - - return string - - -_xcode_define_re = re.compile(r"([\\\"\' ])") - - -def EscapeXcodeDefine(s): - """We must escape the defines that we give to XCode so that it knows not to - split on spaces and to respect backslash and quote literals. However, we - must not quote the define, or Xcode will incorrectly interpret variables - especially $(inherited).""" - return re.sub(_xcode_define_re, r"\\\1", s) - - -def PerformBuild(data, configurations, params): - options = params["options"] - - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != ".gyp": - continue - xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" - if options.generator_output: - xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) - - for config in configurations: - arguments = ["xcodebuild", "-project", xcodeproj_path] - arguments += ["-configuration", config] - print(f"Building [{config}]: {arguments}") - subprocess.check_call(arguments) - - -def CalculateGeneratorInputInfo(params): - toplevel = params["options"].toplevel_dir - if params.get("flavor") == "ninja": - generator_dir = os.path.relpath(params["options"].generator_output or ".") - output_dir = params.get("generator_flags", {}).get("output_dir", "out") - output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, output_dir, "gypfiles-xcode-ninja") - ) - else: - output_dir = os.path.normpath(os.path.join(toplevel, "xcodebuild")) - qualified_out_dir = os.path.normpath( - os.path.join(toplevel, output_dir, "gypfiles") - ) - - global generator_filelist_paths - generator_filelist_paths = { - "toplevel": toplevel, - "qualified_out_dir": qualified_out_dir, - } - - -def GenerateOutput(target_list, target_dicts, data, params): - # Optionally configure each spec to use ninja as the external builder. - ninja_wrapper = params.get("flavor") == "ninja" - if ninja_wrapper: - (target_list, target_dicts, data) = gyp.xcode_ninja.CreateWrapper( - target_list, target_dicts, data, params - ) - - options = params["options"] - generator_flags = params.get("generator_flags", {}) - parallel_builds = generator_flags.get("xcode_parallel_builds", True) - serialize_all_tests = generator_flags.get("xcode_serialize_all_test_runs", True) - upgrade_check_project_version = generator_flags.get( - "xcode_upgrade_check_project_version", None - ) - - # Format upgrade_check_project_version with leading zeros as needed. - if upgrade_check_project_version: - upgrade_check_project_version = str(upgrade_check_project_version) - while len(upgrade_check_project_version) < 4: - upgrade_check_project_version = "0" + upgrade_check_project_version - - skip_excluded_files = not generator_flags.get("xcode_list_excluded_files", True) - xcode_projects = {} - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != ".gyp": - continue - xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" - if options.generator_output: - xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) - xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) - xcode_projects[build_file] = xcp - pbxp = xcp.project - - # Set project-level attributes from multiple options - project_attributes = {} - if parallel_builds: - project_attributes["BuildIndependentTargetsInParallel"] = "YES" - if upgrade_check_project_version: - project_attributes["LastUpgradeCheck"] = upgrade_check_project_version - project_attributes[ - "LastTestingUpgradeCheck" - ] = upgrade_check_project_version - project_attributes["LastSwiftUpdateCheck"] = upgrade_check_project_version - pbxp.SetProperty("attributes", project_attributes) - - # Add gyp/gypi files to project - if not generator_flags.get("standalone"): - main_group = pbxp.GetProperty("mainGroup") - build_group = gyp.xcodeproj_file.PBXGroup({"name": "Build"}) - main_group.AppendChild(build_group) - for included_file in build_file_dict["included_files"]: - build_group.AddOrGetFileByPath(included_file, False) - - xcode_targets = {} - xcode_target_to_target_dict = {} - for qualified_target in target_list: - [build_file, target_name, toolset] = gyp.common.ParseQualifiedTarget( - qualified_target - ) - - spec = target_dicts[qualified_target] - if spec["toolset"] != "target": - raise Exception( - "Multiple toolsets not supported in xcode build (target %s)" - % qualified_target - ) - configuration_names = [spec["default_configuration"]] - for configuration_name in sorted(spec["configurations"].keys()): - if configuration_name not in configuration_names: - configuration_names.append(configuration_name) - xcp = xcode_projects[build_file] - pbxp = xcp.project - - # Set up the configurations for the target according to the list of names - # supplied. - xccl = CreateXCConfigurationList(configuration_names) - - # Create an XCTarget subclass object for the target. The type with - # "+bundle" appended will be used if the target has "mac_bundle" set. - # loadable_modules not in a mac_bundle are mapped to - # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets - # to create a single-file mh_bundle. - _types = { - "executable": "com.apple.product-type.tool", - "loadable_module": "com.googlecode.gyp.xcode.bundle", - "shared_library": "com.apple.product-type.library.dynamic", - "static_library": "com.apple.product-type.library.static", - "mac_kernel_extension": "com.apple.product-type.kernel-extension", - "executable+bundle": "com.apple.product-type.application", - "loadable_module+bundle": "com.apple.product-type.bundle", - "loadable_module+xctest": "com.apple.product-type.bundle.unit-test", - "loadable_module+xcuitest": "com.apple.product-type.bundle.ui-testing", - "shared_library+bundle": "com.apple.product-type.framework", - "executable+extension+bundle": "com.apple.product-type.app-extension", - "executable+watch+extension+bundle": - "com.apple.product-type.watchkit-extension", - "executable+watch+bundle": "com.apple.product-type.application.watchapp", - "mac_kernel_extension+bundle": "com.apple.product-type.kernel-extension", - } - - target_properties = { - "buildConfigurationList": xccl, - "name": target_name, - } - - type = spec["type"] - is_xctest = int(spec.get("mac_xctest_bundle", 0)) - is_xcuitest = int(spec.get("mac_xcuitest_bundle", 0)) - is_bundle = int(spec.get("mac_bundle", 0)) or is_xctest - is_app_extension = int(spec.get("ios_app_extension", 0)) - is_watchkit_extension = int(spec.get("ios_watchkit_extension", 0)) - is_watch_app = int(spec.get("ios_watch_app", 0)) - if type != "none": - type_bundle_key = type - if is_xcuitest: - type_bundle_key += "+xcuitest" - assert type == "loadable_module", ( - "mac_xcuitest_bundle targets must have type loadable_module " - "(target %s)" % target_name - ) - elif is_xctest: - type_bundle_key += "+xctest" - assert type == "loadable_module", ( - "mac_xctest_bundle targets must have type loadable_module " - "(target %s)" % target_name - ) - elif is_app_extension: - assert is_bundle, ( - "ios_app_extension flag requires mac_bundle " - "(target %s)" % target_name - ) - type_bundle_key += "+extension+bundle" - elif is_watchkit_extension: - assert is_bundle, ( - "ios_watchkit_extension flag requires mac_bundle " - "(target %s)" % target_name - ) - type_bundle_key += "+watch+extension+bundle" - elif is_watch_app: - assert is_bundle, ( - "ios_watch_app flag requires mac_bundle " - "(target %s)" % target_name - ) - type_bundle_key += "+watch+bundle" - elif is_bundle: - type_bundle_key += "+bundle" - - xctarget_type = gyp.xcodeproj_file.PBXNativeTarget - try: - target_properties["productType"] = _types[type_bundle_key] - except KeyError as e: - gyp.common.ExceptionAppend( - e, - "-- unknown product type while " "writing target %s" % target_name, - ) - raise - else: - xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget - assert not is_bundle, ( - 'mac_bundle targets cannot have type none (target "%s")' % target_name - ) - assert not is_xcuitest, ( - 'mac_xcuitest_bundle targets cannot have type none (target "%s")' - % target_name - ) - assert not is_xctest, ( - 'mac_xctest_bundle targets cannot have type none (target "%s")' - % target_name - ) - - target_product_name = spec.get("product_name") - if target_product_name is not None: - target_properties["productName"] = target_product_name - - xct = xctarget_type( - target_properties, - parent=pbxp, - force_outdir=spec.get("product_dir"), - force_prefix=spec.get("product_prefix"), - force_extension=spec.get("product_extension"), - ) - pbxp.AppendProperty("targets", xct) - xcode_targets[qualified_target] = xct - xcode_target_to_target_dict[xct] = spec - - spec_actions = spec.get("actions", []) - spec_rules = spec.get("rules", []) - - # Xcode has some "issues" with checking dependencies for the "Compile - # sources" step with any source files/headers generated by actions/rules. - # To work around this, if a target is building anything directly (not - # type "none"), then a second target is used to run the GYP actions/rules - # and is made a dependency of this target. This way the work is done - # before the dependency checks for what should be recompiled. - support_xct = None - # The Xcode "issues" don't affect xcode-ninja builds, since the dependency - # logic all happens in ninja. Don't bother creating the extra targets in - # that case. - if type != "none" and (spec_actions or spec_rules) and not ninja_wrapper: - support_xccl = CreateXCConfigurationList(configuration_names) - support_target_suffix = generator_flags.get( - "support_target_suffix", " Support" - ) - support_target_properties = { - "buildConfigurationList": support_xccl, - "name": target_name + support_target_suffix, - } - if target_product_name: - support_target_properties["productName"] = ( - target_product_name + " Support" - ) - support_xct = gyp.xcodeproj_file.PBXAggregateTarget( - support_target_properties, parent=pbxp - ) - pbxp.AppendProperty("targets", support_xct) - xct.AddDependency(support_xct) - # Hang the support target off the main target so it can be tested/found - # by the generator during Finalize. - xct.support_target = support_xct - - prebuild_index = 0 - - # Add custom shell script phases for "actions" sections. - for action in spec_actions: - # There's no need to write anything into the script to ensure that the - # output directories already exist, because Xcode will look at the - # declared outputs and automatically ensure that they exist for us. - - # Do we have a message to print when this action runs? - message = action.get("message") - if message: - message = "echo note: " + gyp.common.EncodePOSIXShellArgument(message) - else: - message = "" - - # Turn the list into a string that can be passed to a shell. - action_string = gyp.common.EncodePOSIXShellList(action["action"]) - - # Convert Xcode-type variable references to sh-compatible environment - # variable references. - message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) - action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - action_string - ) - - script = "" - # Include the optional message - if message_sh: - script += message_sh + "\n" - # Be sure the script runs in exec, and that if exec fails, the script - # exits signalling an error. - script += "exec " + action_string_sh + "\nexit 1\n" - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - { - "inputPaths": action["inputs"], - "name": 'Action "' + action["action_name"] + '"', - "outputPaths": action["outputs"], - "shellScript": script, - "showEnvVarsInLog": 0, - } - ) - - if support_xct: - support_xct.AppendProperty("buildPhases", ssbp) - else: - # TODO(mark): this assumes too much knowledge of the internals of - # xcodeproj_file; some of these smarts should move into xcodeproj_file - # itself. - xct._properties["buildPhases"].insert(prebuild_index, ssbp) - prebuild_index = prebuild_index + 1 - - # TODO(mark): Should verify that at most one of these is specified. - if int(action.get("process_outputs_as_sources", False)): - for output in action["outputs"]: - AddSourceToTarget(output, type, pbxp, xct) - - if int(action.get("process_outputs_as_mac_bundle_resources", False)): - for output in action["outputs"]: - AddResourceToTarget(output, pbxp, xct) - - # tgt_mac_bundle_resources holds the list of bundle resources so - # the rule processing can check against it. - if is_bundle: - tgt_mac_bundle_resources = spec.get("mac_bundle_resources", []) - else: - tgt_mac_bundle_resources = [] - - # Add custom shell script phases driving "make" for "rules" sections. - # - # Xcode's built-in rule support is almost powerful enough to use directly, - # but there are a few significant deficiencies that render them unusable. - # There are workarounds for some of its inadequacies, but in aggregate, - # the workarounds added complexity to the generator, and some workarounds - # actually require input files to be crafted more carefully than I'd like. - # Consequently, until Xcode rules are made more capable, "rules" input - # sections will be handled in Xcode output by shell script build phases - # performed prior to the compilation phase. - # - # The following problems with Xcode rules were found. The numbers are - # Apple radar IDs. I hope that these shortcomings are addressed, I really - # liked having the rules handled directly in Xcode during the period that - # I was prototyping this. - # - # 6588600 Xcode compiles custom script rule outputs too soon, compilation - # fails. This occurs when rule outputs from distinct inputs are - # interdependent. The only workaround is to put rules and their - # inputs in a separate target from the one that compiles the rule - # outputs. This requires input file cooperation and it means that - # process_outputs_as_sources is unusable. - # 6584932 Need to declare that custom rule outputs should be excluded from - # compilation. A possible workaround is to lie to Xcode about a - # rule's output, giving it a dummy file it doesn't know how to - # compile. The rule action script would need to touch the dummy. - # 6584839 I need a way to declare additional inputs to a custom rule. - # A possible workaround is a shell script phase prior to - # compilation that touches a rule's primary input files if any - # would-be additional inputs are newer than the output. Modifying - # the source tree - even just modification times - feels dirty. - # 6564240 Xcode "custom script" build rules always dump all environment - # variables. This is a low-prioroty problem and is not a - # show-stopper. - rules_by_ext = {} - for rule in spec_rules: - rules_by_ext[rule["extension"]] = rule - - # First, some definitions: - # - # A "rule source" is a file that was listed in a target's "sources" - # list and will have a rule applied to it on the basis of matching the - # rule's "extensions" attribute. Rule sources are direct inputs to - # rules. - # - # Rule definitions may specify additional inputs in their "inputs" - # attribute. These additional inputs are used for dependency tracking - # purposes. - # - # A "concrete output" is a rule output with input-dependent variables - # resolved. For example, given a rule with: - # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], - # if the target's "sources" list contained "one.ext" and "two.ext", - # the "concrete output" for rule input "two.ext" would be "two.cc". If - # a rule specifies multiple outputs, each input file that the rule is - # applied to will have the same number of concrete outputs. - # - # If any concrete outputs are outdated or missing relative to their - # corresponding rule_source or to any specified additional input, the - # rule action must be performed to generate the concrete outputs. - - # concrete_outputs_by_rule_source will have an item at the same index - # as the rule['rule_sources'] that it corresponds to. Each item is a - # list of all of the concrete outputs for the rule_source. - concrete_outputs_by_rule_source = [] - - # concrete_outputs_all is a flat list of all concrete outputs that this - # rule is able to produce, given the known set of input files - # (rule_sources) that apply to it. - concrete_outputs_all = [] - - # messages & actions are keyed by the same indices as rule['rule_sources'] - # and concrete_outputs_by_rule_source. They contain the message and - # action to perform after resolving input-dependent variables. The - # message is optional, in which case None is stored for each rule source. - messages = [] - actions = [] - - for rule_source in rule.get("rule_sources", []): - rule_source_dirname, rule_source_basename = posixpath.split(rule_source) - (rule_source_root, rule_source_ext) = posixpath.splitext( - rule_source_basename - ) - - # These are the same variable names that Xcode uses for its own native - # rule support. Because Xcode's rule engine is not being used, they - # need to be expanded as they are written to the makefile. - rule_input_dict = { - "INPUT_FILE_BASE": rule_source_root, - "INPUT_FILE_SUFFIX": rule_source_ext, - "INPUT_FILE_NAME": rule_source_basename, - "INPUT_FILE_PATH": rule_source, - "INPUT_FILE_DIRNAME": rule_source_dirname, - } - - concrete_outputs_for_this_rule_source = [] - for output in rule.get("outputs", []): - # Fortunately, Xcode and make both use $(VAR) format for their - # variables, so the expansion is the only transformation necessary. - # Any remaining $(VAR)-type variables in the string can be given - # directly to make, which will pick up the correct settings from - # what Xcode puts into the environment. - concrete_output = ExpandXcodeVariables(output, rule_input_dict) - concrete_outputs_for_this_rule_source.append(concrete_output) - - # Add all concrete outputs to the project. - pbxp.AddOrGetFileInRootGroup(concrete_output) - - concrete_outputs_by_rule_source.append( - concrete_outputs_for_this_rule_source - ) - concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) - - # TODO(mark): Should verify that at most one of these is specified. - if int(rule.get("process_outputs_as_sources", False)): - for output in concrete_outputs_for_this_rule_source: - AddSourceToTarget(output, type, pbxp, xct) - - # If the file came from the mac_bundle_resources list or if the rule - # is marked to process outputs as bundle resource, do so. - was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources - if was_mac_bundle_resource or int( - rule.get("process_outputs_as_mac_bundle_resources", False) - ): - for output in concrete_outputs_for_this_rule_source: - AddResourceToTarget(output, pbxp, xct) - - # Do we have a message to print when this rule runs? - message = rule.get("message") - if message: - message = gyp.common.EncodePOSIXShellArgument(message) - message = ExpandXcodeVariables(message, rule_input_dict) - messages.append(message) - - # Turn the list into a string that can be passed to a shell. - action_string = gyp.common.EncodePOSIXShellList(rule["action"]) - - action = ExpandXcodeVariables(action_string, rule_input_dict) - actions.append(action) - - if len(concrete_outputs_all) > 0: - # TODO(mark): There's a possibility for collision here. Consider - # target "t" rule "A_r" and target "t_A" rule "r". - makefile_name = "%s.make" % re.sub( - "[^a-zA-Z0-9_]", "_", "{}_{}".format(target_name, rule["rule_name"]) - ) - makefile_path = os.path.join( - xcode_projects[build_file].path, makefile_name - ) - # TODO(mark): try/close? Write to a temporary file and swap it only - # if it's got changes? - makefile = open(makefile_path, "w") - - # make will build the first target in the makefile by default. By - # convention, it's called "all". List all (or at least one) - # concrete output for each rule source as a prerequisite of the "all" - # target. - makefile.write("all: \\\n") - for concrete_output_index, concrete_output_by_rule_source in enumerate( - concrete_outputs_by_rule_source - ): - # Only list the first (index [0]) concrete output of each input - # in the "all" target. Otherwise, a parallel make (-j > 1) would - # attempt to process each input multiple times simultaneously. - # Otherwise, "all" could just contain the entire list of - # concrete_outputs_all. - concrete_output = concrete_output_by_rule_source[0] - if ( - concrete_output_index - == len(concrete_outputs_by_rule_source) - 1 - ): - eol = "" - else: - eol = " \\" - makefile.write(f" {concrete_output}{eol}\n") - - for (rule_source, concrete_outputs, message, action) in zip( - rule["rule_sources"], - concrete_outputs_by_rule_source, - messages, - actions, - ): - makefile.write("\n") - - # Add a rule that declares it can build each concrete output of a - # rule source. Collect the names of the directories that are - # required. - concrete_output_dirs = [] - for concrete_output_index, concrete_output in enumerate( - concrete_outputs - ): - if concrete_output_index == 0: - bol = "" - else: - bol = " " - makefile.write(f"{bol}{concrete_output} \\\n") - - concrete_output_dir = posixpath.dirname(concrete_output) - if ( - concrete_output_dir - and concrete_output_dir not in concrete_output_dirs - ): - concrete_output_dirs.append(concrete_output_dir) - - makefile.write(" : \\\n") - - # The prerequisites for this rule are the rule source itself and - # the set of additional rule inputs, if any. - prerequisites = [rule_source] - prerequisites.extend(rule.get("inputs", [])) - for prerequisite_index, prerequisite in enumerate(prerequisites): - if prerequisite_index == len(prerequisites) - 1: - eol = "" - else: - eol = " \\" - makefile.write(f" {prerequisite}{eol}\n") - - # Make sure that output directories exist before executing the rule - # action. - if len(concrete_output_dirs) > 0: - makefile.write( - '\t@mkdir -p "%s"\n' % '" "'.join(concrete_output_dirs) - ) - - # The rule message and action have already had - # the necessary variable substitutions performed. - if message: - # Mark it with note: so Xcode picks it up in build output. - makefile.write("\t@echo note: %s\n" % message) - makefile.write("\t%s\n" % action) - - makefile.close() - - # It might be nice to ensure that needed output directories exist - # here rather than in each target in the Makefile, but that wouldn't - # work if there ever was a concrete output that had an input-dependent - # variable anywhere other than in the leaf position. - - # Don't declare any inputPaths or outputPaths. If they're present, - # Xcode will provide a slight optimization by only running the script - # phase if any output is missing or outdated relative to any input. - # Unfortunately, it will also assume that all outputs are touched by - # the script, and if the outputs serve as files in a compilation - # phase, they will be unconditionally rebuilt. Since make might not - # rebuild everything that could be declared here as an output, this - # extra compilation activity is unnecessary. With inputPaths and - # outputPaths not supplied, make will always be called, but it knows - # enough to not do anything when everything is up-to-date. - - # To help speed things up, pass -j COUNT to make so it does some work - # in parallel. Don't use ncpus because Xcode will build ncpus targets - # in parallel and if each target happens to have a rules step, there - # would be ncpus^2 things going. With a machine that has 2 quad-core - # Xeons, a build can quickly run out of processes based on - # scheduling/other tasks, and randomly failing builds are no good. - script = ( - """JOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" -if [ "${JOB_COUNT}" -gt 4 ]; then - JOB_COUNT=4 -fi -exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}" -exit 1 -""" - % makefile_name - ) - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - { - "name": 'Rule "' + rule["rule_name"] + '"', - "shellScript": script, - "showEnvVarsInLog": 0, - } - ) - - if support_xct: - support_xct.AppendProperty("buildPhases", ssbp) - else: - # TODO(mark): this assumes too much knowledge of the internals of - # xcodeproj_file; some of these smarts should move - # into xcodeproj_file itself. - xct._properties["buildPhases"].insert(prebuild_index, ssbp) - prebuild_index = prebuild_index + 1 - - # Extra rule inputs also go into the project file. Concrete outputs were - # already added when they were computed. - groups = ["inputs", "inputs_excluded"] - if skip_excluded_files: - groups = [x for x in groups if not x.endswith("_excluded")] - for group in groups: - for item in rule.get(group, []): - pbxp.AddOrGetFileInRootGroup(item) - - # Add "sources". - for source in spec.get("sources", []): - (source_root, source_extension) = posixpath.splitext(source) - if source_extension[1:] not in rules_by_ext: - # AddSourceToTarget will add the file to a root group if it's not - # already there. - AddSourceToTarget(source, type, pbxp, xct) - else: - pbxp.AddOrGetFileInRootGroup(source) - - # Add "mac_bundle_resources" and "mac_framework_private_headers" if - # it's a bundle of any type. - if is_bundle: - for resource in tgt_mac_bundle_resources: - (resource_root, resource_extension) = posixpath.splitext(resource) - if resource_extension[1:] not in rules_by_ext: - AddResourceToTarget(resource, pbxp, xct) - else: - pbxp.AddOrGetFileInRootGroup(resource) - - for header in spec.get("mac_framework_private_headers", []): - AddHeaderToTarget(header, pbxp, xct, False) - - # Add "mac_framework_headers". These can be valid for both frameworks - # and static libraries. - if is_bundle or type == "static_library": - for header in spec.get("mac_framework_headers", []): - AddHeaderToTarget(header, pbxp, xct, True) - - # Add "copies". - pbxcp_dict = {} - for copy_group in spec.get("copies", []): - dest = copy_group["destination"] - if dest[0] not in ("/", "$"): - # Relative paths are relative to $(SRCROOT). - dest = "$(SRCROOT)/" + dest - - code_sign = int(copy_group.get("xcode_code_sign", 0)) - settings = (None, "{ATTRIBUTES = (CodeSignOnCopy, ); }")[code_sign] - - # Coalesce multiple "copies" sections in the same target with the same - # "destination" property into the same PBXCopyFilesBuildPhase, otherwise - # they'll wind up with ID collisions. - pbxcp = pbxcp_dict.get(dest, None) - if pbxcp is None: - pbxcp = gyp.xcodeproj_file.PBXCopyFilesBuildPhase( - {"name": "Copy to " + copy_group["destination"]}, parent=xct - ) - pbxcp.SetDestination(dest) - - # TODO(mark): The usual comment about this knowing too much about - # gyp.xcodeproj_file internals applies. - xct._properties["buildPhases"].insert(prebuild_index, pbxcp) - - pbxcp_dict[dest] = pbxcp - - for file in copy_group["files"]: - pbxcp.AddFile(file, settings) - - # Excluded files can also go into the project file. - if not skip_excluded_files: - for key in [ - "sources", - "mac_bundle_resources", - "mac_framework_headers", - "mac_framework_private_headers", - ]: - excluded_key = key + "_excluded" - for item in spec.get(excluded_key, []): - pbxp.AddOrGetFileInRootGroup(item) - - # So can "inputs" and "outputs" sections of "actions" groups. - groups = ["inputs", "inputs_excluded", "outputs", "outputs_excluded"] - if skip_excluded_files: - groups = [x for x in groups if not x.endswith("_excluded")] - for action in spec.get("actions", []): - for group in groups: - for item in action.get(group, []): - # Exclude anything in BUILT_PRODUCTS_DIR. They're products, not - # sources. - if not item.startswith("$(BUILT_PRODUCTS_DIR)/"): - pbxp.AddOrGetFileInRootGroup(item) - - for postbuild in spec.get("postbuilds", []): - action_string_sh = gyp.common.EncodePOSIXShellList(postbuild["action"]) - script = "exec " + action_string_sh + "\nexit 1\n" - - # Make the postbuild step depend on the output of ld or ar from this - # target. Apparently putting the script step after the link step isn't - # sufficient to ensure proper ordering in all cases. With an input - # declared but no outputs, the script step should run every time, as - # desired. - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( - { - "inputPaths": ["$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)"], - "name": 'Postbuild "' + postbuild["postbuild_name"] + '"', - "shellScript": script, - "showEnvVarsInLog": 0, - } - ) - xct.AppendProperty("buildPhases", ssbp) - - # Add dependencies before libraries, because adding a dependency may imply - # adding a library. It's preferable to keep dependencies listed first - # during a link phase so that they can override symbols that would - # otherwise be provided by libraries, which will usually include system - # libraries. On some systems, ld is finicky and even requires the - # libraries to be ordered in such a way that unresolved symbols in - # earlier-listed libraries may only be resolved by later-listed libraries. - # The Mac linker doesn't work that way, but other platforms do, and so - # their linker invocations need to be constructed in this way. There's - # no compelling reason for Xcode's linker invocations to differ. - - if "dependencies" in spec: - for dependency in spec["dependencies"]: - xct.AddDependency(xcode_targets[dependency]) - # The support project also gets the dependencies (in case they are - # needed for the actions/rules to work). - if support_xct: - support_xct.AddDependency(xcode_targets[dependency]) - - if "libraries" in spec: - for library in spec["libraries"]: - xct.FrameworksPhase().AddFile(library) - # Add the library's directory to LIBRARY_SEARCH_PATHS if necessary. - # I wish Xcode handled this automatically. - library_dir = posixpath.dirname(library) - if library_dir not in xcode_standard_library_dirs and ( - not xct.HasBuildSetting(_library_search_paths_var) - or library_dir not in xct.GetBuildSetting(_library_search_paths_var) - ): - xct.AppendBuildSetting(_library_search_paths_var, library_dir) - - for configuration_name in configuration_names: - configuration = spec["configurations"][configuration_name] - xcbc = xct.ConfigurationNamed(configuration_name) - for include_dir in configuration.get("mac_framework_dirs", []): - xcbc.AppendBuildSetting("FRAMEWORK_SEARCH_PATHS", include_dir) - for include_dir in configuration.get("include_dirs", []): - xcbc.AppendBuildSetting("HEADER_SEARCH_PATHS", include_dir) - for library_dir in configuration.get("library_dirs", []): - if library_dir not in xcode_standard_library_dirs and ( - not xcbc.HasBuildSetting(_library_search_paths_var) - or library_dir - not in xcbc.GetBuildSetting(_library_search_paths_var) - ): - xcbc.AppendBuildSetting(_library_search_paths_var, library_dir) - - if "defines" in configuration: - for define in configuration["defines"]: - set_define = EscapeXcodeDefine(define) - xcbc.AppendBuildSetting("GCC_PREPROCESSOR_DEFINITIONS", set_define) - if "xcode_settings" in configuration: - for xck, xcv in configuration["xcode_settings"].items(): - xcbc.SetBuildSetting(xck, xcv) - if "xcode_config_file" in configuration: - config_ref = pbxp.AddOrGetFileInRootGroup( - configuration["xcode_config_file"] - ) - xcbc.SetBaseConfiguration(config_ref) - - build_files = [] - for build_file, build_file_dict in data.items(): - if build_file.endswith(".gyp"): - build_files.append(build_file) - - for build_file in build_files: - xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) - - for build_file in build_files: - xcode_projects[build_file].Finalize2(xcode_targets, xcode_target_to_target_dict) - - for build_file in build_files: - xcode_projects[build_file].Write() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py deleted file mode 100644 index 49772d1f4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Unit tests for the xcode.py file. """ - -import gyp.generator.xcode as xcode -import unittest -import sys - - -class TestEscapeXcodeDefine(unittest.TestCase): - if sys.platform == "darwin": - - def test_InheritedRemainsUnescaped(self): - self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)") - - def test_Escaping(self): - self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/input.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/input.py deleted file mode 100644 index d9699a0a5..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/input.py +++ /dev/null @@ -1,3130 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -import ast - -import gyp.common -import gyp.simple_copy -import multiprocessing -import os.path -import re -import shlex -import signal -import subprocess -import sys -import threading -import traceback -from distutils.version import StrictVersion -from gyp.common import GypError -from gyp.common import OrderedSet - -# A list of types that are treated as linkable. -linkable_types = [ - "executable", - "shared_library", - "loadable_module", - "mac_kernel_extension", - "windows_driver", -] - -# A list of sections that contain links to other targets. -dependency_sections = ["dependencies", "export_dependent_settings"] - -# base_path_sections is a list of sections defined by GYP that contain -# pathnames. The generators can provide more keys, the two lists are merged -# into path_sections, but you should call IsPathSection instead of using either -# list directly. -base_path_sections = [ - "destination", - "files", - "include_dirs", - "inputs", - "libraries", - "outputs", - "sources", -] -path_sections = set() - -# These per-process dictionaries are used to cache build file data when loading -# in parallel mode. -per_process_data = {} -per_process_aux_data = {} - - -def IsPathSection(section): - # If section ends in one of the '=+?!' characters, it's applied to a section - # without the trailing characters. '/' is notably absent from this list, - # because there's no way for a regular expression to be treated as a path. - while section and section[-1:] in "=+?!": - section = section[:-1] - - if section in path_sections: - return True - - # Sections matching the regexp '_(dir|file|path)s?$' are also - # considered PathSections. Using manual string matching since that - # is much faster than the regexp and this can be called hundreds of - # thousands of times so micro performance matters. - if "_" in section: - tail = section[-6:] - if tail[-1] == "s": - tail = tail[:-1] - if tail[-5:] in ("_file", "_path"): - return True - return tail[-4:] == "_dir" - - return False - - -# base_non_configuration_keys is a list of key names that belong in the target -# itself and should not be propagated into its configurations. It is merged -# with a list that can come from the generator to -# create non_configuration_keys. -base_non_configuration_keys = [ - # Sections that must exist inside targets and not configurations. - "actions", - "configurations", - "copies", - "default_configuration", - "dependencies", - "dependencies_original", - "libraries", - "postbuilds", - "product_dir", - "product_extension", - "product_name", - "product_prefix", - "rules", - "run_as", - "sources", - "standalone_static_library", - "suppress_wildcard", - "target_name", - "toolset", - "toolsets", - "type", - # Sections that can be found inside targets or configurations, but that - # should not be propagated from targets into their configurations. - "variables", -] -non_configuration_keys = [] - -# Keys that do not belong inside a configuration dictionary. -invalid_configuration_keys = [ - "actions", - "all_dependent_settings", - "configurations", - "dependencies", - "direct_dependent_settings", - "libraries", - "link_settings", - "sources", - "standalone_static_library", - "target_name", - "type", -] - -# Controls whether or not the generator supports multiple toolsets. -multiple_toolsets = False - -# Paths for converting filelist paths to output paths: { -# toplevel, -# qualified_output_dir, -# } -generator_filelist_paths = None - - -def GetIncludedBuildFiles(build_file_path, aux_data, included=None): - """Return a list of all build files included into build_file_path. - - The returned list will contain build_file_path as well as all other files - that it included, either directly or indirectly. Note that the list may - contain files that were included into a conditional section that evaluated - to false and was not merged into build_file_path's dict. - - aux_data is a dict containing a key for each build file or included build - file. Those keys provide access to dicts whose "included" keys contain - lists of all other files included by the build file. - - included should be left at its default None value by external callers. It - is used for recursion. - - The returned list will not contain any duplicate entries. Each build file - in the list will be relative to the current directory. - """ - - if included is None: - included = [] - - if build_file_path in included: - return included - - included.append(build_file_path) - - for included_build_file in aux_data[build_file_path].get("included", []): - GetIncludedBuildFiles(included_build_file, aux_data, included) - - return included - - -def CheckedEval(file_contents): - """Return the eval of a gyp file. - The gyp file is restricted to dictionaries and lists only, and - repeated keys are not allowed. - Note that this is slower than eval() is. - """ - - syntax_tree = ast.parse(file_contents) - assert isinstance(syntax_tree, ast.Module) - c1 = syntax_tree.body - assert len(c1) == 1 - c2 = c1[0] - assert isinstance(c2, ast.Expr) - return CheckNode(c2.value, []) - - -def CheckNode(node, keypath): - if isinstance(node, ast.Dict): - dict = {} - for key, value in zip(node.keys, node.values): - assert isinstance(key, ast.Str) - key = key.s - if key in dict: - raise GypError( - "Key '" - + key - + "' repeated at level " - + repr(len(keypath) + 1) - + " with key path '" - + ".".join(keypath) - + "'" - ) - kp = list(keypath) # Make a copy of the list for descending this node. - kp.append(key) - dict[key] = CheckNode(value, kp) - return dict - elif isinstance(node, ast.List): - children = [] - for index, child in enumerate(node.elts): - kp = list(keypath) # Copy list. - kp.append(repr(index)) - children.append(CheckNode(child, kp)) - return children - elif isinstance(node, ast.Str): - return node.s - else: - raise TypeError( - "Unknown AST node at key path '" + ".".join(keypath) + "': " + repr(node) - ) - - -def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check): - if build_file_path in data: - return data[build_file_path] - - if os.path.exists(build_file_path): - build_file_contents = open(build_file_path, encoding='utf-8').read() - else: - raise GypError(f"{build_file_path} not found (cwd: {os.getcwd()})") - - build_file_data = None - try: - if check: - build_file_data = CheckedEval(build_file_contents) - else: - build_file_data = eval(build_file_contents, {"__builtins__": {}}, None) - except SyntaxError as e: - e.filename = build_file_path - raise - except Exception as e: - gyp.common.ExceptionAppend(e, "while reading " + build_file_path) - raise - - if type(build_file_data) is not dict: - raise GypError("%s does not evaluate to a dictionary." % build_file_path) - - data[build_file_path] = build_file_data - aux_data[build_file_path] = {} - - # Scan for includes and merge them in. - if "skip_includes" not in build_file_data or not build_file_data["skip_includes"]: - try: - if is_target: - LoadBuildFileIncludesIntoDict( - build_file_data, build_file_path, data, aux_data, includes, check - ) - else: - LoadBuildFileIncludesIntoDict( - build_file_data, build_file_path, data, aux_data, None, check - ) - except Exception as e: - gyp.common.ExceptionAppend( - e, "while reading includes of " + build_file_path - ) - raise - - return build_file_data - - -def LoadBuildFileIncludesIntoDict( - subdict, subdict_path, data, aux_data, includes, check -): - includes_list = [] - if includes is not None: - includes_list.extend(includes) - if "includes" in subdict: - for include in subdict["includes"]: - # "include" is specified relative to subdict_path, so compute the real - # path to include by appending the provided "include" to the directory - # in which subdict_path resides. - relative_include = os.path.normpath( - os.path.join(os.path.dirname(subdict_path), include) - ) - includes_list.append(relative_include) - # Unhook the includes list, it's no longer needed. - del subdict["includes"] - - # Merge in the included files. - for include in includes_list: - if "included" not in aux_data[subdict_path]: - aux_data[subdict_path]["included"] = [] - aux_data[subdict_path]["included"].append(include) - - gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) - - MergeDicts( - subdict, - LoadOneBuildFile(include, data, aux_data, None, False, check), - subdict_path, - include, - ) - - # Recurse into subdictionaries. - for k, v in subdict.items(): - if type(v) is dict: - LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, None, check) - elif type(v) is list: - LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, check) - - -# This recurses into lists so that it can look for dicts. -def LoadBuildFileIncludesIntoList(sublist, sublist_path, data, aux_data, check): - for item in sublist: - if type(item) is dict: - LoadBuildFileIncludesIntoDict( - item, sublist_path, data, aux_data, None, check - ) - elif type(item) is list: - LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check) - - -# Processes toolsets in all the targets. This recurses into condition entries -# since they can contain toolsets as well. -def ProcessToolsetsInDict(data): - if "targets" in data: - target_list = data["targets"] - new_target_list = [] - for target in target_list: - # If this target already has an explicit 'toolset', and no 'toolsets' - # list, don't modify it further. - if "toolset" in target and "toolsets" not in target: - new_target_list.append(target) - continue - if multiple_toolsets: - toolsets = target.get("toolsets", ["target"]) - else: - toolsets = ["target"] - # Make sure this 'toolsets' definition is only processed once. - if "toolsets" in target: - del target["toolsets"] - if len(toolsets) > 0: - # Optimization: only do copies if more than one toolset is specified. - for build in toolsets[1:]: - new_target = gyp.simple_copy.deepcopy(target) - new_target["toolset"] = build - new_target_list.append(new_target) - target["toolset"] = toolsets[0] - new_target_list.append(target) - data["targets"] = new_target_list - if "conditions" in data: - for condition in data["conditions"]: - if type(condition) is list: - for condition_dict in condition[1:]: - if type(condition_dict) is dict: - ProcessToolsetsInDict(condition_dict) - - -# TODO(mark): I don't love this name. It just means that it's going to load -# a build file that contains targets and is expected to provide a targets dict -# that contains the targets... -def LoadTargetBuildFile( - build_file_path, - data, - aux_data, - variables, - includes, - depth, - check, - load_dependencies, -): - # If depth is set, predefine the DEPTH variable to be a relative path from - # this build file's directory to the directory identified by depth. - if depth: - # TODO(dglazkov) The backslash/forward-slash replacement at the end is a - # temporary measure. This should really be addressed by keeping all paths - # in POSIX until actual project generation. - d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) - if d == "": - variables["DEPTH"] = "." - else: - variables["DEPTH"] = d.replace("\\", "/") - - # The 'target_build_files' key is only set when loading target build files in - # the non-parallel code path, where LoadTargetBuildFile is called - # recursively. In the parallel code path, we don't need to check whether the - # |build_file_path| has already been loaded, because the 'scheduled' set in - # ParallelState guarantees that we never load the same |build_file_path| - # twice. - if "target_build_files" in data: - if build_file_path in data["target_build_files"]: - # Already loaded. - return False - data["target_build_files"].add(build_file_path) - - gyp.DebugOutput( - gyp.DEBUG_INCLUDES, "Loading Target Build File '%s'", build_file_path - ) - - build_file_data = LoadOneBuildFile( - build_file_path, data, aux_data, includes, True, check - ) - - # Store DEPTH for later use in generators. - build_file_data["_DEPTH"] = depth - - # Set up the included_files key indicating which .gyp files contributed to - # this target dict. - if "included_files" in build_file_data: - raise GypError(build_file_path + " must not contain included_files key") - - included = GetIncludedBuildFiles(build_file_path, aux_data) - build_file_data["included_files"] = [] - for included_file in included: - # included_file is relative to the current directory, but it needs to - # be made relative to build_file_path's directory. - included_relative = gyp.common.RelativePath( - included_file, os.path.dirname(build_file_path) - ) - build_file_data["included_files"].append(included_relative) - - # Do a first round of toolsets expansion so that conditions can be defined - # per toolset. - ProcessToolsetsInDict(build_file_data) - - # Apply "pre"/"early" variable expansions and condition evaluations. - ProcessVariablesAndConditionsInDict( - build_file_data, PHASE_EARLY, variables, build_file_path - ) - - # Since some toolsets might have been defined conditionally, perform - # a second round of toolsets expansion now. - ProcessToolsetsInDict(build_file_data) - - # Look at each project's target_defaults dict, and merge settings into - # targets. - if "target_defaults" in build_file_data: - if "targets" not in build_file_data: - raise GypError("Unable to find targets in build file %s" % build_file_path) - - index = 0 - while index < len(build_file_data["targets"]): - # This procedure needs to give the impression that target_defaults is - # used as defaults, and the individual targets inherit from that. - # The individual targets need to be merged into the defaults. Make - # a deep copy of the defaults for each target, merge the target dict - # as found in the input file into that copy, and then hook up the - # copy with the target-specific data merged into it as the replacement - # target dict. - old_target_dict = build_file_data["targets"][index] - new_target_dict = gyp.simple_copy.deepcopy( - build_file_data["target_defaults"] - ) - MergeDicts( - new_target_dict, old_target_dict, build_file_path, build_file_path - ) - build_file_data["targets"][index] = new_target_dict - index += 1 - - # No longer needed. - del build_file_data["target_defaults"] - - # Look for dependencies. This means that dependency resolution occurs - # after "pre" conditionals and variable expansion, but before "post" - - # in other words, you can't put a "dependencies" section inside a "post" - # conditional within a target. - - dependencies = [] - if "targets" in build_file_data: - for target_dict in build_file_data["targets"]: - if "dependencies" not in target_dict: - continue - for dependency in target_dict["dependencies"]: - dependencies.append( - gyp.common.ResolveTarget(build_file_path, dependency, None)[0] - ) - - if load_dependencies: - for dependency in dependencies: - try: - LoadTargetBuildFile( - dependency, - data, - aux_data, - variables, - includes, - depth, - check, - load_dependencies, - ) - except Exception as e: - gyp.common.ExceptionAppend( - e, "while loading dependencies of %s" % build_file_path - ) - raise - else: - return (build_file_path, dependencies) - - -def CallLoadTargetBuildFile( - global_flags, - build_file_path, - variables, - includes, - depth, - check, - generator_input_info, -): - """Wrapper around LoadTargetBuildFile for parallel processing. - - This wrapper is used when LoadTargetBuildFile is executed in - a worker process. - """ - - try: - signal.signal(signal.SIGINT, signal.SIG_IGN) - - # Apply globals so that the worker process behaves the same. - for key, value in global_flags.items(): - globals()[key] = value - - SetGeneratorGlobals(generator_input_info) - result = LoadTargetBuildFile( - build_file_path, - per_process_data, - per_process_aux_data, - variables, - includes, - depth, - check, - False, - ) - if not result: - return result - - (build_file_path, dependencies) = result - - # We can safely pop the build_file_data from per_process_data because it - # will never be referenced by this process again, so we don't need to keep - # it in the cache. - build_file_data = per_process_data.pop(build_file_path) - - # This gets serialized and sent back to the main process via a pipe. - # It's handled in LoadTargetBuildFileCallback. - return (build_file_path, build_file_data, dependencies) - except GypError as e: - sys.stderr.write("gyp: %s\n" % e) - return None - except Exception as e: - print("Exception:", e, file=sys.stderr) - print(traceback.format_exc(), file=sys.stderr) - return None - - -class ParallelProcessingError(Exception): - pass - - -class ParallelState: - """Class to keep track of state when processing input files in parallel. - - If build files are loaded in parallel, use this to keep track of - state during farming out and processing parallel jobs. It's stored - in a global so that the callback function can have access to it. - """ - - def __init__(self): - # The multiprocessing pool. - self.pool = None - # The condition variable used to protect this object and notify - # the main loop when there might be more data to process. - self.condition = None - # The "data" dict that was passed to LoadTargetBuildFileParallel - self.data = None - # The number of parallel calls outstanding; decremented when a response - # was received. - self.pending = 0 - # The set of all build files that have been scheduled, so we don't - # schedule the same one twice. - self.scheduled = set() - # A list of dependency build file paths that haven't been scheduled yet. - self.dependencies = [] - # Flag to indicate if there was an error in a child process. - self.error = False - - def LoadTargetBuildFileCallback(self, result): - """Handle the results of running LoadTargetBuildFile in another process. - """ - self.condition.acquire() - if not result: - self.error = True - self.condition.notify() - self.condition.release() - return - (build_file_path0, build_file_data0, dependencies0) = result - self.data[build_file_path0] = build_file_data0 - self.data["target_build_files"].add(build_file_path0) - for new_dependency in dependencies0: - if new_dependency not in self.scheduled: - self.scheduled.add(new_dependency) - self.dependencies.append(new_dependency) - self.pending -= 1 - self.condition.notify() - self.condition.release() - - -def LoadTargetBuildFilesParallel( - build_files, data, variables, includes, depth, check, generator_input_info -): - parallel_state = ParallelState() - parallel_state.condition = threading.Condition() - # Make copies of the build_files argument that we can modify while working. - parallel_state.dependencies = list(build_files) - parallel_state.scheduled = set(build_files) - parallel_state.pending = 0 - parallel_state.data = data - - try: - parallel_state.condition.acquire() - while parallel_state.dependencies or parallel_state.pending: - if parallel_state.error: - break - if not parallel_state.dependencies: - parallel_state.condition.wait() - continue - - dependency = parallel_state.dependencies.pop() - - parallel_state.pending += 1 - global_flags = { - "path_sections": globals()["path_sections"], - "non_configuration_keys": globals()["non_configuration_keys"], - "multiple_toolsets": globals()["multiple_toolsets"], - } - - if not parallel_state.pool: - parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) - parallel_state.pool.apply_async( - CallLoadTargetBuildFile, - args=( - global_flags, - dependency, - variables, - includes, - depth, - check, - generator_input_info, - ), - callback=parallel_state.LoadTargetBuildFileCallback, - ) - except KeyboardInterrupt as e: - parallel_state.pool.terminate() - raise e - - parallel_state.condition.release() - - parallel_state.pool.close() - parallel_state.pool.join() - parallel_state.pool = None - - if parallel_state.error: - sys.exit(1) - - -# Look for the bracket that matches the first bracket seen in a -# string, and return the start and end as a tuple. For example, if -# the input is something like "<(foo <(bar)) blah", then it would -# return (1, 13), indicating the entire string except for the leading -# "<" and trailing " blah". -LBRACKETS = set("{[(") -BRACKETS = {"}": "{", "]": "[", ")": "("} - - -def FindEnclosingBracketGroup(input_str): - stack = [] - start = -1 - for index, char in enumerate(input_str): - if char in LBRACKETS: - stack.append(char) - if start == -1: - start = index - elif char in BRACKETS: - if not stack: - return (-1, -1) - if stack.pop() != BRACKETS[char]: - return (-1, -1) - if not stack: - return (start, index + 1) - return (-1, -1) - - -def IsStrCanonicalInt(string): - """Returns True if |string| is in its canonical integer form. - - The canonical form is such that str(int(string)) == string. - """ - if type(string) is str: - # This function is called a lot so for maximum performance, avoid - # involving regexps which would otherwise make the code much - # shorter. Regexps would need twice the time of this function. - if string: - if string == "0": - return True - if string[0] == "-": - string = string[1:] - if not string: - return False - if "1" <= string[0] <= "9": - return string.isdigit() - - return False - - -# This matches things like "<(asdf)", "(?P<(?:(?:!?@?)|\|)?)" - r"(?P[-a-zA-Z0-9_.]+)?" - r"\((?P\s*\[?)" - r"(?P.*?)(\]?)\))" -) - -# This matches the same as early_variable_re, but with '>' instead of '<'. -late_variable_re = re.compile( - r"(?P(?P>(?:(?:!?@?)|\|)?)" - r"(?P[-a-zA-Z0-9_.]+)?" - r"\((?P\s*\[?)" - r"(?P.*?)(\]?)\))" -) - -# This matches the same as early_variable_re, but with '^' instead of '<'. -latelate_variable_re = re.compile( - r"(?P(?P[\^](?:(?:!?@?)|\|)?)" - r"(?P[-a-zA-Z0-9_.]+)?" - r"\((?P\s*\[?)" - r"(?P.*?)(\]?)\))" -) - -# Global cache of results from running commands so they don't have to be run -# more then once. -cached_command_results = {} - - -def FixupPlatformCommand(cmd): - if sys.platform == "win32": - if type(cmd) is list: - cmd = [re.sub("^cat ", "type ", cmd[0])] + cmd[1:] - else: - cmd = re.sub("^cat ", "type ", cmd) - return cmd - - -PHASE_EARLY = 0 -PHASE_LATE = 1 -PHASE_LATELATE = 2 - - -def ExpandVariables(input, phase, variables, build_file): - # Look for the pattern that gets expanded into variables - if phase == PHASE_EARLY: - variable_re = early_variable_re - expansion_symbol = "<" - elif phase == PHASE_LATE: - variable_re = late_variable_re - expansion_symbol = ">" - elif phase == PHASE_LATELATE: - variable_re = latelate_variable_re - expansion_symbol = "^" - else: - assert False - - input_str = str(input) - if IsStrCanonicalInt(input_str): - return int(input_str) - - # Do a quick scan to determine if an expensive regex search is warranted. - if expansion_symbol not in input_str: - return input_str - - # Get the entire list of matches as a list of MatchObject instances. - # (using findall here would return strings instead of MatchObjects). - matches = list(variable_re.finditer(input_str)) - if not matches: - return input_str - - output = input_str - # Reverse the list of matches so that replacements are done right-to-left. - # That ensures that earlier replacements won't mess up the string in a - # way that causes later calls to find the earlier substituted text instead - # of what's intended for replacement. - matches.reverse() - for match_group in matches: - match = match_group.groupdict() - gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %r", match) - # match['replace'] is the substring to look for, match['type'] - # is the character code for the replacement type (< > ! <| >| <@ - # >@ !@), match['is_array'] contains a '[' for command - # arrays, and match['content'] is the name of the variable (< >) - # or command to run (!). match['command_string'] is an optional - # command string. Currently, only 'pymod_do_main' is supported. - - # run_command is true if a ! variant is used. - run_command = "!" in match["type"] - command_string = match["command_string"] - - # file_list is true if a | variant is used. - file_list = "|" in match["type"] - - # Capture these now so we can adjust them later. - replace_start = match_group.start("replace") - replace_end = match_group.end("replace") - - # Find the ending paren, and re-evaluate the contained string. - (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) - - # Adjust the replacement range to match the entire command - # found by FindEnclosingBracketGroup (since the variable_re - # probably doesn't match the entire command if it contained - # nested variables). - replace_end = replace_start + c_end - - # Find the "real" replacement, matching the appropriate closing - # paren, and adjust the replacement start and end. - replacement = input_str[replace_start:replace_end] - - # Figure out what the contents of the variable parens are. - contents_start = replace_start + c_start + 1 - contents_end = replace_end - 1 - contents = input_str[contents_start:contents_end] - - # Do filter substitution now for <|(). - # Admittedly, this is different than the evaluation order in other - # contexts. However, since filtration has no chance to run on <|(), - # this seems like the only obvious way to give them access to filters. - if file_list: - processed_variables = gyp.simple_copy.deepcopy(variables) - ProcessListFiltersInDict(contents, processed_variables) - # Recurse to expand variables in the contents - contents = ExpandVariables(contents, phase, processed_variables, build_file) - else: - # Recurse to expand variables in the contents - contents = ExpandVariables(contents, phase, variables, build_file) - - # Strip off leading/trailing whitespace so that variable matches are - # simpler below (and because they are rarely needed). - contents = contents.strip() - - # expand_to_list is true if an @ variant is used. In that case, - # the expansion should result in a list. Note that the caller - # is to be expecting a list in return, and not all callers do - # because not all are working in list context. Also, for list - # expansions, there can be no other text besides the variable - # expansion in the input string. - expand_to_list = "@" in match["type"] and input_str == replacement - - if run_command or file_list: - # Find the build file's directory, so commands can be run or file lists - # generated relative to it. - build_file_dir = os.path.dirname(build_file) - if build_file_dir == "" and not file_list: - # If build_file is just a leaf filename indicating a file in the - # current directory, build_file_dir might be an empty string. Set - # it to None to signal to subprocess.Popen that it should run the - # command in the current directory. - build_file_dir = None - - # Support <|(listfile.txt ...) which generates a file - # containing items from a gyp list, generated at gyp time. - # This works around actions/rules which have more inputs than will - # fit on the command line. - if file_list: - if type(contents) is list: - contents_list = contents - else: - contents_list = contents.split(" ") - replacement = contents_list[0] - if os.path.isabs(replacement): - raise GypError('| cannot handle absolute paths, got "%s"' % replacement) - - if not generator_filelist_paths: - path = os.path.join(build_file_dir, replacement) - else: - if os.path.isabs(build_file_dir): - toplevel = generator_filelist_paths["toplevel"] - rel_build_file_dir = gyp.common.RelativePath( - build_file_dir, toplevel - ) - else: - rel_build_file_dir = build_file_dir - qualified_out_dir = generator_filelist_paths["qualified_out_dir"] - path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) - gyp.common.EnsureDirExists(path) - - replacement = gyp.common.RelativePath(path, build_file_dir) - f = gyp.common.WriteOnDiff(path) - for i in contents_list[1:]: - f.write("%s\n" % i) - f.close() - - elif run_command: - use_shell = True - if match["is_array"]: - contents = eval(contents) - use_shell = False - - # Check for a cached value to avoid executing commands, or generating - # file lists more than once. The cache key contains the command to be - # run as well as the directory to run it from, to account for commands - # that depend on their current directory. - # TODO(http://code.google.com/p/gyp/issues/detail?id=111): In theory, - # someone could author a set of GYP files where each time the command - # is invoked it produces different output by design. When the need - # arises, the syntax should be extended to support no caching off a - # command's output so it is run every time. - cache_key = (str(contents), build_file_dir) - cached_value = cached_command_results.get(cache_key, None) - if cached_value is None: - gyp.DebugOutput( - gyp.DEBUG_VARIABLES, - "Executing command '%s' in directory '%s'", - contents, - build_file_dir, - ) - - replacement = "" - - if command_string == "pymod_do_main": - # 0: - raise GypError( - "Call to '%s' returned exit status %d while in %s." - % (contents, result.returncode, build_file) - ) - replacement = result.stdout.decode("utf-8").rstrip() - - cached_command_results[cache_key] = replacement - else: - gyp.DebugOutput( - gyp.DEBUG_VARIABLES, - "Had cache value for command '%s' in directory '%s'", - contents, - build_file_dir, - ) - replacement = cached_value - - else: - if contents not in variables: - if contents[-1] in ["!", "/"]: - # In order to allow cross-compiles (nacl) to happen more naturally, - # we will allow references to >(sources/) etc. to resolve to - # and empty list if undefined. This allows actions to: - # 'action!': [ - # '>@(_sources!)', - # ], - # 'action/': [ - # '>@(_sources/)', - # ], - replacement = [] - else: - raise GypError( - "Undefined variable " + contents + " in " + build_file - ) - else: - replacement = variables[contents] - - if isinstance(replacement, bytes) and not isinstance(replacement, str): - replacement = replacement.decode("utf-8") # done on Python 3 only - if type(replacement) is list: - for item in replacement: - if isinstance(item, bytes) and not isinstance(item, str): - item = item.decode("utf-8") # done on Python 3 only - if not contents[-1] == "/" and type(item) not in (str, int): - raise GypError( - "Variable " - + contents - + " must expand to a string or list of strings; " - + "list contains a " - + item.__class__.__name__ - ) - # Run through the list and handle variable expansions in it. Since - # the list is guaranteed not to contain dicts, this won't do anything - # with conditions sections. - ProcessVariablesAndConditionsInList( - replacement, phase, variables, build_file - ) - elif type(replacement) not in (str, int): - raise GypError( - "Variable " - + contents - + " must expand to a string or list of strings; " - + "found a " - + replacement.__class__.__name__ - ) - - if expand_to_list: - # Expanding in list context. It's guaranteed that there's only one - # replacement to do in |input_str| and that it's this replacement. See - # above. - if type(replacement) is list: - # If it's already a list, make a copy. - output = replacement[:] - else: - # Split it the same way sh would split arguments. - output = shlex.split(str(replacement)) - else: - # Expanding in string context. - encoded_replacement = "" - if type(replacement) is list: - # When expanding a list into string context, turn the list items - # into a string in a way that will work with a subprocess call. - # - # TODO(mark): This isn't completely correct. This should - # call a generator-provided function that observes the - # proper list-to-argument quoting rules on a specific - # platform instead of just calling the POSIX encoding - # routine. - encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) - else: - encoded_replacement = replacement - - output = ( - output[:replace_start] + str(encoded_replacement) + output[replace_end:] - ) - # Prepare for the next match iteration. - input_str = output - - if output == input: - gyp.DebugOutput( - gyp.DEBUG_VARIABLES, - "Found only identity matches on %r, avoiding infinite " "recursion.", - output, - ) - else: - # Look for more matches now that we've replaced some, to deal with - # expanding local variables (variables defined in the same - # variables block as this one). - gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %r, recursing.", output) - if type(output) is list: - if output and type(output[0]) is list: - # Leave output alone if it's a list of lists. - # We don't want such lists to be stringified. - pass - else: - new_output = [] - for item in output: - new_output.append( - ExpandVariables(item, phase, variables, build_file) - ) - output = new_output - else: - output = ExpandVariables(output, phase, variables, build_file) - - # Convert all strings that are canonically-represented integers into integers. - if type(output) is list: - for index, outstr in enumerate(output): - if IsStrCanonicalInt(outstr): - output[index] = int(outstr) - elif IsStrCanonicalInt(output): - output = int(output) - - return output - - -# The same condition is often evaluated over and over again so it -# makes sense to cache as much as possible between evaluations. -cached_conditions_asts = {} - - -def EvalCondition(condition, conditions_key, phase, variables, build_file): - """Returns the dict that should be used or None if the result was - that nothing should be used.""" - if type(condition) is not list: - raise GypError(conditions_key + " must be a list") - if len(condition) < 2: - # It's possible that condition[0] won't work in which case this - # attempt will raise its own IndexError. That's probably fine. - raise GypError( - conditions_key - + " " - + condition[0] - + " must be at least length 2, not " - + str(len(condition)) - ) - - i = 0 - result = None - while i < len(condition): - cond_expr = condition[i] - true_dict = condition[i + 1] - if type(true_dict) is not dict: - raise GypError( - "{} {} must be followed by a dictionary, not {}".format( - conditions_key, cond_expr, type(true_dict) - ) - ) - if len(condition) > i + 2 and type(condition[i + 2]) is dict: - false_dict = condition[i + 2] - i = i + 3 - if i != len(condition): - raise GypError( - "{} {} has {} unexpected trailing items".format( - conditions_key, cond_expr, len(condition) - i - ) - ) - else: - false_dict = None - i = i + 2 - if result is None: - result = EvalSingleCondition( - cond_expr, true_dict, false_dict, phase, variables, build_file - ) - - return result - - -def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, build_file): - """Returns true_dict if cond_expr evaluates to true, and false_dict - otherwise.""" - # Do expansions on the condition itself. Since the condition can naturally - # contain variable references without needing to resort to GYP expansion - # syntax, this is of dubious value for variables, but someone might want to - # use a command expansion directly inside a condition. - cond_expr_expanded = ExpandVariables(cond_expr, phase, variables, build_file) - if type(cond_expr_expanded) not in (str, int): - raise ValueError( - "Variable expansion in this context permits str and int " - + "only, found " - + cond_expr_expanded.__class__.__name__ - ) - - try: - if cond_expr_expanded in cached_conditions_asts: - ast_code = cached_conditions_asts[cond_expr_expanded] - else: - ast_code = compile(cond_expr_expanded, "", "eval") - cached_conditions_asts[cond_expr_expanded] = ast_code - env = {"__builtins__": {}, "v": StrictVersion} - if eval(ast_code, env, variables): - return true_dict - return false_dict - except SyntaxError as e: - syntax_error = SyntaxError( - "%s while evaluating condition '%s' in %s " - "at character %d." % (str(e.args[0]), e.text, build_file, e.offset), - e.filename, - e.lineno, - e.offset, - e.text, - ) - raise syntax_error - except NameError as e: - gyp.common.ExceptionAppend( - e, - f"while evaluating condition '{cond_expr_expanded}' in {build_file}", - ) - raise GypError(e) - - -def ProcessConditionsInDict(the_dict, phase, variables, build_file): - # Process a 'conditions' or 'target_conditions' section in the_dict, - # depending on phase. - # early -> conditions - # late -> target_conditions - # latelate -> no conditions - # - # Each item in a conditions list consists of cond_expr, a string expression - # evaluated as the condition, and true_dict, a dict that will be merged into - # the_dict if cond_expr evaluates to true. Optionally, a third item, - # false_dict, may be present. false_dict is merged into the_dict if - # cond_expr evaluates to false. - # - # Any dict merged into the_dict will be recursively processed for nested - # conditionals and other expansions, also according to phase, immediately - # prior to being merged. - - if phase == PHASE_EARLY: - conditions_key = "conditions" - elif phase == PHASE_LATE: - conditions_key = "target_conditions" - elif phase == PHASE_LATELATE: - return - else: - assert False - - if conditions_key not in the_dict: - return - - conditions_list = the_dict[conditions_key] - # Unhook the conditions list, it's no longer needed. - del the_dict[conditions_key] - - for condition in conditions_list: - merge_dict = EvalCondition( - condition, conditions_key, phase, variables, build_file - ) - - if merge_dict is not None: - # Expand variables and nested conditinals in the merge_dict before - # merging it. - ProcessVariablesAndConditionsInDict( - merge_dict, phase, variables, build_file - ) - - MergeDicts(the_dict, merge_dict, build_file, build_file) - - -def LoadAutomaticVariablesFromDict(variables, the_dict): - # Any keys with plain string values in the_dict become automatic variables. - # The variable name is the key name with a "_" character prepended. - for key, value in the_dict.items(): - if type(value) in (str, int, list): - variables["_" + key] = value - - -def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key): - # Any keys in the_dict's "variables" dict, if it has one, becomes a - # variable. The variable name is the key name in the "variables" dict. - # Variables that end with the % character are set only if they are unset in - # the variables dict. the_dict_key is the name of the key that accesses - # the_dict in the_dict's parent dict. If the_dict's parent is not a dict - # (it could be a list or it could be parentless because it is a root dict), - # the_dict_key will be None. - for key, value in the_dict.get("variables", {}).items(): - if type(value) not in (str, int, list): - continue - - if key.endswith("%"): - variable_name = key[:-1] - if variable_name in variables: - # If the variable is already set, don't set it. - continue - if the_dict_key == "variables" and variable_name in the_dict: - # If the variable is set without a % in the_dict, and the_dict is a - # variables dict (making |variables| a variables sub-dict of a - # variables dict), use the_dict's definition. - value = the_dict[variable_name] - else: - variable_name = key - - variables[variable_name] = value - - -def ProcessVariablesAndConditionsInDict( - the_dict, phase, variables_in, build_file, the_dict_key=None -): - """Handle all variable and command expansion and conditional evaluation. - - This function is the public entry point for all variable expansions and - conditional evaluations. The variables_in dictionary will not be modified - by this function. - """ - - # Make a copy of the variables_in dict that can be modified during the - # loading of automatics and the loading of the variables dict. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - - if "variables" in the_dict: - # Make sure all the local variables are added to the variables - # list before we process them so that you can reference one - # variable from another. They will be fully expanded by recursion - # in ExpandVariables. - for key, value in the_dict["variables"].items(): - variables[key] = value - - # Handle the associated variables dict first, so that any variable - # references within can be resolved prior to using them as variables. - # Pass a copy of the variables dict to avoid having it be tainted. - # Otherwise, it would have extra automatics added for everything that - # should just be an ordinary variable in this scope. - ProcessVariablesAndConditionsInDict( - the_dict["variables"], phase, variables, build_file, "variables" - ) - - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - for key, value in the_dict.items(): - # Skip "variables", which was already processed if present. - if key != "variables" and type(value) is str: - expanded = ExpandVariables(value, phase, variables, build_file) - if type(expanded) not in (str, int): - raise ValueError( - "Variable expansion in this context permits str and int " - + "only, found " - + expanded.__class__.__name__ - + " for " - + key - ) - the_dict[key] = expanded - - # Variable expansion may have resulted in changes to automatics. Reload. - # TODO(mark): Optimization: only reload if no changes were made. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - # Process conditions in this dict. This is done after variable expansion - # so that conditions may take advantage of expanded variables. For example, - # if the_dict contains: - # {'type': '<(library_type)', - # 'conditions': [['_type=="static_library"', { ... }]]}, - # _type, as used in the condition, will only be set to the value of - # library_type if variable expansion is performed before condition - # processing. However, condition processing should occur prior to recursion - # so that variables (both automatic and "variables" dict type) may be - # adjusted by conditions sections, merged into the_dict, and have the - # intended impact on contained dicts. - # - # This arrangement means that a "conditions" section containing a "variables" - # section will only have those variables effective in subdicts, not in - # the_dict. The workaround is to put a "conditions" section within a - # "variables" section. For example: - # {'conditions': [['os=="mac"', {'variables': {'define': 'IS_MAC'}}]], - # 'defines': ['<(define)'], - # 'my_subdict': {'defines': ['<(define)']}}, - # will not result in "IS_MAC" being appended to the "defines" list in the - # current scope but would result in it being appended to the "defines" list - # within "my_subdict". By comparison: - # {'variables': {'conditions': [['os=="mac"', {'define': 'IS_MAC'}]]}, - # 'defines': ['<(define)'], - # 'my_subdict': {'defines': ['<(define)']}}, - # will append "IS_MAC" to both "defines" lists. - - # Evaluate conditions sections, allowing variable expansions within them - # as well as nested conditionals. This will process a 'conditions' or - # 'target_conditions' section, perform appropriate merging and recursive - # conditional and variable processing, and then remove the conditions section - # from the_dict if it is present. - ProcessConditionsInDict(the_dict, phase, variables, build_file) - - # Conditional processing may have resulted in changes to automatics or the - # variables dict. Reload. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - # Recurse into child dicts, or process child lists which may result in - # further recursion into descendant dicts. - for key, value in the_dict.items(): - # Skip "variables" and string values, which were already processed if - # present. - if key == "variables" or type(value) is str: - continue - if type(value) is dict: - # Pass a copy of the variables dict so that subdicts can't influence - # parents. - ProcessVariablesAndConditionsInDict( - value, phase, variables, build_file, key - ) - elif type(value) is list: - # The list itself can't influence the variables dict, and - # ProcessVariablesAndConditionsInList will make copies of the variables - # dict if it needs to pass it to something that can influence it. No - # copy is necessary here. - ProcessVariablesAndConditionsInList(value, phase, variables, build_file) - elif type(value) is not int: - raise TypeError("Unknown type " + value.__class__.__name__ + " for " + key) - - -def ProcessVariablesAndConditionsInList(the_list, phase, variables, build_file): - # Iterate using an index so that new values can be assigned into the_list. - index = 0 - while index < len(the_list): - item = the_list[index] - if type(item) is dict: - # Make a copy of the variables dict so that it won't influence anything - # outside of its own scope. - ProcessVariablesAndConditionsInDict(item, phase, variables, build_file) - elif type(item) is list: - ProcessVariablesAndConditionsInList(item, phase, variables, build_file) - elif type(item) is str: - expanded = ExpandVariables(item, phase, variables, build_file) - if type(expanded) in (str, int): - the_list[index] = expanded - elif type(expanded) is list: - the_list[index : index + 1] = expanded - index += len(expanded) - - # index now identifies the next item to examine. Continue right now - # without falling into the index increment below. - continue - else: - raise ValueError( - "Variable expansion in this context permits strings and " - + "lists only, found " - + expanded.__class__.__name__ - + " at " - + index - ) - elif type(item) is not int: - raise TypeError( - "Unknown type " + item.__class__.__name__ + " at index " + index - ) - index = index + 1 - - -def BuildTargetsDict(data): - """Builds a dict mapping fully-qualified target names to their target dicts. - - |data| is a dict mapping loaded build files by pathname relative to the - current directory. Values in |data| are build file contents. For each - |data| value with a "targets" key, the value of the "targets" key is taken - as a list containing target dicts. Each target's fully-qualified name is - constructed from the pathname of the build file (|data| key) and its - "target_name" property. These fully-qualified names are used as the keys - in the returned dict. These keys provide access to the target dicts, - the dicts in the "targets" lists. - """ - - targets = {} - for build_file in data["target_build_files"]: - for target in data[build_file].get("targets", []): - target_name = gyp.common.QualifiedTarget( - build_file, target["target_name"], target["toolset"] - ) - if target_name in targets: - raise GypError("Duplicate target definitions for " + target_name) - targets[target_name] = target - - return targets - - -def QualifyDependencies(targets): - """Make dependency links fully-qualified relative to the current directory. - - |targets| is a dict mapping fully-qualified target names to their target - dicts. For each target in this dict, keys known to contain dependency - links are examined, and any dependencies referenced will be rewritten - so that they are fully-qualified and relative to the current directory. - All rewritten dependencies are suitable for use as keys to |targets| or a - similar dict. - """ - - all_dependency_sections = [ - dep + op for dep in dependency_sections for op in ("", "!", "/") - ] - - for target, target_dict in targets.items(): - target_build_file = gyp.common.BuildFile(target) - toolset = target_dict["toolset"] - for dependency_key in all_dependency_sections: - dependencies = target_dict.get(dependency_key, []) - for index, dep in enumerate(dependencies): - dep_file, dep_target, dep_toolset = gyp.common.ResolveTarget( - target_build_file, dep, toolset - ) - if not multiple_toolsets: - # Ignore toolset specification in the dependency if it is specified. - dep_toolset = toolset - dependency = gyp.common.QualifiedTarget( - dep_file, dep_target, dep_toolset - ) - dependencies[index] = dependency - - # Make sure anything appearing in a list other than "dependencies" also - # appears in the "dependencies" list. - if ( - dependency_key != "dependencies" - and dependency not in target_dict["dependencies"] - ): - raise GypError( - "Found " - + dependency - + " in " - + dependency_key - + " of " - + target - + ", but not in dependencies" - ) - - -def ExpandWildcardDependencies(targets, data): - """Expands dependencies specified as build_file:*. - - For each target in |targets|, examines sections containing links to other - targets. If any such section contains a link of the form build_file:*, it - is taken as a wildcard link, and is expanded to list each target in - build_file. The |data| dict provides access to build file dicts. - - Any target that does not wish to be included by wildcard can provide an - optional "suppress_wildcard" key in its target dict. When present and - true, a wildcard dependency link will not include such targets. - - All dependency names, including the keys to |targets| and the values in each - dependency list, must be qualified when this function is called. - """ - - for target, target_dict in targets.items(): - target_build_file = gyp.common.BuildFile(target) - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - - # Loop this way instead of "for dependency in" or "for index in range" - # because the dependencies list will be modified within the loop body. - index = 0 - while index < len(dependencies): - ( - dependency_build_file, - dependency_target, - dependency_toolset, - ) = gyp.common.ParseQualifiedTarget(dependencies[index]) - if dependency_target != "*" and dependency_toolset != "*": - # Not a wildcard. Keep it moving. - index = index + 1 - continue - - if dependency_build_file == target_build_file: - # It's an error for a target to depend on all other targets in - # the same file, because a target cannot depend on itself. - raise GypError( - "Found wildcard in " - + dependency_key - + " of " - + target - + " referring to same build file" - ) - - # Take the wildcard out and adjust the index so that the next - # dependency in the list will be processed the next time through the - # loop. - del dependencies[index] - index = index - 1 - - # Loop through the targets in the other build file, adding them to - # this target's list of dependencies in place of the removed - # wildcard. - dependency_target_dicts = data[dependency_build_file]["targets"] - for dependency_target_dict in dependency_target_dicts: - if int(dependency_target_dict.get("suppress_wildcard", False)): - continue - dependency_target_name = dependency_target_dict["target_name"] - if ( - dependency_target != "*" - and dependency_target != dependency_target_name - ): - continue - dependency_target_toolset = dependency_target_dict["toolset"] - if ( - dependency_toolset != "*" - and dependency_toolset != dependency_target_toolset - ): - continue - dependency = gyp.common.QualifiedTarget( - dependency_build_file, - dependency_target_name, - dependency_target_toolset, - ) - index = index + 1 - dependencies.insert(index, dependency) - - index = index + 1 - - -def Unify(items): - """Removes duplicate elements from items, keeping the first element.""" - seen = {} - return [seen.setdefault(e, e) for e in items if e not in seen] - - -def RemoveDuplicateDependencies(targets): - """Makes sure every dependency appears only once in all targets's dependency - lists.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - target_dict[dependency_key] = Unify(dependencies) - - -def Filter(items, item): - """Removes item from items.""" - res = {} - return [res.setdefault(e, e) for e in items if e != item] - - -def RemoveSelfDependencies(targets): - """Remove self dependencies from targets that have the prune_self_dependency - variable set.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - for t in dependencies: - if t == target_name: - if ( - targets[t] - .get("variables", {}) - .get("prune_self_dependency", 0) - ): - target_dict[dependency_key] = Filter( - dependencies, target_name - ) - - -def RemoveLinkDependenciesFromNoneTargets(targets): - """Remove dependencies having the 'link_dependency' attribute from the 'none' - targets.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - for t in dependencies: - if target_dict.get("type", None) == "none": - if targets[t].get("variables", {}).get("link_dependency", 0): - target_dict[dependency_key] = Filter( - target_dict[dependency_key], t - ) - - -class DependencyGraphNode: - """ - - Attributes: - ref: A reference to an object that this DependencyGraphNode represents. - dependencies: List of DependencyGraphNodes on which this one depends. - dependents: List of DependencyGraphNodes that depend on this one. - """ - - class CircularException(GypError): - pass - - def __init__(self, ref): - self.ref = ref - self.dependencies = [] - self.dependents = [] - - def __repr__(self): - return "" % self.ref - - def FlattenToList(self): - # flat_list is the sorted list of dependencies - actually, the list items - # are the "ref" attributes of DependencyGraphNodes. Every target will - # appear in flat_list after all of its dependencies, and before all of its - # dependents. - flat_list = OrderedSet() - - def ExtractNodeRef(node): - """Extracts the object that the node represents from the given node.""" - return node.ref - - # in_degree_zeros is the list of DependencyGraphNodes that have no - # dependencies not in flat_list. Initially, it is a copy of the children - # of this node, because when the graph was built, nodes with no - # dependencies were made implicit dependents of the root node. - in_degree_zeros = sorted(self.dependents[:], key=ExtractNodeRef) - - while in_degree_zeros: - # Nodes in in_degree_zeros have no dependencies not in flat_list, so they - # can be appended to flat_list. Take these nodes out of in_degree_zeros - # as work progresses, so that the next node to process from the list can - # always be accessed at a consistent position. - node = in_degree_zeros.pop() - flat_list.add(node.ref) - - # Look at dependents of the node just added to flat_list. Some of them - # may now belong in in_degree_zeros. - for node_dependent in sorted(node.dependents, key=ExtractNodeRef): - is_in_degree_zero = True - # TODO: We want to check through the - # node_dependent.dependencies list but if it's long and we - # always start at the beginning, then we get O(n^2) behaviour. - for node_dependent_dependency in sorted( - node_dependent.dependencies, key=ExtractNodeRef - ): - if node_dependent_dependency.ref not in flat_list: - # The dependent one or more dependencies not in flat_list. - # There will be more chances to add it to flat_list - # when examining it again as a dependent of those other - # dependencies, provided that there are no cycles. - is_in_degree_zero = False - break - - if is_in_degree_zero: - # All of the dependent's dependencies are already in flat_list. Add - # it to in_degree_zeros where it will be processed in a future - # iteration of the outer loop. - in_degree_zeros += [node_dependent] - - return list(flat_list) - - def FindCycles(self): - """ - Returns a list of cycles in the graph, where each cycle is its own list. - """ - results = [] - visited = set() - - def Visit(node, path): - for child in node.dependents: - if child in path: - results.append([child] + path[: path.index(child) + 1]) - elif child not in visited: - visited.add(child) - Visit(child, [child] + path) - - visited.add(self) - Visit(self, [self]) - - return results - - def DirectDependencies(self, dependencies=None): - """Returns a list of just direct dependencies.""" - if dependencies is None: - dependencies = [] - - for dependency in self.dependencies: - # Check for None, corresponding to the root node. - if dependency.ref and dependency.ref not in dependencies: - dependencies.append(dependency.ref) - - return dependencies - - def _AddImportedDependencies(self, targets, dependencies=None): - """Given a list of direct dependencies, adds indirect dependencies that - other dependencies have declared to export their settings. - - This method does not operate on self. Rather, it operates on the list - of dependencies in the |dependencies| argument. For each dependency in - that list, if any declares that it exports the settings of one of its - own dependencies, those dependencies whose settings are "passed through" - are added to the list. As new items are added to the list, they too will - be processed, so it is possible to import settings through multiple levels - of dependencies. - - This method is not terribly useful on its own, it depends on being - "primed" with a list of direct dependencies such as one provided by - DirectDependencies. DirectAndImportedDependencies is intended to be the - public entry point. - """ - - if dependencies is None: - dependencies = [] - - index = 0 - while index < len(dependencies): - dependency = dependencies[index] - dependency_dict = targets[dependency] - # Add any dependencies whose settings should be imported to the list - # if not already present. Newly-added items will be checked for - # their own imports when the list iteration reaches them. - # Rather than simply appending new items, insert them after the - # dependency that exported them. This is done to more closely match - # the depth-first method used by DeepDependencies. - add_index = 1 - for imported_dependency in dependency_dict.get( - "export_dependent_settings", [] - ): - if imported_dependency not in dependencies: - dependencies.insert(index + add_index, imported_dependency) - add_index = add_index + 1 - index = index + 1 - - return dependencies - - def DirectAndImportedDependencies(self, targets, dependencies=None): - """Returns a list of a target's direct dependencies and all indirect - dependencies that a dependency has advertised settings should be exported - through the dependency for. - """ - - dependencies = self.DirectDependencies(dependencies) - return self._AddImportedDependencies(targets, dependencies) - - def DeepDependencies(self, dependencies=None): - """Returns an OrderedSet of all of a target's dependencies, recursively.""" - if dependencies is None: - # Using a list to get ordered output and a set to do fast "is it - # already added" checks. - dependencies = OrderedSet() - - for dependency in self.dependencies: - # Check for None, corresponding to the root node. - if dependency.ref is None: - continue - if dependency.ref not in dependencies: - dependency.DeepDependencies(dependencies) - dependencies.add(dependency.ref) - - return dependencies - - def _LinkDependenciesInternal( - self, targets, include_shared_libraries, dependencies=None, initial=True - ): - """Returns an OrderedSet of dependency targets that are linked - into this target. - - This function has a split personality, depending on the setting of - |initial|. Outside callers should always leave |initial| at its default - setting. - - When adding a target to the list of dependencies, this function will - recurse into itself with |initial| set to False, to collect dependencies - that are linked into the linkable target for which the list is being built. - - If |include_shared_libraries| is False, the resulting dependencies will not - include shared_library targets that are linked into this target. - """ - if dependencies is None: - # Using a list to get ordered output and a set to do fast "is it - # already added" checks. - dependencies = OrderedSet() - - # Check for None, corresponding to the root node. - if self.ref is None: - return dependencies - - # It's kind of sucky that |targets| has to be passed into this function, - # but that's presently the easiest way to access the target dicts so that - # this function can find target types. - - if "target_name" not in targets[self.ref]: - raise GypError("Missing 'target_name' field in target.") - - if "type" not in targets[self.ref]: - raise GypError( - "Missing 'type' field in target %s" % targets[self.ref]["target_name"] - ) - - target_type = targets[self.ref]["type"] - - is_linkable = target_type in linkable_types - - if initial and not is_linkable: - # If this is the first target being examined and it's not linkable, - # return an empty list of link dependencies, because the link - # dependencies are intended to apply to the target itself (initial is - # True) and this target won't be linked. - return dependencies - - # Don't traverse 'none' targets if explicitly excluded. - if target_type == "none" and not targets[self.ref].get( - "dependencies_traverse", True - ): - dependencies.add(self.ref) - return dependencies - - # Executables, mac kernel extensions, windows drivers and loadable modules - # are already fully and finally linked. Nothing else can be a link - # dependency of them, there can only be dependencies in the sense that a - # dependent target might run an executable or load the loadable_module. - if not initial and target_type in ( - "executable", - "loadable_module", - "mac_kernel_extension", - "windows_driver", - ): - return dependencies - - # Shared libraries are already fully linked. They should only be included - # in |dependencies| when adjusting static library dependencies (in order to - # link against the shared_library's import lib), but should not be included - # in |dependencies| when propagating link_settings. - # The |include_shared_libraries| flag controls which of these two cases we - # are handling. - if ( - not initial - and target_type == "shared_library" - and not include_shared_libraries - ): - return dependencies - - # The target is linkable, add it to the list of link dependencies. - if self.ref not in dependencies: - dependencies.add(self.ref) - if initial or not is_linkable: - # If this is a subsequent target and it's linkable, don't look any - # further for linkable dependencies, as they'll already be linked into - # this target linkable. Always look at dependencies of the initial - # target, and always look at dependencies of non-linkables. - for dependency in self.dependencies: - dependency._LinkDependenciesInternal( - targets, include_shared_libraries, dependencies, False - ) - - return dependencies - - def DependenciesForLinkSettings(self, targets): - """ - Returns a list of dependency targets whose link_settings should be merged - into this target. - """ - - # TODO(sbaig) Currently, chrome depends on the bug that shared libraries' - # link_settings are propagated. So for now, we will allow it, unless the - # 'allow_sharedlib_linksettings_propagation' flag is explicitly set to - # False. Once chrome is fixed, we can remove this flag. - include_shared_libraries = targets[self.ref].get( - "allow_sharedlib_linksettings_propagation", True - ) - return self._LinkDependenciesInternal(targets, include_shared_libraries) - - def DependenciesToLinkAgainst(self, targets): - """ - Returns a list of dependency targets that are linked into this target. - """ - return self._LinkDependenciesInternal(targets, True) - - -def BuildDependencyList(targets): - # Create a DependencyGraphNode for each target. Put it into a dict for easy - # access. - dependency_nodes = {} - for target, spec in targets.items(): - if target not in dependency_nodes: - dependency_nodes[target] = DependencyGraphNode(target) - - # Set up the dependency links. Targets that have no dependencies are treated - # as dependent on root_node. - root_node = DependencyGraphNode(None) - for target, spec in targets.items(): - target_node = dependency_nodes[target] - dependencies = spec.get("dependencies") - if not dependencies: - target_node.dependencies = [root_node] - root_node.dependents.append(target_node) - else: - for dependency in dependencies: - dependency_node = dependency_nodes.get(dependency) - if not dependency_node: - raise GypError( - "Dependency '%s' not found while " - "trying to load target %s" % (dependency, target) - ) - target_node.dependencies.append(dependency_node) - dependency_node.dependents.append(target_node) - - flat_list = root_node.FlattenToList() - - # If there's anything left unvisited, there must be a circular dependency - # (cycle). - if len(flat_list) != len(targets): - if not root_node.dependents: - # If all targets have dependencies, add the first target as a dependent - # of root_node so that the cycle can be discovered from root_node. - target = next(iter(targets)) - target_node = dependency_nodes[target] - target_node.dependencies.append(root_node) - root_node.dependents.append(target_node) - - cycles = [] - for cycle in root_node.FindCycles(): - paths = [node.ref for node in cycle] - cycles.append("Cycle: %s" % " -> ".join(paths)) - raise DependencyGraphNode.CircularException( - "Cycles in dependency graph detected:\n" + "\n".join(cycles) - ) - - return [dependency_nodes, flat_list] - - -def VerifyNoGYPFileCircularDependencies(targets): - # Create a DependencyGraphNode for each gyp file containing a target. Put - # it into a dict for easy access. - dependency_nodes = {} - for target in targets: - build_file = gyp.common.BuildFile(target) - if build_file not in dependency_nodes: - dependency_nodes[build_file] = DependencyGraphNode(build_file) - - # Set up the dependency links. - for target, spec in targets.items(): - build_file = gyp.common.BuildFile(target) - build_file_node = dependency_nodes[build_file] - target_dependencies = spec.get("dependencies", []) - for dependency in target_dependencies: - try: - dependency_build_file = gyp.common.BuildFile(dependency) - except GypError as e: - gyp.common.ExceptionAppend( - e, "while computing dependencies of .gyp file %s" % build_file - ) - raise - - if dependency_build_file == build_file: - # A .gyp file is allowed to refer back to itself. - continue - dependency_node = dependency_nodes.get(dependency_build_file) - if not dependency_node: - raise GypError("Dependency '%s' not found" % dependency_build_file) - if dependency_node not in build_file_node.dependencies: - build_file_node.dependencies.append(dependency_node) - dependency_node.dependents.append(build_file_node) - - # Files that have no dependencies are treated as dependent on root_node. - root_node = DependencyGraphNode(None) - for build_file_node in dependency_nodes.values(): - if len(build_file_node.dependencies) == 0: - build_file_node.dependencies.append(root_node) - root_node.dependents.append(build_file_node) - - flat_list = root_node.FlattenToList() - - # If there's anything left unvisited, there must be a circular dependency - # (cycle). - if len(flat_list) != len(dependency_nodes): - if not root_node.dependents: - # If all files have dependencies, add the first file as a dependent - # of root_node so that the cycle can be discovered from root_node. - file_node = next(iter(dependency_nodes.values())) - file_node.dependencies.append(root_node) - root_node.dependents.append(file_node) - cycles = [] - for cycle in root_node.FindCycles(): - paths = [node.ref for node in cycle] - cycles.append("Cycle: %s" % " -> ".join(paths)) - raise DependencyGraphNode.CircularException( - "Cycles in .gyp file dependency graph detected:\n" + "\n".join(cycles) - ) - - -def DoDependentSettings(key, flat_list, targets, dependency_nodes): - # key should be one of all_dependent_settings, direct_dependent_settings, - # or link_settings. - - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - - if key == "all_dependent_settings": - dependencies = dependency_nodes[target].DeepDependencies() - elif key == "direct_dependent_settings": - dependencies = dependency_nodes[target].DirectAndImportedDependencies( - targets - ) - elif key == "link_settings": - dependencies = dependency_nodes[target].DependenciesForLinkSettings(targets) - else: - raise GypError( - "DoDependentSettings doesn't know how to determine " - "dependencies for " + key - ) - - for dependency in dependencies: - dependency_dict = targets[dependency] - if key not in dependency_dict: - continue - dependency_build_file = gyp.common.BuildFile(dependency) - MergeDicts( - target_dict, dependency_dict[key], build_file, dependency_build_file - ) - - -def AdjustStaticLibraryDependencies( - flat_list, targets, dependency_nodes, sort_dependencies -): - # Recompute target "dependencies" properties. For each static library - # target, remove "dependencies" entries referring to other static libraries, - # unless the dependency has the "hard_dependency" attribute set. For each - # linkable target, add a "dependencies" entry referring to all of the - # target's computed list of link dependencies (including static libraries - # if no such entry is already present. - for target in flat_list: - target_dict = targets[target] - target_type = target_dict["type"] - - if target_type == "static_library": - if "dependencies" not in target_dict: - continue - - target_dict["dependencies_original"] = target_dict.get("dependencies", [])[ - : - ] - - # A static library should not depend on another static library unless - # the dependency relationship is "hard," which should only be done when - # a dependent relies on some side effect other than just the build - # product, like a rule or action output. Further, if a target has a - # non-hard dependency, but that dependency exports a hard dependency, - # the non-hard dependency can safely be removed, but the exported hard - # dependency must be added to the target to keep the same dependency - # ordering. - dependencies = dependency_nodes[target].DirectAndImportedDependencies( - targets - ) - index = 0 - while index < len(dependencies): - dependency = dependencies[index] - dependency_dict = targets[dependency] - - # Remove every non-hard static library dependency and remove every - # non-static library dependency that isn't a direct dependency. - if ( - dependency_dict["type"] == "static_library" - and not dependency_dict.get("hard_dependency", False) - ) or ( - dependency_dict["type"] != "static_library" - and dependency not in target_dict["dependencies"] - ): - # Take the dependency out of the list, and don't increment index - # because the next dependency to analyze will shift into the index - # formerly occupied by the one being removed. - del dependencies[index] - else: - index = index + 1 - - # Update the dependencies. If the dependencies list is empty, it's not - # needed, so unhook it. - if len(dependencies) > 0: - target_dict["dependencies"] = dependencies - else: - del target_dict["dependencies"] - - elif target_type in linkable_types: - # Get a list of dependency targets that should be linked into this - # target. Add them to the dependencies list if they're not already - # present. - - link_dependencies = dependency_nodes[target].DependenciesToLinkAgainst( - targets - ) - for dependency in link_dependencies: - if dependency == target: - continue - if "dependencies" not in target_dict: - target_dict["dependencies"] = [] - if dependency not in target_dict["dependencies"]: - target_dict["dependencies"].append(dependency) - # Sort the dependencies list in the order from dependents to dependencies. - # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. - # Note: flat_list is already sorted in the order from dependencies to - # dependents. - if sort_dependencies and "dependencies" in target_dict: - target_dict["dependencies"] = [ - dep - for dep in reversed(flat_list) - if dep in target_dict["dependencies"] - ] - - -# Initialize this here to speed up MakePathRelative. -exception_re = re.compile(r"""["']?[-/$<>^]""") - - -def MakePathRelative(to_file, fro_file, item): - # If item is a relative path, it's relative to the build file dict that it's - # coming from. Fix it up to make it relative to the build file dict that - # it's going into. - # Exception: any |item| that begins with these special characters is - # returned without modification. - # / Used when a path is already absolute (shortcut optimization; - # such paths would be returned as absolute anyway) - # $ Used for build environment variables - # - Used for some build environment flags (such as -lapr-1 in a - # "libraries" section) - # < Used for our own variable and command expansions (see ExpandVariables) - # > Used for our own variable and command expansions (see ExpandVariables) - # ^ Used for our own variable and command expansions (see ExpandVariables) - # - # "/' Used when a value is quoted. If these are present, then we - # check the second character instead. - # - if to_file == fro_file or exception_re.match(item): - return item - else: - # TODO(dglazkov) The backslash/forward-slash replacement at the end is a - # temporary measure. This should really be addressed by keeping all paths - # in POSIX until actual project generation. - ret = os.path.normpath( - os.path.join( - gyp.common.RelativePath( - os.path.dirname(fro_file), os.path.dirname(to_file) - ), - item, - ) - ).replace("\\", "/") - if item.endswith("/"): - ret += "/" - return ret - - -def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): - # Python documentation recommends objects which do not support hash - # set this value to None. Python library objects follow this rule. - def is_hashable(val): - return val.__hash__ - - # If x is hashable, returns whether x is in s. Else returns whether x is in items. - def is_in_set_or_list(x, s, items): - if is_hashable(x): - return x in s - return x in items - - prepend_index = 0 - - # Make membership testing of hashables in |to| (in particular, strings) - # faster. - hashable_to_set = {x for x in to if is_hashable(x)} - for item in fro: - singleton = False - if type(item) in (str, int): - # The cheap and easy case. - if is_paths: - to_item = MakePathRelative(to_file, fro_file, item) - else: - to_item = item - - if not (type(item) is str and item.startswith("-")): - # Any string that doesn't begin with a "-" is a singleton - it can - # only appear once in a list, to be enforced by the list merge append - # or prepend. - singleton = True - elif type(item) is dict: - # Make a copy of the dictionary, continuing to look for paths to fix. - # The other intelligent aspects of merge processing won't apply because - # item is being merged into an empty dict. - to_item = {} - MergeDicts(to_item, item, to_file, fro_file) - elif type(item) is list: - # Recurse, making a copy of the list. If the list contains any - # descendant dicts, path fixing will occur. Note that here, custom - # values for is_paths and append are dropped; those are only to be - # applied to |to| and |fro|, not sublists of |fro|. append shouldn't - # matter anyway because the new |to_item| list is empty. - to_item = [] - MergeLists(to_item, item, to_file, fro_file) - else: - raise TypeError( - "Attempt to merge list item of unsupported type " - + item.__class__.__name__ - ) - - if append: - # If appending a singleton that's already in the list, don't append. - # This ensures that the earliest occurrence of the item will stay put. - if not singleton or not is_in_set_or_list(to_item, hashable_to_set, to): - to.append(to_item) - if is_hashable(to_item): - hashable_to_set.add(to_item) - else: - # If prepending a singleton that's already in the list, remove the - # existing instance and proceed with the prepend. This ensures that the - # item appears at the earliest possible position in the list. - while singleton and to_item in to: - to.remove(to_item) - - # Don't just insert everything at index 0. That would prepend the new - # items to the list in reverse order, which would be an unwelcome - # surprise. - to.insert(prepend_index, to_item) - if is_hashable(to_item): - hashable_to_set.add(to_item) - prepend_index = prepend_index + 1 - - -def MergeDicts(to, fro, to_file, fro_file): - # I wanted to name the parameter "from" but it's a Python keyword... - for k, v in fro.items(): - # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give - # copy semantics. Something else may want to merge from the |fro| dict - # later, and having the same dict ref pointed to twice in the tree isn't - # what anyone wants considering that the dicts may subsequently be - # modified. - if k in to: - bad_merge = False - if type(v) in (str, int): - if type(to[k]) not in (str, int): - bad_merge = True - elif not isinstance(v, type(to[k])): - bad_merge = True - - if bad_merge: - raise TypeError( - "Attempt to merge dict value of type " - + v.__class__.__name__ - + " into incompatible type " - + to[k].__class__.__name__ - + " for key " - + k - ) - if type(v) in (str, int): - # Overwrite the existing value, if any. Cheap and easy. - is_path = IsPathSection(k) - if is_path: - to[k] = MakePathRelative(to_file, fro_file, v) - else: - to[k] = v - elif type(v) is dict: - # Recurse, guaranteeing copies will be made of objects that require it. - if k not in to: - to[k] = {} - MergeDicts(to[k], v, to_file, fro_file) - elif type(v) is list: - # Lists in dicts can be merged with different policies, depending on - # how the key in the "from" dict (k, the from-key) is written. - # - # If the from-key has ...the to-list will have this action - # this character appended:... applied when receiving the from-list: - # = replace - # + prepend - # ? set, only if to-list does not yet exist - # (none) append - # - # This logic is list-specific, but since it relies on the associated - # dict key, it's checked in this dict-oriented function. - ext = k[-1] - append = True - if ext == "=": - list_base = k[:-1] - lists_incompatible = [list_base, list_base + "?"] - to[list_base] = [] - elif ext == "+": - list_base = k[:-1] - lists_incompatible = [list_base + "=", list_base + "?"] - append = False - elif ext == "?": - list_base = k[:-1] - lists_incompatible = [list_base, list_base + "=", list_base + "+"] - else: - list_base = k - lists_incompatible = [list_base + "=", list_base + "?"] - - # Some combinations of merge policies appearing together are meaningless. - # It's stupid to replace and append simultaneously, for example. Append - # and prepend are the only policies that can coexist. - for list_incompatible in lists_incompatible: - if list_incompatible in fro: - raise GypError( - "Incompatible list policies " + k + " and " + list_incompatible - ) - - if list_base in to: - if ext == "?": - # If the key ends in "?", the list will only be merged if it doesn't - # already exist. - continue - elif type(to[list_base]) is not list: - # This may not have been checked above if merging in a list with an - # extension character. - raise TypeError( - "Attempt to merge dict value of type " - + v.__class__.__name__ - + " into incompatible type " - + to[list_base].__class__.__name__ - + " for key " - + list_base - + "(" - + k - + ")" - ) - else: - to[list_base] = [] - - # Call MergeLists, which will make copies of objects that require it. - # MergeLists can recurse back into MergeDicts, although this will be - # to make copies of dicts (with paths fixed), there will be no - # subsequent dict "merging" once entering a list because lists are - # always replaced, appended to, or prepended to. - is_paths = IsPathSection(list_base) - MergeLists(to[list_base], v, to_file, fro_file, is_paths, append) - else: - raise TypeError( - "Attempt to merge dict value of unsupported type " - + v.__class__.__name__ - + " for key " - + k - ) - - -def MergeConfigWithInheritance( - new_configuration_dict, build_file, target_dict, configuration, visited -): - # Skip if previously visited. - if configuration in visited: - return - - # Look at this configuration. - configuration_dict = target_dict["configurations"][configuration] - - # Merge in parents. - for parent in configuration_dict.get("inherit_from", []): - MergeConfigWithInheritance( - new_configuration_dict, - build_file, - target_dict, - parent, - visited + [configuration], - ) - - # Merge it into the new config. - MergeDicts(new_configuration_dict, configuration_dict, build_file, build_file) - - # Drop abstract. - if "abstract" in new_configuration_dict: - del new_configuration_dict["abstract"] - - -def SetUpConfigurations(target, target_dict): - # key_suffixes is a list of key suffixes that might appear on key names. - # These suffixes are handled in conditional evaluations (for =, +, and ?) - # and rules/exclude processing (for ! and /). Keys with these suffixes - # should be treated the same as keys without. - key_suffixes = ["=", "+", "?", "!", "/"] - - build_file = gyp.common.BuildFile(target) - - # Provide a single configuration by default if none exists. - # TODO(mark): Signal an error if default_configurations exists but - # configurations does not. - if "configurations" not in target_dict: - target_dict["configurations"] = {"Default": {}} - if "default_configuration" not in target_dict: - concrete = [ - i - for (i, config) in target_dict["configurations"].items() - if not config.get("abstract") - ] - target_dict["default_configuration"] = sorted(concrete)[0] - - merged_configurations = {} - configs = target_dict["configurations"] - for (configuration, old_configuration_dict) in configs.items(): - # Skip abstract configurations (saves work only). - if old_configuration_dict.get("abstract"): - continue - # Configurations inherit (most) settings from the enclosing target scope. - # Get the inheritance relationship right by making a copy of the target - # dict. - new_configuration_dict = {} - for (key, target_val) in target_dict.items(): - key_ext = key[-1:] - if key_ext in key_suffixes: - key_base = key[:-1] - else: - key_base = key - if key_base not in non_configuration_keys: - new_configuration_dict[key] = gyp.simple_copy.deepcopy(target_val) - - # Merge in configuration (with all its parents first). - MergeConfigWithInheritance( - new_configuration_dict, build_file, target_dict, configuration, [] - ) - - merged_configurations[configuration] = new_configuration_dict - - # Put the new configurations back into the target dict as a configuration. - for configuration in merged_configurations.keys(): - target_dict["configurations"][configuration] = merged_configurations[ - configuration - ] - - # Now drop all the abstract ones. - configs = target_dict["configurations"] - target_dict["configurations"] = { - k: v for k, v in configs.items() if not v.get("abstract") - } - - # Now that all of the target's configurations have been built, go through - # the target dict's keys and remove everything that's been moved into a - # "configurations" section. - delete_keys = [] - for key in target_dict: - key_ext = key[-1:] - if key_ext in key_suffixes: - key_base = key[:-1] - else: - key_base = key - if key_base not in non_configuration_keys: - delete_keys.append(key) - for key in delete_keys: - del target_dict[key] - - # Check the configurations to see if they contain invalid keys. - for configuration in target_dict["configurations"].keys(): - configuration_dict = target_dict["configurations"][configuration] - for key in configuration_dict.keys(): - if key in invalid_configuration_keys: - raise GypError( - "%s not allowed in the %s configuration, found in " - "target %s" % (key, configuration, target) - ) - - -def ProcessListFiltersInDict(name, the_dict): - """Process regular expression and exclusion-based filters on lists. - - An exclusion list is in a dict key named with a trailing "!", like - "sources!". Every item in such a list is removed from the associated - main list, which in this example, would be "sources". Removed items are - placed into a "sources_excluded" list in the dict. - - Regular expression (regex) filters are contained in dict keys named with a - trailing "/", such as "sources/" to operate on the "sources" list. Regex - filters in a dict take the form: - 'sources/': [ ['exclude', '_(linux|mac|win)\\.cc$'], - ['include', '_mac\\.cc$'] ], - The first filter says to exclude all files ending in _linux.cc, _mac.cc, and - _win.cc. The second filter then includes all files ending in _mac.cc that - are now or were once in the "sources" list. Items matching an "exclude" - filter are subject to the same processing as would occur if they were listed - by name in an exclusion list (ending in "!"). Items matching an "include" - filter are brought back into the main list if previously excluded by an - exclusion list or exclusion regex filter. Subsequent matching "exclude" - patterns can still cause items to be excluded after matching an "include". - """ - - # Look through the dictionary for any lists whose keys end in "!" or "/". - # These are lists that will be treated as exclude lists and regular - # expression-based exclude/include lists. Collect the lists that are - # needed first, looking for the lists that they operate on, and assemble - # then into |lists|. This is done in a separate loop up front, because - # the _included and _excluded keys need to be added to the_dict, and that - # can't be done while iterating through it. - - lists = [] - del_lists = [] - for key, value in the_dict.items(): - operation = key[-1] - if operation != "!" and operation != "/": - continue - - if type(value) is not list: - raise ValueError( - name + " key " + key + " must be list, not " + value.__class__.__name__ - ) - - list_key = key[:-1] - if list_key not in the_dict: - # This happens when there's a list like "sources!" but no corresponding - # "sources" list. Since there's nothing for it to operate on, queue up - # the "sources!" list for deletion now. - del_lists.append(key) - continue - - if type(the_dict[list_key]) is not list: - value = the_dict[list_key] - raise ValueError( - name - + " key " - + list_key - + " must be list, not " - + value.__class__.__name__ - + " when applying " - + {"!": "exclusion", "/": "regex"}[operation] - ) - - if list_key not in lists: - lists.append(list_key) - - # Delete the lists that are known to be unneeded at this point. - for del_list in del_lists: - del the_dict[del_list] - - for list_key in lists: - the_list = the_dict[list_key] - - # Initialize the list_actions list, which is parallel to the_list. Each - # item in list_actions identifies whether the corresponding item in - # the_list should be excluded, unconditionally preserved (included), or - # whether no exclusion or inclusion has been applied. Items for which - # no exclusion or inclusion has been applied (yet) have value -1, items - # excluded have value 0, and items included have value 1. Includes and - # excludes override previous actions. All items in list_actions are - # initialized to -1 because no excludes or includes have been processed - # yet. - list_actions = list((-1,) * len(the_list)) - - exclude_key = list_key + "!" - if exclude_key in the_dict: - for exclude_item in the_dict[exclude_key]: - for index, list_item in enumerate(the_list): - if exclude_item == list_item: - # This item matches the exclude_item, so set its action to 0 - # (exclude). - list_actions[index] = 0 - - # The "whatever!" list is no longer needed, dump it. - del the_dict[exclude_key] - - regex_key = list_key + "/" - if regex_key in the_dict: - for regex_item in the_dict[regex_key]: - [action, pattern] = regex_item - pattern_re = re.compile(pattern) - - if action == "exclude": - # This item matches an exclude regex, set its value to 0 (exclude). - action_value = 0 - elif action == "include": - # This item matches an include regex, set its value to 1 (include). - action_value = 1 - else: - # This is an action that doesn't make any sense. - raise ValueError( - "Unrecognized action " - + action - + " in " - + name - + " key " - + regex_key - ) - - for index, list_item in enumerate(the_list): - if list_actions[index] == action_value: - # Even if the regex matches, nothing will change so continue - # (regex searches are expensive). - continue - if pattern_re.search(list_item): - # Regular expression match. - list_actions[index] = action_value - - # The "whatever/" list is no longer needed, dump it. - del the_dict[regex_key] - - # Add excluded items to the excluded list. - # - # Note that exclude_key ("sources!") is different from excluded_key - # ("sources_excluded"). The exclude_key list is input and it was already - # processed and deleted; the excluded_key list is output and it's about - # to be created. - excluded_key = list_key + "_excluded" - if excluded_key in the_dict: - raise GypError( - name + " key " + excluded_key + " must not be present prior " - " to applying exclusion/regex filters for " + list_key - ) - - excluded_list = [] - - # Go backwards through the list_actions list so that as items are deleted, - # the indices of items that haven't been seen yet don't shift. That means - # that things need to be prepended to excluded_list to maintain them in the - # same order that they existed in the_list. - for index in range(len(list_actions) - 1, -1, -1): - if list_actions[index] == 0: - # Dump anything with action 0 (exclude). Keep anything with action 1 - # (include) or -1 (no include or exclude seen for the item). - excluded_list.insert(0, the_list[index]) - del the_list[index] - - # If anything was excluded, put the excluded list into the_dict at - # excluded_key. - if len(excluded_list) > 0: - the_dict[excluded_key] = excluded_list - - # Now recurse into subdicts and lists that may contain dicts. - for key, value in the_dict.items(): - if type(value) is dict: - ProcessListFiltersInDict(key, value) - elif type(value) is list: - ProcessListFiltersInList(key, value) - - -def ProcessListFiltersInList(name, the_list): - for item in the_list: - if type(item) is dict: - ProcessListFiltersInDict(name, item) - elif type(item) is list: - ProcessListFiltersInList(name, item) - - -def ValidateTargetType(target, target_dict): - """Ensures the 'type' field on the target is one of the known types. - - Arguments: - target: string, name of target. - target_dict: dict, target spec. - - Raises an exception on error. - """ - VALID_TARGET_TYPES = ( - "executable", - "loadable_module", - "static_library", - "shared_library", - "mac_kernel_extension", - "none", - "windows_driver", - ) - target_type = target_dict.get("type", None) - if target_type not in VALID_TARGET_TYPES: - raise GypError( - "Target %s has an invalid target type '%s'. " - "Must be one of %s." % (target, target_type, "/".join(VALID_TARGET_TYPES)) - ) - if ( - target_dict.get("standalone_static_library", 0) - and not target_type == "static_library" - ): - raise GypError( - "Target %s has type %s but standalone_static_library flag is" - " only valid for static_library type." % (target, target_type) - ) - - -def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): - """Ensures that the rules sections in target_dict are valid and consistent, - and determines which sources they apply to. - - Arguments: - target: string, name of target. - target_dict: dict, target spec containing "rules" and "sources" lists. - extra_sources_for_rules: a list of keys to scan for rule matches in - addition to 'sources'. - """ - - # Dicts to map between values found in rules' 'rule_name' and 'extension' - # keys and the rule dicts themselves. - rule_names = {} - rule_extensions = {} - - rules = target_dict.get("rules", []) - for rule in rules: - # Make sure that there's no conflict among rule names and extensions. - rule_name = rule["rule_name"] - if rule_name in rule_names: - raise GypError( - f"rule {rule_name} exists in duplicate, target {target}" - ) - rule_names[rule_name] = rule - - rule_extension = rule["extension"] - if rule_extension.startswith("."): - rule_extension = rule_extension[1:] - if rule_extension in rule_extensions: - raise GypError( - ( - "extension %s associated with multiple rules, " - + "target %s rules %s and %s" - ) - % ( - rule_extension, - target, - rule_extensions[rule_extension]["rule_name"], - rule_name, - ) - ) - rule_extensions[rule_extension] = rule - - # Make sure rule_sources isn't already there. It's going to be - # created below if needed. - if "rule_sources" in rule: - raise GypError( - "rule_sources must not exist in input, target %s rule %s" - % (target, rule_name) - ) - - rule_sources = [] - source_keys = ["sources"] - source_keys.extend(extra_sources_for_rules) - for source_key in source_keys: - for source in target_dict.get(source_key, []): - (source_root, source_extension) = os.path.splitext(source) - if source_extension.startswith("."): - source_extension = source_extension[1:] - if source_extension == rule_extension: - rule_sources.append(source) - - if len(rule_sources) > 0: - rule["rule_sources"] = rule_sources - - -def ValidateRunAsInTarget(target, target_dict, build_file): - target_name = target_dict.get("target_name") - run_as = target_dict.get("run_as") - if not run_as: - return - if type(run_as) is not dict: - raise GypError( - "The 'run_as' in target %s from file %s should be a " - "dictionary." % (target_name, build_file) - ) - action = run_as.get("action") - if not action: - raise GypError( - "The 'run_as' in target %s from file %s must have an " - "'action' section." % (target_name, build_file) - ) - if type(action) is not list: - raise GypError( - "The 'action' for 'run_as' in target %s from file %s " - "must be a list." % (target_name, build_file) - ) - working_directory = run_as.get("working_directory") - if working_directory and type(working_directory) is not str: - raise GypError( - "The 'working_directory' for 'run_as' in target %s " - "in file %s should be a string." % (target_name, build_file) - ) - environment = run_as.get("environment") - if environment and type(environment) is not dict: - raise GypError( - "The 'environment' for 'run_as' in target %s " - "in file %s should be a dictionary." % (target_name, build_file) - ) - - -def ValidateActionsInTarget(target, target_dict, build_file): - """Validates the inputs to the actions in a target.""" - target_name = target_dict.get("target_name") - actions = target_dict.get("actions", []) - for action in actions: - action_name = action.get("action_name") - if not action_name: - raise GypError( - "Anonymous action in target %s. " - "An action must have an 'action_name' field." % target_name - ) - inputs = action.get("inputs", None) - if inputs is None: - raise GypError("Action in target %s has no inputs." % target_name) - action_command = action.get("action") - if action_command and not action_command[0]: - raise GypError("Empty action as command in target %s." % target_name) - - -def TurnIntIntoStrInDict(the_dict): - """Given dict the_dict, recursively converts all integers into strings. - """ - # Use items instead of iteritems because there's no need to try to look at - # reinserted keys and their associated values. - for k, v in the_dict.items(): - if type(v) is int: - v = str(v) - the_dict[k] = v - elif type(v) is dict: - TurnIntIntoStrInDict(v) - elif type(v) is list: - TurnIntIntoStrInList(v) - - if type(k) is int: - del the_dict[k] - the_dict[str(k)] = v - - -def TurnIntIntoStrInList(the_list): - """Given list the_list, recursively converts all integers into strings. - """ - for index, item in enumerate(the_list): - if type(item) is int: - the_list[index] = str(item) - elif type(item) is dict: - TurnIntIntoStrInDict(item) - elif type(item) is list: - TurnIntIntoStrInList(item) - - -def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets, data): - """Return only the targets that are deep dependencies of |root_targets|.""" - qualified_root_targets = [] - for target in root_targets: - target = target.strip() - qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list) - if not qualified_targets: - raise GypError("Could not find target %s" % target) - qualified_root_targets.extend(qualified_targets) - - wanted_targets = {} - for target in qualified_root_targets: - wanted_targets[target] = targets[target] - for dependency in dependency_nodes[target].DeepDependencies(): - wanted_targets[dependency] = targets[dependency] - - wanted_flat_list = [t for t in flat_list if t in wanted_targets] - - # Prune unwanted targets from each build_file's data dict. - for build_file in data["target_build_files"]: - if "targets" not in data[build_file]: - continue - new_targets = [] - for target in data[build_file]["targets"]: - qualified_name = gyp.common.QualifiedTarget( - build_file, target["target_name"], target["toolset"] - ) - if qualified_name in wanted_targets: - new_targets.append(target) - data[build_file]["targets"] = new_targets - - return wanted_targets, wanted_flat_list - - -def VerifyNoCollidingTargets(targets): - """Verify that no two targets in the same directory share the same name. - - Arguments: - targets: A list of targets in the form 'path/to/file.gyp:target_name'. - """ - # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'. - used = {} - for target in targets: - # Separate out 'path/to/file.gyp, 'target_name' from - # 'path/to/file.gyp:target_name'. - path, name = target.rsplit(":", 1) - # Separate out 'path/to', 'file.gyp' from 'path/to/file.gyp'. - subdir, gyp = os.path.split(path) - # Use '.' for the current directory '', so that the error messages make - # more sense. - if not subdir: - subdir = "." - # Prepare a key like 'path/to:target_name'. - key = subdir + ":" + name - if key in used: - # Complain if this target is already used. - raise GypError( - 'Duplicate target name "%s" in directory "%s" used both ' - 'in "%s" and "%s".' % (name, subdir, gyp, used[key]) - ) - used[key] = gyp - - -def SetGeneratorGlobals(generator_input_info): - # Set up path_sections and non_configuration_keys with the default data plus - # the generator-specific data. - global path_sections - path_sections = set(base_path_sections) - path_sections.update(generator_input_info["path_sections"]) - - global non_configuration_keys - non_configuration_keys = base_non_configuration_keys[:] - non_configuration_keys.extend(generator_input_info["non_configuration_keys"]) - - global multiple_toolsets - multiple_toolsets = generator_input_info["generator_supports_multiple_toolsets"] - - global generator_filelist_paths - generator_filelist_paths = generator_input_info["generator_filelist_paths"] - - -def Load( - build_files, - variables, - includes, - depth, - generator_input_info, - check, - circular_check, - parallel, - root_targets, -): - SetGeneratorGlobals(generator_input_info) - # A generator can have other lists (in addition to sources) be processed - # for rules. - extra_sources_for_rules = generator_input_info["extra_sources_for_rules"] - - # Load build files. This loads every target-containing build file into - # the |data| dictionary such that the keys to |data| are build file names, - # and the values are the entire build file contents after "early" or "pre" - # processing has been done and includes have been resolved. - # NOTE: data contains both "target" files (.gyp) and "includes" (.gypi), as - # well as meta-data (e.g. 'included_files' key). 'target_build_files' keeps - # track of the keys corresponding to "target" files. - data = {"target_build_files": set()} - # Normalize paths everywhere. This is important because paths will be - # used as keys to the data dict and for references between input files. - build_files = set(map(os.path.normpath, build_files)) - if parallel: - LoadTargetBuildFilesParallel( - build_files, data, variables, includes, depth, check, generator_input_info - ) - else: - aux_data = {} - for build_file in build_files: - try: - LoadTargetBuildFile( - build_file, data, aux_data, variables, includes, depth, check, True - ) - except Exception as e: - gyp.common.ExceptionAppend(e, "while trying to load %s" % build_file) - raise - - # Build a dict to access each target's subdict by qualified name. - targets = BuildTargetsDict(data) - - # Fully qualify all dependency links. - QualifyDependencies(targets) - - # Remove self-dependencies from targets that have 'prune_self_dependencies' - # set to 1. - RemoveSelfDependencies(targets) - - # Expand dependencies specified as build_file:*. - ExpandWildcardDependencies(targets, data) - - # Remove all dependencies marked as 'link_dependency' from the targets of - # type 'none'. - RemoveLinkDependenciesFromNoneTargets(targets) - - # Apply exclude (!) and regex (/) list filters only for dependency_sections. - for target_name, target_dict in targets.items(): - tmp_dict = {} - for key_base in dependency_sections: - for op in ("", "!", "/"): - key = key_base + op - if key in target_dict: - tmp_dict[key] = target_dict[key] - del target_dict[key] - ProcessListFiltersInDict(target_name, tmp_dict) - # Write the results back to |target_dict|. - for key in tmp_dict: - target_dict[key] = tmp_dict[key] - - # Make sure every dependency appears at most once. - RemoveDuplicateDependencies(targets) - - if circular_check: - # Make sure that any targets in a.gyp don't contain dependencies in other - # .gyp files that further depend on a.gyp. - VerifyNoGYPFileCircularDependencies(targets) - - [dependency_nodes, flat_list] = BuildDependencyList(targets) - - if root_targets: - # Remove, from |targets| and |flat_list|, the targets that are not deep - # dependencies of the targets specified in |root_targets|. - targets, flat_list = PruneUnwantedTargets( - targets, flat_list, dependency_nodes, root_targets, data - ) - - # Check that no two targets in the same directory have the same name. - VerifyNoCollidingTargets(flat_list) - - # Handle dependent settings of various types. - for settings_type in [ - "all_dependent_settings", - "direct_dependent_settings", - "link_settings", - ]: - DoDependentSettings(settings_type, flat_list, targets, dependency_nodes) - - # Take out the dependent settings now that they've been published to all - # of the targets that require them. - for target in flat_list: - if settings_type in targets[target]: - del targets[target][settings_type] - - # Make sure static libraries don't declare dependencies on other static - # libraries, but that linkables depend on all unlinked static libraries - # that they need so that their link steps will be correct. - gii = generator_input_info - if gii["generator_wants_static_library_dependencies_adjusted"]: - AdjustStaticLibraryDependencies( - flat_list, - targets, - dependency_nodes, - gii["generator_wants_sorted_dependencies"], - ) - - # Apply "post"/"late"/"target" variable expansions and condition evaluations. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ProcessVariablesAndConditionsInDict( - target_dict, PHASE_LATE, variables, build_file - ) - - # Move everything that can go into a "configurations" section into one. - for target in flat_list: - target_dict = targets[target] - SetUpConfigurations(target, target_dict) - - # Apply exclude (!) and regex (/) list filters. - for target in flat_list: - target_dict = targets[target] - ProcessListFiltersInDict(target, target_dict) - - # Apply "latelate" variable expansions and condition evaluations. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ProcessVariablesAndConditionsInDict( - target_dict, PHASE_LATELATE, variables, build_file - ) - - # Make sure that the rules make sense, and build up rule_sources lists as - # needed. Not all generators will need to use the rule_sources lists, but - # some may, and it seems best to build the list in a common spot. - # Also validate actions and run_as elements in targets. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ValidateTargetType(target, target_dict) - ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) - ValidateRunAsInTarget(target, target_dict, build_file) - ValidateActionsInTarget(target, target_dict, build_file) - - # Generators might not expect ints. Turn them into strs. - TurnIntIntoStrInDict(data) - - # TODO(mark): Return |data| for now because the generator needs a list of - # build files that came in. In the future, maybe it should just accept - # a list, and not the whole data dict. - return [flat_list, targets, data] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/input_test.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/input_test.py deleted file mode 100755 index a18f72e9e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2013 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Unit tests for the input.py file.""" - -import gyp.input -import unittest - - -class TestFindCycles(unittest.TestCase): - def setUp(self): - self.nodes = {} - for x in ("a", "b", "c", "d", "e"): - self.nodes[x] = gyp.input.DependencyGraphNode(x) - - def _create_dependency(self, dependent, dependency): - dependent.dependencies.append(dependency) - dependency.dependents.append(dependent) - - def test_no_cycle_empty_graph(self): - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_no_cycle_line(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["c"]) - self._create_dependency(self.nodes["c"], self.nodes["d"]) - - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_no_cycle_dag(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["a"], self.nodes["c"]) - self._create_dependency(self.nodes["b"], self.nodes["c"]) - - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_cycle_self_reference(self): - self._create_dependency(self.nodes["a"], self.nodes["a"]) - - self.assertEqual( - [[self.nodes["a"], self.nodes["a"]]], self.nodes["a"].FindCycles() - ) - - def test_cycle_two_nodes(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["a"]) - - self.assertEqual( - [[self.nodes["a"], self.nodes["b"], self.nodes["a"]]], - self.nodes["a"].FindCycles(), - ) - self.assertEqual( - [[self.nodes["b"], self.nodes["a"], self.nodes["b"]]], - self.nodes["b"].FindCycles(), - ) - - def test_two_cycles(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["a"]) - - self._create_dependency(self.nodes["b"], self.nodes["c"]) - self._create_dependency(self.nodes["c"], self.nodes["b"]) - - cycles = self.nodes["a"].FindCycles() - self.assertTrue([self.nodes["a"], self.nodes["b"], self.nodes["a"]] in cycles) - self.assertTrue([self.nodes["b"], self.nodes["c"], self.nodes["b"]] in cycles) - self.assertEqual(2, len(cycles)) - - def test_big_cycle(self): - self._create_dependency(self.nodes["a"], self.nodes["b"]) - self._create_dependency(self.nodes["b"], self.nodes["c"]) - self._create_dependency(self.nodes["c"], self.nodes["d"]) - self._create_dependency(self.nodes["d"], self.nodes["e"]) - self._create_dependency(self.nodes["e"], self.nodes["a"]) - - self.assertEqual( - [ - [ - self.nodes["a"], - self.nodes["b"], - self.nodes["c"], - self.nodes["d"], - self.nodes["e"], - self.nodes["a"], - ] - ], - self.nodes["a"].FindCycles(), - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py deleted file mode 100755 index 59647c9a8..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +++ /dev/null @@ -1,771 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions to perform Xcode-style build steps. - -These functions are executed via gyp-mac-tool when using the Makefile generator. -""" - - -import fcntl -import fnmatch -import glob -import json -import os -import plistlib -import re -import shutil -import struct -import subprocess -import sys -import tempfile - - -def main(args): - executor = MacTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) - - -class MacTool: - """This class performs all the Mac tooling steps. The methods can either be - executed directly, or dispatched from an argument list.""" - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace("-", "") - - def ExecCopyBundleResource(self, source, dest, convert_to_binary): - """Copies a resource file to the bundle/Resources directory, performing any - necessary compilation on each resource.""" - convert_to_binary = convert_to_binary == "True" - extension = os.path.splitext(source)[1].lower() - if os.path.isdir(source): - # Copy tree. - # TODO(thakis): This copies file attributes like mtime, while the - # single-file branch below doesn't. This should probably be changed to - # be consistent with the single-file branch. - if os.path.exists(dest): - shutil.rmtree(dest) - shutil.copytree(source, dest) - elif extension == ".xib": - return self._CopyXIBFile(source, dest) - elif extension == ".storyboard": - return self._CopyXIBFile(source, dest) - elif extension == ".strings" and not convert_to_binary: - self._CopyStringsFile(source, dest) - else: - if os.path.exists(dest): - os.unlink(dest) - shutil.copy(source, dest) - - if convert_to_binary and extension in (".plist", ".strings"): - self._ConvertToBinary(dest) - - def _CopyXIBFile(self, source, dest): - """Compiles a XIB file with ibtool into a binary plist in the bundle.""" - - # ibtool sometimes crashes with relative paths. See crbug.com/314728. - base = os.path.dirname(os.path.realpath(__file__)) - if os.path.relpath(source): - source = os.path.join(base, source) - if os.path.relpath(dest): - dest = os.path.join(base, dest) - - args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"] - - if os.environ["XCODE_VERSION_ACTUAL"] > "0700": - args.extend(["--auto-activate-custom-fonts"]) - if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ: - args.extend( - [ - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - ] - ) - else: - args.extend( - [ - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - ] - ) - - args.extend( - ["--output-format", "human-readable-text", "--compile", dest, source] - ) - - ibtool_section_re = re.compile(r"/\*.*\*/") - ibtool_re = re.compile(r".*note:.*is clipping its content") - try: - stdout = subprocess.check_output(args) - except subprocess.CalledProcessError as e: - print(e.output) - raise - current_section_header = None - for line in stdout.splitlines(): - if ibtool_section_re.match(line): - current_section_header = line - elif not ibtool_re.match(line): - if current_section_header: - print(current_section_header) - current_section_header = None - print(line) - return 0 - - def _ConvertToBinary(self, dest): - subprocess.check_call( - ["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest] - ) - - def _CopyStringsFile(self, source, dest): - """Copies a .strings file using iconv to reconvert the input into UTF-16.""" - input_code = self._DetectInputEncoding(source) or "UTF-8" - - # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call - # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints - # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing - # semicolon in dictionary. - # on invalid files. Do the same kind of validation. - import CoreFoundation - - with open(source, "rb") as in_file: - s = in_file.read() - d = CoreFoundation.CFDataCreate(None, s, len(s)) - _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) - if error: - return - - with open(dest, "wb") as fp: - fp.write(s.decode(input_code).encode("UTF-16")) - - def _DetectInputEncoding(self, file_name): - """Reads the first few bytes from file_name and tries to guess the text - encoding. Returns None as a guess if it can't detect it.""" - with open(file_name, "rb") as fp: - try: - header = fp.read(3) - except Exception: - return None - if header.startswith(b"\xFE\xFF"): - return "UTF-16" - elif header.startswith(b"\xFF\xFE"): - return "UTF-16" - elif header.startswith(b"\xEF\xBB\xBF"): - return "UTF-8" - else: - return None - - def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): - """Copies the |source| Info.plist to the destination directory |dest|.""" - # Read the source Info.plist into memory. - with open(source) as fd: - lines = fd.read() - - # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). - plist = plistlib.readPlistFromString(lines) - if keys: - plist.update(json.loads(keys[0])) - lines = plistlib.writePlistToString(plist) - - # Go through all the environment variables and replace them as variables in - # the file. - IDENT_RE = re.compile(r"[_/\s]") - for key in os.environ: - if key.startswith("_"): - continue - evar = "${%s}" % key - evalue = os.environ[key] - lines = lines.replace(lines, evar, evalue) - - # Xcode supports various suffices on environment variables, which are - # all undocumented. :rfc1034identifier is used in the standard project - # template these days, and :identifier was used earlier. They are used to - # convert non-url characters into things that look like valid urls -- - # except that the replacement character for :identifier, '_' isn't valid - # in a URL either -- oops, hence :rfc1034identifier was born. - evar = "${%s:identifier}" % key - evalue = IDENT_RE.sub("_", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - evar = "${%s:rfc1034identifier}" % key - evalue = IDENT_RE.sub("-", os.environ[key]) - lines = lines.replace(lines, evar, evalue) - - # Remove any keys with values that haven't been replaced. - lines = lines.splitlines() - for i in range(len(lines)): - if lines[i].strip().startswith("${"): - lines[i] = None - lines[i - 1] = None - lines = "\n".join(line for line in lines if line is not None) - - # Write out the file with variables replaced. - with open(dest, "w") as fd: - fd.write(lines) - - # Now write out PkgInfo file now that the Info.plist file has been - # "compiled". - self._WritePkgInfo(dest) - - if convert_to_binary == "True": - self._ConvertToBinary(dest) - - def _WritePkgInfo(self, info_plist): - """This writes the PkgInfo file from the data stored in Info.plist.""" - plist = plistlib.readPlist(info_plist) - if not plist: - return - - # Only create PkgInfo for executable types. - package_type = plist["CFBundlePackageType"] - if package_type != "APPL": - return - - # The format of PkgInfo is eight characters, representing the bundle type - # and bundle signature, each four characters. If that is missing, four - # '?' characters are used instead. - signature_code = plist.get("CFBundleSignature", "????") - if len(signature_code) != 4: # Wrong length resets everything, too. - signature_code = "?" * 4 - - dest = os.path.join(os.path.dirname(info_plist), "PkgInfo") - with open(dest, "w") as fp: - fp.write(f"{package_type}{signature_code}") - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - fcntl.flock(fd, fcntl.LOCK_EX) - return subprocess.call(cmd_list) - - def ExecFilterLibtool(self, *cmd_list): - """Calls libtool and filters out '/path/to/libtool: file: foo.o has no - symbols'.""" - libtool_re = re.compile( - r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$" - ) - libtool_re5 = re.compile( - r"^.*libtool: warning for library: " - + r".* the table of contents is empty " - + r"\(no object file members in the library define global symbols\)$" - ) - env = os.environ.copy() - # Ref: - # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c - # The problem with this flag is that it resets the file mtime on the file to - # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. - env["ZERO_AR_DATE"] = "1" - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) - err = libtoolout.communicate()[1].decode("utf-8") - for line in err.splitlines(): - if not libtool_re.match(line) and not libtool_re5.match(line): - print(line, file=sys.stderr) - # Unconditionally touch the output .a file on the command line if present - # and the command succeeded. A bit hacky. - if not libtoolout.returncode: - for i in range(len(cmd_list) - 1): - if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"): - os.utime(cmd_list[i + 1], None) - break - return libtoolout.returncode - - def ExecPackageIosFramework(self, framework): - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - module_path = os.path.join(framework, "Modules") - if not os.path.exists(module_path): - os.mkdir(module_path) - module_template = ( - "framework module %s {\n" - ' umbrella header "%s.h"\n' - "\n" - " export *\n" - " module * { export * }\n" - "}\n" % (binary, binary) - ) - - with open(os.path.join(module_path, "module.modulemap"), "w") as module_file: - module_file.write(module_template) - - def ExecPackageFramework(self, framework, version): - """Takes a path to Something.framework and the Current version of that and - sets up all the symlinks.""" - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split(".")[0] - - CURRENT = "Current" - RESOURCES = "Resources" - VERSIONS = "Versions" - - if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): - # Binary-less frameworks don't seem to contain symlinks (see e.g. - # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). - return - - # Move into the framework directory to set the symlinks correctly. - pwd = os.getcwd() - os.chdir(framework) - - # Set up the Current version. - self._Relink(version, os.path.join(VERSIONS, CURRENT)) - - # Set up the root symlinks. - self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) - self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) - - # Back to where we were before! - os.chdir(pwd) - - def _Relink(self, dest, link): - """Creates a symlink to |dest| named |link|. If |link| already exists, - it is overwritten.""" - if os.path.lexists(link): - os.remove(link) - os.symlink(dest, link) - - def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): - framework_name = os.path.basename(framework).split(".")[0] - all_headers = [os.path.abspath(header) for header in all_headers] - filelist = {} - for header in all_headers: - filename = os.path.basename(header) - filelist[filename] = header - filelist[os.path.join(framework_name, filename)] = header - WriteHmap(out, filelist) - - def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers): - header_path = os.path.join(framework, "Headers") - if not os.path.exists(header_path): - os.makedirs(header_path) - for header in copy_headers: - shutil.copy(header, os.path.join(header_path, os.path.basename(header))) - - def ExecCompileXcassets(self, keys, *inputs): - """Compiles multiple .xcassets files into a single .car file. - - This invokes 'actool' to compile all the inputs .xcassets files. The - |keys| arguments is a json-encoded dictionary of extra arguments to - pass to 'actool' when the asset catalogs contains an application icon - or a launch image. - - Note that 'actool' does not create the Assets.car file if the asset - catalogs does not contains imageset. - """ - command_line = [ - "xcrun", - "actool", - "--output-format", - "human-readable-text", - "--compress-pngs", - "--notices", - "--warnings", - "--errors", - ] - is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ - if is_iphone_target: - platform = os.environ["CONFIGURATION"].split("-")[-1] - if platform not in ("iphoneos", "iphonesimulator"): - platform = "iphonesimulator" - command_line.extend( - [ - "--platform", - platform, - "--target-device", - "iphone", - "--target-device", - "ipad", - "--minimum-deployment-target", - os.environ["IPHONEOS_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]), - ] - ) - else: - command_line.extend( - [ - "--platform", - "macosx", - "--target-device", - "mac", - "--minimum-deployment-target", - os.environ["MACOSX_DEPLOYMENT_TARGET"], - "--compile", - os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]), - ] - ) - if keys: - keys = json.loads(keys) - for key, value in keys.items(): - arg_name = "--" + key - if isinstance(value, bool): - if value: - command_line.append(arg_name) - elif isinstance(value, list): - for v in value: - command_line.append(arg_name) - command_line.append(str(v)) - else: - command_line.append(arg_name) - command_line.append(str(value)) - # Note: actool crashes if inputs path are relative, so use os.path.abspath - # to get absolute path name for inputs. - command_line.extend(map(os.path.abspath, inputs)) - subprocess.check_call(command_line) - - def ExecMergeInfoPlist(self, output, *inputs): - """Merge multiple .plist files into a single .plist file.""" - merged_plist = {} - for path in inputs: - plist = self._LoadPlistMaybeBinary(path) - self._MergePlist(merged_plist, plist) - plistlib.writePlist(merged_plist, output) - - def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): - """Code sign a bundle. - - This function tries to code sign an iOS bundle, following the same - algorithm as Xcode: - 1. pick the provisioning profile that best match the bundle identifier, - and copy it into the bundle as embedded.mobileprovision, - 2. copy Entitlements.plist from user or SDK next to the bundle, - 3. code sign the bundle. - """ - substitutions, overrides = self._InstallProvisioningProfile( - provisioning, self._GetCFBundleIdentifier() - ) - entitlements_path = self._InstallEntitlements( - entitlements, substitutions, overrides - ) - - args = ["codesign", "--force", "--sign", key] - if preserve == "True": - args.extend(["--deep", "--preserve-metadata=identifier,entitlements"]) - else: - args.extend(["--entitlements", entitlements_path]) - args.extend(["--timestamp=none", path]) - subprocess.check_call(args) - - def _InstallProvisioningProfile(self, profile, bundle_identifier): - """Installs embedded.mobileprovision into the bundle. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple containing two dictionary: variables substitutions and values - to overrides when generating the entitlements file. - """ - source_path, provisioning_data, team_id = self._FindProvisioningProfile( - profile, bundle_identifier - ) - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], - os.environ["CONTENTS_FOLDER_PATH"], - "embedded.mobileprovision", - ) - shutil.copy2(source_path, target_path) - substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".") - return substitutions, provisioning_data["Entitlements"] - - def _FindProvisioningProfile(self, profile, bundle_identifier): - """Finds the .mobileprovision file to use for signing the bundle. - - Checks all the installed provisioning profiles (or if the user specified - the PROVISIONING_PROFILE variable, only consult it) and select the most - specific that correspond to the bundle identifier. - - Args: - profile: string, optional, short name of the .mobileprovision file - to use, if empty or the file is missing, the best file installed - will be used - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - - Returns: - A tuple of the path to the selected provisioning profile, the data of - the embedded plist in the provisioning profile and the team identifier - to use for code signing. - - Raises: - SystemExit: if no .mobileprovision can be used to sign the bundle. - """ - profiles_dir = os.path.join( - os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles" - ) - if not os.path.isdir(profiles_dir): - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - provisioning_profiles = None - if profile: - profile_path = os.path.join(profiles_dir, profile + ".mobileprovision") - if os.path.exists(profile_path): - provisioning_profiles = [profile_path] - if not provisioning_profiles: - provisioning_profiles = glob.glob( - os.path.join(profiles_dir, "*.mobileprovision") - ) - valid_provisioning_profiles = {} - for profile_path in provisioning_profiles: - profile_data = self._LoadProvisioningProfile(profile_path) - app_id_pattern = profile_data.get("Entitlements", {}).get( - "application-identifier", "" - ) - for team_identifier in profile_data.get("TeamIdentifier", []): - app_id = f"{team_identifier}.{bundle_identifier}" - if fnmatch.fnmatch(app_id, app_id_pattern): - valid_provisioning_profiles[app_id_pattern] = ( - profile_path, - profile_data, - team_identifier, - ) - if not valid_provisioning_profiles: - print( - "cannot find mobile provisioning for %s" % (bundle_identifier), - file=sys.stderr, - ) - sys.exit(1) - # If the user has multiple provisioning profiles installed that can be - # used for ${bundle_identifier}, pick the most specific one (ie. the - # provisioning profile whose pattern is the longest). - selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) - return valid_provisioning_profiles[selected_key] - - def _LoadProvisioningProfile(self, profile_path): - """Extracts the plist embedded in a provisioning profile. - - Args: - profile_path: string, path to the .mobileprovision file - - Returns: - Content of the plist embedded in the provisioning profile as a dictionary. - """ - with tempfile.NamedTemporaryFile() as temp: - subprocess.check_call( - ["security", "cms", "-D", "-i", profile_path, "-o", temp.name] - ) - return self._LoadPlistMaybeBinary(temp.name) - - def _MergePlist(self, merged_plist, plist): - """Merge |plist| into |merged_plist|.""" - for key, value in plist.items(): - if isinstance(value, dict): - merged_value = merged_plist.get(key, {}) - if isinstance(merged_value, dict): - self._MergePlist(merged_value, value) - merged_plist[key] = merged_value - else: - merged_plist[key] = value - else: - merged_plist[key] = value - - def _LoadPlistMaybeBinary(self, plist_path): - """Loads into a memory a plist possibly encoded in binary format. - - This is a wrapper around plistlib.readPlist that tries to convert the - plist to the XML format if it can't be parsed (assuming that it is in - the binary format). - - Args: - plist_path: string, path to a plist file, in XML or binary format - - Returns: - Content of the plist as a dictionary. - """ - try: - # First, try to read the file using plistlib that only supports XML, - # and if an exception is raised, convert a temporary copy to XML and - # load that copy. - return plistlib.readPlist(plist_path) - except Exception: - pass - with tempfile.NamedTemporaryFile() as temp: - shutil.copy2(plist_path, temp.name) - subprocess.check_call(["plutil", "-convert", "xml1", temp.name]) - return plistlib.readPlist(temp.name) - - def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): - """Constructs a dictionary of variable substitutions for Entitlements.plist. - - Args: - bundle_identifier: string, value of CFBundleIdentifier from Info.plist - app_identifier_prefix: string, value for AppIdentifierPrefix - - Returns: - Dictionary of substitutions to apply when generating Entitlements.plist. - """ - return { - "CFBundleIdentifier": bundle_identifier, - "AppIdentifierPrefix": app_identifier_prefix, - } - - def _GetCFBundleIdentifier(self): - """Extracts CFBundleIdentifier value from Info.plist in the bundle. - - Returns: - Value of CFBundleIdentifier in the Info.plist located in the bundle. - """ - info_plist_path = os.path.join( - os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"] - ) - info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) - return info_plist_data["CFBundleIdentifier"] - - def _InstallEntitlements(self, entitlements, substitutions, overrides): - """Generates and install the ${BundleName}.xcent entitlements file. - - Expands variables "$(variable)" pattern in the source entitlements file, - add extra entitlements defined in the .mobileprovision file and the copy - the generated plist to "${BundlePath}.xcent". - - Args: - entitlements: string, optional, path to the Entitlements.plist template - to use, defaults to "${SDKROOT}/Entitlements.plist" - substitutions: dictionary, variable substitutions - overrides: dictionary, values to add to the entitlements - - Returns: - Path to the generated entitlements file. - """ - source_path = entitlements - target_path = os.path.join( - os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent" - ) - if not source_path: - source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist") - shutil.copy2(source_path, target_path) - data = self._LoadPlistMaybeBinary(target_path) - data = self._ExpandVariables(data, substitutions) - if overrides: - for key in overrides: - if key not in data: - data[key] = overrides[key] - plistlib.writePlist(data, target_path) - return target_path - - def _ExpandVariables(self, data, substitutions): - """Expands variables "$(variable)" in data. - - Args: - data: object, can be either string, list or dictionary - substitutions: dictionary, variable substitutions to perform - - Returns: - Copy of data where each references to "$(variable)" has been replaced - by the corresponding value found in substitutions, or left intact if - the key was not found. - """ - if isinstance(data, str): - for key, value in substitutions.items(): - data = data.replace("$(%s)" % key, value) - return data - if isinstance(data, list): - return [self._ExpandVariables(v, substitutions) for v in data] - if isinstance(data, dict): - return {k: self._ExpandVariables(data[k], substitutions) for k in data} - return data - - -def NextGreaterPowerOf2(x): - return 2 ** (x).bit_length() - - -def WriteHmap(output_name, filelist): - """Generates a header map based on |filelist|. - - Per Mark Mentovai: - A header map is structured essentially as a hash table, keyed by names used - in #includes, and providing pathnames to the actual files. - - The implementation below and the comment above comes from inspecting: - http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt - while also looking at the implementation in clang in: - https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp - """ - magic = 1751998832 - version = 1 - _reserved = 0 - count = len(filelist) - capacity = NextGreaterPowerOf2(count) - strings_offset = 24 + (12 * capacity) - max_value_length = max(len(value) for value in filelist.values()) - - out = open(output_name, "wb") - out.write( - struct.pack( - " 0 or arg.count("/") > 1: - arg = os.path.normpath(arg) - - # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes - # preceding it, and results in n backslashes + the quote. So we substitute - # in 2* what we match, +1 more, plus the quote. - if quote_cmd: - arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg) - - # %'s also need to be doubled otherwise they're interpreted as batch - # positional arguments. Also make sure to escape the % so that they're - # passed literally through escaping so they can be singled to just the - # original %. Otherwise, trying to pass the literal representation that - # looks like an environment variable to the shell (e.g. %PATH%) would fail. - arg = arg.replace("%", "%%") - - # These commands are used in rsp files, so no escaping for the shell (via ^) - # is necessary. - - # As a workaround for programs that don't use CommandLineToArgvW, gyp - # supports msvs_quote_cmd=0, which simply disables all quoting. - if quote_cmd: - # Finally, wrap the whole thing in quotes so that the above quote rule - # applies and whitespace isn't a word break. - return f'"{arg}"' - - return arg - - -def EncodeRspFileList(args, quote_cmd): - """Process a list of arguments using QuoteCmdExeArgument.""" - # Note that the first argument is assumed to be the command. Don't add - # quotes around it because then built-ins like 'echo', etc. won't work. - # Take care to normpath only the path in the case of 'call ../x.bat' because - # otherwise the whole thing is incorrectly interpreted as a path and not - # normalized correctly. - if not args: - return "" - if args[0].startswith("call "): - call, program = args[0].split(" ", 1) - program = call + " " + os.path.normpath(program) - else: - program = os.path.normpath(args[0]) - return (program + " " - + " ".join(QuoteForRspFile(arg, quote_cmd) for arg in args[1:])) - - -def _GenericRetrieve(root, default, path): - """Given a list of dictionary keys |path| and a tree of dicts |root|, find - value at path, or return |default| if any of the path doesn't exist.""" - if not root: - return default - if not path: - return root - return _GenericRetrieve(root.get(path[0]), default, path[1:]) - - -def _AddPrefix(element, prefix): - """Add |prefix| to |element| or each subelement if element is iterable.""" - if element is None: - return element - # Note, not Iterable because we don't want to handle strings like that. - if isinstance(element, list) or isinstance(element, tuple): - return [prefix + e for e in element] - else: - return prefix + element - - -def _DoRemapping(element, map): - """If |element| then remap it through |map|. If |element| is iterable then - each item will be remapped. Any elements not found will be removed.""" - if map is not None and element is not None: - if not callable(map): - map = map.get # Assume it's a dict, otherwise a callable to do the remap. - if isinstance(element, list) or isinstance(element, tuple): - element = filter(None, [map(elem) for elem in element]) - else: - element = map(element) - return element - - -def _AppendOrReturn(append, element): - """If |append| is None, simply return |element|. If |append| is not None, - then add |element| to it, adding each item in |element| if it's a list or - tuple.""" - if append is not None and element is not None: - if isinstance(element, list) or isinstance(element, tuple): - append.extend(element) - else: - append.append(element) - else: - return element - - -def _FindDirectXInstallation(): - """Try to find an installation location for the DirectX SDK. Check for the - standard environment variable, and if that doesn't exist, try to find - via the registry. May return None if not found in either location.""" - # Return previously calculated value, if there is one - if hasattr(_FindDirectXInstallation, "dxsdk_dir"): - return _FindDirectXInstallation.dxsdk_dir - - dxsdk_dir = os.environ.get("DXSDK_DIR") - if not dxsdk_dir: - # Setup params to pass to and attempt to launch reg.exe. - cmd = ["reg.exe", "query", r"HKLM\Software\Microsoft\DirectX", "/s"] - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout = p.communicate()[0].decode("utf-8") - for line in stdout.splitlines(): - if "InstallPath" in line: - dxsdk_dir = line.split(" ")[3] + "\\" - - # Cache return value - _FindDirectXInstallation.dxsdk_dir = dxsdk_dir - return dxsdk_dir - - -def GetGlobalVSMacroEnv(vs_version): - """Get a dict of variables mapping internal VS macro names to their gyp - equivalents. Returns all variables that are independent of the target.""" - env = {} - # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when - # Visual Studio is actually installed. - if vs_version.Path(): - env["$(VSInstallDir)"] = vs_version.Path() - env["$(VCInstallDir)"] = os.path.join(vs_version.Path(), "VC") + "\\" - # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be - # set. This happens when the SDK is sync'd via src-internal, rather than - # by typical end-user installation of the SDK. If it's not set, we don't - # want to leave the unexpanded variable in the path, so simply strip it. - dxsdk_dir = _FindDirectXInstallation() - env["$(DXSDK_DIR)"] = dxsdk_dir if dxsdk_dir else "" - # Try to find an installation location for the Windows DDK by checking - # the WDK_DIR environment variable, may be None. - env["$(WDK_DIR)"] = os.environ.get("WDK_DIR", "") - return env - - -def ExtractSharedMSVSSystemIncludes(configs, generator_flags): - """Finds msvs_system_include_dirs that are common to all targets, removes - them from all targets, and returns an OrderedSet containing them.""" - all_system_includes = OrderedSet(configs[0].get("msvs_system_include_dirs", [])) - for config in configs[1:]: - system_includes = config.get("msvs_system_include_dirs", []) - all_system_includes = all_system_includes & OrderedSet(system_includes) - if not all_system_includes: - return None - # Expand macros in all_system_includes. - env = GetGlobalVSMacroEnv(GetVSVersion(generator_flags)) - expanded_system_includes = OrderedSet( - [ExpandMacros(include, env) for include in all_system_includes] - ) - if any(["$" in include for include in expanded_system_includes]): - # Some path relies on target-specific variables, bail. - return None - - # Remove system includes shared by all targets from the targets. - for config in configs: - includes = config.get("msvs_system_include_dirs", []) - if includes: # Don't insert a msvs_system_include_dirs key if not needed. - # This must check the unexpanded includes list: - new_includes = [i for i in includes if i not in all_system_includes] - config["msvs_system_include_dirs"] = new_includes - return expanded_system_includes - - -class MsvsSettings: - """A class that understands the gyp 'msvs_...' values (especially the - msvs_settings field). They largely correpond to the VS2008 IDE DOM. This - class helps map those settings to command line options.""" - - def __init__(self, spec, generator_flags): - self.spec = spec - self.vs_version = GetVSVersion(generator_flags) - - supported_fields = [ - ("msvs_configuration_attributes", dict), - ("msvs_settings", dict), - ("msvs_system_include_dirs", list), - ("msvs_disabled_warnings", list), - ("msvs_precompiled_header", str), - ("msvs_precompiled_source", str), - ("msvs_configuration_platform", str), - ("msvs_target_platform", str), - ] - configs = spec["configurations"] - for field, default in supported_fields: - setattr(self, field, {}) - for configname, config in configs.items(): - getattr(self, field)[configname] = config.get(field, default()) - - self.msvs_cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."]) - - unsupported_fields = [ - "msvs_prebuild", - "msvs_postbuild", - ] - unsupported = [] - for field in unsupported_fields: - for config in configs.values(): - if field in config: - unsupported += [ - "{} not supported (target {}).".format( - field, spec["target_name"] - ) - ] - if unsupported: - raise Exception("\n".join(unsupported)) - - def GetExtension(self): - """Returns the extension for the target, with no leading dot. - - Uses 'product_extension' if specified, otherwise uses MSVS defaults based on - the target type. - """ - ext = self.spec.get("product_extension", None) - if ext: - return ext - return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec["type"], "") - - def GetVSMacroEnv(self, base_to_build=None, config=None): - """Get a dict of variables mapping internal VS macro names to their gyp - equivalents.""" - target_arch = self.GetArch(config) - if target_arch == "x86": - target_platform = "Win32" - else: - target_platform = target_arch - target_name = self.spec.get("product_prefix", "") + self.spec.get( - "product_name", self.spec["target_name"] - ) - target_dir = base_to_build + "\\" if base_to_build else "" - target_ext = "." + self.GetExtension() - target_file_name = target_name + target_ext - - replacements = { - "$(InputName)": "${root}", - "$(InputPath)": "${source}", - "$(IntDir)": "$!INTERMEDIATE_DIR", - "$(OutDir)\\": target_dir, - "$(PlatformName)": target_platform, - "$(ProjectDir)\\": "", - "$(ProjectName)": self.spec["target_name"], - "$(TargetDir)\\": target_dir, - "$(TargetExt)": target_ext, - "$(TargetFileName)": target_file_name, - "$(TargetName)": target_name, - "$(TargetPath)": os.path.join(target_dir, target_file_name), - } - replacements.update(GetGlobalVSMacroEnv(self.vs_version)) - return replacements - - def ConvertVSMacros(self, s, base_to_build=None, config=None): - """Convert from VS macro names to something equivalent.""" - env = self.GetVSMacroEnv(base_to_build, config=config) - return ExpandMacros(s, env) - - def AdjustLibraries(self, libraries): - """Strip -l from library if it's specified with that.""" - libs = [lib[2:] if lib.startswith("-l") else lib for lib in libraries] - return [ - lib + ".lib" - if not lib.lower().endswith(".lib") and not lib.lower().endswith(".obj") - else lib - for lib in libs - ] - - def _GetAndMunge(self, field, path, default, prefix, append, map): - """Retrieve a value from |field| at |path| or return |default|. If - |append| is specified, and the item is found, it will be appended to that - object instead of returned. If |map| is specified, results will be - remapped through |map| before being returned or appended.""" - result = _GenericRetrieve(field, default, path) - result = _DoRemapping(result, map) - result = _AddPrefix(result, prefix) - return _AppendOrReturn(append, result) - - class _GetWrapper: - def __init__(self, parent, field, base_path, append=None): - self.parent = parent - self.field = field - self.base_path = [base_path] - self.append = append - - def __call__(self, name, map=None, prefix="", default=None): - return self.parent._GetAndMunge( - self.field, - self.base_path + [name], - default=default, - prefix=prefix, - append=self.append, - map=map, - ) - - def GetArch(self, config): - """Get architecture based on msvs_configuration_platform and - msvs_target_platform. Returns either 'x86' or 'x64'.""" - configuration_platform = self.msvs_configuration_platform.get(config, "") - platform = self.msvs_target_platform.get(config, "") - if not platform: # If no specific override, use the configuration's. - platform = configuration_platform - # Map from platform to architecture. - return {"Win32": "x86", "x64": "x64", "ARM64": "arm64"}.get(platform, "x86") - - def _TargetConfig(self, config): - """Returns the target-specific configuration.""" - # There's two levels of architecture/platform specification in VS. The - # first level is globally for the configuration (this is what we consider - # "the" config at the gyp level, which will be something like 'Debug' or - # 'Release'), VS2015 and later only use this level - if int(self.vs_version.short_name) >= 2015: - return config - # and a second target-specific configuration, which is an - # override for the global one. |config| is remapped here to take into - # account the local target-specific overrides to the global configuration. - arch = self.GetArch(config) - if arch == "x64" and not config.endswith("_x64"): - config += "_x64" - if arch == "x86" and config.endswith("_x64"): - config = config.rsplit("_", 1)[0] - return config - - def _Setting(self, path, config, default=None, prefix="", append=None, map=None): - """_GetAndMunge for msvs_settings.""" - return self._GetAndMunge( - self.msvs_settings[config], path, default, prefix, append, map - ) - - def _ConfigAttrib( - self, path, config, default=None, prefix="", append=None, map=None - ): - """_GetAndMunge for msvs_configuration_attributes.""" - return self._GetAndMunge( - self.msvs_configuration_attributes[config], - path, - default, - prefix, - append, - map, - ) - - def AdjustIncludeDirs(self, include_dirs, config): - """Updates include_dirs to expand VS specific paths, and adds the system - include dirs used for platform SDK and similar.""" - config = self._TargetConfig(config) - includes = include_dirs + self.msvs_system_include_dirs[config] - includes.extend( - self._Setting( - ("VCCLCompilerTool", "AdditionalIncludeDirectories"), config, default=[] - ) - ) - return [self.ConvertVSMacros(p, config=config) for p in includes] - - def AdjustMidlIncludeDirs(self, midl_include_dirs, config): - """Updates midl_include_dirs to expand VS specific paths, and adds the - system include dirs used for platform SDK and similar.""" - config = self._TargetConfig(config) - includes = midl_include_dirs + self.msvs_system_include_dirs[config] - includes.extend( - self._Setting( - ("VCMIDLTool", "AdditionalIncludeDirectories"), config, default=[] - ) - ) - return [self.ConvertVSMacros(p, config=config) for p in includes] - - def GetComputedDefines(self, config): - """Returns the set of defines that are injected to the defines list based - on other VS settings.""" - config = self._TargetConfig(config) - defines = [] - if self._ConfigAttrib(["CharacterSet"], config) == "1": - defines.extend(("_UNICODE", "UNICODE")) - if self._ConfigAttrib(["CharacterSet"], config) == "2": - defines.append("_MBCS") - defines.extend( - self._Setting( - ("VCCLCompilerTool", "PreprocessorDefinitions"), config, default=[] - ) - ) - return defines - - def GetCompilerPdbName(self, config, expand_special): - """Get the pdb file name that should be used for compiler invocations, or - None if there's no explicit name specified.""" - config = self._TargetConfig(config) - pdbname = self._Setting(("VCCLCompilerTool", "ProgramDataBaseFileName"), config) - if pdbname: - pdbname = expand_special(self.ConvertVSMacros(pdbname)) - return pdbname - - def GetMapFileName(self, config, expand_special): - """Gets the explicitly overridden map file name for a target or returns None - if it's not set.""" - config = self._TargetConfig(config) - map_file = self._Setting(("VCLinkerTool", "MapFileName"), config) - if map_file: - map_file = expand_special(self.ConvertVSMacros(map_file, config=config)) - return map_file - - def GetOutputName(self, config, expand_special): - """Gets the explicitly overridden output name for a target or returns None - if it's not overridden.""" - config = self._TargetConfig(config) - type = self.spec["type"] - root = "VCLibrarianTool" if type == "static_library" else "VCLinkerTool" - # TODO(scottmg): Handle OutputDirectory without OutputFile. - output_file = self._Setting((root, "OutputFile"), config) - if output_file: - output_file = expand_special( - self.ConvertVSMacros(output_file, config=config) - ) - return output_file - - def GetPDBName(self, config, expand_special, default): - """Gets the explicitly overridden pdb name for a target or returns - default if it's not overridden, or if no pdb will be generated.""" - config = self._TargetConfig(config) - output_file = self._Setting(("VCLinkerTool", "ProgramDatabaseFile"), config) - generate_debug_info = self._Setting( - ("VCLinkerTool", "GenerateDebugInformation"), config - ) - if generate_debug_info == "true": - if output_file: - return expand_special(self.ConvertVSMacros(output_file, config=config)) - else: - return default - else: - return None - - def GetNoImportLibrary(self, config): - """If NoImportLibrary: true, ninja will not expect the output to include - an import library.""" - config = self._TargetConfig(config) - noimplib = self._Setting(("NoImportLibrary",), config) - return noimplib == "true" - - def GetAsmflags(self, config): - """Returns the flags that need to be added to ml invocations.""" - config = self._TargetConfig(config) - asmflags = [] - safeseh = self._Setting(("MASM", "UseSafeExceptionHandlers"), config) - if safeseh == "true": - asmflags.append("/safeseh") - return asmflags - - def GetCflags(self, config): - """Returns the flags that need to be added to .c and .cc compilations.""" - config = self._TargetConfig(config) - cflags = [] - cflags.extend(["/wd" + w for w in self.msvs_disabled_warnings[config]]) - cl = self._GetWrapper( - self, self.msvs_settings[config], "VCCLCompilerTool", append=cflags - ) - cl( - "Optimization", - map={"0": "d", "1": "1", "2": "2", "3": "x"}, - prefix="/O", - default="2", - ) - cl("InlineFunctionExpansion", prefix="/Ob") - cl("DisableSpecificWarnings", prefix="/wd") - cl("StringPooling", map={"true": "/GF"}) - cl("EnableFiberSafeOptimizations", map={"true": "/GT"}) - cl("OmitFramePointers", map={"false": "-", "true": ""}, prefix="/Oy") - cl("EnableIntrinsicFunctions", map={"false": "-", "true": ""}, prefix="/Oi") - cl("FavorSizeOrSpeed", map={"1": "t", "2": "s"}, prefix="/O") - cl( - "FloatingPointModel", - map={"0": "precise", "1": "strict", "2": "fast"}, - prefix="/fp:", - default="0", - ) - cl("CompileAsManaged", map={"false": "", "true": "/clr"}) - cl("WholeProgramOptimization", map={"true": "/GL"}) - cl("WarningLevel", prefix="/W") - cl("WarnAsError", map={"true": "/WX"}) - cl( - "CallingConvention", - map={"0": "d", "1": "r", "2": "z", "3": "v"}, - prefix="/G", - ) - cl("DebugInformationFormat", map={"1": "7", "3": "i", "4": "I"}, prefix="/Z") - cl("RuntimeTypeInfo", map={"true": "/GR", "false": "/GR-"}) - cl("EnableFunctionLevelLinking", map={"true": "/Gy", "false": "/Gy-"}) - cl("MinimalRebuild", map={"true": "/Gm"}) - cl("BufferSecurityCheck", map={"true": "/GS", "false": "/GS-"}) - cl("BasicRuntimeChecks", map={"1": "s", "2": "u", "3": "1"}, prefix="/RTC") - cl( - "RuntimeLibrary", - map={"0": "T", "1": "Td", "2": "D", "3": "Dd"}, - prefix="/M", - ) - cl("ExceptionHandling", map={"1": "sc", "2": "a"}, prefix="/EH") - cl("DefaultCharIsUnsigned", map={"true": "/J"}) - cl( - "TreatWChar_tAsBuiltInType", - map={"false": "-", "true": ""}, - prefix="/Zc:wchar_t", - ) - cl("EnablePREfast", map={"true": "/analyze"}) - cl("AdditionalOptions", prefix="") - cl( - "EnableEnhancedInstructionSet", - map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2"}, - prefix="/arch:", - ) - cflags.extend( - [ - "/FI" + f - for f in self._Setting( - ("VCCLCompilerTool", "ForcedIncludeFiles"), config, default=[] - ) - ] - ) - if float(self.vs_version.project_version) >= 12.0: - # New flag introduced in VS2013 (project version 12.0) Forces writes to - # the program database (PDB) to be serialized through MSPDBSRV.EXE. - # https://msdn.microsoft.com/en-us/library/dn502518.aspx - cflags.append("/FS") - # ninja handles parallelism by itself, don't have the compiler do it too. - cflags = [x for x in cflags if not x.startswith("/MP")] - return cflags - - def _GetPchFlags(self, config, extension): - """Get the flags to be added to the cflags for precompiled header support.""" - config = self._TargetConfig(config) - # The PCH is only built once by a particular source file. Usage of PCH must - # only be for the same language (i.e. C vs. C++), so only include the pch - # flags when the language matches. - if self.msvs_precompiled_header[config]: - source_ext = os.path.splitext(self.msvs_precompiled_source[config])[1] - if _LanguageMatchesForPch(source_ext, extension): - pch = self.msvs_precompiled_header[config] - pchbase = os.path.split(pch)[1] - return ["/Yu" + pch, "/FI" + pch, "/Fp${pchprefix}." + pchbase + ".pch"] - return [] - - def GetCflagsC(self, config): - """Returns the flags that need to be added to .c compilations.""" - config = self._TargetConfig(config) - return self._GetPchFlags(config, ".c") - - def GetCflagsCC(self, config): - """Returns the flags that need to be added to .cc compilations.""" - config = self._TargetConfig(config) - return ["/TP"] + self._GetPchFlags(config, ".cc") - - def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path): - """Get and normalize the list of paths in AdditionalLibraryDirectories - setting.""" - config = self._TargetConfig(config) - libpaths = self._Setting( - (root, "AdditionalLibraryDirectories"), config, default=[] - ) - libpaths = [ - os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(p, config=config))) - for p in libpaths - ] - return ['/LIBPATH:"' + p + '"' for p in libpaths] - - def GetLibFlags(self, config, gyp_to_build_path): - """Returns the flags that need to be added to lib commands.""" - config = self._TargetConfig(config) - libflags = [] - lib = self._GetWrapper( - self, self.msvs_settings[config], "VCLibrarianTool", append=libflags - ) - libflags.extend( - self._GetAdditionalLibraryDirectories( - "VCLibrarianTool", config, gyp_to_build_path - ) - ) - lib("LinkTimeCodeGeneration", map={"true": "/LTCG"}) - lib( - "TargetMachine", - map={"1": "X86", "17": "X64", "3": "ARM"}, - prefix="/MACHINE:", - ) - lib("AdditionalOptions") - return libflags - - def GetDefFile(self, gyp_to_build_path): - """Returns the .def file from sources, if any. Otherwise returns None.""" - spec = self.spec - if spec["type"] in ("shared_library", "loadable_module", "executable"): - def_files = [ - s for s in spec.get("sources", []) if s.lower().endswith(".def") - ] - if len(def_files) == 1: - return gyp_to_build_path(def_files[0]) - elif len(def_files) > 1: - raise Exception("Multiple .def files") - return None - - def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path): - """.def files get implicitly converted to a ModuleDefinitionFile for the - linker in the VS generator. Emulate that behaviour here.""" - def_file = self.GetDefFile(gyp_to_build_path) - if def_file: - ldflags.append('/DEF:"%s"' % def_file) - - def GetPGDName(self, config, expand_special): - """Gets the explicitly overridden pgd name for a target or returns None - if it's not overridden.""" - config = self._TargetConfig(config) - output_file = self._Setting(("VCLinkerTool", "ProfileGuidedDatabase"), config) - if output_file: - output_file = expand_special( - self.ConvertVSMacros(output_file, config=config) - ) - return output_file - - def GetLdflags( - self, - config, - gyp_to_build_path, - expand_special, - manifest_base_name, - output_name, - is_executable, - build_dir, - ): - """Returns the flags that need to be added to link commands, and the - manifest files.""" - config = self._TargetConfig(config) - ldflags = [] - ld = self._GetWrapper( - self, self.msvs_settings[config], "VCLinkerTool", append=ldflags - ) - self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) - ld("GenerateDebugInformation", map={"true": "/DEBUG"}) - # TODO: These 'map' values come from machineTypeOption enum, - # and does not have an official value for ARM64 in VS2017 (yet). - # It needs to verify the ARM64 value when machineTypeOption is updated. - ld( - "TargetMachine", - map={"1": "X86", "17": "X64", "3": "ARM", "18": "ARM64"}, - prefix="/MACHINE:", - ) - ldflags.extend( - self._GetAdditionalLibraryDirectories( - "VCLinkerTool", config, gyp_to_build_path - ) - ) - ld("DelayLoadDLLs", prefix="/DELAYLOAD:") - ld("TreatLinkerWarningAsErrors", prefix="/WX", map={"true": "", "false": ":NO"}) - out = self.GetOutputName(config, expand_special) - if out: - ldflags.append("/OUT:" + out) - pdb = self.GetPDBName(config, expand_special, output_name + ".pdb") - if pdb: - ldflags.append("/PDB:" + pdb) - pgd = self.GetPGDName(config, expand_special) - if pgd: - ldflags.append("/PGD:" + pgd) - map_file = self.GetMapFileName(config, expand_special) - ld("GenerateMapFile", map={"true": "/MAP:" + map_file if map_file else "/MAP"}) - ld("MapExports", map={"true": "/MAPINFO:EXPORTS"}) - ld("AdditionalOptions", prefix="") - - minimum_required_version = self._Setting( - ("VCLinkerTool", "MinimumRequiredVersion"), config, default="" - ) - if minimum_required_version: - minimum_required_version = "," + minimum_required_version - ld( - "SubSystem", - map={ - "1": "CONSOLE%s" % minimum_required_version, - "2": "WINDOWS%s" % minimum_required_version, - }, - prefix="/SUBSYSTEM:", - ) - - stack_reserve_size = self._Setting( - ("VCLinkerTool", "StackReserveSize"), config, default="" - ) - if stack_reserve_size: - stack_commit_size = self._Setting( - ("VCLinkerTool", "StackCommitSize"), config, default="" - ) - if stack_commit_size: - stack_commit_size = "," + stack_commit_size - ldflags.append(f"/STACK:{stack_reserve_size}{stack_commit_size}") - - ld("TerminalServerAware", map={"1": ":NO", "2": ""}, prefix="/TSAWARE") - ld("LinkIncremental", map={"1": ":NO", "2": ""}, prefix="/INCREMENTAL") - ld("BaseAddress", prefix="/BASE:") - ld("FixedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/FIXED") - ld("RandomizedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/DYNAMICBASE") - ld("DataExecutionPrevention", map={"1": ":NO", "2": ""}, prefix="/NXCOMPAT") - ld("OptimizeReferences", map={"1": "NOREF", "2": "REF"}, prefix="/OPT:") - ld("ForceSymbolReferences", prefix="/INCLUDE:") - ld("EnableCOMDATFolding", map={"1": "NOICF", "2": "ICF"}, prefix="/OPT:") - ld( - "LinkTimeCodeGeneration", - map={"1": "", "2": ":PGINSTRUMENT", "3": ":PGOPTIMIZE", "4": ":PGUPDATE"}, - prefix="/LTCG", - ) - ld("IgnoreDefaultLibraryNames", prefix="/NODEFAULTLIB:") - ld("ResourceOnlyDLL", map={"true": "/NOENTRY"}) - ld("EntryPointSymbol", prefix="/ENTRY:") - ld("Profile", map={"true": "/PROFILE"}) - ld("LargeAddressAware", map={"1": ":NO", "2": ""}, prefix="/LARGEADDRESSAWARE") - # TODO(scottmg): This should sort of be somewhere else (not really a flag). - ld("AdditionalDependencies", prefix="") - - if self.GetArch(config) == "x86": - safeseh_default = "true" - else: - safeseh_default = None - ld( - "ImageHasSafeExceptionHandlers", - map={"false": ":NO", "true": ""}, - prefix="/SAFESEH", - default=safeseh_default, - ) - - # If the base address is not specifically controlled, DYNAMICBASE should - # be on by default. - if not any("DYNAMICBASE" in flag or flag == "/FIXED" for flag in ldflags): - ldflags.append("/DYNAMICBASE") - - # If the NXCOMPAT flag has not been specified, default to on. Despite the - # documentation that says this only defaults to on when the subsystem is - # Vista or greater (which applies to the linker), the IDE defaults it on - # unless it's explicitly off. - if not any("NXCOMPAT" in flag for flag in ldflags): - ldflags.append("/NXCOMPAT") - - have_def_file = any(flag.startswith("/DEF:") for flag in ldflags) - ( - manifest_flags, - intermediate_manifest, - manifest_files, - ) = self._GetLdManifestFlags( - config, - manifest_base_name, - gyp_to_build_path, - is_executable and not have_def_file, - build_dir, - ) - ldflags.extend(manifest_flags) - return ldflags, intermediate_manifest, manifest_files - - def _GetLdManifestFlags( - self, config, name, gyp_to_build_path, allow_isolation, build_dir - ): - """Returns a 3-tuple: - - the set of flags that need to be added to the link to generate - a default manifest - - the intermediate manifest that the linker will generate that should be - used to assert it doesn't add anything to the merged one. - - the list of all the manifest files to be merged by the manifest tool and - included into the link.""" - generate_manifest = self._Setting( - ("VCLinkerTool", "GenerateManifest"), config, default="true" - ) - if generate_manifest != "true": - # This means not only that the linker should not generate the intermediate - # manifest but also that the manifest tool should do nothing even when - # additional manifests are specified. - return ["/MANIFEST:NO"], [], [] - - output_name = name + ".intermediate.manifest" - flags = [ - "/MANIFEST", - "/ManifestFile:" + output_name, - ] - - # Instead of using the MANIFESTUAC flags, we generate a .manifest to - # include into the list of manifests. This allows us to avoid the need to - # do two passes during linking. The /MANIFEST flag and /ManifestFile are - # still used, and the intermediate manifest is used to assert that the - # final manifest we get from merging all the additional manifest files - # (plus the one we generate here) isn't modified by merging the - # intermediate into it. - - # Always NO, because we generate a manifest file that has what we want. - flags.append("/MANIFESTUAC:NO") - - config = self._TargetConfig(config) - enable_uac = self._Setting( - ("VCLinkerTool", "EnableUAC"), config, default="true" - ) - manifest_files = [] - generated_manifest_outer = ( - "" - "" - "%s" - ) - if enable_uac == "true": - execution_level = self._Setting( - ("VCLinkerTool", "UACExecutionLevel"), config, default="0" - ) - execution_level_map = { - "0": "asInvoker", - "1": "highestAvailable", - "2": "requireAdministrator", - } - - ui_access = self._Setting( - ("VCLinkerTool", "UACUIAccess"), config, default="false" - ) - - inner = """ - - - - - - -""".format( - execution_level_map[execution_level], - ui_access, - ) - else: - inner = "" - - generated_manifest_contents = generated_manifest_outer % inner - generated_name = name + ".generated.manifest" - # Need to join with the build_dir here as we're writing it during - # generation time, but we return the un-joined version because the build - # will occur in that directory. We only write the file if the contents - # have changed so that simply regenerating the project files doesn't - # cause a relink. - build_dir_generated_name = os.path.join(build_dir, generated_name) - gyp.common.EnsureDirExists(build_dir_generated_name) - f = gyp.common.WriteOnDiff(build_dir_generated_name) - f.write(generated_manifest_contents) - f.close() - manifest_files = [generated_name] - - if allow_isolation: - flags.append("/ALLOWISOLATION") - - manifest_files += self._GetAdditionalManifestFiles(config, gyp_to_build_path) - return flags, output_name, manifest_files - - def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): - """Gets additional manifest files that are added to the default one - generated by the linker.""" - files = self._Setting( - ("VCManifestTool", "AdditionalManifestFiles"), config, default=[] - ) - if isinstance(files, str): - files = files.split(";") - return [ - os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(f, config=config))) - for f in files - ] - - def IsUseLibraryDependencyInputs(self, config): - """Returns whether the target should be linked via Use Library Dependency - Inputs (using component .objs of a given .lib).""" - config = self._TargetConfig(config) - uldi = self._Setting(("VCLinkerTool", "UseLibraryDependencyInputs"), config) - return uldi == "true" - - def IsEmbedManifest(self, config): - """Returns whether manifest should be linked into binary.""" - config = self._TargetConfig(config) - embed = self._Setting( - ("VCManifestTool", "EmbedManifest"), config, default="true" - ) - return embed == "true" - - def IsLinkIncremental(self, config): - """Returns whether the target should be linked incrementally.""" - config = self._TargetConfig(config) - link_inc = self._Setting(("VCLinkerTool", "LinkIncremental"), config) - return link_inc != "1" - - def GetRcflags(self, config, gyp_to_ninja_path): - """Returns the flags that need to be added to invocations of the resource - compiler.""" - config = self._TargetConfig(config) - rcflags = [] - rc = self._GetWrapper( - self, self.msvs_settings[config], "VCResourceCompilerTool", append=rcflags - ) - rc("AdditionalIncludeDirectories", map=gyp_to_ninja_path, prefix="/I") - rcflags.append("/I" + gyp_to_ninja_path(".")) - rc("PreprocessorDefinitions", prefix="/d") - # /l arg must be in hex without leading '0x' - rc("Culture", prefix="/l", map=lambda x: hex(int(x))[2:]) - return rcflags - - def BuildCygwinBashCommandLine(self, args, path_to_base): - """Build a command line that runs args via cygwin bash. We assume that all - incoming paths are in Windows normpath'd form, so they need to be - converted to posix style for the part of the command line that's passed to - bash. We also have to do some Visual Studio macro emulation here because - various rules use magic VS names for things. Also note that rules that - contain ninja variables cannot be fixed here (for example ${source}), so - the outer generator needs to make sure that the paths that are written out - are in posix style, if the command line will be used here.""" - cygwin_dir = os.path.normpath( - os.path.join(path_to_base, self.msvs_cygwin_dirs[0]) - ) - cd = ("cd %s" % path_to_base).replace("\\", "/") - args = [a.replace("\\", "/").replace('"', '\\"') for a in args] - args = ["'%s'" % a.replace("'", "'\\''") for a in args] - bash_cmd = " ".join(args) - cmd = ( - 'call "%s\\setup_env.bat" && set CYGWIN=nontsec && ' % cygwin_dir - + f'bash -c "{cd} ; {bash_cmd}"' - ) - return cmd - - RuleShellFlags = collections.namedtuple("RuleShellFlags", ["cygwin", "quote"]) - - def GetRuleShellFlags(self, rule): - """Return RuleShellFlags about how the given rule should be run. This - includes whether it should run under cygwin (msvs_cygwin_shell), and - whether the commands should be quoted (msvs_quote_cmd).""" - # If the variable is unset, or set to 1 we use cygwin - cygwin = int(rule.get("msvs_cygwin_shell", - self.spec.get("msvs_cygwin_shell", 1))) != 0 - # Default to quoting. There's only a few special instances where the - # target command uses non-standard command line parsing and handle quotes - # and quote escaping differently. - quote_cmd = int(rule.get("msvs_quote_cmd", 1)) - assert quote_cmd != 0 or cygwin != 1, \ - "msvs_quote_cmd=0 only applicable for msvs_cygwin_shell=0" - return MsvsSettings.RuleShellFlags(cygwin, quote_cmd) - - def _HasExplicitRuleForExtension(self, spec, extension): - """Determine if there's an explicit rule for a particular extension.""" - for rule in spec.get("rules", []): - if rule["extension"] == extension: - return True - return False - - def _HasExplicitIdlActions(self, spec): - """Determine if an action should not run midl for .idl files.""" - return any( - [action.get("explicit_idl_action", 0) for action in spec.get("actions", [])] - ) - - def HasExplicitIdlRulesOrActions(self, spec): - """Determine if there's an explicit rule or action for idl files. When - there isn't we need to generate implicit rules to build MIDL .idl files.""" - return self._HasExplicitRuleForExtension( - spec, "idl" - ) or self._HasExplicitIdlActions(spec) - - def HasExplicitAsmRules(self, spec): - """Determine if there's an explicit rule for asm files. When there isn't we - need to generate implicit rules to assemble .asm files.""" - return self._HasExplicitRuleForExtension(spec, "asm") - - def GetIdlBuildData(self, source, config): - """Determine the implicit outputs for an idl file. Returns output - directory, outputs, and variables and flags that are required.""" - config = self._TargetConfig(config) - midl_get = self._GetWrapper(self, self.msvs_settings[config], "VCMIDLTool") - - def midl(name, default=None): - return self.ConvertVSMacros(midl_get(name, default=default), config=config) - - tlb = midl("TypeLibraryName", default="${root}.tlb") - header = midl("HeaderFileName", default="${root}.h") - dlldata = midl("DLLDataFileName", default="dlldata.c") - iid = midl("InterfaceIdentifierFileName", default="${root}_i.c") - proxy = midl("ProxyFileName", default="${root}_p.c") - # Note that .tlb is not included in the outputs as it is not always - # generated depending on the content of the input idl file. - outdir = midl("OutputDirectory", default="") - output = [header, dlldata, iid, proxy] - variables = [ - ("tlb", tlb), - ("h", header), - ("dlldata", dlldata), - ("iid", iid), - ("proxy", proxy), - ] - # TODO(scottmg): Are there configuration settings to set these flags? - target_platform = self.GetArch(config) - if target_platform == "x86": - target_platform = "win32" - flags = ["/char", "signed", "/env", target_platform, "/Oicf"] - return outdir, output, variables, flags - - -def _LanguageMatchesForPch(source_ext, pch_source_ext): - c_exts = (".c",) - cc_exts = (".cc", ".cxx", ".cpp") - return (source_ext in c_exts and pch_source_ext in c_exts) or ( - source_ext in cc_exts and pch_source_ext in cc_exts - ) - - -class PrecompiledHeader: - """Helper to generate dependencies and build rules to handle generation of - precompiled headers. Interface matches the GCH handler in xcode_emulation.py. - """ - - def __init__( - self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext - ): - self.settings = settings - self.config = config - pch_source = self.settings.msvs_precompiled_source[self.config] - self.pch_source = gyp_to_build_path(pch_source) - filename, _ = os.path.splitext(pch_source) - self.output_obj = gyp_to_unique_output(filename + obj_ext).lower() - - def _PchHeader(self): - """Get the header that will appear in an #include line for all source - files.""" - return self.settings.msvs_precompiled_header[self.config] - - def GetObjDependencies(self, sources, objs, arch): - """Given a list of sources files and the corresponding object files, - returns a list of the pch files that should be depended upon. The - additional wrapping in the return value is for interface compatibility - with make.py on Mac, and xcode_emulation.py.""" - assert arch is None - if not self._PchHeader(): - return [] - pch_ext = os.path.splitext(self.pch_source)[1] - for source in sources: - if _LanguageMatchesForPch(os.path.splitext(source)[1], pch_ext): - return [(None, None, self.output_obj)] - return [] - - def GetPchBuildCommands(self, arch): - """Not used on Windows as there are no additional build steps required - (instead, existing steps are modified in GetFlagsModifications below).""" - return [] - - def GetFlagsModifications( - self, input, output, implicit, command, cflags_c, cflags_cc, expand_special - ): - """Get the modified cflags and implicit dependencies that should be used - for the pch compilation step.""" - if input == self.pch_source: - pch_output = ["/Yc" + self._PchHeader()] - if command == "cxx": - return ( - [("cflags_cc", map(expand_special, cflags_cc + pch_output))], - self.output_obj, - [], - ) - elif command == "cc": - return ( - [("cflags_c", map(expand_special, cflags_c + pch_output))], - self.output_obj, - [], - ) - return [], output, implicit - - -vs_version = None - - -def GetVSVersion(generator_flags): - global vs_version - if not vs_version: - vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( - generator_flags.get("msvs_version", "auto"), allow_fallback=False - ) - return vs_version - - -def _GetVsvarsSetupArgs(generator_flags, arch): - vs = GetVSVersion(generator_flags) - return vs.SetupScript() - - -def ExpandMacros(string, expansions): - """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv - for the canonical way to retrieve a suitable dict.""" - if "$" in string: - for old, new in expansions.items(): - assert "$(" not in new, new - string = string.replace(old, new) - return string - - -def _ExtractImportantEnvironment(output_of_set): - """Extracts environment variables required for the toolchain to run from - a textual dump output by the cmd.exe 'set' command.""" - envvars_to_save = ( - "goma_.*", # TODO(scottmg): This is ugly, but needed for goma. - "include", - "lib", - "libpath", - "path", - "pathext", - "systemroot", - "temp", - "tmp", - ) - env = {} - # This occasionally happens and leads to misleading SYSTEMROOT error messages - # if not caught here. - if output_of_set.count("=") == 0: - raise Exception("Invalid output_of_set. Value is:\n%s" % output_of_set) - for line in output_of_set.splitlines(): - for envvar in envvars_to_save: - if re.match(envvar + "=", line.lower()): - var, setting = line.split("=", 1) - if envvar == "path": - # Our own rules (for running gyp-win-tool) and other actions in - # Chromium rely on python being in the path. Add the path to this - # python here so that if it's not in the path when ninja is run - # later, python will still be found. - setting = os.path.dirname(sys.executable) + os.pathsep + setting - env[var.upper()] = setting - break - for required in ("SYSTEMROOT", "TEMP", "TMP"): - if required not in env: - raise Exception( - 'Environment variable "%s" ' - "required to be set to valid path" % required - ) - return env - - -def _FormatAsEnvironmentBlock(envvar_dict): - """Format as an 'environment block' directly suitable for CreateProcess. - Briefly this is a list of key=value\0, terminated by an additional \0. See - CreateProcess documentation for more details.""" - block = "" - nul = "\0" - for key, value in envvar_dict.items(): - block += key + "=" + value + nul - block += nul - return block - - -def _ExtractCLPath(output_of_where): - """Gets the path to cl.exe based on the output of calling the environment - setup batch file, followed by the equivalent of `where`.""" - # Take the first line, as that's the first found in the PATH. - for line in output_of_where.strip().splitlines(): - if line.startswith("LOC:"): - return line[len("LOC:") :].strip() - - -def GenerateEnvironmentFiles( - toplevel_build_dir, generator_flags, system_includes, open_out -): - """It's not sufficient to have the absolute path to the compiler, linker, - etc. on Windows, as those tools rely on .dlls being in the PATH. We also - need to support both x86 and x64 compilers within the same build (to support - msvs_target_platform hackery). Different architectures require a different - compiler binary, and different supporting environment variables (INCLUDE, - LIB, LIBPATH). So, we extract the environment here, wrap all invocations - of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which - sets up the environment, and then we do not prefix the compiler with - an absolute path, instead preferring something like "cl.exe" in the rule - which will then run whichever the environment setup has put in the path. - When the following procedure to generate environment files does not - meet your requirement (e.g. for custom toolchains), you can pass - "-G ninja_use_custom_environment_files" to the gyp to suppress file - generation and use custom environment files prepared by yourself.""" - archs = ("x86", "x64") - if generator_flags.get("ninja_use_custom_environment_files", 0): - cl_paths = {} - for arch in archs: - cl_paths[arch] = "cl.exe" - return cl_paths - vs = GetVSVersion(generator_flags) - cl_paths = {} - for arch in archs: - # Extract environment variables for subprocesses. - args = vs.SetupScript(arch) - args.extend(("&&", "set")) - popen = subprocess.Popen( - args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - variables = popen.communicate()[0].decode("utf-8") - if popen.returncode != 0: - raise Exception('"%s" failed with error %d' % (args, popen.returncode)) - env = _ExtractImportantEnvironment(variables) - - # Inject system includes from gyp files into INCLUDE. - if system_includes: - system_includes = system_includes | OrderedSet( - env.get("INCLUDE", "").split(";") - ) - env["INCLUDE"] = ";".join(system_includes) - - env_block = _FormatAsEnvironmentBlock(env) - f = open_out(os.path.join(toplevel_build_dir, "environment." + arch), "w") - f.write(env_block) - f.close() - - # Find cl.exe location for this architecture. - args = vs.SetupScript(arch) - args.extend( - ("&&", "for", "%i", "in", "(cl.exe)", "do", "@echo", "LOC:%~$PATH:i") - ) - popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) - output = popen.communicate()[0].decode("utf-8") - cl_paths[arch] = _ExtractCLPath(output) - return cl_paths - - -def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): - """Emulate behavior of msvs_error_on_missing_sources present in the msvs - generator: Check that all regular source files, i.e. not created at run time, - exist on disk. Missing files cause needless recompilation when building via - VS, and we want this check to match for people/bots that build using ninja, - so they're not surprised when the VS build fails.""" - if int(generator_flags.get("msvs_error_on_missing_sources", 0)): - no_specials = filter(lambda x: "$" not in x, sources) - relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] - missing = [x for x in relative if not os.path.exists(x)] - if missing: - # They'll look like out\Release\..\..\stuff\things.cc, so normalize the - # path for a slightly less crazy looking output. - cleaned_up = [os.path.normpath(x) for x in missing] - raise Exception("Missing input files:\n%s" % "\n".join(cleaned_up)) - - -# Sets some values in default_variables, which are required for many -# generators, run on Windows. -def CalculateCommonVariables(default_variables, params): - generator_flags = params.get("generator_flags", {}) - - # Set a variable so conditions can be based on msvs_version. - msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) - default_variables["MSVS_VERSION"] = msvs_version.ShortName() - - # To determine processor word size on Windows, in addition to checking - # PROCESSOR_ARCHITECTURE (which reflects the word size of the current - # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which - # contains the actual word size of the system when running thru WOW64). - if "64" in os.environ.get("PROCESSOR_ARCHITECTURE", "") or "64" in os.environ.get( - "PROCESSOR_ARCHITEW6432", "" - ): - default_variables["MSVS_OS_BITS"] = 64 - else: - default_variables["MSVS_OS_BITS"] = 32 diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py deleted file mode 100644 index 0e3e86c74..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +++ /dev/null @@ -1,174 +0,0 @@ -# This file comes from -# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py -# Do not edit! Edit the upstream one instead. - -"""Python module for generating .ninja files. - -Note that this is emphatically not a required piece of Ninja; it's -just a helpful utility for build-file-generation systems that already -use Python. -""" - -import textwrap - - -def escape_path(word): - return word.replace("$ ", "$$ ").replace(" ", "$ ").replace(":", "$:") - - -class Writer: - def __init__(self, output, width=78): - self.output = output - self.width = width - - def newline(self): - self.output.write("\n") - - def comment(self, text): - for line in textwrap.wrap(text, self.width - 2): - self.output.write("# " + line + "\n") - - def variable(self, key, value, indent=0): - if value is None: - return - if isinstance(value, list): - value = " ".join(filter(None, value)) # Filter out empty strings. - self._line(f"{key} = {value}", indent) - - def pool(self, name, depth): - self._line("pool %s" % name) - self.variable("depth", depth, indent=1) - - def rule( - self, - name, - command, - description=None, - depfile=None, - generator=False, - pool=None, - restat=False, - rspfile=None, - rspfile_content=None, - deps=None, - ): - self._line("rule %s" % name) - self.variable("command", command, indent=1) - if description: - self.variable("description", description, indent=1) - if depfile: - self.variable("depfile", depfile, indent=1) - if generator: - self.variable("generator", "1", indent=1) - if pool: - self.variable("pool", pool, indent=1) - if restat: - self.variable("restat", "1", indent=1) - if rspfile: - self.variable("rspfile", rspfile, indent=1) - if rspfile_content: - self.variable("rspfile_content", rspfile_content, indent=1) - if deps: - self.variable("deps", deps, indent=1) - - def build( - self, outputs, rule, inputs=None, implicit=None, order_only=None, variables=None - ): - outputs = self._as_list(outputs) - all_inputs = self._as_list(inputs)[:] - out_outputs = list(map(escape_path, outputs)) - all_inputs = list(map(escape_path, all_inputs)) - - if implicit: - implicit = map(escape_path, self._as_list(implicit)) - all_inputs.append("|") - all_inputs.extend(implicit) - if order_only: - order_only = map(escape_path, self._as_list(order_only)) - all_inputs.append("||") - all_inputs.extend(order_only) - - self._line( - "build {}: {}".format(" ".join(out_outputs), " ".join([rule] + all_inputs)) - ) - - if variables: - if isinstance(variables, dict): - iterator = iter(variables.items()) - else: - iterator = iter(variables) - - for key, val in iterator: - self.variable(key, val, indent=1) - - return outputs - - def include(self, path): - self._line("include %s" % path) - - def subninja(self, path): - self._line("subninja %s" % path) - - def default(self, paths): - self._line("default %s" % " ".join(self._as_list(paths))) - - def _count_dollars_before_index(self, s, i): - """Returns the number of '$' characters right in front of s[i].""" - dollar_count = 0 - dollar_index = i - 1 - while dollar_index > 0 and s[dollar_index] == "$": - dollar_count += 1 - dollar_index -= 1 - return dollar_count - - def _line(self, text, indent=0): - """Write 'text' word-wrapped at self.width characters.""" - leading_space = " " * indent - while len(leading_space) + len(text) > self.width: - # The text is too wide; wrap if possible. - - # Find the rightmost space that would obey our width constraint and - # that's not an escaped space. - available_space = self.width - len(leading_space) - len(" $") - space = available_space - while True: - space = text.rfind(" ", 0, space) - if space < 0 or self._count_dollars_before_index(text, space) % 2 == 0: - break - - if space < 0: - # No such space; just use the first unescaped space we can find. - space = available_space - 1 - while True: - space = text.find(" ", space + 1) - if ( - space < 0 - or self._count_dollars_before_index(text, space) % 2 == 0 - ): - break - if space < 0: - # Give up on breaking. - break - - self.output.write(leading_space + text[0:space] + " $\n") - text = text[space + 1 :] - - # Subsequent lines are continuations, so indent them. - leading_space = " " * (indent + 2) - - self.output.write(leading_space + text + "\n") - - def _as_list(self, input): - if input is None: - return [] - if isinstance(input, list): - return input - return [input] - - -def escape(string): - """Escape a string such that it can be embedded into a Ninja file without - further interpretation.""" - assert "\n" not in string, "Ninja syntax does not allow newlines" - # We only have one special metacharacter: '$'. - return string.replace("$", "$$") diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py deleted file mode 100644 index 729cec063..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2014 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""A clone of the default copy.deepcopy that doesn't handle cyclic -structures or complex types except for dicts and lists. This is -because gyp copies so large structure that small copy overhead ends up -taking seconds in a project the size of Chromium.""" - - -class Error(Exception): - pass - - -__all__ = ["Error", "deepcopy"] - - -def deepcopy(x): - """Deep copy operation on gyp objects such as strings, ints, dicts - and lists. More than twice as fast as copy.deepcopy but much less - generic.""" - - try: - return _deepcopy_dispatch[type(x)](x) - except KeyError: - raise Error( - "Unsupported type %s for deepcopy. Use copy.deepcopy " - + "or expand simple_copy support." % type(x) - ) - - -_deepcopy_dispatch = d = {} - - -def _deepcopy_atomic(x): - return x - - -types = bool, float, int, str, type, type(None) - -for x in types: - d[x] = _deepcopy_atomic - - -def _deepcopy_list(x): - return [deepcopy(a) for a in x] - - -d[list] = _deepcopy_list - - -def _deepcopy_dict(x): - y = {} - for key, value in x.items(): - y[deepcopy(key)] = deepcopy(value) - return y - - -d[dict] = _deepcopy_dict - -del d diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py deleted file mode 100755 index 638eee400..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +++ /dev/null @@ -1,374 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions for Windows builds. - -These functions are executed via gyp-win-tool when using the ninja generator. -""" - - -import os -import re -import shutil -import subprocess -import stat -import string -import sys - -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) - -# A regex matching an argument corresponding to the output filename passed to -# link.exe. -_LINK_EXE_OUT_ARG = re.compile("/OUT:(?P.+)$", re.IGNORECASE) - - -def main(args): - executor = WinTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) - - -class WinTool: - """This class performs all the Windows tooling steps. The methods can either - be executed directly, or dispatched from an argument list.""" - - def _UseSeparateMspdbsrv(self, env, args): - """Allows to use a unique instance of mspdbsrv.exe per linker instead of a - shared one.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - if args[0] != "link.exe": - return - - # Use the output filename passed to the linker to generate an endpoint name - # for mspdbsrv.exe. - endpoint_name = None - for arg in args: - m = _LINK_EXE_OUT_ARG.match(arg) - if m: - endpoint_name = re.sub( - r"\W+", "", "%s_%d" % (m.group("out"), os.getpid()) - ) - break - - if endpoint_name is None: - return - - # Adds the appropriate environment variable. This will be read by link.exe - # to know which instance of mspdbsrv.exe it should connect to (if it's - # not set then the default endpoint is used). - env["_MSPDBSRV_ENDPOINT_"] = endpoint_name - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like recursive-mirror to RecursiveMirror.""" - return name_string.title().replace("-", "") - - def _GetEnv(self, arch): - """Gets the saved environment from a file for a given architecture.""" - # The environment is saved as an "environment block" (see CreateProcess - # and msvs_emulation for details). We convert to a dict here. - # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. - pairs = open(arch).read()[:-2].split("\0") - kvs = [item.split("=", 1) for item in pairs] - return dict(kvs) - - def ExecStamp(self, path): - """Simple stamp command.""" - open(path, "w").close() - - def ExecRecursiveMirror(self, source, dest): - """Emulation of rm -rf out && cp -af in out.""" - if os.path.exists(dest): - if os.path.isdir(dest): - - def _on_error(fn, path, excinfo): - # The operation failed, possibly because the file is set to - # read-only. If that's why, make it writable and try the op again. - if not os.access(path, os.W_OK): - os.chmod(path, stat.S_IWRITE) - fn(path) - - shutil.rmtree(dest, onerror=_on_error) - else: - if not os.access(dest, os.W_OK): - # Attempt to make the file writable before deleting it. - os.chmod(dest, stat.S_IWRITE) - os.unlink(dest) - - if os.path.isdir(source): - shutil.copytree(source, dest) - else: - shutil.copy2(source, dest) - - def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): - """Filter diagnostic output from link that looks like: - ' Creating library ui.dll.lib and object ui.dll.exp' - This happens when there are exports from the dll or exe. - """ - env = self._GetEnv(arch) - if use_separate_mspdbsrv == "True": - self._UseSeparateMspdbsrv(env, args) - if sys.platform == "win32": - args = list(args) # *args is a tuple by default, which is read-only. - args[0] = args[0].replace("/", "\\") - # https://docs.python.org/2/library/subprocess.html: - # "On Unix with shell=True [...] if args is a sequence, the first item - # specifies the command string, and any additional items will be treated as - # additional arguments to the shell itself. That is to say, Popen does the - # equivalent of: - # Popen(['/bin/sh', '-c', args[0], args[1], ...])" - # For that reason, since going through the shell doesn't seem necessary on - # non-Windows don't do that there. - link = subprocess.Popen( - args, - shell=sys.platform == "win32", - env=env, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - ) - out = link.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if ( - not line.startswith(" Creating library ") - and not line.startswith("Generating code") - and not line.startswith("Finished generating code") - ): - print(line) - return link.returncode - - def ExecLinkWithManifests( - self, - arch, - embed_manifest, - out, - ldcmd, - resname, - mt, - rc, - intermediate_manifest, - *manifests - ): - """A wrapper for handling creating a manifest resource and then executing - a link command.""" - # The 'normal' way to do manifests is to have link generate a manifest - # based on gathering dependencies from the object files, then merge that - # manifest with other manifests supplied as sources, convert the merged - # manifest to a resource, and then *relink*, including the compiled - # version of the manifest resource. This breaks incremental linking, and - # is generally overly complicated. Instead, we merge all the manifests - # provided (along with one that includes what would normally be in the - # linker-generated one, see msvs_emulation.py), and include that into the - # first and only link. We still tell link to generate a manifest, but we - # only use that to assert that our simpler process did not miss anything. - variables = { - "python": sys.executable, - "arch": arch, - "out": out, - "ldcmd": ldcmd, - "resname": resname, - "mt": mt, - "rc": rc, - "intermediate_manifest": intermediate_manifest, - "manifests": " ".join(manifests), - } - add_to_ld = "" - if manifests: - subprocess.check_call( - "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " - "-manifest %(manifests)s -out:%(out)s.manifest" % variables - ) - if embed_manifest == "True": - subprocess.check_call( - "%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest" - " %(out)s.manifest.rc %(resname)s" % variables - ) - subprocess.check_call( - "%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s " - "%(out)s.manifest.rc" % variables - ) - add_to_ld = " %(out)s.manifest.res" % variables - subprocess.check_call(ldcmd + add_to_ld) - - # Run mt.exe on the theoretically complete manifest we generated, merging - # it with the one the linker generated to confirm that the linker - # generated one does not add anything. This is strictly unnecessary for - # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not - # used in a #pragma comment. - if manifests: - # Merge the intermediate one with ours to .assert.manifest, then check - # that .assert.manifest is identical to ours. - subprocess.check_call( - "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " - "-manifest %(out)s.manifest %(intermediate_manifest)s " - "-out:%(out)s.assert.manifest" % variables - ) - assert_manifest = "%(out)s.assert.manifest" % variables - our_manifest = "%(out)s.manifest" % variables - # Load and normalize the manifests. mt.exe sometimes removes whitespace, - # and sometimes doesn't unfortunately. - with open(our_manifest) as our_f: - with open(assert_manifest) as assert_f: - translator = str.maketrans('', '', string.whitespace) - our_data = our_f.read().translate(translator) - assert_data = assert_f.read().translate(translator) - if our_data != assert_data: - os.unlink(out) - - def dump(filename): - print(filename, file=sys.stderr) - print("-----", file=sys.stderr) - with open(filename) as f: - print(f.read(), file=sys.stderr) - print("-----", file=sys.stderr) - - dump(intermediate_manifest) - dump(our_manifest) - dump(assert_manifest) - sys.stderr.write( - 'Linker generated manifest "%s" added to final manifest "%s" ' - '(result in "%s"). ' - "Were /MANIFEST switches used in #pragma statements? " - % (intermediate_manifest, our_manifest, assert_manifest) - ) - return 1 - - def ExecManifestWrapper(self, arch, *args): - """Run manifest tool with environment set. Strip out undesirable warning - (some XML blocks are recognized by the OS loader, but not the manifest - tool).""" - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if line and "manifest authoring warning 81010002" not in line: - print(line) - return popen.returncode - - def ExecManifestToRc(self, arch, *args): - """Creates a resource file pointing a SxS assembly manifest. - |args| is tuple containing path to resource file, path to manifest file - and resource name which can be "1" (for executables) or "2" (for DLLs).""" - manifest_path, resource_path, resource_name = args - with open(resource_path, "w") as output: - output.write( - '#include \n%s RT_MANIFEST "%s"' - % (resource_name, os.path.abspath(manifest_path).replace("\\", "/")) - ) - - def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): - """Filter noisy filenames output from MIDL compile step that isn't - quietable via command line flags. - """ - args = ( - ["midl", "/nologo"] - + list(flags) - + [ - "/out", - outdir, - "/tlb", - tlb, - "/h", - h, - "/dlldata", - dlldata, - "/iid", - iid, - "/proxy", - proxy, - idl, - ] - ) - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - # Filter junk out of stdout, and write filtered versions. Output we want - # to filter is pairs of lines that look like this: - # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl - # objidl.idl - lines = out.splitlines() - prefixes = ("Processing ", "64 bit Processing ") - processing = {os.path.basename(x) for x in lines if x.startswith(prefixes)} - for line in lines: - if not line.startswith(prefixes) and line not in processing: - print(line) - return popen.returncode - - def ExecAsmWrapper(self, arch, *args): - """Filter logo banner from invocations of asm.exe.""" - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if ( - not line.startswith("Copyright (C) Microsoft Corporation") - and not line.startswith("Microsoft (R) Macro Assembler") - and not line.startswith(" Assembling: ") - and line - ): - print(line) - return popen.returncode - - def ExecRcWrapper(self, arch, *args): - """Filter logo banner from invocations of rc.exe. Older versions of RC - don't support the /nologo flag.""" - env = self._GetEnv(arch) - popen = subprocess.Popen( - args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT - ) - out = popen.communicate()[0].decode("utf-8") - for line in out.splitlines(): - if ( - not line.startswith("Microsoft (R) Windows (R) Resource Compiler") - and not line.startswith("Copyright (C) Microsoft Corporation") - and line - ): - print(line) - return popen.returncode - - def ExecActionWrapper(self, arch, rspfile, *dir): - """Runs an action command line from a response file using the environment - for |arch|. If |dir| is supplied, use that as the working directory.""" - env = self._GetEnv(arch) - # TODO(scottmg): This is a temporary hack to get some specific variables - # through to actions that are set after gyp-time. http://crbug.com/333738. - for k, v in os.environ.items(): - if k not in env: - env[k] = v - args = open(rspfile).read() - dir = dir[0] if dir else None - return subprocess.call(args, shell=True, env=env, cwd=dir) - - def ExecClCompile(self, project_dir, selected_files): - """Executed by msvs-ninja projects when the 'ClCompile' target is used to - build selected C/C++ files.""" - project_dir = os.path.relpath(project_dir, BASE_DIR) - selected_files = selected_files.split(";") - ninja_targets = [ - os.path.join(project_dir, filename) + "^^" for filename in selected_files - ] - cmd = ["ninja.exe"] - cmd.extend(ninja_targets) - return subprocess.call(cmd, shell=True, cwd=BASE_DIR) - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py deleted file mode 100644 index a75d8eeab..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +++ /dev/null @@ -1,1939 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" -This module contains classes that help to emulate xcodebuild behavior on top of -other build systems, such as make and ninja. -""" - - -import copy -import gyp.common -import os -import os.path -import re -import shlex -import subprocess -import sys -from gyp.common import GypError - -# Populated lazily by XcodeVersion, for efficiency, and to fix an issue when -# "xcodebuild" is called too quickly (it has been found to return incorrect -# version number). -XCODE_VERSION_CACHE = None - -# Populated lazily by GetXcodeArchsDefault, to an |XcodeArchsDefault| instance -# corresponding to the installed version of Xcode. -XCODE_ARCHS_DEFAULT_CACHE = None - - -def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): - """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, - and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" - mapping = {"$(ARCHS_STANDARD)": archs} - if archs_including_64_bit: - mapping["$(ARCHS_STANDARD_INCLUDING_64_BIT)"] = archs_including_64_bit - return mapping - - -class XcodeArchsDefault: - """A class to resolve ARCHS variable from xcode_settings, resolving Xcode - macros and implementing filtering by VALID_ARCHS. The expansion of macros - depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and - on the version of Xcode. - """ - - # Match variable like $(ARCHS_STANDARD). - variable_pattern = re.compile(r"\$\([a-zA-Z_][a-zA-Z0-9_]*\)$") - - def __init__(self, default, mac, iphonesimulator, iphoneos): - self._default = (default,) - self._archs = {"mac": mac, "ios": iphoneos, "iossim": iphonesimulator} - - def _VariableMapping(self, sdkroot): - """Returns the dictionary of variable mapping depending on the SDKROOT.""" - sdkroot = sdkroot.lower() - if "iphoneos" in sdkroot: - return self._archs["ios"] - elif "iphonesimulator" in sdkroot: - return self._archs["iossim"] - else: - return self._archs["mac"] - - def _ExpandArchs(self, archs, sdkroot): - """Expands variables references in ARCHS, and remove duplicates.""" - variable_mapping = self._VariableMapping(sdkroot) - expanded_archs = [] - for arch in archs: - if self.variable_pattern.match(arch): - variable = arch - try: - variable_expansion = variable_mapping[variable] - for arch in variable_expansion: - if arch not in expanded_archs: - expanded_archs.append(arch) - except KeyError: - print('Warning: Ignoring unsupported variable "%s".' % variable) - elif arch not in expanded_archs: - expanded_archs.append(arch) - return expanded_archs - - def ActiveArchs(self, archs, valid_archs, sdkroot): - """Expands variables references in ARCHS, and filter by VALID_ARCHS if it - is defined (if not set, Xcode accept any value in ARCHS, otherwise, only - values present in VALID_ARCHS are kept).""" - expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or "") - if valid_archs: - filtered_archs = [] - for arch in expanded_archs: - if arch in valid_archs: - filtered_archs.append(arch) - expanded_archs = filtered_archs - return expanded_archs - - -def GetXcodeArchsDefault(): - """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the - installed version of Xcode. The default values used by Xcode for ARCHS - and the expansion of the variables depends on the version of Xcode used. - - For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included - uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses - $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0 - and deprecated with Xcode 5.1. - - For "macosx" SDKROOT, all version starting with Xcode 5.0 includes 64-bit - architecture as part of $(ARCHS_STANDARD) and default to only building it. - - For "iphoneos" and "iphonesimulator" SDKROOT, 64-bit architectures are part - of $(ARCHS_STANDARD_INCLUDING_64_BIT) from Xcode 5.0. From Xcode 5.1, they - are also part of $(ARCHS_STANDARD). - - All these rules are coded in the construction of the |XcodeArchsDefault| - object to use depending on the version of Xcode detected. The object is - for performance reason.""" - global XCODE_ARCHS_DEFAULT_CACHE - if XCODE_ARCHS_DEFAULT_CACHE: - return XCODE_ARCHS_DEFAULT_CACHE - xcode_version, _ = XcodeVersion() - if xcode_version < "0500": - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - "$(ARCHS_STANDARD)", - XcodeArchsVariableMapping(["i386"]), - XcodeArchsVariableMapping(["i386"]), - XcodeArchsVariableMapping(["armv7"]), - ) - elif xcode_version < "0510": - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - "$(ARCHS_STANDARD_INCLUDING_64_BIT)", - XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), - XcodeArchsVariableMapping(["i386"], ["i386", "x86_64"]), - XcodeArchsVariableMapping( - ["armv7", "armv7s"], ["armv7", "armv7s", "arm64"] - ), - ) - else: - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - "$(ARCHS_STANDARD)", - XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), - XcodeArchsVariableMapping(["i386", "x86_64"], ["i386", "x86_64"]), - XcodeArchsVariableMapping( - ["armv7", "armv7s", "arm64"], ["armv7", "armv7s", "arm64"] - ), - ) - return XCODE_ARCHS_DEFAULT_CACHE - - -class XcodeSettings: - """A class that understands the gyp 'xcode_settings' object.""" - - # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached - # at class-level for efficiency. - _sdk_path_cache = {} - _platform_path_cache = {} - _sdk_root_cache = {} - - # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so - # cached at class-level for efficiency. - _plist_cache = {} - - # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so - # cached at class-level for efficiency. - _codesigning_key_cache = {} - - def __init__(self, spec): - self.spec = spec - - self.isIOS = False - self.mac_toolchain_dir = None - self.header_map_path = None - - # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. - # This means self.xcode_settings[config] always contains all settings - # for that config -- the per-target settings as well. Settings that are - # the same for all configs are implicitly per-target settings. - self.xcode_settings = {} - configs = spec["configurations"] - for configname, config in configs.items(): - self.xcode_settings[configname] = config.get("xcode_settings", {}) - self._ConvertConditionalKeys(configname) - if self.xcode_settings[configname].get("IPHONEOS_DEPLOYMENT_TARGET", None): - self.isIOS = True - - # This is only non-None temporarily during the execution of some methods. - self.configname = None - - # Used by _AdjustLibrary to match .a and .dylib entries in libraries. - self.library_re = re.compile(r"^lib([^/]+)\.(a|dylib)$") - - def _ConvertConditionalKeys(self, configname): - """Converts or warns on conditional keys. Xcode supports conditional keys, - such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation - with some keys converted while the rest force a warning.""" - settings = self.xcode_settings[configname] - conditional_keys = [key for key in settings if key.endswith("]")] - for key in conditional_keys: - # If you need more, speak up at http://crbug.com/122592 - if key.endswith("[sdk=iphoneos*]"): - if configname.endswith("iphoneos"): - new_key = key.split("[")[0] - settings[new_key] = settings[key] - else: - print( - "Warning: Conditional keys not implemented, ignoring:", - " ".join(conditional_keys), - ) - del settings[key] - - def _Settings(self): - assert self.configname - return self.xcode_settings[self.configname] - - def _Test(self, test_key, cond_key, default): - return self._Settings().get(test_key, default) == cond_key - - def _Appendf(self, lst, test_key, format_str, default=None): - if test_key in self._Settings(): - lst.append(format_str % str(self._Settings()[test_key])) - elif default: - lst.append(format_str % str(default)) - - def _WarnUnimplemented(self, test_key): - if test_key in self._Settings(): - print('Warning: Ignoring not yet implemented key "%s".' % test_key) - - def IsBinaryOutputFormat(self, configname): - default = "binary" if self.isIOS else "xml" - format = self.xcode_settings[configname].get("INFOPLIST_OUTPUT_FORMAT", default) - return format == "binary" - - def IsIosFramework(self): - return self.spec["type"] == "shared_library" and self._IsBundle() and self.isIOS - - def _IsBundle(self): - return ( - int(self.spec.get("mac_bundle", 0)) != 0 - or self._IsXCTest() - or self._IsXCUiTest() - ) - - def _IsXCTest(self): - return int(self.spec.get("mac_xctest_bundle", 0)) != 0 - - def _IsXCUiTest(self): - return int(self.spec.get("mac_xcuitest_bundle", 0)) != 0 - - def _IsIosAppExtension(self): - return int(self.spec.get("ios_app_extension", 0)) != 0 - - def _IsIosWatchKitExtension(self): - return int(self.spec.get("ios_watchkit_extension", 0)) != 0 - - def _IsIosWatchApp(self): - return int(self.spec.get("ios_watch_app", 0)) != 0 - - def GetFrameworkVersion(self): - """Returns the framework version of the current target. Only valid for - bundles.""" - assert self._IsBundle() - return self.GetPerTargetSetting("FRAMEWORK_VERSION", default="A") - - def GetWrapperExtension(self): - """Returns the bundle extension (.app, .framework, .plugin, etc). Only - valid for bundles.""" - assert self._IsBundle() - if self.spec["type"] in ("loadable_module", "shared_library"): - default_wrapper_extension = { - "loadable_module": "bundle", - "shared_library": "framework", - }[self.spec["type"]] - wrapper_extension = self.GetPerTargetSetting( - "WRAPPER_EXTENSION", default=default_wrapper_extension - ) - return "." + self.spec.get("product_extension", wrapper_extension) - elif self.spec["type"] == "executable": - if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): - return "." + self.spec.get("product_extension", "appex") - else: - return "." + self.spec.get("product_extension", "app") - else: - assert False, "Don't know extension for '{}', target '{}'".format( - self.spec["type"], - self.spec["target_name"], - ) - - def GetProductName(self): - """Returns PRODUCT_NAME.""" - return self.spec.get("product_name", self.spec["target_name"]) - - def GetFullProductName(self): - """Returns FULL_PRODUCT_NAME.""" - if self._IsBundle(): - return self.GetWrapperName() - else: - return self._GetStandaloneBinaryPath() - - def GetWrapperName(self): - """Returns the directory name of the bundle represented by this target. - Only valid for bundles.""" - assert self._IsBundle() - return self.GetProductName() + self.GetWrapperExtension() - - def GetBundleContentsFolderPath(self): - """Returns the qualified path to the bundle's contents folder. E.g. - Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" - if self.isIOS: - return self.GetWrapperName() - assert self._IsBundle() - if self.spec["type"] == "shared_library": - return os.path.join( - self.GetWrapperName(), "Versions", self.GetFrameworkVersion() - ) - else: - # loadable_modules have a 'Contents' folder like executables. - return os.path.join(self.GetWrapperName(), "Contents") - - def GetBundleResourceFolder(self): - """Returns the qualified path to the bundle's resource folder. E.g. - Chromium.app/Contents/Resources. Only valid for bundles.""" - assert self._IsBundle() - if self.isIOS: - return self.GetBundleContentsFolderPath() - return os.path.join(self.GetBundleContentsFolderPath(), "Resources") - - def GetBundleExecutableFolderPath(self): - """Returns the qualified path to the bundle's executables folder. E.g. - Chromium.app/Contents/MacOS. Only valid for bundles.""" - assert self._IsBundle() - if self.spec["type"] in ("shared_library") or self.isIOS: - return self.GetBundleContentsFolderPath() - elif self.spec["type"] in ("executable", "loadable_module"): - return os.path.join(self.GetBundleContentsFolderPath(), "MacOS") - - def GetBundleJavaFolderPath(self): - """Returns the qualified path to the bundle's Java resource folder. - E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleResourceFolder(), "Java") - - def GetBundleFrameworksFolderPath(self): - """Returns the qualified path to the bundle's frameworks folder. E.g, - Chromium.app/Contents/Frameworks. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "Frameworks") - - def GetBundleSharedFrameworksFolderPath(self): - """Returns the qualified path to the bundle's frameworks folder. E.g, - Chromium.app/Contents/SharedFrameworks. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "SharedFrameworks") - - def GetBundleSharedSupportFolderPath(self): - """Returns the qualified path to the bundle's shared support folder. E.g, - Chromium.app/Contents/SharedSupport. Only valid for bundles.""" - assert self._IsBundle() - if self.spec["type"] == "shared_library": - return self.GetBundleResourceFolder() - else: - return os.path.join(self.GetBundleContentsFolderPath(), "SharedSupport") - - def GetBundlePlugInsFolderPath(self): - """Returns the qualified path to the bundle's plugins folder. E.g, - Chromium.app/Contents/PlugIns. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "PlugIns") - - def GetBundleXPCServicesFolderPath(self): - """Returns the qualified path to the bundle's XPC services folder. E.g, - Chromium.app/Contents/XPCServices. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join(self.GetBundleContentsFolderPath(), "XPCServices") - - def GetBundlePlistPath(self): - """Returns the qualified path to the bundle's plist file. E.g. - Chromium.app/Contents/Info.plist. Only valid for bundles.""" - assert self._IsBundle() - if ( - self.spec["type"] in ("executable", "loadable_module") - or self.IsIosFramework() - ): - return os.path.join(self.GetBundleContentsFolderPath(), "Info.plist") - else: - return os.path.join( - self.GetBundleContentsFolderPath(), "Resources", "Info.plist" - ) - - def GetProductType(self): - """Returns the PRODUCT_TYPE of this target.""" - if self._IsIosAppExtension(): - assert self._IsBundle(), ( - "ios_app_extension flag requires mac_bundle " - "(target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.app-extension" - if self._IsIosWatchKitExtension(): - assert self._IsBundle(), ( - "ios_watchkit_extension flag requires " - "mac_bundle (target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.watchkit-extension" - if self._IsIosWatchApp(): - assert self._IsBundle(), ( - "ios_watch_app flag requires mac_bundle " - "(target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.application.watchapp" - if self._IsXCUiTest(): - assert self._IsBundle(), ( - "mac_xcuitest_bundle flag requires mac_bundle " - "(target %s)" % self.spec["target_name"] - ) - return "com.apple.product-type.bundle.ui-testing" - if self._IsBundle(): - return { - "executable": "com.apple.product-type.application", - "loadable_module": "com.apple.product-type.bundle", - "shared_library": "com.apple.product-type.framework", - }[self.spec["type"]] - else: - return { - "executable": "com.apple.product-type.tool", - "loadable_module": "com.apple.product-type.library.dynamic", - "shared_library": "com.apple.product-type.library.dynamic", - "static_library": "com.apple.product-type.library.static", - }[self.spec["type"]] - - def GetMachOType(self): - """Returns the MACH_O_TYPE of this target.""" - # Weird, but matches Xcode. - if not self._IsBundle() and self.spec["type"] == "executable": - return "" - return { - "executable": "mh_execute", - "static_library": "staticlib", - "shared_library": "mh_dylib", - "loadable_module": "mh_bundle", - }[self.spec["type"]] - - def _GetBundleBinaryPath(self): - """Returns the name of the bundle binary of by this target. - E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" - assert self._IsBundle() - return os.path.join( - self.GetBundleExecutableFolderPath(), self.GetExecutableName() - ) - - def _GetStandaloneExecutableSuffix(self): - if "product_extension" in self.spec: - return "." + self.spec["product_extension"] - return { - "executable": "", - "static_library": ".a", - "shared_library": ".dylib", - "loadable_module": ".so", - }[self.spec["type"]] - - def _GetStandaloneExecutablePrefix(self): - return self.spec.get( - "product_prefix", - { - "executable": "", - "static_library": "lib", - "shared_library": "lib", - # Non-bundled loadable_modules are called foo.so for some reason - # (that is, .so and no prefix) with the xcode build -- match that. - "loadable_module": "", - }[self.spec["type"]], - ) - - def _GetStandaloneBinaryPath(self): - """Returns the name of the non-bundle binary represented by this target. - E.g. hello_world. Only valid for non-bundles.""" - assert not self._IsBundle() - assert self.spec["type"] in ( - "executable", - "shared_library", - "static_library", - "loadable_module", - ), ("Unexpected type %s" % self.spec["type"]) - target = self.spec["target_name"] - if self.spec["type"] == "static_library": - if target[:3] == "lib": - target = target[3:] - elif self.spec["type"] in ("loadable_module", "shared_library"): - if target[:3] == "lib": - target = target[3:] - - target_prefix = self._GetStandaloneExecutablePrefix() - target = self.spec.get("product_name", target) - target_ext = self._GetStandaloneExecutableSuffix() - return target_prefix + target + target_ext - - def GetExecutableName(self): - """Returns the executable name of the bundle represented by this target. - E.g. Chromium.""" - if self._IsBundle(): - return self.spec.get("product_name", self.spec["target_name"]) - else: - return self._GetStandaloneBinaryPath() - - def GetExecutablePath(self): - """Returns the qualified path to the primary executable of the bundle - represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" - if self._IsBundle(): - return self._GetBundleBinaryPath() - else: - return self._GetStandaloneBinaryPath() - - def GetActiveArchs(self, configname): - """Returns the architectures this target should be built for.""" - config_settings = self.xcode_settings[configname] - xcode_archs_default = GetXcodeArchsDefault() - return xcode_archs_default.ActiveArchs( - config_settings.get("ARCHS"), - config_settings.get("VALID_ARCHS"), - config_settings.get("SDKROOT"), - ) - - def _GetSdkVersionInfoItem(self, sdk, infoitem): - # xcodebuild requires Xcode and can't run on Command Line Tools-only - # systems from 10.7 onward. - # Since the CLT has no SDK paths anyway, returning None is the - # most sensible route and should still do the right thing. - try: - return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem]) - except GypError: - pass - - def _SdkRoot(self, configname): - if configname is None: - configname = self.configname - return self.GetPerConfigSetting("SDKROOT", configname, default="") - - def _XcodePlatformPath(self, configname=None): - sdk_root = self._SdkRoot(configname) - if sdk_root not in XcodeSettings._platform_path_cache: - platform_path = self._GetSdkVersionInfoItem( - sdk_root, "--show-sdk-platform-path" - ) - XcodeSettings._platform_path_cache[sdk_root] = platform_path - return XcodeSettings._platform_path_cache[sdk_root] - - def _SdkPath(self, configname=None): - sdk_root = self._SdkRoot(configname) - if sdk_root.startswith("/"): - return sdk_root - return self._XcodeSdkPath(sdk_root) - - def _XcodeSdkPath(self, sdk_root): - if sdk_root not in XcodeSettings._sdk_path_cache: - sdk_path = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-path") - XcodeSettings._sdk_path_cache[sdk_root] = sdk_path - if sdk_root: - XcodeSettings._sdk_root_cache[sdk_path] = sdk_root - return XcodeSettings._sdk_path_cache[sdk_root] - - def _AppendPlatformVersionMinFlags(self, lst): - self._Appendf(lst, "MACOSX_DEPLOYMENT_TARGET", "-mmacosx-version-min=%s") - if "IPHONEOS_DEPLOYMENT_TARGET" in self._Settings(): - # TODO: Implement this better? - sdk_path_basename = os.path.basename(self._SdkPath()) - if sdk_path_basename.lower().startswith("iphonesimulator"): - self._Appendf( - lst, "IPHONEOS_DEPLOYMENT_TARGET", "-mios-simulator-version-min=%s" - ) - else: - self._Appendf( - lst, "IPHONEOS_DEPLOYMENT_TARGET", "-miphoneos-version-min=%s" - ) - - def GetCflags(self, configname, arch=None): - """Returns flags that need to be added to .c, .cc, .m, and .mm - compilations.""" - # This functions (and the similar ones below) do not offer complete - # emulation of all xcode_settings keys. They're implemented on demand. - - self.configname = configname - cflags = [] - - sdk_root = self._SdkPath() - if "SDKROOT" in self._Settings() and sdk_root: - cflags.append("-isysroot %s" % sdk_root) - - if self.header_map_path: - cflags.append("-I%s" % self.header_map_path) - - if self._Test("CLANG_WARN_CONSTANT_CONVERSION", "YES", default="NO"): - cflags.append("-Wconstant-conversion") - - if self._Test("GCC_CHAR_IS_UNSIGNED_CHAR", "YES", default="NO"): - cflags.append("-funsigned-char") - - if self._Test("GCC_CW_ASM_SYNTAX", "YES", default="YES"): - cflags.append("-fasm-blocks") - - if "GCC_DYNAMIC_NO_PIC" in self._Settings(): - if self._Settings()["GCC_DYNAMIC_NO_PIC"] == "YES": - cflags.append("-mdynamic-no-pic") - else: - pass - # TODO: In this case, it depends on the target. xcode passes - # mdynamic-no-pic by default for executable and possibly static lib - # according to mento - - if self._Test("GCC_ENABLE_PASCAL_STRINGS", "YES", default="YES"): - cflags.append("-mpascal-strings") - - self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") - - if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): - dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") - if dbg_format == "dwarf": - cflags.append("-gdwarf-2") - elif dbg_format == "stabs": - raise NotImplementedError("stabs debug format is not supported yet.") - elif dbg_format == "dwarf-with-dsym": - cflags.append("-gdwarf-2") - else: - raise NotImplementedError("Unknown debug format %s" % dbg_format) - - if self._Settings().get("GCC_STRICT_ALIASING") == "YES": - cflags.append("-fstrict-aliasing") - elif self._Settings().get("GCC_STRICT_ALIASING") == "NO": - cflags.append("-fno-strict-aliasing") - - if self._Test("GCC_SYMBOLS_PRIVATE_EXTERN", "YES", default="NO"): - cflags.append("-fvisibility=hidden") - - if self._Test("GCC_TREAT_WARNINGS_AS_ERRORS", "YES", default="NO"): - cflags.append("-Werror") - - if self._Test("GCC_WARN_ABOUT_MISSING_NEWLINE", "YES", default="NO"): - cflags.append("-Wnewline-eof") - - # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or - # llvm-gcc. It also requires a fairly recent libtool, and - # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the - # path to the libLTO.dylib that matches the used clang. - if self._Test("LLVM_LTO", "YES", default="NO"): - cflags.append("-flto") - - self._AppendPlatformVersionMinFlags(cflags) - - # TODO: - if self._Test("COPY_PHASE_STRIP", "YES", default="NO"): - self._WarnUnimplemented("COPY_PHASE_STRIP") - self._WarnUnimplemented("GCC_DEBUGGING_SYMBOLS") - self._WarnUnimplemented("GCC_ENABLE_OBJC_EXCEPTIONS") - - # TODO: This is exported correctly, but assigning to it is not supported. - self._WarnUnimplemented("MACH_O_TYPE") - self._WarnUnimplemented("PRODUCT_TYPE") - - # If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific - # additions and assume these will be provided as required via CC_host, - # CXX_host, CC_target and CXX_target. - if not gyp.common.CrossCompileRequested(): - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented("ARCHS") - archs = ["i386"] - cflags.append("-arch " + archs[0]) - - if archs[0] in ("i386", "x86_64"): - if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse3") - if self._Test( - "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" - ): - cflags.append("-mssse3") # Note 3rd 's'. - if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse4.1") - if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): - cflags.append("-msse4.2") - - cflags += self._Settings().get("WARNING_CFLAGS", []) - - if self._IsXCTest(): - platform_root = self._XcodePlatformPath(configname) - if platform_root: - cflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") - - if sdk_root: - framework_root = sdk_root - else: - framework_root = "" - config = self.spec["configurations"][self.configname] - framework_dirs = config.get("mac_framework_dirs", []) - for directory in framework_dirs: - cflags.append("-F" + directory.replace("$(SDKROOT)", framework_root)) - - self.configname = None - return cflags - - def GetCflagsC(self, configname): - """Returns flags that need to be added to .c, and .m compilations.""" - self.configname = configname - cflags_c = [] - if self._Settings().get("GCC_C_LANGUAGE_STANDARD", "") == "ansi": - cflags_c.append("-ansi") - else: - self._Appendf(cflags_c, "GCC_C_LANGUAGE_STANDARD", "-std=%s") - cflags_c += self._Settings().get("OTHER_CFLAGS", []) - self.configname = None - return cflags_c - - def GetCflagsCC(self, configname): - """Returns flags that need to be added to .cc, and .mm compilations.""" - self.configname = configname - cflags_cc = [] - - clang_cxx_language_standard = self._Settings().get( - "CLANG_CXX_LANGUAGE_STANDARD" - ) - # Note: Don't make c++0x to c++11 so that c++0x can be used with older - # clangs that don't understand c++11 yet (like Xcode 4.2's). - if clang_cxx_language_standard: - cflags_cc.append("-std=%s" % clang_cxx_language_standard) - - self._Appendf(cflags_cc, "CLANG_CXX_LIBRARY", "-stdlib=%s") - - if self._Test("GCC_ENABLE_CPP_RTTI", "NO", default="YES"): - cflags_cc.append("-fno-rtti") - if self._Test("GCC_ENABLE_CPP_EXCEPTIONS", "NO", default="YES"): - cflags_cc.append("-fno-exceptions") - if self._Test("GCC_INLINES_ARE_PRIVATE_EXTERN", "YES", default="NO"): - cflags_cc.append("-fvisibility-inlines-hidden") - if self._Test("GCC_THREADSAFE_STATICS", "NO", default="YES"): - cflags_cc.append("-fno-threadsafe-statics") - # Note: This flag is a no-op for clang, it only has an effect for gcc. - if self._Test("GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO", "NO", default="YES"): - cflags_cc.append("-Wno-invalid-offsetof") - - other_ccflags = [] - - for flag in self._Settings().get("OTHER_CPLUSPLUSFLAGS", ["$(inherited)"]): - # TODO: More general variable expansion. Missing in many other places too. - if flag in ("$inherited", "$(inherited)", "${inherited}"): - flag = "$OTHER_CFLAGS" - if flag in ("$OTHER_CFLAGS", "$(OTHER_CFLAGS)", "${OTHER_CFLAGS}"): - other_ccflags += self._Settings().get("OTHER_CFLAGS", []) - else: - other_ccflags.append(flag) - cflags_cc += other_ccflags - - self.configname = None - return cflags_cc - - def _AddObjectiveCGarbageCollectionFlags(self, flags): - gc_policy = self._Settings().get("GCC_ENABLE_OBJC_GC", "unsupported") - if gc_policy == "supported": - flags.append("-fobjc-gc") - elif gc_policy == "required": - flags.append("-fobjc-gc-only") - - def _AddObjectiveCARCFlags(self, flags): - if self._Test("CLANG_ENABLE_OBJC_ARC", "YES", default="NO"): - flags.append("-fobjc-arc") - - def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): - if self._Test( - "CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS", "YES", default="NO" - ): - flags.append("-Wobjc-missing-property-synthesis") - - def GetCflagsObjC(self, configname): - """Returns flags that need to be added to .m compilations.""" - self.configname = configname - cflags_objc = [] - self._AddObjectiveCGarbageCollectionFlags(cflags_objc) - self._AddObjectiveCARCFlags(cflags_objc) - self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) - self.configname = None - return cflags_objc - - def GetCflagsObjCC(self, configname): - """Returns flags that need to be added to .mm compilations.""" - self.configname = configname - cflags_objcc = [] - self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) - self._AddObjectiveCARCFlags(cflags_objcc) - self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) - if self._Test("GCC_OBJC_CALL_CXX_CDTORS", "YES", default="NO"): - cflags_objcc.append("-fobjc-call-cxx-cdtors") - self.configname = None - return cflags_objcc - - def GetInstallNameBase(self): - """Return DYLIB_INSTALL_NAME_BASE for this target.""" - # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. - if self.spec["type"] != "shared_library" and ( - self.spec["type"] != "loadable_module" or self._IsBundle() - ): - return None - install_base = self.GetPerTargetSetting( - "DYLIB_INSTALL_NAME_BASE", - default="/Library/Frameworks" if self._IsBundle() else "/usr/local/lib", - ) - return install_base - - def _StandardizePath(self, path): - """Do :standardizepath processing for path.""" - # I'm not quite sure what :standardizepath does. Just call normpath(), - # but don't let @executable_path/../foo collapse to foo. - if "/" in path: - prefix, rest = "", path - if path.startswith("@"): - prefix, rest = path.split("/", 1) - rest = os.path.normpath(rest) # :standardizepath - path = os.path.join(prefix, rest) - return path - - def GetInstallName(self): - """Return LD_DYLIB_INSTALL_NAME for this target.""" - # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. - if self.spec["type"] != "shared_library" and ( - self.spec["type"] != "loadable_module" or self._IsBundle() - ): - return None - - default_install_name = ( - "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)" - ) - install_name = self.GetPerTargetSetting( - "LD_DYLIB_INSTALL_NAME", default=default_install_name - ) - - # Hardcode support for the variables used in chromium for now, to - # unblock people using the make build. - if "$" in install_name: - assert install_name in ( - "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/" - "$(WRAPPER_NAME)/$(PRODUCT_NAME)", - default_install_name, - ), ( - "Variables in LD_DYLIB_INSTALL_NAME are not generally supported " - "yet in target '%s' (got '%s')" - % (self.spec["target_name"], install_name) - ) - - install_name = install_name.replace( - "$(DYLIB_INSTALL_NAME_BASE:standardizepath)", - self._StandardizePath(self.GetInstallNameBase()), - ) - if self._IsBundle(): - # These are only valid for bundles, hence the |if|. - install_name = install_name.replace( - "$(WRAPPER_NAME)", self.GetWrapperName() - ) - install_name = install_name.replace( - "$(PRODUCT_NAME)", self.GetProductName() - ) - else: - assert "$(WRAPPER_NAME)" not in install_name - assert "$(PRODUCT_NAME)" not in install_name - - install_name = install_name.replace( - "$(EXECUTABLE_PATH)", self.GetExecutablePath() - ) - return install_name - - def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): - """Checks if ldflag contains a filename and if so remaps it from - gyp-directory-relative to build-directory-relative.""" - # This list is expanded on demand. - # They get matched as: - # -exported_symbols_list file - # -Wl,exported_symbols_list file - # -Wl,exported_symbols_list,file - LINKER_FILE = r"(\S+)" - WORD = r"\S+" - linker_flags = [ - ["-exported_symbols_list", LINKER_FILE], # Needed for NaCl. - ["-unexported_symbols_list", LINKER_FILE], - ["-reexported_symbols_list", LINKER_FILE], - ["-sectcreate", WORD, WORD, LINKER_FILE], # Needed for remoting. - ] - for flag_pattern in linker_flags: - regex = re.compile("(?:-Wl,)?" + "[ ,]".join(flag_pattern)) - m = regex.match(ldflag) - if m: - ldflag = ( - ldflag[: m.start(1)] - + gyp_to_build_path(m.group(1)) - + ldflag[m.end(1) :] - ) - # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, - # TODO(thakis): Update ffmpeg.gyp): - if ldflag.startswith("-L"): - ldflag = "-L" + gyp_to_build_path(ldflag[len("-L") :]) - return ldflag - - def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): - """Returns flags that need to be passed to the linker. - - Args: - configname: The name of the configuration to get ld flags for. - product_dir: The directory where products such static and dynamic - libraries are placed. This is added to the library search path. - gyp_to_build_path: A function that converts paths relative to the - current gyp file to paths relative to the build directory. - """ - self.configname = configname - ldflags = [] - - # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS - # can contain entries that depend on this. Explicitly absolutify these. - for ldflag in self._Settings().get("OTHER_LDFLAGS", []): - ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) - - if self._Test("DEAD_CODE_STRIPPING", "YES", default="NO"): - ldflags.append("-Wl,-dead_strip") - - if self._Test("PREBINDING", "YES", default="NO"): - ldflags.append("-Wl,-prebind") - - self._Appendf( - ldflags, "DYLIB_COMPATIBILITY_VERSION", "-compatibility_version %s" - ) - self._Appendf(ldflags, "DYLIB_CURRENT_VERSION", "-current_version %s") - - self._AppendPlatformVersionMinFlags(ldflags) - - if "SDKROOT" in self._Settings() and self._SdkPath(): - ldflags.append("-isysroot " + self._SdkPath()) - - for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []): - ldflags.append("-L" + gyp_to_build_path(library_path)) - - if "ORDER_FILE" in self._Settings(): - ldflags.append( - "-Wl,-order_file " - + "-Wl," - + gyp_to_build_path(self._Settings()["ORDER_FILE"]) - ) - - if not gyp.common.CrossCompileRequested(): - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented("ARCHS") - archs = ["i386"] - ldflags.append("-arch " + archs[0]) - - # Xcode adds the product directory by default. - # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 - ldflags.append("-L" + (product_dir if product_dir != "." else "./")) - - install_name = self.GetInstallName() - if install_name and self.spec["type"] != "loadable_module": - ldflags.append("-install_name " + install_name.replace(" ", r"\ ")) - - for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []): - ldflags.append("-Wl,-rpath," + rpath) - - sdk_root = self._SdkPath() - if not sdk_root: - sdk_root = "" - config = self.spec["configurations"][self.configname] - framework_dirs = config.get("mac_framework_dirs", []) - for directory in framework_dirs: - ldflags.append("-F" + directory.replace("$(SDKROOT)", sdk_root)) - - if self._IsXCTest(): - platform_root = self._XcodePlatformPath(configname) - if sdk_root and platform_root: - ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") - ldflags.append("-framework XCTest") - - is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() - if sdk_root and is_extension: - # Adds the link flags for extensions. These flags are common for all - # extensions and provide loader and main function. - # These flags reflect the compilation options used by xcode to compile - # extensions. - xcode_version, _ = XcodeVersion() - if xcode_version < "0900": - ldflags.append("-lpkstart") - ldflags.append( - sdk_root - + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit" - ) - else: - ldflags.append("-e _NSExtensionMain") - ldflags.append("-fapplication-extension") - - self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s") - - self.configname = None - return ldflags - - def GetLibtoolflags(self, configname): - """Returns flags that need to be passed to the static linker. - - Args: - configname: The name of the configuration to get ld flags for. - """ - self.configname = configname - libtoolflags = [] - - for libtoolflag in self._Settings().get("OTHER_LDFLAGS", []): - libtoolflags.append(libtoolflag) - # TODO(thakis): ARCHS? - - self.configname = None - return libtoolflags - - def GetPerTargetSettings(self): - """Gets a list of all the per-target settings. This will only fetch keys - whose values are the same across all configurations.""" - first_pass = True - result = {} - for configname in sorted(self.xcode_settings.keys()): - if first_pass: - result = dict(self.xcode_settings[configname]) - first_pass = False - else: - for key, value in self.xcode_settings[configname].items(): - if key not in result: - continue - elif result[key] != value: - del result[key] - return result - - def GetPerConfigSetting(self, setting, configname, default=None): - if configname in self.xcode_settings: - return self.xcode_settings[configname].get(setting, default) - else: - return self.GetPerTargetSetting(setting, default) - - def GetPerTargetSetting(self, setting, default=None): - """Tries to get xcode_settings.setting from spec. Assumes that the setting - has the same value in all configurations and throws otherwise.""" - is_first_pass = True - result = None - for configname in sorted(self.xcode_settings.keys()): - if is_first_pass: - result = self.xcode_settings[configname].get(setting, None) - is_first_pass = False - else: - assert result == self.xcode_settings[configname].get(setting, None), ( - "Expected per-target setting for '%s', got per-config setting " - "(target %s)" % (setting, self.spec["target_name"]) - ) - if result is None: - return default - return result - - def _GetStripPostbuilds(self, configname, output_binary, quiet): - """Returns a list of shell commands that contain the shell commands - necessary to strip this target's binary. These should be run as postbuilds - before the actual postbuilds run.""" - self.configname = configname - - result = [] - if self._Test("DEPLOYMENT_POSTPROCESSING", "YES", default="NO") and self._Test( - "STRIP_INSTALLED_PRODUCT", "YES", default="NO" - ): - - default_strip_style = "debugging" - if ( - self.spec["type"] == "loadable_module" or self._IsIosAppExtension() - ) and self._IsBundle(): - default_strip_style = "non-global" - elif self.spec["type"] == "executable": - default_strip_style = "all" - - strip_style = self._Settings().get("STRIP_STYLE", default_strip_style) - strip_flags = {"all": "", "non-global": "-x", "debugging": "-S"}[ - strip_style - ] - - explicit_strip_flags = self._Settings().get("STRIPFLAGS", "") - if explicit_strip_flags: - strip_flags += " " + _NormalizeEnvVarReferences(explicit_strip_flags) - - if not quiet: - result.append("echo STRIP\\(%s\\)" % self.spec["target_name"]) - result.append(f"strip {strip_flags} {output_binary}") - - self.configname = None - return result - - def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): - """Returns a list of shell commands that contain the shell commands - necessary to massage this target's debug information. These should be run - as postbuilds before the actual postbuilds run.""" - self.configname = configname - - # For static libraries, no dSYMs are created. - result = [] - if ( - self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") - and self._Test( - "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" - ) - and self.spec["type"] != "static_library" - ): - if not quiet: - result.append("echo DSYMUTIL\\(%s\\)" % self.spec["target_name"]) - result.append("dsymutil {} -o {}".format(output_binary, output + ".dSYM")) - - self.configname = None - return result - - def _GetTargetPostbuilds(self, configname, output, output_binary, quiet=False): - """Returns a list of shell commands that contain the shell commands - to run as postbuilds for this target, before the actual postbuilds.""" - # dSYMs need to build before stripping happens. - return self._GetDebugInfoPostbuilds( - configname, output, output_binary, quiet - ) + self._GetStripPostbuilds(configname, output_binary, quiet) - - def _GetIOSPostbuilds(self, configname, output_binary): - """Return a shell command to codesign the iOS output binary so it can - be deployed to a device. This should be run as the very last step of the - build.""" - if not ( - self.isIOS - and (self.spec["type"] == "executable" or self._IsXCTest()) - or self.IsIosFramework() - ): - return [] - - postbuilds = [] - product_name = self.GetFullProductName() - settings = self.xcode_settings[configname] - - # Xcode expects XCTests to be copied into the TEST_HOST dir. - if self._IsXCTest(): - source = os.path.join("${BUILT_PRODUCTS_DIR}", product_name) - test_host = os.path.dirname(settings.get("TEST_HOST")) - xctest_destination = os.path.join(test_host, "PlugIns", product_name) - postbuilds.extend([f"ditto {source} {xctest_destination}"]) - - key = self._GetIOSCodeSignIdentityKey(settings) - if not key: - return postbuilds - - # Warn for any unimplemented signing xcode keys. - unimpl = ["OTHER_CODE_SIGN_FLAGS"] - unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) - if unimpl: - print( - "Warning: Some codesign keys not implemented, ignoring: %s" - % ", ".join(sorted(unimpl)) - ) - - if self._IsXCTest(): - # For device xctests, Xcode copies two extra frameworks into $TEST_HOST. - test_host = os.path.dirname(settings.get("TEST_HOST")) - frameworks_dir = os.path.join(test_host, "Frameworks") - platform_root = self._XcodePlatformPath(configname) - frameworks = [ - "Developer/Library/PrivateFrameworks/IDEBundleInjection.framework", - "Developer/Library/Frameworks/XCTest.framework", - ] - for framework in frameworks: - source = os.path.join(platform_root, framework) - destination = os.path.join(frameworks_dir, os.path.basename(framework)) - postbuilds.extend([f"ditto {source} {destination}"]) - - # Then re-sign everything with 'preserve=True' - postbuilds.extend( - [ - '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' - % ( - os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), - key, - settings.get("CODE_SIGN_ENTITLEMENTS", ""), - settings.get("PROVISIONING_PROFILE", ""), - destination, - True, - ) - ] - ) - plugin_dir = os.path.join(test_host, "PlugIns") - targets = [os.path.join(plugin_dir, product_name), test_host] - for target in targets: - postbuilds.extend( - [ - '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' - % ( - os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), - key, - settings.get("CODE_SIGN_ENTITLEMENTS", ""), - settings.get("PROVISIONING_PROFILE", ""), - target, - True, - ) - ] - ) - - postbuilds.extend( - [ - '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' - % ( - os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), - key, - settings.get("CODE_SIGN_ENTITLEMENTS", ""), - settings.get("PROVISIONING_PROFILE", ""), - os.path.join("${BUILT_PRODUCTS_DIR}", product_name), - False, - ) - ] - ) - return postbuilds - - def _GetIOSCodeSignIdentityKey(self, settings): - identity = settings.get("CODE_SIGN_IDENTITY") - if not identity: - return None - if identity not in XcodeSettings._codesigning_key_cache: - output = subprocess.check_output( - ["security", "find-identity", "-p", "codesigning", "-v"] - ) - for line in output.splitlines(): - if identity in line: - fingerprint = line.split()[1] - cache = XcodeSettings._codesigning_key_cache - assert identity not in cache or fingerprint == cache[identity], ( - "Multiple codesigning fingerprints for identity: %s" % identity - ) - XcodeSettings._codesigning_key_cache[identity] = fingerprint - return XcodeSettings._codesigning_key_cache.get(identity, "") - - def AddImplicitPostbuilds( - self, configname, output, output_binary, postbuilds=[], quiet=False - ): - """Returns a list of shell commands that should run before and after - |postbuilds|.""" - assert output_binary is not None - pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) - post = self._GetIOSPostbuilds(configname, output_binary) - return pre + postbuilds + post - - def _AdjustLibrary(self, library, config_name=None): - if library.endswith(".framework"): - l_flag = "-framework " + os.path.splitext(os.path.basename(library))[0] - else: - m = self.library_re.match(library) - if m: - l_flag = "-l" + m.group(1) - else: - l_flag = library - - sdk_root = self._SdkPath(config_name) - if not sdk_root: - sdk_root = "" - # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of - # ".dylib" without providing a real support for them. What it does, for - # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the - # library order and cause collision when building Chrome. - # - # Instead substitute ".tbd" to ".dylib" in the generated project when the - # following conditions are both true: - # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", - # - the ".dylib" file does not exists but a ".tbd" file do. - library = l_flag.replace("$(SDKROOT)", sdk_root) - if l_flag.startswith("$(SDKROOT)"): - basename, ext = os.path.splitext(library) - if ext == ".dylib" and not os.path.exists(library): - tbd_library = basename + ".tbd" - if os.path.exists(tbd_library): - library = tbd_library - return library - - def AdjustLibraries(self, libraries, config_name=None): - """Transforms entries like 'Cocoa.framework' in libraries into entries like - '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. - """ - libraries = [self._AdjustLibrary(library, config_name) for library in libraries] - return libraries - - def _BuildMachineOSBuild(self): - return GetStdout(["sw_vers", "-buildVersion"]) - - def _XcodeIOSDeviceFamily(self, configname): - family = self.xcode_settings[configname].get("TARGETED_DEVICE_FAMILY", "1") - return [int(x) for x in family.split(",")] - - def GetExtraPlistItems(self, configname=None): - """Returns a dictionary with extra items to insert into Info.plist.""" - if configname not in XcodeSettings._plist_cache: - cache = {} - cache["BuildMachineOSBuild"] = self._BuildMachineOSBuild() - - xcode_version, xcode_build = XcodeVersion() - cache["DTXcode"] = xcode_version - cache["DTXcodeBuild"] = xcode_build - compiler = self.xcode_settings[configname].get("GCC_VERSION") - if compiler is not None: - cache["DTCompiler"] = compiler - - sdk_root = self._SdkRoot(configname) - if not sdk_root: - sdk_root = self._DefaultSdkRoot() - sdk_version = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-version") - cache["DTSDKName"] = sdk_root + (sdk_version or "") - if xcode_version >= "0720": - cache["DTSDKBuild"] = self._GetSdkVersionInfoItem( - sdk_root, "--show-sdk-build-version" - ) - elif xcode_version >= "0430": - cache["DTSDKBuild"] = sdk_version - else: - cache["DTSDKBuild"] = cache["BuildMachineOSBuild"] - - if self.isIOS: - cache["MinimumOSVersion"] = self.xcode_settings[configname].get( - "IPHONEOS_DEPLOYMENT_TARGET" - ) - cache["DTPlatformName"] = sdk_root - cache["DTPlatformVersion"] = sdk_version - - if configname.endswith("iphoneos"): - cache["CFBundleSupportedPlatforms"] = ["iPhoneOS"] - cache["DTPlatformBuild"] = cache["DTSDKBuild"] - else: - cache["CFBundleSupportedPlatforms"] = ["iPhoneSimulator"] - # This is weird, but Xcode sets DTPlatformBuild to an empty field - # for simulator builds. - cache["DTPlatformBuild"] = "" - XcodeSettings._plist_cache[configname] = cache - - # Include extra plist items that are per-target, not per global - # XcodeSettings. - items = dict(XcodeSettings._plist_cache[configname]) - if self.isIOS: - items["UIDeviceFamily"] = self._XcodeIOSDeviceFamily(configname) - return items - - def _DefaultSdkRoot(self): - """Returns the default SDKROOT to use. - - Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode - project, then the environment variable was empty. Starting with this - version, Xcode uses the name of the newest SDK installed. - """ - xcode_version, _ = XcodeVersion() - if xcode_version < "0500": - return "" - default_sdk_path = self._XcodeSdkPath("") - default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) - if default_sdk_root: - return default_sdk_root - try: - all_sdks = GetStdout(["xcodebuild", "-showsdks"]) - except GypError: - # If xcodebuild fails, there will be no valid SDKs - return "" - for line in all_sdks.splitlines(): - items = line.split() - if len(items) >= 3 and items[-2] == "-sdk": - sdk_root = items[-1] - sdk_path = self._XcodeSdkPath(sdk_root) - if sdk_path == default_sdk_path: - return sdk_root - return "" - - -class MacPrefixHeader: - """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. - - This feature consists of several pieces: - * If GCC_PREFIX_HEADER is present, all compilations in that project get an - additional |-include path_to_prefix_header| cflag. - * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is - instead compiled, and all other compilations in the project get an - additional |-include path_to_compiled_header| instead. - + Compiled prefix headers have the extension gch. There is one gch file for - every language used in the project (c, cc, m, mm), since gch files for - different languages aren't compatible. - + gch files themselves are built with the target's normal cflags, but they - obviously don't get the |-include| flag. Instead, they need a -x flag that - describes their language. - + All o files in the target need to depend on the gch file, to make sure - it's built before any o file is built. - - This class helps with some of these tasks, but it needs help from the build - system for writing dependencies to the gch files, for writing build commands - for the gch files, and for figuring out the location of the gch files. - """ - - def __init__( - self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output - ): - """If xcode_settings is None, all methods on this class are no-ops. - - Args: - gyp_path_to_build_path: A function that takes a gyp-relative path, - and returns a path relative to the build directory. - gyp_path_to_build_output: A function that takes a gyp-relative path and - a language code ('c', 'cc', 'm', or 'mm'), and that returns a path - to where the output of precompiling that path for that language - should be placed (without the trailing '.gch'). - """ - # This doesn't support per-configuration prefix headers. Good enough - # for now. - self.header = None - self.compile_headers = False - if xcode_settings: - self.header = xcode_settings.GetPerTargetSetting("GCC_PREFIX_HEADER") - self.compile_headers = ( - xcode_settings.GetPerTargetSetting( - "GCC_PRECOMPILE_PREFIX_HEADER", default="NO" - ) - != "NO" - ) - self.compiled_headers = {} - if self.header: - if self.compile_headers: - for lang in ["c", "cc", "m", "mm"]: - self.compiled_headers[lang] = gyp_path_to_build_output( - self.header, lang - ) - self.header = gyp_path_to_build_path(self.header) - - def _CompiledHeader(self, lang, arch): - assert self.compile_headers - h = self.compiled_headers[lang] - if arch: - h += "." + arch - return h - - def GetInclude(self, lang, arch=None): - """Gets the cflags to include the prefix header for language |lang|.""" - if self.compile_headers and lang in self.compiled_headers: - return "-include %s" % self._CompiledHeader(lang, arch) - elif self.header: - return "-include %s" % self.header - else: - return "" - - def _Gch(self, lang, arch): - """Returns the actual file name of the prefix header for language |lang|.""" - assert self.compile_headers - return self._CompiledHeader(lang, arch) + ".gch" - - def GetObjDependencies(self, sources, objs, arch=None): - """Given a list of source files and the corresponding object files, returns - a list of (source, object, gch) tuples, where |gch| is the build-directory - relative path to the gch file each object file depends on. |compilable[i]| - has to be the source file belonging to |objs[i]|.""" - if not self.header or not self.compile_headers: - return [] - - result = [] - for source, obj in zip(sources, objs): - ext = os.path.splitext(source)[1] - lang = { - ".c": "c", - ".cpp": "cc", - ".cc": "cc", - ".cxx": "cc", - ".m": "m", - ".mm": "mm", - }.get(ext, None) - if lang: - result.append((source, obj, self._Gch(lang, arch))) - return result - - def GetPchBuildCommands(self, arch=None): - """Returns [(path_to_gch, language_flag, language, header)]. - |path_to_gch| and |header| are relative to the build directory. - """ - if not self.header or not self.compile_headers: - return [] - return [ - (self._Gch("c", arch), "-x c-header", "c", self.header), - (self._Gch("cc", arch), "-x c++-header", "cc", self.header), - (self._Gch("m", arch), "-x objective-c-header", "m", self.header), - (self._Gch("mm", arch), "-x objective-c++-header", "mm", self.header), - ] - - -def XcodeVersion(): - """Returns a tuple of version and build version of installed Xcode.""" - # `xcodebuild -version` output looks like - # Xcode 4.6.3 - # Build version 4H1503 - # or like - # Xcode 3.2.6 - # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 - # BuildVersion: 10M2518 - # Convert that to ('0463', '4H1503') or ('0326', '10M2518'). - global XCODE_VERSION_CACHE - if XCODE_VERSION_CACHE: - return XCODE_VERSION_CACHE - version = "" - build = "" - try: - version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines() - # In some circumstances xcodebuild exits 0 but doesn't return - # the right results; for example, a user on 10.7 or 10.8 with - # a bogus path set via xcode-select - # In that case this may be a CLT-only install so fall back to - # checking that version. - if len(version_list) < 2: - raise GypError("xcodebuild returned unexpected results") - version = version_list[0].split()[-1] # Last word on first line - build = version_list[-1].split()[-1] # Last word on last line - except GypError: # Xcode not installed so look for XCode Command Line Tools - version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322 - if not version: - raise GypError("No Xcode or CLT version detected!") - # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100": - version = version.split(".")[:3] # Just major, minor, micro - version[0] = version[0].zfill(2) # Add a leading zero if major is one digit - version = ("".join(version) + "00")[:4] # Limit to exactly four characters - XCODE_VERSION_CACHE = (version, build) - return XCODE_VERSION_CACHE - - -# This function ported from the logic in Homebrew's CLT version check -def CLTVersion(): - """Returns the version of command-line tools from pkgutil.""" - # pkgutil output looks like - # package-id: com.apple.pkg.CLTools_Executables - # version: 5.0.1.0.1.1382131676 - # volume: / - # location: / - # install-time: 1382544035 - # groups: com.apple.FindSystemFiles.pkg-group - # com.apple.DevToolsBoth.pkg-group - # com.apple.DevToolsNonRelocatableShared.pkg-group - STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" - FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" - MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" - - regex = re.compile("version: (?P.+)") - for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: - try: - output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key]) - return re.search(regex, output).groupdict()["version"] - except GypError: - continue - - regex = re.compile(r'Command Line Tools for Xcode\s+(?P\S+)') - try: - output = GetStdout(["/usr/sbin/softwareupdate", "--history"]) - return re.search(regex, output).groupdict()["version"] - except GypError: - return None - - -def GetStdoutQuiet(cmdlist): - """Returns the content of standard output returned by invoking |cmdlist|. - Ignores the stderr. - Raises |GypError| if the command return with a non-zero return code.""" - job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out = job.communicate()[0].decode("utf-8") - if job.returncode != 0: - raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) - return out.rstrip("\n") - - -def GetStdout(cmdlist): - """Returns the content of standard output returned by invoking |cmdlist|. - Raises |GypError| if the command return with a non-zero return code.""" - job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) - out = job.communicate()[0].decode("utf-8") - if job.returncode != 0: - sys.stderr.write(out + "\n") - raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) - return out.rstrip("\n") - - -def MergeGlobalXcodeSettingsToSpec(global_dict, spec): - """Merges the global xcode_settings dictionary into each configuration of the - target represented by spec. For keys that are both in the global and the local - xcode_settings dict, the local key gets precedence. - """ - # The xcode generator special-cases global xcode_settings and does something - # that amounts to merging in the global xcode_settings into each local - # xcode_settings dict. - global_xcode_settings = global_dict.get("xcode_settings", {}) - for config in spec["configurations"].values(): - if "xcode_settings" in config: - new_settings = global_xcode_settings.copy() - new_settings.update(config["xcode_settings"]) - config["xcode_settings"] = new_settings - - -def IsMacBundle(flavor, spec): - """Returns if |spec| should be treated as a bundle. - - Bundles are directories with a certain subdirectory structure, instead of - just a single file. Bundle rules do not produce a binary but also package - resources into that directory.""" - is_mac_bundle = ( - int(spec.get("mac_xctest_bundle", 0)) != 0 - or int(spec.get("mac_xcuitest_bundle", 0)) != 0 - or (int(spec.get("mac_bundle", 0)) != 0 and flavor == "mac") - ) - - if is_mac_bundle: - assert spec["type"] != "none", ( - 'mac_bundle targets cannot have type none (target "%s")' - % spec["target_name"] - ) - return is_mac_bundle - - -def GetMacBundleResources(product_dir, xcode_settings, resources): - """Yields (output, resource) pairs for every resource in |resources|. - Only call this for mac bundle targets. - - Args: - product_dir: Path to the directory containing the output bundle, - relative to the build directory. - xcode_settings: The XcodeSettings of the current target. - resources: A list of bundle resources, relative to the build directory. - """ - dest = os.path.join(product_dir, xcode_settings.GetBundleResourceFolder()) - for res in resources: - output = dest - - # The make generator doesn't support it, so forbid it everywhere - # to keep the generators more interchangeable. - assert " " not in res, "Spaces in resource filenames not supported (%s)" % res - - # Split into (path,file). - res_parts = os.path.split(res) - - # Now split the path into (prefix,maybe.lproj). - lproj_parts = os.path.split(res_parts[0]) - # If the resource lives in a .lproj bundle, add that to the destination. - if lproj_parts[1].endswith(".lproj"): - output = os.path.join(output, lproj_parts[1]) - - output = os.path.join(output, res_parts[1]) - # Compiled XIB files are referred to by .nib. - if output.endswith(".xib"): - output = os.path.splitext(output)[0] + ".nib" - # Compiled storyboard files are referred to by .storyboardc. - if output.endswith(".storyboard"): - output = os.path.splitext(output)[0] + ".storyboardc" - - yield output, res - - -def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): - """Returns (info_plist, dest_plist, defines, extra_env), where: - * |info_plist| is the source plist path, relative to the - build directory, - * |dest_plist| is the destination plist path, relative to the - build directory, - * |defines| is a list of preprocessor defines (empty if the plist - shouldn't be preprocessed, - * |extra_env| is a dict of env variables that should be exported when - invoking |mac_tool copy-info-plist|. - - Only call this for mac bundle targets. - - Args: - product_dir: Path to the directory containing the output bundle, - relative to the build directory. - xcode_settings: The XcodeSettings of the current target. - gyp_to_build_path: A function that converts paths relative to the - current gyp file to paths relative to the build directory. - """ - info_plist = xcode_settings.GetPerTargetSetting("INFOPLIST_FILE") - if not info_plist: - return None, None, [], {} - - # The make generator doesn't support it, so forbid it everywhere - # to keep the generators more interchangeable. - assert " " not in info_plist, ( - "Spaces in Info.plist filenames not supported (%s)" % info_plist - ) - - info_plist = gyp_path_to_build_path(info_plist) - - # If explicitly set to preprocess the plist, invoke the C preprocessor and - # specify any defines as -D flags. - if ( - xcode_settings.GetPerTargetSetting("INFOPLIST_PREPROCESS", default="NO") - == "YES" - ): - # Create an intermediate file based on the path. - defines = shlex.split( - xcode_settings.GetPerTargetSetting( - "INFOPLIST_PREPROCESSOR_DEFINITIONS", default="" - ) - ) - else: - defines = [] - - dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) - extra_env = xcode_settings.GetPerTargetSettings() - - return info_plist, dest_plist, defines, extra_env - - -def _GetXcodeEnv( - xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None -): - """Return the environment variables that Xcode would set. See - http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 - for a full list. - - Args: - xcode_settings: An XcodeSettings object. If this is None, this function - returns an empty dict. - built_products_dir: Absolute path to the built products dir. - srcroot: Absolute path to the source root. - configuration: The build configuration name. - additional_settings: An optional dict with more values to add to the - result. - """ - - if not xcode_settings: - return {} - - # This function is considered a friend of XcodeSettings, so let it reach into - # its implementation details. - spec = xcode_settings.spec - - # These are filled in on an as-needed basis. - env = { - "BUILT_FRAMEWORKS_DIR": built_products_dir, - "BUILT_PRODUCTS_DIR": built_products_dir, - "CONFIGURATION": configuration, - "PRODUCT_NAME": xcode_settings.GetProductName(), - # For FULL_PRODUCT_NAME see: - # /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec # noqa: E501 - "SRCROOT": srcroot, - "SOURCE_ROOT": "${SRCROOT}", - # This is not true for static libraries, but currently the env is only - # written for bundles: - "TARGET_BUILD_DIR": built_products_dir, - "TEMP_DIR": "${TMPDIR}", - "XCODE_VERSION_ACTUAL": XcodeVersion()[0], - } - if xcode_settings.GetPerConfigSetting("SDKROOT", configuration): - env["SDKROOT"] = xcode_settings._SdkPath(configuration) - else: - env["SDKROOT"] = "" - - if xcode_settings.mac_toolchain_dir: - env["DEVELOPER_DIR"] = xcode_settings.mac_toolchain_dir - - if spec["type"] in ( - "executable", - "static_library", - "shared_library", - "loadable_module", - ): - env["EXECUTABLE_NAME"] = xcode_settings.GetExecutableName() - env["EXECUTABLE_PATH"] = xcode_settings.GetExecutablePath() - env["FULL_PRODUCT_NAME"] = xcode_settings.GetFullProductName() - mach_o_type = xcode_settings.GetMachOType() - if mach_o_type: - env["MACH_O_TYPE"] = mach_o_type - env["PRODUCT_TYPE"] = xcode_settings.GetProductType() - if xcode_settings._IsBundle(): - # xcodeproj_file.py sets the same Xcode subfolder value for this as for - # FRAMEWORKS_FOLDER_PATH so Xcode builds will actually use FFP's value. - env["BUILT_FRAMEWORKS_DIR"] = os.path.join( - built_products_dir + os.sep + xcode_settings.GetBundleFrameworksFolderPath() - ) - env["CONTENTS_FOLDER_PATH"] = xcode_settings.GetBundleContentsFolderPath() - env["EXECUTABLE_FOLDER_PATH"] = xcode_settings.GetBundleExecutableFolderPath() - env[ - "UNLOCALIZED_RESOURCES_FOLDER_PATH" - ] = xcode_settings.GetBundleResourceFolder() - env["JAVA_FOLDER_PATH"] = xcode_settings.GetBundleJavaFolderPath() - env["FRAMEWORKS_FOLDER_PATH"] = xcode_settings.GetBundleFrameworksFolderPath() - env[ - "SHARED_FRAMEWORKS_FOLDER_PATH" - ] = xcode_settings.GetBundleSharedFrameworksFolderPath() - env[ - "SHARED_SUPPORT_FOLDER_PATH" - ] = xcode_settings.GetBundleSharedSupportFolderPath() - env["PLUGINS_FOLDER_PATH"] = xcode_settings.GetBundlePlugInsFolderPath() - env["XPCSERVICES_FOLDER_PATH"] = xcode_settings.GetBundleXPCServicesFolderPath() - env["INFOPLIST_PATH"] = xcode_settings.GetBundlePlistPath() - env["WRAPPER_NAME"] = xcode_settings.GetWrapperName() - - install_name = xcode_settings.GetInstallName() - if install_name: - env["LD_DYLIB_INSTALL_NAME"] = install_name - install_name_base = xcode_settings.GetInstallNameBase() - if install_name_base: - env["DYLIB_INSTALL_NAME_BASE"] = install_name_base - xcode_version, _ = XcodeVersion() - if xcode_version >= "0500" and not env.get("SDKROOT"): - sdk_root = xcode_settings._SdkRoot(configuration) - if not sdk_root: - sdk_root = xcode_settings._XcodeSdkPath("") - if sdk_root is None: - sdk_root = "" - env["SDKROOT"] = sdk_root - - if not additional_settings: - additional_settings = {} - else: - # Flatten lists to strings. - for k in additional_settings: - if not isinstance(additional_settings[k], str): - additional_settings[k] = " ".join(additional_settings[k]) - additional_settings.update(env) - - for k in additional_settings: - additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) - - return additional_settings - - -def _NormalizeEnvVarReferences(str): - """Takes a string containing variable references in the form ${FOO}, $(FOO), - or $FOO, and returns a string with all variable references in the form ${FOO}. - """ - # $FOO -> ${FOO} - str = re.sub(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", r"${\1}", str) - - # $(FOO) -> ${FOO} - matches = re.findall(r"(\$\(([a-zA-Z0-9\-_]+)\))", str) - for match in matches: - to_replace, variable = match - assert "$(" not in match, "$($(FOO)) variables not supported: " + match - str = str.replace(to_replace, "${" + variable + "}") - - return str - - -def ExpandEnvVars(string, expansions): - """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the - expansions list. If the variable expands to something that references - another variable, this variable is expanded as well if it's in env -- - until no variables present in env are left.""" - for k, v in reversed(expansions): - string = string.replace("${" + k + "}", v) - string = string.replace("$(" + k + ")", v) - string = string.replace("$" + k, v) - return string - - -def _TopologicallySortedEnvVarKeys(env): - """Takes a dict |env| whose values are strings that can refer to other keys, - for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of - env such that key2 is after key1 in L if env[key2] refers to env[key1]. - - Throws an Exception in case of dependency cycles. - """ - # Since environment variables can refer to other variables, the evaluation - # order is important. Below is the logic to compute the dependency graph - # and sort it. - regex = re.compile(r"\$\{([a-zA-Z0-9\-_]+)\}") - - def GetEdges(node): - # Use a definition of edges such that user_of_variable -> used_varible. - # This happens to be easier in this case, since a variable's - # definition contains all variables it references in a single string. - # We can then reverse the result of the topological sort at the end. - # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) - matches = {v for v in regex.findall(env[node]) if v in env} - for dependee in matches: - assert "${" not in dependee, "Nested variables not supported: " + dependee - return matches - - try: - # Topologically sort, and then reverse, because we used an edge definition - # that's inverted from the expected result of this function (see comment - # above). - order = gyp.common.TopologicallySorted(env.keys(), GetEdges) - order.reverse() - return order - except gyp.common.CycleError as e: - raise GypError( - "Xcode environment variables are cyclically dependent: " + str(e.nodes) - ) - - -def GetSortedXcodeEnv( - xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None -): - env = _GetXcodeEnv( - xcode_settings, built_products_dir, srcroot, configuration, additional_settings - ) - return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] - - -def GetSpecPostbuildCommands(spec, quiet=False): - """Returns the list of postbuilds explicitly defined on |spec|, in a form - executable by a shell.""" - postbuilds = [] - for postbuild in spec.get("postbuilds", []): - if not quiet: - postbuilds.append( - "echo POSTBUILD\\(%s\\) %s" - % (spec["target_name"], postbuild["postbuild_name"]) - ) - postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild["action"])) - return postbuilds - - -def _HasIOSTarget(targets): - """Returns true if any target contains the iOS specific key - IPHONEOS_DEPLOYMENT_TARGET.""" - for target_dict in targets.values(): - for config in target_dict["configurations"].values(): - if config.get("xcode_settings", {}).get("IPHONEOS_DEPLOYMENT_TARGET"): - return True - return False - - -def _AddIOSDeviceConfigurations(targets): - """Clone all targets and append -iphoneos to the name. Configure these targets - to build for iOS devices and use correct architectures for those builds.""" - for target_dict in targets.values(): - toolset = target_dict["toolset"] - configs = target_dict["configurations"] - for config_name, simulator_config_dict in dict(configs).items(): - iphoneos_config_dict = copy.deepcopy(simulator_config_dict) - configs[config_name + "-iphoneos"] = iphoneos_config_dict - configs[config_name + "-iphonesimulator"] = simulator_config_dict - if toolset == "target": - simulator_config_dict["xcode_settings"]["SDKROOT"] = "iphonesimulator" - iphoneos_config_dict["xcode_settings"]["SDKROOT"] = "iphoneos" - return targets - - -def CloneConfigurationForDeviceAndEmulator(target_dicts): - """If |target_dicts| contains any iOS targets, automatically create -iphoneos - targets for iOS device builds.""" - if _HasIOSTarget(target_dicts): - return _AddIOSDeviceConfigurations(target_dicts) - return target_dicts diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py deleted file mode 100644 index bb74eacbe..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +++ /dev/null @@ -1,302 +0,0 @@ -# Copyright (c) 2014 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Xcode-ninja wrapper project file generator. - -This updates the data structures passed to the Xcode gyp generator to build -with ninja instead. The Xcode project itself is transformed into a list of -executable targets, each with a build step to build with ninja, and a target -with every source and resource file. This appears to sidestep some of the -major performance headaches experienced using complex projects and large number -of targets within Xcode. -""" - -import errno -import gyp.generator.ninja -import os -import re -import xml.sax.saxutils - - -def _WriteWorkspace(main_gyp, sources_gyp, params): - """ Create a workspace to wrap main and sources gyp paths. """ - (build_file_root, build_file_ext) = os.path.splitext(main_gyp) - workspace_path = build_file_root + ".xcworkspace" - options = params["options"] - if options.generator_output: - workspace_path = os.path.join(options.generator_output, workspace_path) - try: - os.makedirs(workspace_path) - except OSError as e: - if e.errno != errno.EEXIST: - raise - output_string = ( - '\n' + '\n' - ) - for gyp_name in [main_gyp, sources_gyp]: - name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj" - name = xml.sax.saxutils.quoteattr("group:" + name) - output_string += " \n" % name - output_string += "\n" - - workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata") - - try: - with open(workspace_file) as input_file: - input_string = input_file.read() - if input_string == output_string: - return - except OSError: - # Ignore errors if the file doesn't exist. - pass - - with open(workspace_file, "w") as output_file: - output_file.write(output_string) - - -def _TargetFromSpec(old_spec, params): - """ Create fake target for xcode-ninja wrapper. """ - # Determine ninja top level build dir (e.g. /path/to/out). - ninja_toplevel = None - jobs = 0 - if params: - options = params["options"] - ninja_toplevel = os.path.join( - options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params) - ) - jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0) - - target_name = old_spec.get("target_name") - product_name = old_spec.get("product_name", target_name) - product_extension = old_spec.get("product_extension") - - ninja_target = {} - ninja_target["target_name"] = target_name - ninja_target["product_name"] = product_name - if product_extension: - ninja_target["product_extension"] = product_extension - ninja_target["toolset"] = old_spec.get("toolset") - ninja_target["default_configuration"] = old_spec.get("default_configuration") - ninja_target["configurations"] = {} - - # Tell Xcode to look in |ninja_toplevel| for build products. - new_xcode_settings = {} - if ninja_toplevel: - new_xcode_settings["CONFIGURATION_BUILD_DIR"] = ( - "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel - ) - - if "configurations" in old_spec: - for config in old_spec["configurations"]: - old_xcode_settings = old_spec["configurations"][config].get( - "xcode_settings", {} - ) - if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings: - new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO" - new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[ - "IPHONEOS_DEPLOYMENT_TARGET" - ] - for key in ["BUNDLE_LOADER", "TEST_HOST"]: - if key in old_xcode_settings: - new_xcode_settings[key] = old_xcode_settings[key] - - ninja_target["configurations"][config] = {} - ninja_target["configurations"][config][ - "xcode_settings" - ] = new_xcode_settings - - ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0) - ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0) - ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0) - ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0) - ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0) - ninja_target["type"] = old_spec["type"] - if ninja_toplevel: - ninja_target["actions"] = [ - { - "action_name": "Compile and copy %s via ninja" % target_name, - "inputs": [], - "outputs": [], - "action": [ - "env", - "PATH=%s" % os.environ["PATH"], - "ninja", - "-C", - new_xcode_settings["CONFIGURATION_BUILD_DIR"], - target_name, - ], - "message": "Compile and copy %s via ninja" % target_name, - }, - ] - if jobs > 0: - ninja_target["actions"][0]["action"].extend(("-j", jobs)) - return ninja_target - - -def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): - """Limit targets for Xcode wrapper. - - Xcode sometimes performs poorly with too many targets, so only include - proper executable targets, with filters to customize. - Arguments: - target_extras: Regular expression to always add, matching any target. - executable_target_pattern: Regular expression limiting executable targets. - spec: Specifications for target. - """ - target_name = spec.get("target_name") - # Always include targets matching target_extras. - if target_extras is not None and re.search(target_extras, target_name): - return True - - # Otherwise just show executable targets and xc_tests. - if int(spec.get("mac_xctest_bundle", 0)) != 0 or ( - spec.get("type", "") == "executable" - and spec.get("product_extension", "") != "bundle" - ): - - # If there is a filter and the target does not match, exclude the target. - if executable_target_pattern is not None: - if not re.search(executable_target_pattern, target_name): - return False - return True - return False - - -def CreateWrapper(target_list, target_dicts, data, params): - """Initialize targets for the ninja wrapper. - - This sets up the necessary variables in the targets to generate Xcode projects - that use ninja as an external builder. - Arguments: - target_list: List of target pairs: 'base/base.gyp:base'. - target_dicts: Dict of target properties keyed on target pair. - data: Dict of flattened build files keyed on gyp path. - params: Dict of global options for gyp. - """ - orig_gyp = params["build_files"][0] - for gyp_name, gyp_dict in data.items(): - if gyp_name == orig_gyp: - depth = gyp_dict["_DEPTH"] - - # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE - # and prepend .ninja before the .gyp extension. - generator_flags = params.get("generator_flags", {}) - main_gyp = generator_flags.get("xcode_ninja_main_gyp", None) - if main_gyp is None: - (build_file_root, build_file_ext) = os.path.splitext(orig_gyp) - main_gyp = build_file_root + ".ninja" + build_file_ext - - # Create new |target_list|, |target_dicts| and |data| data structures. - new_target_list = [] - new_target_dicts = {} - new_data = {} - - # Set base keys needed for |data|. - new_data[main_gyp] = {} - new_data[main_gyp]["included_files"] = [] - new_data[main_gyp]["targets"] = [] - new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) - - # Normally the xcode-ninja generator includes only valid executable targets. - # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to - # executable targets that match the pattern. (Default all) - executable_target_pattern = generator_flags.get( - "xcode_ninja_executable_target_pattern", None - ) - - # For including other non-executable targets, add the matching target name - # to the |xcode_ninja_target_pattern| regular expression. (Default none) - target_extras = generator_flags.get("xcode_ninja_target_pattern", None) - - for old_qualified_target in target_list: - spec = target_dicts[old_qualified_target] - if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): - # Add to new_target_list. - target_name = spec.get("target_name") - new_target_name = f"{main_gyp}:{target_name}#target" - new_target_list.append(new_target_name) - - # Add to new_target_dicts. - new_target_dicts[new_target_name] = _TargetFromSpec(spec, params) - - # Add to new_data. - for old_target in data[old_qualified_target.split(":")[0]]["targets"]: - if old_target["target_name"] == target_name: - new_data_target = {} - new_data_target["target_name"] = old_target["target_name"] - new_data_target["toolset"] = old_target["toolset"] - new_data[main_gyp]["targets"].append(new_data_target) - - # Create sources target. - sources_target_name = "sources_for_indexing" - sources_target = _TargetFromSpec( - { - "target_name": sources_target_name, - "toolset": "target", - "default_configuration": "Default", - "mac_bundle": "0", - "type": "executable", - }, - None, - ) - - # Tell Xcode to look everywhere for headers. - sources_target["configurations"] = {"Default": {"include_dirs": [depth]}} - - # Put excluded files into the sources target so they can be opened in Xcode. - skip_excluded_files = not generator_flags.get( - "xcode_ninja_list_excluded_files", True - ) - - sources = [] - for target, target_dict in target_dicts.items(): - base = os.path.dirname(target) - files = target_dict.get("sources", []) + target_dict.get( - "mac_bundle_resources", [] - ) - - if not skip_excluded_files: - files.extend( - target_dict.get("sources_excluded", []) - + target_dict.get("mac_bundle_resources_excluded", []) - ) - - for action in target_dict.get("actions", []): - files.extend(action.get("inputs", [])) - - if not skip_excluded_files: - files.extend(action.get("inputs_excluded", [])) - - # Remove files starting with $. These are mostly intermediate files for the - # build system. - files = [file for file in files if not file.startswith("$")] - - # Make sources relative to root build file. - relative_path = os.path.dirname(main_gyp) - sources += [ - os.path.relpath(os.path.join(base, file), relative_path) for file in files - ] - - sources_target["sources"] = sorted(set(sources)) - - # Put sources_to_index in it's own gyp. - sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp") - fully_qualified_target_name = f"{sources_gyp}:{sources_target_name}#target" - - # Add to new_target_list, new_target_dicts and new_data. - new_target_list.append(fully_qualified_target_name) - new_target_dicts[fully_qualified_target_name] = sources_target - new_data_target = {} - new_data_target["target_name"] = sources_target["target_name"] - new_data_target["_DEPTH"] = depth - new_data_target["toolset"] = "target" - new_data[sources_gyp] = {} - new_data[sources_gyp]["targets"] = [] - new_data[sources_gyp]["included_files"] = [] - new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) - new_data[sources_gyp]["targets"].append(new_data_target) - - # Write workspace to file. - _WriteWorkspace(main_gyp, sources_gyp, params) - return (new_target_list, new_target_dicts, new_data) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py deleted file mode 100644 index 0e941eb47..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +++ /dev/null @@ -1,3197 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Xcode project file generator. - -This module is both an Xcode project file generator and a documentation of the -Xcode project file format. Knowledge of the project file format was gained -based on extensive experience with Xcode, and by making changes to projects in -Xcode.app and observing the resultant changes in the associated project files. - -XCODE PROJECT FILES - -The generator targets the file format as written by Xcode 3.2 (specifically, -3.2.6), but past experience has taught that the format has not changed -significantly in the past several years, and future versions of Xcode are able -to read older project files. - -Xcode project files are "bundled": the project "file" from an end-user's -perspective is actually a directory with an ".xcodeproj" extension. The -project file from this module's perspective is actually a file inside this -directory, always named "project.pbxproj". This file contains a complete -description of the project and is all that is needed to use the xcodeproj. -Other files contained in the xcodeproj directory are simply used to store -per-user settings, such as the state of various UI elements in the Xcode -application. - -The project.pbxproj file is a property list, stored in a format almost -identical to the NeXTstep property list format. The file is able to carry -Unicode data, and is encoded in UTF-8. The root element in the property list -is a dictionary that contains several properties of minimal interest, and two -properties of immense interest. The most important property is a dictionary -named "objects". The entire structure of the project is represented by the -children of this property. The objects dictionary is keyed by unique 96-bit -values represented by 24 uppercase hexadecimal characters. Each value in the -objects dictionary is itself a dictionary, describing an individual object. - -Each object in the dictionary is a member of a class, which is identified by -the "isa" property of each object. A variety of classes are represented in a -project file. Objects can refer to other objects by ID, using the 24-character -hexadecimal object key. A project's objects form a tree, with a root object -of class PBXProject at the root. As an example, the PBXProject object serves -as parent to an XCConfigurationList object defining the build configurations -used in the project, a PBXGroup object serving as a container for all files -referenced in the project, and a list of target objects, each of which defines -a target in the project. There are several different types of target object, -such as PBXNativeTarget and PBXAggregateTarget. In this module, this -relationship is expressed by having each target type derive from an abstract -base named XCTarget. - -The project.pbxproj file's root dictionary also contains a property, sibling to -the "objects" dictionary, named "rootObject". The value of rootObject is a -24-character object key referring to the root PBXProject object in the -objects dictionary. - -In Xcode, every file used as input to a target or produced as a final product -of a target must appear somewhere in the hierarchy rooted at the PBXGroup -object referenced by the PBXProject's mainGroup property. A PBXGroup is -generally represented as a folder in the Xcode application. PBXGroups can -contain other PBXGroups as well as PBXFileReferences, which are pointers to -actual files. - -Each XCTarget contains a list of build phases, represented in this module by -the abstract base XCBuildPhase. Examples of concrete XCBuildPhase derivations -are PBXSourcesBuildPhase and PBXFrameworksBuildPhase, which correspond to the -"Compile Sources" and "Link Binary With Libraries" phases displayed in the -Xcode application. Files used as input to these phases (for example, source -files in the former case and libraries and frameworks in the latter) are -represented by PBXBuildFile objects, referenced by elements of "files" lists -in XCTarget objects. Each PBXBuildFile object refers to a PBXBuildFile -object as a "weak" reference: it does not "own" the PBXBuildFile, which is -owned by the root object's mainGroup or a descendant group. In most cases, the -layer of indirection between an XCBuildPhase and a PBXFileReference via a -PBXBuildFile appears extraneous, but there's actually one reason for this: -file-specific compiler flags are added to the PBXBuildFile object so as to -allow a single file to be a member of multiple targets while having distinct -compiler flags for each. These flags can be modified in the Xcode applciation -in the "Build" tab of a File Info window. - -When a project is open in the Xcode application, Xcode will rewrite it. As -such, this module is careful to adhere to the formatting used by Xcode, to -avoid insignificant changes appearing in the file when it is used in the -Xcode application. This will keep version control repositories happy, and -makes it possible to compare a project file used in Xcode to one generated by -this module to determine if any significant changes were made in the -application. - -Xcode has its own way of assigning 24-character identifiers to each object, -which is not duplicated here. Because the identifier only is only generated -once, when an object is created, and is then left unchanged, there is no need -to attempt to duplicate Xcode's behavior in this area. The generator is free -to select any identifier, even at random, to refer to the objects it creates, -and Xcode will retain those identifiers and use them when subsequently -rewriting the project file. However, the generator would choose new random -identifiers each time the project files are generated, leading to difficulties -comparing "used" project files to "pristine" ones produced by this module, -and causing the appearance of changes as every object identifier is changed -when updated projects are checked in to a version control repository. To -mitigate this problem, this module chooses identifiers in a more deterministic -way, by hashing a description of each object as well as its parent and ancestor -objects. This strategy should result in minimal "shift" in IDs as successive -generations of project files are produced. - -THIS MODULE - -This module introduces several classes, all derived from the XCObject class. -Nearly all of the "brains" are built into the XCObject class, which understands -how to create and modify objects, maintain the proper tree structure, compute -identifiers, and print objects. For the most part, classes derived from -XCObject need only provide a _schema class object, a dictionary that -expresses what properties objects of the class may contain. - -Given this structure, it's possible to build a minimal project file by creating -objects of the appropriate types and making the proper connections: - - config_list = XCConfigurationList() - group = PBXGroup() - project = PBXProject({'buildConfigurationList': config_list, - 'mainGroup': group}) - -With the project object set up, it can be added to an XCProjectFile object. -XCProjectFile is a pseudo-class in the sense that it is a concrete XCObject -subclass that does not actually correspond to a class type found in a project -file. Rather, it is used to represent the project file's root dictionary. -Printing an XCProjectFile will print the entire project file, including the -full "objects" dictionary. - - project_file = XCProjectFile({'rootObject': project}) - project_file.ComputeIDs() - project_file.Print() - -Xcode project files are always encoded in UTF-8. This module will accept -strings of either the str class or the unicode class. Strings of class str -are assumed to already be encoded in UTF-8. Obviously, if you're just using -ASCII, you won't encounter difficulties because ASCII is a UTF-8 subset. -Strings of class unicode are handled properly and encoded in UTF-8 when -a project file is output. -""" - -import gyp.common -from functools import cmp_to_key -import hashlib -from operator import attrgetter -import posixpath -import re -import struct -import sys - - -def cmp(x, y): - return (x > y) - (x < y) - - -# See XCObject._EncodeString. This pattern is used to determine when a string -# can be printed unquoted. Strings that match this pattern may be printed -# unquoted. Strings that do not match must be quoted and may be further -# transformed to be properly encoded. Note that this expression matches the -# characters listed with "+", for 1 or more occurrences: if a string is empty, -# it must not match this pattern, because it needs to be encoded as "". -_unquoted = re.compile("^[A-Za-z0-9$./_]+$") - -# Strings that match this pattern are quoted regardless of what _unquoted says. -# Oddly, Xcode will quote any string with a run of three or more underscores. -_quoted = re.compile("___") - -# This pattern should match any character that needs to be escaped by -# XCObject._EncodeString. See that function. -_escaped = re.compile('[\\\\"]|[\x00-\x1f]') - - -# Used by SourceTreeAndPathFromPath -_path_leading_variable = re.compile(r"^\$\((.*?)\)(/(.*))?$") - - -def SourceTreeAndPathFromPath(input_path): - """Given input_path, returns a tuple with sourceTree and path values. - - Examples: - input_path (source_tree, output_path) - '$(VAR)/path' ('VAR', 'path') - '$(VAR)' ('VAR', None) - 'path' (None, 'path') - """ - - source_group_match = _path_leading_variable.match(input_path) - if source_group_match: - source_tree = source_group_match.group(1) - output_path = source_group_match.group(3) # This may be None. - else: - source_tree = None - output_path = input_path - - return (source_tree, output_path) - - -def ConvertVariablesToShellSyntax(input_string): - return re.sub(r"\$\((.*?)\)", "${\\1}", input_string) - - -class XCObject: - """The abstract base of all class types used in Xcode project files. - - Class variables: - _schema: A dictionary defining the properties of this class. The keys to - _schema are string property keys as used in project files. Values - are a list of four or five elements: - [ is_list, property_type, is_strong, is_required, default ] - is_list: True if the property described is a list, as opposed - to a single element. - property_type: The type to use as the value of the property, - or if is_list is True, the type to use for each - element of the value's list. property_type must - be an XCObject subclass, or one of the built-in - types str, int, or dict. - is_strong: If property_type is an XCObject subclass, is_strong - is True to assert that this class "owns," or serves - as parent, to the property value (or, if is_list is - True, values). is_strong must be False if - property_type is not an XCObject subclass. - is_required: True if the property is required for the class. - Note that is_required being True does not preclude - an empty string ("", in the case of property_type - str) or list ([], in the case of is_list True) from - being set for the property. - default: Optional. If is_required is True, default may be set - to provide a default value for objects that do not supply - their own value. If is_required is True and default - is not provided, users of the class must supply their own - value for the property. - Note that although the values of the array are expressed in - boolean terms, subclasses provide values as integers to conserve - horizontal space. - _should_print_single_line: False in XCObject. Subclasses whose objects - should be written to the project file in the - alternate single-line format, such as - PBXFileReference and PBXBuildFile, should - set this to True. - _encode_transforms: Used by _EncodeString to encode unprintable characters. - The index into this list is the ordinal of the - character to transform; each value is a string - used to represent the character in the output. XCObject - provides an _encode_transforms list suitable for most - XCObject subclasses. - _alternate_encode_transforms: Provided for subclasses that wish to use - the alternate encoding rules. Xcode seems - to use these rules when printing objects in - single-line format. Subclasses that desire - this behavior should set _encode_transforms - to _alternate_encode_transforms. - _hashables: A list of XCObject subclasses that can be hashed by ComputeIDs - to construct this object's ID. Most classes that need custom - hashing behavior should do it by overriding Hashables, - but in some cases an object's parent may wish to push a - hashable value into its child, and it can do so by appending - to _hashables. - Attributes: - id: The object's identifier, a 24-character uppercase hexadecimal string. - Usually, objects being created should not set id until the entire - project file structure is built. At that point, UpdateIDs() should - be called on the root object to assign deterministic values for id to - each object in the tree. - parent: The object's parent. This is set by a parent XCObject when a child - object is added to it. - _properties: The object's property dictionary. An object's properties are - described by its class' _schema variable. - """ - - _schema = {} - _should_print_single_line = False - - # See _EncodeString. - _encode_transforms = [] - i = 0 - while i < ord(" "): - _encode_transforms.append("\\U%04x" % i) - i = i + 1 - _encode_transforms[7] = "\\a" - _encode_transforms[8] = "\\b" - _encode_transforms[9] = "\\t" - _encode_transforms[10] = "\\n" - _encode_transforms[11] = "\\v" - _encode_transforms[12] = "\\f" - _encode_transforms[13] = "\\n" - - _alternate_encode_transforms = list(_encode_transforms) - _alternate_encode_transforms[9] = chr(9) - _alternate_encode_transforms[10] = chr(10) - _alternate_encode_transforms[11] = chr(11) - - def __init__(self, properties=None, id=None, parent=None): - self.id = id - self.parent = parent - self._properties = {} - self._hashables = [] - self._SetDefaultsFromSchema() - self.UpdateProperties(properties) - - def __repr__(self): - try: - name = self.Name() - except NotImplementedError: - return f"<{self.__class__.__name__} at 0x{id(self):x}>" - return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" - - def Copy(self): - """Make a copy of this object. - - The new object will have its own copy of lists and dicts. Any XCObject - objects owned by this object (marked "strong") will be copied in the - new object, even those found in lists. If this object has any weak - references to other XCObjects, the same references are added to the new - object without making a copy. - """ - - that = self.__class__(id=self.id, parent=self.parent) - for key, value in self._properties.items(): - is_strong = self._schema[key][2] - - if isinstance(value, XCObject): - if is_strong: - new_value = value.Copy() - new_value.parent = that - that._properties[key] = new_value - else: - that._properties[key] = value - elif isinstance(value, (str, int)): - that._properties[key] = value - elif isinstance(value, list): - if is_strong: - # If is_strong is True, each element is an XCObject, so it's safe to - # call Copy. - that._properties[key] = [] - for item in value: - new_item = item.Copy() - new_item.parent = that - that._properties[key].append(new_item) - else: - that._properties[key] = value[:] - elif isinstance(value, dict): - # dicts are never strong. - if is_strong: - raise TypeError( - "Strong dict for key " + key + " in " + self.__class__.__name__ - ) - else: - that._properties[key] = value.copy() - else: - raise TypeError( - "Unexpected type " - + value.__class__.__name__ - + " for key " - + key - + " in " - + self.__class__.__name__ - ) - - return that - - def Name(self): - """Return the name corresponding to an object. - - Not all objects necessarily need to be nameable, and not all that do have - a "name" property. Override as needed. - """ - - # If the schema indicates that "name" is required, try to access the - # property even if it doesn't exist. This will result in a KeyError - # being raised for the property that should be present, which seems more - # appropriate than NotImplementedError in this case. - if "name" in self._properties or ( - "name" in self._schema and self._schema["name"][3] - ): - return self._properties["name"] - - raise NotImplementedError(self.__class__.__name__ + " must implement Name") - - def Comment(self): - """Return a comment string for the object. - - Most objects just use their name as the comment, but PBXProject uses - different values. - - The returned comment is not escaped and does not have any comment marker - strings applied to it. - """ - - return self.Name() - - def Hashables(self): - hashables = [self.__class__.__name__] - - name = self.Name() - if name is not None: - hashables.append(name) - - hashables.extend(self._hashables) - - return hashables - - def HashablesForChild(self): - return None - - def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): - """Set "id" properties deterministically. - - An object's "id" property is set based on a hash of its class type and - name, as well as the class type and name of all ancestor objects. As - such, it is only advisable to call ComputeIDs once an entire project file - tree is built. - - If recursive is True, recurse into all descendant objects and update their - hashes. - - If overwrite is True, any existing value set in the "id" property will be - replaced. - """ - - def _HashUpdate(hash, data): - """Update hash with data's length and contents. - - If the hash were updated only with the value of data, it would be - possible for clowns to induce collisions by manipulating the names of - their objects. By adding the length, it's exceedingly less likely that - ID collisions will be encountered, intentionally or not. - """ - - hash.update(struct.pack(">i", len(data))) - if isinstance(data, str): - data = data.encode("utf-8") - hash.update(data) - - if seed_hash is None: - seed_hash = hashlib.sha1() - - hash = seed_hash.copy() - - hashables = self.Hashables() - assert len(hashables) > 0 - for hashable in hashables: - _HashUpdate(hash, hashable) - - if recursive: - hashables_for_child = self.HashablesForChild() - if hashables_for_child is None: - child_hash = hash - else: - assert len(hashables_for_child) > 0 - child_hash = seed_hash.copy() - for hashable in hashables_for_child: - _HashUpdate(child_hash, hashable) - - for child in self.Children(): - child.ComputeIDs(recursive, overwrite, child_hash) - - if overwrite or self.id is None: - # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is - # is 160 bits. Instead of throwing out 64 bits of the digest, xor them - # into the portion that gets used. - assert hash.digest_size % 4 == 0 - digest_int_count = hash.digest_size // 4 - digest_ints = struct.unpack(">" + "I" * digest_int_count, hash.digest()) - id_ints = [0, 0, 0] - for index in range(0, digest_int_count): - id_ints[index % 3] ^= digest_ints[index] - self.id = "%08X%08X%08X" % tuple(id_ints) - - def EnsureNoIDCollisions(self): - """Verifies that no two objects have the same ID. Checks all descendants. - """ - - ids = {} - descendants = self.Descendants() - for descendant in descendants: - if descendant.id in ids: - other = ids[descendant.id] - raise KeyError( - 'Duplicate ID %s, objects "%s" and "%s" in "%s"' - % ( - descendant.id, - str(descendant._properties), - str(other._properties), - self._properties["rootObject"].Name(), - ) - ) - ids[descendant.id] = descendant - - def Children(self): - """Returns a list of all of this object's owned (strong) children.""" - - children = [] - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong) = attributes[0:3] - if is_strong and property in self._properties: - if not is_list: - children.append(self._properties[property]) - else: - children.extend(self._properties[property]) - return children - - def Descendants(self): - """Returns a list of all of this object's descendants, including this - object. - """ - - children = self.Children() - descendants = [self] - for child in children: - descendants.extend(child.Descendants()) - return descendants - - def PBXProjectAncestor(self): - # The base case for recursion is defined at PBXProject.PBXProjectAncestor. - if self.parent: - return self.parent.PBXProjectAncestor() - return None - - def _EncodeComment(self, comment): - """Encodes a comment to be placed in the project file output, mimicking - Xcode behavior. - """ - - # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If - # the string already contains a "*/", it is turned into "(*)/". This keeps - # the file writer from outputting something that would be treated as the - # end of a comment in the middle of something intended to be entirely a - # comment. - - return "/* " + comment.replace("*/", "(*)/") + " */" - - def _EncodeTransform(self, match): - # This function works closely with _EncodeString. It will only be called - # by re.sub with match.group(0) containing a character matched by the - # the _escaped expression. - char = match.group(0) - - # Backslashes (\) and quotation marks (") are always replaced with a - # backslash-escaped version of the same. Everything else gets its - # replacement from the class' _encode_transforms array. - if char == "\\": - return "\\\\" - if char == '"': - return '\\"' - return self._encode_transforms[ord(char)] - - def _EncodeString(self, value): - """Encodes a string to be placed in the project file output, mimicking - Xcode behavior. - """ - - # Use quotation marks when any character outside of the range A-Z, a-z, 0-9, - # $ (dollar sign), . (period), and _ (underscore) is present. Also use - # quotation marks to represent empty strings. - # - # Escape " (double-quote) and \ (backslash) by preceding them with a - # backslash. - # - # Some characters below the printable ASCII range are encoded specially: - # 7 ^G BEL is encoded as "\a" - # 8 ^H BS is encoded as "\b" - # 11 ^K VT is encoded as "\v" - # 12 ^L NP is encoded as "\f" - # 127 ^? DEL is passed through as-is without escaping - # - In PBXFileReference and PBXBuildFile objects: - # 9 ^I HT is passed through as-is without escaping - # 10 ^J NL is passed through as-is without escaping - # 13 ^M CR is passed through as-is without escaping - # - In other objects: - # 9 ^I HT is encoded as "\t" - # 10 ^J NL is encoded as "\n" - # 13 ^M CR is encoded as "\n" rendering it indistinguishable from - # 10 ^J NL - # All other characters within the ASCII control character range (0 through - # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point - # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e". - # Characters above the ASCII range are passed through to the output encoded - # as UTF-8 without any escaping. These mappings are contained in the - # class' _encode_transforms list. - - if _unquoted.search(value) and not _quoted.search(value): - return value - - return '"' + _escaped.sub(self._EncodeTransform, value) + '"' - - def _XCPrint(self, file, tabs, line): - file.write("\t" * tabs + line) - - def _XCPrintableValue(self, tabs, value, flatten_list=False): - """Returns a representation of value that may be printed in a project file, - mimicking Xcode's behavior. - - _XCPrintableValue can handle str and int values, XCObjects (which are - made printable by returning their id property), and list and dict objects - composed of any of the above types. When printing a list or dict, and - _should_print_single_line is False, the tabs parameter is used to determine - how much to indent the lines corresponding to the items in the list or - dict. - - If flatten_list is True, single-element lists will be transformed into - strings. - """ - - printable = "" - comment = None - - if self._should_print_single_line: - sep = " " - element_tabs = "" - end_tabs = "" - else: - sep = "\n" - element_tabs = "\t" * (tabs + 1) - end_tabs = "\t" * tabs - - if isinstance(value, XCObject): - printable += value.id - comment = value.Comment() - elif isinstance(value, str): - printable += self._EncodeString(value) - elif isinstance(value, str): - printable += self._EncodeString(value.encode("utf-8")) - elif isinstance(value, int): - printable += str(value) - elif isinstance(value, list): - if flatten_list and len(value) <= 1: - if len(value) == 0: - printable += self._EncodeString("") - else: - printable += self._EncodeString(value[0]) - else: - printable = "(" + sep - for item in value: - printable += ( - element_tabs - + self._XCPrintableValue(tabs + 1, item, flatten_list) - + "," - + sep - ) - printable += end_tabs + ")" - elif isinstance(value, dict): - printable = "{" + sep - for item_key, item_value in sorted(value.items()): - printable += ( - element_tabs - + self._XCPrintableValue(tabs + 1, item_key, flatten_list) - + " = " - + self._XCPrintableValue(tabs + 1, item_value, flatten_list) - + ";" - + sep - ) - printable += end_tabs + "}" - else: - raise TypeError("Can't make " + value.__class__.__name__ + " printable") - - if comment: - printable += " " + self._EncodeComment(comment) - - return printable - - def _XCKVPrint(self, file, tabs, key, value): - """Prints a key and value, members of an XCObject's _properties dictionary, - to file. - - tabs is an int identifying the indentation level. If the class' - _should_print_single_line variable is True, tabs is ignored and the - key-value pair will be followed by a space insead of a newline. - """ - - if self._should_print_single_line: - printable = "" - after_kv = " " - else: - printable = "\t" * tabs - after_kv = "\n" - - # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy - # objects without comments. Sometimes it prints them with comments, but - # the majority of the time, it doesn't. To avoid unnecessary changes to - # the project file after Xcode opens it, don't write comments for - # remoteGlobalIDString. This is a sucky hack and it would certainly be - # cleaner to extend the schema to indicate whether or not a comment should - # be printed, but since this is the only case where the problem occurs and - # Xcode itself can't seem to make up its mind, the hack will suffice. - # - # Also see PBXContainerItemProxy._schema['remoteGlobalIDString']. - if key == "remoteGlobalIDString" and isinstance(self, PBXContainerItemProxy): - value_to_print = value.id - else: - value_to_print = value - - # PBXBuildFile's settings property is represented in the output as a dict, - # but a hack here has it represented as a string. Arrange to strip off the - # quotes so that it shows up in the output as expected. - if key == "settings" and isinstance(self, PBXBuildFile): - strip_value_quotes = True - else: - strip_value_quotes = False - - # In another one-off, let's set flatten_list on buildSettings properties - # of XCBuildConfiguration objects, because that's how Xcode treats them. - if key == "buildSettings" and isinstance(self, XCBuildConfiguration): - flatten_list = True - else: - flatten_list = False - - try: - printable_key = self._XCPrintableValue(tabs, key, flatten_list) - printable_value = self._XCPrintableValue(tabs, value_to_print, flatten_list) - if ( - strip_value_quotes - and len(printable_value) > 1 - and printable_value[0] == '"' - and printable_value[-1] == '"' - ): - printable_value = printable_value[1:-1] - printable += printable_key + " = " + printable_value + ";" + after_kv - except TypeError as e: - gyp.common.ExceptionAppend(e, 'while printing key "%s"' % key) - raise - - self._XCPrint(file, 0, printable) - - def Print(self, file=sys.stdout): - """Prints a reprentation of this object to file, adhering to Xcode output - formatting. - """ - - self.VerifyHasRequiredProperties() - - if self._should_print_single_line: - # When printing an object in a single line, Xcode doesn't put any space - # between the beginning of a dictionary (or presumably a list) and the - # first contained item, so you wind up with snippets like - # ...CDEF = {isa = PBXFileReference; fileRef = 0123... - # If it were me, I would have put a space in there after the opening - # curly, but I guess this is just another one of those inconsistencies - # between how Xcode prints PBXFileReference and PBXBuildFile objects as - # compared to other objects. Mimic Xcode's behavior here by using an - # empty string for sep. - sep = "" - end_tabs = 0 - else: - sep = "\n" - end_tabs = 2 - - # Start the object. For example, '\t\tPBXProject = {\n'. - self._XCPrint(file, 2, self._XCPrintableValue(2, self) + " = {" + sep) - - # "isa" isn't in the _properties dictionary, it's an intrinsic property - # of the class which the object belongs to. Xcode always outputs "isa" - # as the first element of an object dictionary. - self._XCKVPrint(file, 3, "isa", self.__class__.__name__) - - # The remaining elements of an object dictionary are sorted alphabetically. - for property, value in sorted(self._properties.items()): - self._XCKVPrint(file, 3, property, value) - - # End the object. - self._XCPrint(file, end_tabs, "};\n") - - def UpdateProperties(self, properties, do_copy=False): - """Merge the supplied properties into the _properties dictionary. - - The input properties must adhere to the class schema or a KeyError or - TypeError exception will be raised. If adding an object of an XCObject - subclass and the schema indicates a strong relationship, the object's - parent will be set to this object. - - If do_copy is True, then lists, dicts, strong-owned XCObjects, and - strong-owned XCObjects in lists will be copied instead of having their - references added. - """ - - if properties is None: - return - - for property, value in properties.items(): - # Make sure the property is in the schema. - if property not in self._schema: - raise KeyError(property + " not in " + self.__class__.__name__) - - # Make sure the property conforms to the schema. - (is_list, property_type, is_strong) = self._schema[property][0:3] - if is_list: - if value.__class__ != list: - raise TypeError( - property - + " of " - + self.__class__.__name__ - + " must be list, not " - + value.__class__.__name__ - ) - for item in value: - if not isinstance(item, property_type) and not ( - isinstance(item, str) and property_type == str - ): - # Accept unicode where str is specified. str is treated as - # UTF-8-encoded. - raise TypeError( - "item of " - + property - + " of " - + self.__class__.__name__ - + " must be " - + property_type.__name__ - + ", not " - + item.__class__.__name__ - ) - elif not isinstance(value, property_type) and not ( - isinstance(value, str) and property_type == str - ): - # Accept unicode where str is specified. str is treated as - # UTF-8-encoded. - raise TypeError( - property - + " of " - + self.__class__.__name__ - + " must be " - + property_type.__name__ - + ", not " - + value.__class__.__name__ - ) - - # Checks passed, perform the assignment. - if do_copy: - if isinstance(value, XCObject): - if is_strong: - self._properties[property] = value.Copy() - else: - self._properties[property] = value - elif isinstance(value, (str, int)): - self._properties[property] = value - elif isinstance(value, list): - if is_strong: - # If is_strong is True, each element is an XCObject, - # so it's safe to call Copy. - self._properties[property] = [] - for item in value: - self._properties[property].append(item.Copy()) - else: - self._properties[property] = value[:] - elif isinstance(value, dict): - self._properties[property] = value.copy() - else: - raise TypeError( - "Don't know how to copy a " - + value.__class__.__name__ - + " object for " - + property - + " in " - + self.__class__.__name__ - ) - else: - self._properties[property] = value - - # Set up the child's back-reference to this object. Don't use |value| - # any more because it may not be right if do_copy is true. - if is_strong: - if not is_list: - self._properties[property].parent = self - else: - for item in self._properties[property]: - item.parent = self - - def HasProperty(self, key): - return key in self._properties - - def GetProperty(self, key): - return self._properties[key] - - def SetProperty(self, key, value): - self.UpdateProperties({key: value}) - - def DelProperty(self, key): - if key in self._properties: - del self._properties[key] - - def AppendProperty(self, key, value): - # TODO(mark): Support ExtendProperty too (and make this call that)? - - # Schema validation. - if key not in self._schema: - raise KeyError(key + " not in " + self.__class__.__name__) - - (is_list, property_type, is_strong) = self._schema[key][0:3] - if not is_list: - raise TypeError(key + " of " + self.__class__.__name__ + " must be list") - if not isinstance(value, property_type): - raise TypeError( - "item of " - + key - + " of " - + self.__class__.__name__ - + " must be " - + property_type.__name__ - + ", not " - + value.__class__.__name__ - ) - - # If the property doesn't exist yet, create a new empty list to receive the - # item. - self._properties[key] = self._properties.get(key, []) - - # Set up the ownership link. - if is_strong: - value.parent = self - - # Store the item. - self._properties[key].append(value) - - def VerifyHasRequiredProperties(self): - """Ensure that all properties identified as required by the schema are - set. - """ - - # TODO(mark): A stronger verification mechanism is needed. Some - # subclasses need to perform validation beyond what the schema can enforce. - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] - if is_required and property not in self._properties: - raise KeyError(self.__class__.__name__ + " requires " + property) - - def _SetDefaultsFromSchema(self): - """Assign object default values according to the schema. This will not - overwrite properties that have already been set.""" - - defaults = {} - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] - if ( - is_required - and len(attributes) >= 5 - and property not in self._properties - ): - default = attributes[4] - - defaults[property] = default - - if len(defaults) > 0: - # Use do_copy=True so that each new object gets its own copy of strong - # objects, lists, and dicts. - self.UpdateProperties(defaults, do_copy=True) - - -class XCHierarchicalElement(XCObject): - """Abstract base for PBXGroup and PBXFileReference. Not represented in a - project file.""" - - # TODO(mark): Do name and path belong here? Probably so. - # If path is set and name is not, name may have a default value. Name will - # be set to the basename of path, if the basename of path is different from - # the full value of path. If path is already just a leaf name, name will - # not be set. - _schema = XCObject._schema.copy() - _schema.update( - { - "comments": [0, str, 0, 0], - "fileEncoding": [0, str, 0, 0], - "includeInIndex": [0, int, 0, 0], - "indentWidth": [0, int, 0, 0], - "lineEnding": [0, int, 0, 0], - "sourceTree": [0, str, 0, 1, ""], - "tabWidth": [0, int, 0, 0], - "usesTabs": [0, int, 0, 0], - "wrapsLines": [0, int, 0, 0], - } - ) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCObject.__init__(self, properties, id, parent) - if "path" in self._properties and "name" not in self._properties: - path = self._properties["path"] - name = posixpath.basename(path) - if name != "" and path != name: - self.SetProperty("name", name) - - if "path" in self._properties and ( - "sourceTree" not in self._properties - or self._properties["sourceTree"] == "" - ): - # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take - # the variable out and make the path be relative to that variable by - # assigning the variable name as the sourceTree. - (source_tree, path) = SourceTreeAndPathFromPath(self._properties["path"]) - if source_tree is not None: - self._properties["sourceTree"] = source_tree - if path is not None: - self._properties["path"] = path - if ( - source_tree is not None - and path is None - and "name" not in self._properties - ): - # The path was of the form "$(SDKROOT)" with no path following it. - # This object is now relative to that variable, so it has no path - # attribute of its own. It does, however, keep a name. - del self._properties["path"] - self._properties["name"] = source_tree - - def Name(self): - if "name" in self._properties: - return self._properties["name"] - elif "path" in self._properties: - return self._properties["path"] - else: - # This happens in the case of the root PBXGroup. - return None - - def Hashables(self): - """Custom hashables for XCHierarchicalElements. - - XCHierarchicalElements are special. Generally, their hashes shouldn't - change if the paths don't change. The normal XCObject implementation of - Hashables adds a hashable for each object, which means that if - the hierarchical structure changes (possibly due to changes caused when - TakeOverOnlyChild runs and encounters slight changes in the hierarchy), - the hashes will change. For example, if a project file initially contains - a/b/f1 and a/b becomes collapsed into a/b, f1 will have a single parent - a/b. If someone later adds a/f2 to the project file, a/b can no longer be - collapsed, and f1 winds up with parent b and grandparent a. That would - be sufficient to change f1's hash. - - To counteract this problem, hashables for all XCHierarchicalElements except - for the main group (which has neither a name nor a path) are taken to be - just the set of path components. Because hashables are inherited from - parents, this provides assurance that a/b/f1 has the same set of hashables - whether its parent is b or a/b. - - The main group is a special case. As it is permitted to have no name or - path, it is permitted to use the standard XCObject hash mechanism. This - is not considered a problem because there can be only one main group. - """ - - if self == self.PBXProjectAncestor()._properties["mainGroup"]: - # super - return XCObject.Hashables(self) - - hashables = [] - - # Put the name in first, ensuring that if TakeOverOnlyChild collapses - # children into a top-level group like "Source", the name always goes - # into the list of hashables without interfering with path components. - if "name" in self._properties: - # Make it less likely for people to manipulate hashes by following the - # pattern of always pushing an object type value onto the list first. - hashables.append(self.__class__.__name__ + ".name") - hashables.append(self._properties["name"]) - - # NOTE: This still has the problem that if an absolute path is encountered, - # including paths with a sourceTree, they'll still inherit their parents' - # hashables, even though the paths aren't relative to their parents. This - # is not expected to be much of a problem in practice. - path = self.PathFromSourceTreeAndPath() - if path is not None: - components = path.split(posixpath.sep) - for component in components: - hashables.append(self.__class__.__name__ + ".path") - hashables.append(component) - - hashables.extend(self._hashables) - - return hashables - - def Compare(self, other): - # Allow comparison of these types. PBXGroup has the highest sort rank; - # PBXVariantGroup is treated as equal to PBXFileReference. - valid_class_types = { - PBXFileReference: "file", - PBXGroup: "group", - PBXVariantGroup: "file", - } - self_type = valid_class_types[self.__class__] - other_type = valid_class_types[other.__class__] - - if self_type == other_type: - # If the two objects are of the same sort rank, compare their names. - return cmp(self.Name(), other.Name()) - - # Otherwise, sort groups before everything else. - if self_type == "group": - return -1 - return 1 - - def CompareRootGroup(self, other): - # This function should be used only to compare direct children of the - # containing PBXProject's mainGroup. These groups should appear in the - # listed order. - # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the - # generator should have a way of influencing this list rather than having - # to hardcode for the generator here. - order = [ - "Source", - "Intermediates", - "Projects", - "Frameworks", - "Products", - "Build", - ] - - # If the groups aren't in the listed order, do a name comparison. - # Otherwise, groups in the listed order should come before those that - # aren't. - self_name = self.Name() - other_name = other.Name() - self_in = isinstance(self, PBXGroup) and self_name in order - other_in = isinstance(self, PBXGroup) and other_name in order - if not self_in and not other_in: - return self.Compare(other) - if self_name in order and other_name not in order: - return -1 - if other_name in order and self_name not in order: - return 1 - - # If both groups are in the listed order, go by the defined order. - self_index = order.index(self_name) - other_index = order.index(other_name) - if self_index < other_index: - return -1 - if self_index > other_index: - return 1 - return 0 - - def PathFromSourceTreeAndPath(self): - # Turn the object's sourceTree and path properties into a single flat - # string of a form comparable to the path parameter. If there's a - # sourceTree property other than "", wrap it in $(...) for the - # comparison. - components = [] - if self._properties["sourceTree"] != "": - components.append("$(" + self._properties["sourceTree"] + ")") - if "path" in self._properties: - components.append(self._properties["path"]) - - if len(components) > 0: - return posixpath.join(*components) - - return None - - def FullPath(self): - # Returns a full path to self relative to the project file, or relative - # to some other source tree. Start with self, and walk up the chain of - # parents prepending their paths, if any, until no more parents are - # available (project-relative path) or until a path relative to some - # source tree is found. - xche = self - path = None - while isinstance(xche, XCHierarchicalElement) and ( - path is None or (not path.startswith("/") and not path.startswith("$")) - ): - this_path = xche.PathFromSourceTreeAndPath() - if this_path is not None and path is not None: - path = posixpath.join(this_path, path) - elif this_path is not None: - path = this_path - xche = xche.parent - - return path - - -class PBXGroup(XCHierarchicalElement): - """ - Attributes: - _children_by_path: Maps pathnames of children of this PBXGroup to the - actual child XCHierarchicalElement objects. - _variant_children_by_name_and_path: Maps (name, path) tuples of - PBXVariantGroup children to the actual child PBXVariantGroup objects. - """ - - _schema = XCHierarchicalElement._schema.copy() - _schema.update( - { - "children": [1, XCHierarchicalElement, 1, 1, []], - "name": [0, str, 0, 0], - "path": [0, str, 0, 0], - } - ) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCHierarchicalElement.__init__(self, properties, id, parent) - self._children_by_path = {} - self._variant_children_by_name_and_path = {} - for child in self._properties.get("children", []): - self._AddChildToDicts(child) - - def Hashables(self): - # super - hashables = XCHierarchicalElement.Hashables(self) - - # It is not sufficient to just rely on name and parent to build a unique - # hashable : a node could have two child PBXGroup sharing a common name. - # To add entropy the hashable is enhanced with the names of all its - # children. - for child in self._properties.get("children", []): - child_name = child.Name() - if child_name is not None: - hashables.append(child_name) - - return hashables - - def HashablesForChild(self): - # To avoid a circular reference the hashables used to compute a child id do - # not include the child names. - return XCHierarchicalElement.Hashables(self) - - def _AddChildToDicts(self, child): - # Sets up this PBXGroup object's dicts to reference the child properly. - child_path = child.PathFromSourceTreeAndPath() - if child_path: - if child_path in self._children_by_path: - raise ValueError("Found multiple children with path " + child_path) - self._children_by_path[child_path] = child - - if isinstance(child, PBXVariantGroup): - child_name = child._properties.get("name", None) - key = (child_name, child_path) - if key in self._variant_children_by_name_and_path: - raise ValueError( - "Found multiple PBXVariantGroup children with " - + "name " - + str(child_name) - + " and path " - + str(child_path) - ) - self._variant_children_by_name_and_path[key] = child - - def AppendChild(self, child): - # Callers should use this instead of calling - # AppendProperty('children', child) directly because this function - # maintains the group's dicts. - self.AppendProperty("children", child) - self._AddChildToDicts(child) - - def GetChildByName(self, name): - # This is not currently optimized with a dict as GetChildByPath is because - # it has few callers. Most callers probably want GetChildByPath. This - # function is only useful to get children that have names but no paths, - # which is rare. The children of the main group ("Source", "Products", - # etc.) is pretty much the only case where this likely to come up. - # - # TODO(mark): Maybe this should raise an error if more than one child is - # present with the same name. - if "children" not in self._properties: - return None - - for child in self._properties["children"]: - if child.Name() == name: - return child - - return None - - def GetChildByPath(self, path): - if not path: - return None - - if path in self._children_by_path: - return self._children_by_path[path] - - return None - - def GetChildByRemoteObject(self, remote_object): - # This method is a little bit esoteric. Given a remote_object, which - # should be a PBXFileReference in another project file, this method will - # return this group's PBXReferenceProxy object serving as a local proxy - # for the remote PBXFileReference. - # - # This function might benefit from a dict optimization as GetChildByPath - # for some workloads, but profiling shows that it's not currently a - # problem. - if "children" not in self._properties: - return None - - for child in self._properties["children"]: - if not isinstance(child, PBXReferenceProxy): - continue - - container_proxy = child._properties["remoteRef"] - if container_proxy._properties["remoteGlobalIDString"] == remote_object: - return child - - return None - - def AddOrGetFileByPath(self, path, hierarchical): - """Returns an existing or new file reference corresponding to path. - - If hierarchical is True, this method will create or use the necessary - hierarchical group structure corresponding to path. Otherwise, it will - look in and create an item in the current group only. - - If an existing matching reference is found, it is returned, otherwise, a - new one will be created, added to the correct group, and returned. - - If path identifies a directory by virtue of carrying a trailing slash, - this method returns a PBXFileReference of "folder" type. If path - identifies a variant, by virtue of it identifying a file inside a directory - with an ".lproj" extension, this method returns a PBXVariantGroup - containing the variant named by path, and possibly other variants. For - all other paths, a "normal" PBXFileReference will be returned. - """ - - # Adding or getting a directory? Directories end with a trailing slash. - is_dir = False - if path.endswith("/"): - is_dir = True - path = posixpath.normpath(path) - if is_dir: - path = path + "/" - - # Adding or getting a variant? Variants are files inside directories - # with an ".lproj" extension. Xcode uses variants for localization. For - # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named - # MainMenu.nib inside path/to, and give it a variant named Language. In - # this example, grandparent would be set to path/to and parent_root would - # be set to Language. - variant_name = None - parent = posixpath.dirname(path) - grandparent = posixpath.dirname(parent) - parent_basename = posixpath.basename(parent) - (parent_root, parent_ext) = posixpath.splitext(parent_basename) - if parent_ext == ".lproj": - variant_name = parent_root - if grandparent == "": - grandparent = None - - # Putting a directory inside a variant group is not currently supported. - assert not is_dir or variant_name is None - - path_split = path.split(posixpath.sep) - if ( - len(path_split) == 1 - or ((is_dir or variant_name is not None) and len(path_split) == 2) - or not hierarchical - ): - # The PBXFileReference or PBXVariantGroup will be added to or gotten from - # this PBXGroup, no recursion necessary. - if variant_name is None: - # Add or get a PBXFileReference. - file_ref = self.GetChildByPath(path) - if file_ref is not None: - assert file_ref.__class__ == PBXFileReference - else: - file_ref = PBXFileReference({"path": path}) - self.AppendChild(file_ref) - else: - # Add or get a PBXVariantGroup. The variant group name is the same - # as the basename (MainMenu.nib in the example above). grandparent - # specifies the path to the variant group itself, and path_split[-2:] - # is the path of the specific variant relative to its group. - variant_group_name = posixpath.basename(path) - variant_group_ref = self.AddOrGetVariantGroupByNameAndPath( - variant_group_name, grandparent - ) - variant_path = posixpath.sep.join(path_split[-2:]) - variant_ref = variant_group_ref.GetChildByPath(variant_path) - if variant_ref is not None: - assert variant_ref.__class__ == PBXFileReference - else: - variant_ref = PBXFileReference( - {"name": variant_name, "path": variant_path} - ) - variant_group_ref.AppendChild(variant_ref) - # The caller is interested in the variant group, not the specific - # variant file. - file_ref = variant_group_ref - return file_ref - else: - # Hierarchical recursion. Add or get a PBXGroup corresponding to the - # outermost path component, and then recurse into it, chopping off that - # path component. - next_dir = path_split[0] - group_ref = self.GetChildByPath(next_dir) - if group_ref is not None: - assert group_ref.__class__ == PBXGroup - else: - group_ref = PBXGroup({"path": next_dir}) - self.AppendChild(group_ref) - return group_ref.AddOrGetFileByPath( - posixpath.sep.join(path_split[1:]), hierarchical - ) - - def AddOrGetVariantGroupByNameAndPath(self, name, path): - """Returns an existing or new PBXVariantGroup for name and path. - - If a PBXVariantGroup identified by the name and path arguments is already - present as a child of this object, it is returned. Otherwise, a new - PBXVariantGroup with the correct properties is created, added as a child, - and returned. - - This method will generally be called by AddOrGetFileByPath, which knows - when to create a variant group based on the structure of the pathnames - passed to it. - """ - - key = (name, path) - if key in self._variant_children_by_name_and_path: - variant_group_ref = self._variant_children_by_name_and_path[key] - assert variant_group_ref.__class__ == PBXVariantGroup - return variant_group_ref - - variant_group_properties = {"name": name} - if path is not None: - variant_group_properties["path"] = path - variant_group_ref = PBXVariantGroup(variant_group_properties) - self.AppendChild(variant_group_ref) - - return variant_group_ref - - def TakeOverOnlyChild(self, recurse=False): - """If this PBXGroup has only one child and it's also a PBXGroup, take - it over by making all of its children this object's children. - - This function will continue to take over only children when those children - are groups. If there are three PBXGroups representing a, b, and c, with - c inside b and b inside a, and a and b have no other children, this will - result in a taking over both b and c, forming a PBXGroup for a/b/c. - - If recurse is True, this function will recurse into children and ask them - to collapse themselves by taking over only children as well. Assuming - an example hierarchy with files at a/b/c/d1, a/b/c/d2, and a/b/c/d3/e/f - (d1, d2, and f are files, the rest are groups), recursion will result in - a group for a/b/c containing a group for d3/e. - """ - - # At this stage, check that child class types are PBXGroup exactly, - # instead of using isinstance. The only subclass of PBXGroup, - # PBXVariantGroup, should not participate in reparenting in the same way: - # reparenting by merging different object types would be wrong. - while ( - len(self._properties["children"]) == 1 - and self._properties["children"][0].__class__ == PBXGroup - ): - # Loop to take over the innermost only-child group possible. - - child = self._properties["children"][0] - - # Assume the child's properties, including its children. Save a copy - # of this object's old properties, because they'll still be needed. - # This object retains its existing id and parent attributes. - old_properties = self._properties - self._properties = child._properties - self._children_by_path = child._children_by_path - - if ( - "sourceTree" not in self._properties - or self._properties["sourceTree"] == "" - ): - # The child was relative to its parent. Fix up the path. Note that - # children with a sourceTree other than "" are not relative to - # their parents, so no path fix-up is needed in that case. - if "path" in old_properties: - if "path" in self._properties: - # Both the original parent and child have paths set. - self._properties["path"] = posixpath.join( - old_properties["path"], self._properties["path"] - ) - else: - # Only the original parent has a path, use it. - self._properties["path"] = old_properties["path"] - if "sourceTree" in old_properties: - # The original parent had a sourceTree set, use it. - self._properties["sourceTree"] = old_properties["sourceTree"] - - # If the original parent had a name set, keep using it. If the original - # parent didn't have a name but the child did, let the child's name - # live on. If the name attribute seems unnecessary now, get rid of it. - if "name" in old_properties and old_properties["name"] not in ( - None, - self.Name(), - ): - self._properties["name"] = old_properties["name"] - if ( - "name" in self._properties - and "path" in self._properties - and self._properties["name"] == self._properties["path"] - ): - del self._properties["name"] - - # Notify all children of their new parent. - for child in self._properties["children"]: - child.parent = self - - # If asked to recurse, recurse. - if recurse: - for child in self._properties["children"]: - if child.__class__ == PBXGroup: - child.TakeOverOnlyChild(recurse) - - def SortGroup(self): - self._properties["children"] = sorted( - self._properties["children"], key=cmp_to_key(lambda x, y: x.Compare(y)) - ) - - # Recurse. - for child in self._properties["children"]: - if isinstance(child, PBXGroup): - child.SortGroup() - - -class XCFileLikeElement(XCHierarchicalElement): - # Abstract base for objects that can be used as the fileRef property of - # PBXBuildFile. - - def PathHashables(self): - # A PBXBuildFile that refers to this object will call this method to - # obtain additional hashables specific to this XCFileLikeElement. Don't - # just use this object's hashables, they're not specific and unique enough - # on their own (without access to the parent hashables.) Instead, provide - # hashables that identify this object by path by getting its hashables as - # well as the hashables of ancestor XCHierarchicalElement objects. - - hashables = [] - xche = self - while isinstance(xche, XCHierarchicalElement): - xche_hashables = xche.Hashables() - for index, xche_hashable in enumerate(xche_hashables): - hashables.insert(index, xche_hashable) - xche = xche.parent - return hashables - - -class XCContainerPortal(XCObject): - # Abstract base for objects that can be used as the containerPortal property - # of PBXContainerItemProxy. - pass - - -class XCRemoteObject(XCObject): - # Abstract base for objects that can be used as the remoteGlobalIDString - # property of PBXContainerItemProxy. - pass - - -class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject): - _schema = XCFileLikeElement._schema.copy() - _schema.update( - { - "explicitFileType": [0, str, 0, 0], - "lastKnownFileType": [0, str, 0, 0], - "name": [0, str, 0, 0], - "path": [0, str, 0, 1], - } - ) - - # Weird output rules for PBXFileReference. - _should_print_single_line = True - # super - _encode_transforms = XCFileLikeElement._alternate_encode_transforms - - def __init__(self, properties=None, id=None, parent=None): - # super - XCFileLikeElement.__init__(self, properties, id, parent) - if "path" in self._properties and self._properties["path"].endswith("/"): - self._properties["path"] = self._properties["path"][:-1] - is_dir = True - else: - is_dir = False - - if ( - "path" in self._properties - and "lastKnownFileType" not in self._properties - and "explicitFileType" not in self._properties - ): - # TODO(mark): This is the replacement for a replacement for a quick hack. - # It is no longer incredibly sucky, but this list needs to be extended. - extension_map = { - "a": "archive.ar", - "app": "wrapper.application", - "bdic": "file", - "bundle": "wrapper.cfbundle", - "c": "sourcecode.c.c", - "cc": "sourcecode.cpp.cpp", - "cpp": "sourcecode.cpp.cpp", - "css": "text.css", - "cxx": "sourcecode.cpp.cpp", - "dart": "sourcecode", - "dylib": "compiled.mach-o.dylib", - "framework": "wrapper.framework", - "gyp": "sourcecode", - "gypi": "sourcecode", - "h": "sourcecode.c.h", - "hxx": "sourcecode.cpp.h", - "icns": "image.icns", - "java": "sourcecode.java", - "js": "sourcecode.javascript", - "kext": "wrapper.kext", - "m": "sourcecode.c.objc", - "mm": "sourcecode.cpp.objcpp", - "nib": "wrapper.nib", - "o": "compiled.mach-o.objfile", - "pdf": "image.pdf", - "pl": "text.script.perl", - "plist": "text.plist.xml", - "pm": "text.script.perl", - "png": "image.png", - "py": "text.script.python", - "r": "sourcecode.rez", - "rez": "sourcecode.rez", - "s": "sourcecode.asm", - "storyboard": "file.storyboard", - "strings": "text.plist.strings", - "swift": "sourcecode.swift", - "ttf": "file", - "xcassets": "folder.assetcatalog", - "xcconfig": "text.xcconfig", - "xcdatamodel": "wrapper.xcdatamodel", - "xcdatamodeld": "wrapper.xcdatamodeld", - "xib": "file.xib", - "y": "sourcecode.yacc", - } - - prop_map = { - "dart": "explicitFileType", - "gyp": "explicitFileType", - "gypi": "explicitFileType", - } - - if is_dir: - file_type = "folder" - prop_name = "lastKnownFileType" - else: - basename = posixpath.basename(self._properties["path"]) - (root, ext) = posixpath.splitext(basename) - # Check the map using a lowercase extension. - # TODO(mark): Maybe it should try with the original case first and fall - # back to lowercase, in case there are any instances where case - # matters. There currently aren't. - if ext != "": - ext = ext[1:].lower() - - # TODO(mark): "text" is the default value, but "file" is appropriate - # for unrecognized files not containing text. Xcode seems to choose - # based on content. - file_type = extension_map.get(ext, "text") - prop_name = prop_map.get(ext, "lastKnownFileType") - - self._properties[prop_name] = file_type - - -class PBXVariantGroup(PBXGroup, XCFileLikeElement): - """PBXVariantGroup is used by Xcode to represent localizations.""" - - # No additions to the schema relative to PBXGroup. - pass - - -# PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below -# because it uses PBXContainerItemProxy, defined below. - - -class XCBuildConfiguration(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "baseConfigurationReference": [0, PBXFileReference, 0, 0], - "buildSettings": [0, dict, 0, 1, {}], - "name": [0, str, 0, 1], - } - ) - - def HasBuildSetting(self, key): - return key in self._properties["buildSettings"] - - def GetBuildSetting(self, key): - return self._properties["buildSettings"][key] - - def SetBuildSetting(self, key, value): - # TODO(mark): If a list, copy? - self._properties["buildSettings"][key] = value - - def AppendBuildSetting(self, key, value): - if key not in self._properties["buildSettings"]: - self._properties["buildSettings"][key] = [] - self._properties["buildSettings"][key].append(value) - - def DelBuildSetting(self, key): - if key in self._properties["buildSettings"]: - del self._properties["buildSettings"][key] - - def SetBaseConfiguration(self, value): - self._properties["baseConfigurationReference"] = value - - -class XCConfigurationList(XCObject): - # _configs is the default list of configurations. - _configs = [ - XCBuildConfiguration({"name": "Debug"}), - XCBuildConfiguration({"name": "Release"}), - ] - - _schema = XCObject._schema.copy() - _schema.update( - { - "buildConfigurations": [1, XCBuildConfiguration, 1, 1, _configs], - "defaultConfigurationIsVisible": [0, int, 0, 1, 1], - "defaultConfigurationName": [0, str, 0, 1, "Release"], - } - ) - - def Name(self): - return ( - "Build configuration list for " - + self.parent.__class__.__name__ - + ' "' - + self.parent.Name() - + '"' - ) - - def ConfigurationNamed(self, name): - """Convenience accessor to obtain an XCBuildConfiguration by name.""" - for configuration in self._properties["buildConfigurations"]: - if configuration._properties["name"] == name: - return configuration - - raise KeyError(name) - - def DefaultConfiguration(self): - """Convenience accessor to obtain the default XCBuildConfiguration.""" - return self.ConfigurationNamed(self._properties["defaultConfigurationName"]) - - def HasBuildSetting(self, key): - """Determines the state of a build setting in all XCBuildConfiguration - child objects. - - If all child objects have key in their build settings, and the value is the - same in all child objects, returns 1. - - If no child objects have the key in their build settings, returns 0. - - If some, but not all, child objects have the key in their build settings, - or if any children have different values for the key, returns -1. - """ - - has = None - value = None - for configuration in self._properties["buildConfigurations"]: - configuration_has = configuration.HasBuildSetting(key) - if has is None: - has = configuration_has - elif has != configuration_has: - return -1 - - if configuration_has: - configuration_value = configuration.GetBuildSetting(key) - if value is None: - value = configuration_value - elif value != configuration_value: - return -1 - - if not has: - return 0 - - return 1 - - def GetBuildSetting(self, key): - """Gets the build setting for key. - - All child XCConfiguration objects must have the same value set for the - setting, or a ValueError will be raised. - """ - - # TODO(mark): This is wrong for build settings that are lists. The list - # contents should be compared (and a list copy returned?) - - value = None - for configuration in self._properties["buildConfigurations"]: - configuration_value = configuration.GetBuildSetting(key) - if value is None: - value = configuration_value - else: - if value != configuration_value: - raise ValueError("Variant values for " + key) - - return value - - def SetBuildSetting(self, key, value): - """Sets the build setting for key to value in all child - XCBuildConfiguration objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.SetBuildSetting(key, value) - - def AppendBuildSetting(self, key, value): - """Appends value to the build setting for key, which is treated as a list, - in all child XCBuildConfiguration objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.AppendBuildSetting(key, value) - - def DelBuildSetting(self, key): - """Deletes the build setting key from all child XCBuildConfiguration - objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.DelBuildSetting(key) - - def SetBaseConfiguration(self, value): - """Sets the build configuration in all child XCBuildConfiguration objects. - """ - - for configuration in self._properties["buildConfigurations"]: - configuration.SetBaseConfiguration(value) - - -class PBXBuildFile(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "fileRef": [0, XCFileLikeElement, 0, 1], - "settings": [0, str, 0, 0], # hack, it's a dict - } - ) - - # Weird output rules for PBXBuildFile. - _should_print_single_line = True - _encode_transforms = XCObject._alternate_encode_transforms - - def Name(self): - # Example: "main.cc in Sources" - return self._properties["fileRef"].Name() + " in " + self.parent.Name() - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # It is not sufficient to just rely on Name() to get the - # XCFileLikeElement's name, because that is not a complete pathname. - # PathHashables returns hashables unique enough that no two - # PBXBuildFiles should wind up with the same set of hashables, unless - # someone adds the same file multiple times to the same target. That - # would be considered invalid anyway. - hashables.extend(self._properties["fileRef"].PathHashables()) - - return hashables - - -class XCBuildPhase(XCObject): - """Abstract base for build phase classes. Not represented in a project - file. - - Attributes: - _files_by_path: A dict mapping each path of a child in the files list by - path (keys) to the corresponding PBXBuildFile children (values). - _files_by_xcfilelikeelement: A dict mapping each XCFileLikeElement (keys) - to the corresponding PBXBuildFile children (values). - """ - - # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't - # actually have a "files" list. XCBuildPhase should not have "files" but - # another abstract subclass of it should provide this, and concrete build - # phase types that do have "files" lists should be derived from that new - # abstract subclass. XCBuildPhase should only provide buildActionMask and - # runOnlyForDeploymentPostprocessing, and not files or the various - # file-related methods and attributes. - - _schema = XCObject._schema.copy() - _schema.update( - { - "buildActionMask": [0, int, 0, 1, 0x7FFFFFFF], - "files": [1, PBXBuildFile, 1, 1, []], - "runOnlyForDeploymentPostprocessing": [0, int, 0, 1, 0], - } - ) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCObject.__init__(self, properties, id, parent) - - self._files_by_path = {} - self._files_by_xcfilelikeelement = {} - for pbxbuildfile in self._properties.get("files", []): - self._AddBuildFileToDicts(pbxbuildfile) - - def FileGroup(self, path): - # Subclasses must override this by returning a two-element tuple. The - # first item in the tuple should be the PBXGroup to which "path" should be - # added, either as a child or deeper descendant. The second item should - # be a boolean indicating whether files should be added into hierarchical - # groups or one single flat group. - raise NotImplementedError(self.__class__.__name__ + " must implement FileGroup") - - def _AddPathToDict(self, pbxbuildfile, path): - """Adds path to the dict tracking paths belonging to this build phase. - - If the path is already a member of this build phase, raises an exception. - """ - - if path in self._files_by_path: - raise ValueError("Found multiple build files with path " + path) - self._files_by_path[path] = pbxbuildfile - - def _AddBuildFileToDicts(self, pbxbuildfile, path=None): - """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts. - - If path is specified, then it is the path that is being added to the - phase, and pbxbuildfile must contain either a PBXFileReference directly - referencing that path, or it must contain a PBXVariantGroup that itself - contains a PBXFileReference referencing the path. - - If path is not specified, either the PBXFileReference's path or the paths - of all children of the PBXVariantGroup are taken as being added to the - phase. - - If the path is already present in the phase, raises an exception. - - If the PBXFileReference or PBXVariantGroup referenced by pbxbuildfile - are already present in the phase, referenced by a different PBXBuildFile - object, raises an exception. This does not raise an exception when - a PBXFileReference or PBXVariantGroup reappear and are referenced by the - same PBXBuildFile that has already introduced them, because in the case - of PBXVariantGroup objects, they may correspond to multiple paths that are - not all added simultaneously. When this situation occurs, the path needs - to be added to _files_by_path, but nothing needs to change in - _files_by_xcfilelikeelement, and the caller should have avoided adding - the PBXBuildFile if it is already present in the list of children. - """ - - xcfilelikeelement = pbxbuildfile._properties["fileRef"] - - paths = [] - if path is not None: - # It's best when the caller provides the path. - if isinstance(xcfilelikeelement, PBXVariantGroup): - paths.append(path) - else: - # If the caller didn't provide a path, there can be either multiple - # paths (PBXVariantGroup) or one. - if isinstance(xcfilelikeelement, PBXVariantGroup): - for variant in xcfilelikeelement._properties["children"]: - paths.append(variant.FullPath()) - else: - paths.append(xcfilelikeelement.FullPath()) - - # Add the paths first, because if something's going to raise, the - # messages provided by _AddPathToDict are more useful owing to its - # having access to a real pathname and not just an object's Name(). - for a_path in paths: - self._AddPathToDict(pbxbuildfile, a_path) - - # If another PBXBuildFile references this XCFileLikeElement, there's a - # problem. - if ( - xcfilelikeelement in self._files_by_xcfilelikeelement - and self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile - ): - raise ValueError( - "Found multiple build files for " + xcfilelikeelement.Name() - ) - self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile - - def AppendBuildFile(self, pbxbuildfile, path=None): - # Callers should use this instead of calling - # AppendProperty('files', pbxbuildfile) directly because this function - # maintains the object's dicts. Better yet, callers can just call AddFile - # with a pathname and not worry about building their own PBXBuildFile - # objects. - self.AppendProperty("files", pbxbuildfile) - self._AddBuildFileToDicts(pbxbuildfile, path) - - def AddFile(self, path, settings=None): - (file_group, hierarchical) = self.FileGroup(path) - file_ref = file_group.AddOrGetFileByPath(path, hierarchical) - - if file_ref in self._files_by_xcfilelikeelement and isinstance( - file_ref, PBXVariantGroup - ): - # There's already a PBXBuildFile in this phase corresponding to the - # PBXVariantGroup. path just provides a new variant that belongs to - # the group. Add the path to the dict. - pbxbuildfile = self._files_by_xcfilelikeelement[file_ref] - self._AddBuildFileToDicts(pbxbuildfile, path) - else: - # Add a new PBXBuildFile to get file_ref into the phase. - if settings is None: - pbxbuildfile = PBXBuildFile({"fileRef": file_ref}) - else: - pbxbuildfile = PBXBuildFile({"fileRef": file_ref, "settings": settings}) - self.AppendBuildFile(pbxbuildfile, path) - - -class PBXHeadersBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Headers" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - -class PBXResourcesBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Resources" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - -class PBXSourcesBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Sources" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - -class PBXFrameworksBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return "Frameworks" - - def FileGroup(self, path): - (root, ext) = posixpath.splitext(path) - if ext != "": - ext = ext[1:].lower() - if ext == "o": - # .o files are added to Xcode Frameworks phases, but conceptually aren't - # frameworks, they're more like sources or intermediates. Redirect them - # to show up in one of those other groups. - return self.PBXProjectAncestor().RootGroupForPath(path) - else: - return (self.PBXProjectAncestor().FrameworksGroup(), False) - - -class PBXShellScriptBuildPhase(XCBuildPhase): - _schema = XCBuildPhase._schema.copy() - _schema.update( - { - "inputPaths": [1, str, 0, 1, []], - "name": [0, str, 0, 0], - "outputPaths": [1, str, 0, 1, []], - "shellPath": [0, str, 0, 1, "/bin/sh"], - "shellScript": [0, str, 0, 1], - "showEnvVarsInLog": [0, int, 0, 0], - } - ) - - def Name(self): - if "name" in self._properties: - return self._properties["name"] - - return "ShellScript" - - -class PBXCopyFilesBuildPhase(XCBuildPhase): - _schema = XCBuildPhase._schema.copy() - _schema.update( - { - "dstPath": [0, str, 0, 1], - "dstSubfolderSpec": [0, int, 0, 1], - "name": [0, str, 0, 0], - } - ) - - # path_tree_re matches "$(DIR)/path", "$(DIR)/$(DIR2)/path" or just "$(DIR)". - # Match group 1 is "DIR", group 3 is "path" or "$(DIR2") or "$(DIR2)/path" - # or None. If group 3 is "path", group 4 will be None otherwise group 4 is - # "DIR2" and group 6 is "path". - path_tree_re = re.compile(r"^\$\((.*?)\)(/(\$\((.*?)\)(/(.*)|)|(.*)|)|)$") - - # path_tree_{first,second}_to_subfolder map names of Xcode variables to the - # associated dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase - # object. - path_tree_first_to_subfolder = { - # Types that can be chosen via the Xcode UI. - "BUILT_PRODUCTS_DIR": 16, # Products Directory - "BUILT_FRAMEWORKS_DIR": 10, # Not an official Xcode macro. - # Existed before support for the - # names below was added. Maps to - # "Frameworks". - } - - path_tree_second_to_subfolder = { - "WRAPPER_NAME": 1, # Wrapper - # Although Xcode's friendly name is "Executables", the destination - # is demonstrably the value of the build setting - # EXECUTABLE_FOLDER_PATH not EXECUTABLES_FOLDER_PATH. - "EXECUTABLE_FOLDER_PATH": 6, # Executables. - "UNLOCALIZED_RESOURCES_FOLDER_PATH": 7, # Resources - "JAVA_FOLDER_PATH": 15, # Java Resources - "FRAMEWORKS_FOLDER_PATH": 10, # Frameworks - "SHARED_FRAMEWORKS_FOLDER_PATH": 11, # Shared Frameworks - "SHARED_SUPPORT_FOLDER_PATH": 12, # Shared Support - "PLUGINS_FOLDER_PATH": 13, # PlugIns - # For XPC Services, Xcode sets both dstPath and dstSubfolderSpec. - # Note that it re-uses the BUILT_PRODUCTS_DIR value for - # dstSubfolderSpec. dstPath is set below. - "XPCSERVICES_FOLDER_PATH": 16, # XPC Services. - } - - def Name(self): - if "name" in self._properties: - return self._properties["name"] - - return "CopyFiles" - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - def SetDestination(self, path): - """Set the dstSubfolderSpec and dstPath properties from path. - - path may be specified in the same notation used for XCHierarchicalElements, - specifically, "$(DIR)/path". - """ - - path_tree_match = self.path_tree_re.search(path) - if path_tree_match: - path_tree = path_tree_match.group(1) - if path_tree in self.path_tree_first_to_subfolder: - subfolder = self.path_tree_first_to_subfolder[path_tree] - relative_path = path_tree_match.group(3) - if relative_path is None: - relative_path = "" - - if subfolder == 16 and path_tree_match.group(4) is not None: - # BUILT_PRODUCTS_DIR (16) is the first element in a path whose - # second element is possibly one of the variable names in - # path_tree_second_to_subfolder. Xcode sets the values of all these - # variables to relative paths so .gyp files must prefix them with - # BUILT_PRODUCTS_DIR, e.g. - # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then - # xcode_emulation.py can export these variables with the same values - # as Xcode yet make & ninja files can determine the absolute path - # to the target. Xcode uses the dstSubfolderSpec value set here - # to determine the full path. - # - # An alternative of xcode_emulation.py setting the values to - # absolute paths when exporting these variables has been - # ruled out because then the values would be different - # depending on the build tool. - # - # Another alternative is to invent new names for the variables used - # to match to the subfolder indices in the second table. .gyp files - # then will not need to prepend $(BUILT_PRODUCTS_DIR) because - # xcode_emulation.py can set the values of those variables to - # the absolute paths when exporting. This is possibly the thinking - # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner. - # - # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because - # this same way could be used to specify destinations in .gyp files - # that pre-date this addition to GYP. However they would only work - # with the Xcode generator. - # The previous version of xcode_emulation.py - # does not export these variables. Such files will get the benefit - # of the Xcode UI showing the proper destination name simply by - # regenerating the projects with this version of GYP. - path_tree = path_tree_match.group(4) - relative_path = path_tree_match.group(6) - separator = "/" - - if path_tree in self.path_tree_second_to_subfolder: - subfolder = self.path_tree_second_to_subfolder[path_tree] - if relative_path is None: - relative_path = "" - separator = "" - if path_tree == "XPCSERVICES_FOLDER_PATH": - relative_path = ( - "$(CONTENTS_FOLDER_PATH)/XPCServices" - + separator - + relative_path - ) - else: - # subfolder = 16 from above - # The second element of the path is an unrecognized variable. - # Include it and any remaining elements in relative_path. - relative_path = path_tree_match.group(3) - - else: - # The path starts with an unrecognized Xcode variable - # name like $(SRCROOT). Xcode will still handle this - # as an "absolute path" that starts with the variable. - subfolder = 0 - relative_path = path - elif path.startswith("/"): - # Special case. Absolute paths are in dstSubfolderSpec 0. - subfolder = 0 - relative_path = path[1:] - else: - raise ValueError( - f"Can't use path {path} in a {self.__class__.__name__}" - ) - - self._properties["dstPath"] = relative_path - self._properties["dstSubfolderSpec"] = subfolder - - -class PBXBuildRule(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "compilerSpec": [0, str, 0, 1], - "filePatterns": [0, str, 0, 0], - "fileType": [0, str, 0, 1], - "isEditable": [0, int, 0, 1, 1], - "outputFiles": [1, str, 0, 1, []], - "script": [0, str, 0, 0], - } - ) - - def Name(self): - # Not very inspired, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # Use the hashables of the weak objects that this object refers to. - hashables.append(self._properties["fileType"]) - if "filePatterns" in self._properties: - hashables.append(self._properties["filePatterns"]) - return hashables - - -class PBXContainerItemProxy(XCObject): - # When referencing an item in this project file, containerPortal is the - # PBXProject root object of this project file. When referencing an item in - # another project file, containerPortal is a PBXFileReference identifying - # the other project file. - # - # When serving as a proxy to an XCTarget (in this project file or another), - # proxyType is 1. When serving as a proxy to a PBXFileReference (in another - # project file), proxyType is 2. Type 2 is used for references to the - # producs of the other project file's targets. - # - # Xcode is weird about remoteGlobalIDString. Usually, it's printed without - # a comment, indicating that it's tracked internally simply as a string, but - # sometimes it's printed with a comment (usually when the object is initially - # created), indicating that it's tracked as a project file object at least - # sometimes. This module always tracks it as an object, but contains a hack - # to prevent it from printing the comment in the project file output. See - # _XCKVPrint. - _schema = XCObject._schema.copy() - _schema.update( - { - "containerPortal": [0, XCContainerPortal, 0, 1], - "proxyType": [0, int, 0, 1], - "remoteGlobalIDString": [0, XCRemoteObject, 0, 1], - "remoteInfo": [0, str, 0, 1], - } - ) - - def __repr__(self): - props = self._properties - name = "{}.gyp:{}".format(props["containerPortal"].Name(), props["remoteInfo"]) - return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" - - def Name(self): - # Admittedly not the best name, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # Use the hashables of the weak objects that this object refers to. - hashables.extend(self._properties["containerPortal"].Hashables()) - hashables.extend(self._properties["remoteGlobalIDString"].Hashables()) - return hashables - - -class PBXTargetDependency(XCObject): - # The "target" property accepts an XCTarget object, and obviously not - # NoneType. But XCTarget is defined below, so it can't be put into the - # schema yet. The definition of PBXTargetDependency can't be moved below - # XCTarget because XCTarget's own schema references PBXTargetDependency. - # Python doesn't deal well with this circular relationship, and doesn't have - # a real way to do forward declarations. To work around, the type of - # the "target" property is reset below, after XCTarget is defined. - # - # At least one of "name" and "target" is required. - _schema = XCObject._schema.copy() - _schema.update( - { - "name": [0, str, 0, 0], - "target": [0, None.__class__, 0, 0], - "targetProxy": [0, PBXContainerItemProxy, 1, 1], - } - ) - - def __repr__(self): - name = self._properties.get("name") or self._properties["target"].Name() - return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" - - def Name(self): - # Admittedly not the best name, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) - - # Use the hashables of the weak objects that this object refers to. - hashables.extend(self._properties["targetProxy"].Hashables()) - return hashables - - -class PBXReferenceProxy(XCFileLikeElement): - _schema = XCFileLikeElement._schema.copy() - _schema.update( - { - "fileType": [0, str, 0, 1], - "path": [0, str, 0, 1], - "remoteRef": [0, PBXContainerItemProxy, 1, 1], - } - ) - - -class XCTarget(XCRemoteObject): - # An XCTarget is really just an XCObject, the XCRemoteObject thing is just - # to allow PBXProject to be used in the remoteGlobalIDString property of - # PBXContainerItemProxy. - # - # Setting a "name" property at instantiation may also affect "productName", - # which may in turn affect the "PRODUCT_NAME" build setting in children of - # "buildConfigurationList". See __init__ below. - _schema = XCRemoteObject._schema.copy() - _schema.update( - { - "buildConfigurationList": [ - 0, - XCConfigurationList, - 1, - 1, - XCConfigurationList(), - ], - "buildPhases": [1, XCBuildPhase, 1, 1, []], - "dependencies": [1, PBXTargetDependency, 1, 1, []], - "name": [0, str, 0, 1], - "productName": [0, str, 0, 1], - } - ) - - def __init__( - self, - properties=None, - id=None, - parent=None, - force_outdir=None, - force_prefix=None, - force_extension=None, - ): - # super - XCRemoteObject.__init__(self, properties, id, parent) - - # Set up additional defaults not expressed in the schema. If a "name" - # property was supplied, set "productName" if it is not present. Also set - # the "PRODUCT_NAME" build setting in each configuration, but only if - # the setting is not present in any build configuration. - if "name" in self._properties: - if "productName" not in self._properties: - self.SetProperty("productName", self._properties["name"]) - - if "productName" in self._properties: - if "buildConfigurationList" in self._properties: - configs = self._properties["buildConfigurationList"] - if configs.HasBuildSetting("PRODUCT_NAME") == 0: - configs.SetBuildSetting( - "PRODUCT_NAME", self._properties["productName"] - ) - - def AddDependency(self, other): - pbxproject = self.PBXProjectAncestor() - other_pbxproject = other.PBXProjectAncestor() - if pbxproject == other_pbxproject: - # Add a dependency to another target in the same project file. - container = PBXContainerItemProxy( - { - "containerPortal": pbxproject, - "proxyType": 1, - "remoteGlobalIDString": other, - "remoteInfo": other.Name(), - } - ) - dependency = PBXTargetDependency( - {"target": other, "targetProxy": container} - ) - self.AppendProperty("dependencies", dependency) - else: - # Add a dependency to a target in a different project file. - other_project_ref = pbxproject.AddOrGetProjectReference(other_pbxproject)[1] - container = PBXContainerItemProxy( - { - "containerPortal": other_project_ref, - "proxyType": 1, - "remoteGlobalIDString": other, - "remoteInfo": other.Name(), - } - ) - dependency = PBXTargetDependency( - {"name": other.Name(), "targetProxy": container} - ) - self.AppendProperty("dependencies", dependency) - - # Proxy all of these through to the build configuration list. - - def ConfigurationNamed(self, name): - return self._properties["buildConfigurationList"].ConfigurationNamed(name) - - def DefaultConfiguration(self): - return self._properties["buildConfigurationList"].DefaultConfiguration() - - def HasBuildSetting(self, key): - return self._properties["buildConfigurationList"].HasBuildSetting(key) - - def GetBuildSetting(self, key): - return self._properties["buildConfigurationList"].GetBuildSetting(key) - - def SetBuildSetting(self, key, value): - return self._properties["buildConfigurationList"].SetBuildSetting(key, value) - - def AppendBuildSetting(self, key, value): - return self._properties["buildConfigurationList"].AppendBuildSetting(key, value) - - def DelBuildSetting(self, key): - return self._properties["buildConfigurationList"].DelBuildSetting(key) - - -# Redefine the type of the "target" property. See PBXTargetDependency._schema -# above. -PBXTargetDependency._schema["target"][1] = XCTarget - - -class PBXNativeTarget(XCTarget): - # buildPhases is overridden in the schema to be able to set defaults. - # - # NOTE: Contrary to most objects, it is advisable to set parent when - # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject - # object. A parent reference is required for a PBXNativeTarget during - # construction to be able to set up the target defaults for productReference, - # because a PBXBuildFile object must be created for the target and it must - # be added to the PBXProject's mainGroup hierarchy. - _schema = XCTarget._schema.copy() - _schema.update( - { - "buildPhases": [ - 1, - XCBuildPhase, - 1, - 1, - [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()], - ], - "buildRules": [1, PBXBuildRule, 1, 1, []], - "productReference": [0, PBXFileReference, 0, 1], - "productType": [0, str, 0, 1], - } - ) - - # Mapping from Xcode product-types to settings. The settings are: - # filetype : used for explicitFileType in the project file - # prefix : the prefix for the file name - # suffix : the suffix for the file name - _product_filetypes = { - "com.apple.product-type.application": ["wrapper.application", "", ".app"], - "com.apple.product-type.application.watchapp": [ - "wrapper.application", - "", - ".app", - ], - "com.apple.product-type.watchkit-extension": [ - "wrapper.app-extension", - "", - ".appex", - ], - "com.apple.product-type.app-extension": ["wrapper.app-extension", "", ".appex"], - "com.apple.product-type.bundle": ["wrapper.cfbundle", "", ".bundle"], - "com.apple.product-type.framework": ["wrapper.framework", "", ".framework"], - "com.apple.product-type.library.dynamic": [ - "compiled.mach-o.dylib", - "lib", - ".dylib", - ], - "com.apple.product-type.library.static": ["archive.ar", "lib", ".a"], - "com.apple.product-type.tool": ["compiled.mach-o.executable", "", ""], - "com.apple.product-type.bundle.unit-test": ["wrapper.cfbundle", "", ".xctest"], - "com.apple.product-type.bundle.ui-testing": ["wrapper.cfbundle", "", ".xctest"], - "com.googlecode.gyp.xcode.bundle": ["compiled.mach-o.dylib", "", ".so"], - "com.apple.product-type.kernel-extension": ["wrapper.kext", "", ".kext"], - } - - def __init__( - self, - properties=None, - id=None, - parent=None, - force_outdir=None, - force_prefix=None, - force_extension=None, - ): - # super - XCTarget.__init__(self, properties, id, parent) - - if ( - "productName" in self._properties - and "productType" in self._properties - and "productReference" not in self._properties - and self._properties["productType"] in self._product_filetypes - ): - products_group = None - pbxproject = self.PBXProjectAncestor() - if pbxproject is not None: - products_group = pbxproject.ProductsGroup() - - if products_group is not None: - (filetype, prefix, suffix) = self._product_filetypes[ - self._properties["productType"] - ] - # Xcode does not have a distinct type for loadable modules that are - # pure BSD targets (not in a bundle wrapper). GYP allows such modules - # to be specified by setting a target type to loadable_module without - # having mac_bundle set. These are mapped to the pseudo-product type - # com.googlecode.gyp.xcode.bundle. - # - # By picking up this special type and converting it to a dynamic - # library (com.apple.product-type.library.dynamic) with fix-ups, - # single-file loadable modules can be produced. - # - # MACH_O_TYPE is changed to mh_bundle to produce the proper file type - # (as opposed to mh_dylib). In order for linking to succeed, - # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be - # cleared. They are meaningless for type mh_bundle. - # - # Finally, the .so extension is forcibly applied over the default - # (.dylib), unless another forced extension is already selected. - # .dylib is plainly wrong, and .bundle is used by loadable_modules in - # bundle wrappers (com.apple.product-type.bundle). .so seems an odd - # choice because it's used as the extension on many other systems that - # don't distinguish between linkable shared libraries and non-linkable - # loadable modules, but there's precedent: Python loadable modules on - # Mac OS X use an .so extension. - if self._properties["productType"] == "com.googlecode.gyp.xcode.bundle": - self._properties[ - "productType" - ] = "com.apple.product-type.library.dynamic" - self.SetBuildSetting("MACH_O_TYPE", "mh_bundle") - self.SetBuildSetting("DYLIB_CURRENT_VERSION", "") - self.SetBuildSetting("DYLIB_COMPATIBILITY_VERSION", "") - if force_extension is None: - force_extension = suffix[1:] - - if ( - self._properties["productType"] - == "com.apple.product-type-bundle.unit.test" - or self._properties["productType"] - == "com.apple.product-type-bundle.ui-testing" - ): - if force_extension is None: - force_extension = suffix[1:] - - if force_extension is not None: - # If it's a wrapper (bundle), set WRAPPER_EXTENSION. - # Extension override. - suffix = "." + force_extension - if filetype.startswith("wrapper."): - self.SetBuildSetting("WRAPPER_EXTENSION", force_extension) - else: - self.SetBuildSetting("EXECUTABLE_EXTENSION", force_extension) - - if filetype.startswith("compiled.mach-o.executable"): - product_name = self._properties["productName"] - product_name += suffix - suffix = "" - self.SetProperty("productName", product_name) - self.SetBuildSetting("PRODUCT_NAME", product_name) - - # Xcode handles most prefixes based on the target type, however there - # are exceptions. If a "BSD Dynamic Library" target is added in the - # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that - # behavior. - if force_prefix is not None: - prefix = force_prefix - if filetype.startswith("wrapper."): - self.SetBuildSetting("WRAPPER_PREFIX", prefix) - else: - self.SetBuildSetting("EXECUTABLE_PREFIX", prefix) - - if force_outdir is not None: - self.SetBuildSetting("TARGET_BUILD_DIR", force_outdir) - - # TODO(tvl): Remove the below hack. - # http://code.google.com/p/gyp/issues/detail?id=122 - - # Some targets include the prefix in the target_name. These targets - # really should just add a product_name setting that doesn't include - # the prefix. For example: - # target_name = 'libevent', product_name = 'event' - # This check cleans up for them. - product_name = self._properties["productName"] - prefix_len = len(prefix) - if prefix_len and (product_name[:prefix_len] == prefix): - product_name = product_name[prefix_len:] - self.SetProperty("productName", product_name) - self.SetBuildSetting("PRODUCT_NAME", product_name) - - ref_props = { - "explicitFileType": filetype, - "includeInIndex": 0, - "path": prefix + product_name + suffix, - "sourceTree": "BUILT_PRODUCTS_DIR", - } - file_ref = PBXFileReference(ref_props) - products_group.AppendChild(file_ref) - self.SetProperty("productReference", file_ref) - - def GetBuildPhaseByType(self, type): - if "buildPhases" not in self._properties: - return None - - the_phase = None - for phase in self._properties["buildPhases"]: - if isinstance(phase, type): - # Some phases may be present in multiples in a well-formed project file, - # but phases like PBXSourcesBuildPhase may only be present singly, and - # this function is intended as an aid to GetBuildPhaseByType. Loop - # over the entire list of phases and assert if more than one of the - # desired type is found. - assert the_phase is None - the_phase = phase - - return the_phase - - def HeadersPhase(self): - headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase) - if headers_phase is None: - headers_phase = PBXHeadersBuildPhase() - - # The headers phase should come before the resources, sources, and - # frameworks phases, if any. - insert_at = len(self._properties["buildPhases"]) - for index, phase in enumerate(self._properties["buildPhases"]): - if ( - isinstance(phase, PBXResourcesBuildPhase) - or isinstance(phase, PBXSourcesBuildPhase) - or isinstance(phase, PBXFrameworksBuildPhase) - ): - insert_at = index - break - - self._properties["buildPhases"].insert(insert_at, headers_phase) - headers_phase.parent = self - - return headers_phase - - def ResourcesPhase(self): - resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase) - if resources_phase is None: - resources_phase = PBXResourcesBuildPhase() - - # The resources phase should come before the sources and frameworks - # phases, if any. - insert_at = len(self._properties["buildPhases"]) - for index, phase in enumerate(self._properties["buildPhases"]): - if isinstance(phase, PBXSourcesBuildPhase) or isinstance( - phase, PBXFrameworksBuildPhase - ): - insert_at = index - break - - self._properties["buildPhases"].insert(insert_at, resources_phase) - resources_phase.parent = self - - return resources_phase - - def SourcesPhase(self): - sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase) - if sources_phase is None: - sources_phase = PBXSourcesBuildPhase() - self.AppendProperty("buildPhases", sources_phase) - - return sources_phase - - def FrameworksPhase(self): - frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase) - if frameworks_phase is None: - frameworks_phase = PBXFrameworksBuildPhase() - self.AppendProperty("buildPhases", frameworks_phase) - - return frameworks_phase - - def AddDependency(self, other): - # super - XCTarget.AddDependency(self, other) - - static_library_type = "com.apple.product-type.library.static" - shared_library_type = "com.apple.product-type.library.dynamic" - framework_type = "com.apple.product-type.framework" - if ( - isinstance(other, PBXNativeTarget) - and "productType" in self._properties - and self._properties["productType"] != static_library_type - and "productType" in other._properties - and ( - other._properties["productType"] == static_library_type - or ( - ( - other._properties["productType"] == shared_library_type - or other._properties["productType"] == framework_type - ) - and ( - (not other.HasBuildSetting("MACH_O_TYPE")) - or other.GetBuildSetting("MACH_O_TYPE") != "mh_bundle" - ) - ) - ) - ): - - file_ref = other.GetProperty("productReference") - - pbxproject = self.PBXProjectAncestor() - other_pbxproject = other.PBXProjectAncestor() - if pbxproject != other_pbxproject: - other_project_product_group = pbxproject.AddOrGetProjectReference( - other_pbxproject - )[0] - file_ref = other_project_product_group.GetChildByRemoteObject(file_ref) - - self.FrameworksPhase().AppendProperty( - "files", PBXBuildFile({"fileRef": file_ref}) - ) - - -class PBXAggregateTarget(XCTarget): - pass - - -class PBXProject(XCContainerPortal): - # A PBXProject is really just an XCObject, the XCContainerPortal thing is - # just to allow PBXProject to be used in the containerPortal property of - # PBXContainerItemProxy. - """ - - Attributes: - path: "sample.xcodeproj". TODO(mark) Document me! - _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each - value is a reference to the dict in the - projectReferences list associated with the keyed - PBXProject. - """ - - _schema = XCContainerPortal._schema.copy() - _schema.update( - { - "attributes": [0, dict, 0, 0], - "buildConfigurationList": [ - 0, - XCConfigurationList, - 1, - 1, - XCConfigurationList(), - ], - "compatibilityVersion": [0, str, 0, 1, "Xcode 3.2"], - "hasScannedForEncodings": [0, int, 0, 1, 1], - "mainGroup": [0, PBXGroup, 1, 1, PBXGroup()], - "projectDirPath": [0, str, 0, 1, ""], - "projectReferences": [1, dict, 0, 0], - "projectRoot": [0, str, 0, 1, ""], - "targets": [1, XCTarget, 1, 1, []], - } - ) - - def __init__(self, properties=None, id=None, parent=None, path=None): - self.path = path - self._other_pbxprojects = {} - # super - return XCContainerPortal.__init__(self, properties, id, parent) - - def Name(self): - name = self.path - if name[-10:] == ".xcodeproj": - name = name[:-10] - return posixpath.basename(name) - - def Path(self): - return self.path - - def Comment(self): - return "Project object" - - def Children(self): - # super - children = XCContainerPortal.Children(self) - - # Add children that the schema doesn't know about. Maybe there's a more - # elegant way around this, but this is the only case where we need to own - # objects in a dictionary (that is itself in a list), and three lines for - # a one-off isn't that big a deal. - if "projectReferences" in self._properties: - for reference in self._properties["projectReferences"]: - children.append(reference["ProductGroup"]) - - return children - - def PBXProjectAncestor(self): - return self - - def _GroupByName(self, name): - if "mainGroup" not in self._properties: - self.SetProperty("mainGroup", PBXGroup()) - - main_group = self._properties["mainGroup"] - group = main_group.GetChildByName(name) - if group is None: - group = PBXGroup({"name": name}) - main_group.AppendChild(group) - - return group - - # SourceGroup and ProductsGroup are created by default in Xcode's own - # templates. - def SourceGroup(self): - return self._GroupByName("Source") - - def ProductsGroup(self): - return self._GroupByName("Products") - - # IntermediatesGroup is used to collect source-like files that are generated - # by rules or script phases and are placed in intermediate directories such - # as DerivedSources. - def IntermediatesGroup(self): - return self._GroupByName("Intermediates") - - # FrameworksGroup and ProjectsGroup are top-level groups used to collect - # frameworks and projects. - def FrameworksGroup(self): - return self._GroupByName("Frameworks") - - def ProjectsGroup(self): - return self._GroupByName("Projects") - - def RootGroupForPath(self, path): - """Returns a PBXGroup child of this object to which path should be added. - - This method is intended to choose between SourceGroup and - IntermediatesGroup on the basis of whether path is present in a source - directory or an intermediates directory. For the purposes of this - determination, any path located within a derived file directory such as - PROJECT_DERIVED_FILE_DIR is treated as being in an intermediates - directory. - - The returned value is a two-element tuple. The first element is the - PBXGroup, and the second element specifies whether that group should be - organized hierarchically (True) or as a single flat list (False). - """ - - # TODO(mark): make this a class variable and bind to self on call? - # Also, this list is nowhere near exhaustive. - # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by - # gyp.generator.xcode. There should probably be some way for that module - # to push the names in, rather than having to hard-code them here. - source_tree_groups = { - "DERIVED_FILE_DIR": (self.IntermediatesGroup, True), - "INTERMEDIATE_DIR": (self.IntermediatesGroup, True), - "PROJECT_DERIVED_FILE_DIR": (self.IntermediatesGroup, True), - "SHARED_INTERMEDIATE_DIR": (self.IntermediatesGroup, True), - } - - (source_tree, path) = SourceTreeAndPathFromPath(path) - if source_tree is not None and source_tree in source_tree_groups: - (group_func, hierarchical) = source_tree_groups[source_tree] - group = group_func() - return (group, hierarchical) - - # TODO(mark): make additional choices based on file extension. - - return (self.SourceGroup(), True) - - def AddOrGetFileInRootGroup(self, path): - """Returns a PBXFileReference corresponding to path in the correct group - according to RootGroupForPath's heuristics. - - If an existing PBXFileReference for path exists, it will be returned. - Otherwise, one will be created and returned. - """ - - (group, hierarchical) = self.RootGroupForPath(path) - return group.AddOrGetFileByPath(path, hierarchical) - - def RootGroupsTakeOverOnlyChildren(self, recurse=False): - """Calls TakeOverOnlyChild for all groups in the main group.""" - - for group in self._properties["mainGroup"]._properties["children"]: - if isinstance(group, PBXGroup): - group.TakeOverOnlyChild(recurse) - - def SortGroups(self): - # Sort the children of the mainGroup (like "Source" and "Products") - # according to their defined order. - self._properties["mainGroup"]._properties["children"] = sorted( - self._properties["mainGroup"]._properties["children"], - key=cmp_to_key(lambda x, y: x.CompareRootGroup(y)), - ) - - # Sort everything else by putting group before files, and going - # alphabetically by name within sections of groups and files. SortGroup - # is recursive. - for group in self._properties["mainGroup"]._properties["children"]: - if not isinstance(group, PBXGroup): - continue - - if group.Name() == "Products": - # The Products group is a special case. Instead of sorting - # alphabetically, sort things in the order of the targets that - # produce the products. To do this, just build up a new list of - # products based on the targets. - products = [] - for target in self._properties["targets"]: - if not isinstance(target, PBXNativeTarget): - continue - product = target._properties["productReference"] - # Make sure that the product is already in the products group. - assert product in group._properties["children"] - products.append(product) - - # Make sure that this process doesn't miss anything that was already - # in the products group. - assert len(products) == len(group._properties["children"]) - group._properties["children"] = products - else: - group.SortGroup() - - def AddOrGetProjectReference(self, other_pbxproject): - """Add a reference to another project file (via PBXProject object) to this - one. - - Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in - this project file that contains a PBXReferenceProxy object for each - product of each PBXNativeTarget in the other project file. ProjectRef is - a PBXFileReference to the other project file. - - If this project file already references the other project file, the - existing ProductGroup and ProjectRef are returned. The ProductGroup will - still be updated if necessary. - """ - - if "projectReferences" not in self._properties: - self._properties["projectReferences"] = [] - - product_group = None - project_ref = None - - if other_pbxproject not in self._other_pbxprojects: - # This project file isn't yet linked to the other one. Establish the - # link. - product_group = PBXGroup({"name": "Products"}) - - # ProductGroup is strong. - product_group.parent = self - - # There's nothing unique about this PBXGroup, and if left alone, it will - # wind up with the same set of hashables as all other PBXGroup objects - # owned by the projectReferences list. Add the hashables of the - # remote PBXProject that it's related to. - product_group._hashables.extend(other_pbxproject.Hashables()) - - # The other project reports its path as relative to the same directory - # that this project's path is relative to. The other project's path - # is not necessarily already relative to this project. Figure out the - # pathname that this project needs to use to refer to the other one. - this_path = posixpath.dirname(self.Path()) - projectDirPath = self.GetProperty("projectDirPath") - if projectDirPath: - if posixpath.isabs(projectDirPath[0]): - this_path = projectDirPath - else: - this_path = posixpath.join(this_path, projectDirPath) - other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path) - - # ProjectRef is weak (it's owned by the mainGroup hierarchy). - project_ref = PBXFileReference( - { - "lastKnownFileType": "wrapper.pb-project", - "path": other_path, - "sourceTree": "SOURCE_ROOT", - } - ) - self.ProjectsGroup().AppendChild(project_ref) - - ref_dict = {"ProductGroup": product_group, "ProjectRef": project_ref} - self._other_pbxprojects[other_pbxproject] = ref_dict - self.AppendProperty("projectReferences", ref_dict) - - # Xcode seems to sort this list case-insensitively - self._properties["projectReferences"] = sorted( - self._properties["projectReferences"], - key=lambda x: x["ProjectRef"].Name().lower() - ) - else: - # The link already exists. Pull out the relevnt data. - project_ref_dict = self._other_pbxprojects[other_pbxproject] - product_group = project_ref_dict["ProductGroup"] - project_ref = project_ref_dict["ProjectRef"] - - self._SetUpProductReferences(other_pbxproject, product_group, project_ref) - - inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False) - targets = other_pbxproject.GetProperty("targets") - if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets): - dir_path = project_ref._properties["path"] - product_group._hashables.extend(dir_path) - - return [product_group, project_ref] - - def _AllSymrootsUnique(self, target, inherit_unique_symroot): - # Returns True if all configurations have a unique 'SYMROOT' attribute. - # The value of inherit_unique_symroot decides, if a configuration is assumed - # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't - # define an explicit value for 'SYMROOT'. - symroots = self._DefinedSymroots(target) - for s in self._DefinedSymroots(target): - if ( - s is not None - and not self._IsUniqueSymrootForTarget(s) - or s is None - and not inherit_unique_symroot - ): - return False - return True if symroots else inherit_unique_symroot - - def _DefinedSymroots(self, target): - # Returns all values for the 'SYMROOT' attribute defined in all - # configurations for this target. If any configuration doesn't define the - # 'SYMROOT' attribute, None is added to the returned set. If all - # configurations don't define the 'SYMROOT' attribute, an empty set is - # returned. - config_list = target.GetProperty("buildConfigurationList") - symroots = set() - for config in config_list.GetProperty("buildConfigurations"): - setting = config.GetProperty("buildSettings") - if "SYMROOT" in setting: - symroots.add(setting["SYMROOT"]) - else: - symroots.add(None) - if len(symroots) == 1 and None in symroots: - return set() - return symroots - - def _IsUniqueSymrootForTarget(self, symroot): - # This method returns True if all configurations in target contain a - # 'SYMROOT' attribute that is unique for the given target. A value is - # unique, if the Xcode macro '$SRCROOT' appears in it in any form. - uniquifier = ["$SRCROOT", "$(SRCROOT)"] - if any(x in symroot for x in uniquifier): - return True - return False - - def _SetUpProductReferences(self, other_pbxproject, product_group, project_ref): - # TODO(mark): This only adds references to products in other_pbxproject - # when they don't exist in this pbxproject. Perhaps it should also - # remove references from this pbxproject that are no longer present in - # other_pbxproject. Perhaps it should update various properties if they - # change. - for target in other_pbxproject._properties["targets"]: - if not isinstance(target, PBXNativeTarget): - continue - - other_fileref = target._properties["productReference"] - if product_group.GetChildByRemoteObject(other_fileref) is None: - # Xcode sets remoteInfo to the name of the target and not the name - # of its product, despite this proxy being a reference to the product. - container_item = PBXContainerItemProxy( - { - "containerPortal": project_ref, - "proxyType": 2, - "remoteGlobalIDString": other_fileref, - "remoteInfo": target.Name(), - } - ) - # TODO(mark): Does sourceTree get copied straight over from the other - # project? Can the other project ever have lastKnownFileType here - # instead of explicitFileType? (Use it if so?) Can path ever be - # unset? (I don't think so.) Can other_fileref have name set, and - # does it impact the PBXReferenceProxy if so? These are the questions - # that perhaps will be answered one day. - reference_proxy = PBXReferenceProxy( - { - "fileType": other_fileref._properties["explicitFileType"], - "path": other_fileref._properties["path"], - "sourceTree": other_fileref._properties["sourceTree"], - "remoteRef": container_item, - } - ) - - product_group.AppendChild(reference_proxy) - - def SortRemoteProductReferences(self): - # For each remote project file, sort the associated ProductGroup in the - # same order that the targets are sorted in the remote project file. This - # is the sort order used by Xcode. - - def CompareProducts(x, y, remote_products): - # x and y are PBXReferenceProxy objects. Go through their associated - # PBXContainerItem to get the remote PBXFileReference, which will be - # present in the remote_products list. - x_remote = x._properties["remoteRef"]._properties["remoteGlobalIDString"] - y_remote = y._properties["remoteRef"]._properties["remoteGlobalIDString"] - x_index = remote_products.index(x_remote) - y_index = remote_products.index(y_remote) - - # Use the order of each remote PBXFileReference in remote_products to - # determine the sort order. - return cmp(x_index, y_index) - - for other_pbxproject, ref_dict in self._other_pbxprojects.items(): - # Build up a list of products in the remote project file, ordered the - # same as the targets that produce them. - remote_products = [] - for target in other_pbxproject._properties["targets"]: - if not isinstance(target, PBXNativeTarget): - continue - remote_products.append(target._properties["productReference"]) - - # Sort the PBXReferenceProxy children according to the list of remote - # products. - product_group = ref_dict["ProductGroup"] - product_group._properties["children"] = sorted( - product_group._properties["children"], - key=cmp_to_key( - lambda x, y, rp=remote_products: CompareProducts(x, y, rp)), - ) - - -class XCProjectFile(XCObject): - _schema = XCObject._schema.copy() - _schema.update( - { - "archiveVersion": [0, int, 0, 1, 1], - "classes": [0, dict, 0, 1, {}], - "objectVersion": [0, int, 0, 1, 46], - "rootObject": [0, PBXProject, 1, 1], - } - ) - - def ComputeIDs(self, recursive=True, overwrite=True, hash=None): - # Although XCProjectFile is implemented here as an XCObject, it's not a - # proper object in the Xcode sense, and it certainly doesn't have its own - # ID. Pass through an attempt to update IDs to the real root object. - if recursive: - self._properties["rootObject"].ComputeIDs(recursive, overwrite, hash) - - def Print(self, file=sys.stdout): - self.VerifyHasRequiredProperties() - - # Add the special "objects" property, which will be caught and handled - # separately during printing. This structure allows a fairly standard - # loop do the normal printing. - self._properties["objects"] = {} - self._XCPrint(file, 0, "// !$*UTF8*$!\n") - if self._should_print_single_line: - self._XCPrint(file, 0, "{ ") - else: - self._XCPrint(file, 0, "{\n") - for property, value in sorted( - self._properties.items() - ): - if property == "objects": - self._PrintObjects(file) - else: - self._XCKVPrint(file, 1, property, value) - self._XCPrint(file, 0, "}\n") - del self._properties["objects"] - - def _PrintObjects(self, file): - if self._should_print_single_line: - self._XCPrint(file, 0, "objects = {") - else: - self._XCPrint(file, 1, "objects = {\n") - - objects_by_class = {} - for object in self.Descendants(): - if object == self: - continue - class_name = object.__class__.__name__ - if class_name not in objects_by_class: - objects_by_class[class_name] = [] - objects_by_class[class_name].append(object) - - for class_name in sorted(objects_by_class): - self._XCPrint(file, 0, "\n") - self._XCPrint(file, 0, "/* Begin " + class_name + " section */\n") - for object in sorted( - objects_by_class[class_name], key=attrgetter("id") - ): - object.Print(file) - self._XCPrint(file, 0, "/* End " + class_name + " section */\n") - - if self._should_print_single_line: - self._XCPrint(file, 0, "}; ") - else: - self._XCPrint(file, 1, "};\n") diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py deleted file mode 100644 index 530196366..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2011 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Applies a fix to CR LF TAB handling in xml.dom. - -Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 -Working around this: http://bugs.python.org/issue5752 -TODO(bradnelson): Consider dropping this when we drop XP support. -""" - - -import xml.dom.minidom - - -def _Replacement_write_data(writer, data, is_attrib=False): - """Writes datachars to writer.""" - data = data.replace("&", "&").replace("<", "<") - data = data.replace('"', """).replace(">", ">") - if is_attrib: - data = data.replace("\r", " ").replace("\n", " ").replace("\t", " ") - writer.write(data) - - -def _Replacement_writexml(self, writer, indent="", addindent="", newl=""): - # indent = current indentation - # addindent = indentation to add to higher levels - # newl = newline string - writer.write(indent + "<" + self.tagName) - - attrs = self._get_attributes() - a_names = sorted(attrs.keys()) - - for a_name in a_names: - writer.write(' %s="' % a_name) - _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) - writer.write('"') - if self.childNodes: - writer.write(">%s" % newl) - for node in self.childNodes: - node.writexml(writer, indent + addindent, addindent, newl) - writer.write(f"{indent}{newl}") - else: - writer.write("/>%s" % newl) - - -class XmlFix: - """Object to manage temporary patching of xml.dom.minidom.""" - - def __init__(self): - # Preserve current xml.dom.minidom functions. - self.write_data = xml.dom.minidom._write_data - self.writexml = xml.dom.minidom.Element.writexml - # Inject replacement versions of a function and a method. - xml.dom.minidom._write_data = _Replacement_write_data - xml.dom.minidom.Element.writexml = _Replacement_writexml - - def Cleanup(self): - if self.write_data: - xml.dom.minidom._write_data = self.write_data - xml.dom.minidom.Element.writexml = self.writexml - self.write_data = None - - def __del__(self): - self.Cleanup() diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pyproject.toml b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pyproject.toml deleted file mode 100644 index d8a545152..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/pyproject.toml +++ /dev/null @@ -1,41 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0"] -build-backend = "setuptools.build_meta" - -[project] -name = "gyp-next" -version = "0.14.0" -authors = [ - { name="Node.js contributors", email="ryzokuken@disroot.org" }, -] -description = "A fork of the GYP build system for use in the Node.js projects" -readme = "README.md" -license = { file="LICENSE" } -requires-python = ">=3.6" -classifiers = [ - "Development Status :: 3 - Alpha", - "Environment :: Console", - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", -] - -[project.optional-dependencies] -dev = ["flake8", "pytest"] - -[project.scripts] -gyp = "gyp:script_main" - -[project.urls] -"Homepage" = "https://github.com/nodejs/gyp-next" - -[tool.setuptools] -package-dir = {"" = "pylib"} -packages = ["gyp", "gyp.generator"] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/test_gyp.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/test_gyp.py deleted file mode 100755 index b7bb956b8..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/test_gyp.py +++ /dev/null @@ -1,261 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""gyptest.py -- test runner for GYP tests.""" - - -import argparse -import os -import platform -import subprocess -import sys -import time - - -def is_test_name(f): - return f.startswith("gyptest") and f.endswith(".py") - - -def find_all_gyptest_files(directory): - result = [] - for root, dirs, files in os.walk(directory): - result.extend([os.path.join(root, f) for f in files if is_test_name(f)]) - result.sort() - return result - - -def main(argv=None): - if argv is None: - argv = sys.argv - - parser = argparse.ArgumentParser() - parser.add_argument("-a", "--all", action="store_true", help="run all tests") - parser.add_argument("-C", "--chdir", action="store", help="change to directory") - parser.add_argument( - "-f", - "--format", - action="store", - default="", - help="run tests with the specified formats", - ) - parser.add_argument( - "-G", - "--gyp_option", - action="append", - default=[], - help="Add -G options to the gyp command line", - ) - parser.add_argument( - "-l", "--list", action="store_true", help="list available tests and exit" - ) - parser.add_argument( - "-n", - "--no-exec", - action="store_true", - help="no execute, just print the command line", - ) - parser.add_argument( - "--path", action="append", default=[], help="additional $PATH directory" - ) - parser.add_argument( - "-q", - "--quiet", - action="store_true", - help="quiet, don't print anything unless there are failures", - ) - parser.add_argument( - "-v", - "--verbose", - action="store_true", - help="print configuration info and test results.", - ) - parser.add_argument("tests", nargs="*") - args = parser.parse_args(argv[1:]) - - if args.chdir: - os.chdir(args.chdir) - - if args.path: - extra_path = [os.path.abspath(p) for p in args.path] - extra_path = os.pathsep.join(extra_path) - os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"] - - if not args.tests: - if not args.all: - sys.stderr.write("Specify -a to get all tests.\n") - return 1 - args.tests = ["test"] - - tests = [] - for arg in args.tests: - if os.path.isdir(arg): - tests.extend(find_all_gyptest_files(os.path.normpath(arg))) - else: - if not is_test_name(os.path.basename(arg)): - print(arg, "is not a valid gyp test name.", file=sys.stderr) - sys.exit(1) - tests.append(arg) - - if args.list: - for test in tests: - print(test) - sys.exit(0) - - os.environ["PYTHONPATH"] = os.path.abspath("test/lib") - - if args.verbose: - print_configuration_info() - - if args.gyp_option and not args.quiet: - print("Extra Gyp options: %s\n" % args.gyp_option) - - if args.format: - format_list = args.format.split(",") - else: - format_list = { - "aix5": ["make"], - "os400": ["make"], - "freebsd7": ["make"], - "freebsd8": ["make"], - "openbsd5": ["make"], - "cygwin": ["msvs"], - "win32": ["msvs", "ninja"], - "linux": ["make", "ninja"], - "linux2": ["make", "ninja"], - "linux3": ["make", "ninja"], - # TODO: Re-enable xcode-ninja. - # https://bugs.chromium.org/p/gyp/issues/detail?id=530 - # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], - "darwin": ["make", "ninja", "xcode"], - }[sys.platform] - - gyp_options = [] - for option in args.gyp_option: - gyp_options += ["-G", option] - - runner = Runner(format_list, tests, gyp_options, args.verbose) - runner.run() - - if not args.quiet: - runner.print_results() - - return 1 if runner.failures else 0 - - -def print_configuration_info(): - print("Test configuration:") - if sys.platform == "darwin": - sys.path.append(os.path.abspath("test/lib")) - import TestMac - - print(f" Mac {platform.mac_ver()[0]} {platform.mac_ver()[2]}") - print(f" Xcode {TestMac.Xcode.Version()}") - elif sys.platform == "win32": - sys.path.append(os.path.abspath("pylib")) - import gyp.MSVSVersion - - print(" Win %s %s\n" % platform.win32_ver()[0:2]) - print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description()) - elif sys.platform in ("linux", "linux2"): - print(" Linux %s" % " ".join(platform.linux_distribution())) - print(f" Python {platform.python_version()}") - print(f" PYTHONPATH={os.environ['PYTHONPATH']}") - print() - - -class Runner: - def __init__(self, formats, tests, gyp_options, verbose): - self.formats = formats - self.tests = tests - self.verbose = verbose - self.gyp_options = gyp_options - self.failures = [] - self.num_tests = len(formats) * len(tests) - num_digits = len(str(self.num_tests)) - self.fmt_str = "[%%%dd/%%%dd] (%%s) %%s" % (num_digits, num_digits) - self.isatty = sys.stdout.isatty() and not self.verbose - self.env = os.environ.copy() - self.hpos = 0 - - def run(self): - run_start = time.time() - - i = 1 - for fmt in self.formats: - for test in self.tests: - self.run_test(test, fmt, i) - i += 1 - - if self.isatty: - self.erase_current_line() - - self.took = time.time() - run_start - - def run_test(self, test, fmt, i): - if self.isatty: - self.erase_current_line() - - msg = self.fmt_str % (i, self.num_tests, fmt, test) - self.print_(msg) - - start = time.time() - cmd = [sys.executable, test] + self.gyp_options - self.env["TESTGYP_FORMAT"] = fmt - proc = subprocess.Popen( - cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=self.env - ) - proc.wait() - took = time.time() - start - - stdout = proc.stdout.read().decode("utf8") - if proc.returncode == 2: - res = "skipped" - elif proc.returncode: - res = "failed" - self.failures.append(f"({test}) {fmt}") - else: - res = "passed" - res_msg = f" {res} {took:.3f}s" - self.print_(res_msg) - - if stdout and not stdout.endswith(("PASSED\n", "NO RESULT\n")): - print() - print("\n".join(f" {line}" for line in stdout.splitlines())) - elif not self.isatty: - print() - - def print_(self, msg): - print(msg, end="") - index = msg.rfind("\n") - if index == -1: - self.hpos += len(msg) - else: - self.hpos = len(msg) - index - sys.stdout.flush() - - def erase_current_line(self): - print("\b" * self.hpos + " " * self.hpos + "\b" * self.hpos, end="") - sys.stdout.flush() - self.hpos = 0 - - def print_results(self): - num_failures = len(self.failures) - if num_failures: - print() - if num_failures == 1: - print("Failed the following test:") - else: - print("Failed the following %d tests:" % num_failures) - print("\t" + "\n\t".join(sorted(self.failures))) - print() - print( - "Ran %d tests in %.3fs, %d failed." - % (self.num_tests, self.took, num_failures) - ) - print() - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/README b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/README deleted file mode 100644 index 84a73d152..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/README +++ /dev/null @@ -1,15 +0,0 @@ -pretty_vcproj: - Usage: pretty_vcproj.py "c:\path\to\vcproj.vcproj" [key1=value1] [key2=value2] - - They key/value pair are used to resolve vsprops name. - - For example, if I want to diff the base.vcproj project: - - pretty_vcproj.py z:\dev\src-chrome\src\base\build\base.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > original.txt - pretty_vcproj.py z:\dev\src-chrome\src\base\base_gyp.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > gyp.txt - - And you can use your favorite diff tool to see the changes. - - Note: In the case of base.vcproj, the original vcproj is one level up the generated one. - I suggest you do a search and replace for '"..\' and replace it with '"' in original.txt - before you perform the diff. \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/README b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/README deleted file mode 100644 index 2492a2c2f..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/README +++ /dev/null @@ -1,5 +0,0 @@ -Specifications contains syntax formatters for Xcode 3. These do not appear to be supported yet on Xcode 4. To use these with Xcode 3 please install both the gyp.pbfilespec and gyp.xclangspec files in - -~/Library/Application Support/Developer/Shared/Xcode/Specifications/ - -and restart Xcode. \ No newline at end of file diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec deleted file mode 100644 index 85e2e268a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec +++ /dev/null @@ -1,27 +0,0 @@ -/* - gyp.pbfilespec - GYP source file spec for Xcode 3 - - There is not much documentation available regarding the format - of .pbfilespec files. As a starting point, see for instance the - outdated documentation at: - http://maxao.free.fr/xcode-plugin-interface/specifications.html - and the files in: - /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/ - - Place this file in directory: - ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ -*/ - -( - { - Identifier = sourcecode.gyp; - BasedOn = sourcecode; - Name = "GYP Files"; - Extensions = ("gyp", "gypi"); - MIMETypes = ("text/gyp"); - Language = "xcode.lang.gyp"; - IsTextFile = YES; - IsSourceFile = YES; - } -) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec deleted file mode 100644 index 3b3506d31..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec +++ /dev/null @@ -1,226 +0,0 @@ -/* - Copyright (c) 2011 Google Inc. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. - - gyp.xclangspec - GYP language specification for Xcode 3 - - There is not much documentation available regarding the format - of .xclangspec files. As a starting point, see for instance the - outdated documentation at: - http://maxao.free.fr/xcode-plugin-interface/specifications.html - and the files in: - /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/ - - Place this file in directory: - ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ -*/ - -( - - { - Identifier = "xcode.lang.gyp.keyword"; - Syntax = { - Words = ( - "and", - "or", - " (caar gyp-parse-history) target-point) - (setq gyp-parse-history (cdr gyp-parse-history)))) - -(defun gyp-parse-point () - "The point of the last parse state added by gyp-parse-to." - (caar gyp-parse-history)) - -(defun gyp-parse-sections () - "A list of section symbols holding at the last parse state point." - (cdar gyp-parse-history)) - -(defun gyp-inside-dictionary-p () - "Predicate returning true if the parser is inside a dictionary." - (not (eq (cadar gyp-parse-history) 'list))) - -(defun gyp-add-parse-history (point sections) - "Add parse state SECTIONS to the parse history at POINT so that parsing can be - resumed instantly." - (while (>= (caar gyp-parse-history) point) - (setq gyp-parse-history (cdr gyp-parse-history))) - (setq gyp-parse-history (cons (cons point sections) gyp-parse-history))) - -(defun gyp-parse-to (target-point) - "Parses from (point) to TARGET-POINT adding the parse state information to - gyp-parse-state-history. Parsing stops if TARGET-POINT is reached or if a - string literal has been parsed. Returns nil if no further parsing can be - done, otherwise returns the position of the start of a parsed string, leaving - the point at the end of the string." - (let ((parsing t) - string-start) - (while parsing - (setq string-start nil) - ;; Parse up to a character that starts a sexp, or if the nesting - ;; level decreases. - (let ((state (parse-partial-sexp (gyp-parse-point) - target-point - -1 - t)) - (sections (gyp-parse-sections))) - (if (= (nth 0 state) -1) - (setq sections (cdr sections)) ; pop out a level - (cond ((looking-at-p "['\"]") ; a string - (setq string-start (point)) - (goto-char (scan-sexps (point) 1)) - (if (gyp-inside-dictionary-p) - ;; Look for sections inside a dictionary - (let ((section (gyp-section-name - (buffer-substring-no-properties - (+ 1 string-start) - (- (point) 1))))) - (setq sections (cons section (cdr sections))))) - ;; Stop after the string so it can be fontified. - (setq target-point (point))) - ((looking-at-p "{") - ;; Inside a dictionary. Increase nesting. - (forward-char 1) - (setq sections (cons 'unknown sections))) - ((looking-at-p "\\[") - ;; Inside a list. Increase nesting - (forward-char 1) - (setq sections (cons 'list sections))) - ((not (eobp)) - ;; other - (forward-char 1)))) - (gyp-add-parse-history (point) sections) - (setq parsing (< (point) target-point)))) - string-start)) - -(defun gyp-section-at-point () - "Transform the last parse state, which is a list of nested sections and return - the section symbol that should be used to determine font-lock information for - the string. Can return nil indicating the string should not have any attached - section." - (let ((sections (gyp-parse-sections))) - (cond - ((eq (car sections) 'conditions) - ;; conditions can occur in a variables section, but we still want to - ;; highlight it as a keyword. - nil) - ((and (eq (car sections) 'list) - (eq (cadr sections) 'list)) - ;; conditions and sources can have items in [[ ]] - (caddr sections)) - (t (cadr sections))))) - -(defun gyp-section-match (limit) - "Parse from (point) to LIMIT returning by means of match data what was - matched. The group of the match indicates what style font-lock should apply. - See also `gyp-add-font-lock-keywords'." - (gyp-invalidate-parse-states-after (point)) - (let ((group nil) - (string-start t)) - (while (and (< (point) limit) - (not group) - string-start) - (setq string-start (gyp-parse-to limit)) - (if string-start - (setq group (cl-case (gyp-section-at-point) - ('dependencies 1) - ('variables 2) - ('conditions 2) - ('sources 3) - ('defines 4) - (nil nil))))) - (if group - (progn - ;; Set the match data to indicate to the font-lock mechanism the - ;; highlighting to be performed. - (set-match-data (append (list string-start (point)) - (make-list (* (1- group) 2) nil) - (list (1+ string-start) (1- (point))))) - t)))) - -;;; Please see http://code.google.com/p/gyp/wiki/GypLanguageSpecification for -;;; canonical list of keywords. -(defun gyp-add-font-lock-keywords () - "Add gyp-mode keywords to font-lock mechanism." - ;; TODO(jknotten): Move all the keyword highlighting into gyp-section-match - ;; so that we can do the font-locking in a single font-lock pass. - (font-lock-add-keywords - nil - (list - ;; Top-level keywords - (list (concat "['\"]\\(" - (regexp-opt (list "action" "action_name" "actions" "cflags" - "cflags_cc" "conditions" "configurations" - "copies" "defines" "dependencies" "destination" - "direct_dependent_settings" - "export_dependent_settings" "extension" "files" - "include_dirs" "includes" "inputs" "ldflags" "libraries" - "link_settings" "mac_bundle" "message" - "msvs_external_rule" "outputs" "product_name" - "process_outputs_as_sources" "rules" "rule_name" - "sources" "suppress_wildcard" - "target_conditions" "target_defaults" - "target_defines" "target_name" "toolsets" - "targets" "type" "variables" "xcode_settings")) - "[!/+=]?\\)") 1 'font-lock-keyword-face t) - ;; Type of target - (list (concat "['\"]\\(" - (regexp-opt (list "loadable_module" "static_library" - "shared_library" "executable" "none")) - "\\)") 1 'font-lock-type-face t) - (list "\\(?:target\\|action\\)_name['\"]\\s-*:\\s-*['\"]\\([^ '\"]*\\)" 1 - 'font-lock-function-name-face t) - (list 'gyp-section-match - (list 1 'font-lock-function-name-face t t) ; dependencies - (list 2 'font-lock-variable-name-face t t) ; variables, conditions - (list 3 'font-lock-constant-face t t) ; sources - (list 4 'font-lock-preprocessor-face t t)) ; preprocessor - ;; Variable expansion - (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) - ;; Command expansion - (list " "{dst}"') - - print("}") - - -def main(): - if len(sys.argv) < 2: - print(__doc__, file=sys.stderr) - print(file=sys.stderr) - print("usage: %s target1 target2..." % (sys.argv[0]), file=sys.stderr) - return 1 - - edges = LoadEdges("dump.json", sys.argv[1:]) - - WriteGraph(edges) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_gyp.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_gyp.py deleted file mode 100755 index 6eef3a1bb..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_gyp.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Pretty-prints the contents of a GYP file.""" - - -import sys -import re - - -# Regex to remove comments when we're counting braces. -COMMENT_RE = re.compile(r"\s*#.*") - -# Regex to remove quoted strings when we're counting braces. -# It takes into account quoted quotes, and makes sure that the quotes match. -# NOTE: It does not handle quotes that span more than one line, or -# cases where an escaped quote is preceded by an escaped backslash. -QUOTE_RE_STR = r'(?P[\'"])(.*?)(? 0: - after = True - - # This catches the special case of a closing brace having something - # other than just whitespace ahead of it -- we don't want to - # unindent that until after this line is printed so it stays with - # the previous indentation level. - if cnt < 0 and closing_prefix_re.match(stripline): - after = True - return (cnt, after) - - -def prettyprint_input(lines): - """Does the main work of indenting the input based on the brace counts.""" - indent = 0 - basic_offset = 2 - for line in lines: - if COMMENT_RE.match(line): - print(line) - else: - line = line.strip("\r\n\t ") # Otherwise doesn't strip \r on Unix. - if len(line) > 0: - (brace_diff, after) = count_braces(line) - if brace_diff != 0: - if after: - print(" " * (basic_offset * indent) + line) - indent += brace_diff - else: - indent += brace_diff - print(" " * (basic_offset * indent) + line) - else: - print(" " * (basic_offset * indent) + line) - else: - print("") - - -def main(): - if len(sys.argv) > 1: - data = open(sys.argv[1]).read().splitlines() - else: - data = sys.stdin.read().splitlines() - # Split up the double braces. - lines = split_double_braces(data) - - # Indent and print the output. - prettyprint_input(lines) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_sln.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_sln.py deleted file mode 100755 index 6ca0cd12a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_sln.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Prints the information in a sln file in a diffable way. - - It first outputs each projects in alphabetical order with their - dependencies. - - Then it outputs a possible build order. -""" - - -import os -import re -import sys -import pretty_vcproj - -__author__ = "nsylvain (Nicolas Sylvain)" - - -def BuildProject(project, built, projects, deps): - # if all dependencies are done, we can build it, otherwise we try to build the - # dependency. - # This is not infinite-recursion proof. - for dep in deps[project]: - if dep not in built: - BuildProject(dep, built, projects, deps) - print(project) - built.append(project) - - -def ParseSolution(solution_file): - # All projects, their clsid and paths. - projects = dict() - - # A list of dependencies associated with a project. - dependencies = dict() - - # Regular expressions that matches the SLN format. - # The first line of a project definition. - begin_project = re.compile( - r'^Project\("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' - r'}"\) = "(.*)", "(.*)", "(.*)"$' - ) - # The last line of a project definition. - end_project = re.compile("^EndProject$") - # The first line of a dependency list. - begin_dep = re.compile(r"ProjectSection\(ProjectDependencies\) = postProject$") - # The last line of a dependency list. - end_dep = re.compile("EndProjectSection$") - # A line describing a dependency. - dep_line = re.compile(" *({.*}) = ({.*})$") - - in_deps = False - solution = open(solution_file) - for line in solution: - results = begin_project.search(line) - if results: - # Hack to remove icu because the diff is too different. - if results.group(1).find("icu") != -1: - continue - # We remove "_gyp" from the names because it helps to diff them. - current_project = results.group(1).replace("_gyp", "") - projects[current_project] = [ - results.group(2).replace("_gyp", ""), - results.group(3), - results.group(2), - ] - dependencies[current_project] = [] - continue - - results = end_project.search(line) - if results: - current_project = None - continue - - results = begin_dep.search(line) - if results: - in_deps = True - continue - - results = end_dep.search(line) - if results: - in_deps = False - continue - - results = dep_line.search(line) - if results and in_deps and current_project: - dependencies[current_project].append(results.group(1)) - continue - - # Change all dependencies clsid to name instead. - for project in dependencies: - # For each dependencies in this project - new_dep_array = [] - for dep in dependencies[project]: - # Look for the project name matching this cldis - for project_info in projects: - if projects[project_info][1] == dep: - new_dep_array.append(project_info) - dependencies[project] = sorted(new_dep_array) - - return (projects, dependencies) - - -def PrintDependencies(projects, deps): - print("---------------------------------------") - print("Dependencies for all projects") - print("---------------------------------------") - print("-- --") - - for (project, dep_list) in sorted(deps.items()): - print("Project : %s" % project) - print("Path : %s" % projects[project][0]) - if dep_list: - for dep in dep_list: - print(" - %s" % dep) - print("") - - print("-- --") - - -def PrintBuildOrder(projects, deps): - print("---------------------------------------") - print("Build order ") - print("---------------------------------------") - print("-- --") - - built = [] - for (project, _) in sorted(deps.items()): - if project not in built: - BuildProject(project, built, projects, deps) - - print("-- --") - - -def PrintVCProj(projects): - - for project in projects: - print("-------------------------------------") - print("-------------------------------------") - print(project) - print(project) - print(project) - print("-------------------------------------") - print("-------------------------------------") - - project_path = os.path.abspath( - os.path.join(os.path.dirname(sys.argv[1]), projects[project][2]) - ) - - pretty = pretty_vcproj - argv = [ - "", - project_path, - "$(SolutionDir)=%s\\" % os.path.dirname(sys.argv[1]), - ] - argv.extend(sys.argv[3:]) - pretty.main(argv) - - -def main(): - # check if we have exactly 1 parameter. - if len(sys.argv) < 2: - print('Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0]) - return 1 - - (projects, deps) = ParseSolution(sys.argv[1]) - PrintDependencies(projects, deps) - PrintBuildOrder(projects, deps) - - if "--recursive" in sys.argv: - PrintVCProj(projects) - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_vcproj.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_vcproj.py deleted file mode 100755 index 00d32debd..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +++ /dev/null @@ -1,339 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Make the format of a vcproj really pretty. - - This script normalize and sort an xml. It also fetches all the properties - inside linked vsprops and include them explicitly in the vcproj. - - It outputs the resulting xml to stdout. -""" - - -import os -import sys - -from xml.dom.minidom import parse -from xml.dom.minidom import Node - -__author__ = "nsylvain (Nicolas Sylvain)" -ARGUMENTS = None -REPLACEMENTS = dict() - - -def cmp(x, y): - return (x > y) - (x < y) - - -class CmpTuple: - """Compare function between 2 tuple.""" - - def __call__(self, x, y): - return cmp(x[0], y[0]) - - -class CmpNode: - """Compare function between 2 xml nodes.""" - - def __call__(self, x, y): - def get_string(node): - node_string = "node" - node_string += node.nodeName - if node.nodeValue: - node_string += node.nodeValue - - if node.attributes: - # We first sort by name, if present. - node_string += node.getAttribute("Name") - - all_nodes = [] - for (name, value) in node.attributes.items(): - all_nodes.append((name, value)) - - all_nodes.sort(CmpTuple()) - for (name, value) in all_nodes: - node_string += name - node_string += value - - return node_string - - return cmp(get_string(x), get_string(y)) - - -def PrettyPrintNode(node, indent=0): - if node.nodeType == Node.TEXT_NODE: - if node.data.strip(): - print("{}{}".format(" " * indent, node.data.strip())) - return - - if node.childNodes: - node.normalize() - # Get the number of attributes - attr_count = 0 - if node.attributes: - attr_count = node.attributes.length - - # Print the main tag - if attr_count == 0: - print("{}<{}>".format(" " * indent, node.nodeName)) - else: - print("{}<{}".format(" " * indent, node.nodeName)) - - all_attributes = [] - for (name, value) in node.attributes.items(): - all_attributes.append((name, value)) - all_attributes.sort(CmpTuple()) - for (name, value) in all_attributes: - print('{} {}="{}"'.format(" " * indent, name, value)) - print("%s>" % (" " * indent)) - if node.nodeValue: - print("{} {}".format(" " * indent, node.nodeValue)) - - for sub_node in node.childNodes: - PrettyPrintNode(sub_node, indent=indent + 2) - print("{}".format(" " * indent, node.nodeName)) - - -def FlattenFilter(node): - """Returns a list of all the node and sub nodes.""" - node_list = [] - - if node.attributes and node.getAttribute("Name") == "_excluded_files": - # We don't add the "_excluded_files" filter. - return [] - - for current in node.childNodes: - if current.nodeName == "Filter": - node_list.extend(FlattenFilter(current)) - else: - node_list.append(current) - - return node_list - - -def FixFilenames(filenames, current_directory): - new_list = [] - for filename in filenames: - if filename: - for key in REPLACEMENTS: - filename = filename.replace(key, REPLACEMENTS[key]) - os.chdir(current_directory) - filename = filename.strip("\"' ") - if filename.startswith("$"): - new_list.append(filename) - else: - new_list.append(os.path.abspath(filename)) - return new_list - - -def AbsoluteNode(node): - """Makes all the properties we know about in this node absolute.""" - if node.attributes: - for (name, value) in node.attributes.items(): - if name in [ - "InheritedPropertySheets", - "RelativePath", - "AdditionalIncludeDirectories", - "IntermediateDirectory", - "OutputDirectory", - "AdditionalLibraryDirectories", - ]: - # We want to fix up these paths - path_list = value.split(";") - new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) - node.setAttribute(name, ";".join(new_list)) - if not value: - node.removeAttribute(name) - - -def CleanupVcproj(node): - """For each sub node, we call recursively this function.""" - for sub_node in node.childNodes: - AbsoluteNode(sub_node) - CleanupVcproj(sub_node) - - # Normalize the node, and remove all extraneous whitespaces. - for sub_node in node.childNodes: - if sub_node.nodeType == Node.TEXT_NODE: - sub_node.data = sub_node.data.replace("\r", "") - sub_node.data = sub_node.data.replace("\n", "") - sub_node.data = sub_node.data.rstrip() - - # Fix all the semicolon separated attributes to be sorted, and we also - # remove the dups. - if node.attributes: - for (name, value) in node.attributes.items(): - sorted_list = sorted(value.split(";")) - unique_list = [] - for i in sorted_list: - if not unique_list.count(i): - unique_list.append(i) - node.setAttribute(name, ";".join(unique_list)) - if not value: - node.removeAttribute(name) - - if node.childNodes: - node.normalize() - - # For each node, take a copy, and remove it from the list. - node_array = [] - while node.childNodes and node.childNodes[0]: - # Take a copy of the node and remove it from the list. - current = node.childNodes[0] - node.removeChild(current) - - # If the child is a filter, we want to append all its children - # to this same list. - if current.nodeName == "Filter": - node_array.extend(FlattenFilter(current)) - else: - node_array.append(current) - - # Sort the list. - node_array.sort(CmpNode()) - - # Insert the nodes in the correct order. - for new_node in node_array: - # But don't append empty tool node. - if new_node.nodeName == "Tool": - if new_node.attributes and new_node.attributes.length == 1: - # This one was empty. - continue - if new_node.nodeName == "UserMacro": - continue - node.appendChild(new_node) - - -def GetConfiguationNodes(vcproj): - # TODO(nsylvain): Find a better way to navigate the xml. - nodes = [] - for node in vcproj.childNodes: - if node.nodeName == "Configurations": - for sub_node in node.childNodes: - if sub_node.nodeName == "Configuration": - nodes.append(sub_node) - - return nodes - - -def GetChildrenVsprops(filename): - dom = parse(filename) - if dom.documentElement.attributes: - vsprops = dom.documentElement.getAttribute("InheritedPropertySheets") - return FixFilenames(vsprops.split(";"), os.path.dirname(filename)) - return [] - - -def SeekToNode(node1, child2): - # A text node does not have properties. - if child2.nodeType == Node.TEXT_NODE: - return None - - # Get the name of the current node. - current_name = child2.getAttribute("Name") - if not current_name: - # There is no name. We don't know how to merge. - return None - - # Look through all the nodes to find a match. - for sub_node in node1.childNodes: - if sub_node.nodeName == child2.nodeName: - name = sub_node.getAttribute("Name") - if name == current_name: - return sub_node - - # No match. We give up. - return None - - -def MergeAttributes(node1, node2): - # No attributes to merge? - if not node2.attributes: - return - - for (name, value2) in node2.attributes.items(): - # Don't merge the 'Name' attribute. - if name == "Name": - continue - value1 = node1.getAttribute(name) - if value1: - # The attribute exist in the main node. If it's equal, we leave it - # untouched, otherwise we concatenate it. - if value1 != value2: - node1.setAttribute(name, ";".join([value1, value2])) - else: - # The attribute does not exist in the main node. We append this one. - node1.setAttribute(name, value2) - - # If the attribute was a property sheet attributes, we remove it, since - # they are useless. - if name == "InheritedPropertySheets": - node1.removeAttribute(name) - - -def MergeProperties(node1, node2): - MergeAttributes(node1, node2) - for child2 in node2.childNodes: - child1 = SeekToNode(node1, child2) - if child1: - MergeProperties(child1, child2) - else: - node1.appendChild(child2.cloneNode(True)) - - -def main(argv): - """Main function of this vcproj prettifier.""" - global ARGUMENTS - ARGUMENTS = argv - - # check if we have exactly 1 parameter. - if len(argv) < 2: - print( - 'Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' - "[key2=value2]" % argv[0] - ) - return 1 - - # Parse the keys - for i in range(2, len(argv)): - (key, value) = argv[i].split("=") - REPLACEMENTS[key] = value - - # Open the vcproj and parse the xml. - dom = parse(argv[1]) - - # First thing we need to do is find the Configuration Node and merge them - # with the vsprops they include. - for configuration_node in GetConfiguationNodes(dom.documentElement): - # Get the property sheets associated with this configuration. - vsprops = configuration_node.getAttribute("InheritedPropertySheets") - - # Fix the filenames to be absolute. - vsprops_list = FixFilenames( - vsprops.strip().split(";"), os.path.dirname(argv[1]) - ) - - # Extend the list of vsprops with all vsprops contained in the current - # vsprops. - for current_vsprops in vsprops_list: - vsprops_list.extend(GetChildrenVsprops(current_vsprops)) - - # Now that we have all the vsprops, we need to merge them. - for current_vsprops in vsprops_list: - MergeProperties(configuration_node, parse(current_vsprops).documentElement) - - # Now that everything is merged, we need to cleanup the xml. - CleanupVcproj(dom.documentElement) - - # Finally, we use the prett xml function to print the vcproj back to the - # user. - # print dom.toprettyxml(newl="\n") - PrettyPrintNode(dom.documentElement) - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv)) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/Find-VisualStudio.cs b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/Find-VisualStudio.cs deleted file mode 100644 index d2e45a762..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/Find-VisualStudio.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2017 - Refael Ackermann -// Distributed under MIT style license -// See accompanying file LICENSE at https://github.com/node4good/windows-autoconf - -// Usage: -// powershell -ExecutionPolicy Unrestricted -Command "Add-Type -Path Find-VisualStudio.cs; [VisualStudioConfiguration.Main]::PrintJson()" -// This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace VisualStudioConfiguration -{ - [Flags] - public enum InstanceState : uint - { - None = 0, - Local = 1, - Registered = 2, - NoRebootRequired = 4, - NoErrors = 8, - Complete = 4294967295, - } - - [Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface IEnumSetupInstances - { - - void Next([MarshalAs(UnmanagedType.U4), In] int celt, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt, - [MarshalAs(UnmanagedType.U4)] out int pceltFetched); - - void Skip([MarshalAs(UnmanagedType.U4), In] int celt); - - void Reset(); - - [return: MarshalAs(UnmanagedType.Interface)] - IEnumSetupInstances Clone(); - } - - [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupConfiguration - { - } - - [Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupConfiguration2 : ISetupConfiguration - { - - [return: MarshalAs(UnmanagedType.Interface)] - IEnumSetupInstances EnumInstances(); - - [return: MarshalAs(UnmanagedType.Interface)] - ISetupInstance GetInstanceForCurrentProcess(); - - [return: MarshalAs(UnmanagedType.Interface)] - ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path); - - [return: MarshalAs(UnmanagedType.Interface)] - IEnumSetupInstances EnumAllInstances(); - } - - [Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupInstance - { - } - - [Guid("89143C9A-05AF-49B0-B717-72E218A2185C")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupInstance2 : ISetupInstance - { - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstanceId(); - - [return: MarshalAs(UnmanagedType.Struct)] - System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstallationName(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstallationPath(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetInstallationVersion(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid); - - [return: MarshalAs(UnmanagedType.BStr)] - string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath); - - [return: MarshalAs(UnmanagedType.U4)] - InstanceState GetState(); - - [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] - ISetupPackageReference[] GetPackages(); - - ISetupPackageReference GetProduct(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetProductPath(); - - [return: MarshalAs(UnmanagedType.VariantBool)] - bool IsLaunchable(); - - [return: MarshalAs(UnmanagedType.VariantBool)] - bool IsComplete(); - - [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] - ISetupPropertyStore GetProperties(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetEnginePath(); - } - - [Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupPackageReference - { - - [return: MarshalAs(UnmanagedType.BStr)] - string GetId(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetVersion(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetChip(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetLanguage(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetBranch(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetType(); - - [return: MarshalAs(UnmanagedType.BStr)] - string GetUniqueId(); - - [return: MarshalAs(UnmanagedType.VariantBool)] - bool GetIsExtension(); - } - - [Guid("c601c175-a3be-44bc-91f6-4568d230fc83")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComImport] - public interface ISetupPropertyStore - { - - [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] - string[] GetNames(); - - object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName); - } - - [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] - [CoClass(typeof(SetupConfigurationClass))] - [ComImport] - public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration - { - } - - [Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")] - [ClassInterface(ClassInterfaceType.None)] - [ComImport] - public class SetupConfigurationClass - { - } - - public static class Main - { - public static void PrintJson() - { - ISetupConfiguration query = new SetupConfiguration(); - ISetupConfiguration2 query2 = (ISetupConfiguration2)query; - IEnumSetupInstances e = query2.EnumAllInstances(); - - int pceltFetched; - ISetupInstance2[] rgelt = new ISetupInstance2[1]; - List instances = new List(); - while (true) - { - e.Next(1, rgelt, out pceltFetched); - if (pceltFetched <= 0) - { - Console.WriteLine(String.Format("[{0}]", string.Join(",", instances.ToArray()))); - return; - } - - try - { - instances.Add(InstanceJson(rgelt[0])); - } - catch (COMException) - { - // Ignore instances that can't be queried. - } - } - } - - private static string JsonString(string s) - { - return "\"" + s.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""; - } - - private static string InstanceJson(ISetupInstance2 setupInstance2) - { - // Visual Studio component directory: - // https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids - - StringBuilder json = new StringBuilder(); - json.Append("{"); - - string path = JsonString(setupInstance2.GetInstallationPath()); - json.Append(String.Format("\"path\":{0},", path)); - - string version = JsonString(setupInstance2.GetInstallationVersion()); - json.Append(String.Format("\"version\":{0},", version)); - - List packages = new List(); - foreach (ISetupPackageReference package in setupInstance2.GetPackages()) - { - string id = JsonString(package.GetId()); - packages.Add(id); - } - json.Append(String.Format("\"packages\":[{0}]", string.Join(",", packages.ToArray()))); - - json.Append("}"); - return json.ToString(); - } - } -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/build.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/build.js deleted file mode 100644 index ea1f90652..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/build.js +++ /dev/null @@ -1,213 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const glob = require('glob') -const log = require('npmlog') -const which = require('which') -const win = process.platform === 'win32' - -function build (gyp, argv, callback) { - var platformMake = 'make' - if (process.platform === 'aix') { - platformMake = 'gmake' - } else if (process.platform === 'os400') { - platformMake = 'gmake' - } else if (process.platform.indexOf('bsd') !== -1) { - platformMake = 'gmake' - } else if (win && argv.length > 0) { - argv = argv.map(function (target) { - return '/t:' + target - }) - } - - var makeCommand = gyp.opts.make || process.env.MAKE || platformMake - var command = win ? 'msbuild' : makeCommand - var jobs = gyp.opts.jobs || process.env.JOBS - var buildType - var config - var arch - var nodeDir - var guessedSolution - - loadConfigGypi() - - /** - * Load the "config.gypi" file that was generated during "configure". - */ - - function loadConfigGypi () { - var configPath = path.resolve('build', 'config.gypi') - - fs.readFile(configPath, 'utf8', function (err, data) { - if (err) { - if (err.code === 'ENOENT') { - callback(new Error('You must run `node-gyp configure` first!')) - } else { - callback(err) - } - return - } - config = JSON.parse(data.replace(/#.+\n/, '')) - - // get the 'arch', 'buildType', and 'nodeDir' vars from the config - buildType = config.target_defaults.default_configuration - arch = config.variables.target_arch - nodeDir = config.variables.nodedir - - if ('debug' in gyp.opts) { - buildType = gyp.opts.debug ? 'Debug' : 'Release' - } - if (!buildType) { - buildType = 'Release' - } - - log.verbose('build type', buildType) - log.verbose('architecture', arch) - log.verbose('node dev dir', nodeDir) - - if (win) { - findSolutionFile() - } else { - doWhich() - } - }) - } - - /** - * On Windows, find the first build/*.sln file. - */ - - function findSolutionFile () { - glob('build/*.sln', function (err, files) { - if (err) { - return callback(err) - } - if (files.length === 0) { - return callback(new Error('Could not find *.sln file. Did you run "configure"?')) - } - guessedSolution = files[0] - log.verbose('found first Solution file', guessedSolution) - doWhich() - }) - } - - /** - * Uses node-which to locate the msbuild / make executable. - */ - - function doWhich () { - // On Windows use msbuild provided by node-gyp configure - if (win) { - if (!config.variables.msbuild_path) { - return callback(new Error( - 'MSBuild is not set, please run `node-gyp configure`.')) - } - command = config.variables.msbuild_path - log.verbose('using MSBuild:', command) - doBuild() - return - } - // First make sure we have the build command in the PATH - which(command, function (err, execPath) { - if (err) { - // Some other error or 'make' not found on Unix, report that to the user - callback(err) - return - } - log.verbose('`which` succeeded for `' + command + '`', execPath) - doBuild() - }) - } - - /** - * Actually spawn the process and compile the module. - */ - - function doBuild () { - // Enable Verbose build - var verbose = log.levels[log.level] <= log.levels.verbose - var j - - if (!win && verbose) { - argv.push('V=1') - } - - if (win && !verbose) { - argv.push('/clp:Verbosity=minimal') - } - - if (win) { - // Turn off the Microsoft logo on Windows - argv.push('/nologo') - } - - // Specify the build type, Release by default - if (win) { - // Convert .gypi config target_arch to MSBuild /Platform - // Since there are many ways to state '32-bit Intel', default to it. - // N.B. msbuild's Condition string equality tests are case-insensitive. - var archLower = arch.toLowerCase() - var p = archLower === 'x64' ? 'x64' - : (archLower === 'arm' ? 'ARM' - : (archLower === 'arm64' ? 'ARM64' : 'Win32')) - argv.push('/p:Configuration=' + buildType + ';Platform=' + p) - if (jobs) { - j = parseInt(jobs, 10) - if (!isNaN(j) && j > 0) { - argv.push('/m:' + j) - } else if (jobs.toUpperCase() === 'MAX') { - argv.push('/m:' + require('os').cpus().length) - } - } - } else { - argv.push('BUILDTYPE=' + buildType) - // Invoke the Makefile in the 'build' dir. - argv.push('-C') - argv.push('build') - if (jobs) { - j = parseInt(jobs, 10) - if (!isNaN(j) && j > 0) { - argv.push('--jobs') - argv.push(j) - } else if (jobs.toUpperCase() === 'MAX') { - argv.push('--jobs') - argv.push(require('os').cpus().length) - } - } - } - - if (win) { - // did the user specify their own .sln file? - var hasSln = argv.some(function (arg) { - return path.extname(arg) === '.sln' - }) - if (!hasSln) { - argv.unshift(gyp.opts.solution || guessedSolution) - } - } - - if (!win) { - // Add build-time dependency symlinks (such as Python) to PATH - const buildBinsDir = path.resolve('build', 'node_gyp_bins') - process.env.PATH = `${buildBinsDir}:${process.env.PATH}` - log.verbose('bin symlinks', `adding symlinks (such as Python), at "${buildBinsDir}", to PATH`) - } - - var proc = gyp.spawn(command, argv) - proc.on('exit', onExit) - } - - function onExit (code, signal) { - if (code !== 0) { - return callback(new Error('`' + command + '` failed with exit code: ' + code)) - } - if (signal) { - return callback(new Error('`' + command + '` got signal: ' + signal)) - } - callback() - } -} - -module.exports = build -module.exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/clean.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/clean.js deleted file mode 100644 index dbfa4dbb9..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/clean.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' - -const rm = require('rimraf') -const log = require('npmlog') - -function clean (gyp, argv, callback) { - // Remove the 'build' dir - var buildDir = 'build' - - log.verbose('clean', 'removing "%s" directory', buildDir) - rm(buildDir, callback) -} - -module.exports = clean -module.exports.usage = 'Removes any generated build files and the "out" dir' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/configure.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/configure.js deleted file mode 100644 index 1ca3ade70..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/configure.js +++ /dev/null @@ -1,360 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const log = require('npmlog') -const os = require('os') -const processRelease = require('./process-release') -const win = process.platform === 'win32' -const findNodeDirectory = require('./find-node-directory') -const createConfigGypi = require('./create-config-gypi') -const msgFormat = require('util').format -var findPython = require('./find-python') -if (win) { - var findVisualStudio = require('./find-visualstudio') -} - -function configure (gyp, argv, callback) { - var python - var buildDir = path.resolve('build') - var buildBinsDir = path.join(buildDir, 'node_gyp_bins') - var configNames = ['config.gypi', 'common.gypi'] - var configs = [] - var nodeDir - var release = processRelease(argv, gyp, process.version, process.release) - - findPython(gyp.opts.python, function (err, found) { - if (err) { - callback(err) - } else { - python = found - getNodeDir() - } - }) - - function getNodeDir () { - // 'python' should be set by now - process.env.PYTHON = python - - if (gyp.opts.nodedir) { - // --nodedir was specified. use that for the dev files - nodeDir = gyp.opts.nodedir.replace(/^~/, os.homedir()) - - log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir) - createBuildDir() - } else { - // if no --nodedir specified, ensure node dependencies are installed - if ('v' + release.version !== process.version) { - // if --target was given, then determine a target version to compile for - log.verbose('get node dir', 'compiling against --target node version: %s', release.version) - } else { - // if no --target was specified then use the current host node version - log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) - } - - if (!release.semver) { - // could not parse the version string with semver - return callback(new Error('Invalid version number: ' + release.version)) - } - - // If the tarball option is set, always remove and reinstall the headers - // into devdir. Otherwise only install if they're not already there. - gyp.opts.ensure = !gyp.opts.tarball - - gyp.commands.install([release.version], function (err) { - if (err) { - return callback(err) - } - log.verbose('get node dir', 'target node version installed:', release.versionDir) - nodeDir = path.resolve(gyp.devDir, release.versionDir) - createBuildDir() - }) - } - } - - function createBuildDir () { - log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) - - const deepestBuildDirSubdirectory = win ? buildDir : buildBinsDir - fs.mkdir(deepestBuildDirSubdirectory, { recursive: true }, function (err, isNew) { - if (err) { - return callback(err) - } - log.verbose( - 'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No' - ) - if (win) { - findVisualStudio(release.semver, gyp.opts.msvs_version, - createConfigFile) - } else { - createPythonSymlink() - createConfigFile() - } - }) - } - - function createPythonSymlink () { - const symlinkDestination = path.join(buildBinsDir, 'python3') - - log.verbose('python symlink', `creating symlink to "${python}" at "${symlinkDestination}"`) - - fs.unlink(symlinkDestination, function (err) { - if (err && err.code !== 'ENOENT') { - log.verbose('python symlink', 'error when attempting to remove existing symlink') - log.verbose('python symlink', err.stack, 'errno: ' + err.errno) - } - fs.symlink(python, symlinkDestination, function (err) { - if (err) { - log.verbose('python symlink', 'error when attempting to create Python symlink') - log.verbose('python symlink', err.stack, 'errno: ' + err.errno) - } - }) - }) - } - - function createConfigFile (err, vsInfo) { - if (err) { - return callback(err) - } - if (process.platform === 'win32') { - process.env.GYP_MSVS_VERSION = Math.min(vsInfo.versionYear, 2015) - process.env.GYP_MSVS_OVERRIDE_PATH = vsInfo.path - } - createConfigGypi({ gyp, buildDir, nodeDir, vsInfo }).then(configPath => { - configs.push(configPath) - findConfigs() - }).catch(err => { - callback(err) - }) - } - - function findConfigs () { - var name = configNames.shift() - if (!name) { - return runGyp() - } - var fullPath = path.resolve(name) - - log.verbose(name, 'checking for gypi file: %s', fullPath) - fs.stat(fullPath, function (err) { - if (err) { - if (err.code === 'ENOENT') { - findConfigs() // check next gypi filename - } else { - callback(err) - } - } else { - log.verbose(name, 'found gypi file') - configs.push(fullPath) - findConfigs() - } - }) - } - - function runGyp (err) { - if (err) { - return callback(err) - } - - if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) { - if (win) { - log.verbose('gyp', 'gyp format was not specified; forcing "msvs"') - // force the 'make' target for non-Windows - argv.push('-f', 'msvs') - } else { - log.verbose('gyp', 'gyp format was not specified; forcing "make"') - // force the 'make' target for non-Windows - argv.push('-f', 'make') - } - } - - // include all the ".gypi" files that were found - configs.forEach(function (config) { - argv.push('-I', config) - }) - - // For AIX and z/OS we need to set up the path to the exports file - // which contains the symbols needed for linking. - var nodeExpFile - if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') { - var ext = process.platform === 'os390' ? 'x' : 'exp' - var nodeRootDir = findNodeDirectory() - var candidates - - if (process.platform === 'aix' || process.platform === 'os400') { - candidates = [ - 'include/node/node', - 'out/Release/node', - 'out/Debug/node', - 'node' - ].map(function (file) { - return file + '.' + ext - }) - } else { - candidates = [ - 'out/Release/lib.target/libnode', - 'out/Debug/lib.target/libnode', - 'out/Release/obj.target/libnode', - 'out/Debug/obj.target/libnode', - 'lib/libnode' - ].map(function (file) { - return file + '.' + ext - }) - } - - var logprefix = 'find exports file' - nodeExpFile = findAccessibleSync(logprefix, nodeRootDir, candidates) - if (nodeExpFile !== undefined) { - log.verbose(logprefix, 'Found exports file: %s', nodeExpFile) - } else { - var msg = msgFormat('Could not find node.%s file in %s', ext, nodeRootDir) - log.error(logprefix, 'Could not find exports file') - return callback(new Error(msg)) - } - } - - // For z/OS we need to set up the path to zoslib include directory, - // which contains headers included in v8config.h. - var zoslibIncDir - if (process.platform === 'os390') { - logprefix = "find zoslib's zos-base.h:" - let msg - var zoslibIncPath = process.env.ZOSLIB_INCLUDES - if (zoslibIncPath) { - zoslibIncPath = findAccessibleSync(logprefix, zoslibIncPath, ['zos-base.h']) - if (zoslibIncPath === undefined) { - msg = msgFormat('Could not find zos-base.h file in the directory set ' + - 'in ZOSLIB_INCLUDES environment variable: %s; set it ' + - 'to the correct path, or unset it to search %s', process.env.ZOSLIB_INCLUDES, nodeRootDir) - } - } else { - candidates = [ - 'include/node/zoslib/zos-base.h', - 'include/zoslib/zos-base.h', - 'zoslib/include/zos-base.h', - 'install/include/node/zoslib/zos-base.h' - ] - zoslibIncPath = findAccessibleSync(logprefix, nodeRootDir, candidates) - if (zoslibIncPath === undefined) { - msg = msgFormat('Could not find any of %s in directory %s; set ' + - 'environmant variable ZOSLIB_INCLUDES to the path ' + - 'that contains zos-base.h', candidates.toString(), nodeRootDir) - } - } - if (zoslibIncPath !== undefined) { - zoslibIncDir = path.dirname(zoslibIncPath) - log.verbose(logprefix, "Found zoslib's zos-base.h in: %s", zoslibIncDir) - } else if (release.version.split('.')[0] >= 16) { - // zoslib is only shipped in Node v16 and above. - log.error(logprefix, msg) - return callback(new Error(msg)) - } - } - - // this logic ported from the old `gyp_addon` python file - var gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') - var addonGypi = path.resolve(__dirname, '..', 'addon.gypi') - var commonGypi = path.resolve(nodeDir, 'include/node/common.gypi') - fs.stat(commonGypi, function (err) { - if (err) { - commonGypi = path.resolve(nodeDir, 'common.gypi') - } - - var outputDir = 'build' - if (win) { - // Windows expects an absolute path - outputDir = buildDir - } - var nodeGypDir = path.resolve(__dirname, '..') - - var nodeLibFile = path.join(nodeDir, - !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)', - release.name + '.lib') - - argv.push('-I', addonGypi) - argv.push('-I', commonGypi) - argv.push('-Dlibrary=shared_library') - argv.push('-Dvisibility=default') - argv.push('-Dnode_root_dir=' + nodeDir) - if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') { - argv.push('-Dnode_exp_file=' + nodeExpFile) - if (process.platform === 'os390' && zoslibIncDir) { - argv.push('-Dzoslib_include_dir=' + zoslibIncDir) - } - } - argv.push('-Dnode_gyp_dir=' + nodeGypDir) - - // Do this to keep Cygwin environments happy, else the unescaped '\' gets eaten up, - // resulting in bad paths, Ex c:parentFolderfolderanotherFolder instead of c:\parentFolder\folder\anotherFolder - if (win) { - nodeLibFile = nodeLibFile.replace(/\\/g, '\\\\') - } - argv.push('-Dnode_lib_file=' + nodeLibFile) - argv.push('-Dmodule_root_dir=' + process.cwd()) - argv.push('-Dnode_engine=' + - (gyp.opts.node_engine || process.jsEngine || 'v8')) - argv.push('--depth=.') - argv.push('--no-parallel') - - // tell gyp to write the Makefile/Solution files into output_dir - argv.push('--generator-output', outputDir) - - // tell make to write its output into the same dir - argv.push('-Goutput_dir=.') - - // enforce use of the "binding.gyp" file - argv.unshift('binding.gyp') - - // execute `gyp` from the current target nodedir - argv.unshift(gypScript) - - // make sure python uses files that came with this particular node package - var pypath = [path.join(__dirname, '..', 'gyp', 'pylib')] - if (process.env.PYTHONPATH) { - pypath.push(process.env.PYTHONPATH) - } - process.env.PYTHONPATH = pypath.join(win ? ';' : ':') - - var cp = gyp.spawn(python, argv) - cp.on('exit', onCpExit) - }) - } - - function onCpExit (code) { - if (code !== 0) { - callback(new Error('`gyp` failed with exit code: ' + code)) - } else { - // we're done - callback() - } - } -} - -/** - * Returns the first file or directory from an array of candidates that is - * readable by the current user, or undefined if none of the candidates are - * readable. - */ -function findAccessibleSync (logprefix, dir, candidates) { - for (var next = 0; next < candidates.length; next++) { - var candidate = path.resolve(dir, candidates[next]) - try { - var fd = fs.openSync(candidate, 'r') - } catch (e) { - // this candidate was not found or not readable, do nothing - log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) - continue - } - fs.closeSync(fd) - log.silly(logprefix, 'Found readable %s', candidate) - return candidate - } - - return undefined -} - -module.exports = configure -module.exports.test = { - findAccessibleSync: findAccessibleSync -} -module.exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/create-config-gypi.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/create-config-gypi.js deleted file mode 100644 index ced491150..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/create-config-gypi.js +++ /dev/null @@ -1,147 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const log = require('npmlog') -const path = require('path') - -function parseConfigGypi (config) { - // translated from tools/js2c.py of Node.js - // 1. string comments - config = config.replace(/#.*/g, '') - // 2. join multiline strings - config = config.replace(/'$\s+'/mg, '') - // 3. normalize string literals from ' into " - config = config.replace(/'/g, '"') - return JSON.parse(config) -} - -async function getBaseConfigGypi ({ gyp, nodeDir }) { - // try reading $nodeDir/include/node/config.gypi first when: - // 1. --dist-url or --nodedir is specified - // 2. and --force-process-config is not specified - const useCustomHeaders = gyp.opts.nodedir || gyp.opts.disturl || gyp.opts['dist-url'] - const shouldReadConfigGypi = useCustomHeaders && !gyp.opts['force-process-config'] - if (shouldReadConfigGypi && nodeDir) { - try { - const baseConfigGypiPath = path.resolve(nodeDir, 'include/node/config.gypi') - const baseConfigGypi = await fs.promises.readFile(baseConfigGypiPath) - return parseConfigGypi(baseConfigGypi.toString()) - } catch (err) { - log.warn('read config.gypi', err.message) - } - } - - // fallback to process.config if it is invalid - return JSON.parse(JSON.stringify(process.config)) -} - -async function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo }) { - const config = await getBaseConfigGypi({ gyp, nodeDir }) - if (!config.target_defaults) { - config.target_defaults = {} - } - if (!config.variables) { - config.variables = {} - } - - const defaults = config.target_defaults - const variables = config.variables - - // don't inherit the "defaults" from the base config.gypi. - // doing so could cause problems in cases where the `node` executable was - // compiled on a different machine (with different lib/include paths) than - // the machine where the addon is being built to - defaults.cflags = [] - defaults.defines = [] - defaults.include_dirs = [] - defaults.libraries = [] - - // set the default_configuration prop - if ('debug' in gyp.opts) { - defaults.default_configuration = gyp.opts.debug ? 'Debug' : 'Release' - } - - if (!defaults.default_configuration) { - defaults.default_configuration = 'Release' - } - - // set the target_arch variable - variables.target_arch = gyp.opts.arch || process.arch || 'ia32' - if (variables.target_arch === 'arm64') { - defaults.msvs_configuration_platform = 'ARM64' - defaults.xcode_configuration_platform = 'arm64' - } - - // set the node development directory - variables.nodedir = nodeDir - - // disable -T "thin" static archives by default - variables.standalone_static_library = gyp.opts.thin ? 0 : 1 - - if (process.platform === 'win32') { - defaults.msbuild_toolset = vsInfo.toolset - if (vsInfo.sdk) { - defaults.msvs_windows_target_platform_version = vsInfo.sdk - } - if (variables.target_arch === 'arm64') { - if (vsInfo.versionMajor > 15 || - (vsInfo.versionMajor === 15 && vsInfo.versionMajor >= 9)) { - defaults.msvs_enable_marmasm = 1 - } else { - log.warn('Compiling ARM64 assembly is only available in\n' + - 'Visual Studio 2017 version 15.9 and above') - } - } - variables.msbuild_path = vsInfo.msBuild - } - - // loop through the rest of the opts and add the unknown ones as variables. - // this allows for module-specific configure flags like: - // - // $ node-gyp configure --shared-libxml2 - Object.keys(gyp.opts).forEach(function (opt) { - if (opt === 'argv') { - return - } - if (opt in gyp.configDefs) { - return - } - variables[opt.replace(/-/g, '_')] = gyp.opts[opt] - }) - - return config -} - -async function createConfigGypi ({ gyp, buildDir, nodeDir, vsInfo }) { - const configFilename = 'config.gypi' - const configPath = path.resolve(buildDir, configFilename) - - log.verbose('build/' + configFilename, 'creating config file') - - const config = await getCurrentConfigGypi({ gyp, nodeDir, vsInfo }) - - // ensures that any boolean values in config.gypi get stringified - function boolsToString (k, v) { - if (typeof v === 'boolean') { - return String(v) - } - return v - } - - log.silly('build/' + configFilename, config) - - // now write out the config.gypi file to the build/ dir - const prefix = '# Do not edit. File was generated by node-gyp\'s "configure" step' - - const json = JSON.stringify(config, boolsToString, 2) - log.verbose('build/' + configFilename, 'writing out config file: %s', configPath) - await fs.promises.writeFile(configPath, [prefix, json, ''].join('\n')) - - return configPath -} - -module.exports = createConfigGypi -module.exports.test = { - parseConfigGypi: parseConfigGypi, - getCurrentConfigGypi: getCurrentConfigGypi -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-node-directory.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-node-directory.js deleted file mode 100644 index 0dd781a6c..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-node-directory.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict' - -const path = require('path') -const log = require('npmlog') - -function findNodeDirectory (scriptLocation, processObj) { - // set dirname and process if not passed in - // this facilitates regression tests - if (scriptLocation === undefined) { - scriptLocation = __dirname - } - if (processObj === undefined) { - processObj = process - } - - // Have a look to see what is above us, to try and work out where we are - var npmParentDirectory = path.join(scriptLocation, '../../../..') - log.verbose('node-gyp root', 'npm_parent_directory is ' + - path.basename(npmParentDirectory)) - var nodeRootDir = '' - - log.verbose('node-gyp root', 'Finding node root directory') - if (path.basename(npmParentDirectory) === 'deps') { - // We are in a build directory where this script lives in - // deps/npm/node_modules/node-gyp/lib - nodeRootDir = path.join(npmParentDirectory, '..') - log.verbose('node-gyp root', 'in build directory, root = ' + - nodeRootDir) - } else if (path.basename(npmParentDirectory) === 'node_modules') { - // We are in a node install directory where this script lives in - // lib/node_modules/npm/node_modules/node-gyp/lib or - // node_modules/npm/node_modules/node-gyp/lib depending on the - // platform - if (processObj.platform === 'win32') { - nodeRootDir = path.join(npmParentDirectory, '..') - } else { - nodeRootDir = path.join(npmParentDirectory, '../..') - } - log.verbose('node-gyp root', 'in install directory, root = ' + - nodeRootDir) - } else { - // We don't know where we are, try working it out from the location - // of the node binary - var nodeDir = path.dirname(processObj.execPath) - var directoryUp = path.basename(nodeDir) - if (directoryUp === 'bin') { - nodeRootDir = path.join(nodeDir, '..') - } else if (directoryUp === 'Release' || directoryUp === 'Debug') { - // If we are a recently built node, and the directory structure - // is that of a repository. If we are on Windows then we only need - // to go one level up, everything else, two - if (processObj.platform === 'win32') { - nodeRootDir = path.join(nodeDir, '..') - } else { - nodeRootDir = path.join(nodeDir, '../..') - } - } - // Else return the default blank, "". - } - return nodeRootDir -} - -module.exports = findNodeDirectory diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-python.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-python.js deleted file mode 100644 index a445e825b..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-python.js +++ /dev/null @@ -1,344 +0,0 @@ -'use strict' - -const log = require('npmlog') -const semver = require('semver') -const cp = require('child_process') -const extend = require('util')._extend // eslint-disable-line -const win = process.platform === 'win32' -const logWithPrefix = require('./util').logWithPrefix - -const systemDrive = process.env.SystemDrive || 'C:' -const username = process.env.USERNAME || process.env.USER || getOsUserInfo() -const localAppData = process.env.LOCALAPPDATA || `${systemDrive}\\${username}\\AppData\\Local` -const foundLocalAppData = process.env.LOCALAPPDATA || username -const programFiles = process.env.ProgramW6432 || process.env.ProgramFiles || `${systemDrive}\\Program Files` -const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)` - -const winDefaultLocationsArray = [] -for (const majorMinor of ['39', '38', '37', '36']) { - if (foundLocalAppData) { - winDefaultLocationsArray.push( - `${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`, - `${programFiles}\\Python${majorMinor}\\python.exe`, - `${localAppData}\\Programs\\Python\\Python${majorMinor}-32\\python.exe`, - `${programFiles}\\Python${majorMinor}-32\\python.exe`, - `${programFilesX86}\\Python${majorMinor}-32\\python.exe` - ) - } else { - winDefaultLocationsArray.push( - `${programFiles}\\Python${majorMinor}\\python.exe`, - `${programFiles}\\Python${majorMinor}-32\\python.exe`, - `${programFilesX86}\\Python${majorMinor}-32\\python.exe` - ) - } -} - -function getOsUserInfo () { - try { - return require('os').userInfo().username - } catch (e) {} -} - -function PythonFinder (configPython, callback) { - this.callback = callback - this.configPython = configPython - this.errorLog = [] -} - -PythonFinder.prototype = { - log: logWithPrefix(log, 'find Python'), - argsExecutable: ['-c', 'import sys; print(sys.executable);'], - argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'], - semverRange: '>=3.6.0', - - // These can be overridden for testing: - execFile: cp.execFile, - env: process.env, - win: win, - pyLauncher: 'py.exe', - winDefaultLocations: winDefaultLocationsArray, - - // Logs a message at verbose level, but also saves it to be displayed later - // at error level if an error occurs. This should help diagnose the problem. - addLog: function addLog (message) { - this.log.verbose(message) - this.errorLog.push(message) - }, - - // Find Python by trying a sequence of possibilities. - // Ignore errors, keep trying until Python is found. - findPython: function findPython () { - const SKIP = 0; const FAIL = 1 - var toCheck = getChecks.apply(this) - - function getChecks () { - if (this.env.NODE_GYP_FORCE_PYTHON) { - return [{ - before: () => { - this.addLog( - 'checking Python explicitly set from NODE_GYP_FORCE_PYTHON') - this.addLog('- process.env.NODE_GYP_FORCE_PYTHON is ' + - `"${this.env.NODE_GYP_FORCE_PYTHON}"`) - }, - check: this.checkCommand, - arg: this.env.NODE_GYP_FORCE_PYTHON - }] - } - - var checks = [ - { - before: () => { - if (!this.configPython) { - this.addLog( - 'Python is not set from command line or npm configuration') - return SKIP - } - this.addLog('checking Python explicitly set from command line or ' + - 'npm configuration') - this.addLog('- "--python=" or "npm config get python" is ' + - `"${this.configPython}"`) - }, - check: this.checkCommand, - arg: this.configPython - }, - { - before: () => { - if (!this.env.PYTHON) { - this.addLog('Python is not set from environment variable ' + - 'PYTHON') - return SKIP - } - this.addLog('checking Python explicitly set from environment ' + - 'variable PYTHON') - this.addLog(`- process.env.PYTHON is "${this.env.PYTHON}"`) - }, - check: this.checkCommand, - arg: this.env.PYTHON - }, - { - before: () => { this.addLog('checking if "python3" can be used') }, - check: this.checkCommand, - arg: 'python3' - }, - { - before: () => { this.addLog('checking if "python" can be used') }, - check: this.checkCommand, - arg: 'python' - } - ] - - if (this.win) { - for (var i = 0; i < this.winDefaultLocations.length; ++i) { - const location = this.winDefaultLocations[i] - checks.push({ - before: () => { - this.addLog('checking if Python is ' + - `${location}`) - }, - check: this.checkExecPath, - arg: location - }) - } - checks.push({ - before: () => { - this.addLog( - 'checking if the py launcher can be used to find Python 3') - }, - check: this.checkPyLauncher - }) - } - - return checks - } - - function runChecks (err) { - this.log.silly('runChecks: err = %j', (err && err.stack) || err) - - const check = toCheck.shift() - if (!check) { - return this.fail() - } - - const before = check.before.apply(this) - if (before === SKIP) { - return runChecks.apply(this) - } - if (before === FAIL) { - return this.fail() - } - - const args = [runChecks.bind(this)] - if (check.arg) { - args.unshift(check.arg) - } - check.check.apply(this, args) - } - - runChecks.apply(this) - }, - - // Check if command is a valid Python to use. - // Will exit the Python finder on success. - // If on Windows, run in a CMD shell to support BAT/CMD launchers. - checkCommand: function checkCommand (command, errorCallback) { - var exec = command - var args = this.argsExecutable - var shell = false - if (this.win) { - // Arguments have to be manually quoted - exec = `"${exec}"` - args = args.map(a => `"${a}"`) - shell = true - } - - this.log.verbose(`- executing "${command}" to get executable path`) - this.run(exec, args, shell, function (err, execPath) { - // Possible outcomes: - // - Error: not in PATH, not executable or execution fails - // - Gibberish: the next command to check version will fail - // - Absolute path to executable - if (err) { - this.addLog(`- "${command}" is not in PATH or produced an error`) - return errorCallback(err) - } - this.addLog(`- executable path is "${execPath}"`) - this.checkExecPath(execPath, errorCallback) - }.bind(this)) - }, - - // Check if the py launcher can find a valid Python to use. - // Will exit the Python finder on success. - // Distributions of Python on Windows by default install with the "py.exe" - // Python launcher which is more likely to exist than the Python executable - // being in the $PATH. - // Because the Python launcher supports Python 2 and Python 3, we should - // explicitly request a Python 3 version. This is done by supplying "-3" as - // the first command line argument. Since "py.exe -3" would be an invalid - // executable for "execFile", we have to use the launcher to figure out - // where the actual "python.exe" executable is located. - checkPyLauncher: function checkPyLauncher (errorCallback) { - this.log.verbose( - `- executing "${this.pyLauncher}" to get Python 3 executable path`) - this.run(this.pyLauncher, ['-3', ...this.argsExecutable], false, - function (err, execPath) { - // Possible outcomes: same as checkCommand - if (err) { - this.addLog( - `- "${this.pyLauncher}" is not in PATH or produced an error`) - return errorCallback(err) - } - this.addLog(`- executable path is "${execPath}"`) - this.checkExecPath(execPath, errorCallback) - }.bind(this)) - }, - - // Check if a Python executable is the correct version to use. - // Will exit the Python finder on success. - checkExecPath: function checkExecPath (execPath, errorCallback) { - this.log.verbose(`- executing "${execPath}" to get version`) - this.run(execPath, this.argsVersion, false, function (err, version) { - // Possible outcomes: - // - Error: executable can not be run (likely meaning the command wasn't - // a Python executable and the previous command produced gibberish) - // - Gibberish: somehow the last command produced an executable path, - // this will fail when verifying the version - // - Version of the Python executable - if (err) { - this.addLog(`- "${execPath}" could not be run`) - return errorCallback(err) - } - this.addLog(`- version is "${version}"`) - - const range = new semver.Range(this.semverRange) - var valid = false - try { - valid = range.test(version) - } catch (err) { - this.log.silly('range.test() threw:\n%s', err.stack) - this.addLog(`- "${execPath}" does not have a valid version`) - this.addLog('- is it a Python executable?') - return errorCallback(err) - } - - if (!valid) { - this.addLog(`- version is ${version} - should be ${this.semverRange}`) - this.addLog('- THIS VERSION OF PYTHON IS NOT SUPPORTED') - return errorCallback(new Error( - `Found unsupported Python version ${version}`)) - } - this.succeed(execPath, version) - }.bind(this)) - }, - - // Run an executable or shell command, trimming the output. - run: function run (exec, args, shell, callback) { - var env = extend({}, this.env) - env.TERM = 'dumb' - const opts = { env: env, shell: shell } - - this.log.silly('execFile: exec = %j', exec) - this.log.silly('execFile: args = %j', args) - this.log.silly('execFile: opts = %j', opts) - try { - this.execFile(exec, args, opts, execFileCallback.bind(this)) - } catch (err) { - this.log.silly('execFile: threw:\n%s', err.stack) - return callback(err) - } - - function execFileCallback (err, stdout, stderr) { - this.log.silly('execFile result: err = %j', (err && err.stack) || err) - this.log.silly('execFile result: stdout = %j', stdout) - this.log.silly('execFile result: stderr = %j', stderr) - if (err) { - return callback(err) - } - const execPath = stdout.trim() - callback(null, execPath) - } - }, - - succeed: function succeed (execPath, version) { - this.log.info(`using Python version ${version} found at "${execPath}"`) - process.nextTick(this.callback.bind(null, null, execPath)) - }, - - fail: function fail () { - const errorLog = this.errorLog.join('\n') - - const pathExample = this.win ? 'C:\\Path\\To\\python.exe' - : '/path/to/pythonexecutable' - // For Windows 80 col console, use up to the column before the one marked - // with X (total 79 chars including logger prefix, 58 chars usable here): - // X - const info = [ - '**********************************************************', - 'You need to install the latest version of Python.', - 'Node-gyp should be able to find and use Python. If not,', - 'you can try one of the following options:', - `- Use the switch --python="${pathExample}"`, - ' (accepted by both node-gyp and npm)', - '- Set the environment variable PYTHON', - '- Set the npm configuration variable python:', - ` npm config set python "${pathExample}"`, - 'For more information consult the documentation at:', - 'https://github.com/nodejs/node-gyp#installation', - '**********************************************************' - ].join('\n') - - this.log.error(`\n${errorLog}\n\n${info}\n`) - process.nextTick(this.callback.bind(null, new Error( - 'Could not find any Python installation to use'))) - } -} - -function findPython (configPython, callback) { - var finder = new PythonFinder(configPython, callback) - finder.findPython() -} - -module.exports = findPython -module.exports.test = { - PythonFinder: PythonFinder, - findPython: findPython -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-visualstudio.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-visualstudio.js deleted file mode 100644 index d3815112e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/find-visualstudio.js +++ /dev/null @@ -1,452 +0,0 @@ -'use strict' - -const log = require('npmlog') -const execFile = require('child_process').execFile -const fs = require('fs') -const path = require('path').win32 -const logWithPrefix = require('./util').logWithPrefix -const regSearchKeys = require('./util').regSearchKeys - -function findVisualStudio (nodeSemver, configMsvsVersion, callback) { - const finder = new VisualStudioFinder(nodeSemver, configMsvsVersion, - callback) - finder.findVisualStudio() -} - -function VisualStudioFinder (nodeSemver, configMsvsVersion, callback) { - this.nodeSemver = nodeSemver - this.configMsvsVersion = configMsvsVersion - this.callback = callback - this.errorLog = [] - this.validVersions = [] -} - -VisualStudioFinder.prototype = { - log: logWithPrefix(log, 'find VS'), - - regSearchKeys: regSearchKeys, - - // Logs a message at verbose level, but also saves it to be displayed later - // at error level if an error occurs. This should help diagnose the problem. - addLog: function addLog (message) { - this.log.verbose(message) - this.errorLog.push(message) - }, - - findVisualStudio: function findVisualStudio () { - this.configVersionYear = null - this.configPath = null - if (this.configMsvsVersion) { - this.addLog('msvs_version was set from command line or npm config') - if (this.configMsvsVersion.match(/^\d{4}$/)) { - this.configVersionYear = parseInt(this.configMsvsVersion, 10) - this.addLog( - `- looking for Visual Studio version ${this.configVersionYear}`) - } else { - this.configPath = path.resolve(this.configMsvsVersion) - this.addLog( - `- looking for Visual Studio installed in "${this.configPath}"`) - } - } else { - this.addLog('msvs_version not set from command line or npm config') - } - - if (process.env.VCINSTALLDIR) { - this.envVcInstallDir = - path.resolve(process.env.VCINSTALLDIR, '..') - this.addLog('running in VS Command Prompt, installation path is:\n' + - `"${this.envVcInstallDir}"\n- will only use this version`) - } else { - this.addLog('VCINSTALLDIR not set, not running in VS Command Prompt') - } - - this.findVisualStudio2017OrNewer((info) => { - if (info) { - return this.succeed(info) - } - this.findVisualStudio2015((info) => { - if (info) { - return this.succeed(info) - } - this.findVisualStudio2013((info) => { - if (info) { - return this.succeed(info) - } - this.fail() - }) - }) - }) - }, - - succeed: function succeed (info) { - this.log.info(`using VS${info.versionYear} (${info.version}) found at:` + - `\n"${info.path}"` + - '\nrun with --verbose for detailed information') - process.nextTick(this.callback.bind(null, null, info)) - }, - - fail: function fail () { - if (this.configMsvsVersion && this.envVcInstallDir) { - this.errorLog.push( - 'msvs_version does not match this VS Command Prompt or the', - 'installation cannot be used.') - } else if (this.configMsvsVersion) { - // If msvs_version was specified but finding VS failed, print what would - // have been accepted - this.errorLog.push('') - if (this.validVersions) { - this.errorLog.push('valid versions for msvs_version:') - this.validVersions.forEach((version) => { - this.errorLog.push(`- "${version}"`) - }) - } else { - this.errorLog.push('no valid versions for msvs_version were found') - } - } - - const errorLog = this.errorLog.join('\n') - - // For Windows 80 col console, use up to the column before the one marked - // with X (total 79 chars including logger prefix, 62 chars usable here): - // X - const infoLog = [ - '**************************************************************', - 'You need to install the latest version of Visual Studio', - 'including the "Desktop development with C++" workload.', - 'For more information consult the documentation at:', - 'https://github.com/nodejs/node-gyp#on-windows', - '**************************************************************' - ].join('\n') - - this.log.error(`\n${errorLog}\n\n${infoLog}\n`) - process.nextTick(this.callback.bind(null, new Error( - 'Could not find any Visual Studio installation to use'))) - }, - - // Invoke the PowerShell script to get information about Visual Studio 2017 - // or newer installations - findVisualStudio2017OrNewer: function findVisualStudio2017OrNewer (cb) { - var ps = path.join(process.env.SystemRoot, 'System32', - 'WindowsPowerShell', 'v1.0', 'powershell.exe') - var csFile = path.join(__dirname, 'Find-VisualStudio.cs') - var psArgs = [ - '-ExecutionPolicy', - 'Unrestricted', - '-NoProfile', - '-Command', - '&{Add-Type -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}' - ] - - this.log.silly('Running', ps, psArgs) - var child = execFile(ps, psArgs, { encoding: 'utf8' }, - (err, stdout, stderr) => { - this.parseData(err, stdout, stderr, cb) - }) - child.stdin.end() - }, - - // Parse the output of the PowerShell script and look for an installation - // of Visual Studio 2017 or newer to use - parseData: function parseData (err, stdout, stderr, cb) { - this.log.silly('PS stderr = %j', stderr) - - const failPowershell = () => { - this.addLog( - 'could not use PowerShell to find Visual Studio 2017 or newer, try re-running with \'--loglevel silly\' for more details') - cb(null) - } - - if (err) { - this.log.silly('PS err = %j', err && (err.stack || err)) - return failPowershell() - } - - var vsInfo - try { - vsInfo = JSON.parse(stdout) - } catch (e) { - this.log.silly('PS stdout = %j', stdout) - this.log.silly(e) - return failPowershell() - } - - if (!Array.isArray(vsInfo)) { - this.log.silly('PS stdout = %j', stdout) - return failPowershell() - } - - vsInfo = vsInfo.map((info) => { - this.log.silly(`processing installation: "${info.path}"`) - info.path = path.resolve(info.path) - var ret = this.getVersionInfo(info) - ret.path = info.path - ret.msBuild = this.getMSBuild(info, ret.versionYear) - ret.toolset = this.getToolset(info, ret.versionYear) - ret.sdk = this.getSDK(info) - return ret - }) - this.log.silly('vsInfo:', vsInfo) - - // Remove future versions or errors parsing version number - vsInfo = vsInfo.filter((info) => { - if (info.versionYear) { - return true - } - this.addLog(`unknown version "${info.version}" found at "${info.path}"`) - return false - }) - - // Sort to place newer versions first - vsInfo.sort((a, b) => b.versionYear - a.versionYear) - - for (var i = 0; i < vsInfo.length; ++i) { - const info = vsInfo[i] - this.addLog(`checking VS${info.versionYear} (${info.version}) found ` + - `at:\n"${info.path}"`) - - if (info.msBuild) { - this.addLog('- found "Visual Studio C++ core features"') - } else { - this.addLog('- "Visual Studio C++ core features" missing') - continue - } - - if (info.toolset) { - this.addLog(`- found VC++ toolset: ${info.toolset}`) - } else { - this.addLog('- missing any VC++ toolset') - continue - } - - if (info.sdk) { - this.addLog(`- found Windows SDK: ${info.sdk}`) - } else { - this.addLog('- missing any Windows SDK') - continue - } - - if (!this.checkConfigVersion(info.versionYear, info.path)) { - continue - } - - return cb(info) - } - - this.addLog( - 'could not find a version of Visual Studio 2017 or newer to use') - cb(null) - }, - - // Helper - process version information - getVersionInfo: function getVersionInfo (info) { - const match = /^(\d+)\.(\d+)\..*/.exec(info.version) - if (!match) { - this.log.silly('- failed to parse version:', info.version) - return {} - } - this.log.silly('- version match = %j', match) - var ret = { - version: info.version, - versionMajor: parseInt(match[1], 10), - versionMinor: parseInt(match[2], 10) - } - if (ret.versionMajor === 15) { - ret.versionYear = 2017 - return ret - } - if (ret.versionMajor === 16) { - ret.versionYear = 2019 - return ret - } - if (ret.versionMajor === 17) { - ret.versionYear = 2022 - return ret - } - this.log.silly('- unsupported version:', ret.versionMajor) - return {} - }, - - // Helper - process MSBuild information - getMSBuild: function getMSBuild (info, versionYear) { - const pkg = 'Microsoft.VisualStudio.VC.MSBuild.Base' - const msbuildPath = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe') - if (info.packages.indexOf(pkg) !== -1) { - this.log.silly('- found VC.MSBuild.Base') - if (versionYear === 2017) { - return path.join(info.path, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe') - } - if (versionYear === 2019) { - return msbuildPath - } - } - // visual studio 2022 don't has msbuild pkg - if (fs.existsSync(msbuildPath)) { - return msbuildPath - } - return null - }, - - // Helper - process toolset information - getToolset: function getToolset (info, versionYear) { - const pkg = 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' - const express = 'Microsoft.VisualStudio.WDExpress' - - if (info.packages.indexOf(pkg) !== -1) { - this.log.silly('- found VC.Tools.x86.x64') - } else if (info.packages.indexOf(express) !== -1) { - this.log.silly('- found Visual Studio Express (looking for toolset)') - } else { - return null - } - - if (versionYear === 2017) { - return 'v141' - } else if (versionYear === 2019) { - return 'v142' - } else if (versionYear === 2022) { - return 'v143' - } - this.log.silly('- invalid versionYear:', versionYear) - return null - }, - - // Helper - process Windows SDK information - getSDK: function getSDK (info) { - const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK' - const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.' - const win11SDKPrefix = 'Microsoft.VisualStudio.Component.Windows11SDK.' - - var Win10or11SDKVer = 0 - info.packages.forEach((pkg) => { - if (!pkg.startsWith(win10SDKPrefix) && !pkg.startsWith(win11SDKPrefix)) { - return - } - const parts = pkg.split('.') - if (parts.length > 5 && parts[5] !== 'Desktop') { - this.log.silly('- ignoring non-Desktop Win10/11SDK:', pkg) - return - } - const foundSdkVer = parseInt(parts[4], 10) - if (isNaN(foundSdkVer)) { - // Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb - this.log.silly('- failed to parse Win10/11SDK number:', pkg) - return - } - this.log.silly('- found Win10/11SDK:', foundSdkVer) - Win10or11SDKVer = Math.max(Win10or11SDKVer, foundSdkVer) - }) - - if (Win10or11SDKVer !== 0) { - return `10.0.${Win10or11SDKVer}.0` - } else if (info.packages.indexOf(win8SDK) !== -1) { - this.log.silly('- found Win8SDK') - return '8.1' - } - return null - }, - - // Find an installation of Visual Studio 2015 to use - findVisualStudio2015: function findVisualStudio2015 (cb) { - if (this.nodeSemver.major >= 19) { - this.addLog( - 'not looking for VS2015 as it is only supported up to Node.js 18') - return cb(null) - } - return this.findOldVS({ - version: '14.0', - versionMajor: 14, - versionMinor: 0, - versionYear: 2015, - toolset: 'v140' - }, cb) - }, - - // Find an installation of Visual Studio 2013 to use - findVisualStudio2013: function findVisualStudio2013 (cb) { - if (this.nodeSemver.major >= 9) { - this.addLog( - 'not looking for VS2013 as it is only supported up to Node.js 8') - return cb(null) - } - return this.findOldVS({ - version: '12.0', - versionMajor: 12, - versionMinor: 0, - versionYear: 2013, - toolset: 'v120' - }, cb) - }, - - // Helper - common code for VS2013 and VS2015 - findOldVS: function findOldVS (info, cb) { - const regVC7 = ['HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7', - 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'] - const regMSBuild = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions' - - this.addLog(`looking for Visual Studio ${info.versionYear}`) - this.regSearchKeys(regVC7, info.version, [], (err, res) => { - if (err) { - this.addLog('- not found') - return cb(null) - } - - const vsPath = path.resolve(res, '..') - this.addLog(`- found in "${vsPath}"`) - - const msBuildRegOpts = process.arch === 'ia32' ? [] : ['/reg:32'] - this.regSearchKeys([`${regMSBuild}\\${info.version}`], - 'MSBuildToolsPath', msBuildRegOpts, (err, res) => { - if (err) { - this.addLog( - '- could not find MSBuild in registry for this version') - return cb(null) - } - - const msBuild = path.join(res, 'MSBuild.exe') - this.addLog(`- MSBuild in "${msBuild}"`) - - if (!this.checkConfigVersion(info.versionYear, vsPath)) { - return cb(null) - } - - info.path = vsPath - info.msBuild = msBuild - info.sdk = null - cb(info) - }) - }) - }, - - // After finding a usable version of Visual Studio: - // - add it to validVersions to be displayed at the end if a specific - // version was requested and not found; - // - check if this is the version that was requested. - // - check if this matches the Visual Studio Command Prompt - checkConfigVersion: function checkConfigVersion (versionYear, vsPath) { - this.validVersions.push(versionYear) - this.validVersions.push(vsPath) - - if (this.configVersionYear && this.configVersionYear !== versionYear) { - this.addLog('- msvs_version does not match this version') - return false - } - if (this.configPath && - path.relative(this.configPath, vsPath) !== '') { - this.addLog('- msvs_version does not point to this installation') - return false - } - if (this.envVcInstallDir && - path.relative(this.envVcInstallDir, vsPath) !== '') { - this.addLog('- does not match this Visual Studio Command Prompt') - return false - } - - return true - } -} - -module.exports = findVisualStudio -module.exports.test = { - VisualStudioFinder: VisualStudioFinder, - findVisualStudio: findVisualStudio -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/install.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/install.js deleted file mode 100644 index 99f6d8592..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/install.js +++ /dev/null @@ -1,376 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const os = require('os') -const tar = require('tar') -const path = require('path') -const util = require('util') -const stream = require('stream') -const crypto = require('crypto') -const log = require('npmlog') -const semver = require('semver') -const fetch = require('make-fetch-happen') -const processRelease = require('./process-release') -const win = process.platform === 'win32' -const streamPipeline = util.promisify(stream.pipeline) - -/** - * @param {typeof import('graceful-fs')} fs - */ - -async function install (fs, gyp, argv) { - const release = processRelease(argv, gyp, process.version, process.release) - - // Determine which node dev files version we are installing - log.verbose('install', 'input version string %j', release.version) - - if (!release.semver) { - // could not parse the version string with semver - throw new Error('Invalid version number: ' + release.version) - } - - if (semver.lt(release.version, '0.8.0')) { - throw new Error('Minimum target version is `0.8.0` or greater. Got: ' + release.version) - } - - // 0.x.y-pre versions are not published yet and cannot be installed. Bail. - if (release.semver.prerelease[0] === 'pre') { - log.verbose('detected "pre" node version', release.version) - if (!gyp.opts.nodedir) { - throw new Error('"pre" versions of node cannot be installed, use the --nodedir flag instead') - } - log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir) - return - } - - // flatten version into String - log.verbose('install', 'installing version: %s', release.versionDir) - - // the directory where the dev files will be installed - const devDir = path.resolve(gyp.devDir, release.versionDir) - - // If '--ensure' was passed, then don't *always* install the version; - // check if it is already installed, and only install when needed - if (gyp.opts.ensure) { - log.verbose('install', '--ensure was passed, so won\'t reinstall if already installed') - try { - await fs.promises.stat(devDir) - } catch (err) { - if (err.code === 'ENOENT') { - log.verbose('install', 'version not already installed, continuing with install', release.version) - try { - return await go() - } catch (err) { - return rollback(err) - } - } else if (err.code === 'EACCES') { - return eaccesFallback(err) - } - throw err - } - log.verbose('install', 'version is already installed, need to check "installVersion"') - const installVersionFile = path.resolve(devDir, 'installVersion') - let installVersion = 0 - try { - const ver = await fs.promises.readFile(installVersionFile, 'ascii') - installVersion = parseInt(ver, 10) || 0 - } catch (err) { - if (err.code !== 'ENOENT') { - throw err - } - } - log.verbose('got "installVersion"', installVersion) - log.verbose('needs "installVersion"', gyp.package.installVersion) - if (installVersion < gyp.package.installVersion) { - log.verbose('install', 'version is no good; reinstalling') - try { - return await go() - } catch (err) { - return rollback(err) - } - } - log.verbose('install', 'version is good') - } else { - try { - return await go() - } catch (err) { - return rollback(err) - } - } - - async function go () { - log.verbose('ensuring nodedir is created', devDir) - - // first create the dir for the node dev files - try { - const created = await fs.promises.mkdir(devDir, { recursive: true }) - - if (created) { - log.verbose('created nodedir', created) - } - } catch (err) { - if (err.code === 'EACCES') { - return eaccesFallback(err) - } - - throw err - } - - // now download the node tarball - const tarPath = gyp.opts.tarball - let extractCount = 0 - const contentShasums = {} - const expectShasums = {} - - // checks if a file to be extracted from the tarball is valid. - // only .h header files and the gyp files get extracted - function isValid (path) { - const isValid = valid(path) - if (isValid) { - log.verbose('extracted file from tarball', path) - extractCount++ - } else { - // invalid - log.silly('ignoring from tarball', path) - } - return isValid - } - - // download the tarball and extract! - - if (tarPath) { - await tar.extract({ - file: tarPath, - strip: 1, - filter: isValid, - cwd: devDir - }) - } else { - try { - const res = await download(gyp, release.tarballUrl) - - if (res.status !== 200) { - throw new Error(`${res.status} response downloading ${release.tarballUrl}`) - } - - await streamPipeline( - res.body, - // content checksum - new ShaSum((_, checksum) => { - const filename = path.basename(release.tarballUrl).trim() - contentShasums[filename] = checksum - log.verbose('content checksum', filename, checksum) - }), - tar.extract({ - strip: 1, - cwd: devDir, - filter: isValid - }) - ) - } catch (err) { - // something went wrong downloading the tarball? - if (err.code === 'ENOTFOUND') { - throw new Error('This is most likely not a problem with node-gyp or the package itself and\n' + - 'is related to network connectivity. In most cases you are behind a proxy or have bad \n' + - 'network settings.') - } - throw err - } - } - - // invoked after the tarball has finished being extracted - if (extractCount === 0) { - throw new Error('There was a fatal problem while downloading/extracting the tarball') - } - - log.verbose('tarball', 'done parsing tarball') - - const installVersionPath = path.resolve(devDir, 'installVersion') - await Promise.all([ - // need to download node.lib - ...(win ? downloadNodeLib() : []), - // write the "installVersion" file - fs.promises.writeFile(installVersionPath, gyp.package.installVersion + '\n'), - // Only download SHASUMS.txt if we downloaded something in need of SHA verification - ...(!tarPath || win ? [downloadShasums()] : []) - ]) - - log.verbose('download contents checksum', JSON.stringify(contentShasums)) - // check content shasums - for (const k in contentShasums) { - log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k]) - if (contentShasums[k] !== expectShasums[k]) { - throw new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k]) - } - } - - async function downloadShasums () { - log.verbose('check download content checksum, need to download `SHASUMS256.txt`...') - log.verbose('checksum url', release.shasumsUrl) - - const res = await download(gyp, release.shasumsUrl) - - if (res.status !== 200) { - throw new Error(`${res.status} status code downloading checksum`) - } - - for (const line of (await res.text()).trim().split('\n')) { - const items = line.trim().split(/\s+/) - if (items.length !== 2) { - return - } - - // 0035d18e2dcf9aad669b1c7c07319e17abfe3762 ./node-v0.11.4.tar.gz - const name = items[1].replace(/^\.\//, '') - expectShasums[name] = items[0] - } - - log.verbose('checksum data', JSON.stringify(expectShasums)) - } - - function downloadNodeLib () { - log.verbose('on Windows; need to download `' + release.name + '.lib`...') - const archs = ['ia32', 'x64', 'arm64'] - return archs.map(async (arch) => { - const dir = path.resolve(devDir, arch) - const targetLibPath = path.resolve(dir, release.name + '.lib') - const { libUrl, libPath } = release[arch] - const name = `${arch} ${release.name}.lib` - log.verbose(name, 'dir', dir) - log.verbose(name, 'url', libUrl) - - await fs.promises.mkdir(dir, { recursive: true }) - log.verbose('streaming', name, 'to:', targetLibPath) - - const res = await download(gyp, libUrl) - - if (res.status === 403 || res.status === 404) { - if (arch === 'arm64') { - // Arm64 is a newer platform on Windows and not all node distributions provide it. - log.verbose(`${name} was not found in ${libUrl}`) - } else { - log.warn(`${name} was not found in ${libUrl}`) - } - return - } else if (res.status !== 200) { - throw new Error(`${res.status} status code downloading ${name}`) - } - - return streamPipeline( - res.body, - new ShaSum((_, checksum) => { - contentShasums[libPath] = checksum - log.verbose('content checksum', libPath, checksum) - }), - fs.createWriteStream(targetLibPath) - ) - }) - } // downloadNodeLib() - } // go() - - /** - * Checks if a given filename is "valid" for this installation. - */ - - function valid (file) { - // header files - const extname = path.extname(file) - return extname === '.h' || extname === '.gypi' - } - - async function rollback (err) { - log.warn('install', 'got an error, rolling back install') - // roll-back the install if anything went wrong - await util.promisify(gyp.commands.remove)([release.versionDir]) - throw err - } - - /** - * The EACCES fallback is a workaround for npm's `sudo` behavior, where - * it drops the permissions before invoking any child processes (like - * node-gyp). So what happens is the "nobody" user doesn't have - * permission to create the dev dir. As a fallback, make the tmpdir() be - * the dev dir for this installation. This is not ideal, but at least - * the compilation will succeed... - */ - - async function eaccesFallback (err) { - const noretry = '--node_gyp_internal_noretry' - if (argv.indexOf(noretry) !== -1) { - throw err - } - const tmpdir = os.tmpdir() - gyp.devDir = path.resolve(tmpdir, '.node-gyp') - let userString = '' - try { - // os.userInfo can fail on some systems, it's not critical here - userString = ` ("${os.userInfo().username}")` - } catch (e) {} - log.warn('EACCES', 'current user%s does not have permission to access the dev dir "%s"', userString, devDir) - log.warn('EACCES', 'attempting to reinstall using temporary dev dir "%s"', gyp.devDir) - if (process.cwd() === tmpdir) { - log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') - gyp.todo.push({ name: 'remove', args: argv }) - } - return util.promisify(gyp.commands.install)([noretry].concat(argv)) - } -} - -class ShaSum extends stream.Transform { - constructor (callback) { - super() - this._callback = callback - this._digester = crypto.createHash('sha256') - } - - _transform (chunk, _, callback) { - this._digester.update(chunk) - callback(null, chunk) - } - - _flush (callback) { - this._callback(null, this._digester.digest('hex')) - callback() - } -} - -async function download (gyp, url) { - log.http('GET', url) - - const requestOpts = { - headers: { - 'User-Agent': `node-gyp v${gyp.version} (node ${process.version})`, - Connection: 'keep-alive' - }, - proxy: gyp.opts.proxy, - noProxy: gyp.opts.noproxy - } - - const cafile = gyp.opts.cafile - if (cafile) { - requestOpts.ca = await readCAFile(cafile) - } - - const res = await fetch(url, requestOpts) - log.http(res.status, res.url) - - return res -} - -async function readCAFile (filename) { - // The CA file can contain multiple certificates so split on certificate - // boundaries. [\S\s]*? is used to match everything including newlines. - const ca = await fs.promises.readFile(filename, 'utf8') - const re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g - return ca.match(re) -} - -module.exports = function (gyp, argv, callback) { - install(fs, gyp, argv).then(callback.bind(undefined, null), callback) -} -module.exports.test = { - download, - install, - readCAFile -} -module.exports.usage = 'Install node development files for the specified node version.' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/list.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/list.js deleted file mode 100644 index 405ebc0d8..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/list.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const log = require('npmlog') - -function list (gyp, args, callback) { - var devDir = gyp.devDir - log.verbose('list', 'using node-gyp dir:', devDir) - - fs.readdir(devDir, onreaddir) - - function onreaddir (err, versions) { - if (err && err.code !== 'ENOENT') { - return callback(err) - } - - if (Array.isArray(versions)) { - versions = versions.filter(function (v) { return v !== 'current' }) - } else { - versions = [] - } - callback(null, versions) - } -} - -module.exports = list -module.exports.usage = 'Prints a listing of the currently installed node development files' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/node-gyp.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/node-gyp.js deleted file mode 100644 index e492ec102..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/node-gyp.js +++ /dev/null @@ -1,215 +0,0 @@ -'use strict' - -const path = require('path') -const nopt = require('nopt') -const log = require('npmlog') -const childProcess = require('child_process') -const EE = require('events').EventEmitter -const inherits = require('util').inherits -const commands = [ - // Module build commands - 'build', - 'clean', - 'configure', - 'rebuild', - // Development Header File management commands - 'install', - 'list', - 'remove' -] -const aliases = { - ls: 'list', - rm: 'remove' -} - -// differentiate node-gyp's logs from npm's -log.heading = 'gyp' - -function gyp () { - return new Gyp() -} - -function Gyp () { - var self = this - - this.devDir = '' - this.commands = {} - - commands.forEach(function (command) { - self.commands[command] = function (argv, callback) { - log.verbose('command', command, argv) - return require('./' + command)(self, argv, callback) - } - }) -} -inherits(Gyp, EE) -exports.Gyp = Gyp -var proto = Gyp.prototype - -/** - * Export the contents of the package.json. - */ - -proto.package = require('../package.json') - -/** - * nopt configuration definitions - */ - -proto.configDefs = { - help: Boolean, // everywhere - arch: String, // 'configure' - cafile: String, // 'install' - debug: Boolean, // 'build' - directory: String, // bin - make: String, // 'build' - msvs_version: String, // 'configure' - ensure: Boolean, // 'install' - solution: String, // 'build' (windows only) - proxy: String, // 'install' - noproxy: String, // 'install' - devdir: String, // everywhere - nodedir: String, // 'configure' - loglevel: String, // everywhere - python: String, // 'configure' - 'dist-url': String, // 'install' - tarball: String, // 'install' - jobs: String, // 'build' - thin: String, // 'configure' - 'force-process-config': Boolean // 'configure' -} - -/** - * nopt shorthands - */ - -proto.shorthands = { - release: '--no-debug', - C: '--directory', - debug: '--debug', - j: '--jobs', - silly: '--loglevel=silly', - verbose: '--loglevel=verbose', - silent: '--loglevel=silent' -} - -/** - * expose the command aliases for the bin file to use. - */ - -proto.aliases = aliases - -/** - * Parses the given argv array and sets the 'opts', - * 'argv' and 'command' properties. - */ - -proto.parseArgv = function parseOpts (argv) { - this.opts = nopt(this.configDefs, this.shorthands, argv) - this.argv = this.opts.argv.remain.slice() - - var commands = this.todo = [] - - // create a copy of the argv array with aliases mapped - argv = this.argv.map(function (arg) { - // is this an alias? - if (arg in this.aliases) { - arg = this.aliases[arg] - } - return arg - }, this) - - // process the mapped args into "command" objects ("name" and "args" props) - argv.slice().forEach(function (arg) { - if (arg in this.commands) { - var args = argv.splice(0, argv.indexOf(arg)) - argv.shift() - if (commands.length > 0) { - commands[commands.length - 1].args = args - } - commands.push({ name: arg, args: [] }) - } - }, this) - if (commands.length > 0) { - commands[commands.length - 1].args = argv.splice(0) - } - - // support for inheriting config env variables from npm - var npmConfigPrefix = 'npm_config_' - Object.keys(process.env).forEach(function (name) { - if (name.indexOf(npmConfigPrefix) !== 0) { - return - } - var val = process.env[name] - if (name === npmConfigPrefix + 'loglevel') { - log.level = val - } else { - // add the user-defined options to the config - name = name.substring(npmConfigPrefix.length) - // gyp@741b7f1 enters an infinite loop when it encounters - // zero-length options so ensure those don't get through. - if (name) { - // convert names like force_process_config to force-process-config - if (name.includes('_')) { - name = name.replace(/_/g, '-') - } - this.opts[name] = val - } - } - }, this) - - if (this.opts.loglevel) { - log.level = this.opts.loglevel - } - log.resume() -} - -/** - * Spawns a child process and emits a 'spawn' event. - */ - -proto.spawn = function spawn (command, args, opts) { - if (!opts) { - opts = {} - } - if (!opts.silent && !opts.stdio) { - opts.stdio = [0, 1, 2] - } - var cp = childProcess.spawn(command, args, opts) - log.info('spawn', command) - log.info('spawn args', args) - return cp -} - -/** - * Returns the usage instructions for node-gyp. - */ - -proto.usage = function usage () { - var str = [ - '', - ' Usage: node-gyp [options]', - '', - ' where is one of:', - commands.map(function (c) { - return ' - ' + c + ' - ' + require('./' + c).usage - }).join('\n'), - '', - 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'), - 'node@' + process.versions.node - ].join('\n') - return str -} - -/** - * Version number getter. - */ - -Object.defineProperty(proto, 'version', { - get: function () { - return this.package.version - }, - enumerable: true -}) - -module.exports = exports = gyp diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/process-release.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/process-release.js deleted file mode 100644 index 95b55e442..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/process-release.js +++ /dev/null @@ -1,147 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ - -'use strict' - -const semver = require('semver') -const url = require('url') -const path = require('path') -const log = require('npmlog') - -// versions where -headers.tar.gz started shipping -const headersTarballRange = '>= 3.0.0 || ~0.12.10 || ~0.10.42' -const bitsre = /\/win-(x86|x64|arm64)\// -const bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should -// have been "x86" - -// Captures all the logic required to determine download URLs, local directory and -// file names. Inputs come from command-line switches (--target, --dist-url), -// `process.version` and `process.release` where it exists. -function processRelease (argv, gyp, defaultVersion, defaultRelease) { - var version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion - var versionSemver = semver.parse(version) - var overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl - var isDefaultVersion - var isNamedForLegacyIojs - var name - var distBaseUrl - var baseUrl - var libUrl32 - var libUrl64 - var libUrlArm64 - var tarballUrl - var canGetHeaders - - if (!versionSemver) { - // not a valid semver string, nothing we can do - return { version: version } - } - // flatten version into String - version = versionSemver.version - - // defaultVersion should come from process.version so ought to be valid semver - isDefaultVersion = version === semver.parse(defaultVersion).version - - // can't use process.release if we're using --target=x.y.z - if (!isDefaultVersion) { - defaultRelease = null - } - - if (defaultRelease) { - // v3 onward, has process.release - name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes - } else { - // old node or alternative --target= - // semver.satisfies() doesn't like prerelease tags so test major directly - isNamedForLegacyIojs = versionSemver.major >= 1 && versionSemver.major < 4 - // isNamedForLegacyIojs is required to support Electron < 4 (in particular Electron 3) - // as previously this logic was used to ensure "iojs" was used to download iojs releases - // and "node" for node releases. Unfortunately the logic was broad enough that electron@3 - // published release assets as "iojs" so that the node-gyp logic worked. Once Electron@3 has - // been EOL for a while (late 2019) we should remove this hack. - name = isNamedForLegacyIojs ? 'iojs' : 'node' - } - - // check for the nvm.sh standard mirror env variables - if (!overrideDistUrl && process.env.NODEJS_ORG_MIRROR) { - overrideDistUrl = process.env.NODEJS_ORG_MIRROR - } - - if (overrideDistUrl) { - log.verbose('download', 'using dist-url', overrideDistUrl) - } - - if (overrideDistUrl) { - distBaseUrl = overrideDistUrl.replace(/\/+$/, '') - } else { - distBaseUrl = 'https://nodejs.org/dist' - } - distBaseUrl += '/v' + version + '/' - - // new style, based on process.release so we have a lot of the data we need - if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) { - baseUrl = url.resolve(defaultRelease.headersUrl, './') - libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major) - libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major) - libUrlArm64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'arm64', versionSemver.major) - tarballUrl = defaultRelease.headersUrl - } else { - // older versions without process.release are captured here and we have to make - // a lot of assumptions, additionally if you --target=x.y.z then we can't use the - // current process.release - baseUrl = distBaseUrl - libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major) - libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major) - libUrlArm64 = resolveLibUrl(name, baseUrl, 'arm64', versionSemver.major) - - // making the bold assumption that anything with a version number >3.0.0 will - // have a *-headers.tar.gz file in its dist location, even some frankenstein - // custom version - canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) - tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz') - } - - return { - version: version, - semver: versionSemver, - name: name, - baseUrl: baseUrl, - tarballUrl: tarballUrl, - shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), - versionDir: (name !== 'node' ? name + '-' : '') + version, - ia32: { - libUrl: libUrl32, - libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)) - }, - x64: { - libUrl: libUrl64, - libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) - }, - arm64: { - libUrl: libUrlArm64, - libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrlArm64).path)) - } - } -} - -function normalizePath (p) { - return path.normalize(p).replace(/\\/g, '/') -} - -function resolveLibUrl (name, defaultUrl, arch, versionMajor) { - var base = url.resolve(defaultUrl, './') - var hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl)) - - if (!hasLibUrl) { - // let's assume it's a baseUrl then - if (versionMajor >= 1) { - return url.resolve(base, 'win-' + arch + '/' + name + '.lib') - } - // prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/ - return url.resolve(base, (arch === 'x86' ? '' : arch + '/') + name + '.lib') - } - - // else we have a proper url to a .lib, just make sure it's the right arch - return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/') -} - -module.exports = processRelease diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/rebuild.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/rebuild.js deleted file mode 100644 index a1c5b27cb..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/rebuild.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -function rebuild (gyp, argv, callback) { - gyp.todo.push( - { name: 'clean', args: [] } - , { name: 'configure', args: argv } - , { name: 'build', args: [] } - ) - process.nextTick(callback) -} - -module.exports = rebuild -module.exports.usage = 'Runs "clean", "configure" and "build" all at once' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/remove.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/remove.js deleted file mode 100644 index 8c945e565..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/remove.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' - -const fs = require('fs') -const rm = require('rimraf') -const path = require('path') -const log = require('npmlog') -const semver = require('semver') - -function remove (gyp, argv, callback) { - var devDir = gyp.devDir - log.verbose('remove', 'using node-gyp dir:', devDir) - - // get the user-specified version to remove - var version = argv[0] || gyp.opts.target - log.verbose('remove', 'removing target version:', version) - - if (!version) { - return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"')) - } - - var versionSemver = semver.parse(version) - if (versionSemver) { - // flatten the version Array into a String - version = versionSemver.version - } - - var versionPath = path.resolve(gyp.devDir, version) - log.verbose('remove', 'removing development files for version:', version) - - // first check if its even installed - fs.stat(versionPath, function (err) { - if (err) { - if (err.code === 'ENOENT') { - callback(null, 'version was already uninstalled: ' + version) - } else { - callback(err) - } - return - } - // Go ahead and delete the dir - rm(versionPath, callback) - }) -} - -module.exports = exports = remove -module.exports.usage = 'Removes the node development files for the specified version' diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/util.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/util.js deleted file mode 100644 index 3e23c628e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/util.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -const log = require('npmlog') -const execFile = require('child_process').execFile -const path = require('path') - -function logWithPrefix (log, prefix) { - function setPrefix (logFunction) { - return (...args) => logFunction.apply(null, [ prefix, ...args ]) // eslint-disable-line - } - return { - silly: setPrefix(log.silly), - verbose: setPrefix(log.verbose), - info: setPrefix(log.info), - warn: setPrefix(log.warn), - error: setPrefix(log.error) - } -} - -function regGetValue (key, value, addOpts, cb) { - const outReValue = value.replace(/\W/g, '.') - const outRe = new RegExp(`^\\s+${outReValue}\\s+REG_\\w+\\s+(\\S.*)$`, 'im') - const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe') - const regArgs = ['query', key, '/v', value].concat(addOpts) - - log.silly('reg', 'running', reg, regArgs) - const child = execFile(reg, regArgs, { encoding: 'utf8' }, - function (err, stdout, stderr) { - log.silly('reg', 'reg.exe stdout = %j', stdout) - if (err || stderr.trim() !== '') { - log.silly('reg', 'reg.exe err = %j', err && (err.stack || err)) - log.silly('reg', 'reg.exe stderr = %j', stderr) - return cb(err, stderr) - } - - const result = outRe.exec(stdout) - if (!result) { - log.silly('reg', 'error parsing stdout') - return cb(new Error('Could not parse output of reg.exe')) - } - log.silly('reg', 'found: %j', result[1]) - cb(null, result[1]) - }) - child.stdin.end() -} - -function regSearchKeys (keys, value, addOpts, cb) { - var i = 0 - const search = () => { - log.silly('reg-search', 'looking for %j in %j', value, keys[i]) - regGetValue(keys[i], value, addOpts, (err, res) => { - ++i - if (err && i < keys.length) { return search() } - cb(err, res) - }) - } - search() -} - -module.exports = { - logWithPrefix: logWithPrefix, - regGetValue: regGetValue, - regSearchKeys: regSearchKeys -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/macOS_Catalina.md b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/macOS_Catalina.md deleted file mode 100644 index dde5fe3f7..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/macOS_Catalina.md +++ /dev/null @@ -1,104 +0,0 @@ -# Installation notes for macOS Catalina (v10.15) - -_This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or when future Catalina versions no longer raise these issues._ - -**Both upgrading to macOS Catalina and running a Software Update in Catalina may cause normal `node-gyp` installations to fail. This might manifest as the following error during `npm install`:** - -```console -gyp: No Xcode or CLT version detected! -``` - -## node-gyp v7 - -The newest release of `node-gyp` should solve this problem. If you are using `node-gyp` directly then you should be able to install v7 and use it as-is. - -If you need to use `node-gyp` from within `npm` (e.g. through `npm install`), you will have to install `node-gyp` (either globally with `-g` or to a predictable location) and tell `npm` where the new version is. Either use: - -* `npm config set node_gyp `; or -* run `npm` with an environment variable prefix: `npm_config_node_gyp= npm install` - -Where "path to node-gyp" is to the `node-gyp` executable which may be a symlink in your global bin directory (e.g. `/usr/local/bin/node-gyp`), or a path to the `node-gyp` installation directory and the `bin/node-gyp.js` file within it (e.g. `/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js`). - -**If you use `npm config set` to change your global `node_gyp` you are responsible for keeping it up to date and can't rely on `npm` to give you a newer version when available.** Use `npm config delete node_gyp` to unset this configuration option. - -## Fixing Catalina for older versions of `node-gyp` - -### Is my Mac running macOS Catalina? -Let's first make sure that your Mac is running Catalina: -``` -% sw_vers - ProductName: Mac OS X - ProductVersion: 10.15 - BuildVersion: 19A602 -``` -If `ProductVersion` is less then `10.15` then this document is not for you. Normal install docs for `node-gyp` on macOS can be found at https://github.com/nodejs/node-gyp#on-macos - - -### The acid test -To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run: -``` -curl -sL https://github.com/nodejs/node-gyp/raw/main/macOS_Catalina_acid_test.sh | bash -``` - -If test succeeded, _you are done_! You should be ready to [install](https://github.com/nodejs/node-gyp#installation) `node-gyp`. - -If test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions). - -### Solutions -There are three ways to install the Xcode libraries `node-gyp` needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable. - -1. With the full Xcode (~7.6 GB download) from the `App Store` app. -2. With the _much_ smaller Xcode Command Line Tools via `xcode-select --install` -3. With the _much_ smaller Xcode Command Line Tools via manual download. **For people running the latest version of Catalina (10.15.2 at the time of this writing), this has worked when the other two solutions haven't.** - -### Installing `node-gyp` using the full Xcode -1. `xcodebuild -version` should show `Xcode 11.1` or later. - * If not, then install/upgrade Xcode from the App Store app. -2. Open the Xcode app and... - * Under __Preferences > Locations__ select the tools if their location is empty. - * Allow Xcode app to do an essential install of the most recent compiler tools. -3. Once all installations are _complete_, quit out of Xcode. -4. `sudo xcodebuild -license accept` # If you agree with the licensing terms. -5. `softwareupdate -l` # No listing is a good sign. - * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them. -6. `xcode-select -version` # Should return `xcode-select version 2370` or later. -7. `xcode-select -print-path` # Should return `/Applications/Xcode.app/Contents/Developer` -8. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. -9. If the _acid test_ does _not_ pass then... -10. `sudo xcode-select --reset` # Enter root password. No output is normal. -11. Repeat step 7 above. Is the path different this time? Repeat the _acid test_. - -### Installing `node-gyp` using the Xcode Command Line Tools via `xcode-select --install` -1. If the _acid test_ has not succeeded, then try `xcode-select --install` -2. If the installation command returns `xcode-select: error: command line tools are already installed, use "Software Update" to install updates`, continue to [remove and reinstall](#i-did-all-that-and-the-acid-test-still-does-not-pass--) -3. Wait until the install process is _complete_. -4. `softwareupdate -l` # No listing is a good sign. - * If Xcode or Tools upgrades are listed, use "Software Update" to install them. -5. `xcode-select -version` # Should return `xcode-select version 2370` or later. -6. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` -7. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. -8. If the _acid test_ does _not_ pass then... -9. `sudo xcode-select --reset` # Enter root password. No output is normal. -10. Repeat step 5 above. Is the path different this time? Repeat the _acid test_. - -### Installing `node-gyp` using the Xcode Command Line Tools via manual download -1. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from . As of MacOS 10.15.5, that's [Command_Line_Tools_for_Xcode_11.5.dmg](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11.5/Command_Line_Tools_for_Xcode_11.5.dmg) -2. Install the package. -3. Run the [_acid test_ steps above](#The-acid-test). - -### I did all that and the acid test still does not pass :-( -1. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal. -2. `sudo rm -rf /Library/Developer/CommandLineTools` # Enter root password. -3. `sudo xcode-select --reset` -4. `xcode-select --install` -5. If the [_acid test_ steps above](#The-acid-test) still does _not_ pass then... -6. `npm explore npm -g -- npm install node-gyp@latest` -7. `npm explore npm -g -- npm explore npm-lifecycle -- npm install node-gyp@latest` -8. If the _acid test_ still does _not_ pass then... -9. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. - -Lessons learned from: -* https://github.com/nodejs/node-gyp/issues/1779 -* https://github.com/nodejs/node-gyp/issues/1861 -* https://github.com/nodejs/node-gyp/issues/1927 and elsewhere -* Thanks to @rrrix for discovering Solution 3 diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/macOS_Catalina_acid_test.sh b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/macOS_Catalina_acid_test.sh deleted file mode 100644 index e1e98941a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/macOS_Catalina_acid_test.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -pkgs=( - "com.apple.pkg.DeveloperToolsCLILeo" # standalone - "com.apple.pkg.DeveloperToolsCLI" # from XCode - "com.apple.pkg.CLTools_Executables" # Mavericks -) - -for pkg in "${pkgs[@]}"; do - output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null) - if [ "$output" ]; then - version=$(echo "$output" | grep 'version' | cut -d' ' -f2) - break - fi -done - -if [ "$version" ]; then - echo "Command Line Tools version: $version" -else - echo >&2 'Command Line Tools not found' -fi diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/package.json b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/package.json deleted file mode 100644 index f95ebeade..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "node-gyp", - "description": "Node.js native addon build tool", - "license": "MIT", - "keywords": [ - "native", - "addon", - "module", - "c", - "c++", - "bindings", - "gyp" - ], - "version": "9.3.1", - "installVersion": 9, - "author": "Nathan Rajlich (http://tootallnate.net)", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/node-gyp.git" - }, - "preferGlobal": true, - "bin": "./bin/node-gyp.js", - "main": "./lib/node-gyp.js", - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^10.0.3", - "nopt": "^6.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "engines": { - "node": "^12.13 || ^14.13 || >=16" - }, - "devDependencies": { - "bindings": "^1.5.0", - "nan": "^2.14.2", - "require-inject": "^1.4.4", - "standard": "^14.3.4", - "tap": "^12.7.0" - }, - "scripts": { - "lint": "standard */*.js test/**/*.js", - "test": "npm run lint && tap --timeout=600 test/test-*" - } -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/src/win_delay_load_hook.cc b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/src/win_delay_load_hook.cc deleted file mode 100644 index 169f8029f..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/src/win_delay_load_hook.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * When this file is linked to a DLL, it sets up a delay-load hook that - * intervenes when the DLL is trying to load the host executable - * dynamically. Instead of trying to locate the .exe file it'll just - * return a handle to the process image. - * - * This allows compiled addons to work when the host executable is renamed. - */ - -#ifdef _MSC_VER - -#pragma managed(push, off) - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include - -#include -#include - -static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { - HMODULE m; - if (event != dliNotePreLoadLibrary) - return NULL; - - if (_stricmp(info->szDll, HOST_BINARY) != 0) - return NULL; - - m = GetModuleHandle(NULL); - return (FARPROC) m; -} - -decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; - -#pragma managed(pop) - -#endif diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/common.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/common.js deleted file mode 100644 index b714ee290..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/common.js +++ /dev/null @@ -1,3 +0,0 @@ -const envPaths = require('env-paths') - -module.exports.devDir = () => envPaths('node-gyp', { suffix: '' }).cache diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_BuildTools_minimal.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_BuildTools_minimal.txt deleted file mode 100644 index 244f6b079..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_BuildTools_minimal.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools","version":"15.9.28307.665","packages":["Microsoft.VisualStudio.Product.BuildTools","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.JavaScript.LanguageService","Microsoft.VisualStudio.JavaScript.LanguageService.Resources","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.CodeAnalysis.VisualStudio.Setup.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.CodeAnalysis.ExpressionEvaluator.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.PackageGroup.CoreEditor","PortableFacades","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer","Microsoft.TeamFoundation.OfficeIntegration","Microsoft.TeamFoundation.OfficeIntegration.Resources","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Editors","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.Component.Windows10SDK.17134","Win10SDK_10.0.17134","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.Workload.MSBuildTools","Microsoft.VisualStudio.Component.CoreBuildTools","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.BuildTools.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Component.MSBuild","Microsoft.PythonTools.BuildCore.Vsix","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.VisualStudio.NativeImageSupport","Microsoft.Build"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Community_workload.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Community_workload.txt deleted file mode 100644 index dd5e77daf..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Community_workload.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community","version":"15.9.28307.665","packages":["Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb","Win10SDK_IpOverUsb","Microsoft.VisualStudio.Component.VC.ATL.ARM64","Microsoft.VisualCpp.ATL.ARM64","Microsoft.VisualStudio.Component.VC.ATL.ARM","Microsoft.VisualCpp.ATL.ARM","Microsoft.VisualStudio.Component.VC.Tools.ARM","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualStudio.Graphics.Analyzer.Resources","Microsoft.Icecap.Analysis","Microsoft.VisualCpp.CRT.Redist.arm.OneCore.Desktop","Microsoft.VisualCpp.CRT.arm.Store","Microsoft.VisualCpp.CRT.arm.Desktop","Microsoft.VisualStudio.PackageGroup.VC.Tools.x64.ARM","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetarm","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetARM.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM.Resources","Microsoft.VisualCpp.Premium.Tools.ARM.Base","Microsoft.VisualCpp.Premium.Tools.ARM.Base.Resources","Microsoft.VisualCpp.PGO.ARM","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualStudio.Product.Community","Microsoft.VisualCpp.Tools.Hostx86.Targetarm","Microsoft.VisualStudio.Component.VC.Tools.ARM64","Microsoft.VisualStudio.VC.MSBuild.Arm64","Microsoft.VisualCpp.CRT.Redist.ARM64.OneCore.Desktop","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.CRT.ARM64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ARM64.Store","Microsoft.VisualCpp.CRT.ARM64.Desktop","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.Icecap.Analysis.Resources","Microsoft.VisualCpp.VCTip.hostX86.targetARM","Microsoft.VisualStudio.PackageGroup.VC.Tools.x64.ARM64","Microsoft.VisualCpp.Tools.Core","Microsoft.VisualCpp.PGO.ARM64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetarm64","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetARM64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetARM64.Resources","Microsoft.VisualCpp.Premium.Tools.ARM64.Base","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Tools.HostX86.TargetARM.Resources","Microsoft.VisualCpp.CRT.Redist.ARM64","Microsoft.VisualCpp.CRT.arm.OneCore.Desktop","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Component.WixToolset.VisualStudioExtension.Dev15","WixToolset.VisualStudioExtension.Dev15","Microsoft.VisualCpp.MFC.X64","Microsoft.VisualCpp.ATL.Headers","Microsoft.VisualStudio.Component.VC.CMake.Project","Microsoft.VisualStudio.VC.CMake","Microsoft.VisualStudio.VC.CMake.Project","Microsoft.VisualStudio.Component.Windows10SDK.17763","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","MLGen","Microsoft.VisualStudio.Graphics.Analyzer","Microsoft.VisualStudio.Component.TestTools.Core","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.NuGet.Licenses","SQLCommon","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualCpp.Tools.HostX64.TargetARM","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualCpp.HTMLHelpWorkshop.Msi","Microsoft.Icecap.Collection.Msi.Resources","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.VCTip.hostX64.targetARM","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.Graphics.Appid","Microsoft.VisualCpp.ATL.Source","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.Debugger.ImmersiveActivateHelper.Msi","Microsoft.VisualStudio.Debugger.JustInTime","Microsoft.DiagnosticsHub.CpuSampling","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualCpp.Tools.HostX64.TargetARM.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.Component.MSBuild","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.WebToolsExtensions","Microsoft.VisualCpp.Tools.Hostx86.Targetarm64","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualCpp.VCTip.hostX86.targetARM64","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualCpp.Tools.HostX86.TargetARM64.Resources","Microsoft.VisualStudio.RazorExtension","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualCpp.MFC.Source","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.Graphics.Viewers","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.MFC.Redist.X86","Microsoft.VisualStudio.WebToolsExtensions.Chip","Microsoft.DiagnosticsHub.Runtime.Resources","Microsoft.DiagnosticsHub.CpuSampling.Targeted","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.Component.VC.DiagnosticTools","Microsoft.VisualCpp.MFC.Redist.X64","Microsoft.VisualStudio.PackageGroup.TestTools.Native","Microsoft.VisualStudio.Graphics.Viewers.Resources","Microsoft.VisualCpp.MFC.MBCS","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Component.TextTemplating","Win10SDK_10.0.17763","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualCpp.MFC.MBCS.X64","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.Graphics.EnableTools","Microsoft.VisualStudio.Graphics.Appid.Resources","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualCpp.MFC.Headers","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.Graphics.Analyzer.Targeted","Microsoft.VisualCpp.CRT.Headers","Microsoft.DiagnosticsHub.Runtime.Targeted","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetARM64","Microsoft.VisualCpp.VCTip.hostX64.targetARM64","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.Icecap.Collection.Msi","Microsoft.VisualCpp.ATL.X86","Microsoft.VisualCpp.Tools.HostX64.TargetARM64.Resources","Microsoft.VisualStudio.Component.VC.ATLMFC","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.Icecap.Collection.Msi.Resources.Targeted","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualStudio.Component.Graphics.Tools","Microsoft.VisualStudio.WebTools.Resources","Microsoft.VisualCpp.ATL.X64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualStudio.Component.Graphics.Win81","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.Icecap.Analysis.Resources.Targeted","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.MFC.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.JavaScript.LanguageService","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.CredentialProvider","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.Component.NuGet","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualCpp.PGO.Headers","Microsoft.DiagnosticsHub.Collection","Microsoft.Icecap.Collection.Msi.Targeted","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualStudio.Branding.Community","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.WebToolsExtensions.Common","Microsoft.VisualStudio.WebTools.MSBuild","Microsoft.VisualStudio.NuGet.Core","Microsoft.DiagnosticsHub.Collection.Service","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.DiaSymReader.Native","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Component.Roslyn.LanguageServices","Microsoft.DiagnosticsHub.Collection.StopService.Install","Microsoft.VisualStudio.InteractiveWindow","Microsoft.PackageGroup.DiagnosticsHub.Platform","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.CodeAnalysis.ExpressionEvaluator.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.Debugger.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","sqlsysclrtypes","Microsoft.VisualStudio.ProTools","Component.Microsoft.VisualStudio.RazorExtension","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.Build.Dependencies","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualStudio.VC.Ide.ATL.Resources","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.Debugger.Managed","Microsoft.VisualStudio.Workload.NativeDesktop","Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest","Microsoft.VisualStudio.Debugger.JustInTime.Msi","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","sqlsysclrtypes","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.WebTools","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.TeamFoundation.OfficeIntegration.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.JavaScript.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.TestAdapterForGoogleTest","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.Component.Windows10SDK.17134","Microsoft.VisualStudio.PackageGroup.Core","PortableFacades","Microsoft.DiaSymReader","Microsoft.DiagnosticsHub.Runtime","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.Community","Microsoft.TeamFoundation.OfficeIntegration","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualCpp.Tools.Common.UtilsPrereq","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.ServiceHub","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.TeamExplorer","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents.Resources","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.GraphProvider","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents","Microsoft.CodeAnalysis.VisualStudio.Setup.Interactive.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup.Resources","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.NuGet.Build.Tasks","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.Build","Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.ATL","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.Workload.CoreEditor","Microsoft.VisualStudio.MinShell.Interop","Microsoft.Build.FileTracker.Msi","Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core","Microsoft.MSHtml","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.Devenv.Msi","Microsoft.VisualStudio.Component.VC.ATL","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.CoreEditor","Win10SDK_10.0.17134","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.Component.Debugger.JustInTime","Microsoft.VisualStudio.VC.Ide.MFC","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.PackageGroup.TeamExplorer","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.Devenv","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualStudio.Devenv.Resources","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.MefHosting","Microsoft.DiagnosticsHub.Collection.StopService.Uninstall","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualCpp.MFC.X86","Microsoft.VisualStudio.Log.Resources","Microsoft.Icecap.Analysis.Targeted","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.Devenv.Config","Microsoft.VisualStudio.MinShell.Resources","Microsoft.VisualStudio.Initializer","Microsoft.Net.PackageGroup.4.6.Redist"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Express.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Express.txt deleted file mode 100644 index c4b3b5f2b..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Express.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress","version":"15.9.28307.858","packages":["Microsoft.VisualStudio.Product.WDExpress","Microsoft.VisualStudio.Workload.WDExpress","Microsoft.VisualStudio.Component.Windows10SDK.17763","MLGen","Win10SDK_10.0.17763","Microsoft.VisualStudio.Component.Windows10SDK.14393","Win10SDK_10.0.14393.795","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.Component.VC.Tools.ARM64","Microsoft.VisualStudio.VC.MSBuild.Arm64","Microsoft.VisualCpp.CRT.Redist.ARM64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.ARM64","Microsoft.VisualCpp.CRT.ARM64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ARM64.Store","Microsoft.VisualCpp.CRT.ARM64.Desktop","Microsoft.VisualCpp.Tools.Hostx86.Targetarm64","Microsoft.VisualCpp.VCTip.hostX86.targetARM64","Microsoft.VisualCpp.Tools.HostX86.TargetARM64.Resources","Microsoft.VisualStudio.Component.VC.Tools.ARM","Microsoft.VisualCpp.Tools.Hostx86.Targetarm","Microsoft.VisualCpp.VCTip.hostX86.targetARM","Microsoft.VisualCpp.Tools.HostX86.TargetARM.Resources","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.arm.OneCore.Desktop","Microsoft.VisualCpp.CRT.arm.OneCore.Desktop","Microsoft.VisualCpp.CRT.arm.Store","Microsoft.VisualCpp.CRT.arm.Desktop","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.JavaScript.LanguageService","Microsoft.VisualStudio.JavaScript.LanguageService.Resources","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualStudio.Component.VC.CLI.Support","Microsoft.VisualCpp.CLI.X86","Microsoft.VisualCpp.CLI.X64","Microsoft.VisualCpp.CLI.Source","Microsoft.VisualCpp.CLI.ARM64","Microsoft.VisualCpp.CLI.ARM","Microsoft.VisualStudio.VC.Templates.CLR","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Templates.CLR.Resources","Microsoft.Component.VC.Runtime.OSSupport","Microsoft.Windows.UniversalCRT.Tools.Msi","Microsoft.Windows.UniversalCRT.Tools.Msi","Microsoft.Windows.UniversalCRT.ExtensionSDK.Msi","Microsoft.Windows.UniversalCRT.HeadersLibsSources.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.Component.HelpViewer","Microsoft.HelpViewer","Microsoft.VisualStudio.Help.Configuration.Msi","Microsoft.VisualStudio.Component.SQL.DataSources","Microsoft.VisualStudio.Component.SQL.SSDT","Microsoft.VisualStudio.Component.SQL.CMDUtils","sqlcmdlnutils","Microsoft.VisualStudio.Component.Common.Azure.Tools","Microsoft.VisualStudio.Azure.CommonAzureTools","SSDT","Microsoft.VisualStudio.Component.SQL.ADAL","sql_adalsql","Microsoft.VisualStudio.Component.NuGet","Microsoft.CredentialProvider","Microsoft.VisualStudio.NuGet.Licenses","Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime","Microsoft.VisualStudio.Component.SQL.NCLI","sqllocaldb","sqlncli","Microsoft.VisualStudio.Component.EntityFramework","Microsoft.VisualStudio.PackageGroup.DslRuntime","Microsoft.VisualStudio.Dsl.Core","Microsoft.VisualStudio.Dsl.GraphObject","Microsoft.VisualStudio.Dsl.Core.Resources","Microsoft.VisualStudio.EntityFrameworkTools","Microsoft.VisualStudio.EntityFrameworkTools.Msi","Microsoft.VisualStudio.Component.Roslyn.LanguageServices","Microsoft.VisualStudio.InteractiveWindow","Microsoft.DiaSymReader.Native","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents.Resources","Microsoft.CodeAnalysis.VisualStudio.InteractiveComponents","Microsoft.CodeAnalysis.VisualStudio.Setup.Interactive.Resources","Microsoft.Net.ComponentGroup.TargetingPacks.Common","Microsoft.Net.Component.4.6.TargetingPack","Microsoft.Net.4.6.TargetingPack","Microsoft.Net.Component.4.5.2.TargetingPack","Microsoft.Net.4.5.2.TargetingPack","Microsoft.Net.Component.4.5.1.TargetingPack","Microsoft.Net.4.5.1.TargetingPack","Microsoft.Net.Component.4.5.TargetingPack","Microsoft.Net.4.5.TargetingPack","Microsoft.Net.Component.4.TargetingPack","Microsoft.Net.4.TargetingPack","Microsoft.Net.ComponentGroup.DevelopmentPrerequisites","Microsoft.Net.Component.4.6.1.TargetingPack","Microsoft.Net.4.6.1.TargetingPack","Microsoft.Net.Cumulative.TargetingPack.Resources","Microsoft.Net.Component.4.6.1.SDK","Microsoft.Net.4.6.1.SDK","Microsoft.VisualStudio.Component.TextTemplating","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualStudio.Component.VisualStudioData","Microsoft.VisualStudio.Component.SQL.CLR","Microsoft.VisualStudio.ProTools","sqlsysclrtypes","sqlsysclrtypes","SQLCommon","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.XamlDiagnostics","Microsoft.VisualStudio.XamlDiagnostics.Resources","Microsoft.VisualStudio.XamlDesigner","Microsoft.VisualStudio.XamlDesigner.Resources","Microsoft.VisualStudio.XamlDesigner.Executables","Microsoft.VisualStudio.XamlShared","Microsoft.VisualStudio.XamlShared.Resources","Microsoft.VisualStudio.PackageGroup.TestTools.Managed","Microsoft.VisualStudio.PackageGroup.IntelliTrace.Core","Microsoft.IntelliTrace.Core","Microsoft.IntelliTrace.Core.Targeted","Microsoft.IntelliTrace.ProfilerProxy.Msi.x64","Microsoft.IntelliTrace.ProfilerProxy.Msi","Microsoft.VisualStudio.NuGet.Core","Microsoft.VisualStudio.TestWindow.SourceBasedTestDiscovery","Microsoft.VisualStudio.TestWindow.Dotnet","Microsoft.VisualStudio.TestTools.TestGeneration","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.PackageGroup.TestTools.Enterprise","Microsoft.VisualStudio.PackageGroup.TestTools.MSTestV2.Managed","Microsoft.VisualStudio.TestTools.MSTestV2.WizardExtension.UnitTest","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","Microsoft.Component.ClickOnce","Microsoft.VisualStudio.PackageGroup.ClickOnce.MSBuild","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.ClickOnce.SignTool.Msi","Microsoft.SQL.ClickOnceBootstrapper.Msi","Microsoft.Net.ClickOnceBootstrapper","Microsoft.ClickOnce.BootStrapper.Msi.Resources","Microsoft.ClickOnce.BootStrapper.Msi","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.CodeAnalysis.VisualStudio.Setup.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.CodeAnalysis.ExpressionEvaluator.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.ClickOnce.Resources","Microsoft.VisualStudio.ClickOnce","Microsoft.Component.MSBuild","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.VisualStudio.TemplateEngine","Microsoft.VisualStudio.WebToolsExtensions.Common","Microsoft.NET.Sdk","Microsoft.VisualStudio.PackageGroup.TestTools.Templates.Managed","Microsoft.VisualStudio.TestTools.Templates.Managed","Microsoft.VisualStudio.TestTools.Templates.Managed.Resources","Microsoft.VisualStudio.Templates.VB.MSTestv2.Desktop.UnitTest","Microsoft.VisualStudio.Templates.CS.MSTestv2.Desktop.UnitTest","Microsoft.VisualStudio.Templates.VB.Wpf","Microsoft.VisualStudio.Templates.VB.Wpf.Resources","Microsoft.VisualStudio.Templates.VB.Winforms","Microsoft.VisualStudio.Templates.VB.ManagedCore","Microsoft.VisualStudio.Templates.VB.Shared","Microsoft.VisualStudio.Templates.VB.Shared.Resources","Microsoft.VisualStudio.Templates.VB.ManagedCore.Resources","Microsoft.VisualStudio.Templates.CS.GettingStarted.Desktop.Package","Microsoft.VisualStudio.Templates.GetStarted.Desktop.Setup","Microsoft.VisualStudio.Templates.CS.GettingStarted.Console.Package","Microsoft.VisualStudio.Templates.GetStarted.Resources","Microsoft.VisualStudio.Templates.GetStarted.Common.Setup","Microsoft.VisualStudio.Templates.GetStarted.Console.Setup","Microsoft.VisualStudio.Templates.CS.Wpf","Microsoft.VisualStudio.Templates.CS.Wpf.Resources","Microsoft.VisualStudio.Templates.CS.Winforms","Microsoft.VisualStudio.Templates.CS.ManagedCore","Microsoft.VisualStudio.Templates.CS.Shared","Microsoft.VisualStudio.Templates.Editorconfig.Wizard.Setup","Templates.Editorconfig.SolutionFile.Setup","Microsoft.VisualStudio.Templates.CS.Shared.Resources","Microsoft.VisualStudio.Templates.CS.ManagedCore.Resources","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.PackageGroup.CoreEditor","PortableFacades","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Build","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer","Microsoft.TeamFoundation.OfficeIntegration","Microsoft.TeamFoundation.OfficeIntegration.Resources","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.WDExpress","Microsoft.VisualStudio.WDExpress.Resources","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.MinShell.Resources","Microsoft.Net.PackageGroup.4.6.Redist","Microsoft.VisualStudio.Branding.WDExpress"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Unusable.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Unusable.txt deleted file mode 100644 index fc0a257f4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2017_Unusable.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildToolsUnusable","version":"15.9.28307.665","packages":["Microsoft.VisualStudio.Product.BuildTools","Microsoft.VisualStudio.Component.Windows10SDK.17134","Win10SDK_10.0.17134","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.Workload.MSBuildTools","Microsoft.VisualStudio.Component.CoreBuildTools","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.BuildTools.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Component.MSBuild","Microsoft.PythonTools.BuildCore.Vsix","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers.Resources","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.6.1.Redist","Microsoft.Net.4.6.1.FullRedist.NonThreshold","Microsoft.Windows.UniversalCRT.Msu.81","Microsoft.VisualStudio.NativeImageSupport","Microsoft.Build"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_BuildTools_minimal.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_BuildTools_minimal.txt deleted file mode 100644 index f07d25416..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_BuildTools_minimal.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools","version":"16.1.28922.388","packages":["Microsoft.VisualStudio.Product.BuildTools","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.CodeSense.Community","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Platform.CallHierarchy","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer.Common","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.OpenFolder.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Platform.NavigateTo","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VisualC.Logging","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.VCPkgDatabase","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Agent","Microsoft.VisualStudio.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Concord","Microsoft.VisualStudio.VC.Ide.Debugger.Concord.Resources","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.DiaSymReader","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Concord.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed.Resources","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.PerfLib","Microsoft.VisualStudio.Debugger.Package.DiagHub.Client.VSx86","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.VisualStudio.Editors","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Platform.Editor","Microsoft.VisualStudio.Debugger.Concord","Microsoft.VisualStudio.Debugger.Concord.Resources","Microsoft.VisualStudio.Debugger.Resources","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.VisualStudio.Component.Windows10SDK.17134","Win10SDK_10.0.17134","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.VC.MSBuild.x86.v142","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.X64.v142","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM.v142","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.Workload.MSBuildTools","Microsoft.VisualStudio.Component.CoreBuildTools","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.BuildTools.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Component.MSBuild","Microsoft.PythonTools.BuildCore.Vsix","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers","Microsoft.Net.PackageGroup.4.7.2.Redist","Microsoft.VisualStudio.NativeImageSupport","Microsoft.Build","Microsoft.VisualStudio.PackageGroup.NuGet","Microsoft.VisualStudio.NuGet.BuildTools"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_Community_workload.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_Community_workload.txt deleted file mode 100644 index 50071c25f..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_Community_workload.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community","version":"16.1.28922.388","packages":["Microsoft.VisualStudio.Workload.NativeDesktop","Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForGoogleTest","Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest","Microsoft.VisualStudio.Component.VC.ATL","Microsoft.VisualStudio.VC.Ide.ATL","Microsoft.VisualStudio.VC.Ide.ATL.Resources","Microsoft.VisualCpp.ATL.X86","Microsoft.VisualCpp.ATL.X64","Microsoft.VisualCpp.ATL.Source","Microsoft.VisualCpp.ATL.Headers","Microsoft.VisualStudio.Component.VC.CMake.Project","Microsoft.VisualStudio.VC.CMake","Microsoft.VisualStudio.VC.CMake.Project","Microsoft.VisualStudio.VC.ExternalBuildFramework","Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core","Microsoft.VisualStudio.PackageGroup.TestTools.Native","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.VC.UnitTest.Desktop.Build.Core","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.Component.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.ImmersiveActivateHelper.Msi","Microsoft.VisualStudio.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.JustInTime.Msi","Microsoft.VisualStudio.Component.Windows10SDK.17763","Win10SDK_10.0.17763","Microsoft.VisualStudio.Component.VC.DiagnosticTools","Microsoft.VisualStudio.Component.Graphics.Tools","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.Graphics.Viewers","Microsoft.VisualStudio.Graphics.Viewers.Resources","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Analyzer","Microsoft.VisualStudio.Graphics.Analyzer.Targeted","Microsoft.VisualStudio.Graphics.Analyzer.Resources","Microsoft.VisualStudio.Graphics.Appid","Microsoft.VisualStudio.Graphics.Appid.Resources","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.VC.MSBuild.X64.v142","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM.v142","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.x86.v142","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.VCPkgDatabase","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Component.Microsoft.VisualStudio.LiveShare","Microsoft.VisualStudio.LiveShare","Microsoft.Icecap.Analysis","Microsoft.Icecap.Analysis.Targeted","Microsoft.Icecap.Analysis.Resources","Microsoft.Icecap.Analysis.Resources.Targeted","Microsoft.Icecap.Collection.Msi","Microsoft.Icecap.Collection.Msi.Targeted","Microsoft.Icecap.Collection.Msi.Resources","Microsoft.Icecap.Collection.Msi.Resources.Targeted","Microsoft.DiagnosticsHub.Instrumentation","Microsoft.DiagnosticsHub.CpuSampling.ExternalDependencies","Microsoft.DiagnosticsHub.CpuSampling","Microsoft.DiagnosticsHub.CpuSampling.Targeted","Microsoft.PackageGroup.DiagnosticsHub.Platform","Microsoft.DiagnosticsHub.Runtime.ExternalDependencies","Microsoft.DiagnosticsHub.Runtime.ExternalDependencies.Targeted","Microsoft.DiagnosticsHub.Collection.ExternalDependencies.x64","Microsoft.DiagnosticsHub.Collection.StopService.Uninstall","Microsoft.DiagnosticsHub.Runtime","Microsoft.DiagnosticsHub.Runtime.Targeted","Microsoft.DiagnosticsHub.Collection","Microsoft.DiagnosticsHub.Collection.Service","Microsoft.DiagnosticsHub.Collection.StopService.Install","Microsoft.VisualStudio.Component.IntelliCode","Microsoft.VisualStudio.IntelliCode","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","Microsoft.VisualStudio.LiveShareApi","Microsoft.VisualStudio.Component.TextTemplating","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.Component.MSBuild","Microsoft.NuGet.Build.Tasks","Microsoft.DiagnosticsHub.KB2882822.Win7","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions","Microsoft.VisualStudio.ProTools","sqlsysclrtypes","sqlsysclrtypes","SQLCommon","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.WebToolsExtensions","Microsoft.VisualStudio.WebTools","Microsoft.VisualStudio.WebTools.Resources","Microsoft.VisualStudio.WebTools.MSBuild","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.VisualC.Logging","Microsoft.WebTools.Shared","Microsoft.WebTools.DotNet.Core.ItemTemplates","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.Windows.UniversalCRT.Msu.7","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers","Microsoft.VisualStudio.Component.NuGet","Microsoft.CredentialProvider","Microsoft.VisualStudio.NuGet.PowershellBindingRedirect","Microsoft.VisualStudio.NuGet.Licenses","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.CodeSense.Community","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Agent","Microsoft.VisualStudio.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Concord","Microsoft.VisualStudio.VC.Ide.Debugger.Concord.Resources","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.VisualStudio.Debugger.Concord.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed.Resources","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.DbgHelp.Win8","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Remote.DbgHelp.Win8","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.Debugger.Package.DiagHub.Client.VSx86","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.DbgHelp.Win8","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Concord","Microsoft.VisualStudio.Debugger.Concord.Resources","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Platform.CallHierarchy","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.Devenv.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.Product.Community","Microsoft.VisualStudio.Workload.CoreEditor","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualCpp.Tools.Common.UtilsPrereq","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Build","Microsoft.VisualStudio.PackageGroup.NuGet","Microsoft.VisualStudio.NuGet.Core","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer.Common","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.OpenFolder.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.Devenv","Microsoft.VisualStudio.Devenv.Resources","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Platform.NavigateTo","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.PerfLib","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Platform.Editor","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.Devenv.Config","Microsoft.VisualStudio.MinShell.Resources","Microsoft.Net.PackageGroup.4.7.2.Redist","Microsoft.Net.4.7.2.FullRedist","Microsoft.VisualStudio.Branding.Community"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_Preview.txt b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_Preview.txt deleted file mode 100644 index 806509e7c..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/VS_2019_Preview.txt +++ /dev/null @@ -1 +0,0 @@ -[{"path":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview","version":"16.0.28608.199","packages":["Microsoft.VisualStudio.Product.Enterprise","Microsoft.VisualStudio.Workload.NativeDesktop","Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForGoogleTest","Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest","Microsoft.VisualStudio.VC.Ide.TestAdapterForBoostTest","Microsoft.VisualStudio.Component.VC.ATL","Microsoft.VisualStudio.VC.Ide.ATL","Microsoft.VisualStudio.VC.Ide.ATL.Resources","Microsoft.VisualCpp.ATL.X86","Microsoft.VisualCpp.ATL.X64","Microsoft.VisualCpp.ATL.Source","Microsoft.VisualCpp.ATL.Headers","Microsoft.VisualStudio.Component.VC.CMake.Project","Microsoft.VisualStudio.VC.CMake","Microsoft.VisualStudio.VC.CMake.Project","Microsoft.VisualStudio.VC.ExternalBuildFramework","Microsoft.VisualStudio.Component.VC.DiagnosticTools","Microsoft.VisualStudio.Component.Graphics.Tools","Microsoft.VisualStudio.Graphics.Viewers","Microsoft.VisualStudio.Graphics.Viewers.Resources","Microsoft.VisualStudio.Graphics.EnableTools","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Msi","Microsoft.VisualStudio.Graphics.Analyzer","Microsoft.VisualStudio.Graphics.Analyzer.Targeted","Microsoft.VisualStudio.Graphics.Analyzer.Resources","Microsoft.VisualStudio.Graphics.Appid","Microsoft.VisualStudio.Graphics.Appid.Resources","Microsoft.VisualStudio.Component.Windows10SDK.17763","Win10SDK_10.0.17763","Microsoft.VisualStudio.Component.VC.Tools.x86.x64","Microsoft.VisualCpp.CodeAnalysis.Extensions","Microsoft.VisualCpp.CodeAnalysis.Extensions.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X86.Resources","Microsoft.VisualCpp.CodeAnalysis.Extensions.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64","Microsoft.VisualCpp.CodeAnalysis.ConcurrencyCheck.X64.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX86","Microsoft.VisualCpp.VCTip.HostX64.TargetX86","Microsoft.VisualCpp.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Tools.HostX64.TargetX64","Microsoft.VisualCpp.VCTip.HostX64.TargetX64","Microsoft.VisualCpp.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX64","Microsoft.VisualCpp.Premium.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX86.Resources","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64","Microsoft.VisualCpp.Premium.Tools.HostX64.TargetX64.Resources","Microsoft.VisualCpp.PGO.X86","Microsoft.VisualCpp.PGO.X64","Microsoft.VisualCpp.PGO.Headers","Microsoft.VisualCpp.CRT.x86.Store","Microsoft.VisualCpp.CRT.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.x64.Store","Microsoft.VisualCpp.CRT.x64.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x86.OneCore.Desktop","Microsoft.VisualCpp.CRT.Redist.x64.OneCore.Desktop","Microsoft.VisualStudio.PackageGroup.VC.Tools.x86","Microsoft.VisualCpp.Tools.HostX86.TargetX64","Microsoft.VisualCpp.VCTip.hostX86.targetX64","Microsoft.VisualCpp.Tools.Hostx86.Targetx64.Resources","Microsoft.VisualCpp.Tools.HostX86.TargetX86","Microsoft.VisualCpp.VCTip.hostX86.targetX86","Microsoft.VisualCpp.Tools.HostX86.TargetX86.Resources","Microsoft.VisualCpp.Tools.Core.Resources","Microsoft.VisualCpp.Tools.Core.x86","Microsoft.VisualCpp.DIA.SDK","Microsoft.VisualCpp.CRT.x86.Desktop","Microsoft.VisualCpp.CRT.x64.Desktop","Microsoft.VisualCpp.CRT.Source","Microsoft.VisualCpp.CRT.Redist.X86","Microsoft.VisualCpp.CRT.Redist.X64","Microsoft.VisualCpp.CRT.Redist.Resources","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.RuntimeDebug.14","Microsoft.VisualCpp.CRT.Headers","Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core","Microsoft.VisualStudio.PackageGroup.TestTools.Native","Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native","Microsoft.VisualStudio.Component.ClassDesigner","Microsoft.VisualStudio.ClassDesigner","Microsoft.VisualStudio.ClassDesigner.Resources","Microsoft.VisualStudio.Component.VC.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualCpp.Redist.14.Latest","Microsoft.VisualStudio.VC.Templates.UnitTest","Microsoft.VisualStudio.VC.UnitTest.Desktop.Build.Core","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CPP","Microsoft.VisualStudio.VC.Templates.UnitTest.Resources","Microsoft.VisualStudio.VC.Templates.Desktop","Microsoft.VisualStudio.Component.VC.CoreIde","Microsoft.VisualStudio.VC.Ide.Pro","Microsoft.VisualStudio.VC.Ide.Pro.Resources","Microsoft.VisualStudio.VC.Templates.Pro","Microsoft.VisualStudio.VC.Templates.Pro.Resources","Microsoft.VisualStudio.VC.Items.Pro","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Reduced","Microsoft.VisualStudio.VC.Ide.x64","Microsoft.VisualStudio.PackageGroup.VC.CoreIDE.Express","Microsoft.VisualStudio.VC.MSBuild.X64.v142","Microsoft.VisualStudio.VC.MSBuild.X64","Microsoft.VS.VC.MSBuild.X64.Resources","Microsoft.VisualStudio.VC.MSBuild.ARM.v142","Microsoft.VisualStudio.VC.MSBuild.ARM","Microsoft.VisualStudio.VC.MSBuild.x86.v142","Microsoft.VisualStudio.VC.MSBuild.X86","Microsoft.VisualStudio.VC.MSBuild.Base","Microsoft.VisualStudio.VC.MSBuild.Base.Resources","Microsoft.VisualStudio.VC.Ide.WinXPlus","Microsoft.VisualStudio.VC.Ide.Dskx","Microsoft.VisualStudio.VC.Ide.Dskx.Resources","Microsoft.VisualStudio.VC.Ide.Base","Microsoft.VisualStudio.VC.Ide.LanguageService","Microsoft.VisualStudio.VC.Ide.Core","Microsoft.VisualStudio.VC.Ide.Core.Resources","Microsoft.VisualStudio.VC.Ide.VCPkgDatabase","Microsoft.VisualStudio.VC.Ide.Progression.Enterprise","Microsoft.VisualStudio.VC.Ide.ProjectSystem","Microsoft.VisualStudio.VC.Ide.ProjectSystem.Resources","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine","Microsoft.VisualStudio.VC.Ide.Core.VCProjectEngine.Resources","Microsoft.VisualStudio.VC.Ide.LanguageService.Resources","Microsoft.VisualStudio.VC.Ide.Base.Resources","Microsoft.VisualStudio.Component.CodeMap","Microsoft.VisualStudio.Component.GraphDocument","Microsoft.VisualStudio.Vmp","Microsoft.VisualStudio.GraphDocument","Microsoft.VisualStudio.GraphDocument.Resources","Microsoft.VisualStudio.CodeMap","Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime","Microsoft.VisualStudio.Component.SQL.NCLI","sqllocaldb","sqlncli","Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions","Microsoft.VisualStudio.WebToolsExtensions","Microsoft.VisualStudio.WebTools","Microsoft.VisualStudio.WebTools.Resources","Microsoft.VisualStudio.WebTools.MSBuild","Microsoft.VisualStudio.PackageGroup.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Msi","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.Debugger.Script.Resources","Microsoft.VisualStudio.VC.Ide.MDD","Microsoft.VisualStudio.Component.NuGet","Microsoft.CredentialProvider","Component.Microsoft.VisualStudio.LiveShare","Microsoft.VisualStudio.LiveShare","Microsoft.VisualStudio.Component.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.ImmersiveActivateHelper.Msi","Microsoft.VisualStudio.Debugger.JustInTime","Microsoft.VisualStudio.Debugger.JustInTime.Msi","Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd","Microsoft.IntelliTrace.DiagnosticsHubAgent.Targeted","Microsoft.IntelliTrace.Debugger","Microsoft.IntelliTrace.Debugger.Targeted","Microsoft.IntelliTrace.FrontEnd","Microsoft.DiagnosticsHub.Instrumentation","Microsoft.DiagnosticsHub.CpuSampling","Microsoft.DiagnosticsHub.CpuSampling.Targeted","Microsoft.PackageGroup.DiagnosticsHub.Platform","Microsoft.DiagnosticsHub.Collection.StopService.Uninstall","Microsoft.DiagnosticsHub.Runtime","Microsoft.DiagnosticsHub.Runtime.Targeted","Microsoft.DiagnosticsHub.Runtime.Resources","Microsoft.DiagnosticsHub.Collection","Microsoft.DiagnosticsHub.Collection.Service","Microsoft.DiagnosticsHub.Collection.StopService.Install","Microsoft.VisualStudio.Dsl.GraphObject","Microsoft.Net.4.TargetingPack","Microsoft.VisualStudio.VC.Ide.ResourceEditor","Microsoft.VisualStudio.VC.Ide.ResourceEditor.Resources","Microsoft.VisualStudio.NuGet.Licenses","Microsoft.WebTools.Shared","Microsoft.VisualStudio.WebToolsExtensions.DotNet.Core.ItemTemplates","Microsoft.VisualStudio.Component.TextTemplating","Microsoft.VisualStudio.TextTemplating.MSBuild","Microsoft.VisualStudio.TextTemplating.Integration","Microsoft.VisualStudio.TextTemplating.Core","Microsoft.VisualStudio.TextTemplating.Integration.Resources","Microsoft.VisualStudio.ProTools","sqlsysclrtypes","sqlsysclrtypes","SQLCommon","Microsoft.VisualStudio.ProTools.Resources","Microsoft.VisualStudio.NuGet.Core","Microsoft.VisualStudio.PackageGroup.TestTools.CodeCoverage","Microsoft.VisualStudio.PackageGroup.IntelliTrace.Core","Microsoft.IntelliTrace.Core","Microsoft.IntelliTrace.Core.Concord","Microsoft.IntelliTrace.Core.Targeted","Microsoft.IntelliTrace.ProfilerProxy.Msi.x64","Microsoft.IntelliTrace.ProfilerProxy.Msi","Microsoft.VisualStudio.TestTools.DynamicCodeCoverage","Microsoft.VisualStudio.TestTools.CodeCoverage.Msi","Microsoft.VisualStudio.TestTools.CodeCoverage","Microsoft.Icecap.Analysis","Microsoft.Icecap.Analysis.Targeted","Microsoft.Icecap.Analysis.Resources","Microsoft.Icecap.Analysis.Resources.Targeted","Microsoft.Icecap.Collection.Msi","Microsoft.Icecap.Collection.Msi.Targeted","Microsoft.Icecap.Collection.Msi.Resources","Microsoft.Icecap.Collection.Msi.Resources.Targeted","Microsoft.VisualStudio.PackageGroup.TestTools.Core","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.TestPlatform.V1.CLI","Microsoft.VisualStudio.TestTools.Pex.Common","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.Legacy","Microsoft.VisualStudio.PackageGroup.MinShell.Interop","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Msi","Microsoft.VisualStudio.TestTools.TP.Legacy.Tips.Common","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Tips.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.TestTools","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Remote","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Professional","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Premium","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Common","Microsoft.VisualStudio.TestTools.TP.Legacy.Common.Res","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Core.Resources","Microsoft.VisualStudio.TestTools.TestPlatform.Legacy.Agent","Microsoft.VisualStudio.PackageGroup.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.TestTools.TestWIExtension","Microsoft.VisualStudio.TestTools.TestPlatform.IDE","Microsoft.VisualStudio.PackageGroup.TestTools.DataCollectors","Microsoft.VisualStudio.TestTools.NE.Msi.Targeted","Microsoft.VisualStudio.TestTools.NetworkEmulation","Microsoft.VisualStudio.TestTools.DataCollectors","Microsoft.VisualCpp.CRT.ClickOnce.Msi","Microsoft.VisualStudio.WebTools.WSP.FSA","Microsoft.VisualStudio.WebTools.WSP.FSA.Resources","Microsoft.VisualStudio.Component.Static.Analysis.Tools","Microsoft.VisualCpp.Redist.14","Microsoft.VisualCpp.Redist.14","Microsoft.VisualStudio.StaticAnalysis","Microsoft.VisualStudio.StaticAnalysis.Resources","Microsoft.VisualStudio.PackageGroup.Community","Microsoft.VisualStudio.Community.Extra.Resources","Microsoft.VisualStudio.Community.Extra","Microsoft.VisualStudio.PackageGroup.Core","Microsoft.VisualStudio.CodeSense","Microsoft.VisualStudio.CodeSense.Community","Microsoft.VisualStudio.TestTools.TeamFoundationClient","Microsoft.VisualStudio.PackageGroup.Debugger.Core","Microsoft.VisualStudio.PackageGroup.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Runtime","Microsoft.VisualStudio.Debugger.TimeTravel.Agent","Microsoft.VisualStudio.Debugger.TimeTravel.Record","Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost","Microsoft.VisualStudio.VC.Ide.Debugger","Microsoft.VisualStudio.VC.Ide.Debugger.Concord","Microsoft.VisualStudio.VC.Ide.Debugger.Concord.Resources","Microsoft.VisualStudio.VC.Ide.Debugger.Resources","Microsoft.VisualStudio.VC.Ide.Common","Microsoft.VisualStudio.VC.Ide.Common.Resources","Microsoft.VisualStudio.Debugger.Parallel","Microsoft.VisualStudio.Debugger.Parallel.Resources","Microsoft.VisualStudio.Debugger.CollectionAgents","Microsoft.VisualStudio.Debugger.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed","Microsoft.VisualStudio.Debugger.Concord.Managed.Resources","Microsoft.VisualStudio.Debugger.Managed.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote","Microsoft.VisualStudio.Debugger.Concord.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger.Remote.Resources","Microsoft.VisualStudio.Debugger","Microsoft.VisualStudio.Debugger.Package.DiagHub.Client.VSx86","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.Debugger.Remote.DiagHub.Client","Microsoft.VisualStudio.VC.MSVCDis","Microsoft.VisualStudio.ScriptedHost","Microsoft.VisualStudio.ScriptedHost.Targeted","Microsoft.VisualStudio.ScriptedHost.Resources","Microsoft.IntelliTrace.DiagnosticsHub","Microsoft.VisualStudio.Debugger.Concord","Microsoft.VisualStudio.Debugger.Concord.Resources","Microsoft.VisualStudio.Debugger.Resources","Microsoft.PackageGroup.ClientDiagnostics","Microsoft.VisualStudio.AppResponsiveness","Microsoft.VisualStudio.AppResponsiveness.Targeted","Microsoft.VisualStudio.AppResponsiveness.Resources","Microsoft.VisualStudio.ClientDiagnostics","Microsoft.VisualStudio.ClientDiagnostics.Targeted","Microsoft.VisualStudio.ClientDiagnostics.Resources","Microsoft.VisualStudio.PackageGroup.ProfessionalCore","Microsoft.VisualStudio.Professional","Microsoft.VisualStudio.Professional.Msi","Microsoft.VisualStudio.PackageGroup.EnterpriseCore","Microsoft.VisualStudio.Enterprise.Msi","Microsoft.VisualStudio.Enterprise","Microsoft.ShDocVw","Microsoft.VisualStudio.PackageGroup.CommunityCore","Microsoft.VisualStudio.ProjectSystem.Full","Microsoft.VisualStudio.ProjectSystem","Microsoft.VisualStudio.Community.x86","Microsoft.VisualStudio.Community.x64","Microsoft.VisualStudio.Community","Microsoft.IntelliTrace.CollectorCab","Microsoft.VisualStudio.Community.Resources","Microsoft.VisualStudio.WebSiteProject.DTE","Microsoft.MSHtml","Microsoft.VisualStudio.Platform.CallHierarchy","Microsoft.VisualStudio.Community.Msi.Resources","Microsoft.VisualStudio.Community.Msi","Microsoft.VisualStudio.Devenv.Msi","Microsoft.VisualStudio.MinShell.Interop.Msi","Microsoft.VisualStudio.Editors","Microsoft.VisualStudio.Net.Eula.Resources","Microsoft.CodeAnalysis.ExpressionEvaluator","Microsoft.CodeAnalysis.VisualStudio.Setup","Microsoft.Component.MSBuild","Microsoft.NuGet.Build.Tasks","Microsoft.VisualStudio.Component.Roslyn.Compiler","Microsoft.CodeAnalysis.Compilers","Microsoft.VisualStudio.Workload.CoreEditor","Microsoft.VisualStudio.Component.CoreEditor","Microsoft.VisualStudio.PackageGroup.CoreEditor","Microsoft.VisualCpp.Tools.Common.UtilsPrereq","Microsoft.VisualCpp.Tools.Common.Utils","Microsoft.VisualCpp.Tools.Common.Utils.Resources","Microsoft.VisualStudio.PackageGroup.VsDevCmd","Microsoft.VisualStudio.VsDevCmd.Ext.NetFxSdk","Microsoft.VisualStudio.VsDevCmd.Core.WinSdk","Microsoft.VisualStudio.VsDevCmd.Core.DotNet","Microsoft.VisualStudio.VC.DevCmd","Microsoft.VisualStudio.VC.DevCmd.Resources","Microsoft.VisualStudio.VirtualTree","Microsoft.VisualStudio.PackageGroup.Progression","Microsoft.VisualStudio.PerformanceProvider","Microsoft.VisualStudio.GraphModel","Microsoft.VisualStudio.GraphProvider","Microsoft.DiaSymReader","Microsoft.Build.Dependencies","Microsoft.Build.FileTracker.Msi","Microsoft.Build","Microsoft.VisualStudio.TextMateGrammars","Microsoft.VisualStudio.PackageGroup.TeamExplorer.Common","Microsoft.VisualStudio.TeamExplorer","Microsoft.ServiceHub","Microsoft.VisualStudio.ProjectServices","Microsoft.VisualStudio.SLNX.VSIX","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.FileHandler.Msi","Microsoft.VisualStudio.PackageGroup.MinShell","Microsoft.VisualStudio.MinShell.Interop","Microsoft.VisualStudio.Log","Microsoft.VisualStudio.Log.Targeted","Microsoft.VisualStudio.Log.Resources","Microsoft.VisualStudio.Finalizer","Microsoft.VisualStudio.Devenv","Microsoft.VisualStudio.Devenv.Resources","Microsoft.VisualStudio.CoreEditor","Microsoft.VisualStudio.Platform.NavigateTo","Microsoft.VisualStudio.Connected","Microsoft.VisualStudio.Connected.Resources","Microsoft.VisualStudio.MinShell","Microsoft.VisualStudio.Setup.Configuration","Microsoft.VisualStudio.Platform.Search","Microsoft.VisualStudio.MinShell.Platform","Microsoft.VisualStudio.MinShell.Platform.Resources","Microsoft.VisualStudio.MefHosting","Microsoft.VisualStudio.MefHosting.Resources","Microsoft.VisualStudio.Initializer","Microsoft.VisualStudio.ExtensionManager","Microsoft.VisualStudio.Platform.Editor","Microsoft.VisualStudio.MinShell.x86","Microsoft.VisualStudio.NativeImageSupport","Microsoft.VisualStudio.MinShell.Msi","Microsoft.VisualStudio.MinShell.Msi.Resources","Microsoft.VisualStudio.LanguageServer","Microsoft.VisualStudio.Devenv.Config","Microsoft.VisualStudio.MinShell.Resources","Microsoft.Net.PackageGroup.4.7.2.Redist","Microsoft.VisualStudio.Branding.Enterprise"]}] diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/certs.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/certs.js deleted file mode 100644 index 766e54b5e..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/certs.js +++ /dev/null @@ -1,150 +0,0 @@ -module.exports['ca.key'] = ` ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAtTbG0k2UFUyCdZuip0TTEtXRHh57qosegrpHPBreSNTxt7OT -KfOUZp2rToTHeN9w0ZbV2eKRI5AuFx8Cmlm73/KIHKzSNTBATGMeeHnGaxvL/W/s -KJdTDRNf7/qCXHQ+gsuEWWCFzOZuHmmAQa2IBX2HAQTqXJI8+2iJ9gytFfJLxjqy -6O4u9ugZVHSyQJWs49tGRcWMlNm7EMStADFvJn3S11xe/kwIA2mSI/eddDnzL0Mx -AkR9dQBL66xOABLL5v3QQdhipfHluX6HLbDd/1YsFTuOpgvLRlr72rTAFrQZCokV -hXPiqstn5zJFW5arHakvMR0+OPaICF5feh/4qQIDAQABAoIBAHWg6exnWUF+GY0Y -CrwDS/QFASpI5UNt7M809bqJQlMKjyEMmvF3YJQ/soxUWlsWx1f1TjmR/V6VX6W4 -hmsE5pRXDY13jTfja0lqacQQYAD02TRY63XpzIpHUlYnSWmUN2OVkgKmShQYW9C3 -8P4xE4Nk2TaLJ0oRzy3uzOb/kXcVaJfknBRUnOhuaTSs+w4l4pPXueYA7xuHgVsL -Qq0S4kK+PmdwCMB7gzlAAQhCM3vQ1U4cjC9JIIKSmPy7BcvD0kBfVPIFQ2byGpA1 -VkWBLSyeig0YxA5oIshK5cLiDIfBIiCSEzm4AMhVhGf0tbGEwiPljxKjbarYUUIi -ATMk83UCgYEA7kKeOveuPbMqxmT42swfa9OU5jLUjH+VExU0Kv3BbEjv/OGt0fac -/cs1Ze3vnrtCHudVajocFjydb8B4c62DbA4/T+LcUw/HaMaORbOoICQidi/zZ1Lj -gjg8Ip2WKXEhSAwqUpaFd6w16NZOxiTh+NDaRKywwbe8j57eDH4uR6MCgYEAwrTS -q5ra6+WDGUFMs0y3GMbL8j14PGhxBQBYSTM//NysI+EM6eeKn1cV3BbphEw//jgE -0pVokkjvLAQWWEG2dZyRxRE3YAMgOAIPx5zbJCim3iBVuoqY9ckLg2jF8Fqqubsb -3Rf2/Xzn/rFqsXdhsjGcJpdN66T9aEjwEkAnc0MCgYA5cOYk4UGormFJo147oaqR -nFjxhp+nn7qY9yu0kajoKk1xchct337J0Qv2nv5+DjdKrArzqT7MPaDXKFfhy5s7 -mdO5tr/XZp50rCnws/d8iDmmtLjB2EHxSw10avmg1B1p+UTa1F8pEuOMVt529r1j -9zYoCFo02c8j8PEnoeQWcQKBgQCVBCuQZu5SSM/zTkTTnU0sy0lf1qflI9IMD92B -+JVqg8HDnAR0KF+x38a9MVP7ixgXCuy19t+XxfY269HmLjTlArWV671D4GCSPRGy -plwZ6nr72ieCo3y57+q94jxL3jh3+bozlpnUG/q6tTKBLGs7JDjsWDSsuxOu8tO6 -RBttXQKBgB6LQFOTjDMfsFHKsnQXFUZId3GG/iLg3WCWxEo88T5Rq3JIR0zDpW8H -cKhl/sPY+JVHsxizNCMPtp7Hn7GrB6D/v9LbO0jpG2U0BFiJ6zhiDopbP9B0EAW4 -5JJ+JGKRKoCxs3DmSVyns0gU4j4rVte97UWyVy5TZ8Acr/qrgOA1 ------END RSA PRIVATE KEY----- -` - -module.exports['ca.crt'] = ` ------BEGIN CERTIFICATE----- -MIIDmzCCAoOgAwIBAgIUDA0GrvcnG41XT6LYFeNwvq8YV1UwDQYJKoZIhvcNAQEL -BQAwXTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRAwDgYDVQQKDAdOb2RlLmpz -MREwDwYDVQQLDAhub2RlLWd5cDEcMBoGA1UEAwwTbm9kZS1neXAubm9kZWpzLm9y -ZzAeFw0yMjA1MTEwNDIyMjRaFw00OTA5MjUwNDIyMjRaMF0xCzAJBgNVBAYTAlVT -MQswCQYDVQQIDAJDQTEQMA4GA1UECgwHTm9kZS5qczERMA8GA1UECwwIbm9kZS1n -eXAxHDAaBgNVBAMME25vZGUtZ3lwLm5vZGVqcy5vcmcwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQC1NsbSTZQVTIJ1m6KnRNMS1dEeHnuqix6Cukc8Gt5I -1PG3s5Mp85RmnatOhMd433DRltXZ4pEjkC4XHwKaWbvf8ogcrNI1MEBMYx54ecZr -G8v9b+wol1MNE1/v+oJcdD6Cy4RZYIXM5m4eaYBBrYgFfYcBBOpckjz7aIn2DK0V -8kvGOrLo7i726BlUdLJAlazj20ZFxYyU2bsQxK0AMW8mfdLXXF7+TAgDaZIj9510 -OfMvQzECRH11AEvrrE4AEsvm/dBB2GKl8eW5foctsN3/ViwVO46mC8tGWvvatMAW -tBkKiRWFc+Kqy2fnMkVblqsdqS8xHT449ogIXl96H/ipAgMBAAGjUzBRMB0GA1Ud -DgQWBBT6LcYYABEOAMv4hI/5bC82rGlD/DAfBgNVHSMEGDAWgBT6LcYYABEOAMv4 -hI/5bC82rGlD/DAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA9 -D+qoKw0njub+NaFRS2DFbSiKb5JKTxVjU5aNusFONFLSXBuRpnYyjjkXpJy8JMWz -g8GFDEPP6kiSb8xaPNrFcUzb4PFzJabNTuaLJpBpd2gNBj5AeYwwpRa2DPv/b4yw -y2mfULuCWS09ZAguI2OcaARlAsFxYN0IuQ6pN1AvGFGee67ve9l2VF/hhwEi4lCk -MM0CWlP6COJ8TX7X0MTtexVOgo9m3hBuTSYEZClYFIdSOk10xkPl8Y3Iz/x6mzfK -Uu2l2ZtYvSdAX1CQMds3ZWt0ChNNEjOKPv4g2QSDhGkiqrmi4wUS81g68wKqOpqn -GbN8uKxIfyMjqZKaujPR ------END CERTIFICATE----- -` - -module.exports['server.key'] = ` ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAvPM99BkYrBcTM355dhz4XzhSDRGxa9qttUlBSgEsbu2UjsRm -XjDS+60XXd66tWpPwLeUd2uvlC/ltv5ekv+EBu35j1KfA1+K1rtFzb1i40kMCsns -OoXjgpsN2wvkxMdFkT2bkqKCS6X0xzlWea1t4poKh9iG7n3otk4RzPNawfwQ9W5n -o9/8i6AUwDbuK4dhAId/Inw2aKrMyQ+AiSvsDM2wUMq+pV7nP46f7MhR4xiGz14z -ATFdjM3Oo/1NKrr0WgVM6i0eNAtuIDqIs8YE7SfODe/SzpJySxewutfYi62OaLh/ -hmWByj/pF5SoNMLyJHxn4GyKK+Qle9NJAThLiwIDAQABAoIBAQCZs4h/Cvct7etZ -pRUqxnAoDQl5xh28LXvGj1uD1qaNacfBxvO6xR6rSedLHcZlkqBjlTI5XqjJ85h6 -njrSevWsKWMrejsNpGetO1OSA+/wEVixYgY+qPEkKftAZ1Fl3O+zMRlfU8CHxuzy -Lqsweap8fW/5h2JjmJp3ydPjE0aNqpQ+0LtYBBawKDIe2zPNOmTPwz3D8qJNQJKU -Qdj08dO/vPZncllPagGvpqhfv4hMyNChr71eBbEFsi3O5VJxfZyj+fQG0DGocr/y -sV54HtYk5j06wMxZFLQtaJn+1pOXquZMNwodSPnbrR/+CI1SZeB8N6VyqqOdmrDz -5NbfGJiRAoGBAPrCuQxJwgc2MzpEtrXA4+1uuV8QWGy3+wNKxKw4lgyC7peXXrVK -l9FkOOAPr8puPRABgDS9t6vo59BAP3Wrx0oJ9PA/Qn03WYLfJMepWqlK7ni9kS04 -5owRTduK7P190sp0m6iicsnchGSSOchECwB5UmtHysEFiuY0T+0pdNbjAoGBAMDl -57lwZDfNTGGDxLQYVzbrXgKcD60DW9MhvH3uso6cw5NYs3tmENCh9D6YrCNN4PmL -zdp4dKbOFoGJdy22TK31nrezUuNKSK+QKH2gsmNVI+a5QokNO1Cfk+PMLoOR5du2 -nwyVvzdaBwuXU4fhmwvLv/SCFNEJ0EgUILeMETE5AoGBAIwLXf9v3e3bJkb/gy8E -mAbNVLez0D5/ja9r/WTVgW9hXFDLF/iVvS4TE/SGrj2WzYF35RsPbVmUDIrwpsBX -/EfsQaA/JCn8VIBTkR31Bg4QLBjAfijMY22MaHgZIXv83lF1SE2o1ATKpCHqzFx9 -K8vK9e22PZUJPGaOhqjEA13TAoGAEPipSJFw38/6NmInfkjd84EFxmkAoBI5k/vV -36aOoyl7s40MTYEPXavCF3fLPVfuwUXhmKUcbkiXhlIX4De3y15e1n66fjDc8EVY -qqTmzQKCpBwMlI5Ld65yjoo6VW0SsiABIlRSfIY5NHXd7YiV4ZXNj6+aMUIRxyWu -Mzfpk1ECgYBZw8lML+F8XbcmCLGYuicf0V/wgFaJr8nnPeW7AiQrv13Ju1ItEaC8 -Tz8F7OfC+FoUb0MGjXHKquDVBDs4xSuS+Ol+rlZEK68ALpm8sUgp6YjARYiXlprs -6o4kN0P5F+DVU2SP6fo9zKLCxaTH9VAQ9C3VUViGAFLBt4DVDmj77g== ------END RSA PRIVATE KEY----- -` - -module.exports['server.crt'] = ` ------BEGIN CERTIFICATE----- -MIIDNzCCAh8CFBg1Ph5t5rBlAbCrEn/PexNy9WunMA0GCSqGSIb3DQEBCwUAMF0x -CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEQMA4GA1UECgwHTm9kZS5qczERMA8G -A1UECwwIbm9kZS1neXAxHDAaBgNVBAMME25vZGUtZ3lwLm5vZGVqcy5vcmcwHhcN -MjIwNTExMDQyMjI0WhcNMjMwOTIzMDQyMjI0WjBTMQswCQYDVQQGEwJVUzELMAkG -A1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsMCG5vZGUtZ3lwMRIw -EAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQC88z30GRisFxMzfnl2HPhfOFINEbFr2q21SUFKASxu7ZSOxGZeMNL7rRdd3rq1 -ak/At5R3a6+UL+W2/l6S/4QG7fmPUp8DX4rWu0XNvWLjSQwKyew6heOCmw3bC+TE -x0WRPZuSooJLpfTHOVZ5rW3imgqH2Ibufei2ThHM81rB/BD1bmej3/yLoBTANu4r -h2EAh38ifDZoqszJD4CJK+wMzbBQyr6lXuc/jp/syFHjGIbPXjMBMV2Mzc6j/U0q -uvRaBUzqLR40C24gOoizxgTtJ84N79LOknJLF7C619iLrY5ouH+GZYHKP+kXlKg0 -wvIkfGfgbIor5CV700kBOEuLAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAEhaNEye -JsE4eG1xaGmHq7w9eV0neOaZ58XCuF1sSEMIy9uMnl3aOdctxh/1SYkqJyMct79q -Ra2UZ6mauRlOeqdHb+HZKrFYYUOtd1HOWWJ44Gaya2EQMiTbd/Ns9Th2KTbTOCbL -CHFNska9Ty2ioT7VcrVuIEXFPMua5T4lnCkNJQla800pHHOak2baN/c66Io+8XI2 -xiqaVrLT3qvpzdiiEjo4POeRnWMIgJJshy77Am5JlhaJiAqP1AHfh/tYpliGkjXF -8DSgSoLHSQfalJ4VQvP4XLc/XnmF5Zt6bvwUxCllEBFRneU74bW7/euYX/TpYobr -Y+YM7fGiCqwHdUs= ------END CERTIFICATE----- -` - -module.exports['ca-bundle.crt'] = ` ------BEGIN CERTIFICATE----- -MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD -VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n -TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv -bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMBkxFzAV -BgNVBAMMDnN0cm9uZ2xvb3AuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAwOYI7OZ2FX/YjRgLZoDQlbPc5UZXU/j0e1wwiJNPtPEax9Y5Uoza0Pnt -Ikzkc2SfvQ+IJrhXo385tI0W5juuqbHnE7UrjUuPjUX6NHevkxcs/flmjan5wnZM -cPsGhH71WDuUEEflvZihf2Se2x+xgZtMhc5XGmVmRuZFYKvkgUhA2/w8/QrK+jPT -n9QRJxZjWNh2RBdC1B7u4jffSmOSUljYFH1I2eTeY+Rdi6YUIYSU9gEoZxsv3Tia -SomfMF5jt2Mouo6MzA+IhLvvFjcrcph1Qxgi9RkfdCMMd+Ipm9YWELkyG1bDRpQy -0iyHD4gvVsAqz1Y2KdRSdc3Kt+nTqwIDAQABoxkwFzAVBgNVHREEDjAMhwQAAAAA -hwR/AAABMA0GCSqGSIb3DQEBBQUAA4IBAQAhy4J0hML3NgmDRHdL5/iTucBe22Mf -jJjg2aifD1S187dHm+Il4qZNO2plWwAhN0h704f+8wpsaALxUvBIu6nvlvcMP5PH -jGN5JLe2Km3UaPvYOQU2SgacLilu+uBcIo2JSHLV6O7ziqUj5Gior6YxDLCtEZie -Ea8aX5/YjuACtEMJ1JjRqjgkM66XAoUe0E8onOK3FgTIO3tGoTJwRp0zS50pFuP0 -PsZtT04ck6mmXEXXknNoAyBCvPypfms9OHqcUIW9fiQnrGbS/Ri4QSQYj0DtFk/1 -na4fY1gf3zTHxH8259b/TOOaPfTnCEsOQtjUrWNR4xhmVZ+HJy4yytUW ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDbzCCAlcCAmm6MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlVTMQswCQYD -VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n -TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv -bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMH0xCzAJ -BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZ -MBcGA1UECgwQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRow -GAYDVQQDDBFjYS5zdHJvbmdsb29wLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANfj86jkvvYDjHBgiqWhk9Cj+bqiMq3MqnV0CBO4iuK33Fo6XssE -H+yVdXlIBFbFe6t655MdBVOR2Sfj7WqNh96vhu6PyDHiwcQlTaiLU6nhIed1J4Wv -lvnJHFmp8Wbtx5AgLT4UYu03ftvXEl2DLi3vhSL2tRM1ebXHB/KPbRWkb25DPX0P -foOHot3f2dgNe2x6kponf7E/QDmAu3s7Nlkfh+ryDhgGU7wocXEhXbprNqRqOGNo -xbXgUI+/9XDxYT/7Gn5LF/fPjtN+aB0SKMnTsDhprVlZie83mlqJ46fOOrR+vrsQ -mi/1m/TadrARtZoIExC/cQRdVM05EK4tUa8CAwEAATANBgkqhkiG9w0BAQsFAAOC -AQEAQ7k5WhyhDTIGYCNzRnrMHWSzGqa1y4tJMW06wafJNRqTm1cthq1ibc6Hfq5a -K10K0qMcgauRTfQ1MWrVCTW/KnJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae -KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ -YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n -VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ -uGZtfEvhbNm6m2i4UNmpCXxUZQ== ------END CERTIFICATE----- -` diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/nodedir/include/node/config.gypi b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/nodedir/include/node/config.gypi deleted file mode 100644 index e76753408..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/nodedir/include/node/config.gypi +++ /dev/null @@ -1,6 +0,0 @@ -# Test configuration -{ - 'variables': { - 'build_with_electron': true - } -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/test-charmap.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/test-charmap.py deleted file mode 100644 index 63aa77bb4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/fixtures/test-charmap.py +++ /dev/null @@ -1,31 +0,0 @@ -import sys -import locale - -try: - reload(sys) -except NameError: # Python 3 - pass - - -def main(): - encoding = locale.getdefaultlocale()[1] - if not encoding: - return False - - try: - sys.setdefaultencoding(encoding) - except AttributeError: # Python 3 - pass - - textmap = { - "cp936": "\u4e2d\u6587", - "cp1252": "Lat\u012Bna", - "cp932": "\u306b\u307b\u3093\u3054", - } - if encoding in textmap: - print(textmap[encoding]) - return True - - -if __name__ == "__main__": - print(main()) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/process-exec-sync.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/process-exec-sync.js deleted file mode 100644 index 21763bc26..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/process-exec-sync.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const childProcess = require('child_process') - -function startsWith (str, search, pos) { - if (String.prototype.startsWith) { - return str.startsWith(search, pos) - } - - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search -} - -function processExecSync (file, args, options) { - var child, error, timeout, tmpdir, command - command = makeCommand(file, args) - - /* - this function emulates child_process.execSync for legacy node <= 0.10.x - derived from https://github.com/gvarsanyi/sync-exec/blob/master/js/sync-exec.js - */ - - options = options || {} - // init timeout - timeout = Date.now() + options.timeout - // init tmpdir - var osTempBase = '/tmp' - var os = determineOS() - osTempBase = '/tmp' - - if (process.env.TMP) { - osTempBase = process.env.TMP - } - - if (osTempBase[osTempBase.length - 1] !== '/') { - osTempBase += '/' - } - - tmpdir = osTempBase + 'processExecSync.' + Date.now() + Math.random() - fs.mkdirSync(tmpdir) - - // init command - if (os === 'linux') { - command = '(' + command + ' > ' + tmpdir + '/stdout 2> ' + tmpdir + - '/stderr); echo $? > ' + tmpdir + '/status' - } else { - command = '(' + command + ' > ' + tmpdir + '/stdout 2> ' + tmpdir + - '/stderr) | echo %errorlevel% > ' + tmpdir + '/status | exit' - } - - // init child - child = childProcess.exec(command, options) - - var maxTry = 100000 // increases the test time by 6 seconds on win-2016-node-0.10 - var tryCount = 0 - while (tryCount < maxTry) { - try { - var x = fs.readFileSync(tmpdir + '/status') - if (x.toString() === '0') { - break - } - } catch (ignore) {} - tryCount++ - if (Date.now() > timeout) { - error = child - break - } - } - - ['stdout', 'stderr', 'status'].forEach(function (file) { - child[file] = fs.readFileSync(tmpdir + '/' + file, options.encoding) - setTimeout(unlinkFile, 500, tmpdir + '/' + file) - }) - - child.status = Number(child.status) - if (child.status !== 0) { - error = child - } - - try { - fs.rmdirSync(tmpdir) - } catch (ignore) {} - if (error) { - throw error - } - return child.stdout -} - -function makeCommand (file, args) { - var command, quote - command = file - if (args.length > 0) { - for (var i in args) { - command = command + ' ' - if (args[i][0] === '-') { - command = command + args[i] - } else { - if (!quote) { - command = command + '"' - quote = true - } - command = command + args[i] - if (quote) { - if (args.length === (parseInt(i) + 1)) { - command = command + '"' - } - } - } - } - } - return command -} - -function determineOS () { - var os = '' - var tmpVar = '' - if (process.env.OSTYPE) { - tmpVar = process.env.OSTYPE - } else if (process.env.OS) { - tmpVar = process.env.OS - } else { - // default is linux - tmpVar = 'linux' - } - - if (startsWith(tmpVar, 'linux')) { - os = 'linux' - } - if (startsWith(tmpVar, 'win')) { - os = 'win' - } - - return os -} - -function unlinkFile (file) { - fs.unlinkSync(file) -} - -module.exports = processExecSync diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/simple-proxy.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/simple-proxy.js deleted file mode 100644 index cb0dfcfec..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/simple-proxy.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' - -const http = require('http') -const https = require('https') -const server = http.createServer(handler) -const port = +process.argv[2] -const prefix = process.argv[3] -const upstream = process.argv[4] -var calls = 0 - -server.listen(port) - -function handler (req, res) { - if (req.url.indexOf(prefix) !== 0) { - throw new Error('request url [' + req.url + '] does not start with [' + prefix + ']') - } - - var upstreamUrl = upstream + req.url.substring(prefix.length) - https.get(upstreamUrl, function (ures) { - ures.on('end', function () { - if (++calls === 2) { - server.close() - } - }) - ures.pipe(res) - }) -} diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-addon.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-addon.js deleted file mode 100644 index f79eff73c..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-addon.js +++ /dev/null @@ -1,150 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const fs = require('graceful-fs') -const childProcess = require('child_process') -const os = require('os') -const addonPath = path.resolve(__dirname, 'node_modules', 'hello_world') -const nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js') -const execFileSync = childProcess.execFileSync || require('./process-exec-sync') -const execFile = childProcess.execFile - -function runHello (hostProcess) { - if (!hostProcess) { - hostProcess = process.execPath - } - var testCode = "console.log(require('hello_world').hello())" - return execFileSync(hostProcess, ['-e', testCode], { cwd: __dirname }).toString() -} - -function getEncoding () { - var code = 'import locale;print(locale.getdefaultlocale()[1])' - return execFileSync('python', ['-c', code]).toString().trim() -} - -function checkCharmapValid () { - var data - try { - data = execFileSync('python', ['fixtures/test-charmap.py'], - { cwd: __dirname }) - } catch (err) { - return false - } - var lines = data.toString().trim().split('\n') - return lines.pop() === 'True' -} - -test('build simple addon', function (t) { - t.plan(3) - - // Set the loglevel otherwise the output disappears when run via 'npm test' - var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - var logLines = stderr.toString().trim().split(/\r?\n/) - var lastLine = logLines[logLines.length - 1] - t.strictEqual(err, null) - t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') - t.strictEqual(runHello().trim(), 'world') - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') -}) - -test('build simple addon in path with non-ascii characters', function (t) { - t.plan(1) - - if (!checkCharmapValid()) { - return t.skip('python console app can\'t encode non-ascii character.') - } - - var testDirNames = { - cp936: '文件夹', - cp1252: 'Latīna', - cp932: 'フォルダ' - } - // Select non-ascii characters by current encoding - var testDirName = testDirNames[getEncoding()] - // If encoding is UTF-8 or other then no need to test - if (!testDirName) { - return t.skip('no need to test') - } - - t.plan(3) - - var data - var configPath = path.join(addonPath, 'build', 'config.gypi') - try { - data = fs.readFileSync(configPath, 'utf8') - } catch (err) { - t.error(err) - return - } - var config = JSON.parse(data.replace(/#.+\n/, '')) - var nodeDir = config.variables.nodedir - var testNodeDir = path.join(addonPath, testDirName) - // Create symbol link to path with non-ascii characters - try { - fs.symlinkSync(nodeDir, testNodeDir, 'dir') - } catch (err) { - switch (err.code) { - case 'EEXIST': break - case 'EPERM': - t.error(err, 'Please try to running console as an administrator') - return - default: - t.error(err) - return - } - } - - var cmd = [ - nodeGyp, - 'rebuild', - '-C', - addonPath, - '--loglevel=verbose', - '-nodedir=' + testNodeDir - ] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - try { - fs.unlink(testNodeDir) - } catch (err) { - t.error(err) - } - - var logLines = stderr.toString().trim().split(/\r?\n/) - var lastLine = logLines[logLines.length - 1] - t.strictEqual(err, null) - t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') - t.strictEqual(runHello().trim(), 'world') - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') -}) - -test('addon works with renamed host executable', function (t) { - // No `fs.copyFileSync` before node8. - if (process.version.substr(1).split('.')[0] < 8) { - t.skip('skipping test for old node version') - t.end() - return - } - - t.plan(3) - - var notNodePath = path.join(os.tmpdir(), 'notnode' + path.extname(process.execPath)) - fs.copyFileSync(process.execPath, notNodePath) - - var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] - var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { - var logLines = stderr.toString().trim().split(/\r?\n/) - var lastLine = logLines[logLines.length - 1] - t.strictEqual(err, null) - t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') - t.strictEqual(runHello(notNodePath).trim(), 'world') - fs.unlinkSync(notNodePath) - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-configure-python.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-configure-python.js deleted file mode 100644 index aacd75f7c..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-configure-python.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const devDir = require('./common').devDir() -const gyp = require('../lib/node-gyp') -const requireInject = require('require-inject') -const configure = requireInject('../lib/configure', { - 'graceful-fs': { - openSync: function () { return 0 }, - closeSync: function () { }, - writeFile: function (file, data, cb) { cb() }, - stat: function (file, cb) { cb(null, {}) }, - mkdir: function (dir, options, cb) { cb() }, - promises: { - writeFile: function (file, data) { return Promise.resolve(null) } - }, - unlink: function (path, cb) { cb() }, - symlink: function (target, path, cb) { cb() } - } -}) - -const EXPECTED_PYPATH = path.join(__dirname, '..', 'gyp', 'pylib') -const SEPARATOR = process.platform === 'win32' ? ';' : ':' -const SPAWN_RESULT = { on: function () { } } - -require('npmlog').level = 'warn' - -test('configure PYTHONPATH with no existing env', function (t) { - t.plan(1) - - delete process.env.PYTHONPATH - - var prog = gyp() - prog.parseArgv([]) - prog.spawn = function () { - t.equal(process.env.PYTHONPATH, EXPECTED_PYPATH) - return SPAWN_RESULT - } - prog.devDir = devDir - configure(prog, [], t.fail) -}) - -test('configure PYTHONPATH with existing env of one dir', function (t) { - t.plan(2) - - var existingPath = path.join('a', 'b') - process.env.PYTHONPATH = existingPath - - var prog = gyp() - prog.parseArgv([]) - prog.spawn = function () { - t.equal(process.env.PYTHONPATH, [EXPECTED_PYPATH, existingPath].join(SEPARATOR)) - - var dirs = process.env.PYTHONPATH.split(SEPARATOR) - t.deepEqual(dirs, [EXPECTED_PYPATH, existingPath]) - - return SPAWN_RESULT - } - prog.devDir = devDir - configure(prog, [], t.fail) -}) - -test('configure PYTHONPATH with existing env of multiple dirs', function (t) { - t.plan(2) - - var pythonDir1 = path.join('a', 'b') - var pythonDir2 = path.join('b', 'c') - var existingPath = [pythonDir1, pythonDir2].join(SEPARATOR) - process.env.PYTHONPATH = existingPath - - var prog = gyp() - prog.parseArgv([]) - prog.spawn = function () { - t.equal(process.env.PYTHONPATH, [EXPECTED_PYPATH, existingPath].join(SEPARATOR)) - - var dirs = process.env.PYTHONPATH.split(SEPARATOR) - t.deepEqual(dirs, [EXPECTED_PYPATH, pythonDir1, pythonDir2]) - - return SPAWN_RESULT - } - prog.devDir = devDir - configure(prog, [], t.fail) -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-create-config-gypi.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-create-config-gypi.js deleted file mode 100644 index eeac73fab..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-create-config-gypi.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -const path = require('path') -const { test } = require('tap') -const gyp = require('../lib/node-gyp') -const createConfigGypi = require('../lib/create-config-gypi') -const { parseConfigGypi, getCurrentConfigGypi } = createConfigGypi.test - -test('config.gypi with no options', async function (t) { - t.plan(2) - - const prog = gyp() - prog.parseArgv([]) - - const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) - t.equal(config.target_defaults.default_configuration, 'Release') - t.equal(config.variables.target_arch, process.arch) -}) - -test('config.gypi with --debug', async function (t) { - t.plan(1) - - const prog = gyp() - prog.parseArgv(['_', '_', '--debug']) - - const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) - t.equal(config.target_defaults.default_configuration, 'Debug') -}) - -test('config.gypi with custom options', async function (t) { - t.plan(1) - - const prog = gyp() - prog.parseArgv(['_', '_', '--shared-libxml2']) - - const config = await getCurrentConfigGypi({ gyp: prog, vsInfo: {} }) - t.equal(config.variables.shared_libxml2, true) -}) - -test('config.gypi with nodedir', async function (t) { - t.plan(1) - - const nodeDir = path.join(__dirname, 'fixtures', 'nodedir') - - const prog = gyp() - prog.parseArgv(['_', '_', `--nodedir=${nodeDir}`]) - - const config = await getCurrentConfigGypi({ gyp: prog, nodeDir, vsInfo: {} }) - t.equal(config.variables.build_with_electron, true) -}) - -test('config.gypi with --force-process-config', async function (t) { - t.plan(1) - - const nodeDir = path.join(__dirname, 'fixtures', 'nodedir') - - const prog = gyp() - prog.parseArgv(['_', '_', '--force-process-config', `--nodedir=${nodeDir}`]) - - const config = await getCurrentConfigGypi({ gyp: prog, nodeDir, vsInfo: {} }) - t.equal(config.variables.build_with_electron, undefined) -}) - -test('config.gypi parsing', function (t) { - t.plan(1) - - const str = "# Some comments\n{'variables': {'multiline': 'A'\n'B'}}" - const config = parseConfigGypi(str) - t.deepEqual(config, { variables: { multiline: 'AB' } }) -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-download.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-download.js deleted file mode 100644 index c4caad9e8..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-download.js +++ /dev/null @@ -1,217 +0,0 @@ -'use strict' - -const { test } = require('tap') -const fs = require('fs') -const path = require('path') -const util = require('util') -const http = require('http') -const https = require('https') -const install = require('../lib/install') -const semver = require('semver') -const devDir = require('./common').devDir() -const rimraf = require('rimraf') -const gyp = require('../lib/node-gyp') -const log = require('npmlog') -const certs = require('./fixtures/certs') - -log.level = 'warn' - -test('download over http', async (t) => { - t.plan(2) - - const server = http.createServer((req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('ok') - }) - - t.tearDown(() => new Promise((resolve) => server.close(resolve))) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - const gyp = { - opts: {}, - version: '42' - } - const url = `http://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'ok') -}) - -test('download over https with custom ca', async (t) => { - t.plan(3) - - const cafile = path.join(__dirname, 'fixtures/ca.crt') - const cacontents = certs['ca.crt'] - const cert = certs['server.crt'] - const key = certs['server.key'] - await fs.promises.writeFile(cafile, cacontents, 'utf8') - const ca = await install.test.readCAFile(cafile) - - t.strictEqual(ca.length, 1) - - const options = { ca: ca, cert: cert, key: key } - const server = https.createServer(options, (req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('ok') - }) - - t.tearDown(async () => { - await new Promise((resolve) => server.close(resolve)) - await fs.promises.unlink(cafile) - }) - - server.on('clientError', (err) => { throw err }) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - const gyp = { - opts: { cafile }, - version: '42' - } - const url = `https://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'ok') -}) - -test('download over http with proxy', async (t) => { - t.plan(2) - - const server = http.createServer((_, res) => { - res.end('ok') - }) - - const pserver = http.createServer((req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('proxy ok') - }) - - t.tearDown(() => Promise.all([ - new Promise((resolve) => server.close(resolve)), - new Promise((resolve) => pserver.close(resolve)) - ])) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - await new Promise((resolve) => pserver.listen(port + 1, host, resolve)) - const gyp = { - opts: { - proxy: `http://${host}:${port + 1}`, - noproxy: 'bad' - }, - version: '42' - } - const url = `http://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'proxy ok') -}) - -test('download over http with noproxy', async (t) => { - t.plan(2) - - const server = http.createServer((req, res) => { - t.strictEqual(req.headers['user-agent'], `node-gyp v42 (node ${process.version})`) - res.end('ok') - }) - - const pserver = http.createServer((_, res) => { - res.end('proxy ok') - }) - - t.tearDown(() => Promise.all([ - new Promise((resolve) => server.close(resolve)), - new Promise((resolve) => pserver.close(resolve)) - ])) - - const host = 'localhost' - await new Promise((resolve) => server.listen(0, host, resolve)) - const { port } = server.address() - await new Promise((resolve) => pserver.listen(port + 1, host, resolve)) - const gyp = { - opts: { - proxy: `http://${host}:${port + 1}`, - noproxy: host - }, - version: '42' - } - const url = `http://${host}:${port}` - const res = await install.test.download(gyp, url) - t.strictEqual(await res.text(), 'ok') -}) - -test('download with missing cafile', async (t) => { - t.plan(1) - const gyp = { - opts: { cafile: 'no.such.file' } - } - try { - await install.test.download(gyp, {}, 'http://bad/') - } catch (e) { - t.ok(/no.such.file/.test(e.message)) - } -}) - -test('check certificate splitting', async (t) => { - const cafile = path.join(__dirname, 'fixtures/ca-bundle.crt') - const cacontents = certs['ca-bundle.crt'] - await fs.promises.writeFile(cafile, cacontents, 'utf8') - t.tearDown(async () => { - await fs.promises.unlink(cafile) - }) - const cas = await install.test.readCAFile(path.join(__dirname, 'fixtures/ca-bundle.crt')) - t.plan(2) - t.strictEqual(cas.length, 2) - t.notStrictEqual(cas[0], cas[1]) -}) - -// only run this test if we are running a version of Node with predictable version path behavior - -test('download headers (actual)', async (t) => { - if (process.env.FAST_TEST || - process.release.name !== 'node' || - semver.prerelease(process.version) !== null || - semver.satisfies(process.version, '<10')) { - return t.skip('Skipping actual download of headers due to test environment configuration') - } - - t.plan(12) - - const expectedDir = path.join(devDir, process.version.replace(/^v/, '')) - await util.promisify(rimraf)(expectedDir) - - const prog = gyp() - prog.parseArgv([]) - prog.devDir = devDir - log.level = 'warn' - await util.promisify(install)(prog, []) - - const data = await fs.promises.readFile(path.join(expectedDir, 'installVersion'), 'utf8') - t.strictEqual(data, '9\n', 'correct installVersion') - - const list = await fs.promises.readdir(path.join(expectedDir, 'include/node')) - t.ok(list.includes('common.gypi')) - t.ok(list.includes('config.gypi')) - t.ok(list.includes('node.h')) - t.ok(list.includes('node_version.h')) - t.ok(list.includes('openssl')) - t.ok(list.includes('uv')) - t.ok(list.includes('uv.h')) - t.ok(list.includes('v8-platform.h')) - t.ok(list.includes('v8.h')) - t.ok(list.includes('zlib.h')) - - const lines = (await fs.promises.readFile(path.join(expectedDir, 'include/node/node_version.h'), 'utf8')).split('\n') - - // extract the 3 version parts from the defines to build a valid version string and - // and check them against our current env version - const version = ['major', 'minor', 'patch'].reduce((version, type) => { - const re = new RegExp(`^#define\\sNODE_${type.toUpperCase()}_VERSION`) - const line = lines.find((l) => re.test(l)) - const i = line ? parseInt(line.replace(/^[^0-9]+([0-9]+).*$/, '$1'), 10) : 'ERROR' - return `${version}${type !== 'major' ? '.' : 'v'}${i}` - }, '') - - t.strictEqual(version, process.version) -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-accessible-sync.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-accessible-sync.js deleted file mode 100644 index 0a2e584c4..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-accessible-sync.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const requireInject = require('require-inject') -const configure = requireInject('../lib/configure', { - 'graceful-fs': { - closeSync: function () { return undefined }, - openSync: function (path) { - if (readableFiles.some(function (f) { return f === path })) { - return 0 - } else { - var error = new Error('ENOENT - not found') - throw error - } - } - } -}) - -const dir = path.sep + 'testdir' -const readableFile = 'readable_file' -const anotherReadableFile = 'another_readable_file' -const readableFileInDir = 'somedir' + path.sep + readableFile -const readableFiles = [ - path.resolve(dir, readableFile), - path.resolve(dir, anotherReadableFile), - path.resolve(dir, readableFileInDir) -] - -test('find accessible - empty array', function (t) { - t.plan(1) - - var candidates = [] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, undefined) -}) - -test('find accessible - single item array, readable', function (t) { - t.plan(1) - - var candidates = [readableFile] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, readableFile)) -}) - -test('find accessible - single item array, readable in subdir', function (t) { - t.plan(1) - - var candidates = [readableFileInDir] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, readableFileInDir)) -}) - -test('find accessible - single item array, unreadable', function (t) { - t.plan(1) - - var candidates = ['unreadable_file'] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, undefined) -}) - -test('find accessible - multi item array, no matches', function (t) { - t.plan(1) - - var candidates = ['non_existent_file', 'unreadable_file'] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, undefined) -}) - -test('find accessible - multi item array, single match', function (t) { - t.plan(1) - - var candidates = ['non_existent_file', readableFile] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, readableFile)) -}) - -test('find accessible - multi item array, return first match', function (t) { - t.plan(1) - - var candidates = ['non_existent_file', anotherReadableFile, readableFile] - var found = configure.test.findAccessibleSync('test', dir, candidates) - t.strictEqual(found, path.resolve(dir, anotherReadableFile)) -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-node-directory.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-node-directory.js deleted file mode 100644 index fa6223c65..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-node-directory.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict' - -const test = require('tap').test -const path = require('path') -const findNodeDirectory = require('../lib/find-node-directory') - -const platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix', 'os400'] - -// we should find the directory based on the directory -// the script is running in and it should match the layout -// in a build tree where npm is installed in -// .... /deps/npm -test('test find-node-directory - node install', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - t.equal( - findNodeDirectory('/x/deps/npm/node_modules/node-gyp/lib', processObj), - path.join('/x')) - } -}) - -// we should find the directory based on the directory -// the script is running in and it should match the layout -// in an installed tree where npm is installed in -// .... /lib/node_modules/npm or .../node_modules/npm -// depending on the patform -test('test find-node-directory - node build', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - if (platforms[next] === 'win32') { - t.equal( - findNodeDirectory('/y/node_modules/npm/node_modules/node-gyp/lib', - processObj), path.join('/y')) - } else { - t.equal( - findNodeDirectory('/y/lib/node_modules/npm/node_modules/node-gyp/lib', - processObj), path.join('/y')) - } - } -}) - -// we should find the directory based on the execPath -// for node and match because it was in the bin directory -test('test find-node-directory - node in bin directory', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - t.equal( - findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), - path.join('/x/y')) - } -}) - -// we should find the directory based on the execPath -// for node and match because it was in the Release directory -test('test find-node-directory - node in build release dir', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj - if (platforms[next] === 'win32') { - processObj = { execPath: '/x/y/Release/node', platform: platforms[next] } - } else { - processObj = { - execPath: '/x/y/out/Release/node', - platform: platforms[next] - } - } - - t.equal( - findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), - path.join('/x/y')) - } -}) - -// we should find the directory based on the execPath -// for node and match because it was in the Debug directory -test('test find-node-directory - node in Debug release dir', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj - if (platforms[next] === 'win32') { - processObj = { execPath: '/a/b/Debug/node', platform: platforms[next] } - } else { - processObj = { execPath: '/a/b/out/Debug/node', platform: platforms[next] } - } - - t.equal( - findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), - path.join('/a/b')) - } -}) - -// we should not find it as it will not match based on the execPath nor -// the directory from which the script is running -test('test find-node-directory - not found', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/z/y', platform: next } - t.equal(findNodeDirectory('/a/b/c/d', processObj), '') - } -}) - -// we should find the directory based on the directory -// the script is running in and it should match the layout -// in a build tree where npm is installed in -// .... /deps/npm -// same test as above but make sure additional directory entries -// don't cause an issue -test('test find-node-directory - node install', function (t) { - t.plan(platforms.length) - for (var next = 0; next < platforms.length; next++) { - var processObj = { execPath: '/x/y/bin/node', platform: platforms[next] } - t.equal( - findNodeDirectory('/x/y/z/a/b/c/deps/npm/node_modules/node-gyp/lib', - processObj), path.join('/x/y/z/a/b/c')) - } -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-python.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-python.js deleted file mode 100644 index 67d0b2664..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-python.js +++ /dev/null @@ -1,226 +0,0 @@ -'use strict' - -delete process.env.PYTHON - -const test = require('tap').test -const findPython = require('../lib/find-python') -const execFile = require('child_process').execFile -const PythonFinder = findPython.test.PythonFinder - -require('npmlog').level = 'warn' - -test('find python', function (t) { - t.plan(4) - - findPython.test.findPython(null, function (err, found) { - t.strictEqual(err, null) - var proc = execFile(found, ['-V'], function (err, stdout, stderr) { - t.strictEqual(err, null) - t.ok(/Python 3/.test(stdout)) - t.strictEqual(stderr, '') - }) - proc.stdout.setEncoding('utf-8') - proc.stderr.setEncoding('utf-8') - }) -}) - -function poison (object, property) { - function fail () { - console.error(Error(`Property ${property} should not have been accessed.`)) - process.abort() - } - var descriptor = { - configurable: false, - enumerable: false, - get: fail, - set: fail - } - Object.defineProperty(object, property, descriptor) -} - -function TestPythonFinder () { - PythonFinder.apply(this, arguments) -} -TestPythonFinder.prototype = Object.create(PythonFinder.prototype) -// Silence npmlog - remove for debugging -TestPythonFinder.prototype.log = { - silly: () => {}, - verbose: () => {}, - info: () => {}, - warn: () => {}, - error: () => {} -} -delete TestPythonFinder.prototype.env.NODE_GYP_FORCE_PYTHON - -test('find python - python', function (t) { - t.plan(6) - - var f = new TestPythonFinder('python', done) - f.execFile = function (program, args, opts, cb) { - f.execFile = function (program, args, opts, cb) { - poison(f, 'execFile') - t.strictEqual(program, '/path/python') - t.ok(/sys\.version_info/.test(args[1])) - cb(null, '3.9.1') - } - t.strictEqual(program, - process.platform === 'win32' ? '"python"' : 'python') - t.ok(/sys\.executable/.test(args[1])) - cb(null, '/path/python') - } - f.findPython() - - function done (err, python) { - t.strictEqual(err, null) - t.strictEqual(python, '/path/python') - } -}) - -test('find python - python too old', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(null, '/path/python') - } else if (/sys\.version_info/.test(args[args.length - 1])) { - cb(null, '2.3.4') - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not supported/i.test(f.errorLog)) - } -}) - -test('find python - no python', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (/sys\.version_info/.test(args[args.length - 1])) { - cb(new Error('not a Python executable')) - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not in PATH/.test(f.errorLog)) - } -}) - -test('find python - no python2, no python, unix', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.checkPyLauncher = t.fail - f.win = false - - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not in PATH/.test(f.errorLog)) - } -}) - -test('find python - no python, use python launcher', function (t) { - t.plan(4) - - var f = new TestPythonFinder(null, done) - f.win = true - - f.execFile = function (program, args, opts, cb) { - if (program === 'py.exe') { - t.notEqual(args.indexOf('-3'), -1) - t.notEqual(args.indexOf('-c'), -1) - return cb(null, 'Z:\\snake.exe') - } - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (f.winDefaultLocations.includes(program)) { - cb(new Error('not found')) - } else if (/sys\.version_info/.test(args[args.length - 1])) { - if (program === 'Z:\\snake.exe') { - cb(null, '3.9.0') - } else { - t.fail() - } - } else { - t.fail() - } - } - f.findPython() - - function done (err, python) { - t.strictEqual(err, null) - t.strictEqual(python, 'Z:\\snake.exe') - } -}) - -test('find python - no python, no python launcher, good guess', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.win = true - const expectedProgram = f.winDefaultLocations[0] - - f.execFile = function (program, args, opts, cb) { - if (program === 'py.exe') { - return cb(new Error('not found')) - } - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (program === expectedProgram && - /sys\.version_info/.test(args[args.length - 1])) { - cb(null, '3.7.3') - } else { - t.fail() - } - } - f.findPython() - - function done (err, python) { - t.strictEqual(err, null) - t.ok(python === expectedProgram) - } -}) - -test('find python - no python, no python launcher, bad guess', function (t) { - t.plan(2) - - var f = new TestPythonFinder(null, done) - f.win = true - - f.execFile = function (program, args, opts, cb) { - if (/sys\.executable/.test(args[args.length - 1])) { - cb(new Error('not found')) - } else if (/sys\.version_info/.test(args[args.length - 1])) { - cb(new Error('not a Python executable')) - } else { - t.fail() - } - } - f.findPython() - - function done (err) { - t.ok(/Could not find any Python/.test(err)) - t.ok(/not in PATH/.test(f.errorLog)) - } -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-visualstudio.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-visualstudio.js deleted file mode 100644 index 1327cf884..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-find-visualstudio.js +++ /dev/null @@ -1,676 +0,0 @@ -'use strict' - -const test = require('tap').test -const fs = require('fs') -const path = require('path') -const findVisualStudio = require('../lib/find-visualstudio') -const VisualStudioFinder = findVisualStudio.test.VisualStudioFinder - -const semverV1 = { major: 1, minor: 0, patch: 0 } - -delete process.env.VCINSTALLDIR - -function poison (object, property) { - function fail () { - console.error(Error(`Property ${property} should not have been accessed.`)) - process.abort() - } - var descriptor = { - configurable: false, - enumerable: false, - get: fail, - set: fail - } - Object.defineProperty(object, property, descriptor) -} - -function TestVisualStudioFinder () { VisualStudioFinder.apply(this, arguments) } -TestVisualStudioFinder.prototype = Object.create(VisualStudioFinder.prototype) -// Silence npmlog - remove for debugging -TestVisualStudioFinder.prototype.log = { - silly: () => {}, - verbose: () => {}, - info: () => {}, - warn: () => {}, - error: () => {} -} - -test('VS2013', function (t) { - t.plan(4) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\MSBuild12\\MSBuild.exe', - path: 'C:\\VS2013', - sdk: null, - toolset: 'v120', - version: '12.0', - versionMajor: 12, - versionMinor: 0, - versionYear: 2013 - }) - }) - - finder.findVisualStudio2017OrNewer = (cb) => { - finder.parseData(new Error(), '', '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - continue - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\VS2013\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\12.0\\MSBuildToolsPath': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\MSBuild12\\') - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } - finder.findVisualStudio() -}) - -test('VS2013 should not be found on new node versions', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder({ - major: 10, - minor: 0, - patch: 0 - }, null, (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', 'VS_2017_Unusable.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - continue - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } - finder.findVisualStudio() -}) - -test('VS2015', function (t) { - t.plan(4) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\MSBuild14\\MSBuild.exe', - path: 'C:\\VS2015', - sdk: null, - toolset: 'v140', - version: '14.0', - versionMajor: 14, - versionMinor: 0, - versionYear: 2015 - }) - }) - - finder.findVisualStudio2017OrNewer = (cb) => { - finder.parseData(new Error(), '', '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\VS2015\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\14.0\\MSBuildToolsPath': - t.pass(`expected search for registry value ${fullName}`) - return cb(null, 'C:\\MSBuild14\\') - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } - finder.findVisualStudio() -}) - -test('error from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(new Error(), '', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('empty output from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, '', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('output from PowerShell not JSON', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, 'AAAABBBB', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('wrong JSON from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, '{}', '', (info) => { - t.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('empty JSON from PowerShell', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, '[]', '', (info) => { - t.ok(/find .* Visual Studio/i.test(finder.errorLog[0]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('future version', function (t) { - t.plan(3) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - finder.parseData(null, JSON.stringify([{ - packages: [ - 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', - 'Microsoft.VisualStudio.Component.Windows10SDK.17763', - 'Microsoft.VisualStudio.VC.MSBuild.Base' - ], - path: 'C:\\VS', - version: '9999.9999.9999.9999' - }]), '', (info) => { - t.ok(/unknown version/i.test(finder.errorLog[0]), 'expect error') - t.ok(/find .* Visual Studio/i.test(finder.errorLog[1]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('single unusable VS2017', function (t) { - t.plan(3) - - const finder = new TestVisualStudioFinder(semverV1, null, null) - - const file = path.join(__dirname, 'fixtures', 'VS_2017_Unusable.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', (info) => { - t.ok(/checking/i.test(finder.errorLog[0]), 'expect error') - t.ok(/find .* Visual Studio/i.test(finder.errorLog[2]), 'expect error') - t.false(info, 'no data') - }) -}) - -test('minimal VS2017 Build Tools', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\' + - 'BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools', - sdk: '10.0.17134.0', - toolset: 'v141', - version: '15.9.28307.665', - versionMajor: 15, - versionMinor: 9, - versionYear: 2017 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2017_BuildTools_minimal.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2017 Community with C++ workload', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\' + - 'Community\\MSBuild\\15.0\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community', - sdk: '10.0.17763.0', - toolset: 'v141', - version: '15.9.28307.665', - versionMajor: 15, - versionMinor: 9, - versionYear: 2017 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2017_Community_workload.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2017 Express', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\' + - 'WDExpress\\MSBuild\\15.0\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\WDExpress', - sdk: '10.0.17763.0', - toolset: 'v141', - version: '15.9.28307.858', - versionMajor: 15, - versionMinor: 9, - versionYear: 2017 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', 'VS_2017_Express.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2019 Preview with C++ workload', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + - 'Preview\\MSBuild\\Current\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview', - sdk: '10.0.17763.0', - toolset: 'v142', - version: '16.0.28608.199', - versionMajor: 16, - versionMinor: 0, - versionYear: 2019 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2019_Preview.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('minimal VS2019 Build Tools', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + - 'BuildTools\\MSBuild\\Current\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools', - sdk: '10.0.17134.0', - toolset: 'v142', - version: '16.1.28922.388', - versionMajor: 16, - versionMinor: 1, - versionYear: 2019 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2019_BuildTools_minimal.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -test('VS2019 Community with C++ workload', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info, { - msBuild: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\' + - 'Community\\MSBuild\\Current\\Bin\\MSBuild.exe', - path: - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community', - sdk: '10.0.17763.0', - toolset: 'v142', - version: '16.1.28922.388', - versionMajor: 16, - versionMinor: 1, - versionYear: 2019 - }) - }) - - poison(finder, 'regSearchKeys') - finder.findVisualStudio2017OrNewer = (cb) => { - const file = path.join(__dirname, 'fixtures', - 'VS_2019_Community_workload.txt') - const data = fs.readFileSync(file) - finder.parseData(null, data, '', cb) - } - finder.findVisualStudio() -}) - -function allVsVersions (t, finder) { - finder.findVisualStudio2017OrNewer = (cb) => { - const data0 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_Unusable.txt'))) - const data1 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_BuildTools_minimal.txt'))) - const data2 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_Community_workload.txt'))) - const data3 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2017_Express.txt'))) - const data4 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2019_Preview.txt'))) - const data5 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2019_BuildTools_minimal.txt'))) - const data6 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures', - 'VS_2019_Community_workload.txt'))) - const data = JSON.stringify(data0.concat(data1, data2, data3, data4, - data5, data6)) - finder.parseData(null, data, '', cb) - } - finder.regSearchKeys = (keys, value, addOpts, cb) => { - for (var i = 0; i < keys.length; ++i) { - const fullName = `${keys[i]}\\${value}` - switch (fullName) { - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - case 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0': - continue - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\12.0': - return cb(null, 'C:\\VS2013\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\12.0\\MSBuildToolsPath': - return cb(null, 'C:\\MSBuild12\\') - case 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7\\14.0': - return cb(null, 'C:\\VS2015\\VC\\') - case 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions\\14.0\\MSBuildToolsPath': - return cb(null, 'C:\\MSBuild14\\') - default: - t.fail(`unexpected search for registry value ${fullName}`) - } - } - return cb(new Error()) - } -} - -test('fail when looking for invalid path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, 'AABB', (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2013 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2013', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2013) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2013 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2013', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2013') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2015 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2015', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2015) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2015 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2015', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2015') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2017 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2017', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2017) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2017 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2019 by version number', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, '2019', (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2019) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('look for VS2019 by installation path', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('msvs_version match should be case insensitive', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, - 'c:\\program files (x86)\\microsoft visual studio\\2019\\BUILDTOOLS', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('latest version should be found by default', function (t) { - t.plan(2) - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.versionYear, 2019) - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a usable VS Command Prompt', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = 'C:\\VS2015\\VC' - // VSINSTALLDIR is not defined on Visual C++ Build Tools 2015 - delete process.env.VSINSTALLDIR - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2015') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('VCINSTALLDIR match should be case insensitive', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = - 'c:\\program files (x86)\\microsoft visual studio\\2019\\BUILDTOOLS\\VC' - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a unusable VS Command Prompt', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildToolsUnusable\\VC' - - const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a VS Command Prompt with matching msvs_version', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = 'C:\\VS2015\\VC' - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2015', - (err, info) => { - t.strictEqual(err, null) - t.deepEqual(info.path, 'C:\\VS2015') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) - -test('run on a VS Command Prompt with mismatched msvs_version', function (t) { - t.plan(2) - - process.env.VCINSTALLDIR = - 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC' - - const finder = new TestVisualStudioFinder(semverV1, 'C:\\VS2015', - (err, info) => { - t.ok(/find .* Visual Studio/i.test(err), 'expect error') - t.false(info, 'no data') - }) - - allVsVersions(t, finder) - finder.findVisualStudio() -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-install.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-install.js deleted file mode 100644 index 5039dc992..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-install.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' - -const { test } = require('tap') -const { test: { install } } = require('../lib/install') -const log = require('npmlog') - -log.level = 'error' // we expect a warning - -test('EACCES retry once', async (t) => { - t.plan(3) - - const fs = { - promises: { - stat (_) { - const err = new Error() - err.code = 'EACCES' - t.ok(true) - throw err - } - } - } - - const Gyp = { - devDir: __dirname, - opts: { - ensure: true - }, - commands: { - install (argv, cb) { - install(fs, Gyp, argv).then(cb, cb) - }, - remove (_, cb) { - cb() - } - } - } - - try { - await install(fs, Gyp, []) - } catch (err) { - t.ok(true) - if (/"pre" versions of node cannot be installed/.test(err.message)) { - t.ok(true) - } - } -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-options.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-options.js deleted file mode 100644 index 8a634f0e0..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-options.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' - -const test = require('tap').test -const gyp = require('../lib/node-gyp') - -test('options in environment', (t) => { - t.plan(1) - - // `npm test` dumps a ton of npm_config_* variables in the environment. - Object.keys(process.env) - .filter((key) => /^npm_config_/.test(key)) - .forEach((key) => { delete process.env[key] }) - - // in some platforms, certain keys are stubborn and cannot be removed - const keys = Object.keys(process.env) - .filter((key) => /^npm_config_/.test(key)) - .map((key) => key.substring('npm_config_'.length)) - .concat('argv', 'x') - - // Zero-length keys should get filtered out. - process.env.npm_config_ = '42' - // Other keys should get added. - process.env.npm_config_x = '42' - // Except loglevel. - process.env.npm_config_loglevel = 'debug' - - const g = gyp() - g.parseArgv(['rebuild']) // Also sets opts.argv. - - t.deepEqual(Object.keys(g.opts).sort(), keys.sort()) -}) - -test('options with spaces in environment', (t) => { - t.plan(1) - - process.env.npm_config_force_process_config = 'true' - - const g = gyp() - g.parseArgv(['rebuild']) // Also sets opts.argv. - - t.equal(g.opts['force-process-config'], 'true') -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-process-release.js b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-process-release.js deleted file mode 100644 index c3ee0703c..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/test/test-process-release.js +++ /dev/null @@ -1,434 +0,0 @@ -'use strict' - -const test = require('tap').test -const processRelease = require('../lib/process-release') - -test('test process release - process.version = 0.8.20', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.8.20', null) - - t.equal(release.semver.version, '0.8.20') - delete release.semver - - t.deepEqual(release, { - version: '0.8.20', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.8.20/', - tarballUrl: 'https://nodejs.org/dist/v0.8.20/node-v0.8.20.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.8.20/SHASUMS256.txt', - versionDir: '0.8.20', - ia32: { libUrl: 'https://nodejs.org/dist/v0.8.20/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.8.20/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.8.20/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -test('test process release - process.version = 0.10.21', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.10.21', null) - - t.equal(release.semver.version, '0.10.21') - delete release.semver - - t.deepEqual(release, { - version: '0.10.21', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.21/', - tarballUrl: 'https://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.21/SHASUMS256.txt', - versionDir: '0.10.21', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.21/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.21/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.21/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// prior to -headers.tar.gz -test('test process release - process.version = 0.12.9', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.12.9', null) - - t.equal(release.semver.version, '0.12.9') - delete release.semver - - t.deepEqual(release, { - version: '0.12.9', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.12.9/', - tarballUrl: 'https://nodejs.org/dist/v0.12.9/node-v0.12.9.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.12.9/SHASUMS256.txt', - versionDir: '0.12.9', - ia32: { libUrl: 'https://nodejs.org/dist/v0.12.9/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.12.9/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.12.9/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// prior to -headers.tar.gz -test('test process release - process.version = 0.10.41', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.10.41', null) - - t.equal(release.semver.version, '0.10.41') - delete release.semver - - t.deepEqual(release, { - version: '0.10.41', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.41/', - tarballUrl: 'https://nodejs.org/dist/v0.10.41/node-v0.10.41.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.41/SHASUMS256.txt', - versionDir: '0.10.41', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.41/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.41/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.41/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// has -headers.tar.gz -test('test process release - process.release ~ node@0.10.42', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.10.42', null) - - t.equal(release.semver.version, '0.10.42') - delete release.semver - - t.deepEqual(release, { - version: '0.10.42', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.42/', - tarballUrl: 'https://nodejs.org/dist/v0.10.42/node-v0.10.42-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.42/SHASUMS256.txt', - versionDir: '0.10.42', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.42/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.42/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.42/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -// has -headers.tar.gz -test('test process release - process.release ~ node@0.12.10', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v0.12.10', null) - - t.equal(release.semver.version, '0.12.10') - delete release.semver - - t.deepEqual(release, { - version: '0.12.10', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.12.10/', - tarballUrl: 'https://nodejs.org/dist/v0.12.10/node-v0.12.10-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.12.10/SHASUMS256.txt', - versionDir: '0.12.10', - ia32: { libUrl: 'https://nodejs.org/dist/v0.12.10/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.12.10/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.12.10/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v4.1.23/', - tarballUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v4.1.23/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'https://nodejs.org/dist/v4.1.23/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v4.1.23/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v4.1.23/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23 / corp build', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'https://some.custom.location/', - tarballUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://some.custom.location/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'https://some.custom.location/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://some.custom.location/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://some.custom.location/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@12.8.0 Windows', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v12.8.0', { - name: 'node', - sourceUrl: 'https://nodejs.org/download/release/v12.8.0/node-v12.8.0.tar.gz', - headersUrl: 'https://nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - libUrl: 'https://nodejs.org/download/release/v12.8.0/win-x64/node.lib' - }) - - t.equal(release.semver.version, '12.8.0') - delete release.semver - - t.deepEqual(release, { - version: '12.8.0', - name: 'node', - baseUrl: 'https://nodejs.org/download/release/v12.8.0/', - tarballUrl: 'https://nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/release/v12.8.0/SHASUMS256.txt', - versionDir: '12.8.0', - ia32: { libUrl: 'https://nodejs.org/download/release/v12.8.0/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/release/v12.8.0/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/release/v12.8.0/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@12.8.0 Windows ARM64', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v12.8.0', { - name: 'node', - sourceUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/node-v12.8.0.tar.gz', - headersUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-arm64/node.lib' - }) - - t.equal(release.semver.version, '12.8.0') - delete release.semver - - t.deepEqual(release, { - version: '12.8.0', - name: 'node', - baseUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/', - tarballUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/node-v12.8.0-headers.tar.gz', - shasumsUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/SHASUMS256.txt', - versionDir: '12.8.0', - ia32: { libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://unofficial-builds.nodejs.org/download/release/v12.8.0/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23 --target=0.10.40', function (t) { - t.plan(2) - - var release = processRelease([], { opts: { target: '0.10.40' } }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '0.10.40') - delete release.semver - - t.deepEqual(release, { - version: '0.10.40', - name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.10.40/', - tarballUrl: 'https://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.10.40/SHASUMS256.txt', - versionDir: '0.10.40', - ia32: { libUrl: 'https://nodejs.org/dist/v0.10.40/node.lib', libPath: 'node.lib' }, - x64: { libUrl: 'https://nodejs.org/dist/v0.10.40/x64/node.lib', libPath: 'x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/dist/v0.10.40/arm64/node.lib', libPath: 'arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.1.23 --dist-url=https://foo.bar/baz', function (t) { - t.plan(2) - - var release = processRelease([], { opts: { 'dist-url': 'https://foo.bar/baz' } }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'https://foo.bar/baz/v4.1.23/', - tarballUrl: 'https://foo.bar/baz/v4.1.23/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://foo.bar/baz/v4.1.23/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'https://foo.bar/baz/v4.1.23/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://foo.bar/baz/v4.1.23/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://foo.bar/baz/v4.1.23/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ frankenstein@4.1.23', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'frankenstein', - headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'frankenstein', - baseUrl: 'https://frankensteinjs.org/dist/v4.1.23/', - tarballUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', - shasumsUrl: 'https://frankensteinjs.org/dist/v4.1.23/SHASUMS256.txt', - versionDir: 'frankenstein-4.1.23', - ia32: { libUrl: 'https://frankensteinjs.org/dist/v4.1.23/win-x86/frankenstein.lib', libPath: 'win-x86/frankenstein.lib' }, - x64: { libUrl: 'https://frankensteinjs.org/dist/v4.1.23/win-x64/frankenstein.lib', libPath: 'win-x64/frankenstein.lib' }, - arm64: { libUrl: 'https://frankensteinjs.org/dist/v4.1.23/win-arm64/frankenstein.lib', libPath: 'win-arm64/frankenstein.lib' } - }) -}) - -test('test process release - process.release ~ frankenstein@4.1.23 --dist-url=http://foo.bar/baz/', function (t) { - t.plan(2) - - var release = processRelease([], { opts: { 'dist-url': 'http://foo.bar/baz/' } }, 'v4.1.23', { - name: 'frankenstein', - headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'frankenstein', - baseUrl: 'http://foo.bar/baz/v4.1.23/', - tarballUrl: 'http://foo.bar/baz/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', - shasumsUrl: 'http://foo.bar/baz/v4.1.23/SHASUMS256.txt', - versionDir: 'frankenstein-4.1.23', - ia32: { libUrl: 'http://foo.bar/baz/v4.1.23/win-x86/frankenstein.lib', libPath: 'win-x86/frankenstein.lib' }, - x64: { libUrl: 'http://foo.bar/baz/v4.1.23/win-x64/frankenstein.lib', libPath: 'win-x64/frankenstein.lib' }, - arm64: { libUrl: 'http://foo.bar/baz/v4.1.23/win-arm64/frankenstein.lib', libPath: 'win-arm64/frankenstein.lib' } - }) -}) - -test('test process release - process.release ~ node@4.0.0-rc.4', function (t) { - t.plan(2) - - var release = processRelease([], { opts: {} }, 'v4.0.0-rc.4', { - name: 'node', - headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.0.0-rc.4') - delete release.semver - - t.deepEqual(release, { - version: '4.0.0-rc.4', - name: 'node', - baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', - tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', - versionDir: '4.0.0-rc.4', - ia32: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.0.0-rc.4 passed as argv[0]', function (t) { - t.plan(2) - - // note the missing 'v' on the arg, it should normalise when checking - // whether we're on the default or not - var release = processRelease(['4.0.0-rc.4'], { opts: {} }, 'v4.0.0-rc.4', { - name: 'node', - headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.0.0-rc.4') - delete release.semver - - t.deepEqual(release, { - version: '4.0.0-rc.4', - name: 'node', - baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', - tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', - versionDir: '4.0.0-rc.4', - ia32: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - process.release ~ node@4.0.0-rc.4 - bogus string passed as argv[0]', function (t) { - t.plan(2) - - // additional arguments can be passed in on the commandline that should be ignored if they - // are not specifying a valid version @ position 0 - var release = processRelease(['this is no version!'], { opts: {} }, 'v4.0.0-rc.4', { - name: 'node', - headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.0.0-rc.4') - delete release.semver - - t.deepEqual(release, { - version: '4.0.0-rc.4', - name: 'node', - baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', - tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', - shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', - versionDir: '4.0.0-rc.4', - ia32: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) -}) - -test('test process release - NODEJS_ORG_MIRROR', function (t) { - t.plan(2) - - process.env.NODEJS_ORG_MIRROR = 'http://foo.bar' - - var release = processRelease([], { opts: {} }, 'v4.1.23', { - name: 'node', - headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' - }) - - t.equal(release.semver.version, '4.1.23') - delete release.semver - - t.deepEqual(release, { - version: '4.1.23', - name: 'node', - baseUrl: 'http://foo.bar/v4.1.23/', - tarballUrl: 'http://foo.bar/v4.1.23/node-v4.1.23-headers.tar.gz', - shasumsUrl: 'http://foo.bar/v4.1.23/SHASUMS256.txt', - versionDir: '4.1.23', - ia32: { libUrl: 'http://foo.bar/v4.1.23/win-x86/node.lib', libPath: 'win-x86/node.lib' }, - x64: { libUrl: 'http://foo.bar/v4.1.23/win-x64/node.lib', libPath: 'win-x64/node.lib' }, - arm64: { libUrl: 'http://foo.bar/v4.1.23/win-arm64/node.lib', libPath: 'win-arm64/node.lib' } - }) - - delete process.env.NODEJS_ORG_MIRROR -}) diff --git a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/update-gyp.py b/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/update-gyp.py deleted file mode 100755 index 19524bd6a..000000000 --- a/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/update-gyp.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import os -import shutil -import subprocess -import tarfile -import tempfile -import urllib.request - -BASE_URL = "https://github.com/nodejs/gyp-next/archive/" -CHECKOUT_PATH = os.path.dirname(os.path.realpath(__file__)) -CHECKOUT_GYP_PATH = os.path.join(CHECKOUT_PATH, "gyp") - -parser = argparse.ArgumentParser() -parser.add_argument("tag", help="gyp tag to update to") -args = parser.parse_args() - -tar_url = BASE_URL + args.tag + ".tar.gz" - -changed_files = subprocess.check_output(["git", "diff", "--name-only"]).strip() -if changed_files: - raise Exception("Can't update gyp while you have uncommitted changes in node-gyp") - -with tempfile.TemporaryDirectory() as tmp_dir: - tar_file = os.path.join(tmp_dir, "gyp.tar.gz") - unzip_target = os.path.join(tmp_dir, "gyp") - with open(tar_file, "wb") as f: - print("Downloading gyp-next@" + args.tag + " into temporary directory...") - print("From: " + tar_url) - with urllib.request.urlopen(tar_url) as in_file: - f.write(in_file.read()) - - print("Unzipping...") - with tarfile.open(tar_file, "r:gz") as tar_ref: - def is_within_directory(directory, target): - - abs_directory = os.path.abspath(directory) - abs_target = os.path.abspath(target) - - prefix = os.path.commonprefix([abs_directory, abs_target]) - - return prefix == abs_directory - - def safe_extract(tar, path=".", members=None, *, numeric_owner=False): - - for member in tar.getmembers(): - member_path = os.path.join(path, member.name) - if not is_within_directory(path, member_path): - raise Exception("Attempted Path Traversal in Tar File") - - tar.extractall(path, members, numeric_owner) - - safe_extract(tar_ref, unzip_target) - - print("Moving to current checkout (" + CHECKOUT_PATH + ")...") - if os.path.exists(CHECKOUT_GYP_PATH): - shutil.rmtree(CHECKOUT_GYP_PATH) - shutil.move( - os.path.join(unzip_target, os.listdir(unzip_target)[0]), CHECKOUT_GYP_PATH - ) - -subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH) -subprocess.check_output(["git", "commit", "-m", "feat(gyp): update gyp to " + args.tag]) diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/.ready b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/LICENSE b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/LICENSE deleted file mode 100644 index 19c91a2f3..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2010 - present, Remy Sharp, https://remysharp.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/README.md b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/README.md deleted file mode 100644 index 60f254e6d..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/README.md +++ /dev/null @@ -1,434 +0,0 @@ -

- Nodemon Logo -

- -# nodemon - -nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected. - -nodemon does **not** require *any* additional changes to your code or method of development. nodemon is a replacement wrapper for `node`. To use `nodemon`, replace the word `node` on the command line when executing your script. - -[![NPM version](https://badge.fury.io/js/nodemon.svg)](https://npmjs.org/package/nodemon) -[![Travis Status](https://travis-ci.org/remy/nodemon.svg?branch=master)](https://travis-ci.org/remy/nodemon) [![Backers on Open Collective](https://opencollective.com/nodemon/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/nodemon/sponsors/badge.svg)](#sponsors) - -# Installation - -Either through cloning with git or by using [npm](http://npmjs.org) (the recommended way): - -```bash -npm install -g nodemon # or using yarn: yarn global add nodemon -``` - -And nodemon will be installed globally to your system path. - -You can also install nodemon as a development dependency: - -```bash -npm install --save-dev nodemon # or using yarn: yarn add nodemon -D -``` - -With a local installation, nodemon will not be available in your system path or you can't use it directly from the command line. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`. - -# Usage - -nodemon wraps your application, so you can pass all the arguments you would normally pass to your app: - -```bash -nodemon [your node app] -``` - -For CLI options, use the `-h` (or `--help`) argument: - -```bash -nodemon -h -``` - -Using nodemon is simple, if my application accepted a host and port as the arguments, I would start it as so: - -```bash -nodemon ./server.js localhost 8080 -``` - -Any output from this script is prefixed with `[nodemon]`, otherwise all output from your application, errors included, will be echoed out as expected. - -You can also pass the `inspect` flag to node through the command line as you would normally: - -```bash -nodemon --inspect ./server.js 80 -``` - -If you have a `package.json` file for your app, you can omit the main script entirely and nodemon will read the `package.json` for the `main` property and use that value as the app ([ref](https://github.com/remy/nodemon/issues/14)). - -nodemon will also search for the `scripts.start` property in `package.json` (as of nodemon 1.1.x). - -Also check out the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) or [issues](https://github.com/remy/nodemon/issues) for nodemon. - -## Automatic re-running - -nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. If your script exits cleanly, nodemon will continue to monitor the directory (or directories) and restart the script if there are any changes. - -## Manual restarting - -Whilst nodemon is running, if you need to manually restart your application, instead of stopping and restart nodemon, you can type `rs` with a carriage return, and nodemon will restart your process. - -## Config files - -nodemon supports local and global configuration files. These are usually named `nodemon.json` and can be located in the current working directory or in your home directory. An alternative local configuration file can be specified with the `--config ` option. - -The specificity is as follows, so that a command line argument will always override the config file settings: - -- command line arguments -- local config -- global config - -A config file can take any of the command line arguments as JSON key values, for example: - -```json -{ - "verbose": true, - "ignore": ["*.test.js", "**/fixtures/**"], - "execMap": { - "rb": "ruby", - "pde": "processing --sketch={{pwd}} --run" - } -} -``` - -The above `nodemon.json` file might be my global config so that I have support for ruby files and processing files, and I can run `nodemon demo.pde` and nodemon will automatically know how to run the script even though out of the box support for processing scripts. - -A further example of options can be seen in [sample-nodemon.md](https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md) - -### package.json - -If you want to keep all your package configurations in one place, nodemon supports using `package.json` for configuration. -Specify the config in the same format as you would for a config file but under `nodemonConfig` in the `package.json` file, for example, take the following `package.json`: - -```json -{ - "name": "nodemon", - "homepage": "http://nodemon.io", - "...": "... other standard package.json values", - "nodemonConfig": { - "ignore": ["**/test/**", "**/docs/**"], - "delay": 2500 - } -} -``` - -Note that if you specify a `--config` file or provide a local `nodemon.json` any `package.json` config is ignored. - -*This section needs better documentation, but for now you can also see `nodemon --help config` ([also here](https://github.com/remy/nodemon/blob/master/doc/cli/config.txt))*. - -## Using nodemon as a module - -Please see [doc/requireable.md](doc/requireable.md) - -## Using nodemon as child process - -Please see [doc/events.md](doc/events.md#Using_nodemon_as_child_process) - -## Running non-node scripts - -nodemon can also be used to execute and monitor other programs. nodemon will read the file extension of the script being run and monitor that extension instead of `.js` if there's no `nodemon.json`: - -```bash -nodemon --exec "python -v" ./app.py -``` - -Now nodemon will run `app.py` with python in verbose mode (note that if you're not passing args to the exec program, you don't need the quotes), and look for new or modified files with the `.py` extension. - -### Default executables - -Using the `nodemon.json` config file, you can define your own default executables using the `execMap` property. This is particularly useful if you're working with a language that isn't supported by default by nodemon. - -To add support for nodemon to know about the `.pl` extension (for Perl), the `nodemon.json` file would add: - -```json -{ - "execMap": { - "pl": "perl" - } -} -``` - -Now running the following, nodemon will know to use `perl` as the executable: - -```bash -nodemon script.pl -``` - -It's generally recommended to use the global `nodemon.json` to add your own `execMap` options. However, if there's a common default that's missing, this can be merged in to the project so that nodemon supports it by default, by changing [default.js](https://github.com/remy/nodemon/blob/master/lib/config/defaults.js) and sending a pull request. - -## Monitoring multiple directories - -By default nodemon monitors the current working directory. If you want to take control of that option, use the `--watch` option to add specific paths: - -```bash -nodemon --watch app --watch libs app/server.js -``` - -Now nodemon will only restart if there are changes in the `./app` or `./libs` directory. By default nodemon will traverse sub-directories, so there's no need in explicitly including sub-directories. - -Nodemon also supports unix globbing, e.g `--watch './lib/*'`. The globbing pattern must be quoted. - -## Specifying extension watch list - -By default, nodemon looks for files with the `.js`, `.mjs`, `.coffee`, `.litcoffee`, and `.json` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so: - -```bash -nodemon -e js,pug -``` - -Now nodemon will restart on any changes to files in the directory (or subdirectories) with the extensions `.js`, `.pug`. - -## Ignoring files - -By default, nodemon will only restart when a `.js` JavaScript file changes. In some cases you will want to ignore some specific files, directories or file patterns, to prevent nodemon from prematurely restarting your application. - -This can be done via the command line: - -```bash -nodemon --ignore lib/ --ignore tests/ -``` - -Or specific files can be ignored: - -```bash -nodemon --ignore lib/app.js -``` - -Patterns can also be ignored (but be sure to quote the arguments): - -```bash -nodemon --ignore 'lib/*.js' -``` - -**Important** the ignore rules are patterns matched to the full absolute path, and this determines how many files are monitored. If using a wild card glob pattern, it needs to be used as `**` or omitted entirely. For example, `nodemon --ignore '**/test/**'` will work, whereas `--ignore '*/test/*'` will not. - -Note that by default, nodemon will ignore the `.git`, `node_modules`, `bower_components`, `.nyc_output`, `coverage` and `.sass-cache` directories and *add* your ignored patterns to the list. If you want to indeed watch a directory like `node_modules`, you need to [override the underlying default ignore rules](https://github.com/remy/nodemon/blob/master/faq.md#overriding-the-underlying-default-ignore-rules). - -## Application isn't restarting - -In some networked environments (such as a container running nodemon reading across a mounted drive), you will need to use the `legacyWatch: true` which enables Chokidar's polling. - -Via the CLI, use either `--legacy-watch` or `-L` for short: - -```bash -nodemon -L -``` - -Though this should be a last resort as it will poll every file it can find. - -## Delaying restarting - -In some situations, you may want to wait until a number of files have changed. The timeout before checking for new file changes is 1 second. If you're uploading a number of files and it's taking some number of seconds, this could cause your app to restart multiple times unnecessarily. - -To add an extra throttle, or delay restarting, use the `--delay` command: - -```bash -nodemon --delay 10 server.js -``` - -For more precision, milliseconds can be specified. Either as a float: - -```bash -nodemon --delay 2.5 server.js -``` - -Or using the time specifier (ms): - -```bash -nodemon --delay 2500ms server.js -``` - -The delay figure is number of seconds (or milliseconds, if specified) to delay before restarting. So nodemon will only restart your app the given number of seconds after the *last* file change. - -If you are setting this value in `nodemon.json`, the value will always be interpreted in milliseconds. E.g., the following are equivalent: - -```bash -nodemon --delay 2.5 - -{ - "delay": 2500 -} -``` - -## Gracefully reloading down your script - -It is possible to have nodemon send any signal that you specify to your application. - -```bash -nodemon --signal SIGHUP server.js -``` - -Your application can handle the signal as follows. - -```js -process.once("SIGHUP", function () { - reloadSomeConfiguration(); -}) -``` - -Please note that nodemon will send this signal to every process in the process tree. - -If you are using `cluster`, then each workers (as well as the master) will receive the signal. If you wish to terminate all workers on receiving a `SIGHUP`, a common pattern is to catch the `SIGHUP` in the master, and forward `SIGTERM` to all workers, while ensuring that all workers ignore `SIGHUP`. - -```js -if (cluster.isMaster) { - process.on("SIGHUP", function () { - for (const worker of Object.values(cluster.workers)) { - worker.process.kill("SIGTERM"); - } - }); -} else { - process.on("SIGHUP", function() {}) -} -``` - -## Controlling shutdown of your script - -nodemon sends a kill signal to your application when it sees a file update. If you need to clean up on shutdown inside your script you can capture the kill signal and handle it yourself. - -The following example will listen once for the `SIGUSR2` signal (used by nodemon to restart), run the clean up process and then kill itself for nodemon to continue control: - -```js -process.once('SIGUSR2', function () { - gracefulShutdown(function () { - process.kill(process.pid, 'SIGUSR2'); - }); -}); -``` - -Note that the `process.kill` is *only* called once your shutdown jobs are complete. Hat tip to [Benjie Gillam](http://www.benjiegillam.com/2011/08/node-js-clean-restart-and-faster-development-with-nodemon/) for writing this technique up. - -## Triggering events when nodemon state changes - -If you want growl like notifications when nodemon restarts or to trigger an action when an event happens, then you can either `require` nodemon or add event actions to your `nodemon.json` file. - -For example, to trigger a notification on a Mac when nodemon restarts, `nodemon.json` looks like this: - -```json -{ - "events": { - "restart": "osascript -e 'display notification \"app restarted\" with title \"nodemon\"'" - } -} -``` - -A full list of available events is listed on the [event states wiki](https://github.com/remy/nodemon/wiki/Events#states). Note that you can bind to both states and messages. - -## Pipe output to somewhere else - -```js -nodemon({ - script: ..., - stdout: false // important: this tells nodemon not to output to console -}).on('readable', function() { // the `readable` event indicates that data is ready to pick up - this.stdout.pipe(fs.createWriteStream('output.txt')); - this.stderr.pipe(fs.createWriteStream('err.txt')); -}); -``` - -## Using nodemon in your gulp workflow - -Check out the [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon) plugin to integrate nodemon with the rest of your project's gulp workflow. - -## Using nodemon in your Grunt workflow - -Check out the [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) plugin to integrate nodemon with the rest of your project's grunt workflow. - -## Pronunciation - -> nodemon, is it pronounced: node-mon, no-demon or node-e-mon (like pokémon)? - -Well...I've been asked this many times before. I like that I've been asked this before. There's been bets as to which one it actually is. - -The answer is simple, but possibly frustrating. I'm not saying (how I pronounce it). It's up to you to call it as you like. All answers are correct :) - -## Design principles - -- Fewer flags is better -- Works across all platforms -- Fewer features -- Let individuals build on top of nodemon -- Offer all CLI functionality as an API -- Contributions must have and pass tests - -Nodemon is not perfect, and CLI arguments has sprawled beyond where I'm completely happy, but perhaps it can be reduced a little one day. - -## FAQ - -See the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) and please add your own questions if you think they would help others. - -## Backers - -Thank you to all [our backers](https://opencollective.com/nodemon#backer)! 🙏 - -[![nodemon backers](https://opencollective.com/nodemon/backers.svg?width=890)](https://opencollective.com/nodemon#backers) - -## Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Sponsor this project today ❤️](https://opencollective.com/nodemon#sponsor) - -
null -#1 Aussie Gambling Guide -NettiCasinoHEX.com is a real giant among casino guides. It provides Finnish players with the most informative and honest casino rewievs. Beside that, there are free casino games and tips there which help to win the best jackpots. -null -Casinoonlineaams.com -aussielowdepositcasino.com -null -null -The UK’s number one place for all things GamStop. -null -freebets.ltd.uk -null -Marketing -Best Online Casino Guide in Australia -Rating of best betting sites in Australia -null -null -null -null -null -null - -null -We are the most advanced casino guide! -Best Australian online casinos. Reviewed by Correct Casinos. -casino online sicuri -null -null - - -null -Best Online Casinos -null -Buy Instagram Views -Website dedicated to finding the best and safest licensed online casinos in India -null -null -null -null -null -null -null -null -Broadband.deals -null -null -At Casinoaustraliaonline.com, we review, compare and list all the best gambling sites for Aussies.
- -Data-Driven SEO Agency -We offer SEO Services in Europe. Scale your traffic and grow more users online via Google -Australia Online Casino Reviewer -Casino utan svensk licens är online casinon som inte har en svensk spellicens. -We provide Marketing Services for the iGaming and Technology space -Likes.io is a social media engagement service that helps users increase their visibility and boost their online presence. With Likes.io, users can easily and quickly get more likes, followers, and views for their social media profiles, including Instagram -null -null -Buy Instagram Likes -
- -# License - -MIT [http://rem.mit-license.org](http://rem.mit-license.org) diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/bin/nodemon.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/bin/nodemon.js deleted file mode 100755 index 3d490f140..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/bin/nodemon.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -const cli = require('../lib/cli'); -const nodemon = require('../lib/'); -const options = cli.parse(process.argv); - -nodemon(options); - -const fs = require('fs'); - -// checks for available update and returns an instance -const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json')); - -if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) { - require('simple-update-notifier')({ pkg }); -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/bin/windows-kill.exe b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/bin/windows-kill.exe deleted file mode 100644 index 98d7d7f7e..000000000 Binary files a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/bin/windows-kill.exe and /dev/null differ diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/authors.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/authors.txt deleted file mode 100644 index 6c77a12ae..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/authors.txt +++ /dev/null @@ -1,8 +0,0 @@ - - Remy Sharp - author and maintainer - https://github.com/remy - https://twitter.com/rem - - Contributors: https://github.com/remy/nodemon/graphs/contributors ❤︎ - - Please help make nodemon better: https://github.com/remy/nodemon/ diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/config.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/config.txt deleted file mode 100644 index 5de9bba57..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/config.txt +++ /dev/null @@ -1,44 +0,0 @@ - - Typically the options to control nodemon are passed in via the CLI and are - listed under: nodemon --help options - - nodemon can also be configured via a local and global config file: - - * $HOME/nodemon.json - * $PWD/nodemon.json OR --config - * nodemonConfig in package.json - - All config options in the .json file map 1-to-1 with the CLI options, so a - config could read as: - - { - "ext": "*.pde", - "verbose": true, - "exec": "processing --sketch=game --run" - } - - There are a limited number of variables available in the config (since you - could use backticks on the CLI to use a variable, backticks won't work in - the .json config). - - * {{pwd}} - the current directory - * {{filename}} - the filename you pass to nodemon - - For example: - - { - "ext": "*.pde", - "verbose": true, - "exec": "processing --sketch={{pwd}} --run" - } - - The global config file is useful for setting up default executables - instead of repeating the same option in each of your local configs: - - { - "verbose": true, - "execMap": { - "rb": "ruby", - "pde": "processing --sketch={{pwd}} --run" - } - } diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/help.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/help.txt deleted file mode 100644 index 7ba4ff2a3..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/help.txt +++ /dev/null @@ -1,29 +0,0 @@ - Usage: nodemon [options] [script.js] [args] - - Options: - - --config file ............ alternate nodemon.json config file to use - -e, --ext ................ extensions to look for, ie. js,pug,hbs. - -x, --exec app ........... execute script with "app", ie. -x "python -v". - -w, --watch path ......... watch directory "path" or files. use once for - each directory or file to watch. - -i, --ignore ............. ignore specific files or directories. - -V, --verbose ............ show detail on what is causing restarts. - -- ........... to tell nodemon stop slurping arguments. - - Note: if the script is omitted, nodemon will try to read "main" from - package.json and without a nodemon.json, nodemon will monitor .js, .mjs, .coffee, - .litcoffee, and .json by default. - - For advanced nodemon configuration use nodemon.json: nodemon --help config - See also the sample: https://github.com/remy/nodemon/wiki/Sample-nodemon.json - - Examples: - - $ nodemon server.js - $ nodemon -w ../foo server.js apparg1 apparg2 - $ nodemon --exec python app.py - $ nodemon --exec "make build" -e "styl hbs" - $ nodemon app.js -- --config # pass config to app.js - - \x1B[1mAll options are documented under: \x1B[4mnodemon --help options\x1B[0m diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/logo.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/logo.txt deleted file mode 100644 index 150f97f59..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/logo.txt +++ /dev/null @@ -1,20 +0,0 @@ - ; ; - kO. x0 - KMX, .:x0kc. 'KMN - 0MMM0: 'oKMMMMMMMXd, ;OMMMX - oMMMMMWKOONMMMMMMMMMMMMMWOOKWMMMMMx - OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK. - .oWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd. - KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN - KMMMMMMMMMMMMMMW0k0WMMMMMMMMMMMMMMW - KMMMMMMMMMMMNk:. :xNMMMMMMMMMMMW - KMMMMMMMMMMK OMMMMMMMMMMW - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMNc ;NMMMMMMMMMN - KMMMMMW0o' .lOWMMMMMN - KMMKd; ,oKMMN - kX: ,K0 \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/options.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/options.txt deleted file mode 100644 index 598ae63ba..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/options.txt +++ /dev/null @@ -1,36 +0,0 @@ - -Configuration - --config .......... alternate nodemon.json config file to use - --exitcrash .............. exit on crash, allows nodemon to work with other watchers - -i, --ignore ............. ignore specific files or directories - --no-colors .............. disable color output - --signal ........ use specified kill signal instead of default (ex. SIGTERM) - -w, --watch path ......... watch directory "dir" or files. use once for each - directory or file to watch - --no-update-notifier ..... opt-out of update version check - -Execution - -C, --on-change-only ..... execute script on change only, not startup - --cwd .............. change into before running the script - -e, --ext ................ extensions to look for, ie. "js,pug,hbs" - -I, --no-stdin ........... nodemon passes stdin directly to child process - --spawn .................. force nodemon to use spawn (over fork) [node only] - -x, --exec app ........... execute script with "app", ie. -x "python -v" - -- ........... to tell nodemon stop slurping arguments - -Watching - -d, --delay n ............ debounce restart for "n" seconds - -L, --legacy-watch ....... use polling to watch for changes (typically needed - when watching over a network/Docker) - -P, --polling-interval ... combined with -L, milliseconds to poll for (default 100) - -Information - --dump ................... print full debug configuration - -h, --help ............... default help - --help ........... help on a specific feature. Try "--help topics" - -q, --quiet .............. minimise nodemon messages to start/stop only - -v, --version ............ current nodemon version - -V, --verbose ............ show detail on what is causing restarts - - -> Note that any unrecognised arguments are passed to the executing command. diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/topics.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/topics.txt deleted file mode 100644 index 9fe3e2b59..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/topics.txt +++ /dev/null @@ -1,8 +0,0 @@ - - options .................. show all available nodemon options - config ................... default config options using nodemon.json - authors .................. contributors to this project - logo ..................... <3 - whoami ................... I, AM, NODEMON \o/ - - Please support https://github.com/remy/nodemon/ diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/usage.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/usage.txt deleted file mode 100644 index bca98b5e6..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/usage.txt +++ /dev/null @@ -1,3 +0,0 @@ - Usage: nodemon [nodemon options] [script.js] [args] - - See "nodemon --help" for more. diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/whoami.txt b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/whoami.txt deleted file mode 100644 index efc3382ef..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/doc/cli/whoami.txt +++ /dev/null @@ -1,9 +0,0 @@ -__/\\\\\_____/\\\_______/\\\\\_______/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\____________/\\\\_______/\\\\\_______/\\\\\_____/\\\_ - _\/\\\\\\___\/\\\_____/\\\///\\\____\/\\\////////\\\__\/\\\///////////__\/\\\\\\________/\\\\\\_____/\\\///\\\____\/\\\\\\___\/\\\_ - _\/\\\/\\\__\/\\\___/\\\/__\///\\\__\/\\\______\//\\\_\/\\\_____________\/\\\//\\\____/\\\//\\\___/\\\/__\///\\\__\/\\\/\\\__\/\\\_ - _\/\\\//\\\_\/\\\__/\\\______\//\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\_____\/\\\\///\\\/\\\/_\/\\\__/\\\______\//\\\_\/\\\//\\\_\/\\\_ - _\/\\\\//\\\\/\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\///////______\/\\\__\///\\\/___\/\\\_\/\\\_______\/\\\_\/\\\\//\\\\/\\\_ - _\/\\\_\//\\\/\\\_\//\\\______/\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\____\///_____\/\\\_\//\\\______/\\\__\/\\\_\//\\\/\\\_ - _\/\\\__\//\\\\\\__\///\\\__/\\\____\/\\\_______/\\\__\/\\\_____________\/\\\_____________\/\\\__\///\\\__/\\\____\/\\\__\//\\\\\\_ - _\/\\\___\//\\\\\____\///\\\\\/_____\/\\\\\\\\\\\\/___\/\\\\\\\\\\\\\\\_\/\\\_____________\/\\\____\///\\\\\/_____\/\\\___\//\\\\\_ - _\///_____\/////_______\/////_______\////////////_____\///////////////__\///______________\///_______\/////_______\///_____\/////__ \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/cli/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/cli/index.js deleted file mode 100644 index bf9e80991..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/cli/index.js +++ /dev/null @@ -1,49 +0,0 @@ -var parse = require('./parse'); - -/** - * Converts a string to command line args, in particular - * groups together quoted values. - * This is a utility function to allow calling nodemon as a required - * library, but with the CLI args passed in (instead of an object). - * - * @param {String} string - * @return {Array} - */ -function stringToArgs(string) { - var args = []; - - var parts = string.split(' '); - var length = parts.length; - var i = 0; - var open = false; - var grouped = ''; - var lead = ''; - - for (; i < length; i++) { - lead = parts[i].substring(0, 1); - if (lead === '"' || lead === '\'') { - open = lead; - grouped = parts[i].substring(1); - } else if (open && parts[i].slice(-1) === open) { - open = false; - grouped += ' ' + parts[i].slice(0, -1); - args.push(grouped); - } else if (open) { - grouped += ' ' + parts[i]; - } else { - args.push(parts[i]); - } - } - - return args; -} - -module.exports = { - parse: function (argv) { - if (typeof argv === 'string') { - argv = stringToArgs(argv); - } - - return parse(argv); - }, -}; \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/cli/parse.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/cli/parse.js deleted file mode 100644 index ad7400386..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/cli/parse.js +++ /dev/null @@ -1,230 +0,0 @@ -/* - -nodemon is a utility for node, and replaces the use of the executable -node. So the user calls `nodemon foo.js` instead. - -nodemon can be run in a number of ways: - -`nodemon` - tries to use package.json#main property to run -`nodemon` - if no package, looks for index.js -`nodemon app.js` - runs app.js -`nodemon --arg app.js --apparg` - eats arg1, and runs app.js with apparg -`nodemon --apparg` - as above, but passes apparg to package.json#main (or - index.js) -`nodemon --debug app.js - -*/ - -var fs = require('fs'); -var path = require('path'); -var existsSync = fs.existsSync || path.existsSync; - -module.exports = parse; - -/** - * Parses the command line arguments `process.argv` and returns the - * nodemon options, the user script and the executable script. - * - * @param {Array} full process arguments, including `node` leading arg - * @return {Object} { options, script, args } - */ -function parse(argv) { - if (typeof argv === 'string') { - argv = argv.split(' '); - } - - var eat = function (i, args) { - if (i <= args.length) { - return args.splice(i + 1, 1).pop(); - } - }; - - var args = argv.slice(2); - var script = null; - var nodemonOptions = { scriptPosition: null }; - - var nodemonOpt = nodemonOption.bind(null, nodemonOptions); - var lookForArgs = true; - - // move forward through the arguments - for (var i = 0; i < args.length; i++) { - // if the argument looks like a file, then stop eating - if (!script) { - if (args[i] === '.' || existsSync(args[i])) { - script = args.splice(i, 1).pop(); - - // we capture the position of the script because we'll reinsert it in - // the right place in run.js:command (though I'm not sure we should even - // take it out of the array in the first place, but this solves passing - // arguments to the exec process for now). - nodemonOptions.scriptPosition = i; - i--; - continue; - } - } - - if (lookForArgs) { - // respect the standard way of saying: hereafter belongs to my script - if (args[i] === '--') { - args.splice(i, 1); - nodemonOptions.scriptPosition = i; - // cycle back one argument, as we just ate this one up - i--; - - // ignore all further nodemon arguments - lookForArgs = false; - - // move to the next iteration - continue; - } - - if (nodemonOpt(args[i], eat.bind(null, i, args)) !== false) { - args.splice(i, 1); - // cycle back one argument, as we just ate this one up - i--; - } - } - } - - nodemonOptions.script = script; - nodemonOptions.args = args; - - return nodemonOptions; -} - - -/** - * Given an argument (ie. from process.argv), sets nodemon - * options and can eat up the argument value - * - * @param {Object} options object that will be updated - * @param {Sting} current argument from argv - * @param {Function} the callback to eat up the next argument in argv - * @return {Boolean} false if argument was not a nodemon arg - */ -function nodemonOption(options, arg, eatNext) { - // line separation on purpose to help legibility - if (arg === '--help' || arg === '-h' || arg === '-?') { - var help = eatNext(); - options.help = help ? help : true; - } else - - if (arg === '--version' || arg === '-v') { - options.version = true; - } else - - if (arg === '--no-update-notifier') { - options.noUpdateNotifier = true; - } else - - if (arg === '--spawn') { - options.spawn = true; - } else - - if (arg === '--dump') { - options.dump = true; - } else - - if (arg === '--verbose' || arg === '-V') { - options.verbose = true; - } else - - if (arg === '--legacy-watch' || arg === '-L') { - options.legacyWatch = true; - } else - - if (arg === '--polling-interval' || arg === '-P') { - options.pollingInterval = parseInt(eatNext(), 10); - } else - - // Depricated as this is "on" by default - if (arg === '--js') { - options.js = true; - } else - - if (arg === '--quiet' || arg === '-q') { - options.quiet = true; - } else - - if (arg === '--config') { - options.configFile = eatNext(); - } else - - if (arg === '--watch' || arg === '-w') { - if (!options.watch) { options.watch = []; } - options.watch.push(eatNext()); - } else - - if (arg === '--ignore' || arg === '-i') { - if (!options.ignore) { options.ignore = []; } - options.ignore.push(eatNext()); - } else - - if (arg === '--exitcrash') { - options.exitcrash = true; - } else - - if (arg === '--delay' || arg === '-d') { - options.delay = parseDelay(eatNext()); - } else - - if (arg === '--exec' || arg === '-x') { - options.exec = eatNext(); - } else - - if (arg === '--no-stdin' || arg === '-I') { - options.stdin = false; - } else - - if (arg === '--on-change-only' || arg === '-C') { - options.runOnChangeOnly = true; - } else - - if (arg === '--ext' || arg === '-e') { - options.ext = eatNext(); - } else - - if (arg === '--no-colours' || arg === '--no-colors') { - options.colours = false; - } else - - if (arg === '--signal' || arg === '-s') { - options.signal = eatNext(); - } else - - if (arg === '--cwd') { - options.cwd = eatNext(); - - // go ahead and change directory. This is primarily for nodemon tools like - // grunt-nodemon - we're doing this early because it will affect where the - // user script is searched for. - process.chdir(path.resolve(options.cwd)); - } else { - - // this means we didn't match - return false; - } -} - -/** - * Given an argument (ie. from nodemonOption()), will parse and return the - * equivalent millisecond value or 0 if the argument cannot be parsed - * - * @param {String} argument value given to the --delay option - * @return {Number} millisecond equivalent of the argument - */ -function parseDelay(value) { - var millisPerSecond = 1000; - var millis = 0; - - if (value.match(/^\d*ms$/)) { - // Explicitly parse for milliseconds when using ms time specifier - millis = parseInt(value, 10); - } else { - // Otherwise, parse for seconds, with or without time specifier then convert - millis = parseFloat(value) * millisPerSecond; - } - - return isNaN(millis) ? 0 : millis; -} - diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/command.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/command.js deleted file mode 100644 index 9839b5c7c..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/command.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = command; - -/** - * command constructs the executable command to run in a shell including the - * user script, the command arguments. - * - * @param {Object} settings Object as: - * { execOptions: { - * exec: String, - * [script: String], - * [scriptPosition: Number], - * [execArgs: Array] - * } - * } - * @return {Object} an object with the node executable and the - * arguments to the command - */ -function command(settings) { - var options = settings.execOptions; - var executable = options.exec; - var args = []; - - // after "executable" go the exec args (like --debug, etc) - if (options.execArgs) { - [].push.apply(args, options.execArgs); - } - - // then goes the user's script arguments - if (options.args) { - [].push.apply(args, options.args); - } - - // after the "executable" goes the user's script - if (options.script) { - args.splice((options.scriptPosition || 0) + - options.execArgs.length, 0, options.script); - } - - return { - executable: executable, - args: args, - }; -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/defaults.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/defaults.js deleted file mode 100644 index c1795b997..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/defaults.js +++ /dev/null @@ -1,32 +0,0 @@ -var ignoreRoot = require('ignore-by-default').directories(); - -// default options for config.options -const defaults = { - restartable: 'rs', - colours: true, - execMap: { - py: 'python', - rb: 'ruby', - ts: 'ts-node', - // more can be added here such as ls: lsc - but please ensure it's cross - // compatible with linux, mac and windows, or make the default.js - // dynamically append the `.cmd` for node based utilities - }, - ignoreRoot: ignoreRoot.map((_) => `**/${_}/**`), - watch: ['*.*'], - stdin: true, - runOnChangeOnly: false, - verbose: false, - signal: 'SIGUSR2', - // 'stdout' refers to the default behaviour of a required nodemon's child, - // but also includes stderr. If this is false, data is still dispatched via - // nodemon.on('stdout/stderr') - stdout: true, - watchOptions: {}, -}; - -if ((process.env.NODE_OPTIONS || '').includes('--loader')) { - delete defaults.execMap.ts; -} - -module.exports = defaults; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/exec.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/exec.js deleted file mode 100644 index 68c2a2de1..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/exec.js +++ /dev/null @@ -1,225 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const existsSync = fs.existsSync; -const utils = require('../utils'); - -module.exports = exec; -module.exports.expandScript = expandScript; - -/** - * Reads the cwd/package.json file and looks to see if it can load a script - * and possibly an exec first from package.main, then package.start. - * - * @return {Object} exec & script if found - */ -function execFromPackage() { - // doing a try/catch because we can't use the path.exist callback pattern - // or we could, but the code would get messy, so this will do exactly - // what we're after - if the file doesn't exist, it'll throw. - try { - // note: this isn't nodemon's package, it's the user's cwd package - var pkg = require(path.join(process.cwd(), 'package.json')); - if (pkg.main !== undefined) { - // no app found to run - so give them a tip and get the feck out - return { exec: null, script: pkg.main }; - } - - if (pkg.scripts && pkg.scripts.start) { - return { exec: pkg.scripts.start }; - } - } catch (e) { } - - return null; -} - -function replace(map, str) { - var re = new RegExp('{{(' + Object.keys(map).join('|') + ')}}', 'g'); - return str.replace(re, function (all, m) { - return map[m] || all || ''; - }); -} - -function expandScript(script, ext) { - if (!ext) { - ext = '.js'; - } - if (script.indexOf(ext) !== -1) { - return script; - } - - if (existsSync(path.resolve(script))) { - return script; - } - - if (existsSync(path.resolve(script + ext))) { - return script + ext; - } - - return script; -} - -/** - * Discovers all the options required to run the script - * and if a custom exec has been passed in, then it will - * also try to work out what extensions to monitor and - * whether there's a special way of running that script. - * - * @param {Object} nodemonOptions - * @param {Object} execMap - * @return {Object} new and updated version of nodemonOptions - */ -function exec(nodemonOptions, execMap) { - if (!execMap) { - execMap = {}; - } - - var options = utils.clone(nodemonOptions || {}); - var script; - - // if there's no script passed, try to get it from the first argument - if (!options.script && (options.args || []).length) { - script = expandScript(options.args[0], - options.ext && ('.' + (options.ext || 'js').split(',')[0])); - - // if the script was found, shift it off our args - if (script !== options.args[0]) { - options.script = script; - options.args.shift(); - } - } - - // if there's no exec found yet, then try to read it from the local - // package.json this logic used to sit in the cli/parse, but actually the cli - // should be parsed first, then the user options (via nodemon.json) then - // finally default down to pot shots at the directory via package.json - if (!options.exec && !options.script) { - var found = execFromPackage(); - if (found !== null) { - if (found.exec) { - options.exec = found.exec; - } - if (!options.script) { - options.script = found.script; - } - if (Array.isArray(options.args) && - options.scriptPosition === null) { - options.scriptPosition = options.args.length; - } - } - } - - // var options = utils.clone(nodemonOptions || {}); - script = path.basename(options.script || ''); - - var scriptExt = path.extname(script).slice(1); - - var extension = options.ext; - if (extension === undefined) { - var isJS = scriptExt === 'js' || scriptExt === 'mjs'; - extension = (isJS || !scriptExt) ? 'js,mjs' : scriptExt; - extension += ',json'; // Always watch JSON files - } - - var execDefined = !!options.exec; - - // allows the user to simplify cli usage: - // https://github.com/remy/nodemon/issues/195 - // but always give preference to the user defined argument - if (!options.exec && execMap[scriptExt] !== undefined) { - options.exec = execMap[scriptExt]; - execDefined = true; - } - - options.execArgs = nodemonOptions.execArgs || []; - - if (Array.isArray(options.exec)) { - options.execArgs = options.exec; - options.exec = options.execArgs.shift(); - } - - if (options.exec === undefined) { - options.exec = 'node'; - } else { - // allow variable substitution for {{filename}} and {{pwd}} - var substitution = replace.bind(null, { - filename: options.script, - pwd: process.cwd(), - }); - - var newExec = substitution(options.exec); - if (newExec !== options.exec && - options.exec.indexOf('{{filename}}') !== -1) { - options.script = null; - } - options.exec = newExec; - - var newExecArgs = options.execArgs.map(substitution); - if (newExecArgs.join('') !== options.execArgs.join('')) { - options.execArgs = newExecArgs; - delete options.script; - } - } - - - if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) { - options.execArgs = options.execArgs.concat(options.nodeArgs); - } - - // note: indexOf('coffee') handles both .coffee and .litcoffee - if (!execDefined && options.exec === 'node' && - scriptExt.indexOf('coffee') !== -1) { - options.exec = 'coffee'; - - // we need to get execArgs set before the script - // for example, in `nodemon --debug my-script.coffee --my-flag`, debug is an - // execArg, while my-flag is a script arg - var leadingArgs = (options.args || []).splice(0, options.scriptPosition); - options.execArgs = options.execArgs.concat(leadingArgs); - options.scriptPosition = 0; - - if (options.execArgs.length > 0) { - // because this is the coffee executable, we need to combine the exec args - // into a single argument after the nodejs flag - options.execArgs = ['--nodejs', options.execArgs.join(' ')]; - } - } - - if (options.exec === 'coffee') { - // don't override user specified extension tracking - if (options.ext === undefined) { - if (extension) { extension += ','; } - extension += 'coffee,litcoffee'; - } - - // because windows can't find 'coffee', it needs the real file 'coffee.cmd' - if (utils.isWindows) { - options.exec += '.cmd'; - } - } - - // allow users to make a mistake on the extension to monitor - // converts .js, pug => js,pug - // BIG NOTE: user can't do this: nodemon -e *.js - // because the terminal will automatically expand the glob against - // the file system :( - extension = (extension.match(/[^,*\s]+/g) || []) - .map(ext => ext.replace(/^\./, '')) - .join(','); - - options.ext = extension; - - if (options.script) { - options.script = expandScript(options.script, - extension && ('.' + extension.split(',')[0])); - } - - options.env = {}; - // make sure it's an object (and since we don't have ) - if (({}).toString.apply(nodemonOptions.env) === '[object Object]') { - options.env = utils.clone(nodemonOptions.env); - } else if (nodemonOptions.env !== undefined) { - throw new Error('nodemon env values must be an object: { PORT: 8000 }'); - } - - return options; -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/index.js deleted file mode 100644 index c78c435cd..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/index.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Manages the internal config of nodemon, checking for the state of support - * with fs.watch, how nodemon can watch files (using find or fs methods). - * - * This is *not* the user's config. - */ -var debug = require('debug')('nodemon'); -var load = require('./load'); -var rules = require('../rules'); -var utils = require('../utils'); -var pinVersion = require('../version').pin; -var command = require('./command'); -var rulesToMonitor = require('../monitor/match').rulesToMonitor; -var bus = utils.bus; - -function reset() { - rules.reset(); - - config.dirs = []; - config.options = { ignore: [], watch: [], monitor: [] }; - config.lastStarted = 0; - config.loaded = []; -} - -var config = { - run: false, - system: { - cwd: process.cwd(), - }, - required: false, - dirs: [], - timeout: 1000, - options: {}, -}; - -/** - * Take user defined settings, then detect the local machine capability, then - * look for local and global nodemon.json files and merge together the final - * settings with the config for nodemon. - * - * @param {Object} settings user defined settings for nodemon (typically on - * the cli) - * @param {Function} ready callback fired once the config is loaded - */ -config.load = function (settings, ready) { - reset(); - var config = this; - load(settings, config.options, config, function (options) { - config.options = options; - - if (options.watch.length === 0) { - // this is to catch when the watch is left blank - options.watch.push('*.*'); - } - - if (options['watch_interval']) { // jshint ignore:line - options.watchInterval = options['watch_interval']; // jshint ignore:line - } - - config.watchInterval = options.watchInterval || null; - if (options.signal) { - config.signal = options.signal; - } - - var cmd = command(config.options); - config.command = { - raw: cmd, - string: utils.stringify(cmd.executable, cmd.args), - }; - - // now run automatic checks on system adding to the config object - options.monitor = rulesToMonitor(options.watch, options.ignore, config); - - var cwd = process.cwd(); - debug('config: dirs', config.dirs); - if (config.dirs.length === 0) { - config.dirs.unshift(cwd); - } - - bus.emit('config:update', config); - pinVersion().then(function () { - ready(config); - }).catch(e => { - // this doesn't help testing, but does give exposure on syntax errors - console.error(e.stack); - setTimeout(() => { throw e; }, 0); - }); - }); -}; - -config.reset = reset; - -module.exports = config; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/load.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/load.js deleted file mode 100644 index bd5a03d8a..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/config/load.js +++ /dev/null @@ -1,256 +0,0 @@ -var debug = require('debug')('nodemon'); -var fs = require('fs'); -var path = require('path'); -var exists = fs.exists || path.exists; -var utils = require('../utils'); -var rules = require('../rules'); -var parse = require('../rules/parse'); -var exec = require('./exec'); -var defaults = require('./defaults'); - -module.exports = load; -module.exports.mutateExecOptions = mutateExecOptions; - -var existsSync = fs.existsSync || path.existsSync; - -function findAppScript() { - // nodemon has been run alone, so try to read the package file - // or try to read the index.js file - if (existsSync('./index.js')) { - return 'index.js'; - } -} - -/** - * Load the nodemon config, first reading the global root/nodemon.json, then - * the local nodemon.json to the exec and then overwriting using any user - * specified settings (i.e. from the cli) - * - * @param {Object} settings user defined settings - * @param {Function} ready callback that receives complete config - */ -function load(settings, options, config, callback) { - config.loaded = []; - // first load the root nodemon.json - loadFile(options, config, utils.home, function (options) { - // then load the user's local configuration file - if (settings.configFile) { - options.configFile = path.resolve(settings.configFile); - } - loadFile(options, config, process.cwd(), function (options) { - // Then merge over with the user settings (parsed from the cli). - // Note that merge protects and favours existing values over new values, - // and thus command line arguments get priority - options = utils.merge(settings, options); - - // legacy support - if (!Array.isArray(options.ignore)) { - options.ignore = [options.ignore]; - } - - if (!options.ignoreRoot) { - options.ignoreRoot = defaults.ignoreRoot; - } - - // blend the user ignore and the default ignore together - if (options.ignoreRoot && options.ignore) { - if (!Array.isArray(options.ignoreRoot)) { - options.ignoreRoot = [options.ignoreRoot]; - } - options.ignore = options.ignoreRoot.concat(options.ignore); - } else { - options.ignore = defaults.ignore.concat(options.ignore); - } - - - // add in any missing defaults - options = utils.merge(options, defaults); - - if (!options.script && !options.exec) { - var found = findAppScript(); - if (found) { - if (!options.args) { - options.args = []; - } - // if the script is found as a result of not being on the command - // line, then we move any of the pre double-dash args in execArgs - const n = options.scriptPosition === null ? - options.args.length : options.scriptPosition; - - options.execArgs = (options.execArgs || []) - .concat(options.args.splice(0, n)); - options.scriptPosition = null; - - options.script = found; - } - } - - mutateExecOptions(options); - - if (options.quiet) { - utils.quiet(); - } - - if (options.verbose) { - utils.debug = true; - } - - // simplify the ready callback to be called after the rules are normalised - // from strings to regexp through the rules lib. Note that this gets - // created *after* options is overwritten twice in the lines above. - var ready = function (options) { - normaliseRules(options, callback); - }; - - // if we didn't pick up a nodemon.json file & there's no cli ignores - // then try loading an old style .nodemonignore file - if (config.loaded.length === 0) { - var legacy = loadLegacyIgnore.bind(null, options, config, ready); - - // first try .nodemonignore, if that doesn't exist, try nodemon-ignore - return legacy('.nodemonignore', function () { - legacy('nodemon-ignore', function (options) { - ready(options); - }); - }); - } - - ready(options); - }); - }); -} - -/** - * Loads the old style nodemonignore files which is a list of patterns - * in a file to ignore - * - * @param {Object} options nodemon user options - * @param {Function} success - * @param {String} filename ignore file (.nodemonignore or nodemon-ignore) - * @param {Function} fail (optional) failure callback - */ -function loadLegacyIgnore(options, config, success, filename, fail) { - var ignoreFile = path.join(process.cwd(), filename); - - exists(ignoreFile, function (exists) { - if (exists) { - config.loaded.push(ignoreFile); - return parse(ignoreFile, function (error, rules) { - options.ignore = rules.raw; - success(options); - }); - } - - if (fail) { - fail(options); - } else { - success(options); - } - }); -} - -function normaliseRules(options, ready) { - // convert ignore and watch options to rules/regexp - rules.watch.add(options.watch); - rules.ignore.add(options.ignore); - - // normalise the watch and ignore arrays - options.watch = options.watch === false ? false : rules.rules.watch; - options.ignore = rules.rules.ignore; - - ready(options); -} - -/** - * Looks for a config in the current working directory, and a config in the - * user's home directory, merging the two together, giving priority to local - * config. This can then be overwritten later by command line arguments - * - * @param {Function} ready callback to pass loaded settings to - */ -function loadFile(options, config, dir, ready) { - if (!ready) { - ready = function () { }; - } - - var callback = function (settings) { - // prefer the local nodemon.json and fill in missing items using - // the global options - ready(utils.merge(settings, options)); - }; - - if (!dir) { - return callback({}); - } - - var filename = options.configFile || path.join(dir, 'nodemon.json'); - - if (config.loaded.indexOf(filename) !== -1) { - // don't bother re-parsing the same config file - return callback({}); - } - - fs.readFile(filename, 'utf8', function (err, data) { - if (err) { - if (err.code === 'ENOENT') { - if (!options.configFile && dir !== utils.home) { - // if no specified local config file and local nodemon.json - // doesn't exist, try the package.json - return loadPackageJSON(config, callback); - } - } - return callback({}); - } - - var settings = {}; - - try { - settings = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, '')); - if (!filename.endsWith('package.json') || settings.nodemonConfig) { - config.loaded.push(filename); - } - } catch (e) { - utils.log.fail('Failed to parse config ' + filename); - console.error(e); - process.exit(1); - } - - // options values will overwrite settings - callback(settings); - }); -} - -function loadPackageJSON(config, ready) { - if (!ready) { - ready = () => { }; - } - - const dir = process.cwd(); - const filename = path.join(dir, 'package.json'); - const packageLoadOptions = { configFile: filename }; - return loadFile(packageLoadOptions, config, dir, settings => { - ready(settings.nodemonConfig || {}); - }); -} - -function mutateExecOptions(options) { - // work out the execOptions based on the final config we have - options.execOptions = exec({ - script: options.script, - exec: options.exec, - args: options.args, - scriptPosition: options.scriptPosition, - nodeArgs: options.nodeArgs, - execArgs: options.execArgs, - ext: options.ext, - env: options.env, - }, options.execMap); - - // clean up values that we don't need at the top level - delete options.scriptPosition; - delete options.script; - delete options.args; - delete options.ext; - - return options; -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/help/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/help/index.js deleted file mode 100644 index 1054b6025..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/help/index.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -const supportsColor = require('supports-color'); - -module.exports = help; - -const highlight = supportsColor.stdout ? '\x1B\[$1m' : ''; - -function help(item) { - if (!item) { - item = 'help'; - } else if (item === true) { // if used with -h or --help and no args - item = 'help'; - } - - // cleanse the filename to only contain letters - // aka: /\W/g but figured this was eaiser to read - item = item.replace(/[^a-z]/gi, ''); - - try { - var dir = path.join(__dirname, '..', '..', 'doc', 'cli', item + '.txt'); - var body = fs.readFileSync(dir, 'utf8'); - return body.replace(/\\x1B\[(.)m/g, highlight); - } catch (e) { - return '"' + item + '" help can\'t be found'; - } -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/index.js deleted file mode 100644 index 0eca5c457..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./nodemon'); \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/index.js deleted file mode 100644 index 89db029b0..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - run: require('./run'), - watch: require('./watch').watch, -}; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/match.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/match.js deleted file mode 100644 index 2ac3b2910..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/match.js +++ /dev/null @@ -1,276 +0,0 @@ -const minimatch = require('minimatch'); -const path = require('path'); -const fs = require('fs'); -const debug = require('debug')('nodemon:match'); -const utils = require('../utils'); - -module.exports = match; -module.exports.rulesToMonitor = rulesToMonitor; - -function rulesToMonitor(watch, ignore, config) { - var monitor = []; - - if (!Array.isArray(ignore)) { - if (ignore) { - ignore = [ignore]; - } else { - ignore = []; - } - } - - if (!Array.isArray(watch)) { - if (watch) { - watch = [watch]; - } else { - watch = []; - } - } - - if (watch && watch.length) { - monitor = utils.clone(watch); - } - - if (ignore) { - [].push.apply(monitor, (ignore || []).map(function (rule) { - return '!' + rule; - })); - } - - var cwd = process.cwd(); - - // next check if the monitored paths are actual directories - // or just patterns - and expand the rule to include *.* - monitor = monitor.map(function (rule) { - var not = rule.slice(0, 1) === '!'; - - if (not) { - rule = rule.slice(1); - } - - if (rule === '.' || rule === '.*') { - rule = '*.*'; - } - - var dir = path.resolve(cwd, rule); - - try { - var stat = fs.statSync(dir); - if (stat.isDirectory()) { - rule = dir; - if (rule.slice(-1) !== '/') { - rule += '/'; - } - rule += '**/*'; - - // `!not` ... sorry. - if (!not) { - config.dirs.push(dir); - } - } else { - // ensures we end up in the check that tries to get a base directory - // and then adds it to the watch list - throw new Error(); - } - } catch (e) { - var base = tryBaseDir(dir); - if (!not && base) { - if (config.dirs.indexOf(base) === -1) { - config.dirs.push(base); - } - } - } - - if (rule.slice(-1) === '/') { - // just slap on a * anyway - rule += '*'; - } - - // if the url ends with * but not **/* and not *.* - // then convert to **/* - somehow it was missed :-\ - if (rule.slice(-4) !== '**/*' && - rule.slice(-1) === '*' && - rule.indexOf('*.') === -1) { - - if (rule.slice(-2) !== '**') { - rule += '*/*'; - } - } - - - return (not ? '!' : '') + rule; - }); - - return monitor; -} - -function tryBaseDir(dir) { - var stat; - if (/[?*\{\[]+/.test(dir)) { // if this is pattern, then try to find the base - try { - var base = path.dirname(dir.replace(/([?*\{\[]+.*$)/, 'foo')); - stat = fs.statSync(base); - if (stat.isDirectory()) { - return base; - } - } catch (error) { - // console.log(error); - } - } else { - try { - stat = fs.statSync(dir); - // if this path is actually a single file that exists, then just monitor - // that, *specifically*. - if (stat.isFile() || stat.isDirectory()) { - return dir; - } - } catch (e) { } - } - - return false; -} - -function match(files, monitor, ext) { - // sort the rules by highest specificity (based on number of slashes) - // ignore rules (!) get sorted highest as they take precedent - const cwd = process.cwd(); - var rules = monitor.sort(function (a, b) { - var r = b.split(path.sep).length - a.split(path.sep).length; - var aIsIgnore = a.slice(0, 1) === '!'; - var bIsIgnore = b.slice(0, 1) === '!'; - - if (aIsIgnore || bIsIgnore) { - if (aIsIgnore) { - return -1; - } - - return 1; - } - - if (r === 0) { - return b.length - a.length; - } - return r; - }).map(function (s) { - var prefix = s.slice(0, 1); - - if (prefix === '!') { - if (s.indexOf('!' + cwd) === 0) { - return s; - } - - // if it starts with a period, then let's get the relative path - if (s.indexOf('!.') === 0) { - return '!' + path.resolve(cwd, s.substring(1)); - } - - return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1); - } - - // if it starts with a period, then let's get the relative path - if (s.indexOf('.') === 0) { - return path.resolve(cwd, s); - } - - if (s.indexOf(cwd) === 0) { - return s; - } - - return '**' + (prefix !== path.sep ? path.sep : '') + s; - }); - - debug('rules', rules); - - var good = []; - var whitelist = []; // files that we won't check against the extension - var ignored = 0; - var watched = 0; - var usedRules = []; - var minimatchOpts = { - dot: true, - }; - - // enable case-insensitivity on Windows - if (utils.isWindows) { - minimatchOpts.nocase = true; - } - - files.forEach(function (file) { - file = path.resolve(cwd, file); - - var matched = false; - for (var i = 0; i < rules.length; i++) { - if (rules[i].slice(0, 1) === '!') { - if (!minimatch(file, rules[i], minimatchOpts)) { - debug('ignored', file, 'rule:', rules[i]); - ignored++; - matched = true; - break; - } - } else { - debug('matched', file, 'rule:', rules[i]); - if (minimatch(file, rules[i], minimatchOpts)) { - watched++; - - // don't repeat the output if a rule is matched - if (usedRules.indexOf(rules[i]) === -1) { - usedRules.push(rules[i]); - utils.log.detail('matched rule: ' + rules[i]); - } - - // if the rule doesn't match the WATCH EVERYTHING - // but *does* match a rule that ends with *.*, then - // white list it - in that we don't run it through - // the extension check too. - if (rules[i] !== '**' + path.sep + '*.*' && - rules[i].slice(-3) === '*.*') { - whitelist.push(file); - } else if (path.basename(file) === path.basename(rules[i])) { - // if the file matches the actual rule, then it's put on whitelist - whitelist.push(file); - } else { - good.push(file); - } - matched = true; - break; - } else { - // utils.log.detail('no match: ' + rules[i], file); - } - } - } - if (!matched) { - ignored++; - } - }); - - debug('good', good) - - // finally check the good files against the extensions that we're monitoring - if (ext) { - if (ext.indexOf(',') === -1) { - ext = '**/*.' + ext; - } else { - ext = '**/*.{' + ext + '}'; - } - - good = good.filter(function (file) { - // only compare the filename to the extension test - return minimatch(path.basename(file), ext, minimatchOpts); - }); - } // else assume *.* - - var result = good.concat(whitelist); - - if (utils.isWindows) { - // fix for windows testing - I *think* this is okay to do - result = result.map(function (file) { - return file.slice(0, 1).toLowerCase() + file.slice(1); - }); - } - - return { - result: result, - ignored: ignored, - watched: watched, - total: files.length, - }; -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/run.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/run.js deleted file mode 100644 index cbd905c04..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/run.js +++ /dev/null @@ -1,546 +0,0 @@ -var debug = require('debug')('nodemon:run'); -const statSync = require('fs').statSync; -var utils = require('../utils'); -var bus = utils.bus; -var childProcess = require('child_process'); -var spawn = childProcess.spawn; -var exec = childProcess.exec; -var execSync = childProcess.execSync; -var fork = childProcess.fork; -var watch = require('./watch').watch; -var config = require('../config'); -var child = null; // the actual child process we spawn -var killedAfterChange = false; -var noop = () => {}; -var restart = null; -var psTree = require('pstree.remy'); -var path = require('path'); -var signals = require('./signals'); -const osRelease = parseInt(require('os').release().split('.')[0], 10); - -function run(options) { - var cmd = config.command.raw; - // moved up - // we need restart function below in the global scope for run.kill - /*jshint validthis:true*/ - restart = run.bind(this, options); - run.restart = restart; - - // binding options with instance of run - // so that we can use it in run.kill - run.options = options; - - var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0; - if (runCmd) { - utils.log.status('starting `' + config.command.string + '`'); - } else { - // should just watch file if command is not to be run - // had another alternate approach - // to stop process being forked/spawned in the below code - // but this approach does early exit and makes code cleaner - debug('start watch on: %s', config.options.watch); - if (config.options.watch !== false) { - watch(); - return; - } - } - - config.lastStarted = Date.now(); - - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - if (config.options.stdin === false) { - stdio = [process.stdin, process.stdout, process.stderr]; - } - - var sh = 'sh'; - var shFlag = '-c'; - - const binPath = process.cwd() + '/node_modules/.bin'; - - const spawnOptions = { - env: Object.assign({}, process.env, options.execOptions.env, { - PATH: binPath + path.delimiter + process.env.PATH, - }), - stdio: stdio, - }; - - var executable = cmd.executable; - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - if (executable.indexOf('/') !== -1) { - executable = executable - .split(' ') - .map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }) - .join(' '); - } - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - spawnOptions.windowsHide = true; - } - - var args = runCmd ? utils.stringify(executable, cmd.args) : ':'; - var spawnArgs = [sh, [shFlag, args], spawnOptions]; - - const firstArg = cmd.args[0] || ''; - - var inBinPath = false; - try { - inBinPath = statSync(`${binPath}/${executable}`).isFile(); - } catch (e) {} - - // hasStdio allows us to correctly handle stdin piping - // see: https://git.io/vNtX3 - const hasStdio = utils.satisfies('>= 6.4.0 || < 5'); - - // forking helps with sub-process handling and tends to clean up better - // than spawning, but it should only be used under specific conditions - const shouldFork = - !config.options.spawn && - !inBinPath && - !(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg - firstArg !== 'inspect' && // don't fork it's `inspect` debugger - executable === 'node' && // only fork if node - utils.version.major > 4; // only fork if node version > 4 - - if (shouldFork) { - // this assumes the first argument is the script and slices it out, since - // we're forking - var forkArgs = cmd.args.slice(1); - var env = utils.merge(options.execOptions.env, process.env); - stdio.push('ipc'); - const forkOptions = { - env: env, - stdio: stdio, - silent: !hasStdio, - }; - if (utils.isWindows) { - forkOptions.windowsHide = true; - } - child = fork(options.execOptions.script, forkArgs, forkOptions); - utils.log.detail('forking'); - debug('fork', sh, shFlag, args); - } else { - utils.log.detail('spawning'); - child = spawn.apply(null, spawnArgs); - debug('spawn', sh, shFlag, args); - } - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - - if (shouldFork) { - child.on('message', function (message, sendHandle) { - bus.emit('message', message, sendHandle); - }); - } - } - - bus.emit('start'); - - utils.log.detail('child pid: ' + child.pid); - - child.on('error', function (error) { - bus.emit('error', error); - if (error.code === 'ENOENT') { - utils.log.error('unable to run executable: "' + cmd.executable + '"'); - process.exit(1); - } else { - utils.log.error('failed to start child process: ' + error.code); - throw error; - } - }); - - child.on('exit', function (code, signal) { - if (child && child.stdin) { - process.stdin.unpipe(child.stdin); - } - - if (code === 127) { - utils.log.error( - 'failed to start process, "' + cmd.executable + '" exec not found' - ); - bus.emit('error', code); - process.exit(); - } - - // If the command failed with code 2, it may or may not be a syntax error - // See: http://git.io/fNOAR - // We will only assume a parse error, if the child failed quickly - if (code === 2 && Date.now() < config.lastStarted + 500) { - utils.log.error('process failed, unhandled exit code (2)'); - utils.log.error(''); - utils.log.error('Either the command has a syntax error,'); - utils.log.error('or it is exiting with reserved code 2.'); - utils.log.error(''); - utils.log.error('To keep nodemon running even after a code 2,'); - utils.log.error('add this to the end of your command: || exit 1'); - utils.log.error(''); - utils.log.error('Read more here: https://git.io/fNOAG'); - utils.log.error(''); - utils.log.error('nodemon will stop now so that you can fix the command.'); - utils.log.error(''); - bus.emit('error', code); - process.exit(); - } - - // In case we killed the app ourselves, set the signal thusly - if (killedAfterChange) { - killedAfterChange = false; - signal = config.signal; - } - // this is nasty, but it gives it windows support - if (utils.isWindows && signal === 'SIGTERM') { - signal = config.signal; - } - - if (signal === config.signal || code === 0) { - // this was a clean exit, so emit exit, rather than crash - debug('bus.emit(exit) via ' + config.signal); - bus.emit('exit', signal); - - // exit the monitor, but do it gracefully - if (signal === config.signal) { - return restart(); - } - - if (code === 0) { - // clean exit - wait until file change to restart - if (runCmd) { - utils.log.status('clean exit - waiting for changes before restart'); - } - child = null; - } - } else { - bus.emit('crash'); - if (options.exitcrash) { - utils.log.fail('app crashed'); - if (!config.required) { - process.exit(1); - } - } else { - utils.log.fail( - 'app crashed - waiting for file changes before' + ' starting...' - ); - child = null; - } - } - - if (config.options.restartable) { - // stdin needs to kick in again to be able to listen to the - // restart command - process.stdin.resume(); - } - }); - - // moved the run.kill outside to handle both the cases - // intial start - // no start - - // connect stdin to the child process (options.stdin is on by default) - if (options.stdin) { - process.stdin.resume(); - // FIXME decide whether or not we need to decide the encoding - // process.stdin.setEncoding('utf8'); - - // swallow the stdin error if it happens - // ref: https://github.com/remy/nodemon/issues/1195 - if (hasStdio) { - child.stdin.on('error', () => {}); - process.stdin.pipe(child.stdin); - } else { - if (child.stdout) { - child.stdout.pipe(process.stdout); - } else { - utils.log.error( - 'running an unsupported version of node ' + process.version - ); - utils.log.error( - 'nodemon may not work as expected - ' + - 'please consider upgrading to LTS' - ); - } - } - - bus.once('exit', function () { - if (child && process.stdin.unpipe) { - // node > 0.8 - process.stdin.unpipe(child.stdin); - } - }); - } - - debug('start watch on: %s', config.options.watch); - if (config.options.watch !== false) { - watch(); - } -} - -function waitForSubProcesses(pid, callback) { - debug('checking ps tree for pids of ' + pid); - psTree(pid, (err, pids) => { - if (!pids.length) { - return callback(); - } - - utils.log.status( - `still waiting for ${pids.length} sub-process${ - pids.length > 2 ? 'es' : '' - } to finish...` - ); - setTimeout(() => waitForSubProcesses(pid, callback), 1000); - }); -} - -function kill(child, signal, callback) { - if (!callback) { - callback = noop; - } - - if (utils.isWindows) { - const taskKill = () => { - try { - exec('taskkill /pid ' + child.pid + ' /T /F'); - } catch (e) { - utils.log.error('Could not shutdown sub process cleanly'); - } - }; - - // We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the - // same way it is handled on a UNIX system: We are performing - // a hard shutdown without waiting for the process to clean-up. - if (signal === 'SIGKILL' || osRelease < 10 || signal === 'SIGUSR2' || signal==="SIGUSR1" ) { - debug('terminating process group by force: %s', child.pid); - - // We are using the taskkill utility to terminate the whole - // process group ('/t') of the child ('/pid') by force ('/f'). - // We need to end all sub processes, because the 'child' - // process in this context is actually a cmd.exe wrapper. - taskKill(); - callback(); - return; - } - - try { - // We are using the Windows Management Instrumentation Command-line - // (wmic.exe) to resolve the sub-child process identifier, because the - // 'child' process in this context is actually a cmd.exe wrapper. - // We want to send the termination signal directly to the node process. - // The '2> nul' silences the no process found error message. - const resultBuffer = execSync( - `wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul` - ); - const result = resultBuffer.toString().match(/^[0-9]+/m); - - // If there is no sub-child process we fall back to the child process. - const processId = Array.isArray(result) ? result[0] : child.pid; - - debug('sending kill signal SIGINT to process: %s', processId); - - // We are using the standalone 'windows-kill' executable to send the - // standard POSIX signal 'SIGINT' to the node process. This fixes #1720. - const windowsKill = path.normalize( - `${__dirname}/../../bin/windows-kill.exe` - ); - - // We have to detach the 'windows-kill' execution completely from this - // process group to avoid terminating the nodemon process itself. - // See: https://github.com/alirdn/windows-kill#how-it-works--limitations - // - // Therefore we are using 'start' to create a new cmd.exe context. - // The '/min' option hides the new terminal window and the '/wait' - // option lets the process wait for the command to finish. - - execSync( - `start "windows-kill" /min /wait "${windowsKill}" -SIGINT ${processId}` - ); - } catch (e) { - taskKill(); - } - callback(); - } else { - // we use psTree to kill the full subtree of nodemon, because when - // spawning processes like `coffee` under the `--debug` flag, it'll spawn - // it's own child, and that can't be killed by nodemon, so psTree gives us - // an array of PIDs that have spawned under nodemon, and we send each the - // configured signal (default: SIGUSR2) signal, which fixes #335 - // note that psTree also works if `ps` is missing by looking in /proc - let sig = signal.replace('SIG', ''); - - psTree(child.pid, function (err, pids) { - // if ps isn't native to the OS, then we need to send the numeric value - // for the signal during the kill, `signals` is a lookup table for that. - if (!psTree.hasPS) { - sig = signals[signal]; - } - - // the sub processes need to be killed from smallest to largest - debug('sending kill signal to ' + pids.join(', ')); - - child.kill(signal); - - pids.sort().forEach((pid) => exec(`kill -${sig} ${pid}`, noop)); - - waitForSubProcesses(child.pid, () => { - // finally kill the main user process - exec(`kill -${sig} ${child.pid}`, callback); - }); - }); - } -} - -run.kill = function (noRestart, callback) { - // I hate code like this :( - Remy (author of said code) - if (typeof noRestart === 'function') { - callback = noRestart; - noRestart = false; - } - - if (!callback) { - callback = noop; - } - - if (child !== null) { - // if the stdin piping is on, we need to unpipe, but also close stdin on - // the child, otherwise linux can throw EPIPE or ECONNRESET errors. - if (run.options.stdin) { - process.stdin.unpipe(child.stdin); - } - - // For the on('exit', ...) handler above the following looks like a - // crash, so we set the killedAfterChange flag if a restart is planned - if (!noRestart) { - killedAfterChange = true; - } - - /* Now kill the entire subtree of processes belonging to nodemon */ - var oldPid = child.pid; - if (child) { - kill(child, config.signal, function () { - // this seems to fix the 0.11.x issue with the "rs" restart command, - // though I'm unsure why. it seems like more data is streamed in to - // stdin after we close. - if (child && run.options.stdin && child.stdin && oldPid === child.pid) { - child.stdin.end(); - } - callback(); - }); - } - } else if (!noRestart) { - // if there's no child, then we need to manually start the process - // this is because as there was no child, the child.on('exit') event - // handler doesn't exist which would normally trigger the restart. - bus.once('start', callback); - run.restart(); - } else { - callback(); - } -}; - -run.restart = noop; - -bus.on('quit', function onQuit(code) { - if (code === undefined) { - code = 0; - } - - // remove event listener - var exitTimer = null; - var exit = function () { - clearTimeout(exitTimer); - exit = noop; // null out in case of race condition - child = null; - if (!config.required) { - // Execute all other quit listeners. - bus.listeners('quit').forEach(function (listener) { - if (listener !== onQuit) { - listener(); - } - }); - process.exit(code); - } else { - bus.emit('exit'); - } - }; - - // if we're not running already, don't bother with trying to kill - if (config.run === false) { - return exit(); - } - - // immediately try to stop any polling - config.run = false; - - if (child) { - // give up waiting for the kids after 10 seconds - exitTimer = setTimeout(exit, 10 * 1000); - child.removeAllListeners('exit'); - child.once('exit', exit); - - kill(child, 'SIGINT'); - } else { - exit(); - } -}); - -bus.on('restart', function () { - // run.kill will send a SIGINT to the child process, which will cause it - // to terminate, which in turn uses the 'exit' event handler to restart - run.kill(); -}); - -// remove the child file on exit -process.on('exit', function () { - utils.log.detail('exiting'); - if (child) { - child.kill(); - } -}); - -// because windows borks when listening for the SIG* events -if (!utils.isWindows) { - bus.once('boot', () => { - // usual suspect: ctrl+c exit - process.once('SIGINT', () => bus.emit('quit', 130)); - process.once('SIGTERM', () => { - bus.emit('quit', 143); - if (child) { - child.kill('SIGTERM'); - } - }); - }); -} - -module.exports = run; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/signals.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/signals.js deleted file mode 100644 index daff6e053..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/signals.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = { - SIGHUP: 1, - SIGINT: 2, - SIGQUIT: 3, - SIGILL: 4, - SIGTRAP: 5, - SIGABRT: 6, - SIGBUS: 7, - SIGFPE: 8, - SIGKILL: 9, - SIGUSR1: 10, - SIGSEGV: 11, - SIGUSR2: 12, - SIGPIPE: 13, - SIGALRM: 14, - SIGTERM: 15, - SIGSTKFLT: 16, - SIGCHLD: 17, - SIGCONT: 18, - SIGSTOP: 19, - SIGTSTP: 20, - SIGTTIN: 21, - SIGTTOU: 22, - SIGURG: 23, - SIGXCPU: 24, - SIGXFSZ: 25, - SIGVTALRM: 26, - SIGPROF: 27, - SIGWINCH: 28, - SIGIO: 29, - SIGPWR: 30, - SIGSYS: 31, - SIGRTMIN: 35, -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/watch.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/watch.js deleted file mode 100644 index 1ef14086d..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/monitor/watch.js +++ /dev/null @@ -1,239 +0,0 @@ -module.exports.watch = watch; -module.exports.resetWatchers = resetWatchers; - -var debug = require('debug')('nodemon:watch'); -var debugRoot = require('debug')('nodemon'); -var chokidar = require('chokidar'); -var undefsafe = require('undefsafe'); -var config = require('../config'); -var path = require('path'); -var utils = require('../utils'); -var bus = utils.bus; -var match = require('./match'); -var watchers = []; -var debouncedBus; - -bus.on('reset', resetWatchers); - -function resetWatchers() { - debugRoot('resetting watchers'); - watchers.forEach(function (watcher) { - watcher.close(); - }); - watchers = []; -} - -function watch() { - if (watchers.length) { - debug('early exit on watch, still watching (%s)', watchers.length); - return; - } - - var dirs = [].slice.call(config.dirs); - - debugRoot('start watch on: %s', dirs.join(', ')); - const rootIgnored = config.options.ignore; - debugRoot('ignored', rootIgnored); - - var watchedFiles = []; - - const promise = new Promise(function (resolve) { - const dotFilePattern = /[/\\]\./; - var ignored = match.rulesToMonitor( - [], // not needed - Array.from(rootIgnored), - config - ).map(pattern => pattern.slice(1)); - - const addDotFile = dirs.filter(dir => dir.match(dotFilePattern)); - - // don't ignore dotfiles if explicitly watched. - if (addDotFile.length === 0) { - ignored.push(dotFilePattern); - } - - var watchOptions = { - ignorePermissionErrors: true, - ignored: ignored, - persistent: true, - usePolling: config.options.legacyWatch || false, - interval: config.options.pollingInterval, - // note to future developer: I've gone back and forth on adding `cwd` - // to the props and in some cases it fixes bugs but typically it causes - // bugs elsewhere (since nodemon is used is so many ways). the final - // decision is to *not* use it at all and work around it - // cwd: ... - }; - - if (utils.isWindows) { - watchOptions.disableGlobbing = true; - } - - if (process.env.TEST) { - watchOptions.useFsEvents = false; - } - - var watcher = chokidar.watch( - dirs, - Object.assign({}, watchOptions, config.options.watchOptions || {}) - ); - - watcher.ready = false; - - var total = 0; - - watcher.on('change', filterAndRestart); - watcher.on('add', function (file) { - if (watcher.ready) { - return filterAndRestart(file); - } - - watchedFiles.push(file); - bus.emit('watching', file); - debug('chokidar watching: %s', file); - }); - watcher.on('ready', function () { - watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes - total = watchedFiles.length; - watcher.ready = true; - resolve(total); - debugRoot('watch is complete'); - }); - - watcher.on('error', function (error) { - if (error.code === 'EINVAL') { - utils.log.error( - 'Internal watch failed. Likely cause: too many ' + - 'files being watched (perhaps from the root of a drive?\n' + - 'See https://github.com/paulmillr/chokidar/issues/229 for details' - ); - } else { - utils.log.error('Internal watch failed: ' + error.message); - process.exit(1); - } - }); - - watchers.push(watcher); - }); - - return promise.catch(e => { - // this is a core error and it should break nodemon - so I have to break - // out of a promise using the setTimeout - setTimeout(() => { - throw e; - }); - }).then(function () { - utils.log.detail(`watching ${watchedFiles.length} file${ - watchedFiles.length === 1 ? '' : 's'}`); - return watchedFiles; - }); -} - -function filterAndRestart(files) { - if (!Array.isArray(files)) { - files = [files]; - } - - if (files.length) { - var cwd = process.cwd(); - if (this.options && this.options.cwd) { - cwd = this.options.cwd; - } - - utils.log.detail( - 'files triggering change check: ' + - files - .map(file => { - const res = path.relative(cwd, file); - return res; - }) - .join(', ') - ); - - // make sure the path is right and drop an empty - // filenames (sometimes on windows) - files = files.filter(Boolean).map(file => { - return path.relative(process.cwd(), path.relative(cwd, file)); - }); - - if (utils.isWindows) { - // ensure the drive letter is in uppercase (c:\foo -> C:\foo) - files = files.map(f => { - if (f.indexOf(':') === -1) { return f; } - return f[0].toUpperCase() + f.slice(1); - }); - } - - - debug('filterAndRestart on', files); - - var matched = match( - files, - config.options.monitor, - undefsafe(config, 'options.execOptions.ext') - ); - - debug('matched?', JSON.stringify(matched)); - - // if there's no matches, then test to see if the changed file is the - // running script, if so, let's allow a restart - if (config.options.execOptions && config.options.execOptions.script) { - const script = path.resolve(config.options.execOptions.script); - if (matched.result.length === 0 && script) { - const length = script.length; - files.find(file => { - if (file.substr(-length, length) === script) { - matched = { - result: [file], - total: 1, - }; - return true; - } - }); - } - } - - utils.log.detail( - 'changes after filters (before/after): ' + - [files.length, matched.result.length].join('/') - ); - - // reset the last check so we're only looking at recently modified files - config.lastStarted = Date.now(); - - if (matched.result.length) { - if (config.options.delay > 0) { - utils.log.detail('delaying restart for ' + config.options.delay + 'ms'); - if (debouncedBus === undefined) { - debouncedBus = debounce(restartBus, config.options.delay); - } - debouncedBus(matched); - } else { - return restartBus(matched); - } - } - } -} - -function restartBus(matched) { - utils.log.status('restarting due to changes...'); - matched.result.map(file => { - utils.log.detail(path.relative(process.cwd(), file)); - }); - - if (config.options.verbose) { - utils.log._log(''); - } - - bus.emit('restart', matched.result); -} - -function debounce(fn, delay) { - var timer = null; - return function () { - const context = this; - const args = arguments; - clearTimeout(timer); - timer = setTimeout(() =>fn.apply(context, args), delay); - }; -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/nodemon.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/nodemon.js deleted file mode 100644 index ce649cb6d..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/nodemon.js +++ /dev/null @@ -1,311 +0,0 @@ -var debug = require('debug')('nodemon'); -var path = require('path'); -var monitor = require('./monitor'); -var cli = require('./cli'); -var version = require('./version'); -var util = require('util'); -var utils = require('./utils'); -var bus = utils.bus; -var help = require('./help'); -var config = require('./config'); -var spawn = require('./spawn'); -const defaults = require('./config/defaults') -var eventHandlers = {}; - -// this is fairly dirty, but theoretically sound since it's part of the -// stable module API -config.required = utils.isRequired; - -function nodemon(settings) { - bus.emit('boot'); - nodemon.reset(); - - // allow the cli string as the argument to nodemon, and allow for - // `node nodemon -V app.js` or just `-V app.js` - if (typeof settings === 'string') { - settings = settings.trim(); - if (settings.indexOf('node') !== 0) { - if (settings.indexOf('nodemon') !== 0) { - settings = 'nodemon ' + settings; - } - settings = 'node ' + settings; - } - settings = cli.parse(settings); - } - - // set the debug flag as early as possible to get all the detailed logging - if (settings.verbose) { - utils.debug = true; - } - - if (settings.help) { - if (process.stdout.isTTY) { - process.stdout._handle.setBlocking(true); // nodejs/node#6456 - } - console.log(help(settings.help)); - if (!config.required) { - process.exit(0); - } - } - - if (settings.version) { - version().then(function (v) { - console.log(v); - if (!config.required) { - process.exit(0); - } - }); - return; - } - - // nodemon tools like grunt-nodemon. This affects where - // the script is being run from, and will affect where - // nodemon looks for the nodemon.json files - if (settings.cwd) { - // this is protection to make sure we haven't dont the chdir already... - // say like in cli/parse.js (which is where we do this once already!) - if (process.cwd() !== path.resolve(config.system.cwd, settings.cwd)) { - process.chdir(settings.cwd); - } - } - - const cwd = process.cwd(); - - config.load(settings, function (config) { - if (!config.options.dump && !config.options.execOptions.script && - config.options.execOptions.exec === 'node') { - if (!config.required) { - console.log(help('usage')); - process.exit(); - } - return; - } - - // before we print anything, update the colour setting on logging - utils.colours = config.options.colours; - - // always echo out the current version - utils.log.info(version.pinned); - - const cwd = process.cwd(); - - if (config.options.cwd) { - utils.log.detail('process root: ' + cwd); - } - - config.loaded.map(file => file.replace(cwd, '.')).forEach(file => { - utils.log.detail('reading config ' + file); - }); - - if (config.options.stdin && config.options.restartable) { - // allow nodemon to restart when the use types 'rs\n' - process.stdin.resume(); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', data => { - const str = data.toString().trim().toLowerCase(); - - // if the keys entered match the restartable value, then restart! - if (str === config.options.restartable) { - bus.emit('restart'); - } else if (data.charCodeAt(0) === 12) { // ctrl+l - console.clear(); - } - }); - } else if (config.options.stdin) { - // so let's make sure we don't eat the key presses - // but also, since we're wrapping, watch out for - // special keys, like ctrl+c x 2 or '.exit' or ctrl+d or ctrl+l - var ctrlC = false; - var buffer = ''; - - process.stdin.on('data', function (data) { - data = data.toString(); - buffer += data; - const chr = data.charCodeAt(0); - - // if restartable, echo back - if (chr === 3) { - if (ctrlC) { - process.exit(0); - } - - ctrlC = true; - return; - } else if (buffer === '.exit' || chr === 4) { // ctrl+d - process.exit(); - } else if (chr === 13 || chr === 10) { // enter / carriage return - buffer = ''; - } else if (chr === 12) { // ctrl+l - console.clear(); - buffer = ''; - } - ctrlC = false; - }); - if (process.stdin.setRawMode) { - process.stdin.setRawMode(true); - } - } - - if (config.options.restartable) { - utils.log.info('to restart at any time, enter `' + - config.options.restartable + '`'); - } - - if (!config.required) { - const restartSignal = config.options.signal === 'SIGUSR2' ? 'SIGHUP' : 'SIGUSR2'; - process.on(restartSignal, nodemon.restart); - utils.bus.on('error', () => { - utils.log.fail((new Error().stack)); - }); - utils.log.detail((config.options.restartable ? 'or ' : '') + 'send ' + - restartSignal + ' to ' + process.pid + ' to restart'); - } - - const ignoring = config.options.monitor.map(function (rule) { - if (rule.slice(0, 1) !== '!') { - return false; - } - - rule = rule.slice(1); - - // don't notify of default ignores - if (defaults.ignoreRoot.indexOf(rule) !== -1) { - return false; - return rule.slice(3).slice(0, -3); - } - - if (rule.startsWith(cwd)) { - return rule.replace(cwd, '.'); - } - - return rule; - }).filter(Boolean).join(' '); - if (ignoring) utils.log.detail('ignoring: ' + ignoring); - - utils.log.info('watching path(s): ' + config.options.monitor.map(function (rule) { - if (rule.slice(0, 1) !== '!') { - try { - rule = path.relative(process.cwd(), rule); - } catch (e) {} - - return rule; - } - - return false; - }).filter(Boolean).join(' ')); - - utils.log.info('watching extensions: ' + (config.options.execOptions.ext || '(all)')); - - if (config.options.dump) { - utils.log._log('log', '--------------'); - utils.log._log('log', 'node: ' + process.version); - utils.log._log('log', 'nodemon: ' + version.pinned); - utils.log._log('log', 'command: ' + process.argv.join(' ')); - utils.log._log('log', 'cwd: ' + cwd); - utils.log._log('log', ['OS:', process.platform, process.arch].join(' ')); - utils.log._log('log', '--------------'); - utils.log._log('log', util.inspect(config, { depth: null })); - utils.log._log('log', '--------------'); - if (!config.required) { - process.exit(); - } - - return; - } - - config.run = true; - - if (config.options.stdout === false) { - nodemon.on('start', function () { - nodemon.stdout = bus.stdout; - nodemon.stderr = bus.stderr; - - bus.emit('readable'); - }); - } - - if (config.options.events && Object.keys(config.options.events).length) { - Object.keys(config.options.events).forEach(function (key) { - utils.log.detail('bind ' + key + ' -> `' + - config.options.events[key] + '`'); - nodemon.on(key, function () { - if (config.options && config.options.events) { - spawn(config.options.events[key], config, - [].slice.apply(arguments)); - } - }); - }); - } - - monitor.run(config.options); - - }); - - return nodemon; -} - -nodemon.restart = function () { - utils.log.status('restarting child process'); - bus.emit('restart'); - return nodemon; -}; - -nodemon.addListener = nodemon.on = function (event, handler) { - if (!eventHandlers[event]) { eventHandlers[event] = []; } - eventHandlers[event].push(handler); - bus.on(event, handler); - return nodemon; -}; - -nodemon.once = function (event, handler) { - if (!eventHandlers[event]) { eventHandlers[event] = []; } - eventHandlers[event].push(handler); - bus.once(event, function () { - debug('bus.once(%s)', event); - eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); - handler.apply(this, arguments); - }); - return nodemon; -}; - -nodemon.emit = function () { - bus.emit.apply(bus, [].slice.call(arguments)); - return nodemon; -}; - -nodemon.removeAllListeners = function (event) { - // unbind only the `nodemon.on` event handlers - Object.keys(eventHandlers).filter(function (e) { - return event ? e === event : true; - }).forEach(function (event) { - eventHandlers[event].forEach(function (handler) { - bus.removeListener(event, handler); - eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); - }); - }); - - return nodemon; -}; - -nodemon.reset = function (done) { - bus.emit('reset', done); -}; - -bus.on('reset', function (done) { - debug('reset'); - nodemon.removeAllListeners(); - monitor.run.kill(true, function () { - utils.reset(); - config.reset(); - config.run = false; - if (done) { - done(); - } - }); -}); - -// expose the full config -nodemon.config = config; - -module.exports = nodemon; - diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/add.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/add.js deleted file mode 100644 index de85bb7fd..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/add.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -// internal -var reEscComments = /\\#/g; -// note that '^^' is used in place of escaped comments -var reUnescapeComments = /\^\^/g; -var reComments = /#.*$/; -var reEscapeChars = /[.|\-[\]()\\]/g; -var reAsterisk = /\*/g; - -module.exports = add; - -/** - * Converts file patterns or regular expressions to nodemon - * compatible RegExp matching rules. Note: the `rules` argument - * object is modified to include the new rule and new RegExp - * - * ### Example: - * - * var rules = { watch: [], ignore: [] }; - * add(rules, 'watch', '*.js'); - * add(rules, 'ignore', '/public/'); - * add(rules, 'watch', ':(\d)*\.js'); // note: string based regexp - * add(rules, 'watch', /\d*\.js/); - * - * @param {Object} rules containing `watch` and `ignore`. Also updated during - * execution - * @param {String} which must be either "watch" or "ignore" - * @param {String|RegExp} the actual rule. - */ -function add(rules, which, rule) { - if (!{ ignore: 1, watch: 1}[which]) { - throw new Error('rules/index.js#add requires "ignore" or "watch" as the ' + - 'first argument'); - } - - if (Array.isArray(rule)) { - rule.forEach(function (rule) { - add(rules, which, rule); - }); - return; - } - - // support the rule being a RegExp, but reformat it to - // the custom : format that we're working with. - if (rule instanceof RegExp) { - // rule = ':' + rule.toString().replace(/^\/(.*?)\/$/g, '$1'); - utils.log.error('RegExp format no longer supported, but globs are.'); - return; - } - - // remove comments and trim lines - // this mess of replace methods is escaping "\#" to allow for emacs temp files - - // first up strip comments and remove blank head or tails - rule = (rule || '').replace(reEscComments, '^^') - .replace(reComments, '') - .replace(reUnescapeComments, '#').trim(); - - var regexp = false; - - if (typeof rule === 'string' && rule.substring(0, 1) === ':') { - rule = rule.substring(1); - utils.log.error('RegExp no longer supported: ' + rule); - regexp = true; - } else if (rule.length === 0) { - // blank line (or it was a comment) - return; - } - - if (regexp) { - // rules[which].push(rule); - } else { - // rule = rule.replace(reEscapeChars, '\\$&') - // .replace(reAsterisk, '.*'); - - rules[which].push(rule); - // compile a regexp of all the rules for this ignore or watch - var re = rules[which].map(function (rule) { - return rule.replace(reEscapeChars, '\\$&') - .replace(reAsterisk, '.*'); - }).join('|'); - - // used for the directory matching - rules[which].re = new RegExp(re); - } -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/index.js deleted file mode 100644 index 04aa92f87..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; -var utils = require('../utils'); -var add = require('./add'); -var parse = require('./parse'); - -// exported -var rules = { ignore: [], watch: [] }; - -/** - * Loads a nodemon config file and populates the ignore - * and watch rules with it's contents, and calls callback - * with the new rules - * - * @param {String} filename - * @param {Function} callback - */ -function load(filename, callback) { - parse(filename, function (err, result) { - if (err) { - // we should have bombed already, but - utils.log.error(err); - callback(err); - } - - if (result.raw) { - result.raw.forEach(add.bind(null, rules, 'ignore')); - } else { - result.ignore.forEach(add.bind(null, rules, 'ignore')); - result.watch.forEach(add.bind(null, rules, 'watch')); - } - - callback(null, rules); - }); -} - -module.exports = { - reset: function () { // just used for testing - rules.ignore.length = rules.watch.length = 0; - delete rules.ignore.re; - delete rules.watch.re; - }, - load: load, - ignore: { - test: add.bind(null, rules, 'ignore'), - add: add.bind(null, rules, 'ignore'), - }, - watch: { - test: add.bind(null, rules, 'watch'), - add: add.bind(null, rules, 'watch'), - }, - add: add.bind(null, rules), - rules: rules, -}; \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/parse.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/parse.js deleted file mode 100644 index 6e1caceaa..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/rules/parse.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; -var fs = require('fs'); - -/** - * Parse the nodemon config file, supporting both old style - * plain text config file, and JSON version of the config - * - * @param {String} filename - * @param {Function} callback - */ -function parse(filename, callback) { - var rules = { - ignore: [], - watch: [], - }; - - fs.readFile(filename, 'utf8', function (err, content) { - - if (err) { - return callback(err); - } - - var json = null; - try { - json = JSON.parse(content); - } catch (e) {} - - if (json !== null) { - rules = { - ignore: json.ignore || [], - watch: json.watch || [], - }; - - return callback(null, rules); - } - - // otherwise return the raw file - return callback(null, { raw: content.split(/\n/) }); - }); -} - -module.exports = parse; - diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/spawn.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/spawn.js deleted file mode 100644 index 256734a01..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/spawn.js +++ /dev/null @@ -1,74 +0,0 @@ -const path = require('path'); -const utils = require('./utils'); -const merge = utils.merge; -const bus = utils.bus; -const spawn = require('child_process').spawn; - -module.exports = function spawnCommand(command, config, eventArgs) { - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - const env = merge(process.env, { FILENAME: eventArgs[0] }); - - var sh = 'sh'; - var shFlag = '-c'; - var spawnOptions = { - env: merge(config.options.execOptions.env, env), - stdio: stdio, - }; - - if (!Array.isArray(command)) { - command = [command]; - } - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - command = command.map(executable => { - if (executable.indexOf('/') === -1) { - return executable; - } - - return executable.split(' ').map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }).join(' '); - }); - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - spawnOptions.windowsHide = true; - } - - const args = command.join(' '); - const child = spawn(sh, [shFlag, args], spawnOptions); - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - } -}; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/bus.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/bus.js deleted file mode 100644 index 4e120c58d..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/bus.js +++ /dev/null @@ -1,44 +0,0 @@ -var events = require('events'); -var debug = require('debug')('nodemon'); -var util = require('util'); - -var Bus = function () { - events.EventEmitter.call(this); -}; - -util.inherits(Bus, events.EventEmitter); - -var bus = new Bus(); - -// /* -var collected = {}; -bus.on('newListener', function (event) { - debug('bus new listener: %s (%s)', event, bus.listeners(event).length); - if (!collected[event]) { - collected[event] = true; - bus.on(event, function () { - debug('bus emit: %s', event); - }); - } -}); - -// */ - -// proxy process messages (if forked) to the bus -process.on('message', function (event) { - debug('process.message(%s)', event); - bus.emit(event); -}); - -var emit = bus.emit; - -// if nodemon was spawned via a fork, allow upstream communication -// via process.send -if (process.send) { - bus.emit = function (event, data) { - process.send({ type: event, data: data }); - emit.apply(bus, arguments); - }; -} - -module.exports = bus; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/clone.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/clone.js deleted file mode 100644 index 6ba6330f3..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/clone.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = clone; - -// via http://stackoverflow.com/a/728694/22617 -function clone(obj) { - // Handle the 3 simple types, and null or undefined - if (null === obj || 'object' !== typeof obj) { - return obj; - } - - var copy; - - // Handle Date - if (obj instanceof Date) { - copy = new Date(); - copy.setTime(obj.getTime()); - return copy; - } - - // Handle Array - if (obj instanceof Array) { - copy = []; - for (var i = 0, len = obj.length; i < len; i++) { - copy[i] = clone(obj[i]); - } - return copy; - } - - // Handle Object - if (obj instanceof Object) { - copy = {}; - for (var attr in obj) { - if (obj.hasOwnProperty && obj.hasOwnProperty(attr)) { - copy[attr] = clone(obj[attr]); - } - } - return copy; - } - - throw new Error('Unable to copy obj! Its type isn\'t supported.'); -} \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/colour.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/colour.js deleted file mode 100644 index 8c1b59054..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/colour.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Encodes a string in a colour: red, yellow or green - * @param {String} c colour to highlight in - * @param {String} str the string to encode - * @return {String} coloured string for terminal printing - */ -function colour(c, str) { - return (colour[c] || colour.black) + str + colour.black; -} - -function strip(str) { - re.lastIndex = 0; // reset position - return str.replace(re, ''); -} - -colour.red = '\x1B[31m'; -colour.yellow = '\x1B[33m'; -colour.green = '\x1B[32m'; -colour.black = '\x1B[39m'; - -var reStr = Object.keys(colour).map(key => colour[key]).join('|'); -var re = new RegExp(('(' + reStr + ')').replace(/\[/g, '\\['), 'g'); - -colour.strip = strip; - -module.exports = colour; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/index.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/index.js deleted file mode 100644 index c4803383f..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/index.js +++ /dev/null @@ -1,102 +0,0 @@ -var noop = function () { }; -var path = require('path'); -const semver = require('semver'); -var version = process.versions.node.split('.') || [null, null, null]; - -var utils = (module.exports = { - semver: semver, - satisfies: test => semver.satisfies(process.versions.node, test), - version: { - major: parseInt(version[0] || 0, 10), - minor: parseInt(version[1] || 0, 10), - patch: parseInt(version[2] || 0, 10), - }, - clone: require('./clone'), - merge: require('./merge'), - bus: require('./bus'), - isWindows: process.platform === 'win32', - isMac: process.platform === 'darwin', - isLinux: process.platform === 'linux', - isRequired: (function () { - var p = module.parent; - while (p) { - // in electron.js engine it happens - if (!p.filename) { - return true; - } - if (p.filename.indexOf('bin' + path.sep + 'nodemon.js') !== -1) { - return false; - } - p = p.parent; - } - - return true; - })(), - home: process.env.HOME || process.env.HOMEPATH, - quiet: function () { - // nukes the logging - if (!this.debug) { - for (var method in utils.log) { - if (typeof utils.log[method] === 'function') { - utils.log[method] = noop; - } - } - } - }, - reset: function () { - if (!this.debug) { - for (var method in utils.log) { - if (typeof utils.log[method] === 'function') { - delete utils.log[method]; - } - } - } - this.debug = false; - }, - regexpToText: function (t) { - return t - .replace(/\.\*\\./g, '*.') - .replace(/\\{2}/g, '^^') - .replace(/\\/g, '') - .replace(/\^\^/g, '\\'); - }, - stringify: function (exec, args) { - // serializes an executable string and array of arguments into a string - args = args || []; - - return [exec] - .concat( - args.map(function (arg) { - // if an argument contains a space, we want to show it with quotes - // around it to indicate that it is a single argument - if (arg.length > 0 && arg.indexOf(' ') === -1) { - return arg; - } - // this should correctly escape nested quotes - return JSON.stringify(arg); - }) - ) - .join(' ') - .trim(); - }, -}); - -utils.log = require('./log')(utils.isRequired); - -Object.defineProperty(utils, 'debug', { - set: function (value) { - this.log.debug = value; - }, - get: function () { - return this.log.debug; - }, -}); - -Object.defineProperty(utils, 'colours', { - set: function (value) { - this.log.useColours = value; - }, - get: function () { - return this.log.useColours; - }, -}); diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/log.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/log.js deleted file mode 100644 index 65800872d..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/log.js +++ /dev/null @@ -1,82 +0,0 @@ -var colour = require('./colour'); -var bus = require('./bus'); -var required = false; -var useColours = true; - -var coding = { - log: 'black', - info: 'yellow', - status: 'green', - detail: 'yellow', - fail: 'red', - error: 'red', -}; - -function log(type, text) { - var msg = '[nodemon] ' + (text || ''); - - if (useColours) { - msg = colour(coding[type], msg); - } - - // always push the message through our bus, using nextTick - // to help testing and get _out of_ promises. - process.nextTick(() => { - bus.emit('log', { type: type, message: text, colour: msg }); - }); - - // but if we're running on the command line, also echo out - // question: should we actually just consume our own events? - if (!required) { - if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } - } -} - -var Logger = function (r) { - if (!(this instanceof Logger)) { - return new Logger(r); - } - this.required(r); - return this; -}; - -Object.keys(coding).forEach(function (type) { - Logger.prototype[type] = log.bind(null, type); -}); - -// detail is for messages that are turned on during debug -Logger.prototype.detail = function (msg) { - if (this.debug) { - log('detail', msg); - } -}; - -Logger.prototype.required = function (val) { - required = val; -}; - -Logger.prototype.debug = false; -Logger.prototype._log = function (type, msg) { - if (required) { - bus.emit('log', { type: type, message: msg || '', colour: msg || '' }); - } else if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } -}; - -Object.defineProperty(Logger.prototype, 'useColours', { - set: function (val) { - useColours = val; - }, - get: function () { - return useColours; - }, -}); - -module.exports = Logger; diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/merge.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/merge.js deleted file mode 100644 index 1f3440bd6..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/utils/merge.js +++ /dev/null @@ -1,47 +0,0 @@ -var clone = require('./clone'); - -module.exports = merge; - -function typesMatch(a, b) { - return (typeof a === typeof b) && (Array.isArray(a) === Array.isArray(b)); -} - -/** - * A deep merge of the source based on the target. - * @param {Object} source [description] - * @param {Object} target [description] - * @return {Object} [description] - */ -function merge(source, target, result) { - if (result === undefined) { - result = clone(source); - } - - // merge missing values from the target to the source - Object.getOwnPropertyNames(target).forEach(function (key) { - if (source[key] === undefined) { - result[key] = target[key]; - } - }); - - Object.getOwnPropertyNames(source).forEach(function (key) { - var value = source[key]; - - if (target[key] && typesMatch(value, target[key])) { - // merge empty values - if (value === '') { - result[key] = target[key]; - } - - if (Array.isArray(value)) { - if (value.length === 0 && target[key].length) { - result[key] = target[key].slice(0); - } - } else if (typeof value === 'object') { - result[key] = merge(value, target[key]); - } - } - }); - - return result; -} \ No newline at end of file diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/version.js b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/version.js deleted file mode 100644 index d0f510447..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/lib/version.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = version; -module.exports.pin = pin; - -var fs = require('fs'); -var path = require('path'); -var exec = require('child_process').exec; -var root = null; - -function pin() { - return version().then(function (v) { - version.pinned = v; - }); -} - -function version(callback) { - // first find the package.json as this will be our root - var promise = findPackage(path.dirname(module.parent.filename)) - .then(function (dir) { - // now try to load the package - var v = require(path.resolve(dir, 'package.json')).version; - - if (v && v !== '0.0.0-development') { - return v; - } - - root = dir; - - // else we're in development, give the commit out - // get the last commit and whether the working dir is dirty - var promises = [ - branch().catch(function () { return 'master'; }), - commit().catch(function () { return ''; }), - dirty().catch(function () { return 0; }), - ]; - - // use the cached result as the export - return Promise.all(promises).then(function (res) { - var branch = res[0]; - var commit = res[1]; - var dirtyCount = parseInt(res[2], 10); - var curr = branch + ': ' + commit; - if (dirtyCount !== 0) { - curr += ' (' + dirtyCount + ' dirty files)'; - } - - return curr; - }); - }).catch(function (error) { - console.log(error.stack); - throw error; - }); - - if (callback) { - promise.then(function (res) { - callback(null, res); - }, callback); - } - - return promise; -} - -function findPackage(dir) { - if (dir === '/') { - return Promise.reject(new Error('package not found')); - } - return new Promise(function (resolve) { - fs.stat(path.resolve(dir, 'package.json'), function (error, exists) { - if (error || !exists) { - return resolve(findPackage(path.resolve(dir, '..'))); - } - - resolve(dir); - }); - }); -} - -function command(cmd) { - return new Promise(function (resolve, reject) { - exec(cmd, { cwd: root }, function (err, stdout, stderr) { - var error = stderr.trim(); - if (error) { - return reject(new Error(error)); - } - resolve(stdout.split('\n').join('')); - }); - }); -} - -function commit() { - return command('git rev-parse HEAD'); -} - -function branch() { - return command('git rev-parse --abbrev-ref HEAD'); -} - -function dirty() { - return command('expr $(git status --porcelain 2>/dev/null| ' + - 'egrep "^(M| M)" | wc -l)'); -} diff --git a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/package.json b/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/package.json deleted file mode 100644 index 25542e3e6..000000000 --- a/.yarn/unplugged/nodemon-npm-2.0.22-2e71ccda0b/node_modules/nodemon/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "nodemon", - "homepage": "https://nodemon.io", - "author": { - "name": "Remy Sharp", - "url": "https://github.com/remy" - }, - "bin": { - "nodemon": "./bin/nodemon.js" - }, - "engines": { - "node": ">=8.10.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/remy/nodemon.git" - }, - "description": "Simple monitor script for use during development of a Node.js app.", - "keywords": [ - "cli", - "monitor", - "monitor", - "development", - "restart", - "autoload", - "reload", - "terminal" - ], - "license": "MIT", - "main": "./lib/nodemon", - "scripts": { - "commitmsg": "commitlint -e", - "coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js", - "lint": "eslint lib/**/*.js", - "test": "npm run lint && npm run spec", - "spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done", - "postspec": "npm run clean", - "clean": "rm -rf test/fixtures/test*.js test/fixtures/test*.md", - "web": "node web", - "semantic-release": "semantic-release", - "prepush": "npm run lint", - "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9" - }, - "devDependencies": { - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "async": "1.4.2", - "coffee-script": "~1.7.1", - "eslint": "^7.32.0", - "husky": "^7.0.4", - "mocha": "^2.5.3", - "nyc": "^15.1.0", - "proxyquire": "^1.8.0", - "semantic-release": "^18.0.0", - "should": "~4.0.0" - }, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^5.7.1", - "simple-update-notifier": "^1.0.7", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "version": "2.0.22", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/.ready b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/LICENSE b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/LICENSE deleted file mode 100644 index 57b7e3097..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -This license applies to all parts of protobuf.js except those files -either explicitly including or referencing a different license or -located in a directory containing a different LICENSE file. - ---- - -Copyright (c) 2016, Daniel Wirtz All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of its author, nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ---- - -Code generated by the command line utilities is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/README.md b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/README.md deleted file mode 100644 index b88c0229f..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/README.md +++ /dev/null @@ -1,740 +0,0 @@ -

protobuf.js

-

donate ❤

- -**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/)). - -**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [node.js](https://nodejs.org) and the browser. It's easy to use, blazingly fast and works out of the box with [.proto](https://developers.google.com/protocol-buffers/docs/proto) files! - -Contents --------- - -* [Installation](#installation)
- How to include protobuf.js in your project. - -* [Usage](#usage)
- A brief introduction to using the toolset. - - * [Valid Message](#valid-message) - * [Toolset](#toolset)
- -* [Examples](#examples)
- A few examples to get you started. - - * [Using .proto files](#using-proto-files) - * [Using JSON descriptors](#using-json-descriptors) - * [Using reflection only](#using-reflection-only) - * [Using custom classes](#using-custom-classes) - * [Using services](#using-services) - * [Usage with TypeScript](#usage-with-typescript)
- -* [Additional documentation](#additional-documentation)
- A list of available documentation resources. - -* [Performance](#performance)
- A few internals and a benchmark on performance. - -* [Compatibility](#compatibility)
- Notes on compatibility regarding browsers and optional libraries. - -* [Building](#building)
- How to build the library and its components yourself. - -Installation ---------------- - -### node.js - -``` -$> npm install protobufjs [--save --save-prefix=~] -``` - -```js -var protobuf = require("protobufjs"); -``` - -The command line utility lives in the protobufjs-cli package and must be installed separately: - -``` -$> npm install protobufjs-cli [--save --save-prefix=~] -``` - -**Note** that this library's versioning scheme is not semver-compatible for historical reasons. For guaranteed backward compatibility, always depend on `~6.A.B` instead of `^6.A.B` (hence the `--save-prefix` above). - -### Browsers - -Development: - -``` - -``` - -Production: - -``` - -``` - -**Remember** to replace the version tag with the exact [release](https://github.com/protobufjs/protobuf.js/tags) your project depends upon. - -The library supports CommonJS and AMD loaders and also exports globally as `protobuf`. - -### Distributions - -Where bundle size is a factor, there are additional stripped-down versions of the [full library][dist-full] (~19kb gzipped) available that exclude certain functionality: - -* When working with JSON descriptors (i.e. generated by [pbjs](cli/README.md#pbjs-for-javascript)) and/or reflection only, see the [light library][dist-light] (~16kb gzipped) that excludes the parser. CommonJS entry point is: - - ```js - var protobuf = require("protobufjs/light"); - ``` - -* When working with statically generated code only, see the [minimal library][dist-minimal] (~6.5kb gzipped) that also excludes reflection. CommonJS entry point is: - - ```js - var protobuf = require("protobufjs/minimal"); - ``` - -| Distribution | Location -|------------|----------------------------------- -| Full | -| Light | -| Minimal | - -Usage ------ - -Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings): - -### Valid message - -> A valid message is an object (1) not missing any required fields and (2) exclusively composed of JS types understood by the wire format writer. - -There are two possible types of valid messages and the encoder is able to work with both of these for convenience: - -* **Message instances** (explicit instances of message classes with default values on their prototype) always (have to) satisfy the requirements of a valid message by design and -* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well. - -In a nutshell, the wire format writer understands the following types: - -| Field type | Expected JS type (create, encode) | Conversion (fromObject) -|------------|-----------------------------------|------------------------ -| s-/u-/int32
s-/fixed32 | `number` (32 bit integer) | value | 0 if signed
`value >>> 0` if unsigned -| s-/u-/int64
s-/fixed64 | `Long`-like (optimal)
`number` (53 bit integer) | `Long.fromValue(value)` with long.js
`parseInt(value, 10)` otherwise -| float
double | `number` | `Number(value)` -| bool | `boolean` | `Boolean(value)` -| string | `string` | `String(value)` -| bytes | `Uint8Array` (optimal)
`Buffer` (optimal under node)
`Array.` (8 bit integers) | `base64.decode(value)` if a `string`
`Object` with non-zero `.length` is assumed to be buffer-like -| enum | `number` (32 bit integer) | Looks up the numeric id if a `string` -| message | Valid message | `Message.fromObject(value)` - -* Explicit `undefined` and `null` are considered as not set if the field is optional. -* Repeated fields are `Array.`. -* Map fields are `Object.` with the key being the string representation of the respective value or an 8 characters long binary hash string for `Long`-likes. -* Types marked as *optimal* provide the best performance because no conversion step (i.e. number to low and high bits or base64 string to buffer) is required. - -### Toolset - -With that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input. - -**Note** that `Message` below refers to any message class. - -* **Message.verify**(message: `Object`): `null|string`
- verifies that a **plain JavaScript object** satisfies the requirements of a valid message and thus can be encoded without issues. Instead of throwing, it returns the error message as a string, if any. - - ```js - var payload = "invalid (not an object)"; - var err = AwesomeMessage.verify(payload); - if (err) - throw Error(err); - ``` - -* **Message.encode**(message: `Message|Object` [, writer: `Writer`]): `Writer`
- encodes a **message instance** or valid **plain JavaScript object**. This method does not implicitly verify the message and it's up to the user to make sure that the payload is a valid message. - - ```js - var buffer = AwesomeMessage.encode(message).finish(); - ``` - -* **Message.encodeDelimited**(message: `Message|Object` [, writer: `Writer`]): `Writer`
- works like `Message.encode` but additionally prepends the length of the message as a varint. - -* **Message.decode**(reader: `Reader|Uint8Array`): `Message`
- decodes a buffer to a **message instance**. If required fields are missing, it throws a `util.ProtocolError` with an `instance` property set to the so far decoded message. If the wire format is invalid, it throws an `Error`. - - ```js - try { - var decodedMessage = AwesomeMessage.decode(buffer); - } catch (e) { - if (e instanceof protobuf.util.ProtocolError) { - // e.instance holds the so far decoded message with missing required fields - } else { - // wire format is invalid - } - } - ``` - -* **Message.decodeDelimited**(reader: `Reader|Uint8Array`): `Message`
- works like `Message.decode` but additionally reads the length of the message prepended as a varint. - -* **Message.create**(properties: `Object`): `Message`
- creates a new **message instance** from a set of properties that satisfy the requirements of a valid message. Where applicable, it is recommended to prefer `Message.create` over `Message.fromObject` because it doesn't perform possibly redundant conversion. - - ```js - var message = AwesomeMessage.create({ awesomeField: "AwesomeString" }); - ``` - -* **Message.fromObject**(object: `Object`): `Message`
- converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above. - - ```js - var message = AwesomeMessage.fromObject({ awesomeField: 42 }); - // converts awesomeField to a string - ``` - -* **Message.toObject**(message: `Message` [, options: `ConversionOptions`]): `Object`
- converts a **message instance** to an arbitrary **plain JavaScript object** for interoperability with other libraries or storage. The resulting plain JavaScript object *might* still satisfy the requirements of a valid message depending on the actual conversion options specified, but most of the time it does not. - - ```js - var object = AwesomeMessage.toObject(message, { - enums: String, // enums as string names - longs: String, // longs as strings (requires long.js) - bytes: String, // bytes as base64 encoded strings - defaults: true, // includes default values - arrays: true, // populates empty arrays (repeated fields) even if defaults=false - objects: true, // populates empty objects (map fields) even if defaults=false - oneofs: true // includes virtual oneof fields set to the present field's name - }); - ``` - -For reference, the following diagram aims to display relationships between the different methods and the concept of a valid message: - -

Toolset Diagram

- -> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/dcodeIO/protobuf.js/issues/748#issuecomment-291925749)) - -Examples --------- - -### Using .proto files - -It is possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use (reflection-based) message classes: - -```protobuf -// awesome.proto -package awesomepackage; -syntax = "proto3"; - -message AwesomeMessage { - string awesome_field = 1; // becomes awesomeField -} -``` - -```js -protobuf.load("awesome.proto", function(err, root) { - if (err) - throw err; - - // Obtain a message type - var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); - - // Exemplary payload - var payload = { awesomeField: "AwesomeString" }; - - // Verify the payload if necessary (i.e. when possibly incomplete or invalid) - var errMsg = AwesomeMessage.verify(payload); - if (errMsg) - throw Error(errMsg); - - // Create a new message - var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary - - // Encode a message to an Uint8Array (browser) or Buffer (node) - var buffer = AwesomeMessage.encode(message).finish(); - // ... do something with buffer - - // Decode an Uint8Array (browser) or Buffer (node) to a message - var message = AwesomeMessage.decode(buffer); - // ... do something with message - - // If the application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited. - - // Maybe convert the message back to a plain object - var object = AwesomeMessage.toObject(message, { - longs: String, - enums: String, - bytes: String, - // see ConversionOptions - }); -}); -``` - -Additionally, promise syntax can be used by omitting the callback, if preferred: - -```js -protobuf.load("awesome.proto") - .then(function(root) { - ... - }); -``` - -### Using JSON descriptors - -The library utilizes JSON descriptors that are equivalent to a .proto definition. For example, the following is identical to the .proto definition seen above: - -```json -// awesome.json -{ - "nested": { - "awesomepackage": { - "nested": { - "AwesomeMessage": { - "fields": { - "awesomeField": { - "type": "string", - "id": 1 - } - } - } - } - } - } -} -``` - -JSON descriptors closely resemble the internal reflection structure: - -| Type (T) | Extends | Type-specific properties -|--------------------|--------------------|------------------------- -| *ReflectionObject* | | options -| *Namespace* | *ReflectionObject* | nested -| Root | *Namespace* | **nested** -| Type | *Namespace* | **fields** -| Enum | *ReflectionObject* | **values** -| Field | *ReflectionObject* | rule, **type**, **id** -| MapField | Field | **keyType** -| OneOf | *ReflectionObject* | **oneof** (array of field names) -| Service | *Namespace* | **methods** -| Method | *ReflectionObject* | type, **requestType**, **responseType**, requestStream, responseStream - -* **Bold properties** are required. *Italic types* are abstract. -* `T.fromJSON(name, json)` creates the respective reflection object from a JSON descriptor -* `T#toJSON()` creates a JSON descriptor from the respective reflection object (its name is used as the key within the parent) - -Exclusively using JSON descriptors instead of .proto files enables the use of just the light library (the parser isn't required in this case). - -A JSON descriptor can either be loaded the usual way: - -```js -protobuf.load("awesome.json", function(err, root) { - if (err) throw err; - - // Continue at "Obtain a message type" above -}); -``` - -Or it can be loaded inline: - -```js -var jsonDescriptor = require("./awesome.json"); // exemplary for node - -var root = protobuf.Root.fromJSON(jsonDescriptor); - -// Continue at "Obtain a message type" above -``` - -### Using reflection only - -Both the full and the light library include full reflection support. One could, for example, define the .proto definitions seen in the examples above using just reflection: - -```js -... -var Root = protobuf.Root, - Type = protobuf.Type, - Field = protobuf.Field; - -var AwesomeMessage = new Type("AwesomeMessage").add(new Field("awesomeField", 1, "string")); - -var root = new Root().define("awesomepackage").add(AwesomeMessage); - -// Continue at "Create a new message" above -... -``` - -Detailed information on the reflection structure is available within the [API documentation](#additional-documentation). - -### Using custom classes - -Message classes can also be extended with custom functionality and it is also possible to register a custom constructor with a reflected message type: - -```js -... - -// Define a custom constructor -function AwesomeMessage(properties) { - // custom initialization code - ... -} - -// Register the custom constructor with its reflected type (*) -root.lookupType("awesomepackage.AwesomeMessage").ctor = AwesomeMessage; - -// Define custom functionality -AwesomeMessage.customStaticMethod = function() { ... }; -AwesomeMessage.prototype.customInstanceMethod = function() { ... }; - -// Continue at "Create a new message" above -``` - -(*) Besides referencing its reflected type through `AwesomeMessage.$type` and `AwesomeMesage#$type`, the respective custom class is automatically populated with: - -* `AwesomeMessage.create` -* `AwesomeMessage.encode` and `AwesomeMessage.encodeDelimited` -* `AwesomeMessage.decode` and `AwesomeMessage.decodeDelimited` -* `AwesomeMessage.verify` -* `AwesomeMessage.fromObject`, `AwesomeMessage.toObject` and `AwesomeMessage#toJSON` - -Afterwards, decoded messages of this type are `instanceof AwesomeMessage`. - -Alternatively, it is also possible to reuse and extend the internal constructor if custom initialization code is not required: - -```js -... - -// Reuse the internal constructor -var AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage").ctor; - -// Define custom functionality -AwesomeMessage.customStaticMethod = function() { ... }; -AwesomeMessage.prototype.customInstanceMethod = function() { ... }; - -// Continue at "Create a new message" above -``` - -### Using services - -The library also supports consuming services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters: - -```js -function rpcImpl(method, requestData, callback) { - // perform the request using an HTTP request or a WebSocket for example - var responseData = ...; - // and call the callback with the binary response afterwards: - callback(null, responseData); -} -``` - -Below is a working example with a typescript implementation using grpc npm package. -```ts -const grpc = require('grpc') - -const Client = grpc.makeGenericClientConstructor({}) -const client = new Client( - grpcServerUrl, - grpc.credentials.createInsecure() -) - -const rpcImpl = function(method, requestData, callback) { - client.makeUnaryRequest( - method.name, - arg => arg, - arg => arg, - requestData, - callback - ) -} -``` - -Example: - -```protobuf -// greeter.proto -syntax = "proto3"; - -service Greeter { - rpc SayHello (HelloRequest) returns (HelloReply) {} -} - -message HelloRequest { - string name = 1; -} - -message HelloReply { - string message = 1; -} -``` - -```js -... -var Greeter = root.lookup("Greeter"); -var greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false); - -greeter.sayHello({ name: 'you' }, function(err, response) { - console.log('Greeting:', response.message); -}); -``` - -Services also support promises: - -```js -greeter.sayHello({ name: 'you' }) - .then(function(response) { - console.log('Greeting:', response.message); - }); -``` - -There is also an [example for streaming RPC](https://github.com/dcodeIO/protobuf.js/blob/master/examples/streaming-rpc.js). - -Note that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages. - -### Usage with TypeScript - -The library ships with its own [type definitions](https://github.com/dcodeIO/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion. - -The npm package depends on [@types/node](https://www.npmjs.com/package/@types/node) because of `Buffer` and [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually. - -#### Using the JS API - -The API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message["awesomeField"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript). - -```ts -import { load } from "protobufjs"; // respectively "./node_modules/protobufjs" - -load("awesome.proto", function(err, root) { - if (err) - throw err; - - // example code - const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); - - let message = AwesomeMessage.create({ awesomeField: "hello" }); - console.log(`message = ${JSON.stringify(message)}`); - - let buffer = AwesomeMessage.encode(message).finish(); - console.log(`buffer = ${Array.prototype.toString.call(buffer)}`); - - let decoded = AwesomeMessage.decode(buffer); - console.log(`decoded = ${JSON.stringify(decoded)}`); -}); -``` - -#### Using generated static code - -If you generated static code to `bundle.js` using the CLI and its type definitions to `bundle.d.ts`, then you can just do: - -```ts -import { AwesomeMessage } from "./bundle.js"; - -// example code -let message = AwesomeMessage.create({ awesomeField: "hello" }); -let buffer = AwesomeMessage.encode(message).finish(); -let decoded = AwesomeMessage.decode(buffer); -``` - -#### Using decorators - -The library also includes an early implementation of [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html). - -**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`. - -```ts -import { Message, Type, Field, OneOf } from "protobufjs/light"; // respectively "./node_modules/protobufjs/light.js" - -export class AwesomeSubMessage extends Message { - - @Field.d(1, "string") - public awesomeString: string; - -} - -export enum AwesomeEnum { - ONE = 1, - TWO = 2 -} - -@Type.d("SuperAwesomeMessage") -export class AwesomeMessage extends Message { - - @Field.d(1, "string", "optional", "awesome default string") - public awesomeField: string; - - @Field.d(2, AwesomeSubMessage) - public awesomeSubMessage: AwesomeSubMessage; - - @Field.d(3, AwesomeEnum, "optional", AwesomeEnum.ONE) - public awesomeEnum: AwesomeEnum; - - @OneOf.d("awesomeSubMessage", "awesomeEnum") - public which: string; - -} - -// example code -let message = new AwesomeMessage({ awesomeField: "hello" }); -let buffer = AwesomeMessage.encode(message).finish(); -let decoded = AwesomeMessage.decode(buffer); -``` - -Supported decorators are: - -* **Type.d(typeName?: `string`)**   *(optional)*
- annotates a class as a protobuf message type. If `typeName` is not specified, the constructor's runtime function name is used for the reflected type. - -* **Field.d<T>(fieldId: `number`, fieldType: `string | Constructor`, fieldRule?: `"optional" | "required" | "repeated"`, defaultValue?: `T`)**
- annotates a property as a protobuf field with the specified id and protobuf type. - -* **MapField.d<T extends { [key: string]: any }>(fieldId: `number`, fieldKeyType: `string`, fieldValueType. `string | Constructor<{}>`)**
- annotates a property as a protobuf map field with the specified id, protobuf key and value type. - -* **OneOf.d<T extends string>(...fieldNames: `string[]`)**
- annotates a property as a protobuf oneof covering the specified fields. - -Other notes: - -* Decorated types reside in `protobuf.roots["decorated"]` using a flat structure, so no duplicate names. -* Enums are copied to a reflected enum with a generic name on decorator evaluation because referenced enum objects have no runtime name the decorator could use. -* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior. -* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string. - -**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/dcodeIO/protobuf.js/blob/master/examples/js-decorators.js) as well. - -Additional documentation ------------------------- - -#### Protocol Buffers -* [Google's Developer Guide](https://developers.google.com/protocol-buffers/docs/overview) - -#### protobuf.js -* [API Documentation](https://protobufjs.github.io/protobuf.js) -* [CHANGELOG](https://github.com/dcodeIO/protobuf.js/blob/master/CHANGELOG.md) -* [Frequently asked questions](https://github.com/dcodeIO/protobuf.js/wiki) on our wiki - -#### Community -* [Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow - -Performance ------------ -The package includes a benchmark that compares protobuf.js performance to native JSON (as far as this is possible) and [Google's JS implementation](https://github.com/google/protobuf/tree/master/js). On an i7-2600K running node 6.9.1 it yields: - -``` -benchmarking encoding performance ... - -protobuf.js (reflect) x 541,707 ops/sec ±1.13% (87 runs sampled) -protobuf.js (static) x 548,134 ops/sec ±1.38% (89 runs sampled) -JSON (string) x 318,076 ops/sec ±0.63% (93 runs sampled) -JSON (buffer) x 179,165 ops/sec ±2.26% (91 runs sampled) -google-protobuf x 74,406 ops/sec ±0.85% (86 runs sampled) - - protobuf.js (static) was fastest - protobuf.js (reflect) was 0.9% ops/sec slower (factor 1.0) - JSON (string) was 41.5% ops/sec slower (factor 1.7) - JSON (buffer) was 67.6% ops/sec slower (factor 3.1) - google-protobuf was 86.4% ops/sec slower (factor 7.3) - -benchmarking decoding performance ... - -protobuf.js (reflect) x 1,383,981 ops/sec ±0.88% (93 runs sampled) -protobuf.js (static) x 1,378,925 ops/sec ±0.81% (93 runs sampled) -JSON (string) x 302,444 ops/sec ±0.81% (93 runs sampled) -JSON (buffer) x 264,882 ops/sec ±0.81% (93 runs sampled) -google-protobuf x 179,180 ops/sec ±0.64% (94 runs sampled) - - protobuf.js (reflect) was fastest - protobuf.js (static) was 0.3% ops/sec slower (factor 1.0) - JSON (string) was 78.1% ops/sec slower (factor 4.6) - JSON (buffer) was 80.8% ops/sec slower (factor 5.2) - google-protobuf was 87.0% ops/sec slower (factor 7.7) - -benchmarking combined performance ... - -protobuf.js (reflect) x 275,900 ops/sec ±0.78% (90 runs sampled) -protobuf.js (static) x 290,096 ops/sec ±0.96% (90 runs sampled) -JSON (string) x 129,381 ops/sec ±0.77% (90 runs sampled) -JSON (buffer) x 91,051 ops/sec ±0.94% (90 runs sampled) -google-protobuf x 42,050 ops/sec ±0.85% (91 runs sampled) - - protobuf.js (static) was fastest - protobuf.js (reflect) was 4.7% ops/sec slower (factor 1.0) - JSON (string) was 55.3% ops/sec slower (factor 2.2) - JSON (buffer) was 68.6% ops/sec slower (factor 3.2) - google-protobuf was 85.5% ops/sec slower (factor 6.9) -``` - -These results are achieved by - -* generating type-specific encoders, decoders, verifiers and converters at runtime -* configuring the reader/writer interface according to the environment -* using node-specific functionality where beneficial and, of course -* avoiding unnecessary operations through splitting up [the toolset](#toolset). - -You can also run [the benchmark](https://github.com/dcodeIO/protobuf.js/blob/master/bench/index.js) ... - -``` -$> npm run bench -``` - -and [the profiler](https://github.com/dcodeIO/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node): - -``` -$> npm run prof [iterations=10000000] -``` - -Note that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths. - -Compatibility -------------- - -* Works in all modern and not-so-modern browsers except IE8. -* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally. -* If typed arrays are not supported by the environment, plain arrays will be used instead. -* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/polyfill.js). -* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without [unsafe-eval](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval)) can be achieved by generating and using static code instead. -* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)). -* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/dcodeIO/protobuf.js/tree/master/ext/descriptor) - -Building --------- - -To build the library or its components yourself, clone it from GitHub and install the development dependencies: - -``` -$> git clone https://github.com/dcodeIO/protobuf.js.git -$> cd protobuf.js -$> npm install -``` - -Building the respective development and production versions with their respective source maps to `dist/`: - -``` -$> npm run build -``` - -Building the documentation to `docs/`: - -``` -$> npm run docs -``` - -Building the TypeScript definition to `index.d.ts`: - -``` -$> npm run types -``` - -### Browserify integration - -By default, protobuf.js integrates into any browserify build-process without requiring any optional modules. Hence: - -* If int64 support is required, explicitly require the `long` module somewhere in your project as it will be excluded otherwise. This assumes that a global `require` function is present that protobuf.js can call to obtain the long module. - - If there is no global `require` function present after bundling, it's also possible to assign the long module programmatically: - - ```js - var Long = ...; - - protobuf.util.Long = Long; - protobuf.configure(); - ``` - -* If you have any special requirements, there is [the bundler](https://github.com/dcodeIO/protobuf.js/blob/master/scripts/bundle.js) for reference. - -**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause) diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/debug/README.md b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/debug/README.md deleted file mode 100644 index a48517e42..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/debug/README.md +++ /dev/null @@ -1,4 +0,0 @@ -protobufjs/ext/debug -========================= - -Experimental debugging extension. diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/debug/index.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/debug/index.js deleted file mode 100644 index 2b797664b..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/debug/index.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -var protobuf = require("../.."); - -/** - * Debugging utility functions. Only present in debug builds. - * @namespace - */ -var debug = protobuf.debug = module.exports = {}; - -var codegen = protobuf.util.codegen; - -var debugFnRe = /function ([^(]+)\(([^)]*)\) {/g; - -// Counts number of calls to any generated function -function codegen_debug() { - codegen_debug.supported = codegen.supported; - codegen_debug.verbose = codegen.verbose; - var gen = codegen.apply(null, Array.prototype.slice.call(arguments)); - gen.str = (function(str) { return function str_debug() { - return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, "function $1($2) {\n\t$1.calls=($1.calls|0)+1"); - };})(gen.str); - return gen; -} - -/** - * Returns a list of unused types within the specified root. - * @param {NamespaceBase} ns Namespace to search - * @returns {Type[]} Unused types - */ -debug.unusedTypes = function unusedTypes(ns) { - - /* istanbul ignore if */ - if (!(ns instanceof protobuf.Namespace)) - throw TypeError("ns must be a Namespace"); - - /* istanbul ignore if */ - if (!ns.nested) - return []; - - var unused = []; - for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) { - var nested = ns.nested[names[i]]; - if (nested instanceof protobuf.Type) { - var calls = (nested.encode.calls|0) - + (nested.decode.calls|0) - + (nested.verify.calls|0) - + (nested.toObject.calls|0) - + (nested.fromObject.calls|0); - if (!calls) - unused.push(nested); - } else if (nested instanceof protobuf.Namespace) - Array.prototype.push.apply(unused, unusedTypes(nested)); - } - return unused; -}; - -/** - * Enables debugging extensions. - * @returns {undefined} - */ -debug.enable = function enable() { - protobuf.util.codegen = codegen_debug; -}; - -/** - * Disables debugging extensions. - * @returns {undefined} - */ -debug.disable = function disable() { - protobuf.util.codegen = codegen; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/README.md b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/README.md deleted file mode 100644 index 3bc4c6c9c..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/README.md +++ /dev/null @@ -1,72 +0,0 @@ -protobufjs/ext/descriptor -========================= - -Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types. - -Usage ------ - -```js -var protobuf = require("protobufjs"), // requires the full library - descriptor = require("protobufjs/ext/descriptor"); - -var root = ...; - -// convert any existing root instance to the corresponding descriptor type -var descriptorMsg = root.toDescriptor("proto2"); -// ^ returns a FileDescriptorSet message, see table below - -// encode to a descriptor buffer -var buffer = descriptor.FileDescriptorSet.encode(descriptorMsg).finish(); - -// decode from a descriptor buffer -var decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer); - -// convert any existing descriptor to a root instance -root = protobuf.Root.fromDescriptor(decodedDescriptor); -// ^ expects a FileDescriptorSet message or buffer, see table below - -// and start all over again -``` - -API ---- - -The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto: - -| Descriptor type | protobuf.js type | Remarks -|-------------------------------|------------------|--------- -| **FileDescriptorSet** | Root | -| FileDescriptorProto | | dependencies are not supported -| FileOptions | | -| FileOptionsOptimizeMode | | -| SourceCodeInfo | | not supported -| SourceCodeInfoLocation | | -| GeneratedCodeInfo | | not supported -| GeneratedCodeInfoAnnotation | | -| **DescriptorProto** | Type | -| MessageOptions | | -| DescriptorProtoExtensionRange | | -| DescriptorProtoReservedRange | | -| **FieldDescriptorProto** | Field | -| FieldDescriptorProtoLabel | | -| FieldDescriptorProtoType | | -| FieldOptions | | -| FieldOptionsCType | | -| FieldOptionsJSType | | -| **OneofDescriptorProto** | OneOf | -| OneofOptions | | -| **EnumDescriptorProto** | Enum | -| EnumOptions | | -| EnumValueDescriptorProto | | -| EnumValueOptions | | not supported -| **ServiceDescriptorProto** | Service | -| ServiceOptions | | -| **MethodDescriptorProto** | Method | -| MethodOptions | | -| UninterpretedOption | | not supported -| UninterpretedOptionNamePart | | - -Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names. - -When using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message`). diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/index.d.ts b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/index.d.ts deleted file mode 100644 index 1df2efcc1..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/index.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import * as $protobuf from "../.."; -export const FileDescriptorSet: $protobuf.Type; - -export const FileDescriptorProto: $protobuf.Type; - -export const DescriptorProto: $protobuf.Type & { - ExtensionRange: $protobuf.Type, - ReservedRange: $protobuf.Type -}; - -export const FieldDescriptorProto: $protobuf.Type & { - Label: $protobuf.Enum, - Type: $protobuf.Enum -}; - -export const OneofDescriptorProto: $protobuf.Type; - -export const EnumDescriptorProto: $protobuf.Type; - -export const ServiceDescriptorProto: $protobuf.Type; - -export const EnumValueDescriptorProto: $protobuf.Type; - -export const MethodDescriptorProto: $protobuf.Type; - -export const FileOptions: $protobuf.Type & { - OptimizeMode: $protobuf.Enum -}; - -export const MessageOptions: $protobuf.Type; - -export const FieldOptions: $protobuf.Type & { - CType: $protobuf.Enum, - JSType: $protobuf.Enum -}; - -export const OneofOptions: $protobuf.Type; - -export const EnumOptions: $protobuf.Type; - -export const EnumValueOptions: $protobuf.Type; - -export const ServiceOptions: $protobuf.Type; - -export const MethodOptions: $protobuf.Type; - -export const UninterpretedOption: $protobuf.Type & { - NamePart: $protobuf.Type -}; - -export const SourceCodeInfo: $protobuf.Type & { - Location: $protobuf.Type -}; - -export const GeneratedCodeInfo: $protobuf.Type & { - Annotation: $protobuf.Type -}; - -export interface IFileDescriptorSet { - file: IFileDescriptorProto[]; -} - -export interface IFileDescriptorProto { - name?: string; - package?: string; - dependency?: any; - publicDependency?: any; - weakDependency?: any; - messageType?: IDescriptorProto[]; - enumType?: IEnumDescriptorProto[]; - service?: IServiceDescriptorProto[]; - extension?: IFieldDescriptorProto[]; - options?: IFileOptions; - sourceCodeInfo?: any; - syntax?: string; -} - -export interface IFileOptions { - javaPackage?: string; - javaOuterClassname?: string; - javaMultipleFiles?: boolean; - javaGenerateEqualsAndHash?: boolean; - javaStringCheckUtf8?: boolean; - optimizeFor?: IFileOptionsOptimizeMode; - goPackage?: string; - ccGenericServices?: boolean; - javaGenericServices?: boolean; - pyGenericServices?: boolean; - deprecated?: boolean; - ccEnableArenas?: boolean; - objcClassPrefix?: string; - csharpNamespace?: string; -} - -type IFileOptionsOptimizeMode = number; - -export interface IDescriptorProto { - name?: string; - field?: IFieldDescriptorProto[]; - extension?: IFieldDescriptorProto[]; - nestedType?: IDescriptorProto[]; - enumType?: IEnumDescriptorProto[]; - extensionRange?: IDescriptorProtoExtensionRange[]; - oneofDecl?: IOneofDescriptorProto[]; - options?: IMessageOptions; - reservedRange?: IDescriptorProtoReservedRange[]; - reservedName?: string[]; -} - -export interface IMessageOptions { - mapEntry?: boolean; -} - -export interface IDescriptorProtoExtensionRange { - start?: number; - end?: number; -} - -export interface IDescriptorProtoReservedRange { - start?: number; - end?: number; -} - -export interface IFieldDescriptorProto { - name?: string; - number?: number; - label?: IFieldDescriptorProtoLabel; - type?: IFieldDescriptorProtoType; - typeName?: string; - extendee?: string; - defaultValue?: string; - oneofIndex?: number; - jsonName?: any; - options?: IFieldOptions; -} - -type IFieldDescriptorProtoLabel = number; - -type IFieldDescriptorProtoType = number; - -export interface IFieldOptions { - packed?: boolean; - jstype?: IFieldOptionsJSType; -} - -type IFieldOptionsJSType = number; - -export interface IEnumDescriptorProto { - name?: string; - value?: IEnumValueDescriptorProto[]; - options?: IEnumOptions; -} - -export interface IEnumValueDescriptorProto { - name?: string; - number?: number; - options?: any; -} - -export interface IEnumOptions { - allowAlias?: boolean; - deprecated?: boolean; -} - -export interface IOneofDescriptorProto { - name?: string; - options?: any; -} - -export interface IServiceDescriptorProto { - name?: string; - method?: IMethodDescriptorProto[]; - options?: IServiceOptions; -} - -export interface IServiceOptions { - deprecated?: boolean; -} - -export interface IMethodDescriptorProto { - name?: string; - inputType?: string; - outputType?: string; - options?: IMethodOptions; - clientStreaming?: boolean; - serverStreaming?: boolean; -} - -export interface IMethodOptions { - deprecated?: boolean; -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/index.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/index.js deleted file mode 100644 index 6aafd2ab8..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/index.js +++ /dev/null @@ -1,1052 +0,0 @@ -"use strict"; -var $protobuf = require("../.."); -module.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require("../../google/protobuf/descriptor.json")).lookup(".google.protobuf"); - -var Namespace = $protobuf.Namespace, - Root = $protobuf.Root, - Enum = $protobuf.Enum, - Type = $protobuf.Type, - Field = $protobuf.Field, - MapField = $protobuf.MapField, - OneOf = $protobuf.OneOf, - Service = $protobuf.Service, - Method = $protobuf.Method; - -// --- Root --- - -/** - * Properties of a FileDescriptorSet message. - * @interface IFileDescriptorSet - * @property {IFileDescriptorProto[]} file Files - */ - -/** - * Properties of a FileDescriptorProto message. - * @interface IFileDescriptorProto - * @property {string} [name] File name - * @property {string} [package] Package - * @property {*} [dependency] Not supported - * @property {*} [publicDependency] Not supported - * @property {*} [weakDependency] Not supported - * @property {IDescriptorProto[]} [messageType] Nested message types - * @property {IEnumDescriptorProto[]} [enumType] Nested enums - * @property {IServiceDescriptorProto[]} [service] Nested services - * @property {IFieldDescriptorProto[]} [extension] Nested extension fields - * @property {IFileOptions} [options] Options - * @property {*} [sourceCodeInfo] Not supported - * @property {string} [syntax="proto2"] Syntax - */ - -/** - * Properties of a FileOptions message. - * @interface IFileOptions - * @property {string} [javaPackage] - * @property {string} [javaOuterClassname] - * @property {boolean} [javaMultipleFiles] - * @property {boolean} [javaGenerateEqualsAndHash] - * @property {boolean} [javaStringCheckUtf8] - * @property {IFileOptionsOptimizeMode} [optimizeFor=1] - * @property {string} [goPackage] - * @property {boolean} [ccGenericServices] - * @property {boolean} [javaGenericServices] - * @property {boolean} [pyGenericServices] - * @property {boolean} [deprecated] - * @property {boolean} [ccEnableArenas] - * @property {string} [objcClassPrefix] - * @property {string} [csharpNamespace] - */ - -/** - * Values of he FileOptions.OptimizeMode enum. - * @typedef IFileOptionsOptimizeMode - * @type {number} - * @property {number} SPEED=1 - * @property {number} CODE_SIZE=2 - * @property {number} LITE_RUNTIME=3 - */ - -/** - * Creates a root from a descriptor set. - * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor - * @returns {Root} Root instance - */ -Root.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.FileDescriptorSet.decode(descriptor); - - var root = new Root(); - - if (descriptor.file) { - var fileDescriptor, - filePackage; - for (var j = 0, i; j < descriptor.file.length; ++j) { - filePackage = root; - if ((fileDescriptor = descriptor.file[j])["package"] && fileDescriptor["package"].length) - filePackage = root.define(fileDescriptor["package"]); - if (fileDescriptor.name && fileDescriptor.name.length) - root.files.push(filePackage.filename = fileDescriptor.name); - if (fileDescriptor.messageType) - for (i = 0; i < fileDescriptor.messageType.length; ++i) - filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], fileDescriptor.syntax)); - if (fileDescriptor.enumType) - for (i = 0; i < fileDescriptor.enumType.length; ++i) - filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i])); - if (fileDescriptor.extension) - for (i = 0; i < fileDescriptor.extension.length; ++i) - filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i])); - if (fileDescriptor.service) - for (i = 0; i < fileDescriptor.service.length; ++i) - filePackage.add(Service.fromDescriptor(fileDescriptor.service[i])); - var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions); - if (opts) { - var ks = Object.keys(opts); - for (i = 0; i < ks.length; ++i) - filePackage.setOption(ks[i], opts[ks[i]]); - } - } - } - - return root; -}; - -/** - * Converts a root to a descriptor set. - * @returns {Message} Descriptor - * @param {string} [syntax="proto2"] Syntax - */ -Root.prototype.toDescriptor = function toDescriptor(syntax) { - var set = exports.FileDescriptorSet.create(); - Root_toDescriptorRecursive(this, set.file, syntax); - return set; -}; - -// Traverses a namespace and assembles the descriptor set -function Root_toDescriptorRecursive(ns, files, syntax) { - - // Create a new file - var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\./g, "_") || "root") + ".proto" }); - if (syntax) - file.syntax = syntax; - if (!(ns instanceof Root)) - file["package"] = ns.fullName.substring(1); - - // Add nested types - for (var i = 0, nested; i < ns.nestedArray.length; ++i) - if ((nested = ns._nestedArray[i]) instanceof Type) - file.messageType.push(nested.toDescriptor(syntax)); - else if (nested instanceof Enum) - file.enumType.push(nested.toDescriptor()); - else if (nested instanceof Field) - file.extension.push(nested.toDescriptor(syntax)); - else if (nested instanceof Service) - file.service.push(nested.toDescriptor()); - else if (nested instanceof /* plain */ Namespace) - Root_toDescriptorRecursive(nested, files, syntax); // requires new file - - // Keep package-level options - file.options = toDescriptorOptions(ns.options, exports.FileOptions); - - // And keep the file only if there is at least one nested object - if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length) - files.push(file); -} - -// --- Type --- - -/** - * Properties of a DescriptorProto message. - * @interface IDescriptorProto - * @property {string} [name] Message type name - * @property {IFieldDescriptorProto[]} [field] Fields - * @property {IFieldDescriptorProto[]} [extension] Extension fields - * @property {IDescriptorProto[]} [nestedType] Nested message types - * @property {IEnumDescriptorProto[]} [enumType] Nested enums - * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges - * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs - * @property {IMessageOptions} [options] Not supported - * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges - * @property {string[]} [reservedName] Reserved names - */ - -/** - * Properties of a MessageOptions message. - * @interface IMessageOptions - * @property {boolean} [mapEntry=false] Whether this message is a map entry - */ - -/** - * Properties of an ExtensionRange message. - * @interface IDescriptorProtoExtensionRange - * @property {number} [start] Start field id - * @property {number} [end] End field id - */ - -/** - * Properties of a ReservedRange message. - * @interface IDescriptorProtoReservedRange - * @property {number} [start] Start field id - * @property {number} [end] End field id - */ - -var unnamedMessageIndex = 0; - -/** - * Creates a type from a descriptor. - * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @param {string} [syntax="proto2"] Syntax - * @returns {Type} Type instance - */ -Type.fromDescriptor = function fromDescriptor(descriptor, syntax) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.DescriptorProto.decode(descriptor); - - // Create the message type - var type = new Type(descriptor.name.length ? descriptor.name : "Type" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)), - i; - - /* Oneofs */ if (descriptor.oneofDecl) - for (i = 0; i < descriptor.oneofDecl.length; ++i) - type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i])); - /* Fields */ if (descriptor.field) - for (i = 0; i < descriptor.field.length; ++i) { - var field = Field.fromDescriptor(descriptor.field[i], syntax); - type.add(field); - if (descriptor.field[i].hasOwnProperty("oneofIndex")) // eslint-disable-line no-prototype-builtins - type.oneofsArray[descriptor.field[i].oneofIndex].add(field); - } - /* Extension fields */ if (descriptor.extension) - for (i = 0; i < descriptor.extension.length; ++i) - type.add(Field.fromDescriptor(descriptor.extension[i], syntax)); - /* Nested types */ if (descriptor.nestedType) - for (i = 0; i < descriptor.nestedType.length; ++i) { - type.add(Type.fromDescriptor(descriptor.nestedType[i], syntax)); - if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry) - type.setOption("map_entry", true); - } - /* Nested enums */ if (descriptor.enumType) - for (i = 0; i < descriptor.enumType.length; ++i) - type.add(Enum.fromDescriptor(descriptor.enumType[i])); - /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) { - type.extensions = []; - for (i = 0; i < descriptor.extensionRange.length; ++i) - type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]); - } - /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) { - type.reserved = []; - /* Ranges */ if (descriptor.reservedRange) - for (i = 0; i < descriptor.reservedRange.length; ++i) - type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]); - /* Names */ if (descriptor.reservedName) - for (i = 0; i < descriptor.reservedName.length; ++i) - type.reserved.push(descriptor.reservedName[i]); - } - - return type; -}; - -/** - * Converts a type to a descriptor. - * @returns {Message} Descriptor - * @param {string} [syntax="proto2"] Syntax - */ -Type.prototype.toDescriptor = function toDescriptor(syntax) { - var descriptor = exports.DescriptorProto.create({ name: this.name }), - i; - - /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) { - var fieldDescriptor; - descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(syntax)); - if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry - var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType), - valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType), - valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14 - ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type - : undefined; - descriptor.nestedType.push(exports.DescriptorProto.create({ - name: fieldDescriptor.typeName, - field: [ - exports.FieldDescriptorProto.create({ name: "key", number: 1, label: 1, type: keyType }), // can't reference a type or enum - exports.FieldDescriptorProto.create({ name: "value", number: 2, label: 1, type: valueType, typeName: valueTypeName }) - ], - options: exports.MessageOptions.create({ mapEntry: true }) - })); - } - } - /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i) - descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor()); - /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) { - /* Extension fields */ if (this._nestedArray[i] instanceof Field) - descriptor.field.push(this._nestedArray[i].toDescriptor(syntax)); - /* Types */ else if (this._nestedArray[i] instanceof Type) - descriptor.nestedType.push(this._nestedArray[i].toDescriptor(syntax)); - /* Enums */ else if (this._nestedArray[i] instanceof Enum) - descriptor.enumType.push(this._nestedArray[i].toDescriptor()); - // plain nested namespaces become packages instead in Root#toDescriptor - } - /* Extension ranges */ if (this.extensions) - for (i = 0; i < this.extensions.length; ++i) - descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] })); - /* Reserved... */ if (this.reserved) - for (i = 0; i < this.reserved.length; ++i) - /* Names */ if (typeof this.reserved[i] === "string") - descriptor.reservedName.push(this.reserved[i]); - /* Ranges */ else - descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] })); - - descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions); - - return descriptor; -}; - -// --- Field --- - -/** - * Properties of a FieldDescriptorProto message. - * @interface IFieldDescriptorProto - * @property {string} [name] Field name - * @property {number} [number] Field id - * @property {IFieldDescriptorProtoLabel} [label] Field rule - * @property {IFieldDescriptorProtoType} [type] Field basic type - * @property {string} [typeName] Field type name - * @property {string} [extendee] Extended type name - * @property {string} [defaultValue] Literal default value - * @property {number} [oneofIndex] Oneof index if part of a oneof - * @property {*} [jsonName] Not supported - * @property {IFieldOptions} [options] Field options - */ - -/** - * Values of the FieldDescriptorProto.Label enum. - * @typedef IFieldDescriptorProtoLabel - * @type {number} - * @property {number} LABEL_OPTIONAL=1 - * @property {number} LABEL_REQUIRED=2 - * @property {number} LABEL_REPEATED=3 - */ - -/** - * Values of the FieldDescriptorProto.Type enum. - * @typedef IFieldDescriptorProtoType - * @type {number} - * @property {number} TYPE_DOUBLE=1 - * @property {number} TYPE_FLOAT=2 - * @property {number} TYPE_INT64=3 - * @property {number} TYPE_UINT64=4 - * @property {number} TYPE_INT32=5 - * @property {number} TYPE_FIXED64=6 - * @property {number} TYPE_FIXED32=7 - * @property {number} TYPE_BOOL=8 - * @property {number} TYPE_STRING=9 - * @property {number} TYPE_GROUP=10 - * @property {number} TYPE_MESSAGE=11 - * @property {number} TYPE_BYTES=12 - * @property {number} TYPE_UINT32=13 - * @property {number} TYPE_ENUM=14 - * @property {number} TYPE_SFIXED32=15 - * @property {number} TYPE_SFIXED64=16 - * @property {number} TYPE_SINT32=17 - * @property {number} TYPE_SINT64=18 - */ - -/** - * Properties of a FieldOptions message. - * @interface IFieldOptions - * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3) - * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js) - */ - -/** - * Values of the FieldOptions.JSType enum. - * @typedef IFieldOptionsJSType - * @type {number} - * @property {number} JS_NORMAL=0 - * @property {number} JS_STRING=1 - * @property {number} JS_NUMBER=2 - */ - -// copied here from parse.js -var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/; - -/** - * Creates a field from a descriptor. - * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @param {string} [syntax="proto2"] Syntax - * @returns {Field} Field instance - */ -Field.fromDescriptor = function fromDescriptor(descriptor, syntax) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.DescriptorProto.decode(descriptor); - - if (typeof descriptor.number !== "number") - throw Error("missing field id"); - - // Rewire field type - var fieldType; - if (descriptor.typeName && descriptor.typeName.length) - fieldType = descriptor.typeName; - else - fieldType = fromDescriptorType(descriptor.type); - - // Rewire field rule - var fieldRule; - switch (descriptor.label) { - // 0 is reserved for errors - case 1: fieldRule = undefined; break; - case 2: fieldRule = "required"; break; - case 3: fieldRule = "repeated"; break; - default: throw Error("illegal label: " + descriptor.label); - } - - var extendee = descriptor.extendee; - if (descriptor.extendee !== undefined) { - extendee = extendee.length ? extendee : undefined; - } - var field = new Field( - descriptor.name.length ? descriptor.name : "field" + descriptor.number, - descriptor.number, - fieldType, - fieldRule, - extendee - ); - - field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions); - - if (descriptor.defaultValue && descriptor.defaultValue.length) { - var defaultValue = descriptor.defaultValue; - switch (defaultValue) { - case "true": case "TRUE": - defaultValue = true; - break; - case "false": case "FALSE": - defaultValue = false; - break; - default: - var match = numberRe.exec(defaultValue); - if (match) - defaultValue = parseInt(defaultValue); // eslint-disable-line radix - break; - } - field.setOption("default", defaultValue); - } - - if (packableDescriptorType(descriptor.type)) { - if (syntax === "proto3") { // defaults to packed=true (internal preset is packed=true) - if (descriptor.options && !descriptor.options.packed) - field.setOption("packed", false); - } else if (!(descriptor.options && descriptor.options.packed)) // defaults to packed=false - field.setOption("packed", false); - } - - return field; -}; - -/** - * Converts a field to a descriptor. - * @returns {Message} Descriptor - * @param {string} [syntax="proto2"] Syntax - */ -Field.prototype.toDescriptor = function toDescriptor(syntax) { - var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id }); - - if (this.map) { - - descriptor.type = 11; // message - descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor) - descriptor.label = 3; // repeated - - } else { - - // Rewire field type - switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType)) { - case 10: // group - case 11: // type - case 14: // enum - descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type; - break; - } - - // Rewire field rule - switch (this.rule) { - case "repeated": descriptor.label = 3; break; - case "required": descriptor.label = 2; break; - default: descriptor.label = 1; break; - } - - } - - // Handle extension field - descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend; - - // Handle part of oneof - if (this.partOf) - if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0) - throw Error("missing oneof"); - - if (this.options) { - descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions); - if (this.options["default"] != null) - descriptor.defaultValue = String(this.options["default"]); - } - - if (syntax === "proto3") { // defaults to packed=true - if (!this.packed) - (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false; - } else if (this.packed) // defaults to packed=false - (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true; - - return descriptor; -}; - -// --- Enum --- - -/** - * Properties of an EnumDescriptorProto message. - * @interface IEnumDescriptorProto - * @property {string} [name] Enum name - * @property {IEnumValueDescriptorProto[]} [value] Enum values - * @property {IEnumOptions} [options] Enum options - */ - -/** - * Properties of an EnumValueDescriptorProto message. - * @interface IEnumValueDescriptorProto - * @property {string} [name] Name - * @property {number} [number] Value - * @property {*} [options] Not supported - */ - -/** - * Properties of an EnumOptions message. - * @interface IEnumOptions - * @property {boolean} [allowAlias] Whether aliases are allowed - * @property {boolean} [deprecated] - */ - -var unnamedEnumIndex = 0; - -/** - * Creates an enum from a descriptor. - * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {Enum} Enum instance - */ -Enum.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.EnumDescriptorProto.decode(descriptor); - - // Construct values object - var values = {}; - if (descriptor.value) - for (var i = 0; i < descriptor.value.length; ++i) { - var name = descriptor.value[i].name, - value = descriptor.value[i].number || 0; - values[name && name.length ? name : "NAME" + value] = value; - } - - return new Enum( - descriptor.name && descriptor.name.length ? descriptor.name : "Enum" + unnamedEnumIndex++, - values, - fromDescriptorOptions(descriptor.options, exports.EnumOptions) - ); -}; - -/** - * Converts an enum to a descriptor. - * @returns {Message} Descriptor - */ -Enum.prototype.toDescriptor = function toDescriptor() { - - // Values - var values = []; - for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i) - values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] })); - - return exports.EnumDescriptorProto.create({ - name: this.name, - value: values, - options: toDescriptorOptions(this.options, exports.EnumOptions) - }); -}; - -// --- OneOf --- - -/** - * Properties of a OneofDescriptorProto message. - * @interface IOneofDescriptorProto - * @property {string} [name] Oneof name - * @property {*} [options] Not supported - */ - -var unnamedOneofIndex = 0; - -/** - * Creates a oneof from a descriptor. - * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {OneOf} OneOf instance - */ -OneOf.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.OneofDescriptorProto.decode(descriptor); - - return new OneOf( - // unnamedOneOfIndex is global, not per type, because we have no ref to a type here - descriptor.name && descriptor.name.length ? descriptor.name : "oneof" + unnamedOneofIndex++ - // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option - ); -}; - -/** - * Converts a oneof to a descriptor. - * @returns {Message} Descriptor - */ -OneOf.prototype.toDescriptor = function toDescriptor() { - return exports.OneofDescriptorProto.create({ - name: this.name - // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option - }); -}; - -// --- Service --- - -/** - * Properties of a ServiceDescriptorProto message. - * @interface IServiceDescriptorProto - * @property {string} [name] Service name - * @property {IMethodDescriptorProto[]} [method] Methods - * @property {IServiceOptions} [options] Options - */ - -/** - * Properties of a ServiceOptions message. - * @interface IServiceOptions - * @property {boolean} [deprecated] - */ - -var unnamedServiceIndex = 0; - -/** - * Creates a service from a descriptor. - * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {Service} Service instance - */ -Service.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.ServiceDescriptorProto.decode(descriptor); - - var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : "Service" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions)); - if (descriptor.method) - for (var i = 0; i < descriptor.method.length; ++i) - service.add(Method.fromDescriptor(descriptor.method[i])); - - return service; -}; - -/** - * Converts a service to a descriptor. - * @returns {Message} Descriptor - */ -Service.prototype.toDescriptor = function toDescriptor() { - - // Methods - var methods = []; - for (var i = 0; i < this.methodsArray.length; ++i) - methods.push(this._methodsArray[i].toDescriptor()); - - return exports.ServiceDescriptorProto.create({ - name: this.name, - method: methods, - options: toDescriptorOptions(this.options, exports.ServiceOptions) - }); -}; - -// --- Method --- - -/** - * Properties of a MethodDescriptorProto message. - * @interface IMethodDescriptorProto - * @property {string} [name] Method name - * @property {string} [inputType] Request type name - * @property {string} [outputType] Response type name - * @property {IMethodOptions} [options] Not supported - * @property {boolean} [clientStreaming=false] Whether requests are streamed - * @property {boolean} [serverStreaming=false] Whether responses are streamed - */ - -/** - * Properties of a MethodOptions message. - * @interface IMethodOptions - * @property {boolean} [deprecated] - */ - -var unnamedMethodIndex = 0; - -/** - * Creates a method from a descriptor. - * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor - * @returns {Method} Reflected method instance - */ -Method.fromDescriptor = function fromDescriptor(descriptor) { - - // Decode the descriptor message if specified as a buffer: - if (typeof descriptor.length === "number") - descriptor = exports.MethodDescriptorProto.decode(descriptor); - - return new Method( - // unnamedMethodIndex is global, not per service, because we have no ref to a service here - descriptor.name && descriptor.name.length ? descriptor.name : "Method" + unnamedMethodIndex++, - "rpc", - descriptor.inputType, - descriptor.outputType, - Boolean(descriptor.clientStreaming), - Boolean(descriptor.serverStreaming), - fromDescriptorOptions(descriptor.options, exports.MethodOptions) - ); -}; - -/** - * Converts a method to a descriptor. - * @returns {Message} Descriptor - */ -Method.prototype.toDescriptor = function toDescriptor() { - return exports.MethodDescriptorProto.create({ - name: this.name, - inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType, - outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType, - clientStreaming: this.requestStream, - serverStreaming: this.responseStream, - options: toDescriptorOptions(this.options, exports.MethodOptions) - }); -}; - -// --- utility --- - -// Converts a descriptor type to a protobuf.js basic type -function fromDescriptorType(type) { - switch (type) { - // 0 is reserved for errors - case 1: return "double"; - case 2: return "float"; - case 3: return "int64"; - case 4: return "uint64"; - case 5: return "int32"; - case 6: return "fixed64"; - case 7: return "fixed32"; - case 8: return "bool"; - case 9: return "string"; - case 12: return "bytes"; - case 13: return "uint32"; - case 15: return "sfixed32"; - case 16: return "sfixed64"; - case 17: return "sint32"; - case 18: return "sint64"; - } - throw Error("illegal type: " + type); -} - -// Tests if a descriptor type is packable -function packableDescriptorType(type) { - switch (type) { - case 1: // double - case 2: // float - case 3: // int64 - case 4: // uint64 - case 5: // int32 - case 6: // fixed64 - case 7: // fixed32 - case 8: // bool - case 13: // uint32 - case 14: // enum (!) - case 15: // sfixed32 - case 16: // sfixed64 - case 17: // sint32 - case 18: // sint64 - return true; - } - return false; -} - -// Converts a protobuf.js basic type to a descriptor type -function toDescriptorType(type, resolvedType) { - switch (type) { - // 0 is reserved for errors - case "double": return 1; - case "float": return 2; - case "int64": return 3; - case "uint64": return 4; - case "int32": return 5; - case "fixed64": return 6; - case "fixed32": return 7; - case "bool": return 8; - case "string": return 9; - case "bytes": return 12; - case "uint32": return 13; - case "sfixed32": return 15; - case "sfixed64": return 16; - case "sint32": return 17; - case "sint64": return 18; - } - if (resolvedType instanceof Enum) - return 14; - if (resolvedType instanceof Type) - return resolvedType.group ? 10 : 11; - throw Error("illegal type: " + type); -} - -// Converts descriptor options to an options object -function fromDescriptorOptions(options, type) { - if (!options) - return undefined; - var out = []; - for (var i = 0, field, key, val; i < type.fieldsArray.length; ++i) - if ((key = (field = type._fieldsArray[i]).name) !== "uninterpretedOption") - if (options.hasOwnProperty(key)) { // eslint-disable-line no-prototype-builtins - val = options[key]; - if (field.resolvedType instanceof Enum && typeof val === "number" && field.resolvedType.valuesById[val] !== undefined) - val = field.resolvedType.valuesById[val]; - out.push(underScore(key), val); - } - return out.length ? $protobuf.util.toObject(out) : undefined; -} - -// Converts an options object to descriptor options -function toDescriptorOptions(options, type) { - if (!options) - return undefined; - var out = []; - for (var i = 0, ks = Object.keys(options), key, val; i < ks.length; ++i) { - val = options[key = ks[i]]; - if (key === "default") - continue; - var field = type.fields[key]; - if (!field && !(field = type.fields[key = $protobuf.util.camelCase(key)])) - continue; - out.push(key, val); - } - return out.length ? type.fromObject($protobuf.util.toObject(out)) : undefined; -} - -// Calculates the shortest relative path from `from` to `to`. -function shortname(from, to) { - var fromPath = from.fullName.split("."), - toPath = to.fullName.split("."), - i = 0, - j = 0, - k = toPath.length - 1; - if (!(from instanceof Root) && to instanceof Namespace) - while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) { - var other = to.lookup(fromPath[i++], true); - if (other !== null && other !== to) - break; - ++j; - } - else - for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j); - return toPath.slice(j).join("."); -} - -// copied here from cli/targets/proto.js -function underScore(str) { - return str.substring(0,1) - + str.substring(1) - .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return "_" + $1.toLowerCase(); }); -} - -// --- exports --- - -/** - * Reflected file descriptor set. - * @name FileDescriptorSet - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected file descriptor proto. - * @name FileDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected descriptor proto. - * @name DescriptorProto - * @type {Type} - * @property {Type} ExtensionRange - * @property {Type} ReservedRange - * @const - * @tstype $protobuf.Type & { - * ExtensionRange: $protobuf.Type, - * ReservedRange: $protobuf.Type - * } - */ - -/** - * Reflected field descriptor proto. - * @name FieldDescriptorProto - * @type {Type} - * @property {Enum} Label - * @property {Enum} Type - * @const - * @tstype $protobuf.Type & { - * Label: $protobuf.Enum, - * Type: $protobuf.Enum - * } - */ - -/** - * Reflected oneof descriptor proto. - * @name OneofDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum descriptor proto. - * @name EnumDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected service descriptor proto. - * @name ServiceDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum value descriptor proto. - * @name EnumValueDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected method descriptor proto. - * @name MethodDescriptorProto - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected file options. - * @name FileOptions - * @type {Type} - * @property {Enum} OptimizeMode - * @const - * @tstype $protobuf.Type & { - * OptimizeMode: $protobuf.Enum - * } - */ - -/** - * Reflected message options. - * @name MessageOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected field options. - * @name FieldOptions - * @type {Type} - * @property {Enum} CType - * @property {Enum} JSType - * @const - * @tstype $protobuf.Type & { - * CType: $protobuf.Enum, - * JSType: $protobuf.Enum - * } - */ - -/** - * Reflected oneof options. - * @name OneofOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum options. - * @name EnumOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected enum value options. - * @name EnumValueOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected service options. - * @name ServiceOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected method options. - * @name MethodOptions - * @type {Type} - * @const - * @tstype $protobuf.Type - */ - -/** - * Reflected uninterpretet option. - * @name UninterpretedOption - * @type {Type} - * @property {Type} NamePart - * @const - * @tstype $protobuf.Type & { - * NamePart: $protobuf.Type - * } - */ - -/** - * Reflected source code info. - * @name SourceCodeInfo - * @type {Type} - * @property {Type} Location - * @const - * @tstype $protobuf.Type & { - * Location: $protobuf.Type - * } - */ - -/** - * Reflected generated code info. - * @name GeneratedCodeInfo - * @type {Type} - * @property {Type} Annotation - * @const - * @tstype $protobuf.Type & { - * Annotation: $protobuf.Type - * } - */ diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/test.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/test.js deleted file mode 100644 index ceb80f827..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/ext/descriptor/test.js +++ /dev/null @@ -1,54 +0,0 @@ -/*eslint-disable no-console*/ -"use strict"; -var protobuf = require("../../"), - descriptor = require("."); - -/* var proto = { - nested: { - Message: { - fields: { - foo: { - type: "string", - id: 1 - } - }, - nested: { - SubMessage: { - fields: {} - } - } - }, - Enum: { - values: { - ONE: 1, - TWO: 2 - } - } - } -}; */ - -// var root = protobuf.Root.fromJSON(proto).resolveAll(); -var root = protobuf.loadSync("tests/data/google/protobuf/descriptor.proto").resolveAll(); - -// console.log("Original proto", JSON.stringify(root, null, 2)); - -var msg = root.toDescriptor(); - -// console.log("\nDescriptor", JSON.stringify(msg.toObject(), null, 2)); - -var buf = descriptor.FileDescriptorSet.encode(msg).finish(); -var root2 = protobuf.Root.fromDescriptor(buf, "proto2").resolveAll(); - -// console.log("\nDecoded proto", JSON.stringify(root2, null, 2)); - -var diff = require("deep-diff").diff(root.toJSON(), root2.toJSON()); -if (diff) { - diff.forEach(function(diff) { - console.log(diff.kind + " @ " + diff.path.join(".")); - console.log("lhs:", typeof diff.lhs, diff.lhs); - console.log("rhs:", typeof diff.rhs, diff.rhs); - console.log(); - }); - process.exitCode = 1; -} else - console.log("no differences"); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/LICENSE b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/LICENSE deleted file mode 100644 index 868bd40de..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2014, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/README.md b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/README.md deleted file mode 100644 index 09e3f2304..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/README.md +++ /dev/null @@ -1 +0,0 @@ -This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required. diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/annotations.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/annotations.json deleted file mode 100644 index 3f13a7338..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/annotations.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "api": { - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "selector": { - "type": "string", - "id": 1 - }, - "body": { - "type": "string", - "id": 7 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - } - } - }, - "protobuf": { - "nested": { - "MethodOptions": { - "fields": {}, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/annotations.proto b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/annotations.proto deleted file mode 100644 index 63a8eefda..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/annotations.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.MethodOptions { - - HttpRule http = 72295728; -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/http.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/http.json deleted file mode 100644 index e3a0f4f90..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/http.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "api": { - "nested": { - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "selector": { - "type": "string", - "id": 1 - }, - "body": { - "type": "string", - "id": 7 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/http.proto b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/http.proto deleted file mode 100644 index e9a7e9de5..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/api/http.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -package google.api; - -message Http { - - repeated HttpRule rules = 1; -} - -message HttpRule { - - oneof pattern { - - string get = 2; - string put = 3; - string post = 4; - string delete = 5; - string patch = 6; - CustomHttpPattern custom = 8; - } - - string selector = 1; - string body = 7; - repeated HttpRule additional_bindings = 11; -} - -message CustomHttpPattern { - - string kind = 1; - string path = 2; -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/api.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/api.json deleted file mode 100644 index 5460612f4..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/api.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "Api": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "methods": { - "rule": "repeated", - "type": "Method", - "id": 2 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 3 - }, - "version": { - "type": "string", - "id": 4 - }, - "sourceContext": { - "type": "SourceContext", - "id": 5 - }, - "mixins": { - "rule": "repeated", - "type": "Mixin", - "id": 6 - }, - "syntax": { - "type": "Syntax", - "id": 7 - } - } - }, - "Method": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "requestTypeUrl": { - "type": "string", - "id": 2 - }, - "requestStreaming": { - "type": "bool", - "id": 3 - }, - "responseTypeUrl": { - "type": "string", - "id": 4 - }, - "responseStreaming": { - "type": "bool", - "id": 5 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 6 - }, - "syntax": { - "type": "Syntax", - "id": 7 - } - } - }, - "Mixin": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "root": { - "type": "string", - "id": 2 - } - } - }, - "SourceContext": { - "fields": { - "fileName": { - "type": "string", - "id": 1 - } - } - }, - "Option": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "type": "Any", - "id": 2 - } - } - }, - "Syntax": { - "values": { - "SYNTAX_PROTO2": 0, - "SYNTAX_PROTO3": 1 - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/api.proto b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/api.proto deleted file mode 100644 index cf6ae3f33..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/api.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/source_context.proto"; -import "google/protobuf/type.proto"; - -message Api { - - string name = 1; - repeated Method methods = 2; - repeated Option options = 3; - string version = 4; - SourceContext source_context = 5; - repeated Mixin mixins = 6; - Syntax syntax = 7; -} - -message Method { - - string name = 1; - string request_type_url = 2; - bool request_streaming = 3; - string response_type_url = 4; - bool response_streaming = 5; - repeated Option options = 6; - Syntax syntax = 7; -} - -message Mixin { - - string name = 1; - string root = 2; -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/descriptor.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/descriptor.json deleted file mode 100644 index f6c5c1123..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/descriptor.json +++ /dev/null @@ -1,739 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "FileDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "FieldDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5 - }, - "serverStreaming": { - "type": "bool", - "id": 6 - } - } - }, - "FileOptions": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10 - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27 - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16 - }, - "javaGenericServices": { - "type": "bool", - "id": 17 - }, - "pyGenericServices": { - "type": "bool", - "id": 18 - }, - "deprecated": { - "type": "bool", - "id": 23 - }, - "ccEnableArenas": { - "type": "bool", - "id": 31 - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1 - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3 - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 8, - 8 - ] - ] - }, - "FieldOptions": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5 - }, - "deprecated": { - "type": "bool", - "id": 3 - }, - "weak": { - "type": "bool", - "id": 10 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - } - } - }, - "OneofOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "UninterpretedOption": { - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - } - } - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/descriptor.proto b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/descriptor.proto deleted file mode 100644 index 327949262..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/descriptor.proto +++ /dev/null @@ -1,286 +0,0 @@ -syntax = "proto2"; - -package google.protobuf; - -message FileDescriptorSet { - - repeated FileDescriptorProto file = 1; -} - -message FileDescriptorProto { - - optional string name = 1; - optional string package = 2; - repeated string dependency = 3; - repeated int32 public_dependency = 10; - repeated int32 weak_dependency = 11; - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - optional FileOptions options = 8; - optional SourceCodeInfo source_code_info = 9; - optional string syntax = 12; -} - -message DescriptorProto { - - optional string name = 1; - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - repeated ExtensionRange extension_range = 5; - repeated OneofDescriptorProto oneof_decl = 8; - optional MessageOptions options = 7; - repeated ReservedRange reserved_range = 9; - repeated string reserved_name = 10; - - message ExtensionRange { - - optional int32 start = 1; - optional int32 end = 2; - } - - message ReservedRange { - - optional int32 start = 1; - optional int32 end = 2; - } -} - -message FieldDescriptorProto { - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - optional Type type = 5; - optional string type_name = 6; - optional string extendee = 2; - optional string default_value = 7; - optional int32 oneof_index = 9; - optional string json_name = 10; - optional FieldOptions options = 8; - - enum Type { - - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; - TYPE_SINT64 = 18; - } - - enum Label { - - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } -} - -message OneofDescriptorProto { - - optional string name = 1; - optional OneofOptions options = 2; -} - -message EnumDescriptorProto { - - optional string name = 1; - repeated EnumValueDescriptorProto value = 2; - optional EnumOptions options = 3; -} - -message EnumValueDescriptorProto { - - optional string name = 1; - optional int32 number = 2; - optional EnumValueOptions options = 3; -} - -message ServiceDescriptorProto { - - optional string name = 1; - repeated MethodDescriptorProto method = 2; - optional ServiceOptions options = 3; -} - -message MethodDescriptorProto { - - optional string name = 1; - optional string input_type = 2; - optional string output_type = 3; - optional MethodOptions options = 4; - optional bool client_streaming = 5; - optional bool server_streaming = 6; -} - -message FileOptions { - - optional string java_package = 1; - optional string java_outer_classname = 8; - optional bool java_multiple_files = 10; - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - optional bool java_string_check_utf8 = 27; - optional OptimizeMode optimize_for = 9 [default=SPEED]; - optional string go_package = 11; - optional bool cc_generic_services = 16; - optional bool java_generic_services = 17; - optional bool py_generic_services = 18; - optional bool deprecated = 23; - optional bool cc_enable_arenas = 31; - optional string objc_class_prefix = 36; - optional string csharp_namespace = 37; - repeated UninterpretedOption uninterpreted_option = 999; - - enum OptimizeMode { - - SPEED = 1; - CODE_SIZE = 2; - LITE_RUNTIME = 3; - } - - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - - optional bool message_set_wire_format = 1; - optional bool no_standard_descriptor_accessor = 2; - optional bool deprecated = 3; - optional bool map_entry = 7; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; - - reserved 8; -} - -message FieldOptions { - - optional CType ctype = 1 [default=STRING]; - optional bool packed = 2; - optional JSType jstype = 6 [default=JS_NORMAL]; - optional bool lazy = 5; - optional bool deprecated = 3; - optional bool weak = 10; - repeated UninterpretedOption uninterpreted_option = 999; - - enum CType { - - STRING = 0; - CORD = 1; - STRING_PIECE = 2; - } - - enum JSType { - - JS_NORMAL = 0; - JS_STRING = 1; - JS_NUMBER = 2; - } - - extensions 1000 to max; - - reserved 4; -} - -message OneofOptions { - - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message EnumOptions { - - optional bool allow_alias = 2; - optional bool deprecated = 3; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message EnumValueOptions { - - optional bool deprecated = 1; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message ServiceOptions { - - optional bool deprecated = 33; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message MethodOptions { - - optional bool deprecated = 33; - repeated UninterpretedOption uninterpreted_option = 999; - - extensions 1000 to max; -} - -message UninterpretedOption { - - repeated NamePart name = 2; - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; - - message NamePart { - - required string name_part = 1; - required bool is_extension = 2; - } -} - -message SourceCodeInfo { - - repeated Location location = 1; - - message Location { - - repeated int32 path = 1 [packed=true]; - repeated int32 span = 2 [packed=true]; - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -message GeneratedCodeInfo { - - repeated Annotation annotation = 1; - - message Annotation { - - repeated int32 path = 1 [packed=true]; - optional string source_file = 2; - optional int32 begin = 3; - optional int32 end = 4; - } -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/source_context.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/source_context.json deleted file mode 100644 index 51adb63de..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/source_context.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "SourceContext": { - "fields": { - "fileName": { - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/source_context.proto b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/source_context.proto deleted file mode 100644 index 584d36cee..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/source_context.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto3"; - -package google.protobuf; - -message SourceContext { - string file_name = 1; -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/type.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/type.json deleted file mode 100644 index fffa70d98..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/type.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "protobuf": { - "nested": { - "Type": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "fields": { - "rule": "repeated", - "type": "Field", - "id": 2 - }, - "oneofs": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 4 - }, - "sourceContext": { - "type": "SourceContext", - "id": 5 - }, - "syntax": { - "type": "Syntax", - "id": 6 - } - } - }, - "Field": { - "fields": { - "kind": { - "type": "Kind", - "id": 1 - }, - "cardinality": { - "type": "Cardinality", - "id": 2 - }, - "number": { - "type": "int32", - "id": 3 - }, - "name": { - "type": "string", - "id": 4 - }, - "typeUrl": { - "type": "string", - "id": 6 - }, - "oneofIndex": { - "type": "int32", - "id": 7 - }, - "packed": { - "type": "bool", - "id": 8 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "defaultValue": { - "type": "string", - "id": 11 - } - }, - "nested": { - "Kind": { - "values": { - "TYPE_UNKNOWN": 0, - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Cardinality": { - "values": { - "CARDINALITY_UNKNOWN": 0, - "CARDINALITY_OPTIONAL": 1, - "CARDINALITY_REQUIRED": 2, - "CARDINALITY_REPEATED": 3 - } - } - } - }, - "Enum": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "enumvalue": { - "rule": "repeated", - "type": "EnumValue", - "id": 2 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 3 - }, - "sourceContext": { - "type": "SourceContext", - "id": 4 - }, - "syntax": { - "type": "Syntax", - "id": 5 - } - } - }, - "EnumValue": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "rule": "repeated", - "type": "Option", - "id": 3 - } - } - }, - "Option": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "type": "Any", - "id": 2 - } - } - }, - "Syntax": { - "values": { - "SYNTAX_PROTO2": 0, - "SYNTAX_PROTO3": 1 - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "SourceContext": { - "fields": { - "fileName": { - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/type.proto b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/type.proto deleted file mode 100644 index 8ee445bfc..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/google/protobuf/type.proto +++ /dev/null @@ -1,89 +0,0 @@ -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/any.proto"; -import "google/protobuf/source_context.proto"; - -message Type { - - string name = 1; - repeated Field fields = 2; - repeated string oneofs = 3; - repeated Option options = 4; - SourceContext source_context = 5; - Syntax syntax = 6; -} - -message Field { - - Kind kind = 1; - Cardinality cardinality = 2; - int32 number = 3; - string name = 4; - string type_url = 6; - int32 oneof_index = 7; - bool packed = 8; - repeated Option options = 9; - string json_name = 10; - string default_value = 11; - - enum Kind { - - TYPE_UNKNOWN = 0; - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; - TYPE_SINT64 = 18; - } - - enum Cardinality { - - CARDINALITY_UNKNOWN = 0; - CARDINALITY_OPTIONAL = 1; - CARDINALITY_REQUIRED = 2; - CARDINALITY_REPEATED = 3; - } -} - -message Enum { - - string name = 1; - repeated EnumValue enumvalue = 2; - repeated Option options = 3; - SourceContext source_context = 4; - Syntax syntax = 5; -} - -message EnumValue { - - string name = 1; - int32 number = 2; - repeated Option options = 3; -} - -message Option { - - string name = 1; - Any value = 2; -} - -enum Syntax { - - SYNTAX_PROTO2 = 0; - SYNTAX_PROTO3 = 1; -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/index.d.ts b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/index.d.ts deleted file mode 100644 index 750ad2f73..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/index.d.ts +++ /dev/null @@ -1,2741 +0,0 @@ -// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'. - -export as namespace protobuf; - -/** - * Provides common type definitions. - * Can also be used to provide additional google types or your own custom types. - * @param name Short name as in `google/protobuf/[name].proto` or full file name - * @param json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition - */ -export function common(name: string, json: { [k: string]: any }): void; - -export namespace common { - - /** Properties of a google.protobuf.Any message. */ - interface IAny { - typeUrl?: string; - bytes?: Uint8Array; - } - - /** Properties of a google.protobuf.Duration message. */ - interface IDuration { - seconds?: (number|Long); - nanos?: number; - } - - /** Properties of a google.protobuf.Timestamp message. */ - interface ITimestamp { - seconds?: (number|Long); - nanos?: number; - } - - /** Properties of a google.protobuf.Empty message. */ - interface IEmpty { - } - - /** Properties of a google.protobuf.Struct message. */ - interface IStruct { - fields?: { [k: string]: IValue }; - } - - /** Properties of a google.protobuf.Value message. */ - interface IValue { - kind?: string; - nullValue?: 0; - numberValue?: number; - stringValue?: string; - boolValue?: boolean; - structValue?: IStruct; - listValue?: IListValue; - } - - /** Properties of a google.protobuf.ListValue message. */ - interface IListValue { - values?: IValue[]; - } - - /** Properties of a google.protobuf.DoubleValue message. */ - interface IDoubleValue { - value?: number; - } - - /** Properties of a google.protobuf.FloatValue message. */ - interface IFloatValue { - value?: number; - } - - /** Properties of a google.protobuf.Int64Value message. */ - interface IInt64Value { - value?: (number|Long); - } - - /** Properties of a google.protobuf.UInt64Value message. */ - interface IUInt64Value { - value?: (number|Long); - } - - /** Properties of a google.protobuf.Int32Value message. */ - interface IInt32Value { - value?: number; - } - - /** Properties of a google.protobuf.UInt32Value message. */ - interface IUInt32Value { - value?: number; - } - - /** Properties of a google.protobuf.BoolValue message. */ - interface IBoolValue { - value?: boolean; - } - - /** Properties of a google.protobuf.StringValue message. */ - interface IStringValue { - value?: string; - } - - /** Properties of a google.protobuf.BytesValue message. */ - interface IBytesValue { - value?: Uint8Array; - } - - /** - * Gets the root definition of the specified common proto file. - * - * Bundled definitions are: - * - google/protobuf/any.proto - * - google/protobuf/duration.proto - * - google/protobuf/empty.proto - * - google/protobuf/field_mask.proto - * - google/protobuf/struct.proto - * - google/protobuf/timestamp.proto - * - google/protobuf/wrappers.proto - * - * @param file Proto file name - * @returns Root definition or `null` if not defined - */ - function get(file: string): (INamespace|null); -} - -/** Runtime message from/to plain object converters. */ -export namespace converter { - - /** - * Generates a plain object to runtime message converter specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ - function fromObject(mtype: Type): Codegen; - - /** - * Generates a runtime message to plain object converter specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ - function toObject(mtype: Type): Codegen; -} - -/** - * Generates a decoder specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ -export function decoder(mtype: Type): Codegen; - -/** - * Generates an encoder specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ -export function encoder(mtype: Type): Codegen; - -/** Reflected enum. */ -export class Enum extends ReflectionObject { - - /** - * Constructs a new enum instance. - * @param name Unique name within its namespace - * @param [values] Enum values as an object, by name - * @param [options] Declared options - * @param [comment] The comment for this enum - * @param [comments] The value comments for this enum - * @param [valuesOptions] The value options for this enum - */ - constructor(name: string, values?: { [k: string]: number }, options?: { [k: string]: any }, comment?: string, comments?: { [k: string]: string }, valuesOptions?: ({ [k: string]: { [k: string]: any } }|undefined)); - - /** Enum values by id. */ - public valuesById: { [k: number]: string }; - - /** Enum values by name. */ - public values: { [k: string]: number }; - - /** Enum comment text. */ - public comment: (string|null); - - /** Value comment texts, if any. */ - public comments: { [k: string]: string }; - - /** Values options, if any */ - public valuesOptions?: { [k: string]: { [k: string]: any } }; - - /** Reserved ranges, if any. */ - public reserved: (number[]|string)[]; - - /** - * Constructs an enum from an enum descriptor. - * @param name Enum name - * @param json Enum descriptor - * @returns Created enum - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IEnum): Enum; - - /** - * Converts this enum to an enum descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Enum descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IEnum; - - /** - * Adds a value to this enum. - * @param name Value name - * @param id Value id - * @param [comment] Comment, if any - * @param {Object.|undefined} [options] Options, if any - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a value with this name or id - */ - public add(name: string, id: number, comment?: string, options?: ({ [k: string]: any }|undefined)): Enum; - - /** - * Removes a value from this enum - * @param name Value name - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `name` is not a name of this enum - */ - public remove(name: string): Enum; - - /** - * Tests if the specified id is reserved. - * @param id Id to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedId(id: number): boolean; - - /** - * Tests if the specified name is reserved. - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedName(name: string): boolean; -} - -/** Enum descriptor. */ -export interface IEnum { - - /** Enum values */ - values: { [k: string]: number }; - - /** Enum options */ - options?: { [k: string]: any }; -} - -/** Reflected message field. */ -export class Field extends FieldBase { - - /** - * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. - * @param name Unique name within its namespace - * @param id Unique id within its namespace - * @param type Value type - * @param [rule="optional"] Field rule - * @param [extend] Extended type if different from parent - * @param [options] Declared options - */ - constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }); - - /** - * Constructs a field from a field descriptor. - * @param name Field name - * @param json Field descriptor - * @returns Created field - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IField): Field; - - /** Determines whether this field is packed. Only relevant when repeated and working with proto2. */ - public readonly packed: boolean; - - /** - * Field decorator (TypeScript). - * @param fieldId Field id - * @param fieldType Field type - * @param [fieldRule="optional"] Field rule - * @param [defaultValue] Default value - * @returns Decorator function - */ - public static d(fieldId: number, fieldType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|object), fieldRule?: ("optional"|"required"|"repeated"), defaultValue?: T): FieldDecorator; - - /** - * Field decorator (TypeScript). - * @param fieldId Field id - * @param fieldType Field type - * @param [fieldRule="optional"] Field rule - * @returns Decorator function - */ - public static d>(fieldId: number, fieldType: (Constructor|string), fieldRule?: ("optional"|"required"|"repeated")): FieldDecorator; -} - -/** Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. */ -export class FieldBase extends ReflectionObject { - - /** - * Not an actual constructor. Use {@link Field} instead. - * @param name Unique name within its namespace - * @param id Unique id within its namespace - * @param type Value type - * @param [rule="optional"] Field rule - * @param [extend] Extended type if different from parent - * @param [options] Declared options - * @param [comment] Comment associated with this field - */ - constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); - - /** Field type. */ - public type: string; - - /** Unique field id. */ - public id: number; - - /** Extended type if different from parent. */ - public extend?: string; - - /** Whether this field is required. */ - public required: boolean; - - /** Whether this field is optional. */ - public optional: boolean; - - /** Whether this field is repeated. */ - public repeated: boolean; - - /** Whether this field is a map or not. */ - public map: boolean; - - /** Message this field belongs to. */ - public message: (Type|null); - - /** OneOf this field belongs to, if any, */ - public partOf: (OneOf|null); - - /** The field type's default value. */ - public typeDefault: any; - - /** The field's default value on prototypes. */ - public defaultValue: any; - - /** Whether this field's value should be treated as a long. */ - public long: boolean; - - /** Whether this field's value is a buffer. */ - public bytes: boolean; - - /** Resolved type if not a basic type. */ - public resolvedType: (Type|Enum|null); - - /** Sister-field within the extended type if a declaring extension field. */ - public extensionField: (Field|null); - - /** Sister-field within the declaring namespace if an extended field. */ - public declaringField: (Field|null); - - /** Comment for this field. */ - public comment: (string|null); - - /** - * Converts this field to a field descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Field descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IField; - - /** - * Resolves this field's type references. - * @returns `this` - * @throws {Error} If any reference cannot be resolved - */ - public resolve(): Field; -} - -/** Field descriptor. */ -export interface IField { - - /** Field rule */ - rule?: string; - - /** Field type */ - type: string; - - /** Field id */ - id: number; - - /** Field options */ - options?: { [k: string]: any }; -} - -/** Extension field descriptor. */ -export interface IExtensionField extends IField { - - /** Extended type */ - extend: string; -} - -/** - * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). - * @param prototype Target prototype - * @param fieldName Field name - */ -type FieldDecorator = (prototype: object, fieldName: string) => void; - -/** - * A node-style callback as used by {@link load} and {@link Root#load}. - * @param error Error, if any, otherwise `null` - * @param [root] Root, if there hasn't been an error - */ -type LoadCallback = (error: (Error|null), root?: Root) => void; - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param filename One or multiple files to load - * @param root Root namespace, defaults to create a new one if omitted. - * @param callback Callback function - * @see {@link Root#load} - */ -export function load(filename: (string|string[]), root: Root, callback: LoadCallback): void; - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param filename One or multiple files to load - * @param callback Callback function - * @see {@link Root#load} - */ -export function load(filename: (string|string[]), callback: LoadCallback): void; - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. - * @param filename One or multiple files to load - * @param [root] Root namespace, defaults to create a new one if omitted. - * @returns Promise - * @see {@link Root#load} - */ -export function load(filename: (string|string[]), root?: Root): Promise; - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). - * @param filename One or multiple files to load - * @param [root] Root namespace, defaults to create a new one if omitted. - * @returns Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - * @see {@link Root#loadSync} - */ -export function loadSync(filename: (string|string[]), root?: Root): Root; - -/** Build type, one of `"full"`, `"light"` or `"minimal"`. */ -export const build: string; - -/** Reconfigures the library according to the environment. */ -export function configure(): void; - -/** Reflected map field. */ -export class MapField extends FieldBase { - - /** - * Constructs a new map field instance. - * @param name Unique name within its namespace - * @param id Unique id within its namespace - * @param keyType Key type - * @param type Value type - * @param [options] Declared options - * @param [comment] Comment associated with this field - */ - constructor(name: string, id: number, keyType: string, type: string, options?: { [k: string]: any }, comment?: string); - - /** Key type. */ - public keyType: string; - - /** Resolved key type if not a basic type. */ - public resolvedKeyType: (ReflectionObject|null); - - /** - * Constructs a map field from a map field descriptor. - * @param name Field name - * @param json Map field descriptor - * @returns Created map field - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IMapField): MapField; - - /** - * Converts this map field to a map field descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Map field descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IMapField; - - /** - * Map field decorator (TypeScript). - * @param fieldId Field id - * @param fieldKeyType Field key type - * @param fieldValueType Field value type - * @returns Decorator function - */ - public static d }>(fieldId: number, fieldKeyType: ("int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"), fieldValueType: ("double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|object|Constructor<{}>)): FieldDecorator; -} - -/** Map field descriptor. */ -export interface IMapField extends IField { - - /** Key type */ - keyType: string; -} - -/** Extension map field descriptor. */ -export interface IExtensionMapField extends IMapField { - - /** Extended type */ - extend: string; -} - -/** Abstract runtime message. */ -export class Message { - - /** - * Constructs a new message instance. - * @param [properties] Properties to set - */ - constructor(properties?: Properties); - - /** Reference to the reflected type. */ - public static readonly $type: Type; - - /** Reference to the reflected type. */ - public readonly $type: Type; - - /** - * Creates a new message of this type using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create>(this: Constructor, properties?: { [k: string]: any }): Message; - - /** - * Encodes a message of this type. - * @param message Message to encode - * @param [writer] Writer to use - * @returns Writer - */ - public static encode>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Encodes a message of this type preceeded by its length as a varint. - * @param message Message to encode - * @param [writer] Writer to use - * @returns Writer - */ - public static encodeDelimited>(this: Constructor, message: (T|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Decodes a message of this type. - * @param reader Reader or buffer to decode - * @returns Decoded message - */ - public static decode>(this: Constructor, reader: (Reader|Uint8Array)): T; - - /** - * Decodes a message of this type preceeded by its length as a varint. - * @param reader Reader or buffer to decode - * @returns Decoded message - */ - public static decodeDelimited>(this: Constructor, reader: (Reader|Uint8Array)): T; - - /** - * Verifies a message of this type. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message instance - */ - public static fromObject>(this: Constructor, object: { [k: string]: any }): T; - - /** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param message Message instance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject>(this: Constructor, message: T, options?: IConversionOptions): { [k: string]: any }; - - /** - * Converts this message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} - -/** Reflected service method. */ -export class Method extends ReflectionObject { - - /** - * Constructs a new service method instance. - * @param name Method name - * @param type Method type, usually `"rpc"` - * @param requestType Request message type - * @param responseType Response message type - * @param [requestStream] Whether the request is streamed - * @param [responseStream] Whether the response is streamed - * @param [options] Declared options - * @param [comment] The comment for this method - * @param [parsedOptions] Declared options, properly parsed into an object - */ - constructor(name: string, type: (string|undefined), requestType: string, responseType: string, requestStream?: (boolean|{ [k: string]: any }), responseStream?: (boolean|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string, parsedOptions?: { [k: string]: any }); - - /** Method type. */ - public type: string; - - /** Request type. */ - public requestType: string; - - /** Whether requests are streamed or not. */ - public requestStream?: boolean; - - /** Response type. */ - public responseType: string; - - /** Whether responses are streamed or not. */ - public responseStream?: boolean; - - /** Resolved request type. */ - public resolvedRequestType: (Type|null); - - /** Resolved response type. */ - public resolvedResponseType: (Type|null); - - /** Comment for this method */ - public comment: (string|null); - - /** Options properly parsed into an object */ - public parsedOptions: any; - - /** - * Constructs a method from a method descriptor. - * @param name Method name - * @param json Method descriptor - * @returns Created method - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IMethod): Method; - - /** - * Converts this method to a method descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Method descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IMethod; -} - -/** Method descriptor. */ -export interface IMethod { - - /** Method type */ - type?: string; - - /** Request type */ - requestType: string; - - /** Response type */ - responseType: string; - - /** Whether requests are streamed */ - requestStream?: boolean; - - /** Whether responses are streamed */ - responseStream?: boolean; - - /** Method options */ - options?: { [k: string]: any }; - - /** Method comments */ - comment: string; - - /** Method options properly parsed into an object */ - parsedOptions?: { [k: string]: any }; -} - -/** Reflected namespace. */ -export class Namespace extends NamespaceBase { - - /** - * Constructs a new namespace instance. - * @param name Namespace name - * @param [options] Declared options - */ - constructor(name: string, options?: { [k: string]: any }); - - /** - * Constructs a namespace from JSON. - * @param name Namespace name - * @param json JSON object - * @returns Created namespace - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: { [k: string]: any }): Namespace; - - /** - * Converts an array of reflection objects to JSON. - * @param array Object array - * @param [toJSONOptions] JSON conversion options - * @returns JSON object or `undefined` when array is empty - */ - public static arrayToJSON(array: ReflectionObject[], toJSONOptions?: IToJSONOptions): ({ [k: string]: any }|undefined); - - /** - * Tests if the specified id is reserved. - * @param reserved Array of reserved ranges and names - * @param id Id to test - * @returns `true` if reserved, otherwise `false` - */ - public static isReservedId(reserved: ((number[]|string)[]|undefined), id: number): boolean; - - /** - * Tests if the specified name is reserved. - * @param reserved Array of reserved ranges and names - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - public static isReservedName(reserved: ((number[]|string)[]|undefined), name: string): boolean; -} - -/** Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. */ -export abstract class NamespaceBase extends ReflectionObject { - - /** Nested objects by name. */ - public nested?: { [k: string]: ReflectionObject }; - - /** Nested objects of this namespace as an array for iteration. */ - public readonly nestedArray: ReflectionObject[]; - - /** - * Converts this namespace to a namespace descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Namespace descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): INamespace; - - /** - * Adds nested objects to this namespace from nested object descriptors. - * @param nestedJson Any nested object descriptors - * @returns `this` - */ - public addJSON(nestedJson: { [k: string]: AnyNestedObject }): Namespace; - - /** - * Gets the nested object of the specified name. - * @param name Nested object name - * @returns The reflection object or `null` if it doesn't exist - */ - public get(name: string): (ReflectionObject|null); - - /** - * Gets the values of the nested {@link Enum|enum} of the specified name. - * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. - * @param name Nested enum name - * @returns Enum values - * @throws {Error} If there is no such enum - */ - public getEnum(name: string): { [k: string]: number }; - - /** - * Adds a nested object to this namespace. - * @param object Nested object to add - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name - */ - public add(object: ReflectionObject): Namespace; - - /** - * Removes a nested object from this namespace. - * @param object Nested object to remove - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this namespace - */ - public remove(object: ReflectionObject): Namespace; - - /** - * Defines additial namespaces within this one if not yet existing. - * @param path Path to create - * @param [json] Nested types to create from JSON - * @returns Pointer to the last namespace created or `this` if path is empty - */ - public define(path: (string|string[]), json?: any): Namespace; - - /** - * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. - * @returns `this` - */ - public resolveAll(): Namespace; - - /** - * Recursively looks up the reflection object matching the specified path in the scope of this namespace. - * @param path Path to look up - * @param filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. - * @param [parentAlreadyChecked=false] If known, whether the parent has already been checked - * @returns Looked up object or `null` if none could be found - */ - public lookup(path: (string|string[]), filterTypes: (any|any[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); - - /** - * Looks up the reflection object at the specified path, relative to this namespace. - * @param path Path to look up - * @param [parentAlreadyChecked=false] Whether the parent has already been checked - * @returns Looked up object or `null` if none could be found - */ - public lookup(path: (string|string[]), parentAlreadyChecked?: boolean): (ReflectionObject|null); - - /** - * Looks up the {@link Type|type} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up type - * @throws {Error} If `path` does not point to a type - */ - public lookupType(path: (string|string[])): Type; - - /** - * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up enum - * @throws {Error} If `path` does not point to an enum - */ - public lookupEnum(path: (string|string[])): Enum; - - /** - * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up type or enum - * @throws {Error} If `path` does not point to a type or enum - */ - public lookupTypeOrEnum(path: (string|string[])): Type; - - /** - * Looks up the {@link Service|service} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param path Path to look up - * @returns Looked up service - * @throws {Error} If `path` does not point to a service - */ - public lookupService(path: (string|string[])): Service; -} - -/** Namespace descriptor. */ -export interface INamespace { - - /** Namespace options */ - options?: { [k: string]: any }; - - /** Nested object descriptors */ - nested?: { [k: string]: AnyNestedObject }; -} - -/** Any extension field descriptor. */ -type AnyExtensionField = (IExtensionField|IExtensionMapField); - -/** Any nested object descriptor. */ -type AnyNestedObject = (IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf); - -/** Base class of all reflection objects. */ -export abstract class ReflectionObject { - - /** Options. */ - public options?: { [k: string]: any }; - - /** Parsed Options. */ - public parsedOptions?: { [k: string]: any[] }; - - /** Unique name within its namespace. */ - public name: string; - - /** Parent namespace. */ - public parent: (Namespace|null); - - /** Whether already resolved or not. */ - public resolved: boolean; - - /** Comment text, if any. */ - public comment: (string|null); - - /** Defining file name. */ - public filename: (string|null); - - /** Reference to the root namespace. */ - public readonly root: Root; - - /** Full name including leading dot. */ - public readonly fullName: string; - - /** - * Converts this reflection object to its descriptor representation. - * @returns Descriptor - */ - public toJSON(): { [k: string]: any }; - - /** - * Called when this object is added to a parent. - * @param parent Parent added to - */ - public onAdd(parent: ReflectionObject): void; - - /** - * Called when this object is removed from a parent. - * @param parent Parent removed from - */ - public onRemove(parent: ReflectionObject): void; - - /** - * Resolves this objects type references. - * @returns `this` - */ - public resolve(): ReflectionObject; - - /** - * Gets an option value. - * @param name Option name - * @returns Option value or `undefined` if not set - */ - public getOption(name: string): any; - - /** - * Sets an option. - * @param name Option name - * @param value Option value - * @param [ifNotSet] Sets the option only if it isn't currently set - * @returns `this` - */ - public setOption(name: string, value: any, ifNotSet?: boolean): ReflectionObject; - - /** - * Sets a parsed option. - * @param name parsed Option name - * @param value Option value - * @param propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value - * @returns `this` - */ - public setParsedOption(name: string, value: any, propName: string): ReflectionObject; - - /** - * Sets multiple options. - * @param options Options to set - * @param [ifNotSet] Sets an option only if it isn't currently set - * @returns `this` - */ - public setOptions(options: { [k: string]: any }, ifNotSet?: boolean): ReflectionObject; - - /** - * Converts this instance to its string representation. - * @returns Class name[, space, full name] - */ - public toString(): string; -} - -/** Reflected oneof. */ -export class OneOf extends ReflectionObject { - - /** - * Constructs a new oneof instance. - * @param name Oneof name - * @param [fieldNames] Field names - * @param [options] Declared options - * @param [comment] Comment associated with this field - */ - constructor(name: string, fieldNames?: (string[]|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string); - - /** Field names that belong to this oneof. */ - public oneof: string[]; - - /** Fields that belong to this oneof as an array for iteration. */ - public readonly fieldsArray: Field[]; - - /** Comment for this field. */ - public comment: (string|null); - - /** - * Constructs a oneof from a oneof descriptor. - * @param name Oneof name - * @param json Oneof descriptor - * @returns Created oneof - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IOneOf): OneOf; - - /** - * Converts this oneof to a oneof descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Oneof descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IOneOf; - - /** - * Adds a field to this oneof and removes it from its current parent, if any. - * @param field Field to add - * @returns `this` - */ - public add(field: Field): OneOf; - - /** - * Removes a field from this oneof and puts it back to the oneof's parent. - * @param field Field to remove - * @returns `this` - */ - public remove(field: Field): OneOf; - - /** - * OneOf decorator (TypeScript). - * @param fieldNames Field names - * @returns Decorator function - */ - public static d(...fieldNames: string[]): OneOfDecorator; -} - -/** Oneof descriptor. */ -export interface IOneOf { - - /** Oneof field names */ - oneof: string[]; - - /** Oneof options */ - options?: { [k: string]: any }; -} - -/** - * Decorator function as returned by {@link OneOf.d} (TypeScript). - * @param prototype Target prototype - * @param oneofName OneOf name - */ -type OneOfDecorator = (prototype: object, oneofName: string) => void; - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param source Source contents - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Parser result - */ -export function parse(source: string, options?: IParseOptions): IParserResult; - -/** Result object returned from {@link parse}. */ -export interface IParserResult { - - /** Package name, if declared */ - package: (string|undefined); - - /** Imports, if any */ - imports: (string[]|undefined); - - /** Weak imports, if any */ - weakImports: (string[]|undefined); - - /** Syntax, if specified (either `"proto2"` or `"proto3"`) */ - syntax: (string|undefined); - - /** Populated root instance */ - root: Root; -} - -/** Options modifying the behavior of {@link parse}. */ -export interface IParseOptions { - - /** Keeps field casing instead of converting to camel case */ - keepCase?: boolean; - - /** Recognize double-slash comments in addition to doc-block comments. */ - alternateCommentMode?: boolean; - - /** Use trailing comment when both leading comment and trailing comment exist. */ - preferTrailingComment?: boolean; -} - -/** Options modifying the behavior of JSON serialization. */ -export interface IToJSONOptions { - - /** Serializes comments. */ - keepComments?: boolean; -} - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param source Source contents - * @param root Root to populate - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Parser result - */ -export function parse(source: string, root: Root, options?: IParseOptions): IParserResult; - -/** Wire format reader using `Uint8Array` if available, otherwise `Array`. */ -export class Reader { - - /** - * Constructs a new reader instance using the specified buffer. - * @param buffer Buffer to read from - */ - constructor(buffer: Uint8Array); - - /** Read buffer. */ - public buf: Uint8Array; - - /** Read buffer position. */ - public pos: number; - - /** Read buffer length. */ - public len: number; - - /** - * Creates a new reader using the specified buffer. - * @param buffer Buffer to read from - * @returns A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ - public static create(buffer: (Uint8Array|Buffer)): (Reader|BufferReader); - - /** - * Reads a varint as an unsigned 32 bit value. - * @returns Value read - */ - public uint32(): number; - - /** - * Reads a varint as a signed 32 bit value. - * @returns Value read - */ - public int32(): number; - - /** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns Value read - */ - public sint32(): number; - - /** - * Reads a varint as a signed 64 bit value. - * @returns Value read - */ - public int64(): Long; - - /** - * Reads a varint as an unsigned 64 bit value. - * @returns Value read - */ - public uint64(): Long; - - /** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @returns Value read - */ - public sint64(): Long; - - /** - * Reads a varint as a boolean. - * @returns Value read - */ - public bool(): boolean; - - /** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns Value read - */ - public fixed32(): number; - - /** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns Value read - */ - public sfixed32(): number; - - /** - * Reads fixed 64 bits. - * @returns Value read - */ - public fixed64(): Long; - - /** - * Reads zig-zag encoded fixed 64 bits. - * @returns Value read - */ - public sfixed64(): Long; - - /** - * Reads a float (32 bit) as a number. - * @returns Value read - */ - public float(): number; - - /** - * Reads a double (64 bit float) as a number. - * @returns Value read - */ - public double(): number; - - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns Value read - */ - public bytes(): Uint8Array; - - /** - * Reads a string preceeded by its byte length as a varint. - * @returns Value read - */ - public string(): string; - - /** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param [length] Length if known, otherwise a varint is assumed - * @returns `this` - */ - public skip(length?: number): Reader; - - /** - * Skips the next element of the specified wire type. - * @param wireType Wire type received - * @returns `this` - */ - public skipType(wireType: number): Reader; -} - -/** Wire format reader using node buffers. */ -export class BufferReader extends Reader { - - /** - * Constructs a new buffer reader instance. - * @param buffer Buffer to read from - */ - constructor(buffer: Buffer); - - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns Value read - */ - public bytes(): Buffer; -} - -/** Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. */ -export class Root extends NamespaceBase { - - /** - * Constructs a new root namespace instance. - * @param [options] Top level options - */ - constructor(options?: { [k: string]: any }); - - /** Deferred extension fields. */ - public deferred: Field[]; - - /** Resolved file names of loaded files. */ - public files: string[]; - - /** - * Loads a namespace descriptor into a root namespace. - * @param json Nameespace descriptor - * @param [root] Root namespace, defaults to create a new one if omitted - * @returns Root namespace - */ - public static fromJSON(json: INamespace, root?: Root): Root; - - /** - * Resolves the path of an imported file, relative to the importing origin. - * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. - * @param origin The file name of the importing file - * @param target The file name being imported - * @returns Resolved path to `target` or `null` to skip the file - */ - public resolvePath(origin: string, target: string): (string|null); - - /** - * Fetch content from file path or url - * This method exists so you can override it with your own logic. - * @param path File path or url - * @param callback Callback function - */ - public fetch(path: string, callback: FetchCallback): void; - - /** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param filename Names of one or multiple files to load - * @param options Parse options - * @param callback Callback function - */ - public load(filename: (string|string[]), options: IParseOptions, callback: LoadCallback): void; - - /** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param filename Names of one or multiple files to load - * @param callback Callback function - */ - public load(filename: (string|string[]), callback: LoadCallback): void; - - /** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. - * @param filename Names of one or multiple files to load - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Promise - */ - public load(filename: (string|string[]), options?: IParseOptions): Promise; - - /** - * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). - * @param filename Names of one or multiple files to load - * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - */ - public loadSync(filename: (string|string[]), options?: IParseOptions): Root; -} - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - */ -export let roots: { [k: string]: Root }; - -/** Streaming RPC helpers. */ -export namespace rpc { - - /** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @param error Error, if any - * @param [response] Response message - */ - type ServiceMethodCallback> = (error: (Error|null), response?: TRes) => void; - - /** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @param request Request message or plain object - * @param [callback] Node-style callback called with the error, if any, and the response message - * @returns Promise if `callback` has been omitted, otherwise `undefined` - */ - type ServiceMethod, TRes extends Message> = (request: (TReq|Properties), callback?: rpc.ServiceMethodCallback) => Promise>; - - /** An RPC service as returned by {@link Service#create}. */ - class Service extends util.EventEmitter { - - /** - * Constructs a new RPC service instance. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** RPC implementation. Becomes `null` once the service is ended. */ - public rpcImpl: (RPCImpl|null); - - /** Whether requests are length-delimited. */ - public requestDelimited: boolean; - - /** Whether responses are length-delimited. */ - public responseDelimited: boolean; - - /** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param method Reflected or static method - * @param requestCtor Request constructor - * @param responseCtor Response constructor - * @param request Request message or plain object - * @param callback Service callback - */ - public rpcCall, TRes extends Message>(method: (Method|rpc.ServiceMethod), requestCtor: Constructor, responseCtor: Constructor, request: (TReq|Properties), callback: rpc.ServiceMethodCallback): void; - - /** - * Ends this service and emits the `end` event. - * @param [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns `this` - */ - public end(endedByRPC?: boolean): rpc.Service; - } -} - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @param method Reflected or static method being called - * @param requestData Request data - * @param callback Callback function - */ -type RPCImpl = (method: (Method|rpc.ServiceMethod, Message<{}>>), requestData: Uint8Array, callback: RPCImplCallback) => void; - -/** - * Node-style callback as used by {@link RPCImpl}. - * @param error Error, if any, otherwise `null` - * @param [response] Response data or `null` to signal end of stream, if there hasn't been an error - */ -type RPCImplCallback = (error: (Error|null), response?: (Uint8Array|null)) => void; - -/** Reflected service. */ -export class Service extends NamespaceBase { - - /** - * Constructs a new service instance. - * @param name Service name - * @param [options] Service options - * @throws {TypeError} If arguments are invalid - */ - constructor(name: string, options?: { [k: string]: any }); - - /** Service methods. */ - public methods: { [k: string]: Method }; - - /** - * Constructs a service from a service descriptor. - * @param name Service name - * @param json Service descriptor - * @returns Created service - * @throws {TypeError} If arguments are invalid - */ - public static fromJSON(name: string, json: IService): Service; - - /** - * Converts this service to a service descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Service descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IService; - - /** Methods of this service as an array for iteration. */ - public readonly methodsArray: Method[]; - - /** - * Creates a runtime service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public create(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): rpc.Service; -} - -/** Service descriptor. */ -export interface IService extends INamespace { - - /** Method descriptors */ - methods: { [k: string]: IMethod }; -} - -/** - * Gets the next token and advances. - * @returns Next token or `null` on eof - */ -type TokenizerHandleNext = () => (string|null); - -/** - * Peeks for the next token. - * @returns Next token or `null` on eof - */ -type TokenizerHandlePeek = () => (string|null); - -/** - * Pushes a token back to the stack. - * @param token Token - */ -type TokenizerHandlePush = (token: string) => void; - -/** - * Skips the next token. - * @param expected Expected token - * @param [optional=false] If optional - * @returns Whether the token matched - * @throws {Error} If the token didn't match and is not optional - */ -type TokenizerHandleSkip = (expected: string, optional?: boolean) => boolean; - -/** - * Gets the comment on the previous line or, alternatively, the line comment on the specified line. - * @param [line] Line number - * @returns Comment text or `null` if none - */ -type TokenizerHandleCmnt = (line?: number) => (string|null); - -/** Handle object returned from {@link tokenize}. */ -export interface ITokenizerHandle { - - /** Gets the next token and advances (`null` on eof) */ - next: TokenizerHandleNext; - - /** Peeks for the next token (`null` on eof) */ - peek: TokenizerHandlePeek; - - /** Pushes a token back to the stack */ - push: TokenizerHandlePush; - - /** Skips a token, returns its presence and advances or, if non-optional and not present, throws */ - skip: TokenizerHandleSkip; - - /** Gets the comment on the previous line or the line comment on the specified line, if any */ - cmnt: TokenizerHandleCmnt; - - /** Current line number */ - line: number; -} - -/** - * Tokenizes the given .proto source and returns an object with useful utility functions. - * @param source Source contents - * @param alternateCommentMode Whether we should activate alternate comment parsing mode. - * @returns Tokenizer handle - */ -export function tokenize(source: string, alternateCommentMode: boolean): ITokenizerHandle; - -export namespace tokenize { - - /** - * Unescapes a string. - * @param str String to unescape - * @returns Unescaped string - */ - function unescape(str: string): string; -} - -/** Reflected message type. */ -export class Type extends NamespaceBase { - - /** - * Constructs a new reflected message type instance. - * @param name Message name - * @param [options] Declared options - */ - constructor(name: string, options?: { [k: string]: any }); - - /** Message fields. */ - public fields: { [k: string]: Field }; - - /** Oneofs declared within this namespace, if any. */ - public oneofs: { [k: string]: OneOf }; - - /** Extension ranges, if any. */ - public extensions: number[][]; - - /** Reserved ranges, if any. */ - public reserved: (number[]|string)[]; - - /** Message fields by id. */ - public readonly fieldsById: { [k: number]: Field }; - - /** Fields of this message as an array for iteration. */ - public readonly fieldsArray: Field[]; - - /** Oneofs of this message as an array for iteration. */ - public readonly oneofsArray: OneOf[]; - - /** - * The registered constructor, if any registered, otherwise a generic constructor. - * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. - */ - public ctor: Constructor<{}>; - - /** - * Generates a constructor function for the specified type. - * @param mtype Message type - * @returns Codegen instance - */ - public static generateConstructor(mtype: Type): Codegen; - - /** - * Creates a message type from a message type descriptor. - * @param name Message name - * @param json Message type descriptor - * @returns Created message type - */ - public static fromJSON(name: string, json: IType): Type; - - /** - * Converts this message type to a message type descriptor. - * @param [toJSONOptions] JSON conversion options - * @returns Message type descriptor - */ - public toJSON(toJSONOptions?: IToJSONOptions): IType; - - /** - * Adds a nested object to this type. - * @param object Nested object to add - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id - */ - public add(object: ReflectionObject): Type; - - /** - * Removes a nested object from this type. - * @param object Nested object to remove - * @returns `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this type - */ - public remove(object: ReflectionObject): Type; - - /** - * Tests if the specified id is reserved. - * @param id Id to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedId(id: number): boolean; - - /** - * Tests if the specified name is reserved. - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - public isReservedName(name: string): boolean; - - /** - * Creates a new message of this type using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public create(properties?: { [k: string]: any }): Message<{}>; - - /** - * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. - * @returns `this` - */ - public setup(): Type; - - /** - * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. - * @param message Message instance or plain object - * @param [writer] Writer to encode to - * @returns writer - */ - public encode(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. - * @param message Message instance or plain object - * @param [writer] Writer to encode to - * @returns writer - */ - public encodeDelimited(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer; - - /** - * Decodes a message of this type. - * @param reader Reader or buffer to decode from - * @param [length] Length of the message, if known beforehand - * @returns Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError<{}>} If required fields are missing - */ - public decode(reader: (Reader|Uint8Array), length?: number): Message<{}>; - - /** - * Decodes a message of this type preceeded by its byte length as a varint. - * @param reader Reader or buffer to decode from - * @returns Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError} If required fields are missing - */ - public decodeDelimited(reader: (Reader|Uint8Array)): Message<{}>; - - /** - * Verifies that field values are valid and that required fields are present. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public verify(message: { [k: string]: any }): (null|string); - - /** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param object Plain object to convert - * @returns Message instance - */ - public fromObject(object: { [k: string]: any }): Message<{}>; - - /** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param message Message instance - * @param [options] Conversion options - * @returns Plain object - */ - public toObject(message: Message<{}>, options?: IConversionOptions): { [k: string]: any }; - - /** - * Type decorator (TypeScript). - * @param [typeName] Type name, defaults to the constructor's name - * @returns Decorator function - */ - public static d>(typeName?: string): TypeDecorator; -} - -/** Message type descriptor. */ -export interface IType extends INamespace { - - /** Oneof descriptors */ - oneofs?: { [k: string]: IOneOf }; - - /** Field descriptors */ - fields: { [k: string]: IField }; - - /** Extension ranges */ - extensions?: number[][]; - - /** Reserved ranges */ - reserved?: number[][]; - - /** Whether a legacy group or not */ - group?: boolean; -} - -/** Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. */ -export interface IConversionOptions { - - /** - * Long conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. - */ - longs?: Function; - - /** - * Enum value conversion type. - * Only valid value is `String` (the global type). - * Defaults to copy the present value, which is the numeric id. - */ - enums?: Function; - - /** - * Bytes value conversion type. - * Valid values are `Array` and (a base64 encoded) `String` (the global types). - * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. - */ - bytes?: Function; - - /** Also sets default values on the resulting object */ - defaults?: boolean; - - /** Sets empty arrays for missing repeated fields even if `defaults=false` */ - arrays?: boolean; - - /** Sets empty objects for missing map fields even if `defaults=false` */ - objects?: boolean; - - /** Includes virtual oneof properties set to the present field's name, if any */ - oneofs?: boolean; - - /** Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings */ - json?: boolean; -} - -/** - * Decorator function as returned by {@link Type.d} (TypeScript). - * @param target Target constructor - */ -type TypeDecorator> = (target: Constructor) => void; - -/** Common type constants. */ -export namespace types { - - /** Basic type wire types. */ - const basic: { - "double": number, - "float": number, - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": number, - "string": number, - "bytes": number - }; - - /** Basic type defaults. */ - const defaults: { - "double": number, - "float": number, - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": boolean, - "string": string, - "bytes": number[], - "message": null - }; - - /** Basic long type wire types. */ - const long: { - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number - }; - - /** Allowed types for map keys with their associated wire type. */ - const mapKey: { - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": number, - "string": number - }; - - /** Allowed types for packed repeated fields with their associated wire type. */ - const packed: { - "double": number, - "float": number, - "int32": number, - "uint32": number, - "sint32": number, - "fixed32": number, - "sfixed32": number, - "int64": number, - "uint64": number, - "sint64": number, - "fixed64": number, - "sfixed64": number, - "bool": number - }; -} - -/** Constructor type. */ -export interface Constructor extends Function { - new(...params: any[]): T; prototype: T; -} - -/** Properties type. */ -type Properties = { [P in keyof T]?: T[P] }; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - */ -export interface Buffer extends Uint8Array { -} - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - */ -export interface Long { - - /** Low bits */ - low: number; - - /** High bits */ - high: number; - - /** Whether unsigned or not */ - unsigned: boolean; -} - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @returns Set field name, if any - */ -type OneOfGetter = () => (string|undefined); - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @param value Field name - */ -type OneOfSetter = (value: (string|undefined)) => void; - -/** Various utility functions. */ -export namespace util { - - /** Helper class for working with the low and high bits of a 64 bit value. */ - class LongBits { - - /** - * Constructs new long bits. - * @param lo Low 32 bits, unsigned - * @param hi High 32 bits, unsigned - */ - constructor(lo: number, hi: number); - - /** Low bits. */ - public lo: number; - - /** High bits. */ - public hi: number; - - /** Zero bits. */ - public static zero: util.LongBits; - - /** Zero hash. */ - public static zeroHash: string; - - /** - * Constructs new long bits from the specified number. - * @param value Value - * @returns Instance - */ - public static fromNumber(value: number): util.LongBits; - - /** - * Constructs new long bits from a number, long or string. - * @param value Value - * @returns Instance - */ - public static from(value: (Long|number|string)): util.LongBits; - - /** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param [unsigned=false] Whether unsigned or not - * @returns Possibly unsafe number - */ - public toNumber(unsigned?: boolean): number; - - /** - * Converts this long bits to a long. - * @param [unsigned=false] Whether unsigned or not - * @returns Long - */ - public toLong(unsigned?: boolean): Long; - - /** - * Constructs new long bits from the specified 8 characters long hash. - * @param hash Hash - * @returns Bits - */ - public static fromHash(hash: string): util.LongBits; - - /** - * Converts this long bits to a 8 characters long hash. - * @returns Hash - */ - public toHash(): string; - - /** - * Zig-zag encodes this long bits. - * @returns `this` - */ - public zzEncode(): util.LongBits; - - /** - * Zig-zag decodes this long bits. - * @returns `this` - */ - public zzDecode(): util.LongBits; - - /** - * Calculates the length of this longbits when encoded as a varint. - * @returns Length - */ - public length(): number; - } - - /** Whether running within node or not. */ - let isNode: boolean; - - /** Global object reference. */ - let global: object; - - /** An immuable empty array. */ - const emptyArray: any[]; - - /** An immutable empty object. */ - const emptyObject: object; - - /** - * Tests if the specified value is an integer. - * @param value Value to test - * @returns `true` if the value is an integer - */ - function isInteger(value: any): boolean; - - /** - * Tests if the specified value is a string. - * @param value Value to test - * @returns `true` if the value is a string - */ - function isString(value: any): boolean; - - /** - * Tests if the specified value is a non-null object. - * @param value Value to test - * @returns `true` if the value is a non-null object - */ - function isObject(value: any): boolean; - - /** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @param obj Plain object or message instance - * @param prop Property name - * @returns `true` if considered to be present, otherwise `false` - */ - function isset(obj: object, prop: string): boolean; - - /** - * Checks if a property on a message is considered to be present. - * @param obj Plain object or message instance - * @param prop Property name - * @returns `true` if considered to be present, otherwise `false` - */ - function isSet(obj: object, prop: string): boolean; - - /** Node's Buffer class if available. */ - let Buffer: Constructor; - - /** - * Creates a new buffer of whatever type supported by the environment. - * @param [sizeOrArray=0] Buffer size or number array - * @returns Buffer - */ - function newBuffer(sizeOrArray?: (number|number[])): (Uint8Array|Buffer); - - /** Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. */ - let Array: Constructor; - - /** Long.js's Long class if available. */ - let Long: Constructor; - - /** Regular expression used to verify 2 bit (`bool`) map keys. */ - const key2Re: RegExp; - - /** Regular expression used to verify 32 bit (`int32` etc.) map keys. */ - const key32Re: RegExp; - - /** Regular expression used to verify 64 bit (`int64` etc.) map keys. */ - const key64Re: RegExp; - - /** - * Converts a number or long to an 8 characters long hash string. - * @param value Value to convert - * @returns Hash - */ - function longToHash(value: (Long|number)): string; - - /** - * Converts an 8 characters long hash string to a long or number. - * @param hash Hash - * @param [unsigned=false] Whether unsigned or not - * @returns Original value - */ - function longFromHash(hash: string, unsigned?: boolean): (Long|number); - - /** - * Merges the properties of the source object into the destination object. - * @param dst Destination object - * @param src Source object - * @param [ifNotSet=false] Merges only if the key is not already set - * @returns Destination object - */ - function merge(dst: { [k: string]: any }, src: { [k: string]: any }, ifNotSet?: boolean): { [k: string]: any }; - - /** - * Converts the first character of a string to lower case. - * @param str String to convert - * @returns Converted string - */ - function lcFirst(str: string): string; - - /** - * Creates a custom error constructor. - * @param name Error name - * @returns Custom error constructor - */ - function newError(name: string): Constructor; - - /** Error subclass indicating a protocol specifc error. */ - class ProtocolError> extends Error { - - /** - * Constructs a new protocol error. - * @param message Error message - * @param [properties] Additional properties - */ - constructor(message: string, properties?: { [k: string]: any }); - - /** So far decoded message instance. */ - public instance: Message; - } - - /** - * Builds a getter for a oneof's present field name. - * @param fieldNames Field names - * @returns Unbound getter - */ - function oneOfGetter(fieldNames: string[]): OneOfGetter; - - /** - * Builds a setter for a oneof's present field name. - * @param fieldNames Field names - * @returns Unbound setter - */ - function oneOfSetter(fieldNames: string[]): OneOfSetter; - - /** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ - let toJSONOptions: IConversionOptions; - - /** Node's fs module if available. */ - let fs: { [k: string]: any }; - - /** - * Converts an object's values to an array. - * @param object Object to convert - * @returns Converted array - */ - function toArray(object: { [k: string]: any }): any[]; - - /** - * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. - * @param array Array to convert - * @returns Converted object - */ - function toObject(array: any[]): { [k: string]: any }; - - /** - * Tests whether the specified name is a reserved word in JS. - * @param name Name to test - * @returns `true` if reserved, otherwise `false` - */ - function isReserved(name: string): boolean; - - /** - * Returns a safe property accessor for the specified property name. - * @param prop Property name - * @returns Safe accessor - */ - function safeProp(prop: string): string; - - /** - * Converts the first character of a string to upper case. - * @param str String to convert - * @returns Converted string - */ - function ucFirst(str: string): string; - - /** - * Converts a string to camel case. - * @param str String to convert - * @returns Converted string - */ - function camelCase(str: string): string; - - /** - * Compares reflected fields by id. - * @param a First field - * @param b Second field - * @returns Comparison value - */ - function compareFieldsById(a: Field, b: Field): number; - - /** - * Decorator helper for types (TypeScript). - * @param ctor Constructor function - * @param [typeName] Type name, defaults to the constructor's name - * @returns Reflected type - */ - function decorateType>(ctor: Constructor, typeName?: string): Type; - - /** - * Decorator helper for enums (TypeScript). - * @param object Enum object - * @returns Reflected enum - */ - function decorateEnum(object: object): Enum; - - /** - * Sets the value of a property by property path. If a value already exists, it is turned to an array - * @param dst Destination object - * @param path dot '.' delimited path of the property to set - * @param value the value to set - * @returns Destination object - */ - function setProperty(dst: { [k: string]: any }, path: string, value: object): { [k: string]: any }; - - /** Decorator root (TypeScript). */ - let decorateRoot: Root; - - /** - * Returns a promise from a node-style callback function. - * @param fn Function to call - * @param ctx Function context - * @param params Function arguments - * @returns Promisified function - */ - function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise; - - /** A minimal base64 implementation for number arrays. */ - namespace base64 { - - /** - * Calculates the byte length of a base64 encoded string. - * @param string Base64 encoded string - * @returns Byte length - */ - function length(string: string): number; - - /** - * Encodes a buffer to a base64 encoded string. - * @param buffer Source buffer - * @param start Source start - * @param end Source end - * @returns Base64 encoded string - */ - function encode(buffer: Uint8Array, start: number, end: number): string; - - /** - * Decodes a base64 encoded string to a buffer. - * @param string Source string - * @param buffer Destination buffer - * @param offset Destination offset - * @returns Number of bytes written - * @throws {Error} If encoding is invalid - */ - function decode(string: string, buffer: Uint8Array, offset: number): number; - - /** - * Tests if the specified string appears to be base64 encoded. - * @param string String to test - * @returns `true` if probably base64 encoded, otherwise false - */ - function test(string: string): boolean; - } - - /** - * Begins generating a function. - * @param functionParams Function parameter names - * @param [functionName] Function name if not anonymous - * @returns Appender that appends code to the function's body - */ - function codegen(functionParams: string[], functionName?: string): Codegen; - - namespace codegen { - - /** When set to `true`, codegen will log generated code to console. Useful for debugging. */ - let verbose: boolean; - } - - /** - * Begins generating a function. - * @param [functionName] Function name if not anonymous - * @returns Appender that appends code to the function's body - */ - function codegen(functionName?: string): Codegen; - - /** A minimal event emitter. */ - class EventEmitter { - - /** Constructs a new event emitter instance. */ - constructor(); - - /** - * Registers an event listener. - * @param evt Event name - * @param fn Listener - * @param [ctx] Listener context - * @returns `this` - */ - public on(evt: string, fn: EventEmitterListener, ctx?: any): this; - - /** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param [evt] Event name. Removes all listeners if omitted. - * @param [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns `this` - */ - public off(evt?: string, fn?: EventEmitterListener): this; - - /** - * Emits an event by calling its listeners with the specified arguments. - * @param evt Event name - * @param args Arguments - * @returns `this` - */ - public emit(evt: string, ...args: any[]): this; - } - - /** Reads / writes floats / doubles from / to buffers. */ - namespace float { - - /** - * Writes a 32 bit float to a buffer using little endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeFloatLE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Writes a 32 bit float to a buffer using big endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeFloatBE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Reads a 32 bit float from a buffer using little endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readFloatLE(buf: Uint8Array, pos: number): number; - - /** - * Reads a 32 bit float from a buffer using big endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readFloatBE(buf: Uint8Array, pos: number): number; - - /** - * Writes a 64 bit double to a buffer using little endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Writes a 64 bit double to a buffer using big endian byte order. - * @param val Value to write - * @param buf Target buffer - * @param pos Target buffer offset - */ - function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void; - - /** - * Reads a 64 bit double from a buffer using little endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readDoubleLE(buf: Uint8Array, pos: number): number; - - /** - * Reads a 64 bit double from a buffer using big endian byte order. - * @param buf Source buffer - * @param pos Source buffer offset - * @returns Value read - */ - function readDoubleBE(buf: Uint8Array, pos: number): number; - } - - /** - * Fetches the contents of a file. - * @param filename File path or url - * @param options Fetch options - * @param callback Callback function - */ - function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void; - - /** - * Fetches the contents of a file. - * @param path File path or url - * @param callback Callback function - */ - function fetch(path: string, callback: FetchCallback): void; - - /** - * Fetches the contents of a file. - * @param path File path or url - * @param [options] Fetch options - * @returns Promise - */ - function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>; - - /** - * Requires a module only if available. - * @param moduleName Module to require - * @returns Required module if available and not empty, otherwise `null` - */ - function inquire(moduleName: string): object; - - /** A minimal path module to resolve Unix, Windows and URL paths alike. */ - namespace path { - - /** - * Tests if the specified path is absolute. - * @param path Path to test - * @returns `true` if path is absolute - */ - function isAbsolute(path: string): boolean; - - /** - * Normalizes the specified path. - * @param path Path to normalize - * @returns Normalized path - */ - function normalize(path: string): string; - - /** - * Resolves the specified include path against the specified origin path. - * @param originPath Path to the origin file - * @param includePath Include path relative to origin path - * @param [alreadyNormalized=false] `true` if both paths are already known to be normalized - * @returns Path to the include file - */ - function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string; - } - - /** - * A general purpose buffer pool. - * @param alloc Allocator - * @param slice Slicer - * @param [size=8192] Slab size - * @returns Pooled allocator - */ - function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator; - - /** A minimal UTF8 implementation for number arrays. */ - namespace utf8 { - - /** - * Calculates the UTF8 byte length of a string. - * @param string String - * @returns Byte length - */ - function length(string: string): number; - - /** - * Reads UTF8 bytes as a string. - * @param buffer Source buffer - * @param start Source start - * @param end Source end - * @returns String read - */ - function read(buffer: Uint8Array, start: number, end: number): string; - - /** - * Writes a string as UTF8 bytes. - * @param string Source string - * @param buffer Destination buffer - * @param offset Destination offset - * @returns Bytes written - */ - function write(string: string, buffer: Uint8Array, offset: number): number; - } -} - -/** - * Generates a verifier specific to the specified message type. - * @param mtype Message type - * @returns Codegen instance - */ -export function verifier(mtype: Type): Codegen; - -/** Wrappers for common types. */ -export const wrappers: { [k: string]: IWrapper }; - -/** - * From object converter part of an {@link IWrapper}. - * @param object Plain object - * @returns Message instance - */ -type WrapperFromObjectConverter = (this: Type, object: { [k: string]: any }) => Message<{}>; - -/** - * To object converter part of an {@link IWrapper}. - * @param message Message instance - * @param [options] Conversion options - * @returns Plain object - */ -type WrapperToObjectConverter = (this: Type, message: Message<{}>, options?: IConversionOptions) => { [k: string]: any }; - -/** Common type wrapper part of {@link wrappers}. */ -export interface IWrapper { - - /** From object converter */ - fromObject?: WrapperFromObjectConverter; - - /** To object converter */ - toObject?: WrapperToObjectConverter; -} - -/** Wire format writer using `Uint8Array` if available, otherwise `Array`. */ -export class Writer { - - /** Constructs a new writer instance. */ - constructor(); - - /** Current length. */ - public len: number; - - /** Operations head. */ - public head: object; - - /** Operations tail */ - public tail: object; - - /** Linked forked states. */ - public states: (object|null); - - /** - * Creates a new writer. - * @returns A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ - public static create(): (BufferWriter|Writer); - - /** - * Allocates a buffer of the specified size. - * @param size Buffer size - * @returns Buffer - */ - public static alloc(size: number): Uint8Array; - - /** - * Writes an unsigned 32 bit value as a varint. - * @param value Value to write - * @returns `this` - */ - public uint32(value: number): Writer; - - /** - * Writes a signed 32 bit value as a varint. - * @param value Value to write - * @returns `this` - */ - public int32(value: number): Writer; - - /** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param value Value to write - * @returns `this` - */ - public sint32(value: number): Writer; - - /** - * Writes an unsigned 64 bit value as a varint. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public uint64(value: (Long|number|string)): Writer; - - /** - * Writes a signed 64 bit value as a varint. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public int64(value: (Long|number|string)): Writer; - - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public sint64(value: (Long|number|string)): Writer; - - /** - * Writes a boolish value as a varint. - * @param value Value to write - * @returns `this` - */ - public bool(value: boolean): Writer; - - /** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param value Value to write - * @returns `this` - */ - public fixed32(value: number): Writer; - - /** - * Writes a signed 32 bit value as fixed 32 bits. - * @param value Value to write - * @returns `this` - */ - public sfixed32(value: number): Writer; - - /** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public fixed64(value: (Long|number|string)): Writer; - - /** - * Writes a signed 64 bit value as fixed 64 bits. - * @param value Value to write - * @returns `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - public sfixed64(value: (Long|number|string)): Writer; - - /** - * Writes a float (32 bit). - * @param value Value to write - * @returns `this` - */ - public float(value: number): Writer; - - /** - * Writes a double (64 bit float). - * @param value Value to write - * @returns `this` - */ - public double(value: number): Writer; - - /** - * Writes a sequence of bytes. - * @param value Buffer or base64 encoded string to write - * @returns `this` - */ - public bytes(value: (Uint8Array|string)): Writer; - - /** - * Writes a string. - * @param value Value to write - * @returns `this` - */ - public string(value: string): Writer; - - /** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns `this` - */ - public fork(): Writer; - - /** - * Resets this instance to the last state. - * @returns `this` - */ - public reset(): Writer; - - /** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns `this` - */ - public ldelim(): Writer; - - /** - * Finishes the write operation. - * @returns Finished buffer - */ - public finish(): Uint8Array; -} - -/** Wire format writer using node buffers. */ -export class BufferWriter extends Writer { - - /** Constructs a new buffer writer instance. */ - constructor(); - - /** - * Allocates a buffer of the specified size. - * @param size Buffer size - * @returns Buffer - */ - public static alloc(size: number): Buffer; - - /** - * Finishes the write operation. - * @returns Finished buffer - */ - public finish(): Buffer; -} - -/** - * Callback as used by {@link util.asPromise}. - * @param error Error, if any - * @param params Additional arguments - */ -type asPromiseCallback = (error: (Error|null), ...params: any[]) => void; - -/** - * Appends code to the function's body or finishes generation. - * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any - * @param [formatParams] Format parameters - * @returns Itself or the generated function if finished - * @throws {Error} If format parameter counts do not match - */ -type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function); - -/** - * Event listener as used by {@link util.EventEmitter}. - * @param args Arguments - */ -type EventEmitterListener = (...args: any[]) => void; - -/** - * Node-style callback as used by {@link util.fetch}. - * @param error Error, if any, otherwise `null` - * @param [contents] File contents, if there hasn't been an error - */ -type FetchCallback = (error: Error, contents?: string) => void; - -/** Options as used by {@link util.fetch}. */ -export interface IFetchOptions { - - /** Whether expecting a binary response */ - binary?: boolean; - - /** If `true`, forces the use of XMLHttpRequest */ - xhr?: boolean; -} - -/** - * An allocator as used by {@link util.pool}. - * @param size Buffer size - * @returns Buffer - */ -type PoolAllocator = (size: number) => Uint8Array; - -/** - * A slicer as used by {@link util.pool}. - * @param start Start offset - * @param end End offset - * @returns Buffer slice - */ -type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/index.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/index.js deleted file mode 100644 index 042042ae5..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/index.js +++ /dev/null @@ -1,4 +0,0 @@ -// full library entry point. - -"use strict"; -module.exports = require("./src/index"); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/light.d.ts b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/light.d.ts deleted file mode 100644 index d83e7f99c..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/light.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export as namespace protobuf; -export * from "./index"; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/light.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/light.js deleted file mode 100644 index 1209e64c1..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/light.js +++ /dev/null @@ -1,4 +0,0 @@ -// light library entry point. - -"use strict"; -module.exports = require("./src/index-light"); \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/minimal.d.ts b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/minimal.d.ts deleted file mode 100644 index d83e7f99c..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/minimal.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export as namespace protobuf; -export * from "./index"; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/minimal.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/minimal.js deleted file mode 100644 index 1f35ec99d..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/minimal.js +++ /dev/null @@ -1,4 +0,0 @@ -// minimal library entry point. - -"use strict"; -module.exports = require("./src/index-minimal"); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/package.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/package.json deleted file mode 100644 index 471d3f9b2..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/package.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "name": "protobufjs", - "version": "7.2.3", - "versionScheme": "~", - "description": "Protocol Buffers for JavaScript (& TypeScript).", - "author": "Daniel Wirtz ", - "license": "BSD-3-Clause", - "repository": "protobufjs/protobuf.js", - "bugs": "https://github.com/protobufjs/protobuf.js/issues", - "homepage": "https://protobufjs.github.io/protobuf.js/", - "engines": { - "node": ">=12.0.0" - }, - "eslintConfig": { - "env": { - "es6": true - }, - "parserOptions": { - "ecmaVersion": 6 - } - }, - "keywords": [ - "protobuf", - "protocol-buffers", - "serialization", - "typescript" - ], - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "bench": "node bench", - "build": "npm run build:bundle && npm run build:types", - "build:bundle": "gulp --gulpfile scripts/gulpfile.js", - "build:types": "node cli/bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/inquire/index.js lib/path/index.js lib/pool/index.js lib/utf8/index.js", - "changelog": "node scripts/changelog -w", - "coverage": "nyc tape -r ./lib/tape-adapter tests/*.js tests/node/*.js", - "docs": "jsdoc -c config/jsdoc.json -R README.md --verbose --pedantic", - "lint": "npm run lint:sources && npm run lint:types", - "lint:sources": "eslint \"**/*.js\" -c config/eslint.json", - "lint:types": "tslint \"**/*.d.ts\" -e \"**/node_modules/**\" -t stylish -c config/tslint.json", - "pages": "node scripts/pages", - "prepublish": "cd cli && npm install && cd .. && npm run build", - "postinstall": "node scripts/postinstall", - "prof": "node bench/prof", - "test": "npm run test:sources && npm run test:types", - "test:sources": "tape -r ./lib/tape-adapter tests/*.js tests/node/*.js", - "test:types": "tsc tests/comp_typescript.ts --lib es2015 --esModuleInterop --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --esModuleInterop --noEmit --strictNullChecks && tsc tests/data/*.ts --lib es2015 --esModuleInterop --noEmit --strictNullChecks", - "make": "npm run lint:sources && npm run build && npm run lint:types && node ./scripts/gentests.js && npm test" - }, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "devDependencies": { - "benchmark": "^2.1.4", - "browserify": "^17.0.0", - "browserify-wrap": "^1.0.2", - "bundle-collapser": "^1.3.0", - "chalk": "^4.0.0", - "escodegen": "^1.13.0", - "eslint": "^8.15.0", - "espree": "^9.0.0", - "estraverse": "^5.1.0", - "gh-pages": "^4.0.0", - "git-raw-commits": "^2.0.3", - "git-semver-tags": "^4.0.0", - "google-protobuf": "^3.11.3", - "gulp": "^4.0.2", - "gulp-header": "^2.0.9", - "gulp-if": "^3.0.0", - "gulp-sourcemaps": "^3.0.0", - "gulp-uglify": "^3.0.2", - "jaguarjs-jsdoc": "github:dcodeIO/jaguarjs-jsdoc", - "jsdoc": "^4.0.0", - "minimist": "^1.2.0", - "nyc": "^15.0.0", - "reflect-metadata": "^0.1.13", - "tape": "^5.0.0", - "tslint": "^6.0.0", - "typescript": "^3.7.5", - "uglify-js": "^3.7.7", - "vinyl-buffer": "^1.0.1", - "vinyl-fs": "^3.0.3", - "vinyl-source-stream": "^2.0.0" - }, - "files": [ - "index.js", - "index.d.ts", - "light.d.ts", - "light.js", - "minimal.d.ts", - "minimal.js", - "package-lock.json", - "tsconfig.json", - "scripts/postinstall.js", - "dist/**", - "ext/**", - "google/**", - "src/**" - ] -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/scripts/postinstall.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/scripts/postinstall.js deleted file mode 100644 index bf4ff454c..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/scripts/postinstall.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -var path = require("path"), - fs = require("fs"), - pkg = require(path.join(__dirname, "..", "package.json")); - -// check version scheme used by dependents -if (!pkg.versionScheme) - return; - -var warn = process.stderr.isTTY - ? "\x1b[30m\x1b[43mWARN\x1b[0m \x1b[35m" + path.basename(process.argv[1], ".js") + "\x1b[0m" - : "WARN " + path.basename(process.argv[1], ".js"); - -var basePkg; -try { - basePkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "..", "package.json"))); -} catch (e) { - return; -} - -[ - "dependencies", - "devDependencies", - "optionalDependencies", - "peerDependencies" -] -.forEach(function(check) { - var version = basePkg && basePkg[check] && basePkg[check][pkg.name]; - if (typeof version === "string" && version.charAt(0) !== pkg.versionScheme) - process.stderr.write(pkg.name + " " + warn + " " + pkg.name + "@" + version + " is configured as a dependency of " + basePkg.name + ". use " + pkg.name + "@" + pkg.versionScheme + version.substring(1) + " instead for API compatibility.\n"); -}); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/common.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/common.js deleted file mode 100644 index 489ee1c67..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/common.js +++ /dev/null @@ -1,399 +0,0 @@ -"use strict"; -module.exports = common; - -var commonRe = /\/|\./; - -/** - * Provides common type definitions. - * Can also be used to provide additional google types or your own custom types. - * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name - * @param {Object.} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition - * @returns {undefined} - * @property {INamespace} google/protobuf/any.proto Any - * @property {INamespace} google/protobuf/duration.proto Duration - * @property {INamespace} google/protobuf/empty.proto Empty - * @property {INamespace} google/protobuf/field_mask.proto FieldMask - * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue - * @property {INamespace} google/protobuf/timestamp.proto Timestamp - * @property {INamespace} google/protobuf/wrappers.proto Wrappers - * @example - * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension) - * protobuf.common("descriptor", descriptorJson); - * - * // manually provides a custom definition (uses my.foo namespace) - * protobuf.common("my/foo/bar.proto", myFooBarJson); - */ -function common(name, json) { - if (!commonRe.test(name)) { - name = "google/protobuf/" + name + ".proto"; - json = { nested: { google: { nested: { protobuf: { nested: json } } } } }; - } - common[name] = json; -} - -// Not provided because of limited use (feel free to discuss or to provide yourself): -// -// google/protobuf/descriptor.proto -// google/protobuf/source_context.proto -// google/protobuf/type.proto -// -// Stripped and pre-parsed versions of these non-bundled files are instead available as part of -// the repository or package within the google/protobuf directory. - -common("any", { - - /** - * Properties of a google.protobuf.Any message. - * @interface IAny - * @type {Object} - * @property {string} [typeUrl] - * @property {Uint8Array} [bytes] - * @memberof common - */ - Any: { - fields: { - type_url: { - type: "string", - id: 1 - }, - value: { - type: "bytes", - id: 2 - } - } - } -}); - -var timeType; - -common("duration", { - - /** - * Properties of a google.protobuf.Duration message. - * @interface IDuration - * @type {Object} - * @property {number|Long} [seconds] - * @property {number} [nanos] - * @memberof common - */ - Duration: timeType = { - fields: { - seconds: { - type: "int64", - id: 1 - }, - nanos: { - type: "int32", - id: 2 - } - } - } -}); - -common("timestamp", { - - /** - * Properties of a google.protobuf.Timestamp message. - * @interface ITimestamp - * @type {Object} - * @property {number|Long} [seconds] - * @property {number} [nanos] - * @memberof common - */ - Timestamp: timeType -}); - -common("empty", { - - /** - * Properties of a google.protobuf.Empty message. - * @interface IEmpty - * @memberof common - */ - Empty: { - fields: {} - } -}); - -common("struct", { - - /** - * Properties of a google.protobuf.Struct message. - * @interface IStruct - * @type {Object} - * @property {Object.} [fields] - * @memberof common - */ - Struct: { - fields: { - fields: { - keyType: "string", - type: "Value", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Value message. - * @interface IValue - * @type {Object} - * @property {string} [kind] - * @property {0} [nullValue] - * @property {number} [numberValue] - * @property {string} [stringValue] - * @property {boolean} [boolValue] - * @property {IStruct} [structValue] - * @property {IListValue} [listValue] - * @memberof common - */ - Value: { - oneofs: { - kind: { - oneof: [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - fields: { - nullValue: { - type: "NullValue", - id: 1 - }, - numberValue: { - type: "double", - id: 2 - }, - stringValue: { - type: "string", - id: 3 - }, - boolValue: { - type: "bool", - id: 4 - }, - structValue: { - type: "Struct", - id: 5 - }, - listValue: { - type: "ListValue", - id: 6 - } - } - }, - - NullValue: { - values: { - NULL_VALUE: 0 - } - }, - - /** - * Properties of a google.protobuf.ListValue message. - * @interface IListValue - * @type {Object} - * @property {Array.} [values] - * @memberof common - */ - ListValue: { - fields: { - values: { - rule: "repeated", - type: "Value", - id: 1 - } - } - } -}); - -common("wrappers", { - - /** - * Properties of a google.protobuf.DoubleValue message. - * @interface IDoubleValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - DoubleValue: { - fields: { - value: { - type: "double", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.FloatValue message. - * @interface IFloatValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - FloatValue: { - fields: { - value: { - type: "float", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Int64Value message. - * @interface IInt64Value - * @type {Object} - * @property {number|Long} [value] - * @memberof common - */ - Int64Value: { - fields: { - value: { - type: "int64", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.UInt64Value message. - * @interface IUInt64Value - * @type {Object} - * @property {number|Long} [value] - * @memberof common - */ - UInt64Value: { - fields: { - value: { - type: "uint64", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.Int32Value message. - * @interface IInt32Value - * @type {Object} - * @property {number} [value] - * @memberof common - */ - Int32Value: { - fields: { - value: { - type: "int32", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.UInt32Value message. - * @interface IUInt32Value - * @type {Object} - * @property {number} [value] - * @memberof common - */ - UInt32Value: { - fields: { - value: { - type: "uint32", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.BoolValue message. - * @interface IBoolValue - * @type {Object} - * @property {boolean} [value] - * @memberof common - */ - BoolValue: { - fields: { - value: { - type: "bool", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.StringValue message. - * @interface IStringValue - * @type {Object} - * @property {string} [value] - * @memberof common - */ - StringValue: { - fields: { - value: { - type: "string", - id: 1 - } - } - }, - - /** - * Properties of a google.protobuf.BytesValue message. - * @interface IBytesValue - * @type {Object} - * @property {Uint8Array} [value] - * @memberof common - */ - BytesValue: { - fields: { - value: { - type: "bytes", - id: 1 - } - } - } -}); - -common("field_mask", { - - /** - * Properties of a google.protobuf.FieldMask message. - * @interface IDoubleValue - * @type {Object} - * @property {number} [value] - * @memberof common - */ - FieldMask: { - fields: { - paths: { - rule: "repeated", - type: "string", - id: 1 - } - } - } -}); - -/** - * Gets the root definition of the specified common proto file. - * - * Bundled definitions are: - * - google/protobuf/any.proto - * - google/protobuf/duration.proto - * - google/protobuf/empty.proto - * - google/protobuf/field_mask.proto - * - google/protobuf/struct.proto - * - google/protobuf/timestamp.proto - * - google/protobuf/wrappers.proto - * - * @param {string} file Proto file name - * @returns {INamespace|null} Root definition or `null` if not defined - */ -common.get = function get(file) { - return common[file] || null; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/converter.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/converter.js deleted file mode 100644 index c9e68b5be..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/converter.js +++ /dev/null @@ -1,301 +0,0 @@ -"use strict"; -/** - * Runtime message from/to plain object converters. - * @namespace - */ -var converter = exports; - -var Enum = require("./enum"), - util = require("./util"); - -/** - * Generates a partial value fromObject conveter. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} prop Property reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genValuePartial_fromObject(gen, field, fieldIndex, prop) { - var defaultAlreadyEmitted = false; - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(d%s){", prop); - for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) { - // enum unknown values passthrough - if (values[keys[i]] === field.typeDefault && !defaultAlreadyEmitted) { gen - ("default:") - ("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop); - if (!field.repeated) gen // fallback to default value only for - // arrays, to avoid leaving holes. - ("break"); // for non-repeated fields, just ignore - defaultAlreadyEmitted = true; - } - gen - ("case%j:", keys[i]) - ("case %i:", values[keys[i]]) - ("m%s=%j", prop, values[keys[i]]) - ("break"); - } gen - ("}"); - } else gen - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop); - } else { - var isUnsigned = false; - switch (field.type) { - case "double": - case "float": gen - ("m%s=Number(d%s)", prop, prop); // also catches "NaN", "Infinity" - break; - case "uint32": - case "fixed32": gen - ("m%s=d%s>>>0", prop, prop); - break; - case "int32": - case "sint32": - case "sfixed32": gen - ("m%s=d%s|0", prop, prop); - break; - case "uint64": - isUnsigned = true; - // eslint-disable-line no-fallthrough - case "int64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(util.Long)") - ("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned) - ("else if(typeof d%s===\"string\")", prop) - ("m%s=parseInt(d%s,10)", prop, prop) - ("else if(typeof d%s===\"number\")", prop) - ("m%s=d%s", prop, prop) - ("else if(typeof d%s===\"object\")", prop) - ("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); - break; - case "bytes": gen - ("if(typeof d%s===\"string\")", prop) - ("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop) - ("else if(d%s.length >= 0)", prop) - ("m%s=d%s", prop, prop); - break; - case "string": gen - ("m%s=String(d%s)", prop, prop); - break; - case "bool": gen - ("m%s=Boolean(d%s)", prop, prop); - break; - /* default: gen - ("m%s=d%s", prop, prop); - break; */ - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a plain object to runtime message converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.fromObject = function fromObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray; - var gen = util.codegen(["d"], mtype.name + "$fromObject") - ("if(d instanceof this.ctor)") - ("return d"); - if (!fields.length) return gen - ("return new this.ctor"); - gen - ("var m=new this.ctor"); - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - prop = util.safeProp(field.name); - - // Map fields - if (field.map) { gen - ("if(d%s){", prop) - ("if(typeof d%s!==\"object\")", prop) - ("throw TypeError(%j)", field.fullName + ": object expected") - ("m%s={}", prop) - ("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true": "", prop); - break; - case "bytes": gen - ("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); - break; - default: gen - ("d%s=m%s", prop, prop); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} - -/** - * Generates a runtime message to plain object converter specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -converter.toObject = function toObject(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById); - if (!fields.length) - return util.codegen()("return {}"); - var gen = util.codegen(["m", "o"], mtype.name + "$toObject") - ("if(!o)") - ("o={}") - ("var d={}"); - - var repeatedFields = [], - mapFields = [], - normalFields = [], - i = 0; - for (; i < fields.length; ++i) - if (!fields[i].partOf) - ( fields[i].resolve().repeated ? repeatedFields - : fields[i].map ? mapFields - : normalFields).push(fields[i]); - - if (repeatedFields.length) { gen - ("if(o.arrays||o.defaults){"); - for (i = 0; i < repeatedFields.length; ++i) gen - ("d%s=[]", util.safeProp(repeatedFields[i].name)); - gen - ("}"); - } - - if (mapFields.length) { gen - ("if(o.objects||o.defaults){"); - for (i = 0; i < mapFields.length; ++i) gen - ("d%s={}", util.safeProp(mapFields[i].name)); - gen - ("}"); - } - - if (normalFields.length) { gen - ("if(o.defaults){"); - for (i = 0; i < normalFields.length; ++i) { - var field = normalFields[i], - prop = util.safeProp(field.name); - if (field.resolvedType instanceof Enum) gen - ("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); - else if (field.long) gen - ("if(util.Long){") - ("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned) - ("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop) - ("}else") - ("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); - else if (field.bytes) { - var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; - gen - ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault)) - ("else{") - ("d%s=%s", prop, arrayDefault) - ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop) - ("}"); - } else gen - ("d%s=%j", prop, field.typeDefault); // also messages (=null) - } gen - ("}"); - } - var hasKs2 = false; - for (i = 0; i < fields.length; ++i) { - var field = fields[i], - index = mtype._fieldsArray.indexOf(field), - prop = util.safeProp(field.name); - if (field.map) { - if (!hasKs2) { hasKs2 = true; gen - ("var ks2"); - } gen - ("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop) - ("d%s={}", prop) - ("for(var j=0;j>>3){"); - - var i = 0; - for (; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - ref = "m" + util.safeProp(field.name); gen - ("case %i: {", field.id); - - // Map fields - if (field.map) { gen - ("if(%s===util.emptyObject)", ref) - ("%s={}", ref) - ("var c2 = r.uint32()+r.pos"); - - if (types.defaults[field.keyType] !== undefined) gen - ("k=%j", types.defaults[field.keyType]); - else gen - ("k=null"); - - if (types.defaults[type] !== undefined) gen - ("value=%j", types.defaults[type]); - else gen - ("value=null"); - - gen - ("while(r.pos>>3){") - ("case 1: k=r.%s(); break", field.keyType) - ("case 2:"); - - if (types.basic[type] === undefined) gen - ("value=types[%i].decode(r,r.uint32())", i); // can't be groups - else gen - ("value=r.%s()", type); - - gen - ("break") - ("default:") - ("r.skipType(tag2&7)") - ("break") - ("}") - ("}"); - - if (types.long[field.keyType] !== undefined) gen - ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref); - else gen - ("%s[k]=value", ref); - - // Repeated fields - } else if (field.repeated) { gen - - ("if(!(%s&&%s.length))", ref, ref) - ("%s=[]", ref); - - // Packable (always check for forward and backward compatiblity) - if (types.packed[type] !== undefined) gen - ("if((t&7)===2){") - ("var c2=r.uint32()+r.pos") - ("while(r.pos>> 0, (field.id << 3 | 4) >>> 0) - : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); -} - -/** - * Generates an encoder specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function encoder(mtype) { - /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */ - var gen = util.codegen(["m", "w"], mtype.name + "$encode") - ("if(!w)") - ("w=Writer.create()"); - - var i, ref; - - // "when a message is serialized its known fields should be written sequentially by field number" - var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById); - - for (var i = 0; i < fields.length; ++i) { - var field = fields[i].resolve(), - index = mtype._fieldsArray.indexOf(field), - type = field.resolvedType instanceof Enum ? "int32" : field.type, - wireType = types.basic[type]; - ref = "m" + util.safeProp(field.name); - - // Map fields - if (field.map) { - gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name) // !== undefined && !== null - ("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types.mapKey[field.keyType], field.keyType); - if (wireType === undefined) gen - ("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index, ref); // can't be groups - else gen - (".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type, ref); - gen - ("}") - ("}"); - - // Repeated fields - } else if (field.repeated) { gen - ("if(%s!=null&&%s.length){", ref, ref); // !== undefined && !== null - - // Packed repeated - if (field.packed && types.packed[type] !== undefined) { gen - - ("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0) - ("for(var i=0;i<%s.length;++i)", ref) - ("w.%s(%s[i])", type, ref) - ("w.ldelim()"); - - // Non-packed - } else { gen - - ("for(var i=0;i<%s.length;++i)", ref); - if (wireType === undefined) - genTypePartial(gen, field, index, ref + "[i]"); - else gen - ("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type, ref); - - } gen - ("}"); - - // Non-repeated - } else { - if (field.optional) gen - ("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); // !== undefined && !== null - - if (wireType === undefined) - genTypePartial(gen, field, index, ref); - else gen - ("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type, ref); - - } - } - - return gen - ("return w"); - /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */ -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/enum.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/enum.js deleted file mode 100644 index 1c016209f..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/enum.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; -module.exports = Enum; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum"; - -var Namespace = require("./namespace"), - util = require("./util"); - -/** - * Constructs a new enum instance. - * @classdesc Reflected enum. - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {Object.} [values] Enum values as an object, by name - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this enum - * @param {Object.} [comments] The value comments for this enum - * @param {Object.>|undefined} [valuesOptions] The value options for this enum - */ -function Enum(name, values, options, comment, comments, valuesOptions) { - ReflectionObject.call(this, name, options); - - if (values && typeof values !== "object") - throw TypeError("values must be an object"); - - /** - * Enum values by id. - * @type {Object.} - */ - this.valuesById = {}; - - /** - * Enum values by name. - * @type {Object.} - */ - this.values = Object.create(this.valuesById); // toJSON, marker - - /** - * Enum comment text. - * @type {string|null} - */ - this.comment = comment; - - /** - * Value comment texts, if any. - * @type {Object.} - */ - this.comments = comments || {}; - - /** - * Values options, if any - * @type {Object>|undefined} - */ - this.valuesOptions = valuesOptions; - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - // Note that values inherit valuesById on their prototype which makes them a TypeScript- - // compatible enum. This is used by pbts to write actual enum definitions that work for - // static and reflection code alike instead of emitting generic object definitions. - - if (values) - for (var keys = Object.keys(values), i = 0; i < keys.length; ++i) - if (typeof values[keys[i]] === "number") // use forward entries only - this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i]; -} - -/** - * Enum descriptor. - * @interface IEnum - * @property {Object.} values Enum values - * @property {Object.} [options] Enum options - */ - -/** - * Constructs an enum from an enum descriptor. - * @param {string} name Enum name - * @param {IEnum} json Enum descriptor - * @returns {Enum} Created enum - * @throws {TypeError} If arguments are invalid - */ -Enum.fromJSON = function fromJSON(name, json) { - var enm = new Enum(name, json.values, json.options, json.comment, json.comments); - enm.reserved = json.reserved; - return enm; -}; - -/** - * Converts this enum to an enum descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IEnum} Enum descriptor - */ -Enum.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "valuesOptions" , this.valuesOptions, - "values" , this.values, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "comment" , keepComments ? this.comment : undefined, - "comments" , keepComments ? this.comments : undefined - ]); -}; - -/** - * Adds a value to this enum. - * @param {string} name Value name - * @param {number} id Value id - * @param {string} [comment] Comment, if any - * @param {Object.|undefined} [options] Options, if any - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a value with this name or id - */ -Enum.prototype.add = function add(name, id, comment, options) { - // utilized by the parser but not by .fromJSON - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (!util.isInteger(id)) - throw TypeError("id must be an integer"); - - if (this.values[name] !== undefined) - throw Error("duplicate name '" + name + "' in " + this); - - if (this.isReservedId(id)) - throw Error("id " + id + " is reserved in " + this); - - if (this.isReservedName(name)) - throw Error("name '" + name + "' is reserved in " + this); - - if (this.valuesById[id] !== undefined) { - if (!(this.options && this.options.allow_alias)) - throw Error("duplicate id " + id + " in " + this); - this.values[name] = id; - } else - this.valuesById[this.values[name] = id] = name; - - if (options) { - if (this.valuesOptions === undefined) - this.valuesOptions = {}; - this.valuesOptions[name] = options || null; - } - - this.comments[name] = comment || null; - return this; -}; - -/** - * Removes a value from this enum - * @param {string} name Value name - * @returns {Enum} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `name` is not a name of this enum - */ -Enum.prototype.remove = function remove(name) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - var val = this.values[name]; - if (val == null) - throw Error("name '" + name + "' does not exist in " + this); - - delete this.valuesById[val]; - delete this.values[name]; - delete this.comments[name]; - if (this.valuesOptions) - delete this.valuesOptions[name]; - - return this; -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Enum.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/field.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/field.js deleted file mode 100644 index e0feb8b43..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/field.js +++ /dev/null @@ -1,377 +0,0 @@ -"use strict"; -module.exports = Field; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; - -var Enum = require("./enum"), - types = require("./types"), - util = require("./util"); - -var Type; // cyclic - -var ruleRe = /^required|optional|repeated$/; - -/** - * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class. - * @name Field - * @classdesc Reflected message field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a field from a field descriptor. - * @param {string} name Field name - * @param {IField} json Field descriptor - * @returns {Field} Created field - * @throws {TypeError} If arguments are invalid - */ -Field.fromJSON = function fromJSON(name, json) { - return new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment); -}; - -/** - * Not an actual constructor. Use {@link Field} instead. - * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. - * @exports FieldBase - * @extends ReflectionObject - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} type Value type - * @param {string|Object.} [rule="optional"] Field rule - * @param {string|Object.} [extend] Extended type if different from parent - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function Field(name, id, type, rule, extend, options, comment) { - - if (util.isObject(rule)) { - comment = extend; - options = rule; - rule = extend = undefined; - } else if (util.isObject(extend)) { - comment = options; - options = extend; - extend = undefined; - } - - ReflectionObject.call(this, name, options); - - if (!util.isInteger(id) || id < 0) - throw TypeError("id must be a non-negative integer"); - - if (!util.isString(type)) - throw TypeError("type must be a string"); - - if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase())) - throw TypeError("rule must be a string rule"); - - if (extend !== undefined && !util.isString(extend)) - throw TypeError("extend must be a string"); - - /** - * Field rule, if any. - * @type {string|undefined} - */ - if (rule === "proto3_optional") { - rule = "optional"; - } - this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON - - /** - * Field type. - * @type {string} - */ - this.type = type; // toJSON - - /** - * Unique field id. - * @type {number} - */ - this.id = id; // toJSON, marker - - /** - * Extended type if different from parent. - * @type {string|undefined} - */ - this.extend = extend || undefined; // toJSON - - /** - * Whether this field is required. - * @type {boolean} - */ - this.required = rule === "required"; - - /** - * Whether this field is optional. - * @type {boolean} - */ - this.optional = !this.required; - - /** - * Whether this field is repeated. - * @type {boolean} - */ - this.repeated = rule === "repeated"; - - /** - * Whether this field is a map or not. - * @type {boolean} - */ - this.map = false; - - /** - * Message this field belongs to. - * @type {Type|null} - */ - this.message = null; - - /** - * OneOf this field belongs to, if any, - * @type {OneOf|null} - */ - this.partOf = null; - - /** - * The field type's default value. - * @type {*} - */ - this.typeDefault = null; - - /** - * The field's default value on prototypes. - * @type {*} - */ - this.defaultValue = null; - - /** - * Whether this field's value should be treated as a long. - * @type {boolean} - */ - this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false; - - /** - * Whether this field's value is a buffer. - * @type {boolean} - */ - this.bytes = type === "bytes"; - - /** - * Resolved type if not a basic type. - * @type {Type|Enum|null} - */ - this.resolvedType = null; - - /** - * Sister-field within the extended type if a declaring extension field. - * @type {Field|null} - */ - this.extensionField = null; - - /** - * Sister-field within the declaring namespace if an extended field. - * @type {Field|null} - */ - this.declaringField = null; - - /** - * Internally remembers whether this field is packed. - * @type {boolean|null} - * @private - */ - this._packed = null; - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Determines whether this field is packed. Only relevant when repeated and working with proto2. - * @name Field#packed - * @type {boolean} - * @readonly - */ -Object.defineProperty(Field.prototype, "packed", { - get: function() { - // defaults to packed=true if not explicity set to false - if (this._packed === null) - this._packed = this.getOption("packed") !== false; - return this._packed; - } -}); - -/** - * @override - */ -Field.prototype.setOption = function setOption(name, value, ifNotSet) { - if (name === "packed") // clear cached before setting - this._packed = null; - return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet); -}; - -/** - * Field descriptor. - * @interface IField - * @property {string} [rule="optional"] Field rule - * @property {string} type Field type - * @property {number} id Field id - * @property {Object.} [options] Field options - */ - -/** - * Extension field descriptor. - * @interface IExtensionField - * @extends IField - * @property {string} extend Extended type - */ - -/** - * Converts this field to a field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IField} Field descriptor - */ -Field.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "rule" , this.rule !== "optional" && this.rule || undefined, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Resolves this field's type references. - * @returns {Field} `this` - * @throws {Error} If any reference cannot be resolved - */ -Field.prototype.resolve = function resolve() { - - if (this.resolved) - return this; - - if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it - this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); - if (this.resolvedType instanceof Type) - this.typeDefault = null; - else // instanceof Enum - this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined - } else if (this.options && this.options.proto3_optional) { - // proto3 scalar value marked optional; should default to null - this.typeDefault = null; - } - - // use explicitly set default value if present - if (this.options && this.options["default"] != null) { - this.typeDefault = this.options["default"]; - if (this.resolvedType instanceof Enum && typeof this.typeDefault === "string") - this.typeDefault = this.resolvedType.values[this.typeDefault]; - } - - // remove unnecessary options - if (this.options) { - if (this.options.packed === true || this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum)) - delete this.options.packed; - if (!Object.keys(this.options).length) - this.options = undefined; - } - - // convert to internal data type if necesssary - if (this.long) { - this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); - - /* istanbul ignore else */ - if (Object.freeze) - Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it) - - } else if (this.bytes && typeof this.typeDefault === "string") { - var buf; - if (util.base64.test(this.typeDefault)) - util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0); - else - util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0); - this.typeDefault = buf; - } - - // take special care of maps and repeated fields - if (this.map) - this.defaultValue = util.emptyObject; - else if (this.repeated) - this.defaultValue = util.emptyArray; - else - this.defaultValue = this.typeDefault; - - // ensure proper value on prototype - if (this.parent instanceof Type) - this.parent.ctor.prototype[this.name] = this.defaultValue; - - return ReflectionObject.prototype.resolve.call(this); -}; - -/** - * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript). - * @typedef FieldDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} fieldName Field name - * @returns {undefined} - */ - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"string"|"bool"|"bytes"|Object} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @param {T} [defaultValue] Default value - * @returns {FieldDecorator} Decorator function - * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[] - */ -Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { - - // submessage: decorate the submessage and use its name as the type - if (typeof fieldType === "function") - fieldType = util.decorateType(fieldType).name; - - // enum reference: create a reflected copy of the enum and keep reuseing it - else if (fieldType && typeof fieldType === "object") - fieldType = util.decorateEnum(fieldType).name; - - return function fieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); - }; -}; - -/** - * Field decorator (TypeScript). - * @name Field.d - * @function - * @param {number} fieldId Field id - * @param {Constructor|string} fieldType Field type - * @param {"optional"|"required"|"repeated"} [fieldRule="optional"] Field rule - * @returns {FieldDecorator} Decorator function - * @template T extends Message - * @variation 2 - */ -// like Field.d but without a default value - -// Sets up cyclic dependencies (called in index-light) -Field._configure = function configure(Type_) { - Type = Type_; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index-light.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index-light.js deleted file mode 100644 index 32c6a05cd..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index-light.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -var protobuf = module.exports = require("./index-minimal"); - -protobuf.build = "light"; - -/** - * A node-style callback as used by {@link load} and {@link Root#load}. - * @typedef LoadCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Root} [root] Root, if there hasn't been an error - * @returns {undefined} - */ - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @param {string|string[]} filename One or multiple files to load - * @param {Root} root Root namespace, defaults to create a new one if omitted. - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - */ -function load(filename, root, callback) { - if (typeof root === "function") { - callback = root; - root = new protobuf.Root(); - } else if (!root) - root = new protobuf.Root(); - return root.load(filename, callback); -} - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @see {@link Root#load} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise. - * @name load - * @function - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Promise} Promise - * @see {@link Root#load} - * @variation 3 - */ -// function load(filename:string, [root:Root]):Promise - -protobuf.load = load; - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only). - * @param {string|string[]} filename One or multiple files to load - * @param {Root} [root] Root namespace, defaults to create a new one if omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - * @see {@link Root#loadSync} - */ -function loadSync(filename, root) { - if (!root) - root = new protobuf.Root(); - return root.loadSync(filename); -} - -protobuf.loadSync = loadSync; - -// Serialization -protobuf.encoder = require("./encoder"); -protobuf.decoder = require("./decoder"); -protobuf.verifier = require("./verifier"); -protobuf.converter = require("./converter"); - -// Reflection -protobuf.ReflectionObject = require("./object"); -protobuf.Namespace = require("./namespace"); -protobuf.Root = require("./root"); -protobuf.Enum = require("./enum"); -protobuf.Type = require("./type"); -protobuf.Field = require("./field"); -protobuf.OneOf = require("./oneof"); -protobuf.MapField = require("./mapfield"); -protobuf.Service = require("./service"); -protobuf.Method = require("./method"); - -// Runtime -protobuf.Message = require("./message"); -protobuf.wrappers = require("./wrappers"); - -// Utility -protobuf.types = require("./types"); -protobuf.util = require("./util"); - -// Set up possibly cyclic reflection dependencies -protobuf.ReflectionObject._configure(protobuf.Root); -protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum); -protobuf.Root._configure(protobuf.Type); -protobuf.Field._configure(protobuf.Type); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index-minimal.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index-minimal.js deleted file mode 100644 index 1f4aaea6a..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index-minimal.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var protobuf = exports; - -/** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ -protobuf.build = "minimal"; - -// Serialization -protobuf.Writer = require("./writer"); -protobuf.BufferWriter = require("./writer_buffer"); -protobuf.Reader = require("./reader"); -protobuf.BufferReader = require("./reader_buffer"); - -// Utility -protobuf.util = require("./util/minimal"); -protobuf.rpc = require("./rpc"); -protobuf.roots = require("./roots"); -protobuf.configure = configure; - -/* istanbul ignore next */ -/** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ -function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); -} - -// Set up buffer utility according to the environment -configure(); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index.js deleted file mode 100644 index 56bd3d5d7..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -var protobuf = module.exports = require("./index-light"); - -protobuf.build = "full"; - -// Parser -protobuf.tokenize = require("./tokenize"); -protobuf.parse = require("./parse"); -protobuf.common = require("./common"); - -// Configure parser -protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/mapfield.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/mapfield.js deleted file mode 100644 index 67c70978f..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/mapfield.js +++ /dev/null @@ -1,126 +0,0 @@ -"use strict"; -module.exports = MapField; - -// extends Field -var Field = require("./field"); -((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; - -var types = require("./types"), - util = require("./util"); - -/** - * Constructs a new map field instance. - * @classdesc Reflected map field. - * @extends FieldBase - * @constructor - * @param {string} name Unique name within its namespace - * @param {number} id Unique id within its namespace - * @param {string} keyType Key type - * @param {string} type Value type - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function MapField(name, id, keyType, type, options, comment) { - Field.call(this, name, id, type, undefined, undefined, options, comment); - - /* istanbul ignore if */ - if (!util.isString(keyType)) - throw TypeError("keyType must be a string"); - - /** - * Key type. - * @type {string} - */ - this.keyType = keyType; // toJSON, marker - - /** - * Resolved key type if not a basic type. - * @type {ReflectionObject|null} - */ - this.resolvedKeyType = null; - - // Overrides Field#map - this.map = true; -} - -/** - * Map field descriptor. - * @interface IMapField - * @extends {IField} - * @property {string} keyType Key type - */ - -/** - * Extension map field descriptor. - * @interface IExtensionMapField - * @extends IMapField - * @property {string} extend Extended type - */ - -/** - * Constructs a map field from a map field descriptor. - * @param {string} name Field name - * @param {IMapField} json Map field descriptor - * @returns {MapField} Created map field - * @throws {TypeError} If arguments are invalid - */ -MapField.fromJSON = function fromJSON(name, json) { - return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment); -}; - -/** - * Converts this map field to a map field descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMapField} Map field descriptor - */ -MapField.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "keyType" , this.keyType, - "type" , this.type, - "id" , this.id, - "extend" , this.extend, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -MapField.prototype.resolve = function resolve() { - if (this.resolved) - return this; - - // Besides a value type, map fields have a key type that may be "any scalar type except for floating point types and bytes" - if (types.mapKey[this.keyType] === undefined) - throw Error("invalid key type: " + this.keyType); - - return Field.prototype.resolve.call(this); -}; - -/** - * Map field decorator (TypeScript). - * @name MapField.d - * @function - * @param {number} fieldId Field id - * @param {"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"} fieldKeyType Field key type - * @param {"double"|"float"|"int32"|"uint32"|"sint32"|"fixed32"|"sfixed32"|"int64"|"uint64"|"sint64"|"fixed64"|"sfixed64"|"bool"|"string"|"bytes"|Object|Constructor<{}>} fieldValueType Field value type - * @returns {FieldDecorator} Decorator function - * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> } - */ -MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { - - // submessage value: decorate the submessage and use its name as the type - if (typeof fieldValueType === "function") - fieldValueType = util.decorateType(fieldValueType).name; - - // enum reference value: create a reflected copy of the enum and keep reuseing it - else if (fieldValueType && typeof fieldValueType === "object") - fieldValueType = util.decorateEnum(fieldValueType).name; - - return function mapFieldDecorator(prototype, fieldName) { - util.decorateType(prototype.constructor) - .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); - }; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/message.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/message.js deleted file mode 100644 index 3f94bf6a8..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/message.js +++ /dev/null @@ -1,139 +0,0 @@ -"use strict"; -module.exports = Message; - -var util = require("./util/minimal"); - -/** - * Constructs a new message instance. - * @classdesc Abstract runtime message. - * @constructor - * @param {Properties} [properties] Properties to set - * @template T extends object = object - */ -function Message(properties) { - // not used internally - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - this[keys[i]] = properties[keys[i]]; -} - -/** - * Reference to the reflected type. - * @name Message.$type - * @type {Type} - * @readonly - */ - -/** - * Reference to the reflected type. - * @name Message#$type - * @type {Type} - * @readonly - */ - -/*eslint-disable valid-jsdoc*/ - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message} Message instance - * @template T extends Message - * @this Constructor - */ -Message.create = function create(properties) { - return this.$type.create(properties); -}; - -/** - * Encodes a message of this type. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encode = function encode(message, writer) { - return this.$type.encode(message, writer); -}; - -/** - * Encodes a message of this type preceeded by its length as a varint. - * @param {T|Object.} message Message to encode - * @param {Writer} [writer] Writer to use - * @returns {Writer} Writer - * @template T extends Message - * @this Constructor - */ -Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.$type.encodeDelimited(message, writer); -}; - -/** - * Decodes a message of this type. - * @name Message.decode - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decode = function decode(reader) { - return this.$type.decode(reader); -}; - -/** - * Decodes a message of this type preceeded by its length as a varint. - * @name Message.decodeDelimited - * @function - * @param {Reader|Uint8Array} reader Reader or buffer to decode - * @returns {T} Decoded message - * @template T extends Message - * @this Constructor - */ -Message.decodeDelimited = function decodeDelimited(reader) { - return this.$type.decodeDelimited(reader); -}; - -/** - * Verifies a message of this type. - * @name Message.verify - * @function - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ -Message.verify = function verify(message) { - return this.$type.verify(message); -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object - * @returns {T} Message instance - * @template T extends Message - * @this Constructor - */ -Message.fromObject = function fromObject(object) { - return this.$type.fromObject(object); -}; - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {T} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @template T extends Message - * @this Constructor - */ -Message.toObject = function toObject(message, options) { - return this.$type.toObject(message, options); -}; - -/** - * Converts this message to JSON. - * @returns {Object.} JSON object - */ -Message.prototype.toJSON = function toJSON() { - return this.$type.toObject(this, util.toJSONOptions); -}; - -/*eslint-enable valid-jsdoc*/ \ No newline at end of file diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/method.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/method.js deleted file mode 100644 index 18a6ab2cf..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/method.js +++ /dev/null @@ -1,160 +0,0 @@ -"use strict"; -module.exports = Method; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; - -var util = require("./util"); - -/** - * Constructs a new service method instance. - * @classdesc Reflected service method. - * @extends ReflectionObject - * @constructor - * @param {string} name Method name - * @param {string|undefined} type Method type, usually `"rpc"` - * @param {string} requestType Request message type - * @param {string} responseType Response message type - * @param {boolean|Object.} [requestStream] Whether the request is streamed - * @param {boolean|Object.} [responseStream] Whether the response is streamed - * @param {Object.} [options] Declared options - * @param {string} [comment] The comment for this method - * @param {Object.} [parsedOptions] Declared options, properly parsed into an object - */ -function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) { - - /* istanbul ignore next */ - if (util.isObject(requestStream)) { - options = requestStream; - requestStream = responseStream = undefined; - } else if (util.isObject(responseStream)) { - options = responseStream; - responseStream = undefined; - } - - /* istanbul ignore if */ - if (!(type === undefined || util.isString(type))) - throw TypeError("type must be a string"); - - /* istanbul ignore if */ - if (!util.isString(requestType)) - throw TypeError("requestType must be a string"); - - /* istanbul ignore if */ - if (!util.isString(responseType)) - throw TypeError("responseType must be a string"); - - ReflectionObject.call(this, name, options); - - /** - * Method type. - * @type {string} - */ - this.type = type || "rpc"; // toJSON - - /** - * Request type. - * @type {string} - */ - this.requestType = requestType; // toJSON, marker - - /** - * Whether requests are streamed or not. - * @type {boolean|undefined} - */ - this.requestStream = requestStream ? true : undefined; // toJSON - - /** - * Response type. - * @type {string} - */ - this.responseType = responseType; // toJSON - - /** - * Whether responses are streamed or not. - * @type {boolean|undefined} - */ - this.responseStream = responseStream ? true : undefined; // toJSON - - /** - * Resolved request type. - * @type {Type|null} - */ - this.resolvedRequestType = null; - - /** - * Resolved response type. - * @type {Type|null} - */ - this.resolvedResponseType = null; - - /** - * Comment for this method - * @type {string|null} - */ - this.comment = comment; - - /** - * Options properly parsed into an object - */ - this.parsedOptions = parsedOptions; -} - -/** - * Method descriptor. - * @interface IMethod - * @property {string} [type="rpc"] Method type - * @property {string} requestType Request type - * @property {string} responseType Response type - * @property {boolean} [requestStream=false] Whether requests are streamed - * @property {boolean} [responseStream=false] Whether responses are streamed - * @property {Object.} [options] Method options - * @property {string} comment Method comments - * @property {Object.} [parsedOptions] Method options properly parsed into an object - */ - -/** - * Constructs a method from a method descriptor. - * @param {string} name Method name - * @param {IMethod} json Method descriptor - * @returns {Method} Created method - * @throws {TypeError} If arguments are invalid - */ -Method.fromJSON = function fromJSON(name, json) { - return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions); -}; - -/** - * Converts this method to a method descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IMethod} Method descriptor - */ -Method.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "type" , this.type !== "rpc" && /* istanbul ignore next */ this.type || undefined, - "requestType" , this.requestType, - "requestStream" , this.requestStream, - "responseType" , this.responseType, - "responseStream" , this.responseStream, - "options" , this.options, - "comment" , keepComments ? this.comment : undefined, - "parsedOptions" , this.parsedOptions, - ]); -}; - -/** - * @override - */ -Method.prototype.resolve = function resolve() { - - /* istanbul ignore if */ - if (this.resolved) - return this; - - this.resolvedRequestType = this.parent.lookupType(this.requestType); - this.resolvedResponseType = this.parent.lookupType(this.responseType); - - return ReflectionObject.prototype.resolve.call(this); -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/namespace.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/namespace.js deleted file mode 100644 index 731afc75f..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/namespace.js +++ /dev/null @@ -1,433 +0,0 @@ -"use strict"; -module.exports = Namespace; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; - -var Field = require("./field"), - util = require("./util"), - OneOf = require("./oneof"); - -var Type, // cyclic - Service, - Enum; - -/** - * Constructs a new namespace instance. - * @name Namespace - * @classdesc Reflected namespace. - * @extends NamespaceBase - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - */ - -/** - * Constructs a namespace from JSON. - * @memberof Namespace - * @function - * @param {string} name Namespace name - * @param {Object.} json JSON object - * @returns {Namespace} Created namespace - * @throws {TypeError} If arguments are invalid - */ -Namespace.fromJSON = function fromJSON(name, json) { - return new Namespace(name, json.options).addJSON(json.nested); -}; - -/** - * Converts an array of reflection objects to JSON. - * @memberof Namespace - * @param {ReflectionObject[]} array Object array - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {Object.|undefined} JSON object or `undefined` when array is empty - */ -function arrayToJSON(array, toJSONOptions) { - if (!(array && array.length)) - return undefined; - var obj = {}; - for (var i = 0; i < array.length; ++i) - obj[array[i].name] = array[i].toJSON(toJSONOptions); - return obj; -} - -Namespace.arrayToJSON = arrayToJSON; - -/** - * Tests if the specified id is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedId = function isReservedId(reserved, id) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (typeof reserved[i] !== "string" && reserved[i][0] <= id && reserved[i][1] > id) - return true; - return false; -}; - -/** - * Tests if the specified name is reserved. - * @param {Array.|undefined} reserved Array of reserved ranges and names - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Namespace.isReservedName = function isReservedName(reserved, name) { - if (reserved) - for (var i = 0; i < reserved.length; ++i) - if (reserved[i] === name) - return true; - return false; -}; - -/** - * Not an actual constructor. Use {@link Namespace} instead. - * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. - * @exports NamespaceBase - * @extends ReflectionObject - * @abstract - * @constructor - * @param {string} name Namespace name - * @param {Object.} [options] Declared options - * @see {@link Namespace} - */ -function Namespace(name, options) { - ReflectionObject.call(this, name, options); - - /** - * Nested objects by name. - * @type {Object.|undefined} - */ - this.nested = undefined; // toJSON - - /** - * Cached nested objects as an array. - * @type {ReflectionObject[]|null} - * @private - */ - this._nestedArray = null; -} - -function clearCache(namespace) { - namespace._nestedArray = null; - return namespace; -} - -/** - * Nested objects of this namespace as an array for iteration. - * @name NamespaceBase#nestedArray - * @type {ReflectionObject[]} - * @readonly - */ -Object.defineProperty(Namespace.prototype, "nestedArray", { - get: function() { - return this._nestedArray || (this._nestedArray = util.toArray(this.nested)); - } -}); - -/** - * Namespace descriptor. - * @interface INamespace - * @property {Object.} [options] Namespace options - * @property {Object.} [nested] Nested object descriptors - */ - -/** - * Any extension field descriptor. - * @typedef AnyExtensionField - * @type {IExtensionField|IExtensionMapField} - */ - -/** - * Any nested object descriptor. - * @typedef AnyNestedObject - * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf} - */ - -/** - * Converts this namespace to a namespace descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {INamespace} Namespace descriptor - */ -Namespace.prototype.toJSON = function toJSON(toJSONOptions) { - return util.toObject([ - "options" , this.options, - "nested" , arrayToJSON(this.nestedArray, toJSONOptions) - ]); -}; - -/** - * Adds nested objects to this namespace from nested object descriptors. - * @param {Object.} nestedJson Any nested object descriptors - * @returns {Namespace} `this` - */ -Namespace.prototype.addJSON = function addJSON(nestedJson) { - var ns = this; - /* istanbul ignore else */ - if (nestedJson) { - for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) { - nested = nestedJson[names[i]]; - ns.add( // most to least likely - ( nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : nested.id !== undefined - ? Field.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - } - return this; -}; - -/** - * Gets the nested object of the specified name. - * @param {string} name Nested object name - * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist - */ -Namespace.prototype.get = function get(name) { - return this.nested && this.nested[name] - || null; -}; - -/** - * Gets the values of the nested {@link Enum|enum} of the specified name. - * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`. - * @param {string} name Nested enum name - * @returns {Object.} Enum values - * @throws {Error} If there is no such enum - */ -Namespace.prototype.getEnum = function getEnum(name) { - if (this.nested && this.nested[name] instanceof Enum) - return this.nested[name].values; - throw Error("no such enum: " + name); -}; - -/** - * Adds a nested object to this namespace. - * @param {ReflectionObject} object Nested object to add - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name - */ -Namespace.prototype.add = function add(object) { - - if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace)) - throw TypeError("object must be a valid nested object"); - - if (!this.nested) - this.nested = {}; - else { - var prev = this.get(object.name); - if (prev) { - if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) { - // replace plain namespace but keep existing nested elements and options - var nested = prev.nestedArray; - for (var i = 0; i < nested.length; ++i) - object.add(nested[i]); - this.remove(prev); - if (!this.nested) - this.nested = {}; - object.setOptions(prev.options, true); - - } else - throw Error("duplicate name '" + object.name + "' in " + this); - } - } - this.nested[object.name] = object; - object.onAdd(this); - return clearCache(this); -}; - -/** - * Removes a nested object from this namespace. - * @param {ReflectionObject} object Nested object to remove - * @returns {Namespace} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this namespace - */ -Namespace.prototype.remove = function remove(object) { - - if (!(object instanceof ReflectionObject)) - throw TypeError("object must be a ReflectionObject"); - if (object.parent !== this) - throw Error(object + " is not a member of " + this); - - delete this.nested[object.name]; - if (!Object.keys(this.nested).length) - this.nested = undefined; - - object.onRemove(this); - return clearCache(this); -}; - -/** - * Defines additial namespaces within this one if not yet existing. - * @param {string|string[]} path Path to create - * @param {*} [json] Nested types to create from JSON - * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty - */ -Namespace.prototype.define = function define(path, json) { - - if (util.isString(path)) - path = path.split("."); - else if (!Array.isArray(path)) - throw TypeError("illegal path"); - if (path && path.length && path[0] === "") - throw Error("path must be relative"); - - var ptr = this; - while (path.length > 0) { - var part = path.shift(); - if (ptr.nested && ptr.nested[part]) { - ptr = ptr.nested[part]; - if (!(ptr instanceof Namespace)) - throw Error("path conflicts with non-namespace objects"); - } else - ptr.add(ptr = new Namespace(part)); - } - if (json) - ptr.addJSON(json); - return ptr; -}; - -/** - * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost. - * @returns {Namespace} `this` - */ -Namespace.prototype.resolveAll = function resolveAll() { - var nested = this.nestedArray, i = 0; - while (i < nested.length) - if (nested[i] instanceof Namespace) - nested[i++].resolveAll(); - else - nested[i++].resolve(); - return this.resolve(); -}; - -/** - * Recursively looks up the reflection object matching the specified path in the scope of this namespace. - * @param {string|string[]} path Path to look up - * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc. - * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - */ -Namespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) { - - /* istanbul ignore next */ - if (typeof filterTypes === "boolean") { - parentAlreadyChecked = filterTypes; - filterTypes = undefined; - } else if (filterTypes && !Array.isArray(filterTypes)) - filterTypes = [ filterTypes ]; - - if (util.isString(path) && path.length) { - if (path === ".") - return this.root; - path = path.split("."); - } else if (!path.length) - return this; - - // Start at root if path is absolute - if (path[0] === "") - return this.root.lookup(path.slice(1), filterTypes); - - // Test if the first part matches any nested object, and if so, traverse if path contains more - var found = this.get(path[0]); - if (found) { - if (path.length === 1) { - if (!filterTypes || filterTypes.indexOf(found.constructor) > -1) - return found; - } else if (found instanceof Namespace && (found = found.lookup(path.slice(1), filterTypes, true))) - return found; - - // Otherwise try each nested namespace - } else - for (var i = 0; i < this.nestedArray.length; ++i) - if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i].lookup(path, filterTypes, true))) - return found; - - // If there hasn't been a match, try again at the parent - if (this.parent === null || parentAlreadyChecked) - return null; - return this.parent.lookup(path, filterTypes); -}; - -/** - * Looks up the reflection object at the specified path, relative to this namespace. - * @name NamespaceBase#lookup - * @function - * @param {string|string[]} path Path to look up - * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked - * @returns {ReflectionObject|null} Looked up object or `null` if none could be found - * @variation 2 - */ -// lookup(path: string, [parentAlreadyChecked: boolean]) - -/** - * Looks up the {@link Type|type} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type - * @throws {Error} If `path` does not point to a type - */ -Namespace.prototype.lookupType = function lookupType(path) { - var found = this.lookup(path, [ Type ]); - if (!found) - throw Error("no such type: " + path); - return found; -}; - -/** - * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Enum} Looked up enum - * @throws {Error} If `path` does not point to an enum - */ -Namespace.prototype.lookupEnum = function lookupEnum(path) { - var found = this.lookup(path, [ Enum ]); - if (!found) - throw Error("no such Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Type} Looked up type or enum - * @throws {Error} If `path` does not point to a type or enum - */ -Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) { - var found = this.lookup(path, [ Type, Enum ]); - if (!found) - throw Error("no such Type or Enum '" + path + "' in " + this); - return found; -}; - -/** - * Looks up the {@link Service|service} at the specified path, relative to this namespace. - * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`. - * @param {string|string[]} path Path to look up - * @returns {Service} Looked up service - * @throws {Error} If `path` does not point to a service - */ -Namespace.prototype.lookupService = function lookupService(path) { - var found = this.lookup(path, [ Service ]); - if (!found) - throw Error("no such Service '" + path + "' in " + this); - return found; -}; - -// Sets up cyclic dependencies (called in index-light) -Namespace._configure = function(Type_, Service_, Enum_) { - Type = Type_; - Service = Service_; - Enum = Enum_; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/object.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/object.js deleted file mode 100644 index bd04ceca8..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/object.js +++ /dev/null @@ -1,243 +0,0 @@ -"use strict"; -module.exports = ReflectionObject; - -ReflectionObject.className = "ReflectionObject"; - -var util = require("./util"); - -var Root; // cyclic - -/** - * Constructs a new reflection object instance. - * @classdesc Base class of all reflection objects. - * @constructor - * @param {string} name Object name - * @param {Object.} [options] Declared options - * @abstract - */ -function ReflectionObject(name, options) { - - if (!util.isString(name)) - throw TypeError("name must be a string"); - - if (options && !util.isObject(options)) - throw TypeError("options must be an object"); - - /** - * Options. - * @type {Object.|undefined} - */ - this.options = options; // toJSON - - /** - * Parsed Options. - * @type {Array.>|undefined} - */ - this.parsedOptions = null; - - /** - * Unique name within its namespace. - * @type {string} - */ - this.name = name; - - /** - * Parent namespace. - * @type {Namespace|null} - */ - this.parent = null; - - /** - * Whether already resolved or not. - * @type {boolean} - */ - this.resolved = false; - - /** - * Comment text, if any. - * @type {string|null} - */ - this.comment = null; - - /** - * Defining file name. - * @type {string|null} - */ - this.filename = null; -} - -Object.defineProperties(ReflectionObject.prototype, { - - /** - * Reference to the root namespace. - * @name ReflectionObject#root - * @type {Root} - * @readonly - */ - root: { - get: function() { - var ptr = this; - while (ptr.parent !== null) - ptr = ptr.parent; - return ptr; - } - }, - - /** - * Full name including leading dot. - * @name ReflectionObject#fullName - * @type {string} - * @readonly - */ - fullName: { - get: function() { - var path = [ this.name ], - ptr = this.parent; - while (ptr) { - path.unshift(ptr.name); - ptr = ptr.parent; - } - return path.join("."); - } - } -}); - -/** - * Converts this reflection object to its descriptor representation. - * @returns {Object.} Descriptor - * @abstract - */ -ReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() { - throw Error(); // not implemented, shouldn't happen -}; - -/** - * Called when this object is added to a parent. - * @param {ReflectionObject} parent Parent added to - * @returns {undefined} - */ -ReflectionObject.prototype.onAdd = function onAdd(parent) { - if (this.parent && this.parent !== parent) - this.parent.remove(this); - this.parent = parent; - this.resolved = false; - var root = parent.root; - if (root instanceof Root) - root._handleAdd(this); -}; - -/** - * Called when this object is removed from a parent. - * @param {ReflectionObject} parent Parent removed from - * @returns {undefined} - */ -ReflectionObject.prototype.onRemove = function onRemove(parent) { - var root = parent.root; - if (root instanceof Root) - root._handleRemove(this); - this.parent = null; - this.resolved = false; -}; - -/** - * Resolves this objects type references. - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.resolve = function resolve() { - if (this.resolved) - return this; - if (this.root instanceof Root) - this.resolved = true; // only if part of a root - return this; -}; - -/** - * Gets an option value. - * @param {string} name Option name - * @returns {*} Option value or `undefined` if not set - */ -ReflectionObject.prototype.getOption = function getOption(name) { - if (this.options) - return this.options[name]; - return undefined; -}; - -/** - * Sets an option. - * @param {string} name Option name - * @param {*} value Option value - * @param {boolean} [ifNotSet] Sets the option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) { - if (!ifNotSet || !this.options || this.options[name] === undefined) - (this.options || (this.options = {}))[name] = value; - return this; -}; - -/** - * Sets a parsed option. - * @param {string} name parsed Option name - * @param {*} value Option value - * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\empty, will add a new option with that value - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) { - if (!this.parsedOptions) { - this.parsedOptions = []; - } - var parsedOptions = this.parsedOptions; - if (propName) { - // If setting a sub property of an option then try to merge it - // with an existing option - var opt = parsedOptions.find(function (opt) { - return Object.prototype.hasOwnProperty.call(opt, name); - }); - if (opt) { - // If we found an existing option - just merge the property value - var newValue = opt[name]; - util.setProperty(newValue, propName, value); - } else { - // otherwise, create a new option, set it's property and add it to the list - opt = {}; - opt[name] = util.setProperty({}, propName, value); - parsedOptions.push(opt); - } - } else { - // Always create a new option when setting the value of the option itself - var newOpt = {}; - newOpt[name] = value; - parsedOptions.push(newOpt); - } - return this; -}; - -/** - * Sets multiple options. - * @param {Object.} options Options to set - * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set - * @returns {ReflectionObject} `this` - */ -ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { - if (options) - for (var keys = Object.keys(options), i = 0; i < keys.length; ++i) - this.setOption(keys[i], options[keys[i]], ifNotSet); - return this; -}; - -/** - * Converts this instance to its string representation. - * @returns {string} Class name[, space, full name] - */ -ReflectionObject.prototype.toString = function toString() { - var className = this.constructor.className, - fullName = this.fullName; - if (fullName.length) - return className + " " + fullName; - return className; -}; - -// Sets up cyclic dependencies (called in index-light) -ReflectionObject._configure = function(Root_) { - Root = Root_; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/oneof.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/oneof.js deleted file mode 100644 index ba0e90279..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/oneof.js +++ /dev/null @@ -1,203 +0,0 @@ -"use strict"; -module.exports = OneOf; - -// extends ReflectionObject -var ReflectionObject = require("./object"); -((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; - -var Field = require("./field"), - util = require("./util"); - -/** - * Constructs a new oneof instance. - * @classdesc Reflected oneof. - * @extends ReflectionObject - * @constructor - * @param {string} name Oneof name - * @param {string[]|Object.} [fieldNames] Field names - * @param {Object.} [options] Declared options - * @param {string} [comment] Comment associated with this field - */ -function OneOf(name, fieldNames, options, comment) { - if (!Array.isArray(fieldNames)) { - options = fieldNames; - fieldNames = undefined; - } - ReflectionObject.call(this, name, options); - - /* istanbul ignore if */ - if (!(fieldNames === undefined || Array.isArray(fieldNames))) - throw TypeError("fieldNames must be an Array"); - - /** - * Field names that belong to this oneof. - * @type {string[]} - */ - this.oneof = fieldNames || []; // toJSON, marker - - /** - * Fields that belong to this oneof as an array for iteration. - * @type {Field[]} - * @readonly - */ - this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent - - /** - * Comment for this field. - * @type {string|null} - */ - this.comment = comment; -} - -/** - * Oneof descriptor. - * @interface IOneOf - * @property {Array.} oneof Oneof field names - * @property {Object.} [options] Oneof options - */ - -/** - * Constructs a oneof from a oneof descriptor. - * @param {string} name Oneof name - * @param {IOneOf} json Oneof descriptor - * @returns {OneOf} Created oneof - * @throws {TypeError} If arguments are invalid - */ -OneOf.fromJSON = function fromJSON(name, json) { - return new OneOf(name, json.oneof, json.options, json.comment); -}; - -/** - * Converts this oneof to a oneof descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IOneOf} Oneof descriptor - */ -OneOf.prototype.toJSON = function toJSON(toJSONOptions) { - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , this.options, - "oneof" , this.oneof, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Adds the fields of the specified oneof to the parent if not already done so. - * @param {OneOf} oneof The oneof - * @returns {undefined} - * @inner - * @ignore - */ -function addFieldsToParent(oneof) { - if (oneof.parent) - for (var i = 0; i < oneof.fieldsArray.length; ++i) - if (!oneof.fieldsArray[i].parent) - oneof.parent.add(oneof.fieldsArray[i]); -} - -/** - * Adds a field to this oneof and removes it from its current parent, if any. - * @param {Field} field Field to add - * @returns {OneOf} `this` - */ -OneOf.prototype.add = function add(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - if (field.parent && field.parent !== this.parent) - field.parent.remove(field); - this.oneof.push(field.name); - this.fieldsArray.push(field); - field.partOf = this; // field.parent remains null - addFieldsToParent(this); - return this; -}; - -/** - * Removes a field from this oneof and puts it back to the oneof's parent. - * @param {Field} field Field to remove - * @returns {OneOf} `this` - */ -OneOf.prototype.remove = function remove(field) { - - /* istanbul ignore if */ - if (!(field instanceof Field)) - throw TypeError("field must be a Field"); - - var index = this.fieldsArray.indexOf(field); - - /* istanbul ignore if */ - if (index < 0) - throw Error(field + " is not a member of " + this); - - this.fieldsArray.splice(index, 1); - index = this.oneof.indexOf(field.name); - - /* istanbul ignore else */ - if (index > -1) // theoretical - this.oneof.splice(index, 1); - - field.partOf = null; - return this; -}; - -/** - * @override - */ -OneOf.prototype.onAdd = function onAdd(parent) { - ReflectionObject.prototype.onAdd.call(this, parent); - var self = this; - // Collect present fields - for (var i = 0; i < this.oneof.length; ++i) { - var field = parent.get(this.oneof[i]); - if (field && !field.partOf) { - field.partOf = self; - self.fieldsArray.push(field); - } - } - // Add not yet present fields - addFieldsToParent(this); -}; - -/** - * @override - */ -OneOf.prototype.onRemove = function onRemove(parent) { - for (var i = 0, field; i < this.fieldsArray.length; ++i) - if ((field = this.fieldsArray[i]).parent) - field.parent.remove(field); - ReflectionObject.prototype.onRemove.call(this, parent); -}; - -/** - * Decorator function as returned by {@link OneOf.d} (TypeScript). - * @typedef OneOfDecorator - * @type {function} - * @param {Object} prototype Target prototype - * @param {string} oneofName OneOf name - * @returns {undefined} - */ - -/** - * OneOf decorator (TypeScript). - * @function - * @param {...string} fieldNames Field names - * @returns {OneOfDecorator} Decorator function - * @template T extends string - */ -OneOf.d = function decorateOneOf() { - var fieldNames = new Array(arguments.length), - index = 0; - while (index < arguments.length) - fieldNames[index] = arguments[index++]; - return function oneOfDecorator(prototype, oneofName) { - util.decorateType(prototype.constructor) - .add(new OneOf(oneofName, fieldNames)); - Object.defineProperty(prototype, oneofName, { - get: util.oneOfGetter(fieldNames), - set: util.oneOfSetter(fieldNames) - }); - }; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/parse.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/parse.js deleted file mode 100644 index ebb8b9c42..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/parse.js +++ /dev/null @@ -1,869 +0,0 @@ -"use strict"; -module.exports = parse; - -parse.filename = null; -parse.defaults = { keepCase: false }; - -var tokenize = require("./tokenize"), - Root = require("./root"), - Type = require("./type"), - Field = require("./field"), - MapField = require("./mapfield"), - OneOf = require("./oneof"), - Enum = require("./enum"), - Service = require("./service"), - Method = require("./method"), - types = require("./types"), - util = require("./util"); - -var base10Re = /^[1-9][0-9]*$/, - base10NegRe = /^-?[1-9][0-9]*$/, - base16Re = /^0[x][0-9a-fA-F]+$/, - base16NegRe = /^-?0[x][0-9a-fA-F]+$/, - base8Re = /^0[0-7]+$/, - base8NegRe = /^-?0[0-7]+$/, - numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, - nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, - typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, - fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/; - -/** - * Result object returned from {@link parse}. - * @interface IParserResult - * @property {string|undefined} package Package name, if declared - * @property {string[]|undefined} imports Imports, if any - * @property {string[]|undefined} weakImports Weak imports, if any - * @property {string|undefined} syntax Syntax, if specified (either `"proto2"` or `"proto3"`) - * @property {Root} root Populated root instance - */ - -/** - * Options modifying the behavior of {@link parse}. - * @interface IParseOptions - * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case - * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments. - * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist. - */ - -/** - * Options modifying the behavior of JSON serialization. - * @interface IToJSONOptions - * @property {boolean} [keepComments=false] Serializes comments. - */ - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @param {string} source Source contents - * @param {Root} root Root to populate - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {IParserResult} Parser result - * @property {string} filename=null Currently processing file name for error reporting, if known - * @property {IParseOptions} defaults Default {@link IParseOptions} - */ -function parse(source, root, options) { - /* eslint-disable callback-return */ - if (!(root instanceof Root)) { - options = root; - root = new Root(); - } - if (!options) - options = parse.defaults; - - var preferTrailingComment = options.preferTrailingComment || false; - var tn = tokenize(source, options.alternateCommentMode || false), - next = tn.next, - push = tn.push, - peek = tn.peek, - skip = tn.skip, - cmnt = tn.cmnt; - - var head = true, - pkg, - imports, - weakImports, - syntax, - isProto3 = false; - - var ptr = root; - - var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase; - - /* istanbul ignore next */ - function illegal(token, name, insideTryCatch) { - var filename = parse.filename; - if (!insideTryCatch) - parse.filename = null; - return Error("illegal " + (name || "token") + " '" + token + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); - } - - function readString() { - var values = [], - token; - do { - /* istanbul ignore if */ - if ((token = next()) !== "\"" && token !== "'") - throw illegal(token); - - values.push(next()); - skip(token); - token = peek(); - } while (token === "\"" || token === "'"); - return values.join(""); - } - - function readValue(acceptTypeRef) { - var token = next(); - switch (token) { - case "'": - case "\"": - push(token); - return readString(); - case "true": case "TRUE": - return true; - case "false": case "FALSE": - return false; - } - try { - return parseNumber(token, /* insideTryCatch */ true); - } catch (e) { - - /* istanbul ignore else */ - if (acceptTypeRef && typeRefRe.test(token)) - return token; - - /* istanbul ignore next */ - throw illegal(token, "value"); - } - } - - function readRanges(target, acceptStrings) { - var token, start; - do { - if (acceptStrings && ((token = peek()) === "\"" || token === "'")) - target.push(readString()); - else - target.push([ start = parseId(next()), skip("to", true) ? parseId(next()) : start ]); - } while (skip(",", true)); - skip(";"); - } - - function parseNumber(token, insideTryCatch) { - var sign = 1; - if (token.charAt(0) === "-") { - sign = -1; - token = token.substring(1); - } - switch (token) { - case "inf": case "INF": case "Inf": - return sign * Infinity; - case "nan": case "NAN": case "Nan": case "NaN": - return NaN; - case "0": - return 0; - } - if (base10Re.test(token)) - return sign * parseInt(token, 10); - if (base16Re.test(token)) - return sign * parseInt(token, 16); - if (base8Re.test(token)) - return sign * parseInt(token, 8); - - /* istanbul ignore else */ - if (numberRe.test(token)) - return sign * parseFloat(token); - - /* istanbul ignore next */ - throw illegal(token, "number", insideTryCatch); - } - - function parseId(token, acceptNegative) { - switch (token) { - case "max": case "MAX": case "Max": - return 536870911; - case "0": - return 0; - } - - /* istanbul ignore if */ - if (!acceptNegative && token.charAt(0) === "-") - throw illegal(token, "id"); - - if (base10NegRe.test(token)) - return parseInt(token, 10); - if (base16NegRe.test(token)) - return parseInt(token, 16); - - /* istanbul ignore else */ - if (base8NegRe.test(token)) - return parseInt(token, 8); - - /* istanbul ignore next */ - throw illegal(token, "id"); - } - - function parsePackage() { - - /* istanbul ignore if */ - if (pkg !== undefined) - throw illegal("package"); - - pkg = next(); - - /* istanbul ignore if */ - if (!typeRefRe.test(pkg)) - throw illegal(pkg, "name"); - - ptr = ptr.define(pkg); - skip(";"); - } - - function parseImport() { - var token = peek(); - var whichImports; - switch (token) { - case "weak": - whichImports = weakImports || (weakImports = []); - next(); - break; - case "public": - next(); - // eslint-disable-line no-fallthrough - default: - whichImports = imports || (imports = []); - break; - } - token = readString(); - skip(";"); - whichImports.push(token); - } - - function parseSyntax() { - skip("="); - syntax = readString(); - isProto3 = syntax === "proto3"; - - /* istanbul ignore if */ - if (!isProto3 && syntax !== "proto2") - throw illegal(syntax, "syntax"); - - skip(";"); - } - - function parseCommon(parent, token) { - switch (token) { - - case "option": - parseOption(parent, token); - skip(";"); - return true; - - case "message": - parseType(parent, token); - return true; - - case "enum": - parseEnum(parent, token); - return true; - - case "service": - parseService(parent, token); - return true; - - case "extend": - parseExtension(parent, token); - return true; - } - return false; - } - - function ifBlock(obj, fnIf, fnElse) { - var trailingLine = tn.line; - if (obj) { - if(typeof obj.comment !== "string") { - obj.comment = cmnt(); // try block-type comment - } - obj.filename = parse.filename; - } - if (skip("{", true)) { - var token; - while ((token = next()) !== "}") - fnIf(token); - skip(";", true); - } else { - if (fnElse) - fnElse(); - skip(";"); - if (obj && (typeof obj.comment !== "string" || preferTrailingComment)) - obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment - } - } - - function parseType(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "type name"); - - var type = new Type(token); - ifBlock(type, function parseType_block(token) { - if (parseCommon(type, token)) - return; - - switch (token) { - - case "map": - parseMapField(type, token); - break; - - case "required": - case "repeated": - parseField(type, token); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(type, "proto3_optional"); - } else { - parseField(type, "optional"); - } - break; - - case "oneof": - parseOneOf(type, token); - break; - - case "extensions": - readRanges(type.extensions || (type.extensions = [])); - break; - - case "reserved": - readRanges(type.reserved || (type.reserved = []), true); - break; - - default: - /* istanbul ignore if */ - if (!isProto3 || !typeRefRe.test(token)) - throw illegal(token); - - push(token); - parseField(type, "optional"); - break; - } - }); - parent.add(type); - } - - function parseField(parent, rule, extend) { - var type = next(); - if (type === "group") { - parseGroup(parent, rule); - return; - } - // Type names can consume multiple tokens, in multiple variants: - // package.subpackage field tokens: "package.subpackage" [TYPE NAME ENDS HERE] "field" - // package . subpackage field tokens: "package" "." "subpackage" [TYPE NAME ENDS HERE] "field" - // package. subpackage field tokens: "package." "subpackage" [TYPE NAME ENDS HERE] "field" - // package .subpackage field tokens: "package" ".subpackage" [TYPE NAME ENDS HERE] "field" - // Keep reading tokens until we get a type name with no period at the end, - // and the next token does not start with a period. - while (type.endsWith(".") || peek().startsWith(".")) { - type += next(); - } - - /* istanbul ignore if */ - if (!typeRefRe.test(type)) - throw illegal(type, "type"); - - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - name = applyCase(name); - skip("="); - - var field = new Field(name, parseId(next()), type, rule, extend); - ifBlock(field, function parseField_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(field, token); - skip(";"); - } else - throw illegal(token); - - }, function parseField_line() { - parseInlineOptions(field); - }); - - if (rule === "proto3_optional") { - // for proto3 optional fields, we create a single-member Oneof to mimic "optional" behavior - var oneof = new OneOf("_" + name); - field.setOption("proto3_optional", true); - oneof.add(field); - parent.add(oneof); - } else { - parent.add(field); - } - - // JSON defaults to packed=true if not set so we have to set packed=false explicity when - // parsing proto2 descriptors without the option, where applicable. This must be done for - // all known packable types and anything that could be an enum (= is not a basic type). - if (!isProto3 && field.repeated && (types.packed[type] !== undefined || types.basic[type] === undefined)) - field.setOption("packed", false, /* ifNotSet */ true); - } - - function parseGroup(parent, rule) { - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - var fieldName = util.lcFirst(name); - if (name === fieldName) - name = util.ucFirst(name); - skip("="); - var id = parseId(next()); - var type = new Type(name); - type.group = true; - var field = new Field(fieldName, id, name, rule); - field.filename = parse.filename; - ifBlock(type, function parseGroup_block(token) { - switch (token) { - - case "option": - parseOption(type, token); - skip(";"); - break; - - case "required": - case "repeated": - parseField(type, token); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(type, "proto3_optional"); - } else { - parseField(type, "optional"); - } - break; - - case "message": - parseType(type, token); - break; - - case "enum": - parseEnum(type, token); - break; - - /* istanbul ignore next */ - default: - throw illegal(token); // there are no groups with proto3 semantics - } - }); - parent.add(type) - .add(field); - } - - function parseMapField(parent) { - skip("<"); - var keyType = next(); - - /* istanbul ignore if */ - if (types.mapKey[keyType] === undefined) - throw illegal(keyType, "type"); - - skip(","); - var valueType = next(); - - /* istanbul ignore if */ - if (!typeRefRe.test(valueType)) - throw illegal(valueType, "type"); - - skip(">"); - var name = next(); - - /* istanbul ignore if */ - if (!nameRe.test(name)) - throw illegal(name, "name"); - - skip("="); - var field = new MapField(applyCase(name), parseId(next()), keyType, valueType); - ifBlock(field, function parseMapField_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(field, token); - skip(";"); - } else - throw illegal(token); - - }, function parseMapField_line() { - parseInlineOptions(field); - }); - parent.add(field); - } - - function parseOneOf(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var oneof = new OneOf(applyCase(token)); - ifBlock(oneof, function parseOneOf_block(token) { - if (token === "option") { - parseOption(oneof, token); - skip(";"); - } else { - push(token); - parseField(oneof, "optional"); - } - }); - parent.add(oneof); - } - - function parseEnum(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var enm = new Enum(token); - ifBlock(enm, function parseEnum_block(token) { - switch(token) { - case "option": - parseOption(enm, token); - skip(";"); - break; - - case "reserved": - readRanges(enm.reserved || (enm.reserved = []), true); - break; - - default: - parseEnumValue(enm, token); - } - }); - parent.add(enm); - } - - function parseEnumValue(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token)) - throw illegal(token, "name"); - - skip("="); - var value = parseId(next(), true), - dummy = { - options: undefined - }; - dummy.setOption = function(name, value) { - if (this.options === undefined) - this.options = {}; - this.options[name] = value; - }; - ifBlock(dummy, function parseEnumValue_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(dummy, token); // skip - skip(";"); - } else - throw illegal(token); - - }, function parseEnumValue_line() { - parseInlineOptions(dummy); // skip - }); - parent.add(token, value, dummy.comment, dummy.options); - } - - function parseOption(parent, token) { - var isCustom = skip("(", true); - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token, "name"); - - var name = token; - var option = name; - var propName; - - if (isCustom) { - skip(")"); - name = "(" + name + ")"; - option = name; - token = peek(); - if (fqTypeRefRe.test(token)) { - propName = token.slice(1); //remove '.' before property name - name += token; - next(); - } - } - skip("="); - var optionValue = parseOptionValue(parent, name); - setParsedOption(parent, option, optionValue, propName); - } - - function parseOptionValue(parent, name) { - // { a: "foo" b { c: "bar" } } - if (skip("{", true)) { - var objectResult = {}; - - while (!skip("}", true)) { - /* istanbul ignore if */ - if (!nameRe.test(token = next())) { - throw illegal(token, "name"); - } - - var value; - var propName = token; - - skip(":", true); - - if (peek() === "{") - value = parseOptionValue(parent, name + "." + token); - else if (peek() === "[") { - // option (my_option) = { - // repeated_value: [ "foo", "bar" ] - // }; - value = []; - var lastValue; - if (skip("[", true)) { - do { - lastValue = readValue(true); - value.push(lastValue); - } while (skip(",", true)); - skip("]"); - if (typeof lastValue !== "undefined") { - setOption(parent, name + "." + token, lastValue); - } - } - } else { - value = readValue(true); - setOption(parent, name + "." + token, value); - } - - var prevValue = objectResult[propName]; - - if (prevValue) - value = [].concat(prevValue).concat(value); - - objectResult[propName] = value; - - // Semicolons and commas can be optional - skip(",", true); - skip(";", true); - } - - return objectResult; - } - - var simpleValue = readValue(true); - setOption(parent, name, simpleValue); - return simpleValue; - // Does not enforce a delimiter to be universal - } - - function setOption(parent, name, value) { - if (parent.setOption) - parent.setOption(name, value); - } - - function setParsedOption(parent, name, value, propName) { - if (parent.setParsedOption) - parent.setParsedOption(name, value, propName); - } - - function parseInlineOptions(parent) { - if (skip("[", true)) { - do { - parseOption(parent, "option"); - } while (skip(",", true)); - skip("]"); - } - return parent; - } - - function parseService(parent, token) { - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "service name"); - - var service = new Service(token); - ifBlock(service, function parseService_block(token) { - if (parseCommon(service, token)) - return; - - /* istanbul ignore else */ - if (token === "rpc") - parseMethod(service, token); - else - throw illegal(token); - }); - parent.add(service); - } - - function parseMethod(parent, token) { - // Get the comment of the preceding line now (if one exists) in case the - // method is defined across multiple lines. - var commentText = cmnt(); - - var type = token; - - /* istanbul ignore if */ - if (!nameRe.test(token = next())) - throw illegal(token, "name"); - - var name = token, - requestType, requestStream, - responseType, responseStream; - - skip("("); - if (skip("stream", true)) - requestStream = true; - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token); - - requestType = token; - skip(")"); skip("returns"); skip("("); - if (skip("stream", true)) - responseStream = true; - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token); - - responseType = token; - skip(")"); - - var method = new Method(name, type, requestType, responseType, requestStream, responseStream); - method.comment = commentText; - ifBlock(method, function parseMethod_block(token) { - - /* istanbul ignore else */ - if (token === "option") { - parseOption(method, token); - skip(";"); - } else - throw illegal(token); - - }); - parent.add(method); - } - - function parseExtension(parent, token) { - - /* istanbul ignore if */ - if (!typeRefRe.test(token = next())) - throw illegal(token, "reference"); - - var reference = token; - ifBlock(null, function parseExtension_block(token) { - switch (token) { - - case "required": - case "repeated": - parseField(parent, token, reference); - break; - - case "optional": - /* istanbul ignore if */ - if (isProto3) { - parseField(parent, "proto3_optional", reference); - } else { - parseField(parent, "optional", reference); - } - break; - - default: - /* istanbul ignore if */ - if (!isProto3 || !typeRefRe.test(token)) - throw illegal(token); - push(token); - parseField(parent, "optional", reference); - break; - } - }); - } - - var token; - while ((token = next()) !== null) { - switch (token) { - - case "package": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parsePackage(); - break; - - case "import": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parseImport(); - break; - - case "syntax": - - /* istanbul ignore if */ - if (!head) - throw illegal(token); - - parseSyntax(); - break; - - case "option": - - parseOption(ptr, token); - skip(";"); - break; - - default: - - /* istanbul ignore else */ - if (parseCommon(ptr, token)) { - head = false; - continue; - } - - /* istanbul ignore next */ - throw illegal(token); - } - } - - parse.filename = null; - return { - "package" : pkg, - "imports" : imports, - weakImports : weakImports, - syntax : syntax, - root : root - }; -} - -/** - * Parses the given .proto source and returns an object with the parsed contents. - * @name parse - * @function - * @param {string} source Source contents - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {IParserResult} Parser result - * @property {string} filename=null Currently processing file name for error reporting, if known - * @property {IParseOptions} defaults Default {@link IParseOptions} - * @variation 2 - */ diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/reader.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/reader.js deleted file mode 100644 index 1b6ae13f8..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/reader.js +++ /dev/null @@ -1,411 +0,0 @@ -"use strict"; -module.exports = Reader; - -var util = require("./util/minimal"); - -var BufferReader; // cyclic - -var LongBits = util.LongBits, - utf8 = util.utf8; - -/* istanbul ignore next */ -function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); -} - -/** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ -function Reader(buffer) { - - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; -} - -var create_array = typeof Uint8Array !== "undefined" - ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - } - /* istanbul ignore next */ - : function create_array(buffer) { - if (Array.isArray(buffer)) - return new Reader(buffer); - throw Error("illegal buffer"); - }; - -var create = function create() { - return util.Buffer - ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer) { - return util.Buffer.isBuffer(buffer) - ? new BufferReader(buffer) - /* istanbul ignore next */ - : create_array(buffer); - })(buffer); - } - /* istanbul ignore next */ - : create_array; -}; - -/** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ -Reader.create = create(); - -Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice; - -/** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ -Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!) - return function read_uint32() { - value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value; - - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; -})(); - -/** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; -}; - -/** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ -Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readLongVarint() { - // tends to deopt with local vars for octet etc. - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { // fast route (lo) - for (; i < 4; ++i) { - // 1st..4th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 5th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 1st..3th - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - // 4th - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) { // fast route (hi) - for (; i < 5; ++i) { - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } else { - for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - // 6th..10th - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) - return bits; - } - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ -Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; -}; - -function readFixed32_end(buf, end) { // note that this uses `end`, not `pos` - return (buf[end - 4] - | buf[end - 3] << 8 - | buf[end - 2] << 16 - | buf[end - 1] << 24) >>> 0; -} - -/** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.fixed32 = function read_fixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4); -}; - -/** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ -Reader.prototype.sfixed32 = function read_sfixed32() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - return readFixed32_end(this.buf, this.pos += 4) | 0; -}; - -/* eslint-disable no-invalid-this */ - -function readFixed64(/* this: Reader */) { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 8); - - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); -} - -/* eslint-enable no-invalid-this */ - -/** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - -/** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.float = function read_float() { - - /* istanbul ignore if */ - if (this.pos + 4 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; -}; - -/** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ -Reader.prototype.double = function read_double() { - - /* istanbul ignore if */ - if (this.pos + 8 > this.len) - throw indexOutOfRange(this, 4); - - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ -Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), - start = this.pos, - end = this.pos + length; - - /* istanbul ignore if */ - if (end > this.len) - throw indexOutOfRange(this, length); - - this.pos += length; - if (Array.isArray(this.buf)) // plain array - return this.buf.slice(start, end); - return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1 - ? new this.buf.constructor(0) - : this._slice.call(this.buf, start, end); -}; - -/** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ -Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); -}; - -/** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ -Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) - throw indexOutOfRange(this, length); - this.pos += length; - } else { - do { - /* istanbul ignore if */ - if (this.pos >= this.len) - throw indexOutOfRange(this); - } while (this.buf[this.pos++] & 128); - } - return this; -}; - -/** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @returns {Reader} `this` - */ -Reader.prototype.skipType = function(wireType) { - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) { - this.skipType(wireType); - } - break; - case 5: - this.skip(4); - break; - - /* istanbul ignore next */ - default: - throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; -}; - -Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - - var fn = util.Long ? "toLong" : /* istanbul ignore next */ "toNumber"; - util.merge(Reader.prototype, { - - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - - }); -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/reader_buffer.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/reader_buffer.js deleted file mode 100644 index e54742416..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/reader_buffer.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -module.exports = BufferReader; - -// extends Reader -var Reader = require("./reader"); -(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - -var util = require("./util/minimal"); - -/** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ -function BufferReader(buffer) { - Reader.call(this, buffer); - - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ -} - -BufferReader._configure = function () { - /* istanbul ignore else */ - if (util.Buffer) - BufferReader.prototype._slice = util.Buffer.prototype.slice; -}; - - -/** - * @override - */ -BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); // modifies pos - return this.buf.utf8Slice - ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) - : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); -}; - -/** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - -BufferReader._configure(); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/root.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/root.js deleted file mode 100644 index 9441a7fc3..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/root.js +++ /dev/null @@ -1,368 +0,0 @@ -"use strict"; -module.exports = Root; - -// extends Namespace -var Namespace = require("./namespace"); -((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root"; - -var Field = require("./field"), - Enum = require("./enum"), - OneOf = require("./oneof"), - util = require("./util"); - -var Type, // cyclic - parse, // might be excluded - common; // " - -/** - * Constructs a new root namespace instance. - * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. - * @extends NamespaceBase - * @constructor - * @param {Object.} [options] Top level options - */ -function Root(options) { - Namespace.call(this, "", options); - - /** - * Deferred extension fields. - * @type {Field[]} - */ - this.deferred = []; - - /** - * Resolved file names of loaded files. - * @type {string[]} - */ - this.files = []; -} - -/** - * Loads a namespace descriptor into a root namespace. - * @param {INamespace} json Nameespace descriptor - * @param {Root} [root] Root namespace, defaults to create a new one if omitted - * @returns {Root} Root namespace - */ -Root.fromJSON = function fromJSON(json, root) { - if (!root) - root = new Root(); - if (json.options) - root.setOptions(json.options); - return root.addJSON(json.nested); -}; - -/** - * Resolves the path of an imported file, relative to the importing origin. - * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories. - * @function - * @param {string} origin The file name of the importing file - * @param {string} target The file name being imported - * @returns {string|null} Resolved path to `target` or `null` to skip the file - */ -Root.prototype.resolvePath = util.path.resolve; - -/** - * Fetch content from file path or url - * This method exists so you can override it with your own logic. - * @function - * @param {string} path File path or url - * @param {FetchCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.fetch = util.fetch; - -// A symbol-like function to safely signal synchronous loading -/* istanbul ignore next */ -function SYNC() {} // eslint-disable-line no-empty-function - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} options Parse options - * @param {LoadCallback} callback Callback function - * @returns {undefined} - */ -Root.prototype.load = function load(filename, options, callback) { - if (typeof options === "function") { - callback = options; - options = undefined; - } - var self = this; - if (!callback) - return util.asPromise(load, self, filename, options); - - var sync = callback === SYNC; // undocumented - - // Finishes loading by calling the callback (exactly once) - function finish(err, root) { - /* istanbul ignore if */ - if (!callback) - return; - var cb = callback; - callback = null; - if (sync) - throw err; - cb(err, root); - } - - // Bundled definition existence checking - function getBundledFileName(filename) { - var idx = filename.lastIndexOf("google/protobuf/"); - if (idx > -1) { - var altname = filename.substring(idx); - if (altname in common) return altname; - } - return null; - } - - // Processes a single file - function process(filename, source) { - try { - if (util.isString(source) && source.charAt(0) === "{") - source = JSON.parse(source); - if (!util.isString(source)) - self.setOptions(source.options).addJSON(source.nested); - else { - parse.filename = filename; - var parsed = parse(source, self, options), - resolved, - i = 0; - if (parsed.imports) - for (; i < parsed.imports.length; ++i) - if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i])) - fetch(resolved); - if (parsed.weakImports) - for (i = 0; i < parsed.weakImports.length; ++i) - if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i])) - fetch(resolved, true); - } - } catch (err) { - finish(err); - } - if (!sync && !queued) - finish(null, self); // only once anyway - } - - // Fetches a single file - function fetch(filename, weak) { - filename = getBundledFileName(filename) || filename; - - // Skip if already loaded / attempted - if (self.files.indexOf(filename) > -1) - return; - self.files.push(filename); - - // Shortcut bundled definitions - if (filename in common) { - if (sync) - process(filename, common[filename]); - else { - ++queued; - setTimeout(function() { - --queued; - process(filename, common[filename]); - }); - } - return; - } - - // Otherwise fetch from disk or network - if (sync) { - var source; - try { - source = util.fs.readFileSync(filename).toString("utf8"); - } catch (err) { - if (!weak) - finish(err); - return; - } - process(filename, source); - } else { - ++queued; - self.fetch(filename, function(err, source) { - --queued; - /* istanbul ignore if */ - if (!callback) - return; // terminated meanwhile - if (err) { - /* istanbul ignore else */ - if (!weak) - finish(err); - else if (!queued) // can't be covered reliably - finish(null, self); - return; - } - process(filename, source); - }); - } - } - var queued = 0; - - // Assembling the root namespace doesn't require working type - // references anymore, so we can load everything in parallel - if (util.isString(filename)) - filename = [ filename ]; - for (var i = 0, resolved; i < filename.length; ++i) - if (resolved = self.resolvePath("", filename[i])) - fetch(resolved); - - if (sync) - return self; - if (!queued) - finish(null, self); - return undefined; -}; -// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {LoadCallback} callback Callback function - * @returns {undefined} - * @variation 2 - */ -// function load(filename:string, callback:LoadCallback):undefined - -/** - * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise. - * @function Root#load - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Promise} Promise - * @variation 3 - */ -// function load(filename:string, [options:IParseOptions]):Promise - -/** - * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only). - * @function Root#loadSync - * @param {string|string[]} filename Names of one or multiple files to load - * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted. - * @returns {Root} Root namespace - * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid - */ -Root.prototype.loadSync = function loadSync(filename, options) { - if (!util.isNode) - throw Error("not supported"); - return this.load(filename, options, SYNC); -}; - -/** - * @override - */ -Root.prototype.resolveAll = function resolveAll() { - if (this.deferred.length) - throw Error("unresolvable extensions: " + this.deferred.map(function(field) { - return "'extend " + field.extend + "' in " + field.parent.fullName; - }).join(", ")); - return Namespace.prototype.resolveAll.call(this); -}; - -// only uppercased (and thus conflict-free) children are exposed, see below -var exposeRe = /^[A-Z]/; - -/** - * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type. - * @param {Root} root Root instance - * @param {Field} field Declaring extension field witin the declaring type - * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise - * @inner - * @ignore - */ -function tryHandleExtension(root, field) { - var extendedType = field.parent.lookup(field.extend); - if (extendedType) { - var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options); - //do not allow to extend same field twice to prevent the error - if (extendedType.get(sisterField.name)) { - return true; - } - sisterField.declaringField = field; - field.extensionField = sisterField; - extendedType.add(sisterField); - return true; - } - return false; -} - -/** - * Called when any object is added to this root or its sub-namespaces. - * @param {ReflectionObject} object Object added - * @returns {undefined} - * @private - */ -Root.prototype._handleAdd = function _handleAdd(object) { - if (object instanceof Field) { - - if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField) - if (!tryHandleExtension(this, object)) - this.deferred.push(object); - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - object.parent[object.name] = object.values; // expose enum values as property of its parent - - } else if (!(object instanceof OneOf)) /* everything else is a namespace */ { - - if (object instanceof Type) // Try to handle any deferred extensions - for (var i = 0; i < this.deferred.length;) - if (tryHandleExtension(this, this.deferred[i])) - this.deferred.splice(i, 1); - else - ++i; - for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace - this._handleAdd(object._nestedArray[j]); - if (exposeRe.test(object.name)) - object.parent[object.name] = object; // expose namespace as property of its parent - } - - // The above also adds uppercased (and thus conflict-free) nested types, services and enums as - // properties of namespaces just like static code does. This allows using a .d.ts generated for - // a static module with reflection-based solutions where the condition is met. -}; - -/** - * Called when any object is removed from this root or its sub-namespaces. - * @param {ReflectionObject} object Object removed - * @returns {undefined} - * @private - */ -Root.prototype._handleRemove = function _handleRemove(object) { - if (object instanceof Field) { - - if (/* an extension field */ object.extend !== undefined) { - if (/* already handled */ object.extensionField) { // remove its sister field - object.extensionField.parent.remove(object.extensionField); - object.extensionField = null; - } else { // cancel the extension - var index = this.deferred.indexOf(object); - /* istanbul ignore else */ - if (index > -1) - this.deferred.splice(index, 1); - } - } - - } else if (object instanceof Enum) { - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose enum values - - } else if (object instanceof Namespace) { - - for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace - this._handleRemove(object._nestedArray[i]); - - if (exposeRe.test(object.name)) - delete object.parent[object.name]; // unexpose namespaces - - } -}; - -// Sets up cyclic dependencies (called in index-light) -Root._configure = function(Type_, parse_, common_) { - Type = Type_; - parse = parse_; - common = common_; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/roots.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/roots.js deleted file mode 100644 index 1d93086dd..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/roots.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -module.exports = {}; - -/** - * Named roots. - * This is where pbjs stores generated structures (the option `-r, --root` specifies a name). - * Can also be used manually to make roots available across modules. - * @name roots - * @type {Object.} - * @example - * // pbjs -r myroot -o compiled.js ... - * - * // in another module: - * require("./compiled.js"); - * - * // in any subsequent module: - * var root = protobuf.roots["myroot"]; - */ diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/rpc.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/rpc.js deleted file mode 100644 index 894e5c7c9..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/rpc.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; - -/** - * Streaming RPC helpers. - * @namespace - */ -var rpc = exports; - -/** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - -/** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - -rpc.Service = require("./rpc/service"); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/rpc/service.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/rpc/service.js deleted file mode 100644 index 757f382eb..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/rpc/service.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -module.exports = Service; - -var util = require("../util/minimal"); - -// Extends EventEmitter -(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - -/** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - -/** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - -/** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ -function Service(rpcImpl, requestDelimited, responseDelimited) { - - if (typeof rpcImpl !== "function") - throw TypeError("rpcImpl must be a function"); - - util.EventEmitter.call(this); - - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); -} - -/** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ -Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - - if (!request) - throw TypeError("request must be specified"); - - var self = this; - if (!callback) - return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request); - - if (!self.rpcImpl) { - setTimeout(function() { callback(Error("already ended")); }, 0); - return undefined; - } - - try { - return self.rpcImpl( - method, - requestCtor[self.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), - function rpcCallback(err, response) { - - if (err) { - self.emit("error", err, method); - return callback(err); - } - - if (response === null) { - self.end(/* endedByRPC */ true); - return undefined; - } - - if (!(response instanceof responseCtor)) { - try { - response = responseCtor[self.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err) { - self.emit("error", err, method); - return callback(err); - } - } - - self.emit("data", response, method); - return callback(null, response); - } - ); - } catch (err) { - self.emit("error", err, method); - setTimeout(function() { callback(err); }, 0); - return undefined; - } -}; - -/** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ -Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) // signal end to rpcImpl - this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/service.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/service.js deleted file mode 100644 index bc2c3080c..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/service.js +++ /dev/null @@ -1,167 +0,0 @@ -"use strict"; -module.exports = Service; - -// extends Namespace -var Namespace = require("./namespace"); -((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; - -var Method = require("./method"), - util = require("./util"), - rpc = require("./rpc"); - -/** - * Constructs a new service instance. - * @classdesc Reflected service. - * @extends NamespaceBase - * @constructor - * @param {string} name Service name - * @param {Object.} [options] Service options - * @throws {TypeError} If arguments are invalid - */ -function Service(name, options) { - Namespace.call(this, name, options); - - /** - * Service methods. - * @type {Object.} - */ - this.methods = {}; // toJSON, marker - - /** - * Cached methods as an array. - * @type {Method[]|null} - * @private - */ - this._methodsArray = null; -} - -/** - * Service descriptor. - * @interface IService - * @extends INamespace - * @property {Object.} methods Method descriptors - */ - -/** - * Constructs a service from a service descriptor. - * @param {string} name Service name - * @param {IService} json Service descriptor - * @returns {Service} Created service - * @throws {TypeError} If arguments are invalid - */ -Service.fromJSON = function fromJSON(name, json) { - var service = new Service(name, json.options); - /* istanbul ignore else */ - if (json.methods) - for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i) - service.add(Method.fromJSON(names[i], json.methods[names[i]])); - if (json.nested) - service.addJSON(json.nested); - service.comment = json.comment; - return service; -}; - -/** - * Converts this service to a service descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IService} Service descriptor - */ -Service.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {}, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * Methods of this service as an array for iteration. - * @name Service#methodsArray - * @type {Method[]} - * @readonly - */ -Object.defineProperty(Service.prototype, "methodsArray", { - get: function() { - return this._methodsArray || (this._methodsArray = util.toArray(this.methods)); - } -}); - -function clearCache(service) { - service._methodsArray = null; - return service; -} - -/** - * @override - */ -Service.prototype.get = function get(name) { - return this.methods[name] - || Namespace.prototype.get.call(this, name); -}; - -/** - * @override - */ -Service.prototype.resolveAll = function resolveAll() { - var methods = this.methodsArray; - for (var i = 0; i < methods.length; ++i) - methods[i].resolve(); - return Namespace.prototype.resolve.call(this); -}; - -/** - * @override - */ -Service.prototype.add = function add(object) { - - /* istanbul ignore if */ - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Method) { - this.methods[object.name] = object; - object.parent = this; - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * @override - */ -Service.prototype.remove = function remove(object) { - if (object instanceof Method) { - - /* istanbul ignore if */ - if (this.methods[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.methods[object.name]; - object.parent = null; - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Creates a runtime service using the specified rpc implementation. - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed. - */ -Service.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) { - var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); - for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) { - var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, ""); - rpcService[methodName] = util.codegen(["r","c"], util.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ - m: method, - q: method.resolvedRequestType.ctor, - s: method.resolvedResponseType.ctor - }); - } - return rpcService; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/tokenize.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/tokenize.js deleted file mode 100644 index bfb784bd2..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/tokenize.js +++ /dev/null @@ -1,418 +0,0 @@ -"use strict"; -module.exports = tokenize; - -var delimRe = /[\s{}=;:[\],'"()<>]/g, - stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, - stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; - -var setCommentRe = /^ *[*/]+ */, - setCommentAltRe = /^\s*\*?\/*/, - setCommentSplitRe = /\n/g, - whitespaceRe = /\s/, - unescapeRe = /\\(.?)/g; - -var unescapeMap = { - "0": "\0", - "r": "\r", - "n": "\n", - "t": "\t" -}; - -/** - * Unescapes a string. - * @param {string} str String to unescape - * @returns {string} Unescaped string - * @property {Object.} map Special characters map - * @memberof tokenize - */ -function unescape(str) { - return str.replace(unescapeRe, function($0, $1) { - switch ($1) { - case "\\": - case "": - return $1; - default: - return unescapeMap[$1] || ""; - } - }); -} - -tokenize.unescape = unescape; - -/** - * Gets the next token and advances. - * @typedef TokenizerHandleNext - * @type {function} - * @returns {string|null} Next token or `null` on eof - */ - -/** - * Peeks for the next token. - * @typedef TokenizerHandlePeek - * @type {function} - * @returns {string|null} Next token or `null` on eof - */ - -/** - * Pushes a token back to the stack. - * @typedef TokenizerHandlePush - * @type {function} - * @param {string} token Token - * @returns {undefined} - */ - -/** - * Skips the next token. - * @typedef TokenizerHandleSkip - * @type {function} - * @param {string} expected Expected token - * @param {boolean} [optional=false] If optional - * @returns {boolean} Whether the token matched - * @throws {Error} If the token didn't match and is not optional - */ - -/** - * Gets the comment on the previous line or, alternatively, the line comment on the specified line. - * @typedef TokenizerHandleCmnt - * @type {function} - * @param {number} [line] Line number - * @returns {string|null} Comment text or `null` if none - */ - -/** - * Handle object returned from {@link tokenize}. - * @interface ITokenizerHandle - * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof) - * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof) - * @property {TokenizerHandlePush} push Pushes a token back to the stack - * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws - * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any - * @property {number} line Current line number - */ - -/** - * Tokenizes the given .proto source and returns an object with useful utility functions. - * @param {string} source Source contents - * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode. - * @returns {ITokenizerHandle} Tokenizer handle - */ -function tokenize(source, alternateCommentMode) { - /* eslint-disable callback-return */ - source = source.toString(); - - var offset = 0, - length = source.length, - line = 1, - lastCommentLine = 0, - comments = {}; - - var stack = []; - - var stringDelim = null; - - /* istanbul ignore next */ - /** - * Creates an error for illegal syntax. - * @param {string} subject Subject - * @returns {Error} Error created - * @inner - */ - function illegal(subject) { - return Error("illegal " + subject + " (line " + line + ")"); - } - - /** - * Reads a string till its end. - * @returns {string} String read - * @inner - */ - function readString() { - var re = stringDelim === "'" ? stringSingleRe : stringDoubleRe; - re.lastIndex = offset - 1; - var match = re.exec(source); - if (!match) - throw illegal("string"); - offset = re.lastIndex; - push(stringDelim); - stringDelim = null; - return unescape(match[1]); - } - - /** - * Gets the character at `pos` within the source. - * @param {number} pos Position - * @returns {string} Character - * @inner - */ - function charAt(pos) { - return source.charAt(pos); - } - - /** - * Sets the current comment text. - * @param {number} start Start offset - * @param {number} end End offset - * @param {boolean} isLeading set if a leading comment - * @returns {undefined} - * @inner - */ - function setComment(start, end, isLeading) { - var comment = { - type: source.charAt(start++), - lineEmpty: false, - leading: isLeading, - }; - var lookback; - if (alternateCommentMode) { - lookback = 2; // alternate comment parsing: "//" or "/*" - } else { - lookback = 3; // "///" or "/**" - } - var commentOffset = start - lookback, - c; - do { - if (--commentOffset < 0 || - (c = source.charAt(commentOffset)) === "\n") { - comment.lineEmpty = true; - break; - } - } while (c === " " || c === "\t"); - var lines = source - .substring(start, end) - .split(setCommentSplitRe); - for (var i = 0; i < lines.length; ++i) - lines[i] = lines[i] - .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "") - .trim(); - comment.text = lines - .join("\n") - .trim(); - - comments[line] = comment; - lastCommentLine = line; - } - - function isDoubleSlashCommentLine(startOffset) { - var endOffset = findEndOfLine(startOffset); - - // see if remaining line matches comment pattern - var lineText = source.substring(startOffset, endOffset); - // look for 1 or 2 slashes since startOffset would already point past - // the first slash that started the comment. - var isComment = /^\s*\/{1,2}/.test(lineText); - return isComment; - } - - function findEndOfLine(cursor) { - // find end of cursor's line - var endOffset = cursor; - while (endOffset < length && charAt(endOffset) !== "\n") { - endOffset++; - } - return endOffset; - } - - /** - * Obtains the next token. - * @returns {string|null} Next token or `null` on eof - * @inner - */ - function next() { - if (stack.length > 0) - return stack.shift(); - if (stringDelim) - return readString(); - var repeat, - prev, - curr, - start, - isDoc, - isLeadingComment = offset === 0; - do { - if (offset === length) - return null; - repeat = false; - while (whitespaceRe.test(curr = charAt(offset))) { - if (curr === "\n") { - isLeadingComment = true; - ++line; - } - if (++offset === length) - return null; - } - - if (charAt(offset) === "/") { - if (++offset === length) { - throw illegal("comment"); - } - if (charAt(offset) === "/") { // Line - if (!alternateCommentMode) { - // check for triple-slash comment - isDoc = charAt(start = offset + 1) === "/"; - - while (charAt(++offset) !== "\n") { - if (offset === length) { - return null; - } - } - ++offset; - if (isDoc) { - setComment(start, offset - 1, isLeadingComment); - // Trailing comment cannot not be multi-line, - // so leading comment state should be reset to handle potential next comments - isLeadingComment = true; - } - ++line; - repeat = true; - } else { - // check for double-slash comments, consolidating consecutive lines - start = offset; - isDoc = false; - if (isDoubleSlashCommentLine(offset)) { - isDoc = true; - do { - offset = findEndOfLine(offset); - if (offset === length) { - break; - } - offset++; - if (!isLeadingComment) { - // Trailing comment cannot not be multi-line - break; - } - } while (isDoubleSlashCommentLine(offset)); - } else { - offset = Math.min(length, findEndOfLine(offset) + 1); - } - if (isDoc) { - setComment(start, offset, isLeadingComment); - isLeadingComment = true; - } - line++; - repeat = true; - } - } else if ((curr = charAt(offset)) === "*") { /* Block */ - // check for /** (regular comment mode) or /* (alternate comment mode) - start = offset + 1; - isDoc = alternateCommentMode || charAt(start) === "*"; - do { - if (curr === "\n") { - ++line; - } - if (++offset === length) { - throw illegal("comment"); - } - prev = curr; - curr = charAt(offset); - } while (prev !== "*" || curr !== "/"); - ++offset; - if (isDoc) { - setComment(start, offset - 2, isLeadingComment); - isLeadingComment = true; - } - repeat = true; - } else { - return "/"; - } - } - } while (repeat); - - // offset !== length if we got here - - var end = offset; - delimRe.lastIndex = 0; - var delim = delimRe.test(charAt(end++)); - if (!delim) - while (end < length && !delimRe.test(charAt(end))) - ++end; - var token = source.substring(offset, offset = end); - if (token === "\"" || token === "'") - stringDelim = token; - return token; - } - - /** - * Pushes a token back to the stack. - * @param {string} token Token - * @returns {undefined} - * @inner - */ - function push(token) { - stack.push(token); - } - - /** - * Peeks for the next token. - * @returns {string|null} Token or `null` on eof - * @inner - */ - function peek() { - if (!stack.length) { - var token = next(); - if (token === null) - return null; - push(token); - } - return stack[0]; - } - - /** - * Skips a token. - * @param {string} expected Expected token - * @param {boolean} [optional=false] Whether the token is optional - * @returns {boolean} `true` when skipped, `false` if not - * @throws {Error} When a required token is not present - * @inner - */ - function skip(expected, optional) { - var actual = peek(), - equals = actual === expected; - if (equals) { - next(); - return true; - } - if (!optional) - throw illegal("token '" + actual + "', '" + expected + "' expected"); - return false; - } - - /** - * Gets a comment. - * @param {number} [trailingLine] Line number if looking for a trailing comment - * @returns {string|null} Comment text - * @inner - */ - function cmnt(trailingLine) { - var ret = null; - var comment; - if (trailingLine === undefined) { - comment = comments[line - 1]; - delete comments[line - 1]; - if (comment && (alternateCommentMode || comment.type === "*" || comment.lineEmpty)) { - ret = comment.leading ? comment.text : null; - } - } else { - /* istanbul ignore else */ - if (lastCommentLine < trailingLine) { - peek(); - } - comment = comments[trailingLine]; - delete comments[trailingLine]; - if (comment && !comment.lineEmpty && (alternateCommentMode || comment.type === "/")) { - ret = comment.leading ? null : comment.text; - } - } - return ret; - } - - return Object.defineProperty({ - next: next, - peek: peek, - push: push, - skip: skip, - cmnt: cmnt - }, "line", { - get: function() { return line; } - }); - /* eslint-enable callback-return */ -} diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/type.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/type.js deleted file mode 100644 index 2e7bda49b..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/type.js +++ /dev/null @@ -1,589 +0,0 @@ -"use strict"; -module.exports = Type; - -// extends Namespace -var Namespace = require("./namespace"); -((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type"; - -var Enum = require("./enum"), - OneOf = require("./oneof"), - Field = require("./field"), - MapField = require("./mapfield"), - Service = require("./service"), - Message = require("./message"), - Reader = require("./reader"), - Writer = require("./writer"), - util = require("./util"), - encoder = require("./encoder"), - decoder = require("./decoder"), - verifier = require("./verifier"), - converter = require("./converter"), - wrappers = require("./wrappers"); - -/** - * Constructs a new reflected message type instance. - * @classdesc Reflected message type. - * @extends NamespaceBase - * @constructor - * @param {string} name Message name - * @param {Object.} [options] Declared options - */ -function Type(name, options) { - Namespace.call(this, name, options); - - /** - * Message fields. - * @type {Object.} - */ - this.fields = {}; // toJSON, marker - - /** - * Oneofs declared within this namespace, if any. - * @type {Object.} - */ - this.oneofs = undefined; // toJSON - - /** - * Extension ranges, if any. - * @type {number[][]} - */ - this.extensions = undefined; // toJSON - - /** - * Reserved ranges, if any. - * @type {Array.} - */ - this.reserved = undefined; // toJSON - - /*? - * Whether this type is a legacy group. - * @type {boolean|undefined} - */ - this.group = undefined; // toJSON - - /** - * Cached fields by id. - * @type {Object.|null} - * @private - */ - this._fieldsById = null; - - /** - * Cached fields as an array. - * @type {Field[]|null} - * @private - */ - this._fieldsArray = null; - - /** - * Cached oneofs as an array. - * @type {OneOf[]|null} - * @private - */ - this._oneofsArray = null; - - /** - * Cached constructor. - * @type {Constructor<{}>} - * @private - */ - this._ctor = null; -} - -Object.defineProperties(Type.prototype, { - - /** - * Message fields by id. - * @name Type#fieldsById - * @type {Object.} - * @readonly - */ - fieldsById: { - get: function() { - - /* istanbul ignore if */ - if (this._fieldsById) - return this._fieldsById; - - this._fieldsById = {}; - for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) { - var field = this.fields[names[i]], - id = field.id; - - /* istanbul ignore if */ - if (this._fieldsById[id]) - throw Error("duplicate id " + id + " in " + this); - - this._fieldsById[id] = field; - } - return this._fieldsById; - } - }, - - /** - * Fields of this message as an array for iteration. - * @name Type#fieldsArray - * @type {Field[]} - * @readonly - */ - fieldsArray: { - get: function() { - return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields)); - } - }, - - /** - * Oneofs of this message as an array for iteration. - * @name Type#oneofsArray - * @type {OneOf[]} - * @readonly - */ - oneofsArray: { - get: function() { - return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs)); - } - }, - - /** - * The registered constructor, if any registered, otherwise a generic constructor. - * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. - * @name Type#ctor - * @type {Constructor<{}>} - */ - ctor: { - get: function() { - return this._ctor || (this.ctor = Type.generateConstructor(this)()); - }, - set: function(ctor) { - - // Ensure proper prototype - var prototype = ctor.prototype; - if (!(prototype instanceof Message)) { - (ctor.prototype = new Message()).constructor = ctor; - util.merge(ctor.prototype, prototype); - } - - // Classes and messages reference their reflected type - ctor.$type = ctor.prototype.$type = this; - - // Mix in static methods - util.merge(ctor, Message, true); - - this._ctor = ctor; - - // Messages have non-enumerable default values on their prototype - var i = 0; - for (; i < /* initializes */ this.fieldsArray.length; ++i) - this._fieldsArray[i].resolve(); // ensures a proper value - - // Messages have non-enumerable getters and setters for each virtual oneof field - var ctorProperties = {}; - for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i) - ctorProperties[this._oneofsArray[i].resolve().name] = { - get: util.oneOfGetter(this._oneofsArray[i].oneof), - set: util.oneOfSetter(this._oneofsArray[i].oneof) - }; - if (i) - Object.defineProperties(ctor.prototype, ctorProperties); - } - } -}); - -/** - * Generates a constructor function for the specified type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -Type.generateConstructor = function generateConstructor(mtype) { - /* eslint-disable no-unexpected-multiline */ - var gen = util.codegen(["p"], mtype.name); - // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype - for (var i = 0, field; i < mtype.fieldsArray.length; ++i) - if ((field = mtype._fieldsArray[i]).map) gen - ("this%s={}", util.safeProp(field.name)); - else if (field.repeated) gen - ("this%s=[]", util.safeProp(field.name)); - return gen - ("if(p)for(var ks=Object.keys(p),i=0;i} [oneofs] Oneof descriptors - * @property {Object.} fields Field descriptors - * @property {number[][]} [extensions] Extension ranges - * @property {number[][]} [reserved] Reserved ranges - * @property {boolean} [group=false] Whether a legacy group or not - */ - -/** - * Creates a message type from a message type descriptor. - * @param {string} name Message name - * @param {IType} json Message type descriptor - * @returns {Type} Created message type - */ -Type.fromJSON = function fromJSON(name, json) { - var type = new Type(name, json.options); - type.extensions = json.extensions; - type.reserved = json.reserved; - var names = Object.keys(json.fields), - i = 0; - for (; i < names.length; ++i) - type.add( - ( typeof json.fields[names[i]].keyType !== "undefined" - ? MapField.fromJSON - : Field.fromJSON )(names[i], json.fields[names[i]]) - ); - if (json.oneofs) - for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i) - type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]])); - if (json.nested) - for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) { - var nested = json.nested[names[i]]; - type.add( // most to least likely - ( nested.id !== undefined - ? Field.fromJSON - : nested.fields !== undefined - ? Type.fromJSON - : nested.values !== undefined - ? Enum.fromJSON - : nested.methods !== undefined - ? Service.fromJSON - : Namespace.fromJSON )(names[i], nested) - ); - } - if (json.extensions && json.extensions.length) - type.extensions = json.extensions; - if (json.reserved && json.reserved.length) - type.reserved = json.reserved; - if (json.group) - type.group = true; - if (json.comment) - type.comment = json.comment; - return type; -}; - -/** - * Converts this message type to a message type descriptor. - * @param {IToJSONOptions} [toJSONOptions] JSON conversion options - * @returns {IType} Message type descriptor - */ -Type.prototype.toJSON = function toJSON(toJSONOptions) { - var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); - var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; - return util.toObject([ - "options" , inherited && inherited.options || undefined, - "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions), - "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {}, - "extensions" , this.extensions && this.extensions.length ? this.extensions : undefined, - "reserved" , this.reserved && this.reserved.length ? this.reserved : undefined, - "group" , this.group || undefined, - "nested" , inherited && inherited.nested || undefined, - "comment" , keepComments ? this.comment : undefined - ]); -}; - -/** - * @override - */ -Type.prototype.resolveAll = function resolveAll() { - var fields = this.fieldsArray, i = 0; - while (i < fields.length) - fields[i++].resolve(); - var oneofs = this.oneofsArray; i = 0; - while (i < oneofs.length) - oneofs[i++].resolve(); - return Namespace.prototype.resolveAll.call(this); -}; - -/** - * @override - */ -Type.prototype.get = function get(name) { - return this.fields[name] - || this.oneofs && this.oneofs[name] - || this.nested && this.nested[name] - || null; -}; - -/** - * Adds a nested object to this type. - * @param {ReflectionObject} object Nested object to add - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id - */ -Type.prototype.add = function add(object) { - - if (this.get(object.name)) - throw Error("duplicate name '" + object.name + "' in " + this); - - if (object instanceof Field && object.extend === undefined) { - // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects. - // The root object takes care of adding distinct sister-fields to the respective extended - // type instead. - - // avoids calling the getter if not absolutely necessary because it's called quite frequently - if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id]) - throw Error("duplicate id " + object.id + " in " + this); - if (this.isReservedId(object.id)) - throw Error("id " + object.id + " is reserved in " + this); - if (this.isReservedName(object.name)) - throw Error("name '" + object.name + "' is reserved in " + this); - - if (object.parent) - object.parent.remove(object); - this.fields[object.name] = object; - object.message = this; - object.onAdd(this); - return clearCache(this); - } - if (object instanceof OneOf) { - if (!this.oneofs) - this.oneofs = {}; - this.oneofs[object.name] = object; - object.onAdd(this); - return clearCache(this); - } - return Namespace.prototype.add.call(this, object); -}; - -/** - * Removes a nested object from this type. - * @param {ReflectionObject} object Nested object to remove - * @returns {Type} `this` - * @throws {TypeError} If arguments are invalid - * @throws {Error} If `object` is not a member of this type - */ -Type.prototype.remove = function remove(object) { - if (object instanceof Field && object.extend === undefined) { - // See Type#add for the reason why extension fields are excluded here. - - /* istanbul ignore if */ - if (!this.fields || this.fields[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.fields[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - if (object instanceof OneOf) { - - /* istanbul ignore if */ - if (!this.oneofs || this.oneofs[object.name] !== object) - throw Error(object + " is not a member of " + this); - - delete this.oneofs[object.name]; - object.parent = null; - object.onRemove(this); - return clearCache(this); - } - return Namespace.prototype.remove.call(this, object); -}; - -/** - * Tests if the specified id is reserved. - * @param {number} id Id to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedId = function isReservedId(id) { - return Namespace.isReservedId(this.reserved, id); -}; - -/** - * Tests if the specified name is reserved. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -Type.prototype.isReservedName = function isReservedName(name) { - return Namespace.isReservedName(this.reserved, name); -}; - -/** - * Creates a new message of this type using the specified properties. - * @param {Object.} [properties] Properties to set - * @returns {Message<{}>} Message instance - */ -Type.prototype.create = function create(properties) { - return new this.ctor(properties); -}; - -/** - * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}. - * @returns {Type} `this` - */ -Type.prototype.setup = function setup() { - // Sets up everything at once so that the prototype chain does not have to be re-evaluated - // multiple times (V8, soft-deopt prototype-check). - - var fullName = this.fullName, - types = []; - for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i) - types.push(this._fieldsArray[i].resolve().resolvedType); - - // Replace setup methods with type-specific generated functions - this.encode = encoder(this)({ - Writer : Writer, - types : types, - util : util - }); - this.decode = decoder(this)({ - Reader : Reader, - types : types, - util : util - }); - this.verify = verifier(this)({ - types : types, - util : util - }); - this.fromObject = converter.fromObject(this)({ - types : types, - util : util - }); - this.toObject = converter.toObject(this)({ - types : types, - util : util - }); - - // Inject custom wrappers for common types - var wrapper = wrappers[fullName]; - if (wrapper) { - var originalThis = Object.create(this); - // if (wrapper.fromObject) { - originalThis.fromObject = this.fromObject; - this.fromObject = wrapper.fromObject.bind(originalThis); - // } - // if (wrapper.toObject) { - originalThis.toObject = this.toObject; - this.toObject = wrapper.toObject.bind(originalThis); - // } - } - - return this; -}; - -/** - * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encode = function encode_setup(message, writer) { - return this.setup().encode(message, writer); // overrides this method -}; - -/** - * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages. - * @param {Message<{}>|Object.} message Message instance or plain object - * @param {Writer} [writer] Writer to encode to - * @returns {Writer} writer - */ -Type.prototype.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); -}; - -/** - * Decodes a message of this type. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Length of the message, if known beforehand - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError<{}>} If required fields are missing - */ -Type.prototype.decode = function decode_setup(reader, length) { - return this.setup().decode(reader, length); // overrides this method -}; - -/** - * Decodes a message of this type preceeded by its byte length as a varint. - * @param {Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Message<{}>} Decoded message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {util.ProtocolError} If required fields are missing - */ -Type.prototype.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof Reader)) - reader = Reader.create(reader); - return this.decode(reader, reader.uint32()); -}; - -/** - * Verifies that field values are valid and that required fields are present. - * @param {Object.} message Plain object to verify - * @returns {null|string} `null` if valid, otherwise the reason why it is not - */ -Type.prototype.verify = function verify_setup(message) { - return this.setup().verify(message); // overrides this method -}; - -/** - * Creates a new message of this type from a plain object. Also converts values to their respective internal types. - * @param {Object.} object Plain object to convert - * @returns {Message<{}>} Message instance - */ -Type.prototype.fromObject = function fromObject(object) { - return this.setup().fromObject(object); -}; - -/** - * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. - * @interface IConversionOptions - * @property {Function} [longs] Long conversion type. - * Valid values are `String` and `Number` (the global types). - * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library. - * @property {Function} [enums] Enum value conversion type. - * Only valid value is `String` (the global type). - * Defaults to copy the present value, which is the numeric id. - * @property {Function} [bytes] Bytes value conversion type. - * Valid values are `Array` and (a base64 encoded) `String` (the global types). - * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser. - * @property {boolean} [defaults=false] Also sets default values on the resulting object - * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false` - * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false` - * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any - * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings - */ - -/** - * Creates a plain object from a message of this type. Also converts values to other types if specified. - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ -Type.prototype.toObject = function toObject(message, options) { - return this.setup().toObject(message, options); -}; - -/** - * Decorator function as returned by {@link Type.d} (TypeScript). - * @typedef TypeDecorator - * @type {function} - * @param {Constructor} target Target constructor - * @returns {undefined} - * @template T extends Message - */ - -/** - * Type decorator (TypeScript). - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {TypeDecorator} Decorator function - * @template T extends Message - */ -Type.d = function decorateType(typeName) { - return function typeDecorator(target) { - util.decorateType(target, typeName); - }; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/types.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/types.js deleted file mode 100644 index 5fda19a69..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/types.js +++ /dev/null @@ -1,196 +0,0 @@ -"use strict"; - -/** - * Common type constants. - * @namespace - */ -var types = exports; - -var util = require("./util"); - -var s = [ - "double", // 0 - "float", // 1 - "int32", // 2 - "uint32", // 3 - "sint32", // 4 - "fixed32", // 5 - "sfixed32", // 6 - "int64", // 7 - "uint64", // 8 - "sint64", // 9 - "fixed64", // 10 - "sfixed64", // 11 - "bool", // 12 - "string", // 13 - "bytes" // 14 -]; - -function bake(values, offset) { - var i = 0, o = {}; - offset |= 0; - while (i < values.length) o[s[i + offset]] = values[i++]; - return o; -} - -/** - * Basic type wire types. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - * @property {number} bytes=2 Ldelim wire type - */ -types.basic = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2, - /* bytes */ 2 -]); - -/** - * Basic type defaults. - * @type {Object.} - * @const - * @property {number} double=0 Double default - * @property {number} float=0 Float default - * @property {number} int32=0 Int32 default - * @property {number} uint32=0 Uint32 default - * @property {number} sint32=0 Sint32 default - * @property {number} fixed32=0 Fixed32 default - * @property {number} sfixed32=0 Sfixed32 default - * @property {number} int64=0 Int64 default - * @property {number} uint64=0 Uint64 default - * @property {number} sint64=0 Sint32 default - * @property {number} fixed64=0 Fixed64 default - * @property {number} sfixed64=0 Sfixed64 default - * @property {boolean} bool=false Bool default - * @property {string} string="" String default - * @property {Array.} bytes=Array(0) Bytes default - * @property {null} message=null Message default - */ -types.defaults = bake([ - /* double */ 0, - /* float */ 0, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 0, - /* sfixed32 */ 0, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 0, - /* sfixed64 */ 0, - /* bool */ false, - /* string */ "", - /* bytes */ util.emptyArray, - /* message */ null -]); - -/** - * Basic long type wire types. - * @type {Object.} - * @const - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - */ -types.long = bake([ - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1 -], 7); - -/** - * Allowed types for map keys with their associated wire type. - * @type {Object.} - * @const - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - * @property {number} string=2 Ldelim wire type - */ -types.mapKey = bake([ - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0, - /* string */ 2 -], 2); - -/** - * Allowed types for packed repeated fields with their associated wire type. - * @type {Object.} - * @const - * @property {number} double=1 Fixed64 wire type - * @property {number} float=5 Fixed32 wire type - * @property {number} int32=0 Varint wire type - * @property {number} uint32=0 Varint wire type - * @property {number} sint32=0 Varint wire type - * @property {number} fixed32=5 Fixed32 wire type - * @property {number} sfixed32=5 Fixed32 wire type - * @property {number} int64=0 Varint wire type - * @property {number} uint64=0 Varint wire type - * @property {number} sint64=0 Varint wire type - * @property {number} fixed64=1 Fixed64 wire type - * @property {number} sfixed64=1 Fixed64 wire type - * @property {number} bool=0 Varint wire type - */ -types.packed = bake([ - /* double */ 1, - /* float */ 5, - /* int32 */ 0, - /* uint32 */ 0, - /* sint32 */ 0, - /* fixed32 */ 5, - /* sfixed32 */ 5, - /* int64 */ 0, - /* uint64 */ 0, - /* sint64 */ 0, - /* fixed64 */ 1, - /* sfixed64 */ 1, - /* bool */ 0 -]); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/typescript.jsdoc b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/typescript.jsdoc deleted file mode 100644 index 9a6710169..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/typescript.jsdoc +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Constructor type. - * @interface Constructor - * @extends Function - * @template T - * @tstype new(...params: any[]): T; prototype: T; - */ - -/** - * Properties type. - * @typedef Properties - * @template T - * @type {Object.} - * @tstype { [P in keyof T]?: T[P] } - */ diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util.js deleted file mode 100644 index c39d33a6a..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util.js +++ /dev/null @@ -1,212 +0,0 @@ -"use strict"; - -/** - * Various utility functions. - * @namespace - */ -var util = module.exports = require("./util/minimal"); - -var roots = require("./roots"); - -var Type, // cyclic - Enum; - -util.codegen = require("@protobufjs/codegen"); -util.fetch = require("@protobufjs/fetch"); -util.path = require("@protobufjs/path"); - -/** - * Node's fs module if available. - * @type {Object.} - */ -util.fs = util.inquire("fs"); - -/** - * Converts an object's values to an array. - * @param {Object.} object Object to convert - * @returns {Array.<*>} Converted array - */ -util.toArray = function toArray(object) { - if (object) { - var keys = Object.keys(object), - array = new Array(keys.length), - index = 0; - while (index < keys.length) - array[index] = object[keys[index++]]; - return array; - } - return []; -}; - -/** - * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values. - * @param {Array.<*>} array Array to convert - * @returns {Object.} Converted object - */ -util.toObject = function toObject(array) { - var object = {}, - index = 0; - while (index < array.length) { - var key = array[index++], - val = array[index++]; - if (val !== undefined) - object[key] = val; - } - return object; -}; - -var safePropBackslashRe = /\\/g, - safePropQuoteRe = /"/g; - -/** - * Tests whether the specified name is a reserved word in JS. - * @param {string} name Name to test - * @returns {boolean} `true` if reserved, otherwise `false` - */ -util.isReserved = function isReserved(name) { - return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name); -}; - -/** - * Returns a safe property accessor for the specified property name. - * @param {string} prop Property name - * @returns {string} Safe accessor - */ -util.safeProp = function safeProp(prop) { - if (!/^[$\w_]+$/.test(prop) || util.isReserved(prop)) - return "[\"" + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, "\\\"") + "\"]"; - return "." + prop; -}; - -/** - * Converts the first character of a string to upper case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.ucFirst = function ucFirst(str) { - return str.charAt(0).toUpperCase() + str.substring(1); -}; - -var camelCaseRe = /_([a-z])/g; - -/** - * Converts a string to camel case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.camelCase = function camelCase(str) { - return str.substring(0, 1) - + str.substring(1) - .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); }); -}; - -/** - * Compares reflected fields by id. - * @param {Field} a First field - * @param {Field} b Second field - * @returns {number} Comparison value - */ -util.compareFieldsById = function compareFieldsById(a, b) { - return a.id - b.id; -}; - -/** - * Decorator helper for types (TypeScript). - * @param {Constructor} ctor Constructor function - * @param {string} [typeName] Type name, defaults to the constructor's name - * @returns {Type} Reflected type - * @template T extends Message - * @property {Root} root Decorators root - */ -util.decorateType = function decorateType(ctor, typeName) { - - /* istanbul ignore if */ - if (ctor.$type) { - if (typeName && ctor.$type.name !== typeName) { - util.decorateRoot.remove(ctor.$type); - ctor.$type.name = typeName; - util.decorateRoot.add(ctor.$type); - } - return ctor.$type; - } - - /* istanbul ignore next */ - if (!Type) - Type = require("./type"); - - var type = new Type(typeName || ctor.name); - util.decorateRoot.add(type); - type.ctor = ctor; // sets up .encode, .decode etc. - Object.defineProperty(ctor, "$type", { value: type, enumerable: false }); - Object.defineProperty(ctor.prototype, "$type", { value: type, enumerable: false }); - return type; -}; - -var decorateEnumIndex = 0; - -/** - * Decorator helper for enums (TypeScript). - * @param {Object} object Enum object - * @returns {Enum} Reflected enum - */ -util.decorateEnum = function decorateEnum(object) { - - /* istanbul ignore if */ - if (object.$type) - return object.$type; - - /* istanbul ignore next */ - if (!Enum) - Enum = require("./enum"); - - var enm = new Enum("Enum" + decorateEnumIndex++, object); - util.decorateRoot.add(enm); - Object.defineProperty(object, "$type", { value: enm, enumerable: false }); - return enm; -}; - - -/** - * Sets the value of a property by property path. If a value already exists, it is turned to an array - * @param {Object.} dst Destination object - * @param {string} path dot '.' delimited path of the property to set - * @param {Object} value the value to set - * @returns {Object.} Destination object - */ -util.setProperty = function setProperty(dst, path, value) { - function setProp(dst, path, value) { - var part = path.shift(); - if (part === "__proto__") { - return dst; - } - if (path.length > 0) { - dst[part] = setProp(dst[part] || {}, path, value); - } else { - var prevValue = dst[part]; - if (prevValue) - value = [].concat(prevValue).concat(value); - dst[part] = value; - } - return dst; - } - - if (typeof dst !== "object") - throw TypeError("dst must be an object"); - if (!path) - throw TypeError("path must be specified"); - - path = path.split("."); - return setProp(dst, path, value); -}; - -/** - * Decorator root (TypeScript). - * @name util.decorateRoot - * @type {Root} - * @readonly - */ -Object.defineProperty(util, "decorateRoot", { - get: function() { - return roots["decorated"] || (roots["decorated"] = new (require("./root"))()); - } -}); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util/longbits.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util/longbits.js deleted file mode 100644 index 11bfb1c00..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util/longbits.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; -module.exports = LongBits; - -var util = require("../util/minimal"); - -/** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ -function LongBits(lo, hi) { - - // note that the casts below are theoretically unnecessary as of today, but older statically - // generated converter code might still call the ctor with signed 32bits. kept for compat. - - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; -} - -/** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ -var zero = LongBits.zero = new LongBits(0, 0); - -zero.toNumber = function() { return 0; }; -zero.zzEncode = zero.zzDecode = function() { return this; }; -zero.length = function() { return 1; }; - -/** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ -var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - -/** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ -LongBits.fromNumber = function fromNumber(value) { - if (value === 0) - return zero; - var sign = value < 0; - if (sign) - value = -value; - var lo = value >>> 0, - hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) - hi = 0; - } - } - return new LongBits(lo, hi); -}; - -/** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ -LongBits.from = function from(value) { - if (typeof value === "number") - return LongBits.fromNumber(value); - if (util.isString(value)) { - /* istanbul ignore else */ - if (util.Long) - value = util.Long.fromString(value); - else - return LongBits.fromNumber(parseInt(value, 10)); - } - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; -}; - -/** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ -LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, - hi = ~this.hi >>> 0; - if (!lo) - hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; -}; - -/** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ -LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long - ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) - /* istanbul ignore next */ - : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; -}; - -var charCodeAt = String.prototype.charCodeAt; - -/** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ -LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) - return zero; - return new LongBits( - ( charCodeAt.call(hash, 0) - | charCodeAt.call(hash, 1) << 8 - | charCodeAt.call(hash, 2) << 16 - | charCodeAt.call(hash, 3) << 24) >>> 0 - , - ( charCodeAt.call(hash, 4) - | charCodeAt.call(hash, 5) << 8 - | charCodeAt.call(hash, 6) << 16 - | charCodeAt.call(hash, 7) << 24) >>> 0 - ); -}; - -/** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ -LongBits.prototype.toHash = function toHash() { - return String.fromCharCode( - this.lo & 255, - this.lo >>> 8 & 255, - this.lo >>> 16 & 255, - this.lo >>> 24 , - this.hi & 255, - this.hi >>> 8 & 255, - this.hi >>> 16 & 255, - this.hi >>> 24 - ); -}; - -/** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = ( this.lo << 1 ^ mask) >>> 0; - return this; -}; - -/** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ -LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = ( this.hi >>> 1 ^ mask) >>> 0; - return this; -}; - -/** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ -LongBits.prototype.length = function length() { - var part0 = this.lo, - part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, - part2 = this.hi >>> 24; - return part2 === 0 - ? part1 === 0 - ? part0 < 16384 - ? part0 < 128 ? 1 : 2 - : part0 < 2097152 ? 3 : 4 - : part1 < 16384 - ? part1 < 128 ? 5 : 6 - : part1 < 2097152 ? 7 : 8 - : part2 < 128 ? 9 : 10; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util/minimal.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util/minimal.js deleted file mode 100644 index 62d683326..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/util/minimal.js +++ /dev/null @@ -1,438 +0,0 @@ -"use strict"; -var util = exports; - -// used to return a Promise where callback is omitted -util.asPromise = require("@protobufjs/aspromise"); - -// converts to / from base64 encoded strings -util.base64 = require("@protobufjs/base64"); - -// base class of rpc.Service -util.EventEmitter = require("@protobufjs/eventemitter"); - -// float handling accross browsers -util.float = require("@protobufjs/float"); - -// requires modules optionally and hides the call from bundlers -util.inquire = require("@protobufjs/inquire"); - -// converts to / from utf8 encoded strings -util.utf8 = require("@protobufjs/utf8"); - -// provides a node-like buffer pool in the browser -util.pool = require("@protobufjs/pool"); - -// utility to work with the low and high bits of a 64 bit value -util.LongBits = require("./longbits"); - -/** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ -util.isNode = Boolean(typeof global !== "undefined" - && global - && global.process - && global.process.versions - && global.process.versions.node); - -/** - * Global object reference. - * @memberof util - * @type {Object} - */ -util.global = util.isNode && global - || typeof window !== "undefined" && window - || typeof self !== "undefined" && self - || this; // eslint-disable-line no-invalid-this - -/** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ -util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes - -/** - * An immutable empty object. - * @type {Object} - * @const - */ -util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes - -/** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ -util.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; -}; - -/** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ -util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; -}; - -/** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ -util.isObject = function isObject(value) { - return value && typeof value === "object"; -}; - -/** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isset = - -/** - * Checks if a property on a message is considered to be present. - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ -util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins - return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; -}; - -/** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - -/** - * Node's Buffer class if available. - * @type {Constructor} - */ -util.Buffer = (function() { - try { - var Buffer = util.inquire("buffer").Buffer; - // refuse to use non-node buffers if not explicitly assigned (perf reasons): - return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null; - } catch (e) { - /* istanbul ignore next */ - return null; - } -})(); - -// Internal alias of or polyfull for Buffer.from. -util._Buffer_from = null; - -// Internal alias of or polyfill for Buffer.allocUnsafe. -util._Buffer_allocUnsafe = null; - -/** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ -util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" - ? util.Buffer - ? util._Buffer_allocUnsafe(sizeOrArray) - : new util.Array(sizeOrArray) - : util.Buffer - ? util._Buffer_from(sizeOrArray) - : typeof Uint8Array === "undefined" - ? sizeOrArray - : new Uint8Array(sizeOrArray); -}; - -/** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ -util.Array = typeof Uint8Array !== "undefined" ? Uint8Array /* istanbul ignore next */ : Array; - -/** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - -/** - * Long.js's Long class if available. - * @type {Constructor} - */ -util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long - || /* istanbul ignore next */ util.global.Long - || util.inquire("long"); - -/** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ -util.key2Re = /^true|false|0|1$/; - -/** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - -/** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ -util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - -/** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ -util.longToHash = function longToHash(value) { - return value - ? util.LongBits.from(value).toHash() - : util.LongBits.zeroHash; -}; - -/** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ -util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) - return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); -}; - -/** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {Object.} src Source object - * @param {boolean} [ifNotSet=false] Merges only if the key is not already set - * @returns {Object.} Destination object - */ -function merge(dst, src, ifNotSet) { // used by converters - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) - if (dst[keys[i]] === undefined || !ifNotSet) - dst[keys[i]] = src[keys[i]]; - return dst; -} - -util.merge = merge; - -/** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ -util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); -}; - -/** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ -function newError(name) { - - function CustomError(message, properties) { - - if (!(this instanceof CustomError)) - return new CustomError(message, properties); - - // Error.call(this, message); - // ^ just returns a new error instance because the ctor can be called as a function - - Object.defineProperty(this, "message", { get: function() { return message; } }); - - /* istanbul ignore next */ - if (Error.captureStackTrace) // node - Error.captureStackTrace(this, CustomError); - else - Object.defineProperty(this, "stack", { value: new Error().stack || "" }); - - if (properties) - merge(this, properties); - } - - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true, - }, - name: { - get: function get() { return name; }, - set: undefined, - enumerable: false, - // configurable: false would accurately preserve the behavior of - // the original, but I'm guessing that was not intentional. - // For an actual error subclass, this property would - // be configurable. - configurable: true, - }, - toString: { - value: function value() { return this.name + ": " + this.message; }, - writable: true, - enumerable: false, - configurable: true, - }, - }); - - return CustomError; -} - -util.newError = newError; - -/** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ -util.ProtocolError = newError("ProtocolError"); - -/** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - -/** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - -/** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ -util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) - fieldMap[fieldNames[i]] = 1; - - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { // eslint-disable-line consistent-return - for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i) - if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null) - return keys[i]; - }; -}; - -/** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - -/** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ -util.oneOfSetter = function setOneOf(fieldNames) { - - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) - if (fieldNames[i] !== name) - delete this[fieldNames[i]]; - }; -}; - -/** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ -util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true -}; - -// Sets up buffer utility according to the environment (called in index-minimal) -util._configure = function() { - var Buffer = util.Buffer; - /* istanbul ignore if */ - if (!Buffer) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - // because node 4.x buffers are incompatible & immutable - // see: https://github.com/dcodeIO/protobuf.js/pull/665 - util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || - /* istanbul ignore next */ - function Buffer_from(value, encoding) { - return new Buffer(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer.allocUnsafe || - /* istanbul ignore next */ - function Buffer_allocUnsafe(size) { - return new Buffer(size); - }; -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/verifier.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/verifier.js deleted file mode 100644 index d58e27abe..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/verifier.js +++ /dev/null @@ -1,177 +0,0 @@ -"use strict"; -module.exports = verifier; - -var Enum = require("./enum"), - util = require("./util"); - -function invalid(field, expected) { - return field.name + ": " + expected + (field.repeated && expected !== "array" ? "[]" : field.map && expected !== "object" ? "{k:"+field.keyType+"}" : "") + " expected"; -} - -/** - * Generates a partial value verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {number} fieldIndex Field index - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyValue(gen, field, fieldIndex, ref) { - /* eslint-disable no-unexpected-multiline */ - if (field.resolvedType) { - if (field.resolvedType instanceof Enum) { gen - ("switch(%s){", ref) - ("default:") - ("return%j", invalid(field, "enum value")); - for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen - ("case %i:", field.resolvedType.values[keys[j]]); - gen - ("break") - ("}"); - } else { - gen - ("{") - ("var e=types[%i].verify(%s);", fieldIndex, ref) - ("if(e)") - ("return%j+e", field.name + ".") - ("}"); - } - } else { - switch (field.type) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.isInteger(%s))", ref) - ("return%j", invalid(field, "integer")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", ref, ref, ref, ref) - ("return%j", invalid(field, "integer|Long")); - break; - case "float": - case "double": gen - ("if(typeof %s!==\"number\")", ref) - ("return%j", invalid(field, "number")); - break; - case "bool": gen - ("if(typeof %s!==\"boolean\")", ref) - ("return%j", invalid(field, "boolean")); - break; - case "string": gen - ("if(!util.isString(%s))", ref) - ("return%j", invalid(field, "string")); - break; - case "bytes": gen - ("if(!(%s&&typeof %s.length===\"number\"||util.isString(%s)))", ref, ref, ref) - ("return%j", invalid(field, "buffer")); - break; - } - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a partial key verifier. - * @param {Codegen} gen Codegen instance - * @param {Field} field Reflected field - * @param {string} ref Variable reference - * @returns {Codegen} Codegen instance - * @ignore - */ -function genVerifyKey(gen, field, ref) { - /* eslint-disable no-unexpected-multiline */ - switch (field.keyType) { - case "int32": - case "uint32": - case "sint32": - case "fixed32": - case "sfixed32": gen - ("if(!util.key32Re.test(%s))", ref) - ("return%j", invalid(field, "integer key")); - break; - case "int64": - case "uint64": - case "sint64": - case "fixed64": - case "sfixed64": gen - ("if(!util.key64Re.test(%s))", ref) // see comment above: x is ok, d is not - ("return%j", invalid(field, "integer|Long key")); - break; - case "bool": gen - ("if(!util.key2Re.test(%s))", ref) - ("return%j", invalid(field, "boolean key")); - break; - } - return gen; - /* eslint-enable no-unexpected-multiline */ -} - -/** - * Generates a verifier specific to the specified message type. - * @param {Type} mtype Message type - * @returns {Codegen} Codegen instance - */ -function verifier(mtype) { - /* eslint-disable no-unexpected-multiline */ - - var gen = util.codegen(["m"], mtype.name + "$verify") - ("if(typeof m!==\"object\"||m===null)") - ("return%j", "object expected"); - var oneofs = mtype.oneofsArray, - seenFirstField = {}; - if (oneofs.length) gen - ("var p={}"); - - for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) { - var field = mtype._fieldsArray[i].resolve(), - ref = "m" + util.safeProp(field.name); - - if (field.optional) gen - ("if(%s!=null&&m.hasOwnProperty(%j)){", ref, field.name); // !== undefined && !== null - - // map fields - if (field.map) { gen - ("if(!util.isObject(%s))", ref) - ("return%j", invalid(field, "object")) - ("var k=Object.keys(%s)", ref) - ("for(var i=0;i} - * @const - */ -var wrappers = exports; - -var Message = require("./message"); - -/** - * From object converter part of an {@link IWrapper}. - * @typedef WrapperFromObjectConverter - * @type {function} - * @param {Object.} object Plain object - * @returns {Message<{}>} Message instance - * @this Type - */ - -/** - * To object converter part of an {@link IWrapper}. - * @typedef WrapperToObjectConverter - * @type {function} - * @param {Message<{}>} message Message instance - * @param {IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - * @this Type - */ - -/** - * Common type wrapper part of {@link wrappers}. - * @interface IWrapper - * @property {WrapperFromObjectConverter} [fromObject] From object converter - * @property {WrapperToObjectConverter} [toObject] To object converter - */ - -// Custom wrapper for Any -wrappers[".google.protobuf.Any"] = { - - fromObject: function(object) { - - // unwrap value type if mapped - if (object && object["@type"]) { - // Only use fully qualified type name after the last '/' - var name = object["@type"].substring(object["@type"].lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) { - // type_url does not accept leading "." - var type_url = object["@type"].charAt(0) === "." ? - object["@type"].slice(1) : object["@type"]; - // type_url prefix is optional, but path seperator is required - if (type_url.indexOf("/") === -1) { - type_url = "/" + type_url; - } - return this.create({ - type_url: type_url, - value: type.encode(type.fromObject(object)).finish() - }); - } - } - - return this.fromObject(object); - }, - - toObject: function(message, options) { - - // Default prefix - var googleApi = "type.googleapis.com/"; - var prefix = ""; - var name = ""; - - // decode value if requested and unmapped - if (options && options.json && message.type_url && message.value) { - // Only use fully qualified type name after the last '/' - name = message.type_url.substring(message.type_url.lastIndexOf("/") + 1); - // Separate the prefix used - prefix = message.type_url.substring(0, message.type_url.lastIndexOf("/") + 1); - var type = this.lookup(name); - /* istanbul ignore else */ - if (type) - message = type.decode(message.value); - } - - // wrap value if unmapped - if (!(message instanceof this.ctor) && message instanceof Message) { - var object = message.$type.toObject(message, options); - var messageName = message.$type.fullName[0] === "." ? - message.$type.fullName.slice(1) : message.$type.fullName; - // Default to type.googleapis.com prefix if no prefix is used - if (prefix === "") { - prefix = googleApi; - } - name = prefix + messageName; - object["@type"] = name; - return object; - } - - return this.toObject(message, options); - } -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/writer.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/writer.js deleted file mode 100644 index cc84a00e2..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/writer.js +++ /dev/null @@ -1,465 +0,0 @@ -"use strict"; -module.exports = Writer; - -var util = require("./util/minimal"); - -var BufferWriter; // cyclic - -var LongBits = util.LongBits, - base64 = util.base64, - utf8 = util.utf8; - -/** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ -function Op(fn, len, val) { - - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - - /** - * Value byte length. - * @type {number} - */ - this.len = len; - - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = undefined; - - /** - * Value to write. - * @type {*} - */ - this.val = val; // type varies -} - -/* istanbul ignore next */ -function noop() {} // eslint-disable-line no-empty-function - -/** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ -function State(writer) { - - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; -} - -/** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ -function Writer() { - - /** - * Current length. - * @type {number} - */ - this.len = 0; - - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - - // When a value is written, the writer calculates its byte length and puts it into a linked - // list of operations to perform when finish() is called. This both allows us to allocate - // buffers of the exact required size and reduces the amount of work we have to do compared - // to first calculating over objects and then encoding over objects. In our case, the encoding - // part is just a linked list walk calling operations with already prepared values. -} - -var create = function create() { - return util.Buffer - ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } - /* istanbul ignore next */ - : function create_array() { - return new Writer(); - }; -}; - -/** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ -Writer.create = create(); - -/** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ -Writer.alloc = function alloc(size) { - return new util.Array(size); -}; - -// Use Uint8Array buffer pool in the browser, just like node does with buffers -/* istanbul ignore else */ -if (util.Array !== Array) - Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - -/** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ -Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; -}; - -function writeByte(val, buf, pos) { - buf[pos] = val & 255; -} - -function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; -} - -/** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ -function VarintOp(len, val) { - this.len = len; - this.next = undefined; - this.val = val; -} - -VarintOp.prototype = Object.create(Op.prototype); -VarintOp.prototype.fn = writeVarint32; - -/** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.uint32 = function write_uint32(value) { - // here, the call to this.push has been inlined and a varint specific Op subclass is used. - // uint32 is by far the most frequently used operation and benefits significantly from this. - this.len += (this.tail = this.tail.next = new VarintOp( - (value = value >>> 0) - < 128 ? 1 - : value < 16384 ? 2 - : value < 2097152 ? 3 - : value < 268435456 ? 4 - : 5, - value)).len; - return this; -}; - -/** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.int32 = function write_int32(value) { - return value < 0 - ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec - : this.uint32(value); -}; - -/** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); -}; - -function writeVarint64(val, buf, pos) { - while (val.hi) { - buf[pos++] = val.lo & 127 | 128; - val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; - val.hi >>>= 7; - } - while (val.lo > 127) { - buf[pos++] = val.lo & 127 | 128; - val.lo = val.lo >>> 7; - } - buf[pos++] = val.lo; -} - -/** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.int64 = Writer.prototype.uint64; - -/** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); -}; - -/** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); -}; - -function writeFixed32(val, buf, pos) { - buf[pos ] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; -} - -/** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); -}; - -/** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.sfixed32 = Writer.prototype.fixed32; - -/** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); -}; - -/** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ -Writer.prototype.sfixed64 = Writer.prototype.fixed64; - -/** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); -}; - -/** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); -}; - -var writeBytes = util.Array.prototype.set - ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) - buf[pos + i] = val[i]; - }; - -/** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ -Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) - return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); -}; - -/** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ -Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len - ? this.uint32(len)._push(utf8.write, len, value) - : this._push(writeByte, 1, 0); -}; - -/** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ -Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; -}; - -/** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ -Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; -}; - -/** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ -Writer.prototype.ldelim = function ldelim() { - var head = this.head, - tail = this.tail, - len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; // skip noop - this.tail = tail; - this.len += len; - } - return this; -}; - -/** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ -Writer.prototype.finish = function finish() { - var head = this.head.next, // skip noop - buf = this.constructor.alloc(this.len), - pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - // this.head = this.tail = null; - return buf; -}; - -Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); -}; diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/writer_buffer.js b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/writer_buffer.js deleted file mode 100644 index 09a4a912a..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/src/writer_buffer.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -module.exports = BufferWriter; - -// extends Writer -var Writer = require("./writer"); -(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - -var util = require("./util/minimal"); - -/** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ -function BufferWriter() { - Writer.call(this); -} - -BufferWriter._configure = function () { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" - ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited) - // also works for plain array values - } - /* istanbul ignore next */ - : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) // Buffer values - val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) // plain array values - buf[pos++] = val[i++]; - }; -}; - - -/** - * @override - */ -BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) - value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) - this._push(BufferWriter.writeBytesBuffer, len, value); - return this; -}; - -function writeStringBuffer(val, buf, pos) { - if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions) - util.utf8.write(val, buf, pos); - else if (buf.utf8Write) - buf.utf8Write(val, pos); - else - buf.write(val, pos); -} - -/** - * @override - */ -BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) - this._push(writeStringBuffer, len, value); - return this; -}; - - -/** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - -BufferWriter._configure(); diff --git a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/tsconfig.json b/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/tsconfig.json deleted file mode 100644 index a0b3639c2..000000000 --- a/.yarn/unplugged/protobufjs-npm-7.2.3-c8e4e8bc20/node_modules/protobufjs/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "target": "ES5", - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "esModuleInterop": true, - } -} \ No newline at end of file diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/.ready b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/.ready deleted file mode 100644 index e69de29bb..000000000 diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/LICENSE b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/LICENSE deleted file mode 100644 index 6c4ce40d5..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) MapBox -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. -- Neither the name "MapBox" nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/README.md b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/README.md deleted file mode 100644 index db1200bbd..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# ⚙️ node-sqlite3 - -Asynchronous, non-blocking [SQLite3](https://sqlite.org/) bindings for [Node.js](http://nodejs.org/). - -[![Latest release](https://img.shields.io/github/release/TryGhost/node-sqlite3.svg)](https://www.npmjs.com/package/sqlite3) -![Build Status](https://github.com/TryGhost/node-sqlite3/workflows/CI/badge.svg?branch=master) -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3?ref=badge_shield) -[![N-API v3 Badge](https://img.shields.io/badge/N--API-v3-green.svg)](https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api) -[![N-API v6 Badge](https://img.shields.io/badge/N--API-v6-green.svg)](https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api) - -# Features - - - Straightforward query and parameter binding interface - - Full Buffer/Blob support - - Extensive [debugging support](https://github.com/tryghost/node-sqlite3/wiki/Debugging) - - [Query serialization](https://github.com/tryghost/node-sqlite3/wiki/Control-Flow) API - - [Extension support](https://github.com/TryGhost/node-sqlite3/wiki/API#databaseloadextensionpath-callback), including bundled support for the [json1 extension](https://www.sqlite.org/json1.html) - - Big test suite - - Written in modern C++ and tested for memory leaks - - Bundles SQLite v3.41.1, or you can build using a local SQLite - -# Installing - -You can use [`npm`](https://github.com/npm/cli) or [`yarn`](https://github.com/yarnpkg/yarn) to install `sqlite3`: - -* (recommended) Latest published package: -```bash -npm install sqlite3 -# or -yarn add sqlite3 -``` -* GitHub's `master` branch: `npm install https://github.com/tryghost/node-sqlite3/tarball/master` - -### Prebuilt binaries - -`sqlite3` v5+ was rewritten to use [Node-API](https://nodejs.org/api/n-api.html) so prebuilt binaries do not need to be built for specific Node versions. `sqlite3` currently builds for both Node-API v3 and v6. Check the [Node-API version matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix) to ensure your Node version supports one of these. The prebuilt binaries should be supported on Node v10+. - -The module uses [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) to download the prebuilt binary for your platform, if it exists. These binaries are hosted on GitHub Releases for `sqlite3` versions above 5.0.2, and they are hosted on S3 otherwise. The following targets are currently provided: - -Format: `napi-v{napi_build_version}-{platform}-{libc}-{arch}` - -* `napi-v3-darwin-unknown-arm64` -* `napi-v3-darwin-unknown-x64` -* `napi-v3-linux-glibc-arm64` -* `napi-v3-linux-glibc-x64` -* `napi-v3-linux-musl-arm64` -* `napi-v3-linux-musl-x64` -* `napi-v3-win32-unknown-ia32` -* `napi-v3-win32-unknown-x64` -* `napi-v6-darwin-unknown-arm64` -* `napi-v6-darwin-unknown-x64` -* `napi-v6-linux-glibc-arm64` -* `napi-v6-linux-glibc-x64` -* `napi-v6-linux-musl-arm64` -* `napi-v6-linux-musl-x64` -* `napi-v6-win32-unknown-ia32` -* `napi-v6-win32-unknown-x64` - -Unfortunately, [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) cannot differentiate between `armv6` and `armv7`, and instead uses `arm` as the `{arch}`. Until that is fixed, you will still need to install `sqlite3` from [source](#source-install). - -Support for other platforms and architectures may be added in the future if CI supports building on them. - -If your environment isn't supported, it'll use `node-gyp` to build SQLite but you will need to install a C++ compiler and linker. - -### Other ways to install - -It is also possible to make your own build of `sqlite3` from its source instead of its npm package ([See below.](#source-install)). - -The `sqlite3` module also works with [node-webkit](https://github.com/rogerwang/node-webkit) if node-webkit contains a supported version of Node.js engine. [(See below.)](#building-for-node-webkit) - -SQLite's [SQLCipher extension](https://github.com/sqlcipher/sqlcipher) is also supported. [(See below.)](#building-for-sqlcipher) - -# API - -See the [API documentation](https://github.com/TryGhost/node-sqlite3/wiki/API) in the wiki. - -# Usage - -**Note:** the module must be [installed](#installing) before use. - -``` js -const sqlite3 = require('sqlite3').verbose(); -const db = new sqlite3.Database(':memory:'); - -db.serialize(() => { - db.run("CREATE TABLE lorem (info TEXT)"); - - const stmt = db.prepare("INSERT INTO lorem VALUES (?)"); - for (let i = 0; i < 10; i++) { - stmt.run("Ipsum " + i); - } - stmt.finalize(); - - db.each("SELECT rowid AS id, info FROM lorem", (err, row) => { - console.log(row.id + ": " + row.info); - }); -}); - -db.close(); -``` - -## Source install - -To skip searching for pre-compiled binaries, and force a build from source, use - -```bash -npm install --build-from-source -``` - -The sqlite3 module depends only on libsqlite3. However, by default, an internal/bundled copy of sqlite will be built and statically linked, so an externally installed sqlite3 is not required. - -If you wish to install against an external sqlite then you need to pass the `--sqlite` argument to `npm` wrapper: - -```bash -npm install --build-from-source --sqlite=/usr/local -``` - -If building against an external sqlite3 make sure to have the development headers available. Mac OS X ships with these by default. If you don't have them installed, install the `-dev` package with your package manager, e.g. `apt-get install libsqlite3-dev` for Debian/Ubuntu. Make sure that you have at least `libsqlite3` >= 3.6. - -Note, if building against homebrew-installed sqlite on OS X you can do: - -```bash -npm install --build-from-source --sqlite=/usr/local/opt/sqlite/ -``` - -## Custom file header (magic) - -The default sqlite file header is "SQLite format 3". You can specify a different magic, though this will make standard tools and libraries unable to work with your files. - -```bash -npm install --build-from-source --sqlite_magic="MyCustomMagic15" -``` - -Note that the magic *must* be exactly 15 characters long (16 bytes including null terminator). - -## Building for node-webkit - -Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit). - -To build `sqlite3` for node-webkit: - -1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)* - -2. Build the module with the custom flags of `--runtime`, `--target_arch`, and `--target`: - -```bash -NODE_WEBKIT_VERSION="0.8.6" # see latest version at https://github.com/rogerwang/node-webkit#downloads -npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION) -``` - -This command internally calls out to [`node-pre-gyp`](https://github.com/mapbox/node-pre-gyp) which itself calls out to [`nw-gyp`](https://github.com/rogerwang/nw-gyp) when the `--runtime=node-webkit` option is passed. - -You can also run this command from within a `sqlite3` checkout: - -```bash -npm install --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION) -``` - -Remember the following: - -* You must provide the right `--target_arch` flag. `ia32` is needed to target 32bit node-webkit builds, while `x64` will target 64bit node-webkit builds (if available for your platform). - -* After the `sqlite3` package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa). - * For example, `npm test` of the node-webkit's package would fail. - -Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules)” article in the node-webkit's wiki for more details. - -## Building for SQLCipher - -For instructions on building SQLCipher, see [Building SQLCipher for Node.js](https://coolaj86.com/articles/building-sqlcipher-for-node-js-on-raspberry-pi-2/). Alternatively, you can install it with your local package manager. - -To run against SQLCipher, you need to compile `sqlite3` from source by passing build options like: - -```bash -npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/ - -node -e 'require("sqlite3")' -``` - -If your SQLCipher is installed in a custom location (if you compiled and installed it yourself), you'll need to set some environment variables: - -### On OS X with Homebrew - -Set the location where `brew` installed it: - -```bash -export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib" -export CPPFLAGS="-I`brew --prefix`/opt/sqlcipher/include/sqlcipher" -npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` - -node -e 'require("sqlite3")' -``` - -### On most Linuxes (including Raspberry Pi) - -Set the location where `make` installed it: - -```bash -export LDFLAGS="-L/usr/local/lib" -export CPPFLAGS="-I/usr/local/include -I/usr/local/include/sqlcipher" -export CXXFLAGS="$CPPFLAGS" -npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/local --verbose - -node -e 'require("sqlite3")' -``` - -### Custom builds and Electron - -Running `sqlite3` through [electron-rebuild](https://github.com/electron/electron-rebuild) does not preserve the SQLCipher extension, so some additional flags are needed to make this build Electron compatible. Your `npm install sqlite3 --build-from-source` command needs these additional flags (be sure to replace the target version with the current Electron version you are working with): - -```bash ---runtime=electron --target=18.2.1 --dist-url=https://electronjs.org/headers -``` - -In the case of MacOS with Homebrew, the command should look like the following: - -```bash -npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` --runtime=electron --target=18.2.1 --dist-url=https://electronjs.org/headers -``` - -# Testing - -```bash -npm test -``` - -# Contributors - -* [Daniel Lockyer](https://github.com/daniellockyer) -* [Konstantin Käfer](https://github.com/kkaefer) -* [Dane Springmeyer](https://github.com/springmeyer) -* [Will White](https://github.com/willwhite) -* [Orlando Vazquez](https://github.com/orlandov) -* [Artem Kustikov](https://github.com/artiz) -* [Eric Fredricksen](https://github.com/grumdrig) -* [John Wright](https://github.com/mrjjwright) -* [Ryan Dahl](https://github.com/ry) -* [Tom MacWright](https://github.com/tmcw) -* [Carter Thaxton](https://github.com/carter-thaxton) -* [Audrius Kažukauskas](https://github.com/audriusk) -* [Johannes Schauer](https://github.com/pyneo) -* [Mithgol](https://github.com/Mithgol) -* [Kewde](https://github.com/kewde) - -# Acknowledgments - -Thanks to [Orlando Vazquez](https://github.com/orlandov), -[Eric Fredricksen](https://github.com/grumdrig) and -[Ryan Dahl](https://github.com/ry) for their SQLite bindings for node, and to mraleph on Freenode's #v8 for answering questions. - -This module was originally created by [Mapbox](https://mapbox.com/) & is now maintained by [Ghost](https://ghost.org). - -# Changelog - -We use [GitHub releases](https://github.com/TryGhost/node-sqlite3/releases) for notes on the latest versions. See [CHANGELOG.md](https://github.com/TryGhost/node-sqlite3/blob/b05f4594cf8b0de64743561fcd2cfe6f4571754d/CHANGELOG.md) in git history for details on older versions. - -# License - -`node-sqlite3` is [BSD licensed](https://github.com/tryghost/node-sqlite3/raw/master/LICENSE). - -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmapbox%2Fnode-sqlite3?ref=badge_large) diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/binding.gyp b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/binding.gyp deleted file mode 100644 index 20d418b3c..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/binding.gyp +++ /dev/null @@ -1,68 +0,0 @@ -{ - "includes": [ "deps/common-sqlite.gypi" ], - "variables": { - "sqlite%":"internal", - "sqlite_libname%":"sqlite3" - }, - "targets": [ - { - "target_name": "<(module_name)", - "cflags!": [ "-fno-exceptions" ], - "cflags_cc!": [ "-fno-exceptions" ], - "xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES", - "CLANG_CXX_LIBRARY": "libc++", - "MACOSX_DEPLOYMENT_TARGET": "10.7", - }, - "msvs_settings": { - "VCCLCompilerTool": { "ExceptionHandling": 1 }, - }, - "include_dirs": [ - " - -import events = require("events"); - -export const OPEN_READONLY: number; -export const OPEN_READWRITE: number; -export const OPEN_CREATE: number; -export const OPEN_FULLMUTEX: number; -export const OPEN_SHAREDCACHE: number; -export const OPEN_PRIVATECACHE: number; -export const OPEN_URI: number; - -export const VERSION: string; -export const SOURCE_ID: string; -export const VERSION_NUMBER: number; - -export const OK: number; -export const ERROR: number; -export const INTERNAL: number; -export const PERM: number; -export const ABORT: number; -export const BUSY: number; -export const LOCKED: number; -export const NOMEM: number; -export const READONLY: number; -export const INTERRUPT: number -export const IOERR: number; -export const CORRUPT: number -export const NOTFOUND: number; -export const FULL: number; -export const CANTOPEN: number; -export const PROTOCOL: number; -export const EMPTY: number; -export const SCHEMA: number; -export const TOOBIG: number -export const CONSTRAINT: number -export const MISMATCH: number; -export const MISUSE: number; -export const NOLFS: number; -export const AUTH: number -export const FORMAT: number; -export const RANGE: number -export const NOTADB: number; - -export const LIMIT_LENGTH: number; -export const LIMIT_SQL_LENGTH: number; -export const LIMIT_COLUMN: number; -export const LIMIT_EXPR_DEPTH: number; -export const LIMIT_COMPOUND_SELECT: number; -export const LIMIT_VDBE_OP: number; -export const LIMIT_FUNCTION_ARG: number; -export const LIMIT_ATTACHED: number; -export const LIMIT_LIKE_PATTERN_LENGTH: number; -export const LIMIT_VARIABLE_NUMBER: number; -export const LIMIT_TRIGGER_DEPTH: number; -export const LIMIT_WORKER_THREADS: number; - -export const cached: { - Database(filename: string, callback?: (this: Database, err: Error | null) => void): Database; - Database(filename: string, mode?: number, callback?: (this: Database, err: Error | null) => void): Database; -}; - -export interface RunResult extends Statement { - lastID: number; - changes: number; -} - -export class Statement extends events.EventEmitter { - bind(callback?: (err: Error | null) => void): this; - bind(...params: any[]): this; - - reset(callback?: (err: null) => void): this; - - finalize(callback?: (err: Error) => void): Database; - - run(callback?: (err: Error | null) => void): this; - run(params: any, callback?: (this: RunResult, err: Error | null) => void): this; - run(...params: any[]): this; - - get(callback?: (err: Error | null, row?: T) => void): this; - get(params: any, callback?: (this: RunResult, err: Error | null, row?: T) => void): this; - get(...params: any[]): this; - - all(callback?: (err: Error | null, rows: T[]) => void): this; - all(params: any, callback?: (this: RunResult, err: Error | null, rows: T[]) => void): this; - all(...params: any[]): this; - - each(callback?: (err: Error | null, row: T) => void, complete?: (err: Error | null, count: number) => void): this; - each(params: any, callback?: (this: RunResult, err: Error | null, row: T) => void, complete?: (err: Error | null, count: number) => void): this; - each(...params: any[]): this; -} - -export class Database extends events.EventEmitter { - constructor(filename: string, callback?: (err: Error | null) => void); - constructor(filename: string, mode?: number, callback?: (err: Error | null) => void); - - close(callback?: (err: Error | null) => void): void; - - run(sql: string, callback?: (this: RunResult, err: Error | null) => void): this; - run(sql: string, params: any, callback?: (this: RunResult, err: Error | null) => void): this; - run(sql: string, ...params: any[]): this; - - get(sql: string, callback?: (this: Statement, err: Error | null, row: T) => void): this; - get(sql: string, params: any, callback?: (this: Statement, err: Error | null, row: T) => void): this; - get(sql: string, ...params: any[]): this; - - all(sql: string, callback?: (this: Statement, err: Error | null, rows: T[]) => void): this; - all(sql: string, params: any, callback?: (this: Statement, err: Error | null, rows: T[]) => void): this; - all(sql: string, ...params: any[]): this; - - each(sql: string, callback?: (this: Statement, err: Error | null, row: T) => void, complete?: (err: Error | null, count: number) => void): this; - each(sql: string, params: any, callback?: (this: Statement, err: Error | null, row: T) => void, complete?: (err: Error | null, count: number) => void): this; - each(sql: string, ...params: any[]): this; - - exec(sql: string, callback?: (this: Statement, err: Error | null) => void): this; - - prepare(sql: string, callback?: (this: Statement, err: Error | null) => void): Statement; - prepare(sql: string, params: any, callback?: (this: Statement, err: Error | null) => void): Statement; - prepare(sql: string, ...params: any[]): Statement; - - serialize(callback?: () => void): void; - parallelize(callback?: () => void): void; - - on(event: "trace", listener: (sql: string) => void): this; - on(event: "profile", listener: (sql: string, time: number) => void): this; - on(event: "change", listener: (type: string, database: string, table: string, rowid: number) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open" | "close", listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - - configure(option: "busyTimeout", value: number): void; - configure(option: "limit", id: number, value: number): void; - - loadExtension(filename: string, callback?: (err: Error | null) => void): this; - - wait(callback?: (param: null) => void): this; - - interrupt(): void; -} - -export function verbose(): sqlite3; - -export interface sqlite3 { - OPEN_READONLY: number; - OPEN_READWRITE: number; - OPEN_CREATE: number; - OPEN_FULLMUTEX: number; - OPEN_SHAREDCACHE: number; - OPEN_PRIVATECACHE: number; - OPEN_URI: number; - - VERSION: string; - SOURCE_ID: string; - VERSION_NUMBER: number; - - OK: number; - ERROR: number; - INTERNAL: number; - PERM: number; - ABORT: number; - BUSY: number; - LOCKED: number; - NOMEM: number; - READONLY: number; - INTERRUPT: number - IOERR: number; - CORRUPT: number - NOTFOUND: number; - FULL: number; - CANTOPEN: number; - PROTOCOL: number; - EMPTY: number; - SCHEMA: number; - TOOBIG: number - CONSTRAINT: number - MISMATCH: number; - MISUSE: number; - NOLFS: number; - AUTH: number - FORMAT: number; - RANGE: number - NOTADB: number; - - LIMIT_LENGTH: number; - LIMIT_SQL_LENGTH: number; - LIMIT_COLUMN: number; - LIMIT_EXPR_DEPTH: number; - LIMIT_COMPOUND_SELECT: number; - LIMIT_VDBE_OP: number; - LIMIT_FUNCTION_ARG: number; - LIMIT_ATTACHED: number; - LIMIT_LIKE_PATTERN_LENGTH: number; - LIMIT_VARIABLE_NUMBER: number; - LIMIT_TRIGGER_DEPTH: number; - LIMIT_WORKER_THREADS: number; - - cached: typeof cached; - RunResult: RunResult; - Statement: typeof Statement; - Database: typeof Database; - verbose(): this; -} \ No newline at end of file diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/lib/sqlite3.js b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/lib/sqlite3.js deleted file mode 100644 index 430a2b88a..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/lib/sqlite3.js +++ /dev/null @@ -1,207 +0,0 @@ -const path = require('path'); -const sqlite3 = require('./sqlite3-binding.js'); -const EventEmitter = require('events').EventEmitter; -module.exports = exports = sqlite3; - -function normalizeMethod (fn) { - return function (sql) { - let errBack; - const args = Array.prototype.slice.call(arguments, 1); - - if (typeof args[args.length - 1] === 'function') { - const callback = args[args.length - 1]; - errBack = function(err) { - if (err) { - callback(err); - } - }; - } - const statement = new Statement(this, sql, errBack); - return fn.call(this, statement, args); - }; -} - -function inherits(target, source) { - for (const k in source.prototype) - target.prototype[k] = source.prototype[k]; -} - -sqlite3.cached = { - Database: function(file, a, b) { - if (file === '' || file === ':memory:') { - // Don't cache special databases. - return new Database(file, a, b); - } - - let db; - file = path.resolve(file); - - if (!sqlite3.cached.objects[file]) { - db = sqlite3.cached.objects[file] = new Database(file, a, b); - } - else { - // Make sure the callback is called. - db = sqlite3.cached.objects[file]; - const callback = (typeof a === 'number') ? b : a; - if (typeof callback === 'function') { - function cb() { callback.call(db, null); } - if (db.open) process.nextTick(cb); - else db.once('open', cb); - } - } - - return db; - }, - objects: {} -}; - - -const Database = sqlite3.Database; -const Statement = sqlite3.Statement; -const Backup = sqlite3.Backup; - -inherits(Database, EventEmitter); -inherits(Statement, EventEmitter); -inherits(Backup, EventEmitter); - -// Database#prepare(sql, [bind1, bind2, ...], [callback]) -Database.prototype.prepare = normalizeMethod(function(statement, params) { - return params.length - ? statement.bind.apply(statement, params) - : statement; -}); - -// Database#run(sql, [bind1, bind2, ...], [callback]) -Database.prototype.run = normalizeMethod(function(statement, params) { - statement.run.apply(statement, params).finalize(); - return this; -}); - -// Database#get(sql, [bind1, bind2, ...], [callback]) -Database.prototype.get = normalizeMethod(function(statement, params) { - statement.get.apply(statement, params).finalize(); - return this; -}); - -// Database#all(sql, [bind1, bind2, ...], [callback]) -Database.prototype.all = normalizeMethod(function(statement, params) { - statement.all.apply(statement, params).finalize(); - return this; -}); - -// Database#each(sql, [bind1, bind2, ...], [callback], [complete]) -Database.prototype.each = normalizeMethod(function(statement, params) { - statement.each.apply(statement, params).finalize(); - return this; -}); - -Database.prototype.map = normalizeMethod(function(statement, params) { - statement.map.apply(statement, params).finalize(); - return this; -}); - -// Database#backup(filename, [callback]) -// Database#backup(filename, destName, sourceName, filenameIsDest, [callback]) -Database.prototype.backup = function() { - let backup; - if (arguments.length <= 2) { - // By default, we write the main database out to the main database of the named file. - // This is the most likely use of the backup api. - backup = new Backup(this, arguments[0], 'main', 'main', true, arguments[1]); - } else { - // Otherwise, give the user full control over the sqlite3_backup_init arguments. - backup = new Backup(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]); - } - // Per the sqlite docs, exclude the following errors as non-fatal by default. - backup.retryErrors = [sqlite3.BUSY, sqlite3.LOCKED]; - return backup; -}; - -Statement.prototype.map = function() { - const params = Array.prototype.slice.call(arguments); - const callback = params.pop(); - params.push(function(err, rows) { - if (err) return callback(err); - const result = {}; - if (rows.length) { - const keys = Object.keys(rows[0]); - const key = keys[0]; - if (keys.length > 2) { - // Value is an object - for (let i = 0; i < rows.length; i++) { - result[rows[i][key]] = rows[i]; - } - } else { - const value = keys[1]; - // Value is a plain value - for (let i = 0; i < rows.length; i++) { - result[rows[i][key]] = rows[i][value]; - } - } - } - callback(err, result); - }); - return this.all.apply(this, params); -}; - -let isVerbose = false; - -const supportedEvents = [ 'trace', 'profile', 'change' ]; - -Database.prototype.addListener = Database.prototype.on = function(type) { - const val = EventEmitter.prototype.addListener.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0) { - this.configure(type, true); - } - return val; -}; - -Database.prototype.removeListener = function(type) { - const val = EventEmitter.prototype.removeListener.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) { - this.configure(type, false); - } - return val; -}; - -Database.prototype.removeAllListeners = function(type) { - const val = EventEmitter.prototype.removeAllListeners.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0) { - this.configure(type, false); - } - return val; -}; - -// Save the stack trace over EIO callbacks. -sqlite3.verbose = function() { - if (!isVerbose) { - const trace = require('./trace'); - [ - 'prepare', - 'get', - 'run', - 'all', - 'each', - 'map', - 'close', - 'exec' - ].forEach(function (name) { - trace.extendTrace(Database.prototype, name); - }); - [ - 'bind', - 'get', - 'run', - 'all', - 'each', - 'map', - 'reset', - 'finalize', - ].forEach(function (name) { - trace.extendTrace(Statement.prototype, name); - }); - isVerbose = true; - } - - return sqlite3; -}; diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/lib/trace.js b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/lib/trace.js deleted file mode 100644 index 1d84cb011..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/lib/trace.js +++ /dev/null @@ -1,38 +0,0 @@ -// Inspired by https://github.com/tlrobinson/long-stack-traces -const util = require('util'); - -function extendTrace(object, property, pos) { - const old = object[property]; - object[property] = function() { - const error = new Error(); - const name = object.constructor.name + '#' + property + '(' + - Array.prototype.slice.call(arguments).map(function(el) { - return util.inspect(el, false, 0); - }).join(', ') + ')'; - - if (typeof pos === 'undefined') pos = -1; - if (pos < 0) pos += arguments.length; - const cb = arguments[pos]; - if (typeof arguments[pos] === 'function') { - arguments[pos] = function replacement() { - const err = arguments[0]; - if (err && err.stack && !err.__augmented) { - err.stack = filter(err).join('\n'); - err.stack += '\n--> in ' + name; - err.stack += '\n' + filter(error).slice(1).join('\n'); - err.__augmented = true; - } - return cb.apply(this, arguments); - }; - } - return old.apply(this, arguments); - }; -} -exports.extendTrace = extendTrace; - - -function filter(error) { - return error.stack.split('\n').filter(function(line) { - return line.indexOf(__filename) < 0; - }); -} diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/package.json b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/package.json deleted file mode 100644 index 81ebdc7aa..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "sqlite3", - "description": "Asynchronous, non-blocking SQLite3 bindings", - "version": "5.1.6", - "homepage": "https://github.com/TryGhost/node-sqlite3", - "author": { - "name": "Mapbox", - "url": "https://mapbox.com/" - }, - "binary": { - "module_name": "node_sqlite3", - "module_path": "./lib/binding/napi-v{napi_build_version}-{platform}-{libc}-{arch}", - "host": "https://github.com/TryGhost/node-sqlite3/releases/download/", - "remote_path": "v{version}", - "package_name": "napi-v{napi_build_version}-{platform}-{libc}-{arch}.tar.gz", - "napi_versions": [ - 3, - 6 - ] - }, - "contributors": [ - "Konstantin Käfer ", - "Dane Springmeyer ", - "Will White ", - "Orlando Vazquez ", - "Artem Kustikov ", - "Eric Fredricksen ", - "John Wright ", - "Ryan Dahl ", - "Tom MacWright ", - "Carter Thaxton ", - "Audrius Kažukauskas ", - "Johannes Schauer ", - "Nathan Rajlich ", - "AJ ONeal ", - "Mithgol", - "Ben Noordhuis " - ], - "files": [ - "binding.gyp", - "deps/", - "lib/*.js", - "lib/*.d.ts", - "src/" - ], - "repository": { - "type": "git", - "url": "https://github.com/TryGhost/node-sqlite3.git" - }, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^4.2.0", - "tar": "^6.1.11" - }, - "devDependencies": { - "eslint": "6.8.0", - "mocha": "7.2.0", - "node-pre-gyp-github": "1.4.4" - }, - "peerDependencies": { - "node-gyp": "8.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - }, - "optionalDependencies": { - "node-gyp": "8.x" - }, - "scripts": { - "build": "node-pre-gyp build", - "build:debug": "node-pre-gyp build --debug", - "install": "node-pre-gyp install --fallback-to-build", - "pretest": "node test/support/createdb.js", - "test": "mocha -R spec --timeout 480000", - "pack": "node-pre-gyp package" - }, - "license": "BSD-3-Clause", - "keywords": [ - "sql", - "sqlite", - "sqlite3", - "database" - ], - "main": "./lib/sqlite3", - "types": "./lib/sqlite3.d.ts", - "renovate": { - "extends": [ - "@tryghost:base" - ] - } -} diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/async.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/async.h deleted file mode 100644 index b1a8f9dd6..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/async.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef NODE_SQLITE3_SRC_ASYNC_H -#define NODE_SQLITE3_SRC_ASYNC_H - -#include -#include - -#include "threading.h" - -// Generic uv_async handler. -template class Async { - typedef void (*Callback)(Parent* parent, Item* item); - -protected: - uv_async_t watcher; - NODE_SQLITE3_MUTEX_t - std::vector data; - Callback callback; -public: - Parent* parent; - -public: - Async(Parent* parent_, Callback cb_) - : callback(cb_), parent(parent_) { - watcher.data = this; - NODE_SQLITE3_MUTEX_INIT - uv_loop_t *loop; - napi_get_uv_event_loop(parent_->Env(), &loop); - uv_async_init(loop, &watcher, reinterpret_cast(listener)); - } - - static void listener(uv_async_t* handle) { - Async* async = static_cast(handle->data); - std::vector rows; - NODE_SQLITE3_MUTEX_LOCK(&async->mutex) - rows.swap(async->data); - NODE_SQLITE3_MUTEX_UNLOCK(&async->mutex) - for (unsigned int i = 0, size = rows.size(); i < size; i++) { - async->callback(async->parent, rows[i]); - } - } - - static void close(uv_handle_t* handle) { - assert(handle != NULL); - assert(handle->data != NULL); - Async* async = static_cast(handle->data); - delete async; - } - - void finish() { - // Need to call the listener again to ensure all items have been - // processed. Is this a bug in uv_async? Feels like uv_close - // should handle that. - listener(&watcher); - uv_close((uv_handle_t*)&watcher, close); - } - - void add(Item* item) { - NODE_SQLITE3_MUTEX_LOCK(&mutex); - data.push_back(item); - NODE_SQLITE3_MUTEX_UNLOCK(&mutex) - } - - void send() { - uv_async_send(&watcher); - } - - void send(Item* item) { - add(item); - send(); - } - - ~Async() { - NODE_SQLITE3_MUTEX_DESTROY - } -}; - -#endif diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/backup.cc b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/backup.cc deleted file mode 100644 index 9f3893b96..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/backup.cc +++ /dev/null @@ -1,423 +0,0 @@ -#include -#include - -#include "macros.h" -#include "database.h" -#include "backup.h" - -using namespace node_sqlite3; - -Napi::Object Backup::Init(Napi::Env env, Napi::Object exports) { - Napi::HandleScope scope(env); - - // declare napi_default_method here as it is only available in Node v14.12.0+ - napi_property_attributes napi_default_method = static_cast(napi_writable | napi_configurable); - - Napi::Function t = DefineClass(env, "Backup", { - InstanceMethod("step", &Backup::Step, napi_default_method), - InstanceMethod("finish", &Backup::Finish, napi_default_method), - InstanceAccessor("idle", &Backup::IdleGetter, nullptr), - InstanceAccessor("completed", &Backup::CompletedGetter, nullptr), - InstanceAccessor("failed", &Backup::FailedGetter, nullptr), - InstanceAccessor("remaining", &Backup::RemainingGetter, nullptr), - InstanceAccessor("pageCount", &Backup::PageCountGetter, nullptr), - InstanceAccessor("retryErrors", &Backup::RetryErrorGetter, &Backup::RetryErrorSetter), - }); - - exports.Set("Backup", t); - return exports; -} - -void Backup::Process() { - if (finished && !queue.empty()) { - return CleanQueue(); - } - - while (inited && !locked && !queue.empty()) { - std::unique_ptr call(queue.front()); - queue.pop(); - - call->callback(call->baton); - } -} - -void Backup::Schedule(Work_Callback callback, Baton* baton) { - if (finished) { - queue.push(new Call(callback, baton)); - CleanQueue(); - } - else if (!inited || locked || !queue.empty()) { - queue.push(new Call(callback, baton)); - } - else { - callback(baton); - } -} - -template void Backup::Error(T* baton) { - Napi::Env env = baton->backup->Env(); - Napi::HandleScope scope(env); - - Backup* backup = baton->backup; - // Fail hard on logic errors. - assert(backup->status != 0); - EXCEPTION(Napi::String::New(env, backup->message), backup->status, exception); - - Napi::Function cb = baton->callback.Value(); - - if (!cb.IsEmpty() && cb.IsFunction()) { - Napi::Value argv[] = { exception }; - TRY_CATCH_CALL(backup->Value(), cb, 1, argv); - } - else { - Napi::Value argv[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(backup->Value(), 2, argv); - } -} - -void Backup::CleanQueue() { - Napi::Env env = this->Env(); - Napi::HandleScope scope(env); - - if (inited && !queue.empty()) { - // This backup has already been initialized and is now finished. - // Fire error for all remaining items in the queue. - EXCEPTION(Napi::String::New(env, "Backup is already finished"), SQLITE_MISUSE, exception); - Napi::Value argv[] = { exception }; - bool called = false; - - // Clear out the queue so that this object can get GC'ed. - while (!queue.empty()) { - std::unique_ptr call(queue.front()); - queue.pop(); - - std::unique_ptr baton(call->baton); - Napi::Function cb = baton->callback.Value(); - - if (inited && !cb.IsEmpty() && - cb.IsFunction()) { - TRY_CATCH_CALL(Value(), cb, 1, argv); - called = true; - } - } - - // When we couldn't call a callback function, emit an error on the - // Backup object. - if (!called) { - Napi::Value info[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(Value(), 2, info); - } - } - else while (!queue.empty()) { - // Just delete all items in the queue; we already fired an event when - // initializing the backup failed. - std::unique_ptr call(queue.front()); - queue.pop(); - - // We don't call the actual callback, so we have to make sure that - // the baton gets destroyed. - delete call->baton; - } -} - -Backup::Backup(const Napi::CallbackInfo& info) : Napi::ObjectWrap(info) { - Napi::Env env = info.Env(); - if (!info.IsConstructCall()) { - Napi::TypeError::New(env, "Use the new operator to create new Backup objects").ThrowAsJavaScriptException(); - return; - } - - int length = info.Length(); - - if (length <= 0 || !Database::HasInstance(info[0])) { - Napi::TypeError::New(env, "Database object expected").ThrowAsJavaScriptException(); - return; - } - else if (length <= 1 || !info[1].IsString()) { - Napi::TypeError::New(env, "Filename expected").ThrowAsJavaScriptException(); - return; - } - else if (length <= 2 || !info[2].IsString()) { - Napi::TypeError::New(env, "Source database name expected").ThrowAsJavaScriptException(); - return; - } - else if (length <= 3 || !info[3].IsString()) { - Napi::TypeError::New(env, "Destination database name expected").ThrowAsJavaScriptException(); - return; - } - else if (length <= 4 || !info[4].IsBoolean()) { - Napi::TypeError::New(env, "Direction flag expected").ThrowAsJavaScriptException(); - return; - } - else if (length > 5 && !info[5].IsUndefined() && !info[5].IsFunction()) { - Napi::TypeError::New(env, "Callback expected").ThrowAsJavaScriptException(); - return; - } - - Database* db = Napi::ObjectWrap::Unwrap(info[0].As()); - Napi::String filename = info[1].As(); - Napi::String sourceName = info[2].As(); - Napi::String destName = info[3].As(); - Napi::Boolean filenameIsDest = info[4].As(); - - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("filename", filename)); - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("sourceName", sourceName)); - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("destName", destName)); - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("filenameIsDest", filenameIsDest)); - - init(db); - - InitializeBaton* baton = new InitializeBaton(db, info[5].As(), this); - baton->filename = filename.Utf8Value(); - baton->sourceName = sourceName.Utf8Value(); - baton->destName = destName.Utf8Value(); - baton->filenameIsDest = filenameIsDest.Value(); - db->Schedule(Work_BeginInitialize, baton); -} - -void Backup::Work_BeginInitialize(Database::Baton* baton) { - assert(baton->db->open); - baton->db->pending++; - Napi::Env env = baton->db->Env(); - int status = napi_create_async_work( - env, NULL, Napi::String::New(env, "sqlite3.Backup.Initialize"), - Work_Initialize, Work_AfterInitialize, baton, &baton->request - ); - assert(status == 0); - napi_queue_async_work(env, baton->request); -} - -void Backup::Work_Initialize(napi_env e, void* data) { - BACKUP_INIT(InitializeBaton); - - // In case stepping fails, we use a mutex to make sure we get the associated - // error message. - sqlite3_mutex* mtx = sqlite3_db_mutex(baton->db->_handle); - sqlite3_mutex_enter(mtx); - - backup->status = sqlite3_open(baton->filename.c_str(), &backup->_otherDb); - - if (backup->status == SQLITE_OK) { - backup->_handle = sqlite3_backup_init( - baton->filenameIsDest ? backup->_otherDb : backup->db->_handle, - baton->destName.c_str(), - baton->filenameIsDest ? backup->db->_handle : backup->_otherDb, - baton->sourceName.c_str()); - } - backup->_destDb = baton->filenameIsDest ? backup->_otherDb : backup->db->_handle; - - if (backup->status != SQLITE_OK) { - backup->message = std::string(sqlite3_errmsg(backup->_destDb)); - sqlite3_close(backup->_otherDb); - backup->_otherDb = NULL; - backup->_destDb = NULL; - } - - sqlite3_mutex_leave(mtx); -} - -void Backup::Work_AfterInitialize(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Backup* backup = baton->backup; - - Napi::Env env = backup->Env(); - Napi::HandleScope scope(env); - - if (backup->status != SQLITE_OK) { - Error(baton.get()); - backup->FinishAll(); - } - else { - backup->inited = true; - Napi::Function cb = baton->callback.Value(); - if (!cb.IsEmpty() && cb.IsFunction()) { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(backup->Value(), cb, 1, argv); - } - } - BACKUP_END(); -} - -Napi::Value Backup::Step(const Napi::CallbackInfo& info) { - Backup* backup = this; - Napi::Env env = backup->Env(); - - REQUIRE_ARGUMENT_INTEGER(0, pages); - OPTIONAL_ARGUMENT_FUNCTION(1, callback); - - StepBaton* baton = new StepBaton(backup, callback, pages); - backup->GetRetryErrors(baton->retryErrorsSet); - backup->Schedule(Work_BeginStep, baton); - return info.This(); -} - -void Backup::Work_BeginStep(Baton* baton) { - BACKUP_BEGIN(Step); -} - -void Backup::Work_Step(napi_env e, void* data) { - BACKUP_INIT(StepBaton); - if (backup->_handle) { - backup->status = sqlite3_backup_step(backup->_handle, baton->pages); - backup->remaining = sqlite3_backup_remaining(backup->_handle); - backup->pageCount = sqlite3_backup_pagecount(backup->_handle); - } - if (backup->status != SQLITE_OK) { - // Text of message is a little awkward to get, since the error is not associated - // with a db connection. -#if SQLITE_VERSION_NUMBER >= 3007015 - // sqlite3_errstr is a relatively new method - backup->message = std::string(sqlite3_errstr(backup->status)); -#else - backup->message = "Sqlite error"; -#endif - if (baton->retryErrorsSet.size() > 0) { - if (baton->retryErrorsSet.find(backup->status) == baton->retryErrorsSet.end()) { - backup->FinishSqlite(); - } - } - } -} - -void Backup::Work_AfterStep(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Backup* backup = baton->backup; - - Napi::Env env = backup->Env(); - Napi::HandleScope scope(env); - - if (backup->status == SQLITE_DONE) { - backup->completed = true; - } else if (!backup->_handle) { - backup->failed = true; - } - - if (backup->status != SQLITE_OK && backup->status != SQLITE_DONE) { - Error(baton.get()); - } - else { - // Fire callbacks. - Napi::Function cb = baton->callback.Value(); - if (!cb.IsEmpty() && cb.IsFunction()) { - Napi::Value argv[] = { env.Null(), Napi::Boolean::New(env, backup->status == SQLITE_DONE) }; - TRY_CATCH_CALL(backup->Value(), cb, 2, argv); - } - } - - BACKUP_END(); -} - -Napi::Value Backup::Finish(const Napi::CallbackInfo& info) { - Backup* backup = this; - Napi::Env env = backup->Env(); - - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - Baton* baton = new Baton(backup, callback); - backup->Schedule(Work_BeginFinish, baton); - return info.This(); -} - -void Backup::Work_BeginFinish(Baton* baton) { - BACKUP_BEGIN(Finish); -} - -void Backup::Work_Finish(napi_env e, void* data) { - BACKUP_INIT(Baton); - backup->FinishSqlite(); -} - -void Backup::Work_AfterFinish(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Backup* backup = baton->backup; - - Napi::Env env = backup->Env(); - Napi::HandleScope scope(env); - - backup->FinishAll(); - - // Fire callback in case there was one. - Napi::Function cb = baton->callback.Value(); - if (!cb.IsEmpty() && cb.IsFunction()) { - TRY_CATCH_CALL(backup->Value(), cb, 0, NULL); - } - - BACKUP_END(); -} - -void Backup::FinishAll() { - assert(!finished); - if (!completed && !failed) { - failed = true; - } - finished = true; - CleanQueue(); - FinishSqlite(); - db->Unref(); -} - -void Backup::FinishSqlite() { - if (_handle) { - sqlite3_backup_finish(_handle); - _handle = NULL; - } - if (_otherDb) { - sqlite3_close(_otherDb); - _otherDb = NULL; - } - _destDb = NULL; -} - -Napi::Value Backup::IdleGetter(const Napi::CallbackInfo& info) { - Backup* backup = this; - bool idle = backup->inited && !backup->locked && backup->queue.empty(); - return Napi::Boolean::New(this->Env(), idle); -} - -Napi::Value Backup::CompletedGetter(const Napi::CallbackInfo& info) { - Backup* backup = this; - return Napi::Boolean::New(this->Env(), backup->completed); -} - -Napi::Value Backup::FailedGetter(const Napi::CallbackInfo& info) { - Backup* backup = this; - return Napi::Boolean::New(this->Env(), backup->failed); -} - -Napi::Value Backup::RemainingGetter(const Napi::CallbackInfo& info) { - Backup* backup = this; - return Napi::Number::New(this->Env(), backup->remaining); -} - -Napi::Value Backup::PageCountGetter(const Napi::CallbackInfo& info) { - Backup* backup = this; - return Napi::Number::New(this->Env(), backup->pageCount); -} - -Napi::Value Backup::RetryErrorGetter(const Napi::CallbackInfo& info) { - Backup* backup = this; - return backup->retryErrors.Value(); -} - -void Backup::RetryErrorSetter(const Napi::CallbackInfo& info, const Napi::Value& value) { - Backup* backup = this; - Napi::Env env = backup->Env(); - if (!value.IsArray()) { - Napi::Error::New(env, "retryErrors must be an array").ThrowAsJavaScriptException(); - return; - } - Napi::Array array = value.As(); - backup->retryErrors.Reset(array, 1); -} - -void Backup::GetRetryErrors(std::set& retryErrorsSet) { - retryErrorsSet.clear(); - Napi::Array array = retryErrors.Value(); - int length = array.Length(); - for (int i = 0; i < length; i++) { - Napi::Value code = (array).Get(i); - if (code.IsNumber()) { - retryErrorsSet.insert(code.As().Int32Value()); - } - } -} diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/backup.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/backup.h deleted file mode 100644 index c15b77bfe..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/backup.h +++ /dev/null @@ -1,221 +0,0 @@ -#ifndef NODE_SQLITE3_SRC_BACKUP_H -#define NODE_SQLITE3_SRC_BACKUP_H - -#include "database.h" - -#include -#include -#include - -#include -#include - -using namespace Napi; - -namespace node_sqlite3 { - -/** - * - * A class for managing an sqlite3_backup object. For consistency - * with other node-sqlite3 classes, it maintains an internal queue - * of calls. - * - * Intended usage from node: - * - * var db = new sqlite3.Database('live.db'); - * var backup = db.backup('backup.db'); - * ... - * // in event loop, move backup forward when we have time. - * if (backup.idle) { backup.step(NPAGES); } - * if (backup.completed) { ... success ... } - * if (backup.failed) { ... sadness ... } - * // do other work in event loop - fine to modify live.db - * ... - * - * Here is how sqlite's backup api is exposed: - * - * - `sqlite3_backup_init`: This is implemented as - * `db.backup(filename, [callback])` or - * `db.backup(filename, destDbName, sourceDbName, filenameIsDest, [callback])`. - * - `sqlite3_backup_step`: `backup.step(pages, [callback])`. - * - `sqlite3_backup_finish`: `backup.finish([callback])`. - * - `sqlite3_backup_remaining`: `backup.remaining`. - * - `sqlite3_backup_pagecount`: `backup.pageCount`. - * - * There are the following read-only properties: - * - * - `backup.completed` is set to `true` when the backup - * succeeeds. - * - `backup.failed` is set to `true` when the backup - * has a fatal error. - * - `backup.idle` is set to `true` when no operation - * is currently in progress or queued for the backup. - * - `backup.remaining` is an integer with the remaining - * number of pages after the last call to `backup.step` - * (-1 if `step` not yet called). - * - `backup.pageCount` is an integer with the total number - * of pages measured during the last call to `backup.step` - * (-1 if `step` not yet called). - * - * There is the following writable property: - * - * - `backup.retryErrors`: an array of sqlite3 error codes - * that are treated as non-fatal - meaning, if they occur, - * backup.failed is not set, and the backup may continue. - * By default, this is `[sqlite3.BUSY, sqlite3.LOCKED]`. - * - * The `db.backup(filename, [callback])` shorthand is sufficient - * for making a backup of a database opened by node-sqlite3. If - * using attached or temporary databases, or moving data in the - * opposite direction, the more complete (but daunting) - * `db.backup(filename, destDbName, sourceDbName, filenameIsDest, [callback])` - * signature is provided. - * - * A backup will finish automatically when it succeeds or a fatal - * error occurs, meaning it is not necessary to call `db.finish()`. - * By default, SQLITE_LOCKED and SQLITE_BUSY errors are not - * treated as failures, and the backup will continue if they - * occur. The set of errors that are tolerated can be controlled - * by setting `backup.retryErrors`. To disable automatic - * finishing and stick strictly to sqlite's raw api, set - * `backup.retryErrors` to `[]`. In that case, it is necessary - * to call `backup.finish()`. - * - * In the same way as node-sqlite3 databases and statements, - * backup methods can be called safely without callbacks, due - * to an internal call queue. So for example this naive code - * will correctly back up a db, if there are no errors: - * - * var backup = db.backup('backup.db'); - * backup.step(-1); - * backup.finish(); - * - */ -class Backup : public Napi::ObjectWrap { -public: - static Napi::Object Init(Napi::Env env, Napi::Object exports); - - struct Baton { - napi_async_work request = NULL; - Backup* backup; - Napi::FunctionReference callback; - - Baton(Backup* backup_, Napi::Function cb_) : backup(backup_) { - backup->Ref(); - callback.Reset(cb_, 1); - } - virtual ~Baton() { - if (request) napi_delete_async_work(backup->Env(), request); - backup->Unref(); - callback.Reset(); - } - }; - - struct InitializeBaton : Database::Baton { - Backup* backup; - std::string filename; - std::string sourceName; - std::string destName; - bool filenameIsDest; - InitializeBaton(Database* db_, Napi::Function cb_, Backup* backup_) : - Baton(db_, cb_), backup(backup_), filenameIsDest(true) { - backup->Ref(); - } - virtual ~InitializeBaton() { - backup->Unref(); - if (!db->IsOpen() && db->IsLocked()) { - // The database handle was closed before the backup could be opened. - backup->FinishAll(); - } - } - }; - - struct StepBaton : Baton { - int pages; - std::set retryErrorsSet; - StepBaton(Backup* backup_, Napi::Function cb_, int pages_) : - Baton(backup_, cb_), pages(pages_) {} - }; - - typedef void (*Work_Callback)(Baton* baton); - - struct Call { - Call(Work_Callback cb_, Baton* baton_) : callback(cb_), baton(baton_) {}; - Work_Callback callback; - Baton* baton; - }; - - void init(Database* db_) { - db = db_; - _handle = NULL; - _otherDb = NULL; - _destDb = NULL; - inited = false; - locked = true; - completed = false; - failed = false; - remaining = -1; - pageCount = -1; - finished = false; - db->Ref(); - } - - Backup(const Napi::CallbackInfo& info); - - ~Backup() { - if (!finished) { - FinishAll(); - } - retryErrors.Reset(); - } - - WORK_DEFINITION(Step); - WORK_DEFINITION(Finish); - Napi::Value IdleGetter(const Napi::CallbackInfo& info); - Napi::Value CompletedGetter(const Napi::CallbackInfo& info); - Napi::Value FailedGetter(const Napi::CallbackInfo& info); - Napi::Value PageCountGetter(const Napi::CallbackInfo& info); - Napi::Value RemainingGetter(const Napi::CallbackInfo& info); - Napi::Value FatalErrorGetter(const Napi::CallbackInfo& info); - Napi::Value RetryErrorGetter(const Napi::CallbackInfo& info); - - void FatalErrorSetter(const Napi::CallbackInfo& info, const Napi::Value& value); - void RetryErrorSetter(const Napi::CallbackInfo& info, const Napi::Value& value); - -protected: - static void Work_BeginInitialize(Database::Baton* baton); - static void Work_Initialize(napi_env env, void* data); - static void Work_AfterInitialize(napi_env env, napi_status status, void* data); - - void Schedule(Work_Callback callback, Baton* baton); - void Process(); - void CleanQueue(); - template static void Error(T* baton); - - void FinishAll(); - void FinishSqlite(); - void GetRetryErrors(std::set& retryErrorsSet); - - Database* db; - - sqlite3_backup* _handle; - sqlite3* _otherDb; - sqlite3* _destDb; - int status; - std::string message; - - bool inited; - bool locked; - bool completed; - bool failed; - int remaining; - int pageCount; - bool finished; - std::queue queue; - - Napi::Reference retryErrors; -}; - -} - -#endif diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/database.cc b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/database.cc deleted file mode 100644 index 15709ce3d..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/database.cc +++ /dev/null @@ -1,775 +0,0 @@ -#include -#include - -#include "macros.h" -#include "database.h" -#include "statement.h" - -using namespace node_sqlite3; - -#if NAPI_VERSION < 6 -Napi::FunctionReference Database::constructor; -#endif - -Napi::Object Database::Init(Napi::Env env, Napi::Object exports) { - Napi::HandleScope scope(env); - // declare napi_default_method here as it is only available in Node v14.12.0+ - napi_property_attributes napi_default_method = static_cast(napi_writable | napi_configurable); - - Napi::Function t = DefineClass(env, "Database", { - InstanceMethod("close", &Database::Close, napi_default_method), - InstanceMethod("exec", &Database::Exec, napi_default_method), - InstanceMethod("wait", &Database::Wait, napi_default_method), - InstanceMethod("loadExtension", &Database::LoadExtension, napi_default_method), - InstanceMethod("serialize", &Database::Serialize, napi_default_method), - InstanceMethod("parallelize", &Database::Parallelize, napi_default_method), - InstanceMethod("configure", &Database::Configure, napi_default_method), - InstanceMethod("interrupt", &Database::Interrupt, napi_default_method), - InstanceAccessor("open", &Database::OpenGetter, nullptr) - }); - -#if NAPI_VERSION < 6 - constructor = Napi::Persistent(t); - constructor.SuppressDestruct(); -#else - Napi::FunctionReference* constructor = new Napi::FunctionReference(); - *constructor = Napi::Persistent(t); - env.SetInstanceData(constructor); -#endif - - exports.Set("Database", t); - return exports; -} - -void Database::Process() { - Napi::Env env = this->Env(); - Napi::HandleScope scope(env); - - if (!open && locked && !queue.empty()) { - EXCEPTION(Napi::String::New(env, "Database handle is closed"), SQLITE_MISUSE, exception); - Napi::Value argv[] = { exception }; - bool called = false; - - // Call all callbacks with the error object. - while (!queue.empty()) { - std::unique_ptr call(queue.front()); - queue.pop(); - std::unique_ptr baton(call->baton); - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - TRY_CATCH_CALL(this->Value(), cb, 1, argv); - called = true; - } - } - - // When we couldn't call a callback function, emit an error on the - // Database object. - if (!called) { - Napi::Value info[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(Value(), 2, info); - } - return; - } - - while (open && (!locked || pending == 0) && !queue.empty()) { - Call *c = queue.front(); - - if (c->exclusive && pending > 0) { - break; - } - - queue.pop(); - std::unique_ptr call(c); - locked = call->exclusive; - call->callback(call->baton); - - if (locked) break; - } -} - -void Database::Schedule(Work_Callback callback, Baton* baton, bool exclusive) { - Napi::Env env = this->Env(); - Napi::HandleScope scope(env); - - if (!open && locked) { - EXCEPTION(Napi::String::New(env, "Database is closed"), SQLITE_MISUSE, exception); - Napi::Function cb = baton->callback.Value(); - // We don't call the actual callback, so we have to make sure that - // the baton gets destroyed. - delete baton; - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { exception }; - TRY_CATCH_CALL(Value(), cb, 1, argv); - } - else { - Napi::Value argv[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(Value(), 2, argv); - } - return; - } - - if (!open || ((locked || exclusive || serialize) && pending > 0)) { - queue.push(new Call(callback, baton, exclusive || serialize)); - } - else { - locked = exclusive; - callback(baton); - } -} - -Database::Database(const Napi::CallbackInfo& info) : Napi::ObjectWrap(info) { - init(); - Napi::Env env = info.Env(); - - if (info.Length() <= 0 || !info[0].IsString()) { - Napi::TypeError::New(env, "String expected").ThrowAsJavaScriptException(); - return; - } - std::string filename = info[0].As(); - - unsigned int pos = 1; - - int mode; - if (info.Length() >= pos && info[pos].IsNumber() && OtherIsInt(info[pos].As())) { - mode = info[pos++].As().Int32Value(); - } - else { - mode = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX; - } - - Napi::Function callback; - if (info.Length() >= pos && info[pos].IsFunction()) { - callback = info[pos++].As(); - } - - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("filename", info[0].As(), napi_default)); - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("mode", Napi::Number::New(env, mode), napi_default)); - - // Start opening the database. - OpenBaton* baton = new OpenBaton(this, callback, filename.c_str(), mode); - Work_BeginOpen(baton); -} - -void Database::Work_BeginOpen(Baton* baton) { - Napi::Env env = baton->db->Env(); - int status = napi_create_async_work( - env, NULL, Napi::String::New(env, "sqlite3.Database.Open"), - Work_Open, Work_AfterOpen, baton, &baton->request - ); - assert(status == 0); - napi_queue_async_work(env, baton->request); -} - -void Database::Work_Open(napi_env e, void* data) { - OpenBaton* baton = static_cast(data); - Database* db = baton->db; - - baton->status = sqlite3_open_v2( - baton->filename.c_str(), - &db->_handle, - baton->mode, - NULL - ); - - if (baton->status != SQLITE_OK) { - baton->message = std::string(sqlite3_errmsg(db->_handle)); - sqlite3_close(db->_handle); - db->_handle = NULL; - } - else { - // Set default database handle values. - sqlite3_busy_timeout(db->_handle, 1000); - } -} - -void Database::Work_AfterOpen(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - - Database* db = baton->db; - - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - Napi::Value argv[1]; - if (baton->status != SQLITE_OK) { - EXCEPTION(Napi::String::New(env, baton->message.c_str()), baton->status, exception); - argv[0] = exception; - } - else { - db->open = true; - argv[0] = env.Null(); - } - - Napi::Function cb = baton->callback.Value(); - - if (IS_FUNCTION(cb)) { - TRY_CATCH_CALL(db->Value(), cb, 1, argv); - } - else if (!db->open) { - Napi::Value info[] = { Napi::String::New(env, "error"), argv[0] }; - EMIT_EVENT(db->Value(), 2, info); - } - - if (db->open) { - Napi::Value info[] = { Napi::String::New(env, "open") }; - EMIT_EVENT(db->Value(), 1, info); - db->Process(); - } -} - -Napi::Value Database::OpenGetter(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - return Napi::Boolean::New(env, db->open); -} - -Napi::Value Database::Close(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Database* db = this; - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - Baton* baton = new Baton(db, callback); - db->Schedule(Work_BeginClose, baton, true); - - return info.This(); -} - -void Database::Work_BeginClose(Baton* baton) { - assert(baton->db->locked); - assert(baton->db->open); - assert(baton->db->_handle); - assert(baton->db->pending == 0); - - baton->db->pending++; - baton->db->RemoveCallbacks(); - baton->db->closing = true; - - Napi::Env env = baton->db->Env(); - - int status = napi_create_async_work( - env, NULL, Napi::String::New(env, "sqlite3.Database.Close"), - Work_Close, Work_AfterClose, baton, &baton->request - ); - assert(status == 0); - napi_queue_async_work(env, baton->request); -} - -void Database::Work_Close(napi_env e, void* data) { - Baton* baton = static_cast(data); - Database* db = baton->db; - - baton->status = sqlite3_close(db->_handle); - - if (baton->status != SQLITE_OK) { - baton->message = std::string(sqlite3_errmsg(db->_handle)); - } - else { - db->_handle = NULL; - } -} - -void Database::Work_AfterClose(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - - Database* db = baton->db; - - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - db->pending--; - db->closing = false; - - Napi::Value argv[1]; - if (baton->status != SQLITE_OK) { - EXCEPTION(Napi::String::New(env, baton->message.c_str()), baton->status, exception); - argv[0] = exception; - } - else { - db->open = false; - // Leave db->locked to indicate that this db object has reached - // the end of its life. - argv[0] = env.Null(); - } - - Napi::Function cb = baton->callback.Value(); - - // Fire callbacks. - if (IS_FUNCTION(cb)) { - TRY_CATCH_CALL(db->Value(), cb, 1, argv); - } - else if (db->open) { - Napi::Value info[] = { Napi::String::New(env, "error"), argv[0] }; - EMIT_EVENT(db->Value(), 2, info); - } - - if (!db->open) { - Napi::Value info[] = { Napi::String::New(env, "close"), argv[0] }; - EMIT_EVENT(db->Value(), 1, info); - db->Process(); - } -} - -Napi::Value Database::Serialize(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - bool before = db->serialize; - db->serialize = true; - - if (!callback.IsEmpty() && callback.IsFunction()) { - TRY_CATCH_CALL(info.This(), callback, 0, NULL, info.This()); - db->serialize = before; - } - - db->Process(); - - return info.This(); -} - -Napi::Value Database::Parallelize(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - bool before = db->serialize; - db->serialize = false; - - if (!callback.IsEmpty() && callback.IsFunction()) { - TRY_CATCH_CALL(info.This(), callback, 0, NULL, info.This()); - db->serialize = before; - } - - db->Process(); - - return info.This(); -} - -Napi::Value Database::Configure(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - - REQUIRE_ARGUMENTS(2); - - if (info[0].StrictEquals( Napi::String::New(env, "trace"))) { - Napi::Function handle; - Baton* baton = new Baton(db, handle); - db->Schedule(RegisterTraceCallback, baton); - } - else if (info[0].StrictEquals( Napi::String::New(env, "profile"))) { - Napi::Function handle; - Baton* baton = new Baton(db, handle); - db->Schedule(RegisterProfileCallback, baton); - } - else if (info[0].StrictEquals( Napi::String::New(env, "busyTimeout"))) { - if (!info[1].IsNumber()) { - Napi::TypeError::New(env, "Value must be an integer").ThrowAsJavaScriptException(); - return env.Null(); - } - Napi::Function handle; - Baton* baton = new Baton(db, handle); - baton->status = info[1].As().Int32Value(); - db->Schedule(SetBusyTimeout, baton); - } - else if (info[0].StrictEquals( Napi::String::New(env, "limit"))) { - REQUIRE_ARGUMENTS(3); - if (!info[1].IsNumber()) { - Napi::TypeError::New(env, "limit id must be an integer").ThrowAsJavaScriptException(); - return env.Null(); - } - if (!info[2].IsNumber()) { - Napi::TypeError::New(env, "limit value must be an integer").ThrowAsJavaScriptException(); - return env.Null(); - } - Napi::Function handle; - int id = info[1].As().Int32Value(); - int value = info[2].As().Int32Value(); - Baton* baton = new LimitBaton(db, handle, id, value); - db->Schedule(SetLimit, baton); - } - else if (info[0].StrictEquals(Napi::String::New(env, "change"))) { - Napi::Function handle; - Baton* baton = new Baton(db, handle); - db->Schedule(RegisterUpdateCallback, baton); - } - else { - Napi::TypeError::New(env, (StringConcat( -#if V8_MAJOR_VERSION > 6 - info.GetIsolate(), -#endif - info[0].As(), - Napi::String::New(env, " is not a valid configuration option") - )).Utf8Value().c_str()).ThrowAsJavaScriptException(); - return env.Null(); - } - - db->Process(); - - return info.This(); -} - -Napi::Value Database::Interrupt(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - - if (!db->open) { - Napi::Error::New(env, "Database is not open").ThrowAsJavaScriptException(); - return env.Null(); - } - - if (db->closing) { - Napi::Error::New(env, "Database is closing").ThrowAsJavaScriptException(); - return env.Null(); - } - - sqlite3_interrupt(db->_handle); - return info.This(); -} - -void Database::SetBusyTimeout(Baton* b) { - std::unique_ptr baton(b); - - assert(baton->db->open); - assert(baton->db->_handle); - - // Abuse the status field for passing the timeout. - sqlite3_busy_timeout(baton->db->_handle, baton->status); -} - -void Database::SetLimit(Baton* b) { - std::unique_ptr baton(static_cast(b)); - - assert(baton->db->open); - assert(baton->db->_handle); - - sqlite3_limit(baton->db->_handle, baton->id, baton->value); -} - -void Database::RegisterTraceCallback(Baton* b) { - std::unique_ptr baton(b); - assert(baton->db->open); - assert(baton->db->_handle); - Database* db = baton->db; - - if (db->debug_trace == NULL) { - // Add it. - db->debug_trace = new AsyncTrace(db, TraceCallback); - sqlite3_trace(db->_handle, TraceCallback, db); - } - else { - // Remove it. - sqlite3_trace(db->_handle, NULL, NULL); - db->debug_trace->finish(); - db->debug_trace = NULL; - } -} - -void Database::TraceCallback(void* db, const char* sql) { - // Note: This function is called in the thread pool. - // Note: Some queries, such as "EXPLAIN" queries, are not sent through this. - static_cast(db)->debug_trace->send(new std::string(sql)); -} - -void Database::TraceCallback(Database* db, std::string* s) { - std::unique_ptr sql(s); - // Note: This function is called in the main V8 thread. - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - Napi::Value argv[] = { - Napi::String::New(env, "trace"), - Napi::String::New(env, sql->c_str()) - }; - EMIT_EVENT(db->Value(), 2, argv); -} - -void Database::RegisterProfileCallback(Baton* b) { - std::unique_ptr baton(b); - assert(baton->db->open); - assert(baton->db->_handle); - Database* db = baton->db; - - if (db->debug_profile == NULL) { - // Add it. - db->debug_profile = new AsyncProfile(db, ProfileCallback); - sqlite3_profile(db->_handle, ProfileCallback, db); - } - else { - // Remove it. - sqlite3_profile(db->_handle, NULL, NULL); - db->debug_profile->finish(); - db->debug_profile = NULL; - } -} - -void Database::ProfileCallback(void* db, const char* sql, sqlite3_uint64 nsecs) { - // Note: This function is called in the thread pool. - // Note: Some queries, such as "EXPLAIN" queries, are not sent through this. - ProfileInfo* info = new ProfileInfo(); - info->sql = std::string(sql); - info->nsecs = nsecs; - static_cast(db)->debug_profile->send(info); -} - -void Database::ProfileCallback(Database *db, ProfileInfo* i) { - std::unique_ptr info(i); - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - Napi::Value argv[] = { - Napi::String::New(env, "profile"), - Napi::String::New(env, info->sql.c_str()), - Napi::Number::New(env, (double)info->nsecs / 1000000.0) - }; - EMIT_EVENT(db->Value(), 3, argv); -} - -void Database::RegisterUpdateCallback(Baton* b) { - std::unique_ptr baton(b); - assert(baton->db->open); - assert(baton->db->_handle); - Database* db = baton->db; - - if (db->update_event == NULL) { - // Add it. - db->update_event = new AsyncUpdate(db, UpdateCallback); - sqlite3_update_hook(db->_handle, UpdateCallback, db); - } - else { - // Remove it. - sqlite3_update_hook(db->_handle, NULL, NULL); - db->update_event->finish(); - db->update_event = NULL; - } -} - -void Database::UpdateCallback(void* db, int type, const char* database, - const char* table, sqlite3_int64 rowid) { - // Note: This function is called in the thread pool. - // Note: Some queries, such as "EXPLAIN" queries, are not sent through this. - UpdateInfo* info = new UpdateInfo(); - info->type = type; - info->database = std::string(database); - info->table = std::string(table); - info->rowid = rowid; - static_cast(db)->update_event->send(info); -} - -void Database::UpdateCallback(Database *db, UpdateInfo* i) { - std::unique_ptr info(i); - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - Napi::Value argv[] = { - Napi::String::New(env, "change"), - Napi::String::New(env, sqlite_authorizer_string(info->type)), - Napi::String::New(env, info->database.c_str()), - Napi::String::New(env, info->table.c_str()), - Napi::Number::New(env, info->rowid), - }; - EMIT_EVENT(db->Value(), 5, argv); -} - -Napi::Value Database::Exec(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - - REQUIRE_ARGUMENT_STRING(0, sql); - OPTIONAL_ARGUMENT_FUNCTION(1, callback); - - Baton* baton = new ExecBaton(db, callback, sql.c_str()); - db->Schedule(Work_BeginExec, baton, true); - - return info.This(); -} - -void Database::Work_BeginExec(Baton* baton) { - assert(baton->db->locked); - assert(baton->db->open); - assert(baton->db->_handle); - assert(baton->db->pending == 0); - baton->db->pending++; - Napi::Env env = baton->db->Env(); - int status = napi_create_async_work( - env, NULL, Napi::String::New(env, "sqlite3.Database.Exec"), - Work_Exec, Work_AfterExec, baton, &baton->request - ); - assert(status == 0); - napi_queue_async_work(env, baton->request); -} - -void Database::Work_Exec(napi_env e, void* data) { - ExecBaton* baton = static_cast(data); - - char* message = NULL; - baton->status = sqlite3_exec( - baton->db->_handle, - baton->sql.c_str(), - NULL, - NULL, - &message - ); - - if (baton->status != SQLITE_OK && message != NULL) { - baton->message = std::string(message); - sqlite3_free(message); - } -} - -void Database::Work_AfterExec(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - - Database* db = baton->db; - db->pending--; - - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - Napi::Function cb = baton->callback.Value(); - - if (baton->status != SQLITE_OK) { - EXCEPTION(Napi::String::New(env, baton->message.c_str()), baton->status, exception); - - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { exception }; - TRY_CATCH_CALL(db->Value(), cb, 1, argv); - } - else { - Napi::Value info[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(db->Value(), 2, info); - } - } - else if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(db->Value(), cb, 1, argv); - } - - db->Process(); -} - -Napi::Value Database::Wait(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Database* db = this; - - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - Baton* baton = new Baton(db, callback); - db->Schedule(Work_Wait, baton, true); - - return info.This(); -} - -void Database::Work_Wait(Baton* b) { - std::unique_ptr baton(b); - - Napi::Env env = baton->db->Env(); - Napi::HandleScope scope(env); - - assert(baton->db->locked); - assert(baton->db->open); - assert(baton->db->_handle); - assert(baton->db->pending == 0); - - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(baton->db->Value(), cb, 1, argv); - } - - baton->db->Process(); -} - -Napi::Value Database::LoadExtension(const Napi::CallbackInfo& info) { - Napi::Env env = this->Env(); - Database* db = this; - - REQUIRE_ARGUMENT_STRING(0, filename); - OPTIONAL_ARGUMENT_FUNCTION(1, callback); - - Baton* baton = new LoadExtensionBaton(db, callback, filename.c_str()); - db->Schedule(Work_BeginLoadExtension, baton, true); - - return info.This(); -} - -void Database::Work_BeginLoadExtension(Baton* baton) { - assert(baton->db->locked); - assert(baton->db->open); - assert(baton->db->_handle); - assert(baton->db->pending == 0); - baton->db->pending++; - Napi::Env env = baton->db->Env(); - int status = napi_create_async_work( - env, NULL, Napi::String::New(env, "sqlite3.Database.LoadExtension"), - Work_LoadExtension, Work_AfterLoadExtension, baton, &baton->request - ); - assert(status == 0); - napi_queue_async_work(env, baton->request); -} - -void Database::Work_LoadExtension(napi_env e, void* data) { - LoadExtensionBaton* baton = static_cast(data); - - sqlite3_enable_load_extension(baton->db->_handle, 1); - - char* message = NULL; - baton->status = sqlite3_load_extension( - baton->db->_handle, - baton->filename.c_str(), - 0, - &message - ); - - sqlite3_enable_load_extension(baton->db->_handle, 0); - - if (baton->status != SQLITE_OK && message != NULL) { - baton->message = std::string(message); - sqlite3_free(message); - } -} - -void Database::Work_AfterLoadExtension(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - - Database* db = baton->db; - db->pending--; - - Napi::Env env = db->Env(); - Napi::HandleScope scope(env); - - Napi::Function cb = baton->callback.Value(); - - if (baton->status != SQLITE_OK) { - EXCEPTION(Napi::String::New(env, baton->message.c_str()), baton->status, exception); - - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { exception }; - TRY_CATCH_CALL(db->Value(), cb, 1, argv); - } - else { - Napi::Value info[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(db->Value(), 2, info); - } - } - else if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(db->Value(), cb, 1, argv); - } - - db->Process(); -} - -void Database::RemoveCallbacks() { - if (debug_trace) { - debug_trace->finish(); - debug_trace = NULL; - } - if (debug_profile) { - debug_profile->finish(); - debug_profile = NULL; - } - if (update_event) { - update_event->finish(); - update_event = NULL; - } -} diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/database.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/database.h deleted file mode 100644 index 420b5dd1c..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/database.h +++ /dev/null @@ -1,214 +0,0 @@ - -#ifndef NODE_SQLITE3_SRC_DATABASE_H -#define NODE_SQLITE3_SRC_DATABASE_H - - -#include -#include -#include - -#include -#include - -#include "async.h" - -using namespace Napi; - -namespace node_sqlite3 { - -class Database; - - -class Database : public Napi::ObjectWrap { -public: -#if NAPI_VERSION < 6 - static Napi::FunctionReference constructor; -#endif - static Napi::Object Init(Napi::Env env, Napi::Object exports); - - static inline bool HasInstance(Napi::Value val) { - Napi::Env env = val.Env(); - Napi::HandleScope scope(env); - if (!val.IsObject()) return false; - Napi::Object obj = val.As(); -#if NAPI_VERSION < 6 - return obj.InstanceOf(constructor.Value()); -#else - Napi::FunctionReference* constructor = - env.GetInstanceData(); - return obj.InstanceOf(constructor->Value()); -#endif - } - - struct Baton { - napi_async_work request = NULL; - Database* db; - Napi::FunctionReference callback; - int status; - std::string message; - - Baton(Database* db_, Napi::Function cb_) : - db(db_), status(SQLITE_OK) { - db->Ref(); - if (!cb_.IsUndefined() && cb_.IsFunction()) { - callback.Reset(cb_, 1); - } - } - virtual ~Baton() { - if (request) napi_delete_async_work(db->Env(), request); - db->Unref(); - callback.Reset(); - } - }; - - struct OpenBaton : Baton { - std::string filename; - int mode; - OpenBaton(Database* db_, Napi::Function cb_, const char* filename_, int mode_) : - Baton(db_, cb_), filename(filename_), mode(mode_) {} - }; - - struct ExecBaton : Baton { - std::string sql; - ExecBaton(Database* db_, Napi::Function cb_, const char* sql_) : - Baton(db_, cb_), sql(sql_) {} - }; - - struct LoadExtensionBaton : Baton { - std::string filename; - LoadExtensionBaton(Database* db_, Napi::Function cb_, const char* filename_) : - Baton(db_, cb_), filename(filename_) {} - }; - - struct LimitBaton : Baton { - int id; - int value; - LimitBaton(Database* db_, Napi::Function cb_, int id_, int value_) : - Baton(db_, cb_), id(id_), value(value_) {} - }; - - typedef void (*Work_Callback)(Baton* baton); - - struct Call { - Call(Work_Callback cb_, Baton* baton_, bool exclusive_ = false) : - callback(cb_), exclusive(exclusive_), baton(baton_) {}; - Work_Callback callback; - bool exclusive; - Baton* baton; - }; - - struct ProfileInfo { - std::string sql; - sqlite3_int64 nsecs; - }; - - struct UpdateInfo { - int type; - std::string database; - std::string table; - sqlite3_int64 rowid; - }; - - bool IsOpen() { return open; } - bool IsLocked() { return locked; } - - typedef Async AsyncTrace; - typedef Async AsyncProfile; - typedef Async AsyncUpdate; - - friend class Statement; - friend class Backup; - - void init() { - _handle = NULL; - open = false; - closing = false; - locked = false; - pending = 0; - serialize = false; - debug_trace = NULL; - debug_profile = NULL; - update_event = NULL; - } - - Database(const Napi::CallbackInfo& info); - - ~Database() { - RemoveCallbacks(); - sqlite3_close(_handle); - _handle = NULL; - open = false; - } - -protected: - static void Work_BeginOpen(Baton* baton); - static void Work_Open(napi_env env, void* data); - static void Work_AfterOpen(napi_env env, napi_status status, void* data); - - Napi::Value OpenGetter(const Napi::CallbackInfo& info); - - void Schedule(Work_Callback callback, Baton* baton, bool exclusive = false); - void Process(); - - Napi::Value Exec(const Napi::CallbackInfo& info); - static void Work_BeginExec(Baton* baton); - static void Work_Exec(napi_env env, void* data); - static void Work_AfterExec(napi_env env, napi_status status, void* data); - - Napi::Value Wait(const Napi::CallbackInfo& info); - static void Work_Wait(Baton* baton); - - Napi::Value Close(const Napi::CallbackInfo& info); - static void Work_BeginClose(Baton* baton); - static void Work_Close(napi_env env, void* data); - static void Work_AfterClose(napi_env env, napi_status status, void* data); - - Napi::Value LoadExtension(const Napi::CallbackInfo& info); - static void Work_BeginLoadExtension(Baton* baton); - static void Work_LoadExtension(napi_env env, void* data); - static void Work_AfterLoadExtension(napi_env env, napi_status status, void* data); - - Napi::Value Serialize(const Napi::CallbackInfo& info); - Napi::Value Parallelize(const Napi::CallbackInfo& info); - - Napi::Value Configure(const Napi::CallbackInfo& info); - - Napi::Value Interrupt(const Napi::CallbackInfo& info); - - static void SetBusyTimeout(Baton* baton); - static void SetLimit(Baton* baton); - - static void RegisterTraceCallback(Baton* baton); - static void TraceCallback(void* db, const char* sql); - static void TraceCallback(Database* db, std::string* sql); - - static void RegisterProfileCallback(Baton* baton); - static void ProfileCallback(void* db, const char* sql, sqlite3_uint64 nsecs); - static void ProfileCallback(Database* db, ProfileInfo* info); - - static void RegisterUpdateCallback(Baton* baton); - static void UpdateCallback(void* db, int type, const char* database, const char* table, sqlite3_int64 rowid); - static void UpdateCallback(Database* db, UpdateInfo* info); - - void RemoveCallbacks(); - -protected: - sqlite3* _handle; - - bool open; - bool closing; - bool locked; - unsigned int pending; - - bool serialize; - - std::queue queue; - - AsyncTrace* debug_trace; - AsyncProfile* debug_profile; - AsyncUpdate* update_event; -}; - -} - -#endif diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/gcc-preinclude.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/gcc-preinclude.h deleted file mode 100644 index 7a52a4dc1..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/gcc-preinclude.h +++ /dev/null @@ -1,30 +0,0 @@ -// http://web.archive.org/web/20140401031018/http://rjpower9000.wordpress.com:80/2012/04/09/fun-with-shared-libraries-version-glibc_2-14-not-found/ - -#if defined(__linux__) - -#define _GNU_SOURCE -#include -#undef _GNU_SOURCE - -#if defined(__USE_GNU) - -#if defined(__x86_64__) -__asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); -__asm__(".symver exp,exp@GLIBC_2.2.5"); -__asm__(".symver log,log@GLIBC_2.2.5"); -__asm__(".symver log2,log2@GLIBC_2.2.5"); -__asm__(".symver pow,pow@GLIBC_2.2.5"); -__asm__(".symver fcntl64,fcntl@GLIBC_2.2.5"); -#endif - -#if defined(__aarch64__) || defined(_M_ARM64) -__asm__(".symver memcpy,memcpy@GLIBC_2.17"); -__asm__(".symver exp,exp@GLIBC_2.17"); -__asm__(".symver log,log@GLIBC_2.17"); -__asm__(".symver log2,log2@GLIBC_2.17"); -__asm__(".symver pow,pow@GLIBC_2.17"); -__asm__(".symver fcntl64,fcntl@GLIBC_2.17"); -#endif - -#endif -#endif diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/macros.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/macros.h deleted file mode 100644 index 344642d9d..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/macros.h +++ /dev/null @@ -1,215 +0,0 @@ -#ifndef NODE_SQLITE3_SRC_MACROS_H -#define NODE_SQLITE3_SRC_MACROS_H - -const char* sqlite_code_string(int code); -const char* sqlite_authorizer_string(int type); -#include - -// TODO: better way to work around StringConcat? -#include -inline Napi::String StringConcat(Napi::Value str1, Napi::Value str2) { - return Napi::String::New(str1.Env(), str1.As().Utf8Value() + - str2.As().Utf8Value() ); -} - -// A Napi substitute IsInt32() -inline bool OtherIsInt(Napi::Number source) { - double orig_val = source.DoubleValue(); - double int_val = (double)source.Int32Value(); - if (orig_val == int_val) { - return true; - } else { - return false; - } -} - -#define IS_FUNCTION(cb) \ - !cb.IsUndefined() && cb.IsFunction() - -#define REQUIRE_ARGUMENTS(n) \ - if (info.Length() < (n)) { \ - Napi::TypeError::New(env, "Expected " #n "arguments").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } - - -#define REQUIRE_ARGUMENT_EXTERNAL(i, var) \ - if (info.Length() <= (i) || !info[i].IsExternal()) { \ - Napi::TypeError::New(env, "Argument " #i " invalid").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } \ - Napi::External var = info[i].As(); - - -#define REQUIRE_ARGUMENT_FUNCTION(i, var) \ - if (info.Length() <= (i) || !info[i].IsFunction()) { \ - Napi::TypeError::New(env, "Argument " #i " must be a function").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } \ - Napi::Function var = info[i].As(); - - -#define REQUIRE_ARGUMENT_STRING(i, var) \ - if (info.Length() <= (i) || !info[i].IsString()) { \ - Napi::TypeError::New(env, "Argument " #i " must be a string").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } \ - std::string var = info[i].As(); - -#define REQUIRE_ARGUMENT_INTEGER(i, var) \ - if (info.Length() <= (i) || !info[i].IsNumber()) { \ - Napi::TypeError::New(env, "Argument " #i " must be an integer").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } \ - int var(info[i].As().Int32Value()); - -#define OPTIONAL_ARGUMENT_FUNCTION(i, var) \ - Napi::Function var; \ - if (info.Length() > i && !info[i].IsUndefined()) { \ - if (!info[i].IsFunction()) { \ - Napi::TypeError::New(env, "Argument " #i " must be a function").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } \ - var = info[i].As(); \ - } - - -#define OPTIONAL_ARGUMENT_INTEGER(i, var, default) \ - int var; \ - if (info.Length() <= (i)) { \ - var = (default); \ - } \ - else if (info[i].IsNumber()) { \ - if (OtherIsInt(info[i].As())) { \ - var = info[i].As().Int32Value(); \ - } \ - } \ - else { \ - Napi::TypeError::New(env, "Argument " #i " must be an integer").ThrowAsJavaScriptException(); \ - return env.Null(); \ - } - - -#define DEFINE_CONSTANT_INTEGER(target, constant, name) \ - Napi::PropertyDescriptor::Value(#name, Napi::Number::New(env, constant), \ - static_cast(napi_enumerable | napi_configurable)), - -#define DEFINE_CONSTANT_STRING(target, constant, name) \ - Napi::PropertyDescriptor::Value(#name, Napi::String::New(env, constant), \ - static_cast(napi_enumerable | napi_configurable)), - -#define EXCEPTION(msg, errno, name) \ - Napi::Value name = Napi::Error::New(env, \ - StringConcat( \ - StringConcat( \ - Napi::String::New(env, sqlite_code_string(errno)), \ - Napi::String::New(env, ": ") \ - ), \ - (msg) \ - ).Utf8Value() \ - ).Value(); \ - Napi::Object name ##_obj = name.As(); \ - (name ##_obj).Set( Napi::String::New(env, "errno"), Napi::Number::New(env, errno)); \ - (name ##_obj).Set( Napi::String::New(env, "code"), \ - Napi::String::New(env, sqlite_code_string(errno))); - - -#define EMIT_EVENT(obj, argc, argv) \ - TRY_CATCH_CALL((obj), \ - (obj).Get("emit").As(),\ - argc, argv \ - ); - -// The Mac OS compiler complains when argv is NULL unless we -// first assign it to a locally defined variable. -#define TRY_CATCH_CALL(context, callback, argc, argv, ...) \ - Napi::Value* passed_argv = argv;\ - std::vector args;\ - if ((argc != 0) && (passed_argv != NULL)) {\ - args.assign(passed_argv, passed_argv + argc);\ - }\ - Napi::Value res = (callback).Call(Napi::Value(context), args); \ - if (res.IsEmpty()) return __VA_ARGS__; - -#define WORK_DEFINITION(name) \ - Napi::Value name(const Napi::CallbackInfo& info); \ - static void Work_Begin##name(Baton* baton); \ - static void Work_##name(napi_env env, void* data); \ - static void Work_After##name(napi_env env, napi_status status, void* data); - -#define STATEMENT_BEGIN(type) \ - assert(baton); \ - assert(baton->stmt); \ - assert(!baton->stmt->locked); \ - assert(!baton->stmt->finalized); \ - assert(baton->stmt->prepared); \ - baton->stmt->locked = true; \ - baton->stmt->db->pending++; \ - Napi::Env env = baton->stmt->Env(); \ - int status = napi_create_async_work( \ - env, NULL, Napi::String::New(env, "sqlite3.Statement."#type), \ - Work_##type, Work_After##type, baton, &baton->request \ - ); \ - assert(status == 0); \ - napi_queue_async_work(env, baton->request); - -#define STATEMENT_INIT(type) \ - type* baton = static_cast(data); \ - Statement* stmt = baton->stmt; - -#define STATEMENT_MUTEX(name) \ - if (!stmt->db->_handle) { \ - stmt->status = SQLITE_MISUSE; \ - stmt->message = "Database handle is closed"; \ - return; \ - } \ - sqlite3_mutex* name = sqlite3_db_mutex(stmt->db->_handle); - -#define STATEMENT_END() \ - assert(stmt->locked); \ - assert(stmt->db->pending); \ - stmt->locked = false; \ - stmt->db->pending--; \ - stmt->Process(); \ - stmt->db->Process(); - -#define BACKUP_BEGIN(type) \ - assert(baton); \ - assert(baton->backup); \ - assert(!baton->backup->locked); \ - assert(!baton->backup->finished); \ - assert(baton->backup->inited); \ - baton->backup->locked = true; \ - baton->backup->db->pending++; \ - Napi::Env env = baton->backup->Env(); \ - int status = napi_create_async_work( \ - env, NULL, Napi::String::New(env, "sqlite3.Backup."#type), \ - Work_##type, Work_After##type, baton, &baton->request \ - ); \ - assert(status == 0); \ - napi_queue_async_work(env, baton->request); - -#define BACKUP_INIT(type) \ - type* baton = static_cast(data); \ - Backup* backup = baton->backup; - -#define BACKUP_END() \ - assert(backup->locked); \ - assert(backup->db->pending); \ - backup->locked = false; \ - backup->db->pending--; \ - backup->Process(); \ - backup->db->Process(); - -#define DELETE_FIELD(field) \ - if (field != NULL) { \ - switch ((field)->type) { \ - case SQLITE_INTEGER: delete (Values::Integer*)(field); break; \ - case SQLITE_FLOAT: delete (Values::Float*)(field); break; \ - case SQLITE_TEXT: delete (Values::Text*)(field); break; \ - case SQLITE_BLOB: delete (Values::Blob*)(field); break; \ - case SQLITE_NULL: delete (Values::Null*)(field); break; \ - } \ - } - -#endif diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/node_sqlite3.cc b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/node_sqlite3.cc deleted file mode 100644 index 6f47a68a8..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/node_sqlite3.cc +++ /dev/null @@ -1,128 +0,0 @@ -#include -#include -#include -#include -#include - -#include "macros.h" -#include "database.h" -#include "statement.h" -#include "backup.h" - -using namespace node_sqlite3; - -namespace { - -Napi::Object RegisterModule(Napi::Env env, Napi::Object exports) { - Napi::HandleScope scope(env); - - Database::Init(env, exports); - Statement::Init(env, exports); - Backup::Init(env, exports); - - exports.DefineProperties({ - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_READONLY, OPEN_READONLY) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_READWRITE, OPEN_READWRITE) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_CREATE, OPEN_CREATE) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_FULLMUTEX, OPEN_FULLMUTEX) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_URI, OPEN_URI) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_SHAREDCACHE, OPEN_SHAREDCACHE) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OPEN_PRIVATECACHE, OPEN_PRIVATECACHE) - DEFINE_CONSTANT_STRING(exports, SQLITE_VERSION, VERSION) -#ifdef SQLITE_SOURCE_ID - DEFINE_CONSTANT_STRING(exports, SQLITE_SOURCE_ID, SOURCE_ID) -#endif - DEFINE_CONSTANT_INTEGER(exports, SQLITE_VERSION_NUMBER, VERSION_NUMBER) - - DEFINE_CONSTANT_INTEGER(exports, SQLITE_OK, OK) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_ERROR, ERROR) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_INTERNAL, INTERNAL) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_PERM, PERM) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_ABORT, ABORT) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_BUSY, BUSY) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LOCKED, LOCKED) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_NOMEM, NOMEM) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_READONLY, READONLY) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_INTERRUPT, INTERRUPT) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_IOERR, IOERR) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_CORRUPT, CORRUPT) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_NOTFOUND, NOTFOUND) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_FULL, FULL) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_CANTOPEN, CANTOPEN) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_PROTOCOL, PROTOCOL) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_EMPTY, EMPTY) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_SCHEMA, SCHEMA) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_TOOBIG, TOOBIG) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_CONSTRAINT, CONSTRAINT) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_MISMATCH, MISMATCH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_MISUSE, MISUSE) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_NOLFS, NOLFS) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_AUTH, AUTH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_FORMAT, FORMAT) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_RANGE, RANGE) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_NOTADB, NOTADB) - - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_LENGTH, LIMIT_LENGTH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_SQL_LENGTH, LIMIT_SQL_LENGTH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_COLUMN, LIMIT_COLUMN) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_EXPR_DEPTH, LIMIT_EXPR_DEPTH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_COMPOUND_SELECT, LIMIT_COMPOUND_SELECT) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_VDBE_OP, LIMIT_VDBE_OP) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_FUNCTION_ARG, LIMIT_FUNCTION_ARG) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_ATTACHED, LIMIT_ATTACHED) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_LIKE_PATTERN_LENGTH, LIMIT_LIKE_PATTERN_LENGTH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_VARIABLE_NUMBER, LIMIT_VARIABLE_NUMBER) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_TRIGGER_DEPTH, LIMIT_TRIGGER_DEPTH) - DEFINE_CONSTANT_INTEGER(exports, SQLITE_LIMIT_WORKER_THREADS, LIMIT_WORKER_THREADS) - }); - - return exports; -} - -} - -const char* sqlite_code_string(int code) { - switch (code) { - case SQLITE_OK: return "SQLITE_OK"; - case SQLITE_ERROR: return "SQLITE_ERROR"; - case SQLITE_INTERNAL: return "SQLITE_INTERNAL"; - case SQLITE_PERM: return "SQLITE_PERM"; - case SQLITE_ABORT: return "SQLITE_ABORT"; - case SQLITE_BUSY: return "SQLITE_BUSY"; - case SQLITE_LOCKED: return "SQLITE_LOCKED"; - case SQLITE_NOMEM: return "SQLITE_NOMEM"; - case SQLITE_READONLY: return "SQLITE_READONLY"; - case SQLITE_INTERRUPT: return "SQLITE_INTERRUPT"; - case SQLITE_IOERR: return "SQLITE_IOERR"; - case SQLITE_CORRUPT: return "SQLITE_CORRUPT"; - case SQLITE_NOTFOUND: return "SQLITE_NOTFOUND"; - case SQLITE_FULL: return "SQLITE_FULL"; - case SQLITE_CANTOPEN: return "SQLITE_CANTOPEN"; - case SQLITE_PROTOCOL: return "SQLITE_PROTOCOL"; - case SQLITE_EMPTY: return "SQLITE_EMPTY"; - case SQLITE_SCHEMA: return "SQLITE_SCHEMA"; - case SQLITE_TOOBIG: return "SQLITE_TOOBIG"; - case SQLITE_CONSTRAINT: return "SQLITE_CONSTRAINT"; - case SQLITE_MISMATCH: return "SQLITE_MISMATCH"; - case SQLITE_MISUSE: return "SQLITE_MISUSE"; - case SQLITE_NOLFS: return "SQLITE_NOLFS"; - case SQLITE_AUTH: return "SQLITE_AUTH"; - case SQLITE_FORMAT: return "SQLITE_FORMAT"; - case SQLITE_RANGE: return "SQLITE_RANGE"; - case SQLITE_NOTADB: return "SQLITE_NOTADB"; - case SQLITE_ROW: return "SQLITE_ROW"; - case SQLITE_DONE: return "SQLITE_DONE"; - default: return "UNKNOWN"; - } -} - -const char* sqlite_authorizer_string(int type) { - switch (type) { - case SQLITE_INSERT: return "insert"; - case SQLITE_UPDATE: return "update"; - case SQLITE_DELETE: return "delete"; - default: return ""; - } -} - -NODE_API_MODULE(node_sqlite3, RegisterModule) diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/statement.cc b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/statement.cc deleted file mode 100644 index 29e06f992..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/statement.cc +++ /dev/null @@ -1,954 +0,0 @@ -#include -#include -#include - -#include "macros.h" -#include "database.h" -#include "statement.h" - -using namespace node_sqlite3; - -Napi::Object Statement::Init(Napi::Env env, Napi::Object exports) { - Napi::HandleScope scope(env); - - // declare napi_default_method here as it is only available in Node v14.12.0+ - napi_property_attributes napi_default_method = static_cast(napi_writable | napi_configurable); - - Napi::Function t = DefineClass(env, "Statement", { - InstanceMethod("bind", &Statement::Bind, napi_default_method), - InstanceMethod("get", &Statement::Get, napi_default_method), - InstanceMethod("run", &Statement::Run, napi_default_method), - InstanceMethod("all", &Statement::All, napi_default_method), - InstanceMethod("each", &Statement::Each, napi_default_method), - InstanceMethod("reset", &Statement::Reset, napi_default_method), - InstanceMethod("finalize", &Statement::Finalize_, napi_default_method), - }); - - exports.Set("Statement", t); - return exports; -} - -// A Napi InstanceOf for Javascript Objects "Date" and "RegExp" -bool OtherInstanceOf(Napi::Object source, const char* object_type) { - if (strncmp(object_type, "Date", 4) == 0) { - return source.InstanceOf(source.Env().Global().Get("Date").As()); - } else if (strncmp(object_type, "RegExp", 6) == 0) { - return source.InstanceOf(source.Env().Global().Get("RegExp").As()); - } - - return false; -} - -void Statement::Process() { - if (finalized && !queue.empty()) { - return CleanQueue(); - } - - while (prepared && !locked && !queue.empty()) { - std::unique_ptr call(queue.front()); - queue.pop(); - - call->callback(call->baton); - } -} - -void Statement::Schedule(Work_Callback callback, Baton* baton) { - if (finalized) { - queue.push(new Call(callback, baton)); - CleanQueue(); - } - else if (!prepared || locked) { - queue.push(new Call(callback, baton)); - } - else { - callback(baton); - } -} - -template void Statement::Error(T* baton) { - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - // Fail hard on logic errors. - assert(stmt->status != 0); - EXCEPTION(Napi::String::New(env, stmt->message.c_str()), stmt->status, exception); - - Napi::Function cb = baton->callback.Value(); - - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { exception }; - TRY_CATCH_CALL(stmt->Value(), cb, 1, argv); - } - else { - Napi::Value argv[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(stmt->Value(), 2, argv); - } -} - -// { Database db, String sql, Array params, Function callback } -Statement::Statement(const Napi::CallbackInfo& info) : Napi::ObjectWrap(info) { - Napi::Env env = info.Env(); - int length = info.Length(); - - if (length <= 0 || !Database::HasInstance(info[0])) { - Napi::TypeError::New(env, "Database object expected").ThrowAsJavaScriptException(); - return; - } - else if (length <= 1 || !info[1].IsString()) { - Napi::TypeError::New(env, "SQL query expected").ThrowAsJavaScriptException(); - return; - } - else if (length > 2 && !info[2].IsUndefined() && !info[2].IsFunction()) { - Napi::TypeError::New(env, "Callback expected").ThrowAsJavaScriptException(); - return; - } - - Database* db = Napi::ObjectWrap::Unwrap(info[0].As()); - Napi::String sql = info[1].As(); - - info.This().As().DefineProperty(Napi::PropertyDescriptor::Value("sql", sql, napi_default)); - - init(db); - Statement* stmt = this; - - PrepareBaton* baton = new PrepareBaton(db, info[2].As(), stmt); - baton->sql = std::string(sql.As().Utf8Value().c_str()); - db->Schedule(Work_BeginPrepare, baton); -} - -void Statement::Work_BeginPrepare(Database::Baton* baton) { - assert(baton->db->open); - baton->db->pending++; - Napi::Env env = baton->db->Env(); - int status = napi_create_async_work( - env, NULL, Napi::String::New(env, "sqlite3.Statement.Prepare"), - Work_Prepare, Work_AfterPrepare, baton, &baton->request - ); - assert(status == 0); - napi_queue_async_work(env, baton->request); -} - -void Statement::Work_Prepare(napi_env e, void* data) { - STATEMENT_INIT(PrepareBaton); - - // In case preparing fails, we use a mutex to make sure we get the associated - // error message. - STATEMENT_MUTEX(mtx); - sqlite3_mutex_enter(mtx); - - stmt->status = sqlite3_prepare_v2( - baton->db->_handle, - baton->sql.c_str(), - baton->sql.size(), - &stmt->_handle, - NULL - ); - - if (stmt->status != SQLITE_OK) { - stmt->message = std::string(sqlite3_errmsg(baton->db->_handle)); - stmt->_handle = NULL; - } - - sqlite3_mutex_leave(mtx); -} - -void Statement::Work_AfterPrepare(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - if (stmt->status != SQLITE_OK) { - Error(baton.get()); - stmt->Finalize_(); - } - else { - stmt->prepared = true; - if (!baton->callback.IsEmpty() && baton->callback.Value().IsFunction()) { - Napi::Function cb = baton->callback.Value(); - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(stmt->Value(), cb, 1, argv); - } - } - - STATEMENT_END(); -} - -template Values::Field* - Statement::BindParameter(const Napi::Value source, T pos) { - if (source.IsString()) { - std::string val = source.As().Utf8Value(); - return new Values::Text(pos, val.length(), val.c_str()); - } - else if (OtherInstanceOf(source.As(), "RegExp")) { - std::string val = source.ToString().Utf8Value(); - return new Values::Text(pos, val.length(), val.c_str()); - } - else if (source.IsNumber()) { - if (OtherIsInt(source.As())) { - return new Values::Integer(pos, source.As().Int32Value()); - } else { - return new Values::Float(pos, source.As().DoubleValue()); - } - } - else if (source.IsBoolean()) { - return new Values::Integer(pos, source.As().Value() ? 1 : 0); - } - else if (source.IsNull()) { - return new Values::Null(pos); - } - else if (source.IsBuffer()) { - Napi::Buffer buffer = source.As>(); - return new Values::Blob(pos, buffer.Length(), buffer.Data()); - } - else if (OtherInstanceOf(source.As(), "Date")) { - return new Values::Float(pos, source.ToNumber().DoubleValue()); - } - else if (source.IsObject()) { - Napi::String napiVal = Napi::String::New(source.Env(), "[object Object]"); - // Check whether toString returned a value that is not undefined. - if(napiVal.Type() == 0) { - return NULL; - } - - std::string val = napiVal.Utf8Value(); - return new Values::Text(pos, val.length(), val.c_str()); - } - else { - return NULL; - } -} - -template T* Statement::Bind(const Napi::CallbackInfo& info, int start, int last) { - Napi::Env env = info.Env(); - Napi::HandleScope scope(env); - - if (last < 0) last = info.Length(); - Napi::Function callback; - if (last > start && info[last - 1].IsFunction()) { - callback = info[last - 1].As(); - last--; - } - - T* baton = new T(this, callback); - - if (start < last) { - if (info[start].IsArray()) { - Napi::Array array = info[start].As(); - int length = array.Length(); - // Note: bind parameters start with 1. - for (int i = 0, pos = 1; i < length; i++, pos++) { - baton->parameters.push_back(BindParameter((array).Get(i), pos)); - } - } - else if (!info[start].IsObject() || OtherInstanceOf(info[start].As(), "RegExp") || OtherInstanceOf(info[start].As(), "Date") || info[start].IsBuffer()) { - // Parameters directly in array. - // Note: bind parameters start with 1. - for (int i = start, pos = 1; i < last; i++, pos++) { - baton->parameters.push_back(BindParameter(info[i], pos)); - } - } - else if (info[start].IsObject()) { - Napi::Object object = info[start].As(); - Napi::Array array = object.GetPropertyNames(); - int length = array.Length(); - for (int i = 0; i < length; i++) { - Napi::Value name = (array).Get(i); - Napi::Number num = name.ToNumber(); - - if (num.Int32Value() == num.DoubleValue()) { - baton->parameters.push_back( - BindParameter((object).Get(name), num.Int32Value())); - } - else { - baton->parameters.push_back(BindParameter((object).Get(name), - name.As().Utf8Value().c_str())); - } - } - } - else { - return NULL; - } - } - - return baton; -} - -bool Statement::Bind(const Parameters & parameters) { - if (parameters.size() == 0) { - return true; - } - - sqlite3_reset(_handle); - sqlite3_clear_bindings(_handle); - - Parameters::const_iterator it = parameters.begin(); - Parameters::const_iterator end = parameters.end(); - - for (; it < end; ++it) { - Values::Field* field = *it; - - if (field != NULL) { - unsigned int pos; - if (field->index > 0) { - pos = field->index; - } - else { - pos = sqlite3_bind_parameter_index(_handle, field->name.c_str()); - } - - switch (field->type) { - case SQLITE_INTEGER: { - status = sqlite3_bind_int(_handle, pos, - ((Values::Integer*)field)->value); - } break; - case SQLITE_FLOAT: { - status = sqlite3_bind_double(_handle, pos, - ((Values::Float*)field)->value); - } break; - case SQLITE_TEXT: { - status = sqlite3_bind_text(_handle, pos, - ((Values::Text*)field)->value.c_str(), - ((Values::Text*)field)->value.size(), SQLITE_TRANSIENT); - } break; - case SQLITE_BLOB: { - status = sqlite3_bind_blob(_handle, pos, - ((Values::Blob*)field)->value, - ((Values::Blob*)field)->length, SQLITE_TRANSIENT); - } break; - case SQLITE_NULL: { - status = sqlite3_bind_null(_handle, pos); - } break; - } - - if (status != SQLITE_OK) { - message = std::string(sqlite3_errmsg(db->_handle)); - return false; - } - } - } - - return true; -} - -Napi::Value Statement::Bind(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - - Baton* baton = stmt->Bind(info); - if (baton == NULL) { - Napi::TypeError::New(env, "Data type is not supported").ThrowAsJavaScriptException(); - return env.Null(); - } - else { - stmt->Schedule(Work_BeginBind, baton); - return info.This(); - } -} - -void Statement::Work_BeginBind(Baton* baton) { - STATEMENT_BEGIN(Bind); -} - -void Statement::Work_Bind(napi_env e, void* data) { - STATEMENT_INIT(Baton); - - STATEMENT_MUTEX(mtx); - sqlite3_mutex_enter(mtx); - stmt->Bind(baton->parameters); - sqlite3_mutex_leave(mtx); -} - -void Statement::Work_AfterBind(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - if (stmt->status != SQLITE_OK) { - Error(baton.get()); - } - else { - // Fire callbacks. - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(stmt->Value(), cb, 1, argv); - } - } - - STATEMENT_END(); -} - - - -Napi::Value Statement::Get(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - - Baton* baton = stmt->Bind(info); - if (baton == NULL) { - Napi::Error::New(env, "Data type is not supported").ThrowAsJavaScriptException(); - return env.Null(); - } - else { - stmt->Schedule(Work_BeginGet, baton); - return info.This(); - } -} - -void Statement::Work_BeginGet(Baton* baton) { - STATEMENT_BEGIN(Get); -} - -void Statement::Work_Get(napi_env e, void* data) { - STATEMENT_INIT(RowBaton); - - if (stmt->status != SQLITE_DONE || baton->parameters.size()) { - STATEMENT_MUTEX(mtx); - sqlite3_mutex_enter(mtx); - - if (stmt->Bind(baton->parameters)) { - stmt->status = sqlite3_step(stmt->_handle); - - if (!(stmt->status == SQLITE_ROW || stmt->status == SQLITE_DONE)) { - stmt->message = std::string(sqlite3_errmsg(stmt->db->_handle)); - } - } - - sqlite3_mutex_leave(mtx); - - if (stmt->status == SQLITE_ROW) { - // Acquire one result row before returning. - GetRow(&baton->row, stmt->_handle); - } - } -} - -void Statement::Work_AfterGet(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - if (stmt->status != SQLITE_ROW && stmt->status != SQLITE_DONE) { - Error(baton.get()); - } - else { - // Fire callbacks. - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - if (stmt->status == SQLITE_ROW) { - // Create the result array from the data we acquired. - Napi::Value argv[] = { env.Null(), RowToJS(env, &baton->row) }; - TRY_CATCH_CALL(stmt->Value(), cb, 2, argv); - } - else { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(stmt->Value(), cb, 1, argv); - } - } - } - - STATEMENT_END(); -} - -Napi::Value Statement::Run(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - - Baton* baton = stmt->Bind(info); - if (baton == NULL) { - Napi::Error::New(env, "Data type is not supported").ThrowAsJavaScriptException(); - return env.Null(); - } - else { - stmt->Schedule(Work_BeginRun, baton); - return info.This(); - } -} - -void Statement::Work_BeginRun(Baton* baton) { - STATEMENT_BEGIN(Run); -} - -void Statement::Work_Run(napi_env e, void* data) { - STATEMENT_INIT(RunBaton); - - STATEMENT_MUTEX(mtx); - sqlite3_mutex_enter(mtx); - - // Make sure that we also reset when there are no parameters. - if (!baton->parameters.size()) { - sqlite3_reset(stmt->_handle); - } - - if (stmt->Bind(baton->parameters)) { - stmt->status = sqlite3_step(stmt->_handle); - - if (!(stmt->status == SQLITE_ROW || stmt->status == SQLITE_DONE)) { - stmt->message = std::string(sqlite3_errmsg(stmt->db->_handle)); - } - else { - baton->inserted_id = sqlite3_last_insert_rowid(stmt->db->_handle); - baton->changes = sqlite3_changes(stmt->db->_handle); - } - } - - sqlite3_mutex_leave(mtx); -} - -void Statement::Work_AfterRun(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - if (stmt->status != SQLITE_ROW && stmt->status != SQLITE_DONE) { - Error(baton.get()); - } - else { - // Fire callbacks. - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - (stmt->Value()).Set(Napi::String::New(env, "lastID"), Napi::Number::New(env, baton->inserted_id)); - (stmt->Value()).Set( Napi::String::New(env, "changes"), Napi::Number::New(env, baton->changes)); - - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(stmt->Value(), cb, 1, argv); - } - } - - STATEMENT_END(); -} - -Napi::Value Statement::All(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - - Baton* baton = stmt->Bind(info); - if (baton == NULL) { - Napi::Error::New(env, "Data type is not supported").ThrowAsJavaScriptException(); - return env.Null(); - } - else { - stmt->Schedule(Work_BeginAll, baton); - return info.This(); - } -} - -void Statement::Work_BeginAll(Baton* baton) { - STATEMENT_BEGIN(All); -} - -void Statement::Work_All(napi_env e, void* data) { - STATEMENT_INIT(RowsBaton); - - STATEMENT_MUTEX(mtx); - sqlite3_mutex_enter(mtx); - - // Make sure that we also reset when there are no parameters. - if (!baton->parameters.size()) { - sqlite3_reset(stmt->_handle); - } - - if (stmt->Bind(baton->parameters)) { - while ((stmt->status = sqlite3_step(stmt->_handle)) == SQLITE_ROW) { - Row* row = new Row(); - GetRow(row, stmt->_handle); - baton->rows.push_back(row); - } - - if (stmt->status != SQLITE_DONE) { - stmt->message = std::string(sqlite3_errmsg(stmt->db->_handle)); - } - } - - sqlite3_mutex_leave(mtx); -} - -void Statement::Work_AfterAll(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - if (stmt->status != SQLITE_DONE) { - Error(baton.get()); - } - else { - // Fire callbacks. - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - if (baton->rows.size()) { - // Create the result array from the data we acquired. - Napi::Array result(Napi::Array::New(env, baton->rows.size())); - Rows::const_iterator it = baton->rows.begin(); - Rows::const_iterator end = baton->rows.end(); - for (int i = 0; it < end; ++it, i++) { - std::unique_ptr row(*it); - (result).Set(i, RowToJS(env,row.get())); - } - - Napi::Value argv[] = { env.Null(), result }; - TRY_CATCH_CALL(stmt->Value(), cb, 2, argv); - } - else { - // There were no result rows. - Napi::Value argv[] = { - env.Null(), - Napi::Array::New(env, 0) - }; - TRY_CATCH_CALL(stmt->Value(), cb, 2, argv); - } - } - } - - STATEMENT_END(); -} - -Napi::Value Statement::Each(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - - int last = info.Length(); - - Napi::Function completed; - if (last >= 2 && info[last - 1].IsFunction() && info[last - 2].IsFunction()) { - completed = info[--last].As(); - } - - EachBaton* baton = stmt->Bind(info, 0, last); - if (baton == NULL) { - Napi::Error::New(env, "Data type is not supported").ThrowAsJavaScriptException(); - return env.Null(); - } - else { - baton->completed.Reset(completed, 1); - stmt->Schedule(Work_BeginEach, baton); - return info.This(); - } -} - -void Statement::Work_BeginEach(Baton* baton) { - // Only create the Async object when we're actually going into - // the event loop. This prevents dangling events. - EachBaton* each_baton = static_cast(baton); - each_baton->async = new Async(each_baton->stmt, reinterpret_cast(AsyncEach)); - each_baton->async->item_cb.Reset(each_baton->callback.Value(), 1); - each_baton->async->completed_cb.Reset(each_baton->completed.Value(), 1); - - STATEMENT_BEGIN(Each); -} - -void Statement::Work_Each(napi_env e, void* data) { - STATEMENT_INIT(EachBaton); - - Async* async = baton->async; - - STATEMENT_MUTEX(mtx); - - int retrieved = 0; - - // Make sure that we also reset when there are no parameters. - if (!baton->parameters.size()) { - sqlite3_reset(stmt->_handle); - } - - if (stmt->Bind(baton->parameters)) { - while (true) { - sqlite3_mutex_enter(mtx); - stmt->status = sqlite3_step(stmt->_handle); - if (stmt->status == SQLITE_ROW) { - sqlite3_mutex_leave(mtx); - Row* row = new Row(); - GetRow(row, stmt->_handle); - NODE_SQLITE3_MUTEX_LOCK(&async->mutex) - async->data.push_back(row); - retrieved++; - NODE_SQLITE3_MUTEX_UNLOCK(&async->mutex) - - uv_async_send(&async->watcher); - } - else { - if (stmt->status != SQLITE_DONE) { - stmt->message = std::string(sqlite3_errmsg(stmt->db->_handle)); - } - sqlite3_mutex_leave(mtx); - break; - } - } - } - - async->completed = true; - uv_async_send(&async->watcher); -} - -void Statement::CloseCallback(uv_handle_t* handle) { - assert(handle != NULL); - assert(handle->data != NULL); - Async* async = static_cast(handle->data); - delete async; -} - -void Statement::AsyncEach(uv_async_t* handle) { - Async* async = static_cast(handle->data); - - Napi::Env env = async->stmt->Env(); - Napi::HandleScope scope(env); - - while (true) { - // Get the contents out of the data cache for us to process in the JS callback. - Rows rows; - NODE_SQLITE3_MUTEX_LOCK(&async->mutex) - rows.swap(async->data); - NODE_SQLITE3_MUTEX_UNLOCK(&async->mutex) - - if (rows.empty()) { - break; - } - - Napi::Function cb = async->item_cb.Value(); - if (IS_FUNCTION(cb)) { - Napi::Value argv[2]; - argv[0] = env.Null(); - - Rows::const_iterator it = rows.begin(); - Rows::const_iterator end = rows.end(); - for (int i = 0; it < end; ++it, i++) { - std::unique_ptr row(*it); - argv[1] = RowToJS(env,row.get()); - async->retrieved++; - TRY_CATCH_CALL(async->stmt->Value(), cb, 2, argv); - } - } - } - - Napi::Function cb = async->completed_cb.Value(); - if (async->completed) { - if (!cb.IsEmpty() && - cb.IsFunction()) { - Napi::Value argv[] = { - env.Null(), - Napi::Number::New(env, async->retrieved) - }; - TRY_CATCH_CALL(async->stmt->Value(), cb, 2, argv); - } - uv_close(reinterpret_cast(handle), CloseCallback); - } -} - -void Statement::Work_AfterEach(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - if (stmt->status != SQLITE_DONE) { - Error(baton.get()); - } - - STATEMENT_END(); -} - -Napi::Value Statement::Reset(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - Baton* baton = new Baton(stmt, callback); - stmt->Schedule(Work_BeginReset, baton); - - return info.This(); -} - -void Statement::Work_BeginReset(Baton* baton) { - STATEMENT_BEGIN(Reset); -} - -void Statement::Work_Reset(napi_env e, void* data) { - STATEMENT_INIT(Baton); - - sqlite3_reset(stmt->_handle); - stmt->status = SQLITE_OK; -} - -void Statement::Work_AfterReset(napi_env e, napi_status status, void* data) { - std::unique_ptr baton(static_cast(data)); - Statement* stmt = baton->stmt; - - Napi::Env env = stmt->Env(); - Napi::HandleScope scope(env); - - // Fire callbacks. - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - Napi::Value argv[] = { env.Null() }; - TRY_CATCH_CALL(stmt->Value(), cb, 1, argv); - } - - STATEMENT_END(); -} - -Napi::Value Statement::RowToJS(Napi::Env env, Row* row) { - Napi::EscapableHandleScope scope(env); - - Napi::Object result = Napi::Object::New(env); - - Row::const_iterator it = row->begin(); - Row::const_iterator end = row->end(); - for (int i = 0; it < end; ++it, i++) { - Values::Field* field = *it; - - Napi::Value value; - - switch (field->type) { - case SQLITE_INTEGER: { - value = Napi::Number::New(env, ((Values::Integer*)field)->value); - } break; - case SQLITE_FLOAT: { - value = Napi::Number::New(env, ((Values::Float*)field)->value); - } break; - case SQLITE_TEXT: { - value = Napi::String::New(env, ((Values::Text*)field)->value.c_str(), ((Values::Text*)field)->value.size()); - } break; - case SQLITE_BLOB: { - value = Napi::Buffer::Copy(env, ((Values::Blob*)field)->value, ((Values::Blob*)field)->length); - } break; - case SQLITE_NULL: { - value = env.Null(); - } break; - } - - (result).Set(Napi::String::New(env, field->name.c_str()), value); - - DELETE_FIELD(field); - } - - return scope.Escape(result); -} - -void Statement::GetRow(Row* row, sqlite3_stmt* stmt) { - int cols = sqlite3_column_count(stmt); - - for (int i = 0; i < cols; i++) { - int type = sqlite3_column_type(stmt, i); - const char* name = sqlite3_column_name(stmt, i); - if (name == NULL) { - assert(false); - } - - switch (type) { - case SQLITE_INTEGER: { - row->push_back(new Values::Integer(name, sqlite3_column_int64(stmt, i))); - } break; - case SQLITE_FLOAT: { - row->push_back(new Values::Float(name, sqlite3_column_double(stmt, i))); - } break; - case SQLITE_TEXT: { - const char* text = (const char*)sqlite3_column_text(stmt, i); - int length = sqlite3_column_bytes(stmt, i); - row->push_back(new Values::Text(name, length, text)); - } break; - case SQLITE_BLOB: { - const void* blob = sqlite3_column_blob(stmt, i); - int length = sqlite3_column_bytes(stmt, i); - row->push_back(new Values::Blob(name, length, blob)); - } break; - case SQLITE_NULL: { - row->push_back(new Values::Null(name)); - } break; - default: - assert(false); - } - } -} - -Napi::Value Statement::Finalize_(const Napi::CallbackInfo& info) { - Napi::Env env = info.Env(); - Statement* stmt = this; - OPTIONAL_ARGUMENT_FUNCTION(0, callback); - - Baton* baton = new Baton(stmt, callback); - stmt->Schedule(Finalize_, baton); - - return stmt->db->Value(); -} - -void Statement::Finalize_(Baton* b) { - std::unique_ptr baton(b); - Napi::Env env = baton->stmt->Env(); - Napi::HandleScope scope(env); - - baton->stmt->Finalize_(); - - // Fire callback in case there was one. - Napi::Function cb = baton->callback.Value(); - if (IS_FUNCTION(cb)) { - TRY_CATCH_CALL(baton->stmt->Value(), cb, 0, NULL); - } -} - -void Statement::Finalize_() { - assert(!finalized); - finalized = true; - CleanQueue(); - // Finalize returns the status code of the last operation. We already fired - // error events in case those failed. - sqlite3_finalize(_handle); - _handle = NULL; - db->Unref(); -} - -void Statement::CleanQueue() { - Napi::Env env = this->Env(); - Napi::HandleScope scope(env); - - if (prepared && !queue.empty()) { - // This statement has already been prepared and is now finalized. - // Fire error for all remaining items in the queue. - EXCEPTION(Napi::String::New(env, "Statement is already finalized"), SQLITE_MISUSE, exception); - Napi::Value argv[] = { exception }; - bool called = false; - - // Clear out the queue so that this object can get GC'ed. - while (!queue.empty()) { - std::unique_ptr call(queue.front()); - queue.pop(); - - std::unique_ptr baton(call->baton); - Napi::Function cb = baton->callback.Value(); - - if (prepared && !cb.IsEmpty() && - cb.IsFunction()) { - TRY_CATCH_CALL(Value(), cb, 1, argv); - called = true; - } - } - - // When we couldn't call a callback function, emit an error on the - // Statement object. - if (!called) { - Napi::Value info[] = { Napi::String::New(env, "error"), exception }; - EMIT_EVENT(Value(), 2, info); - } - } - else while (!queue.empty()) { - // Just delete all items in the queue; we already fired an event when - // preparing the statement failed. - std::unique_ptr call(queue.front()); - queue.pop(); - // We don't call the actual callback, so we have to make sure that - // the baton gets destroyed. - delete call->baton; - } -} diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/statement.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/statement.h deleted file mode 100644 index dec0015d1..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/statement.h +++ /dev/null @@ -1,249 +0,0 @@ -#ifndef NODE_SQLITE3_SRC_STATEMENT_H -#define NODE_SQLITE3_SRC_STATEMENT_H - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "database.h" -#include "threading.h" - -using namespace Napi; - -namespace node_sqlite3 { - -namespace Values { - struct Field { - inline Field(unsigned short _index, unsigned short _type = SQLITE_NULL) : - type(_type), index(_index) {} - inline Field(const char* _name, unsigned short _type = SQLITE_NULL) : - type(_type), index(0), name(_name) {} - - unsigned short type; - unsigned short index; - std::string name; - }; - - struct Integer : Field { - template inline Integer(T _name, int64_t val) : - Field(_name, SQLITE_INTEGER), value(val) {} - int64_t value; - }; - - struct Float : Field { - template inline Float(T _name, double val) : - Field(_name, SQLITE_FLOAT), value(val) {} - double value; - }; - - struct Text : Field { - template inline Text(T _name, size_t len, const char* val) : - Field(_name, SQLITE_TEXT), value(val, len) {} - std::string value; - }; - - struct Blob : Field { - template inline Blob(T _name, size_t len, const void* val) : - Field(_name, SQLITE_BLOB), length(len) { - value = (char*)malloc(len); - memcpy(value, val, len); - } - inline ~Blob() { - free(value); - } - int length; - char* value; - }; - - typedef Field Null; -} - -typedef std::vector Row; -typedef std::vector Rows; -typedef Row Parameters; - - - -class Statement : public Napi::ObjectWrap { -public: - static Napi::Object Init(Napi::Env env, Napi::Object exports); - static Napi::Value New(const Napi::CallbackInfo& info); - - struct Baton { - napi_async_work request = NULL; - Statement* stmt; - Napi::FunctionReference callback; - Parameters parameters; - - Baton(Statement* stmt_, Napi::Function cb_) : stmt(stmt_) { - stmt->Ref(); - callback.Reset(cb_, 1); - } - virtual ~Baton() { - for (size_t i = 0; i < parameters.size(); i++) { - Values::Field* field = parameters[i]; - DELETE_FIELD(field); - } - if (request) napi_delete_async_work(stmt->Env(), request); - stmt->Unref(); - callback.Reset(); - } - }; - - struct RowBaton : Baton { - RowBaton(Statement* stmt_, Napi::Function cb_) : - Baton(stmt_, cb_) {} - Row row; - }; - - struct RunBaton : Baton { - RunBaton(Statement* stmt_, Napi::Function cb_) : - Baton(stmt_, cb_), inserted_id(0), changes(0) {} - sqlite3_int64 inserted_id; - int changes; - }; - - struct RowsBaton : Baton { - RowsBaton(Statement* stmt_, Napi::Function cb_) : - Baton(stmt_, cb_) {} - Rows rows; - }; - - struct Async; - - struct EachBaton : Baton { - Napi::FunctionReference completed; - Async* async; // Isn't deleted when the baton is deleted. - - EachBaton(Statement* stmt_, Napi::Function cb_) : - Baton(stmt_, cb_) {} - virtual ~EachBaton() { - completed.Reset(); - } - }; - - struct PrepareBaton : Database::Baton { - Statement* stmt; - std::string sql; - PrepareBaton(Database* db_, Napi::Function cb_, Statement* stmt_) : - Baton(db_, cb_), stmt(stmt_) { - stmt->Ref(); - } - virtual ~PrepareBaton() { - stmt->Unref(); - if (!db->IsOpen() && db->IsLocked()) { - // The database handle was closed before the statement could be - // prepared. - stmt->Finalize_(); - } - } - }; - - typedef void (*Work_Callback)(Baton* baton); - - struct Call { - Call(Work_Callback cb_, Baton* baton_) : callback(cb_), baton(baton_) {}; - Work_Callback callback; - Baton* baton; - }; - - struct Async { - uv_async_t watcher; - Statement* stmt; - Rows data; - NODE_SQLITE3_MUTEX_t; - bool completed; - int retrieved; - - // Store the callbacks here because we don't have - // access to the baton in the async callback. - Napi::FunctionReference item_cb; - Napi::FunctionReference completed_cb; - - Async(Statement* st, uv_async_cb async_cb) : - stmt(st), completed(false), retrieved(0) { - watcher.data = this; - NODE_SQLITE3_MUTEX_INIT - stmt->Ref(); - uv_loop_t *loop; - napi_get_uv_event_loop(stmt->Env(), &loop); - uv_async_init(loop, &watcher, async_cb); - } - - ~Async() { - stmt->Unref(); - item_cb.Reset(); - completed_cb.Reset(); - NODE_SQLITE3_MUTEX_DESTROY - } - }; - - void init(Database* db_) { - db = db_; - _handle = NULL; - status = SQLITE_OK; - prepared = false; - locked = true; - finalized = false; - db->Ref(); - } - - Statement(const Napi::CallbackInfo& info); - - ~Statement() { - if (!finalized) Finalize_(); - } - - WORK_DEFINITION(Bind); - WORK_DEFINITION(Get); - WORK_DEFINITION(Run); - WORK_DEFINITION(All); - WORK_DEFINITION(Each); - WORK_DEFINITION(Reset); - - Napi::Value Finalize_(const Napi::CallbackInfo& info); - -protected: - static void Work_BeginPrepare(Database::Baton* baton); - static void Work_Prepare(napi_env env, void* data); - static void Work_AfterPrepare(napi_env env, napi_status status, void* data); - - static void AsyncEach(uv_async_t* handle); - static void CloseCallback(uv_handle_t* handle); - - static void Finalize_(Baton* baton); - void Finalize_(); - - template inline Values::Field* BindParameter(const Napi::Value source, T pos); - template T* Bind(const Napi::CallbackInfo& info, int start = 0, int end = -1); - bool Bind(const Parameters ¶meters); - - static void GetRow(Row* row, sqlite3_stmt* stmt); - static Napi::Value RowToJS(Napi::Env env, Row* row); - void Schedule(Work_Callback callback, Baton* baton); - void Process(); - void CleanQueue(); - template static void Error(T* baton); - -protected: - Database* db; - - sqlite3_stmt* _handle; - int status; - std::string message; - - bool prepared; - bool locked; - bool finalized; - std::queue queue; -}; - -} - -#endif diff --git a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/threading.h b/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/threading.h deleted file mode 100644 index 7c7139bd3..000000000 --- a/.yarn/unplugged/sqlite3-virtual-01b65fb1d2/node_modules/sqlite3/src/threading.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef NODE_SQLITE3_SRC_THREADING_H -#define NODE_SQLITE3_SRC_THREADING_H - -#define NODE_SQLITE3_MUTEX_t uv_mutex_t mutex; -#define NODE_SQLITE3_MUTEX_INIT uv_mutex_init(&mutex); -#define NODE_SQLITE3_MUTEX_LOCK(m) uv_mutex_lock(m); -#define NODE_SQLITE3_MUTEX_UNLOCK(m) uv_mutex_unlock(m); -#define NODE_SQLITE3_MUTEX_DESTROY uv_mutex_destroy(&mutex); - -#endif // NODE_SQLITE3_SRC_THREADING_H diff --git a/package.json b/package.json index 8e2afffa1..9e650499f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "@lerna-lite/run": "^2.3.0", "@lerna-lite/version": "^2.3.0", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.0", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", @@ -38,12 +37,8 @@ "typescript": "^5.0.4" }, "packageManager": "yarn@4.0.0-rc.43", - "dependencies": { - "newrelic": "^10.1.0" - }, - "dependenciesMeta": { - "newrelic@10.1.0": { - "unplugged": true - } + "optionalDependencies": { + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/analytics/bin/report.ts b/packages/analytics/bin/report.ts index 1558bdfd6..db88d1f45 100644 --- a/packages/analytics/bin/report.ts +++ b/packages/analytics/bin/report.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { EmailLevel } from '@standardnotes/domain-core' diff --git a/packages/analytics/bin/worker.ts b/packages/analytics/bin/worker.ts index 0190d5935..2e7124487 100644 --- a/packages/analytics/bin/worker.ts +++ b/packages/analytics/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events' import * as dayjs from 'dayjs' diff --git a/packages/analytics/package.json b/packages/analytics/package.json index a4e996623..dedd7b2a0 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -28,7 +28,6 @@ "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", "@types/mixpanel": "^2.14.4", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.0", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", @@ -42,7 +41,6 @@ "dependencies": { "@aws-sdk/client-sns": "^3.332.0", "@aws-sdk/client-sqs": "^3.332.0", - "@newrelic/winston-enricher": "^4.0.1", "@standardnotes/common": "workspace:*", "@standardnotes/domain-core": "workspace:^", "@standardnotes/domain-events": "workspace:*", @@ -54,9 +52,13 @@ "ioredis": "^5.2.4", "mixpanel": "^0.17.0", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "reflect-metadata": "^0.1.13", "typeorm": "^0.3.15", "winston": "^3.8.1" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/analytics/src/Bootstrap/Container.ts b/packages/analytics/src/Bootstrap/Container.ts index 80b9a62dd..754b506d1 100644 --- a/packages/analytics/src/Bootstrap/Container.ts +++ b/packages/analytics/src/Bootstrap/Container.ts @@ -58,9 +58,6 @@ import { SQSClient, SQSClientConfig } from '@aws-sdk/client-sqs' import { SessionCreatedEventHandler } from '../Domain/Handler/SessionCreatedEventHandler' import { SessionRefreshedEventHandler } from '../Domain/Handler/SessionRefreshedEventHandler' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') - export class ContainerConfigLoader { async load(): Promise { const env: Env = new Env() @@ -81,9 +78,12 @@ export class ContainerConfigLoader { container.bind(TYPES.Redis).toConstantValue(redis) - const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') + const newrelicWinstonFormatter = newrelicFormatter(winston) winstonFormatters.push(newrelicWinstonFormatter()) } diff --git a/packages/api-gateway/bin/server.ts b/packages/api-gateway/bin/server.ts index 983f987d2..2a293c40c 100644 --- a/packages/api-gateway/bin/server.ts +++ b/packages/api-gateway/bin/server.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import '../src/Controller/LegacyController' import '../src/Controller/HealthCheckController' diff --git a/packages/api-gateway/package.json b/packages/api-gateway/package.json index da145c961..d09bf8c76 100644 --- a/packages/api-gateway/package.json +++ b/packages/api-gateway/package.json @@ -26,7 +26,6 @@ "upgrade:snjs": "yarn ncu -u '@standardnotes/*'" }, "dependencies": { - "@newrelic/winston-enricher": "^4.0.1", "@standardnotes/domain-core": "workspace:^", "@standardnotes/domain-events": "workspace:*", "@standardnotes/domain-events-infra": "workspace:*", @@ -42,7 +41,6 @@ "inversify-express-utils": "^6.4.3", "ioredis": "^5.2.4", "jsonwebtoken": "^9.0.0", - "newrelic": "^10.1.0", "prettyjson": "^1.2.5", "reflect-metadata": "0.1.13", "winston": "^3.8.1" @@ -53,7 +51,6 @@ "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", "@types/jsonwebtoken": "^9.0.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.5", "@types/prettyjson": "^0.0.30", "@typescript-eslint/eslint-plugin": "^5.59.2", @@ -66,5 +63,10 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/api-gateway/src/Bootstrap/Container.ts b/packages/api-gateway/src/Bootstrap/Container.ts index 089509a15..4a5370550 100644 --- a/packages/api-gateway/src/Bootstrap/Container.ts +++ b/packages/api-gateway/src/Bootstrap/Container.ts @@ -23,9 +23,6 @@ import { RequiredCrossServiceTokenMiddleware } from '../Controller/RequiredCross import { OptionalCrossServiceTokenMiddleware } from '../Controller/OptionalCrossServiceTokenMiddleware' import { Transform } from 'stream' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') - export class ContainerConfigLoader { async load(configuration?: { serviceContainer?: ServiceContainerInterface; logger?: Transform }): Promise { const env: Env = new Env() @@ -35,9 +32,12 @@ export class ContainerConfigLoader { const isConfiguredForHomeServer = env.get('CACHE_TYPE') === 'memory' - const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') + const newrelicWinstonFormatter = newrelicFormatter(winston) winstonFormatters.push(newrelicWinstonFormatter()) } diff --git a/packages/auth/bin/backup.ts b/packages/auth/bin/backup.ts index d59bbea06..dcf782fb4 100644 --- a/packages/auth/bin/backup.ts +++ b/packages/auth/bin/backup.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Stream } from 'stream' import { Logger } from 'winston' diff --git a/packages/auth/bin/cleanup.ts b/packages/auth/bin/cleanup.ts index bbc1485d6..f7e0219e4 100644 --- a/packages/auth/bin/cleanup.ts +++ b/packages/auth/bin/cleanup.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { ContainerConfigLoader } from '../src/Bootstrap/Container' diff --git a/packages/auth/bin/server.ts b/packages/auth/bin/server.ts index 08ae4d780..91e1c4662 100644 --- a/packages/auth/bin/server.ts +++ b/packages/auth/bin/server.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import '../src/Infra/InversifyExpressUtils/InversifyExpressAuthController' import '../src/Infra/InversifyExpressUtils/InversifyExpressAuthenticatorsController' import '../src/Infra/InversifyExpressUtils/InversifyExpressSessionsController' diff --git a/packages/auth/bin/stats.ts b/packages/auth/bin/stats.ts index 5f4d0c178..bb5715c73 100644 --- a/packages/auth/bin/stats.ts +++ b/packages/auth/bin/stats.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { TimerInterface } from '@standardnotes/time' diff --git a/packages/auth/bin/user_email_backup.ts b/packages/auth/bin/user_email_backup.ts index 0efb9cc03..f411d48da 100644 --- a/packages/auth/bin/user_email_backup.ts +++ b/packages/auth/bin/user_email_backup.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import * as dayjs from 'dayjs' import * as utc from 'dayjs/plugin/utc' diff --git a/packages/auth/bin/worker.ts b/packages/auth/bin/worker.ts index 25acae57a..a118dd549 100644 --- a/packages/auth/bin/worker.ts +++ b/packages/auth/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { ContainerConfigLoader } from '../src/Bootstrap/Container' diff --git a/packages/auth/package.json b/packages/auth/package.json index 13d3ec1c6..e672e3b34 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -39,7 +39,6 @@ "@aws-sdk/client-sqs": "^3.332.0", "@cbor-extract/cbor-extract-linux-arm64": "^2.1.1", "@cbor-extract/cbor-extract-linux-x64": "^2.1.1", - "@newrelic/winston-enricher": "^4.0.1", "@simplewebauthn/server": "^7.2.0", "@simplewebauthn/typescript-types": "^7.0.0", "@standardnotes/api": "^1.25.3", @@ -65,7 +64,6 @@ "inversify-express-utils": "^6.4.3", "ioredis": "^5.2.4", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "otplib": "12.0.1", "prettyjson": "^1.2.5", "reflect-metadata": "0.1.13", @@ -81,7 +79,6 @@ "@types/express": "^4.17.14", "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.5", "@types/otplib": "^10.0.0", "@types/prettyjson": "^0.0.30", @@ -97,5 +94,10 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/auth/src/Bootstrap/Container.ts b/packages/auth/src/Bootstrap/Container.ts index 435d22eeb..b8d98851a 100644 --- a/packages/auth/src/Bootstrap/Container.ts +++ b/packages/auth/src/Bootstrap/Container.ts @@ -252,9 +252,6 @@ import { HomeServerWebSocketsController } from '../Infra/InversifyExpressUtils/H import { HomeServerSessionsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSessionsController' import { Transform } from 'stream' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') - export class ContainerConfigLoader { async load(configuration?: { controllerConatiner?: ControllerContainerInterface @@ -286,9 +283,12 @@ export class ContainerConfigLoader { container.bind(TYPES.Auth_Redis).toConstantValue(redis) } - const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') + const newrelicWinstonFormatter = newrelicFormatter(winston) winstonFormatters.push(newrelicWinstonFormatter()) } diff --git a/packages/domain-events-infra/package.json b/packages/domain-events-infra/package.json index 2cec921bc..67992f9e3 100644 --- a/packages/domain-events-infra/package.json +++ b/packages/domain-events-infra/package.json @@ -27,7 +27,6 @@ "@aws-sdk/client-sqs": "^3.332.0", "@standardnotes/domain-events": "workspace:*", "ioredis": "^5.2.4", - "newrelic": "^10.1.0", "reflect-metadata": "^0.1.13", "sqs-consumer": "^6.2.1", "winston": "^3.8.1" @@ -35,7 +34,6 @@ "devDependencies": { "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", "eslint": "^8.39.0", @@ -44,5 +42,9 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicBounceNotificiationHandler.ts b/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicBounceNotificiationHandler.ts index de25f3349..0c37b0cd0 100644 --- a/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicBounceNotificiationHandler.ts +++ b/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicBounceNotificiationHandler.ts @@ -1,5 +1,4 @@ import { Logger } from 'winston' -import * as newrelic from 'newrelic' import { DomainEventHandlerInterface, @@ -50,6 +49,8 @@ export class SQSNewRelicBounceNotificiationHandler implements DomainEventMessage this.logger.debug(`Received event: ${domainEvent.type}`) + const newrelic = await import('newrelic') + await newrelic.startBackgroundTransaction( domainEvent.type, /* istanbul ignore next */ diff --git a/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicEventMessageHandler.ts b/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicEventMessageHandler.ts index b4af65c85..ec5227c16 100644 --- a/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicEventMessageHandler.ts +++ b/packages/domain-events-infra/src/Infra/SQS/SQSNewRelicEventMessageHandler.ts @@ -1,6 +1,5 @@ import { Logger } from 'winston' import * as zlib from 'zlib' -import * as newrelic from 'newrelic' import { DomainEventHandlerInterface, @@ -29,6 +28,8 @@ export class SQSNewRelicEventMessageHandler implements DomainEventMessageHandler this.logger.debug(`Received event: ${domainEvent.type}`) + const newrelic = await import('newrelic') + await newrelic.startBackgroundTransaction( domainEvent.type, /* istanbul ignore next */ diff --git a/packages/event-store/bin/worker.ts b/packages/event-store/bin/worker.ts index 23fe62631..3f6d09792 100644 --- a/packages/event-store/bin/worker.ts +++ b/packages/event-store/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { ContainerConfigLoader } from '../src/Bootstrap/Container' diff --git a/packages/event-store/package.json b/packages/event-store/package.json index 6bce2bf5d..5be1ca1c6 100644 --- a/packages/event-store/package.json +++ b/packages/event-store/package.json @@ -21,7 +21,6 @@ "devDependencies": { "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@types/nodemailer": "^6.4.1", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", @@ -41,9 +40,12 @@ "inversify": "^6.0.1", "ioredis": "^5.2.4", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "reflect-metadata": "0.1.13", "typeorm": "^0.3.15", "winston": "^3.8.1" + }, + "optionalDependencies": { + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/event-store/src/Bootstrap/Container.ts b/packages/event-store/src/Bootstrap/Container.ts index 65ff97aad..4637eab56 100644 --- a/packages/event-store/src/Bootstrap/Container.ts +++ b/packages/event-store/src/Bootstrap/Container.ts @@ -26,6 +26,10 @@ export class ContainerConfigLoader { const container = new Container() + if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + } + await AppDataSource.initialize() if (env.get('SQS_QUEUE_URL', true)) { diff --git a/packages/files/bin/server.ts b/packages/files/bin/server.ts index 8f698b228..14bc31e7c 100644 --- a/packages/files/bin/server.ts +++ b/packages/files/bin/server.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import * as busboy from 'connect-busboy' import '../src/Infra/InversifyExpress/InversifyExpressHealthCheckController' diff --git a/packages/files/bin/worker.ts b/packages/files/bin/worker.ts index 7e7dfcf00..f5241c880 100644 --- a/packages/files/bin/worker.ts +++ b/packages/files/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { ContainerConfigLoader } from '../src/Bootstrap/Container' diff --git a/packages/files/package.json b/packages/files/package.json index 52e119056..43ca8bf78 100644 --- a/packages/files/package.json +++ b/packages/files/package.json @@ -50,7 +50,6 @@ "inversify-express-utils": "^6.4.3", "ioredis": "^5.2.4", "jsonwebtoken": "^9.0.0", - "newrelic": "^10.1.0", "nodemon": "^2.0.19", "prettyjson": "^1.2.5", "reflect-metadata": "^0.1.13", @@ -63,7 +62,6 @@ "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", "@types/jsonwebtoken": "^9.0.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.5", "@types/prettyjson": "^0.0.30", "@types/uuid": "^8.3.0", @@ -78,5 +76,9 @@ "ts-jest": "^29.1.0", "typescript": "^5.0.4", "uuid": "^9.0.0" + }, + "optionalDependencies": { + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/files/src/Bootstrap/Container.ts b/packages/files/src/Bootstrap/Container.ts index a850f53a2..26adc16da 100644 --- a/packages/files/src/Bootstrap/Container.ts +++ b/packages/files/src/Bootstrap/Container.ts @@ -62,6 +62,10 @@ export class ContainerConfigLoader { const container = new Container() + if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + } + const isConfiguredForHomeServer = env.get('CACHE_TYPE') === 'memory' if (configuration?.logger) { diff --git a/packages/revisions/bin/server.ts b/packages/revisions/bin/server.ts index e02c9cb15..c2db44234 100644 --- a/packages/revisions/bin/server.ts +++ b/packages/revisions/bin/server.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import * as cors from 'cors' import { urlencoded, json, Request, Response, NextFunction } from 'express' import * as winston from 'winston' diff --git a/packages/revisions/bin/worker.ts b/packages/revisions/bin/worker.ts index 863670b0e..93a3fe379 100644 --- a/packages/revisions/bin/worker.ts +++ b/packages/revisions/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import TYPES from '../src/Bootstrap/Types' diff --git a/packages/revisions/package.json b/packages/revisions/package.json index 6d3f1bc72..4e119a096 100644 --- a/packages/revisions/package.json +++ b/packages/revisions/package.json @@ -27,7 +27,6 @@ "dependencies": { "@aws-sdk/client-s3": "^3.332.0", "@aws-sdk/client-sqs": "^3.332.0", - "@newrelic/winston-enricher": "^4.0.1", "@standardnotes/api": "^1.25.3", "@standardnotes/common": "workspace:^", "@standardnotes/domain-core": "workspace:^", @@ -42,7 +41,6 @@ "inversify": "^6.0.1", "inversify-express-utils": "^6.4.3", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "reflect-metadata": "0.1.13", "sqlite3": "^5.1.6", "typeorm": "^0.3.15", @@ -53,7 +51,6 @@ "@types/dotenv": "^8.2.0", "@types/express": "^4.17.14", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.5", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", @@ -64,5 +61,10 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/revisions/src/Bootstrap/Container.ts b/packages/revisions/src/Bootstrap/Container.ts index 8f93358f4..cdacbb89c 100644 --- a/packages/revisions/src/Bootstrap/Container.ts +++ b/packages/revisions/src/Bootstrap/Container.ts @@ -48,9 +48,6 @@ import { RevisionItemStringMapper } from '../Mapping/RevisionItemStringMapper' import { HomeServerRevisionsController } from '../Infra/InversifyExpress/HomeServer/HomeServerRevisionsController' import { Transform } from 'stream' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') - export class ContainerConfigLoader { async load(configuration?: { controllerConatiner?: ControllerContainerInterface @@ -76,24 +73,23 @@ export class ContainerConfigLoader { if (configuration?.logger) { container.bind(TYPES.Revisions_Logger).toConstantValue(configuration.logger as winston.Logger) } else { - container.bind(TYPES.Revisions_Logger).toDynamicValue((context: interfaces.Context) => { - const env: Env = context.container.get(TYPES.Revisions_Env) - + const winstonFormatters = [winston.format.splat(), winston.format.json()] + if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') const newrelicWinstonFormatter = newrelicFormatter(winston) - const winstonFormatters = [winston.format.splat(), winston.format.json()] - if (env.get('NEW_RELIC_ENABLED', true) === 'true') { - winstonFormatters.push(newrelicWinstonFormatter()) - } + winstonFormatters.push(newrelicWinstonFormatter()) + } - const logger = winston.createLogger({ - level: env.get('LOG_LEVEL') || 'info', - format: winston.format.combine(...winstonFormatters), - transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })], - defaultMeta: { service: 'revisions' }, - }) - - return logger + const logger = winston.createLogger({ + level: env.get('LOG_LEVEL') || 'info', + format: winston.format.combine(...winstonFormatters), + transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })], + defaultMeta: { service: 'revisions' }, }) + + container.bind(TYPES.Revisions_Logger).toConstantValue(logger) } container.bind(TYPES.Revisions_NEW_RELIC_ENABLED).toConstantValue(env.get('NEW_RELIC_ENABLED', true)) diff --git a/packages/scheduler/bin/verify.ts b/packages/scheduler/bin/verify.ts index 7c45361ad..fdf6825c4 100644 --- a/packages/scheduler/bin/verify.ts +++ b/packages/scheduler/bin/verify.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import * as dayjs from 'dayjs' import * as utc from 'dayjs/plugin/utc' diff --git a/packages/scheduler/bin/worker.ts b/packages/scheduler/bin/worker.ts index 0190d5935..2e7124487 100644 --- a/packages/scheduler/bin/worker.ts +++ b/packages/scheduler/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events' import * as dayjs from 'dayjs' diff --git a/packages/scheduler/package.json b/packages/scheduler/package.json index 34f8c3b08..dd9a2d855 100644 --- a/packages/scheduler/package.json +++ b/packages/scheduler/package.json @@ -26,7 +26,6 @@ "dependencies": { "@aws-sdk/client-sns": "^3.332.0", "@aws-sdk/client-sqs": "^3.332.0", - "@newrelic/winston-enricher": "^4.0.1", "@standardnotes/domain-core": "workspace:^", "@standardnotes/domain-events": "workspace:*", "@standardnotes/domain-events-infra": "workspace:*", @@ -37,7 +36,6 @@ "inversify": "^6.0.1", "ioredis": "^5.2.4", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "reflect-metadata": "^0.1.13", "typeorm": "^0.3.15", "winston": "^3.8.1" @@ -45,7 +43,6 @@ "devDependencies": { "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.0", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", @@ -56,5 +53,10 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/scheduler/src/Bootstrap/Container.ts b/packages/scheduler/src/Bootstrap/Container.ts index 9f036b134..3bdd8f31b 100644 --- a/packages/scheduler/src/Bootstrap/Container.ts +++ b/packages/scheduler/src/Bootstrap/Container.ts @@ -36,9 +36,6 @@ import { UserRegisteredEventHandler } from '../Domain/Handler/UserRegisteredEven import { SubscriptionCancelledEventHandler } from '../Domain/Handler/SubscriptionCancelledEventHandler' import { ExitDiscountAppliedEventHandler } from '../Domain/Handler/ExitDiscountAppliedEventHandler' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') - export class ContainerConfigLoader { async load(): Promise { const env: Env = new Env() @@ -59,9 +56,12 @@ export class ContainerConfigLoader { container.bind(TYPES.Redis).toConstantValue(redis) - const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') + const newrelicWinstonFormatter = newrelicFormatter(winston) winstonFormatters.push(newrelicWinstonFormatter()) } diff --git a/packages/syncing-server/bin/server.ts b/packages/syncing-server/bin/server.ts index ffffb3919..17bf43426 100644 --- a/packages/syncing-server/bin/server.ts +++ b/packages/syncing-server/bin/server.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import '../src/Infra/InversifyExpressUtils/InversifyExpressHealthCheckController' import '../src/Infra/InversifyExpressUtils/InversifyExpressItemsController' diff --git a/packages/syncing-server/bin/worker.ts b/packages/syncing-server/bin/worker.ts index 648a18d20..c8f42b6c5 100644 --- a/packages/syncing-server/bin/worker.ts +++ b/packages/syncing-server/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import TYPES from '../src/Bootstrap/Types' diff --git a/packages/syncing-server/package.json b/packages/syncing-server/package.json index 038c26c4d..fcd7507f3 100644 --- a/packages/syncing-server/package.json +++ b/packages/syncing-server/package.json @@ -30,7 +30,6 @@ "@aws-sdk/client-s3": "^3.332.0", "@aws-sdk/client-sns": "^3.332.0", "@aws-sdk/client-sqs": "^3.332.0", - "@newrelic/winston-enricher": "^4.0.1", "@standardnotes/api": "^1.25.3", "@standardnotes/common": "workspace:*", "@standardnotes/domain-core": "workspace:^", @@ -49,7 +48,6 @@ "inversify-express-utils": "^6.4.3", "jsonwebtoken": "^9.0.0", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "nodemon": "^2.0.19", "prettyjson": "^1.2.5", "reflect-metadata": "0.1.13", @@ -65,7 +63,6 @@ "@types/express": "^4.17.14", "@types/jest": "^29.5.1", "@types/jsonwebtoken": "^9.0.1", - "@types/newrelic": "^9.13.0", "@types/node": "^20.2.5", "@types/prettyjson": "^0.0.30", "@types/ua-parser-js": "^0.7.36", @@ -79,5 +76,10 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/syncing-server/src/Bootstrap/Container.ts b/packages/syncing-server/src/Bootstrap/Container.ts index 4fb37b056..ab24efd9e 100644 --- a/packages/syncing-server/src/Bootstrap/Container.ts +++ b/packages/syncing-server/src/Bootstrap/Container.ts @@ -73,8 +73,6 @@ import { S3ItemBackupService } from '../Infra/S3/S3ItemBackupService' import { ControllerContainer, ControllerContainerInterface } from '@standardnotes/domain-core' import { HomeServerItemsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerItemsController' import { Transform } from 'stream' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') export class ContainerConfigLoader { private readonly DEFAULT_CONTENT_SIZE_TRANSFER_LIMIT = 10_000_000 @@ -105,24 +103,23 @@ export class ContainerConfigLoader { if (configuration?.logger) { container.bind(TYPES.Sync_Logger).toConstantValue(configuration.logger as winston.Logger) } else { - container.bind(TYPES.Sync_Logger).toDynamicValue((context: interfaces.Context) => { - const env: Env = context.container.get(TYPES.Sync_Env) - + const winstonFormatters = [winston.format.splat(), winston.format.json()] + if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') const newrelicWinstonFormatter = newrelicFormatter(winston) - const winstonFormatters = [winston.format.splat(), winston.format.json()] - if (env.get('NEW_RELIC_ENABLED', true) === 'true') { - winstonFormatters.push(newrelicWinstonFormatter()) - } + winstonFormatters.push(newrelicWinstonFormatter()) + } - const logger = winston.createLogger({ - level: env.get('LOG_LEVEL') || 'info', - format: winston.format.combine(...winstonFormatters), - transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })], - defaultMeta: { service: 'syncing-server' }, - }) - - return logger + const logger = winston.createLogger({ + level: env.get('LOG_LEVEL') || 'info', + format: winston.format.combine(...winstonFormatters), + transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })], + defaultMeta: { service: 'syncing-server' }, }) + + container.bind(TYPES.Sync_Logger).toConstantValue(logger) } if (isConfiguredForHomeServer) { diff --git a/packages/websockets/bin/server.ts b/packages/websockets/bin/server.ts index 4cb761a16..81e575b1d 100644 --- a/packages/websockets/bin/server.ts +++ b/packages/websockets/bin/server.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import '../src/Infra/InversifyExpressUtils/InversifyExpressHealthCheckController' import '../src/Infra/InversifyExpressUtils/InversifyExpressWebSocketsController' diff --git a/packages/websockets/bin/worker.ts b/packages/websockets/bin/worker.ts index 23fe62631..3f6d09792 100644 --- a/packages/websockets/bin/worker.ts +++ b/packages/websockets/bin/worker.ts @@ -1,7 +1,5 @@ import 'reflect-metadata' -import 'newrelic' - import { Logger } from 'winston' import { ContainerConfigLoader } from '../src/Bootstrap/Container' diff --git a/packages/websockets/package.json b/packages/websockets/package.json index b3428765b..3908114c7 100644 --- a/packages/websockets/package.json +++ b/packages/websockets/package.json @@ -23,7 +23,6 @@ }, "dependencies": { "@aws-sdk/client-sqs": "^3.332.0", - "@newrelic/winston-enricher": "^4.0.1", "@standardnotes/api": "^1.25.3", "@standardnotes/common": "workspace:^", "@standardnotes/domain-core": "workspace:^", @@ -40,7 +39,6 @@ "inversify-express-utils": "^6.4.3", "ioredis": "^5.2.4", "mysql2": "^3.0.1", - "newrelic": "^10.1.0", "reflect-metadata": "0.1.13", "typeorm": "^0.3.15", "winston": "^3.8.1" @@ -50,7 +48,6 @@ "@types/express": "^4.17.14", "@types/ioredis": "^5.0.0", "@types/jest": "^29.5.1", - "@types/newrelic": "^9.13.0", "@typescript-eslint/eslint-plugin": "^5.59.2", "@typescript-eslint/parser": "^5.59.2", "eslint": "^8.39.0", @@ -59,5 +56,10 @@ "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.0.4" + }, + "optionalDependencies": { + "@newrelic/winston-enricher": "^4.0.1", + "@types/newrelic": "^9.13.0", + "newrelic": "^10.1.2" } } diff --git a/packages/websockets/src/Bootstrap/Container.ts b/packages/websockets/src/Bootstrap/Container.ts index 98fb15a47..1a45479ec 100644 --- a/packages/websockets/src/Bootstrap/Container.ts +++ b/packages/websockets/src/Bootstrap/Container.ts @@ -38,9 +38,6 @@ import { WebSocketServerInterface } from '@standardnotes/api' import { ClientMessengerInterface } from '../Client/ClientMessengerInterface' import { WebSocketMessageRequestedEventHandler } from '../Domain/Handler/WebSocketMessageRequestedEventHandler' -// eslint-disable-next-line @typescript-eslint/no-var-requires -const newrelicFormatter = require('@newrelic/winston-enricher') - export class ContainerConfigLoader { async load(): Promise { const env: Env = new Env() @@ -59,9 +56,12 @@ export class ContainerConfigLoader { container.bind(TYPES.Redis).toConstantValue(redis) - const newrelicWinstonFormatter = newrelicFormatter(winston) const winstonFormatters = [winston.format.splat(), winston.format.json()] if (env.get('NEW_RELIC_ENABLED', true) === 'true') { + await import('newrelic') + // eslint-disable-next-line @typescript-eslint/no-var-requires + const newrelicFormatter = require('@newrelic/winston-enricher') + const newrelicWinstonFormatter = newrelicFormatter(winston) winstonFormatters.push(newrelicWinstonFormatter()) } diff --git a/yarn.lock b/yarn.lock index 6a1145b98..40467d45b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -108,23 +108,13 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/abort-controller@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/abort-controller@npm:3.310.0" +"@aws-sdk/abort-controller@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/abort-controller@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 0f0fd8b9fea42f001ce5f478f3aaacc93db3b350484ebed3d4bdcc54d7da4338c8f159679d74fd6a2ff7bc056a8c62ac9b7069bccfd0dd0b6a1258e182f244dc - languageName: node - linkType: hard - -"@aws-sdk/abort-controller@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/abort-controller@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 86f90b191d7fba7b1d801202214c2ca2dad81e138bf64bbf79f457a5082bf818d8be4f7e3efdde35fc5920b708f7e7b1ed59d0dbe5700ad0d83444cd6fd05654 + checksum: 53f49d69eb4ef4876dc06cc9cd678deb71cc4c23ea3dedd63165cc563f1dccdb0eeb209e752d172268306bbba3494692e2065e15caaf77e901b0fa836864be2c languageName: node linkType: hard @@ -138,810 +128,504 @@ __metadata: linkType: hard "@aws-sdk/client-s3@npm:^3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/client-s3@npm:3.332.0" + version: 3.342.0 + resolution: "@aws-sdk/client-s3@npm:3.342.0" dependencies: "@aws-crypto/sha1-browser": "npm:3.0.0" "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.332.0" - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/credential-provider-node": "npm:3.332.0" - "@aws-sdk/eventstream-serde-browser": "npm:3.329.0" - "@aws-sdk/eventstream-serde-config-resolver": "npm:3.329.0" - "@aws-sdk/eventstream-serde-node": "npm:3.329.0" - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/hash-blob-browser": "npm:3.329.0" - "@aws-sdk/hash-node": "npm:3.329.0" - "@aws-sdk/hash-stream-node": "npm:3.329.0" - "@aws-sdk/invalid-dependency": "npm:3.329.0" - "@aws-sdk/md5-js": "npm:3.329.0" - "@aws-sdk/middleware-bucket-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-content-length": "npm:3.329.0" - "@aws-sdk/middleware-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-expect-continue": "npm:3.329.0" - "@aws-sdk/middleware-flexible-checksums": "npm:3.331.0" - "@aws-sdk/middleware-host-header": "npm:3.329.0" - "@aws-sdk/middleware-location-constraint": "npm:3.329.0" - "@aws-sdk/middleware-logger": "npm:3.329.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.329.0" - "@aws-sdk/middleware-retry": "npm:3.329.0" - "@aws-sdk/middleware-sdk-s3": "npm:3.329.0" - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/middleware-signing": "npm:3.329.0" - "@aws-sdk/middleware-ssec": "npm:3.329.0" - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/middleware-user-agent": "npm:3.332.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/signature-v4-multi-region": "npm:3.329.0" - "@aws-sdk/smithy-client": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" + "@aws-sdk/client-sts": "npm:3.342.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/credential-provider-node": "npm:3.342.0" + "@aws-sdk/eventstream-serde-browser": "npm:3.342.0" + "@aws-sdk/eventstream-serde-config-resolver": "npm:3.342.0" + "@aws-sdk/eventstream-serde-node": "npm:3.342.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/hash-blob-browser": "npm:3.342.0" + "@aws-sdk/hash-node": "npm:3.342.0" + "@aws-sdk/hash-stream-node": "npm:3.342.0" + "@aws-sdk/invalid-dependency": "npm:3.342.0" + "@aws-sdk/md5-js": "npm:3.342.0" + "@aws-sdk/middleware-bucket-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-content-length": "npm:3.342.0" + "@aws-sdk/middleware-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-expect-continue": "npm:3.342.0" + "@aws-sdk/middleware-flexible-checksums": "npm:3.342.0" + "@aws-sdk/middleware-host-header": "npm:3.342.0" + "@aws-sdk/middleware-location-constraint": "npm:3.342.0" + "@aws-sdk/middleware-logger": "npm:3.342.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.342.0" + "@aws-sdk/middleware-retry": "npm:3.342.0" + "@aws-sdk/middleware-sdk-s3": "npm:3.342.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/middleware-signing": "npm:3.342.0" + "@aws-sdk/middleware-ssec": "npm:3.342.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/middleware-user-agent": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/signature-v4-multi-region": "npm:3.342.0" + "@aws-sdk/smithy-client": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-body-length-browser": "npm:3.310.0" "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.329.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" - "@aws-sdk/util-retry": "npm:3.329.0" - "@aws-sdk/util-stream-browser": "npm:3.329.0" - "@aws-sdk/util-stream-node": "npm:3.331.0" - "@aws-sdk/util-user-agent-browser": "npm:3.329.0" - "@aws-sdk/util-user-agent-node": "npm:3.329.0" + "@aws-sdk/util-defaults-mode-browser": "npm:3.342.0" + "@aws-sdk/util-defaults-mode-node": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" + "@aws-sdk/util-stream-browser": "npm:3.342.0" + "@aws-sdk/util-stream-node": "npm:3.342.0" + "@aws-sdk/util-user-agent-browser": "npm:3.342.0" + "@aws-sdk/util-user-agent-node": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" - "@aws-sdk/util-waiter": "npm:3.329.0" + "@aws-sdk/util-waiter": "npm:3.342.0" "@aws-sdk/xml-builder": "npm:3.310.0" + "@smithy/protocol-http": "npm:^1.0.1" + "@smithy/types": "npm:^1.0.0" fast-xml-parser: "npm:4.1.2" tslib: "npm:^2.5.0" - checksum: 08bd1ae694c455cbf3774a1c7bb70e3da88b820eed566afab6e69b152e3cd0de7b5b4cef5cad637f8faa951fd2a82f9122a2812f81ba0bd0c367789a5d87931e + checksum: 9f3b9171ddd042dca6922cdddfe44c0f7565211154fef54d8710662aa171919cad7639d34801357b14106ff9f8682abe8f101f99a9945003c6e1a1024522c99c languageName: node linkType: hard "@aws-sdk/client-sns@npm:^3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/client-sns@npm:3.332.0" + version: 3.342.0 + resolution: "@aws-sdk/client-sns@npm:3.342.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.332.0" - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/credential-provider-node": "npm:3.332.0" - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/hash-node": "npm:3.329.0" - "@aws-sdk/invalid-dependency": "npm:3.329.0" - "@aws-sdk/middleware-content-length": "npm:3.329.0" - "@aws-sdk/middleware-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-host-header": "npm:3.329.0" - "@aws-sdk/middleware-logger": "npm:3.329.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.329.0" - "@aws-sdk/middleware-retry": "npm:3.329.0" - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/middleware-signing": "npm:3.329.0" - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/middleware-user-agent": "npm:3.332.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/smithy-client": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" + "@aws-sdk/client-sts": "npm:3.342.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/credential-provider-node": "npm:3.342.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/hash-node": "npm:3.342.0" + "@aws-sdk/invalid-dependency": "npm:3.342.0" + "@aws-sdk/middleware-content-length": "npm:3.342.0" + "@aws-sdk/middleware-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-host-header": "npm:3.342.0" + "@aws-sdk/middleware-logger": "npm:3.342.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.342.0" + "@aws-sdk/middleware-retry": "npm:3.342.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/middleware-signing": "npm:3.342.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/middleware-user-agent": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/smithy-client": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-body-length-browser": "npm:3.310.0" "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.329.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" - "@aws-sdk/util-retry": "npm:3.329.0" - "@aws-sdk/util-user-agent-browser": "npm:3.329.0" - "@aws-sdk/util-user-agent-node": "npm:3.329.0" + "@aws-sdk/util-defaults-mode-browser": "npm:3.342.0" + "@aws-sdk/util-defaults-mode-node": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" + "@aws-sdk/util-user-agent-browser": "npm:3.342.0" + "@aws-sdk/util-user-agent-node": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" + "@smithy/protocol-http": "npm:^1.0.1" + "@smithy/types": "npm:^1.0.0" fast-xml-parser: "npm:4.1.2" tslib: "npm:^2.5.0" - checksum: 72345e1f6b57c21cc30ee1f7a4df9dbbc4d9c65be345b6784ad47ad70213aba8c18ef423a200839c5d486b4101aa57e2dd186edd73a599a05c419d2b63a8b416 + checksum: 8d7ccac0ed1e0f33512e887584fb140738aa1229a4f9ccc64e1157b63caf1060d3c1e3a6795b5f332249b5d74a60547e890b604e430a0f0d1bb98986f8f3b1c6 languageName: node linkType: hard -"@aws-sdk/client-sqs@npm:^3.258.0": - version: 3.327.0 - resolution: "@aws-sdk/client-sqs@npm:3.327.0" +"@aws-sdk/client-sqs@npm:^3.258.0, @aws-sdk/client-sqs@npm:^3.332.0": + version: 3.342.0 + resolution: "@aws-sdk/client-sqs@npm:3.342.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.327.0" - "@aws-sdk/config-resolver": "npm:3.310.0" - "@aws-sdk/credential-provider-node": "npm:3.327.0" - "@aws-sdk/fetch-http-handler": "npm:3.310.0" - "@aws-sdk/hash-node": "npm:3.310.0" - "@aws-sdk/invalid-dependency": "npm:3.310.0" - "@aws-sdk/md5-js": "npm:3.310.0" - "@aws-sdk/middleware-content-length": "npm:3.325.0" - "@aws-sdk/middleware-endpoint": "npm:3.325.0" - "@aws-sdk/middleware-host-header": "npm:3.325.0" - "@aws-sdk/middleware-logger": "npm:3.325.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.325.0" - "@aws-sdk/middleware-retry": "npm:3.327.0" - "@aws-sdk/middleware-sdk-sqs": "npm:3.326.0" - "@aws-sdk/middleware-serde": "npm:3.325.0" - "@aws-sdk/middleware-signing": "npm:3.325.0" - "@aws-sdk/middleware-stack": "npm:3.325.0" - "@aws-sdk/middleware-user-agent": "npm:3.327.0" - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/node-http-handler": "npm:3.321.1" - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/smithy-client": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/url-parser": "npm:3.310.0" + "@aws-sdk/client-sts": "npm:3.342.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/credential-provider-node": "npm:3.342.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/hash-node": "npm:3.342.0" + "@aws-sdk/invalid-dependency": "npm:3.342.0" + "@aws-sdk/md5-js": "npm:3.342.0" + "@aws-sdk/middleware-content-length": "npm:3.342.0" + "@aws-sdk/middleware-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-host-header": "npm:3.342.0" + "@aws-sdk/middleware-logger": "npm:3.342.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.342.0" + "@aws-sdk/middleware-retry": "npm:3.342.0" + "@aws-sdk/middleware-sdk-sqs": "npm:3.342.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/middleware-signing": "npm:3.342.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/middleware-user-agent": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/smithy-client": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-body-length-browser": "npm:3.310.0" "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.325.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.325.0" - "@aws-sdk/util-endpoints": "npm:3.327.0" - "@aws-sdk/util-retry": "npm:3.327.0" - "@aws-sdk/util-user-agent-browser": "npm:3.310.0" - "@aws-sdk/util-user-agent-node": "npm:3.310.0" - "@aws-sdk/util-utf8": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: cc1a4bfa8bcd96f810ceb8453ea320e641995e38872511ec71a1e97b4731820ee83089dd55a16b666cbaae226d3c02f867019ca44cde474c4212d181ba6207fd - languageName: node - linkType: hard - -"@aws-sdk/client-sqs@npm:^3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/client-sqs@npm:3.332.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/client-sts": "npm:3.332.0" - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/credential-provider-node": "npm:3.332.0" - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/hash-node": "npm:3.329.0" - "@aws-sdk/invalid-dependency": "npm:3.329.0" - "@aws-sdk/md5-js": "npm:3.329.0" - "@aws-sdk/middleware-content-length": "npm:3.329.0" - "@aws-sdk/middleware-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-host-header": "npm:3.329.0" - "@aws-sdk/middleware-logger": "npm:3.329.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.329.0" - "@aws-sdk/middleware-retry": "npm:3.329.0" - "@aws-sdk/middleware-sdk-sqs": "npm:3.329.0" - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/middleware-signing": "npm:3.329.0" - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/middleware-user-agent": "npm:3.332.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/smithy-client": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" - "@aws-sdk/util-base64": "npm:3.310.0" - "@aws-sdk/util-body-length-browser": "npm:3.310.0" - "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.329.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" - "@aws-sdk/util-retry": "npm:3.329.0" - "@aws-sdk/util-user-agent-browser": "npm:3.329.0" - "@aws-sdk/util-user-agent-node": "npm:3.329.0" + "@aws-sdk/util-defaults-mode-browser": "npm:3.342.0" + "@aws-sdk/util-defaults-mode-node": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" + "@aws-sdk/util-user-agent-browser": "npm:3.342.0" + "@aws-sdk/util-user-agent-node": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" + "@smithy/protocol-http": "npm:^1.0.1" + "@smithy/types": "npm:^1.0.0" fast-xml-parser: "npm:4.1.2" tslib: "npm:^2.5.0" - checksum: 2a5c0d8a827a7d5226a6255baf187d01abd00ac4cf6dfe52c89d63dc4ce60c2e110b60e3e19801967080c385200ed7fa3d70e07cf8c588cdd1e83ced61a7681f + checksum: e08dd27f26f8070ed92d02ffecf8b10d271571cfcffae12605105b40a44060249a5227d877bfd92460a76d9e85f9d6134f46030c3c0e84c54a50d8b58480db97 languageName: node linkType: hard -"@aws-sdk/client-sso-oidc@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/client-sso-oidc@npm:3.327.0" +"@aws-sdk/client-sso-oidc@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/client-sso-oidc@npm:3.342.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/config-resolver": "npm:3.310.0" - "@aws-sdk/fetch-http-handler": "npm:3.310.0" - "@aws-sdk/hash-node": "npm:3.310.0" - "@aws-sdk/invalid-dependency": "npm:3.310.0" - "@aws-sdk/middleware-content-length": "npm:3.325.0" - "@aws-sdk/middleware-endpoint": "npm:3.325.0" - "@aws-sdk/middleware-host-header": "npm:3.325.0" - "@aws-sdk/middleware-logger": "npm:3.325.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.325.0" - "@aws-sdk/middleware-retry": "npm:3.327.0" - "@aws-sdk/middleware-serde": "npm:3.325.0" - "@aws-sdk/middleware-stack": "npm:3.325.0" - "@aws-sdk/middleware-user-agent": "npm:3.327.0" - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/node-http-handler": "npm:3.321.1" - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/smithy-client": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/url-parser": "npm:3.310.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/hash-node": "npm:3.342.0" + "@aws-sdk/invalid-dependency": "npm:3.342.0" + "@aws-sdk/middleware-content-length": "npm:3.342.0" + "@aws-sdk/middleware-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-host-header": "npm:3.342.0" + "@aws-sdk/middleware-logger": "npm:3.342.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.342.0" + "@aws-sdk/middleware-retry": "npm:3.342.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/middleware-user-agent": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/smithy-client": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-body-length-browser": "npm:3.310.0" "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.325.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.325.0" - "@aws-sdk/util-endpoints": "npm:3.327.0" - "@aws-sdk/util-retry": "npm:3.327.0" - "@aws-sdk/util-user-agent-browser": "npm:3.310.0" - "@aws-sdk/util-user-agent-node": "npm:3.310.0" + "@aws-sdk/util-defaults-mode-browser": "npm:3.342.0" + "@aws-sdk/util-defaults-mode-node": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" + "@aws-sdk/util-user-agent-browser": "npm:3.342.0" + "@aws-sdk/util-user-agent-node": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" + "@smithy/protocol-http": "npm:^1.0.1" + "@smithy/types": "npm:^1.0.0" tslib: "npm:^2.5.0" - checksum: 7429ae92c91541c7764f5f7d810ccae1b4732e94451d193a4bcaa3622ca2c0feff16127b3aa4a3bf5ebf5d8a878421631853e8f395c4b5c81c80ed4391d86b2c + checksum: 083c2beff36073eb5e9311bc4604b3c43ad6f70eef208c2c90996b73a69bf7a42eae7e8dc2361033fe98ad327d114923910161381db595ff3760fa8099f0be55 languageName: node linkType: hard -"@aws-sdk/client-sso-oidc@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/client-sso-oidc@npm:3.332.0" +"@aws-sdk/client-sso@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/client-sso@npm:3.342.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/hash-node": "npm:3.329.0" - "@aws-sdk/invalid-dependency": "npm:3.329.0" - "@aws-sdk/middleware-content-length": "npm:3.329.0" - "@aws-sdk/middleware-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-host-header": "npm:3.329.0" - "@aws-sdk/middleware-logger": "npm:3.329.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.329.0" - "@aws-sdk/middleware-retry": "npm:3.329.0" - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/middleware-user-agent": "npm:3.332.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/smithy-client": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/hash-node": "npm:3.342.0" + "@aws-sdk/invalid-dependency": "npm:3.342.0" + "@aws-sdk/middleware-content-length": "npm:3.342.0" + "@aws-sdk/middleware-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-host-header": "npm:3.342.0" + "@aws-sdk/middleware-logger": "npm:3.342.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.342.0" + "@aws-sdk/middleware-retry": "npm:3.342.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/middleware-user-agent": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/smithy-client": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-body-length-browser": "npm:3.310.0" "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.329.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" - "@aws-sdk/util-retry": "npm:3.329.0" - "@aws-sdk/util-user-agent-browser": "npm:3.329.0" - "@aws-sdk/util-user-agent-node": "npm:3.329.0" + "@aws-sdk/util-defaults-mode-browser": "npm:3.342.0" + "@aws-sdk/util-defaults-mode-node": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" + "@aws-sdk/util-user-agent-browser": "npm:3.342.0" + "@aws-sdk/util-user-agent-node": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" + "@smithy/protocol-http": "npm:^1.0.1" + "@smithy/types": "npm:^1.0.0" tslib: "npm:^2.5.0" - checksum: 84948c90b72589686aa893b86d0cdc0bd472b80aa5024ad0c87c1a580b11cbf3c80114553e12628e2bb3e5f6a5a838792f163b14c20852875c37c4878b450f51 + checksum: 78748ec6a8521ef079611b6f3c12187af76cedbb06344d61cce629a3373e16209e5821f5fd402242f001440b36d0bcc4c465b8bd84be52eb6c41b9e8abc9dacb languageName: node linkType: hard -"@aws-sdk/client-sso@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/client-sso@npm:3.327.0" +"@aws-sdk/client-sts@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/client-sts@npm:3.342.0" dependencies: "@aws-crypto/sha256-browser": "npm:3.0.0" "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/config-resolver": "npm:3.310.0" - "@aws-sdk/fetch-http-handler": "npm:3.310.0" - "@aws-sdk/hash-node": "npm:3.310.0" - "@aws-sdk/invalid-dependency": "npm:3.310.0" - "@aws-sdk/middleware-content-length": "npm:3.325.0" - "@aws-sdk/middleware-endpoint": "npm:3.325.0" - "@aws-sdk/middleware-host-header": "npm:3.325.0" - "@aws-sdk/middleware-logger": "npm:3.325.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.325.0" - "@aws-sdk/middleware-retry": "npm:3.327.0" - "@aws-sdk/middleware-serde": "npm:3.325.0" - "@aws-sdk/middleware-stack": "npm:3.325.0" - "@aws-sdk/middleware-user-agent": "npm:3.327.0" - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/node-http-handler": "npm:3.321.1" - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/smithy-client": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/url-parser": "npm:3.310.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/credential-provider-node": "npm:3.342.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/hash-node": "npm:3.342.0" + "@aws-sdk/invalid-dependency": "npm:3.342.0" + "@aws-sdk/middleware-content-length": "npm:3.342.0" + "@aws-sdk/middleware-endpoint": "npm:3.342.0" + "@aws-sdk/middleware-host-header": "npm:3.342.0" + "@aws-sdk/middleware-logger": "npm:3.342.0" + "@aws-sdk/middleware-recursion-detection": "npm:3.342.0" + "@aws-sdk/middleware-retry": "npm:3.342.0" + "@aws-sdk/middleware-sdk-sts": "npm:3.342.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/middleware-signing": "npm:3.342.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/middleware-user-agent": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/smithy-client": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-body-length-browser": "npm:3.310.0" "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.325.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.325.0" - "@aws-sdk/util-endpoints": "npm:3.327.0" - "@aws-sdk/util-retry": "npm:3.327.0" - "@aws-sdk/util-user-agent-browser": "npm:3.310.0" - "@aws-sdk/util-user-agent-node": "npm:3.310.0" - "@aws-sdk/util-utf8": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: c11e99c85f3a5df6de1a0f3697072494246c65e7bd0d0797c8382dffb6477cbca0884e011ca35f8716075bdb39dd0b310b77049c18d47b1672c49f57cb88403c - languageName: node - linkType: hard - -"@aws-sdk/client-sso@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/client-sso@npm:3.332.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/hash-node": "npm:3.329.0" - "@aws-sdk/invalid-dependency": "npm:3.329.0" - "@aws-sdk/middleware-content-length": "npm:3.329.0" - "@aws-sdk/middleware-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-host-header": "npm:3.329.0" - "@aws-sdk/middleware-logger": "npm:3.329.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.329.0" - "@aws-sdk/middleware-retry": "npm:3.329.0" - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/middleware-user-agent": "npm:3.332.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/smithy-client": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" - "@aws-sdk/util-base64": "npm:3.310.0" - "@aws-sdk/util-body-length-browser": "npm:3.310.0" - "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.329.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" - "@aws-sdk/util-retry": "npm:3.329.0" - "@aws-sdk/util-user-agent-browser": "npm:3.329.0" - "@aws-sdk/util-user-agent-node": "npm:3.329.0" - "@aws-sdk/util-utf8": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: ec0660f92e99dab2b4b7a7091f75394cdbbf646d16e16df91c200c9fc3945b500edcf060e27b704671016ec4ba88ad0bd5818d31e895bb30d8e29060fd9a6ce6 - languageName: node - linkType: hard - -"@aws-sdk/client-sts@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/client-sts@npm:3.327.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/config-resolver": "npm:3.310.0" - "@aws-sdk/credential-provider-node": "npm:3.327.0" - "@aws-sdk/fetch-http-handler": "npm:3.310.0" - "@aws-sdk/hash-node": "npm:3.310.0" - "@aws-sdk/invalid-dependency": "npm:3.310.0" - "@aws-sdk/middleware-content-length": "npm:3.325.0" - "@aws-sdk/middleware-endpoint": "npm:3.325.0" - "@aws-sdk/middleware-host-header": "npm:3.325.0" - "@aws-sdk/middleware-logger": "npm:3.325.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.325.0" - "@aws-sdk/middleware-retry": "npm:3.327.0" - "@aws-sdk/middleware-sdk-sts": "npm:3.326.0" - "@aws-sdk/middleware-serde": "npm:3.325.0" - "@aws-sdk/middleware-signing": "npm:3.325.0" - "@aws-sdk/middleware-stack": "npm:3.325.0" - "@aws-sdk/middleware-user-agent": "npm:3.327.0" - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/node-http-handler": "npm:3.321.1" - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/smithy-client": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/url-parser": "npm:3.310.0" - "@aws-sdk/util-base64": "npm:3.310.0" - "@aws-sdk/util-body-length-browser": "npm:3.310.0" - "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.325.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.325.0" - "@aws-sdk/util-endpoints": "npm:3.327.0" - "@aws-sdk/util-retry": "npm:3.327.0" - "@aws-sdk/util-user-agent-browser": "npm:3.310.0" - "@aws-sdk/util-user-agent-node": "npm:3.310.0" + "@aws-sdk/util-defaults-mode-browser": "npm:3.342.0" + "@aws-sdk/util-defaults-mode-node": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" + "@aws-sdk/util-user-agent-browser": "npm:3.342.0" + "@aws-sdk/util-user-agent-node": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" + "@smithy/protocol-http": "npm:^1.0.1" + "@smithy/types": "npm:^1.0.0" fast-xml-parser: "npm:4.1.2" tslib: "npm:^2.5.0" - checksum: 730d25b8dcdd5d8e57091e1c60e700beef6ec4cb989e328b210fe3522891bb29e618da3f738f1ba2ef66571e62b0fc890024f7f8297ccdc72d35115777dc6505 + checksum: 14475bf1b438c3ec5941335187e3faa105177eb33c046c2e5d9e4dcb76a90fb62326a26ec7e350df237e70834ca7fca0aea26281c427cce39aa77e4659f0f3e8 languageName: node linkType: hard -"@aws-sdk/client-sts@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/client-sts@npm:3.332.0" +"@aws-sdk/config-resolver@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/config-resolver@npm:3.342.0" dependencies: - "@aws-crypto/sha256-browser": "npm:3.0.0" - "@aws-crypto/sha256-js": "npm:3.0.0" - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/credential-provider-node": "npm:3.332.0" - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/hash-node": "npm:3.329.0" - "@aws-sdk/invalid-dependency": "npm:3.329.0" - "@aws-sdk/middleware-content-length": "npm:3.329.0" - "@aws-sdk/middleware-endpoint": "npm:3.329.0" - "@aws-sdk/middleware-host-header": "npm:3.329.0" - "@aws-sdk/middleware-logger": "npm:3.329.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.329.0" - "@aws-sdk/middleware-retry": "npm:3.329.0" - "@aws-sdk/middleware-sdk-sts": "npm:3.329.0" - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/middleware-signing": "npm:3.329.0" - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/middleware-user-agent": "npm:3.332.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/smithy-client": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" - "@aws-sdk/util-base64": "npm:3.310.0" - "@aws-sdk/util-body-length-browser": "npm:3.310.0" - "@aws-sdk/util-body-length-node": "npm:3.310.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.329.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" - "@aws-sdk/util-retry": "npm:3.329.0" - "@aws-sdk/util-user-agent-browser": "npm:3.329.0" - "@aws-sdk/util-user-agent-node": "npm:3.329.0" - "@aws-sdk/util-utf8": "npm:3.310.0" - fast-xml-parser: "npm:4.1.2" - tslib: "npm:^2.5.0" - checksum: ebf88a07d394ea6acee585c882731d9b3580598914f9654130116a389d443654b928fa866362c8ded2337c041578dca4406c49f9f55a80cca704009c9772e911 - languageName: node - linkType: hard - -"@aws-sdk/config-resolver@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/config-resolver@npm:3.310.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-config-provider": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.310.0" + "@aws-sdk/util-middleware": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 980f73e75ba3c207e418c3feeb36d22d879a42a32bff2dd089cca75c10e6e869aa1964fd75411d2aacd0629210d18c275bd0221f91474f6a4537ef4b41da363a + checksum: 94007fc7e1bf5ae2953a2a40154bdb406b4f67e78f0c361e5066b28e6093b3f69e816cf8ac6b571bbd698901b32be38f6b14630b038d666cee0d92b7c2db2803 languageName: node linkType: hard -"@aws-sdk/config-resolver@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/config-resolver@npm:3.329.0" +"@aws-sdk/credential-provider-env@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-env@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-config-provider": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.329.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 96a66188db79992df70c63a94c4d10264057f44b34fee893a40b699069e33145eacb5679d378bf3c75149095cb929f1672efce33842e2a7615e73e7095615eca + checksum: 5bb6a1891d4e3210bc3690386bc6ab0794afab01850010682f49a5ad151ac6e8ff86320d0e693122e96ed6cd291ab95f7d9954fffc2e5d4173e3cb1056a4b43a languageName: node linkType: hard -"@aws-sdk/credential-provider-env@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/credential-provider-env@npm:3.310.0" +"@aws-sdk/credential-provider-imds@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-imds@npm:3.342.0" dependencies: - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: b416df1446d9cf1b3d92409485d157e49e930ba9118943844498ec576351ada6fedf84fba2039e83ed5c881d83b68c69db09e314d15947dcf87979ea6dc664df + checksum: a5fb146d98e2cad9f892e356cfdaec745d6f093acfcc8eaf428c6cafe6cada5236a194e1d498f20758fe7be471ecb609b714f43c6895224f08eeeb4e75b3cdcb languageName: node linkType: hard -"@aws-sdk/credential-provider-env@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/credential-provider-env@npm:3.329.0" +"@aws-sdk/credential-provider-ini@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-ini@npm:3.342.0" dependencies: - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/credential-provider-env": "npm:3.342.0" + "@aws-sdk/credential-provider-imds": "npm:3.342.0" + "@aws-sdk/credential-provider-process": "npm:3.342.0" + "@aws-sdk/credential-provider-sso": "npm:3.342.0" + "@aws-sdk/credential-provider-web-identity": "npm:3.342.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/shared-ini-file-loader": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: f55a57adfb0ff5ce589c7277b25f57560fe4500428c70cf8042b74bd14746da53be5424a000672a840308d436ab89e89e5470eb9e5a40471813853df62d77603 + checksum: b00358cd282a81c07a473a534d65d5511314cfd62ca2e3581055dd6db13f206da811873b474be6ebb39c0d6ee66b4d7290b622aab869d86ba6d77cef50225d55 languageName: node linkType: hard -"@aws-sdk/credential-provider-imds@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/credential-provider-imds@npm:3.310.0" +"@aws-sdk/credential-provider-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-node@npm:3.342.0" dependencies: - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/url-parser": "npm:3.310.0" + "@aws-sdk/credential-provider-env": "npm:3.342.0" + "@aws-sdk/credential-provider-imds": "npm:3.342.0" + "@aws-sdk/credential-provider-ini": "npm:3.342.0" + "@aws-sdk/credential-provider-process": "npm:3.342.0" + "@aws-sdk/credential-provider-sso": "npm:3.342.0" + "@aws-sdk/credential-provider-web-identity": "npm:3.342.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/shared-ini-file-loader": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: edc6cdecf5c644e143e863efaf8f49b7bcaa362475e2639887971a8ff7d10bc2f84bb6ddac4c4c786dd5e0d22edf058fdf83f89d9c5fe007235af05aa6164622 + checksum: ac5214f8da1b30cdf122ca86c703beab6d76e9f62efdbe05080ac9bf2bc5e941b83d78ad037f87009af57b82125cfd459603a6bc08857ee5bb064b73e599a310 languageName: node linkType: hard -"@aws-sdk/credential-provider-imds@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/credential-provider-imds@npm:3.329.0" +"@aws-sdk/credential-provider-process@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-process@npm:3.342.0" dependencies: - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/shared-ini-file-loader": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 6ec90ae7e463691de0f961ef90cef98ee57eaca8ff0b2a27e0aa5fc07d7eae4b90aadae98f7e3316a26637c19bbe8d4400a53c4ad4718acaf6f5bf749cdd603f + checksum: b0c909eacf74dce17d18b0d9a826e7f4c98f48fb14e57e15d0fb2db5d3068c592a5ed9227f927b3e38755e4ee415cad8ea070a618225564782e5ce0d188df71d languageName: node linkType: hard -"@aws-sdk/credential-provider-ini@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/credential-provider-ini@npm:3.327.0" +"@aws-sdk/credential-provider-sso@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-sso@npm:3.342.0" dependencies: - "@aws-sdk/credential-provider-env": "npm:3.310.0" - "@aws-sdk/credential-provider-imds": "npm:3.310.0" - "@aws-sdk/credential-provider-process": "npm:3.310.0" - "@aws-sdk/credential-provider-sso": "npm:3.327.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.310.0" - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/client-sso": "npm:3.342.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/shared-ini-file-loader": "npm:3.342.0" + "@aws-sdk/token-providers": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: f5707ac74075824a32d16716ed1492704e90ce7a8572387119ef25e5defef04978a75db0e8f49cf702b9afb5aeca8850a99eb6481f56d96dc6a272b647c93056 + checksum: 85a8c3814aba78f37c8c8ecc96a96771df4f69290758527f22779ef475df2ab2f10232459e955333ed96de3649cd97957f4c1934ba0f6be264189b8d39452882 languageName: node linkType: hard -"@aws-sdk/credential-provider-ini@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/credential-provider-ini@npm:3.332.0" +"@aws-sdk/credential-provider-web-identity@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/credential-provider-web-identity@npm:3.342.0" dependencies: - "@aws-sdk/credential-provider-env": "npm:3.329.0" - "@aws-sdk/credential-provider-imds": "npm:3.329.0" - "@aws-sdk/credential-provider-process": "npm:3.329.0" - "@aws-sdk/credential-provider-sso": "npm:3.332.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.329.0" - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: b87946f4b74904896d21dddc6c9564d59b31d775116f0a31ba5be5b1137293bd55a9bccc40fef173c7f2e0d4e0e4585dd4021098caeccca0b578db5be7bb50b8 + checksum: 6989324b981db39d840b4cf0b257f0a8996bb85ce952b4feb840b223c1cf5bbddb0783656497e678a10766379c5314ea01452dd6f2d0b1fb206afbda0d03bab1 languageName: node linkType: hard -"@aws-sdk/credential-provider-node@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/credential-provider-node@npm:3.327.0" - dependencies: - "@aws-sdk/credential-provider-env": "npm:3.310.0" - "@aws-sdk/credential-provider-imds": "npm:3.310.0" - "@aws-sdk/credential-provider-ini": "npm:3.327.0" - "@aws-sdk/credential-provider-process": "npm:3.310.0" - "@aws-sdk/credential-provider-sso": "npm:3.327.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.310.0" - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 04f10696da0087d671c6d98486c0034a0a7162a80fdee047be1c50fd86957955778543ea2c0569d916d14fb7701d3c93ac0d387a98ef30850919f1846b0b048b - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-node@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/credential-provider-node@npm:3.332.0" - dependencies: - "@aws-sdk/credential-provider-env": "npm:3.329.0" - "@aws-sdk/credential-provider-imds": "npm:3.329.0" - "@aws-sdk/credential-provider-ini": "npm:3.332.0" - "@aws-sdk/credential-provider-process": "npm:3.329.0" - "@aws-sdk/credential-provider-sso": "npm:3.332.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.329.0" - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 8900cd74488803715acc72f2546a5f9e4507306827905bce4d1af20477d221e7ad038b6ce98e9e4f235bf807eee3a5d63d2bcce921d6ab9bd63134f0d9c956fc - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-process@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/credential-provider-process@npm:3.310.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 6cd97bd81b217bfcc93ac52af4921d748d88b61b6905ea9fe2000ff6274b970f56290a84c20c30e785d4a8efca8cd6f138577ad56e0bb5232876e605cbff4480 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-process@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/credential-provider-process@npm:3.329.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: ad125b9c5e6bb16cef650b67d151e4217afc21d9dfd3b563e41aaae5908ac107e061c15d8d8745849eb970dfaf3e5ad2d800b9b9b28ebaf7a5ca38194548bb56 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-sso@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/credential-provider-sso@npm:3.327.0" - dependencies: - "@aws-sdk/client-sso": "npm:3.327.0" - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.310.0" - "@aws-sdk/token-providers": "npm:3.327.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 177071c9d46023406bff1dae72b880784c5ff17f794f86c0421d635b24591f12d1b2127ef268d891a17455c4f5756628e5cf97fe424ed6f94f0b57201aaccd95 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-sso@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/credential-provider-sso@npm:3.332.0" - dependencies: - "@aws-sdk/client-sso": "npm:3.332.0" - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.329.0" - "@aws-sdk/token-providers": "npm:3.332.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 5738d9eae17f1043d43ee143bd8f811f4a9558bdaacf61479438d98795582219270b79d92660f1688955ee186ec313c438b33914c0d6feeb33db511cab4b2e54 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-web-identity@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/credential-provider-web-identity@npm:3.310.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 86d95473990b31d09df11436e2291d165fb4ec9a123fa2944ef4b098f29dff6de650d75179913d957b13ed140b0c18dbbef46a4bd0676f1d4fe11f371415fb32 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-web-identity@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/credential-provider-web-identity@npm:3.329.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: cfdf8074d2f7bc1d1f85ca815a6bbc861a7fbb6c1d745869188133d8ec05b012711a43dc9683a513e46e7155e5a6b961ff8473413f5a130f45798b8a58592858 - languageName: node - linkType: hard - -"@aws-sdk/eventstream-codec@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/eventstream-codec@npm:3.329.0" +"@aws-sdk/eventstream-codec@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/eventstream-codec@npm:3.342.0" dependencies: "@aws-crypto/crc32": "npm:3.0.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-hex-encoding": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: aef44310a556160e9c8ca4e79ffb99f5b9781648a2640413132e2525e2df1f449ddf43b71a03ae1d33a38cf092aef5a47750bae0e0bfaf42b151c5ebc847ca93 + checksum: b735b3ea18e61b6e6d3164aea01176d0deb3776fb9883ae6b696b4282a1280d4348d3af5c9ba51cdcdf2615dcb546484e12f9335b66c5e8868a353bd74810c53 languageName: node linkType: hard -"@aws-sdk/eventstream-serde-browser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/eventstream-serde-browser@npm:3.329.0" +"@aws-sdk/eventstream-serde-browser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/eventstream-serde-browser@npm:3.342.0" dependencies: - "@aws-sdk/eventstream-serde-universal": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/eventstream-serde-universal": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 9b0c2503c8cd450cc7f27ec89453a1d76e3aa1abd9cca9379e96e808c45af3e8e51ab5a0df676e7ed5ffdd2d137ca13d52e45e7b0a830b5fa6b6af0225df0d63 + checksum: 345f41170276b6d4fcd55e218e9256337c2fc264b5af62dd5357a2fb1a2c5d98feb3f8814711a3d2344c02738517f1e033c38989d778be49e951a00764835c6b languageName: node linkType: hard -"@aws-sdk/eventstream-serde-config-resolver@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/eventstream-serde-config-resolver@npm:3.329.0" +"@aws-sdk/eventstream-serde-config-resolver@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/eventstream-serde-config-resolver@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 4aad3bdd73073808e875d896b22e4cc370cb4c82b82dd9042be1cee6c0fcbb694c0f9b91434a1a1429cb34e11ddf6dcbf862ae757ff9c691e140a4c7b5225a2b + checksum: cd08f6a6058994f769dae3ba06007f9a19be6870f970e855af7621d68ce3c03475864ebb7467dde28a1e902aaac355d6bb99c9a56a9b056ad01e65fe12f8d42e languageName: node linkType: hard -"@aws-sdk/eventstream-serde-node@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/eventstream-serde-node@npm:3.329.0" +"@aws-sdk/eventstream-serde-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/eventstream-serde-node@npm:3.342.0" dependencies: - "@aws-sdk/eventstream-serde-universal": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/eventstream-serde-universal": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 4852c098cb26d31b7ff936dc1f0bf81ae4e9c459bc3dddfc331afd784ecda02b340e6187399ef19681c59b134eda4cfa8f7d0b4276c8c6bb4d981877994731d0 + checksum: 5267253359a9a5c3bb7104458894052e011922bc67119b5566d86dc48c2242335e0e417993bae296731553a6c994cf3225863fe054387cd2aff8badc6125f351 languageName: node linkType: hard -"@aws-sdk/eventstream-serde-universal@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/eventstream-serde-universal@npm:3.329.0" +"@aws-sdk/eventstream-serde-universal@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/eventstream-serde-universal@npm:3.342.0" dependencies: - "@aws-sdk/eventstream-codec": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/eventstream-codec": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: c269cb96a53e37ab3d38329bc5357adebbf2ed26c604df9929c9dddc4537e7372b0a0174677f1c943c6518c65e75e1bf149546568fc9f5b39bcba23157a68621 + checksum: 18ae41b14105a22c3689878453d92cafcc6febd8bdee6ef16f5f2e50df578e8e25bc6d4130e588efd4b83c1e2b4dc60796514be8d4701e54cef575bb4ecb8d4d languageName: node linkType: hard -"@aws-sdk/fetch-http-handler@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/fetch-http-handler@npm:3.310.0" +"@aws-sdk/fetch-http-handler@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/fetch-http-handler@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/querystring-builder": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/querystring-builder": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 566b1b2a9c9ac159dc874dc4d815f4e1cb3f55bf77746ec6132a577a231737d69e9a862744fc5492bcde1a79726c7a942362c65c03a45355959fe8eebf731ce6 + checksum: 63e3544b61dfcf90341a424978109666680a5b029b15f8c83f1f0f62744faab5ecf83aedb23194e349e3b4d0190085598a6b03570d15ea64d5ea7816b407df1a languageName: node linkType: hard -"@aws-sdk/fetch-http-handler@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/fetch-http-handler@npm:3.329.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/querystring-builder": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-base64": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: d0961fb2ed3d3635d459082812af4b2670771928696d5c5ab7cf9786714b48577278ac2d477745e4798ac290fe54b44a78e1b3fe998ae14ac200161651458829 - languageName: node - linkType: hard - -"@aws-sdk/hash-blob-browser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/hash-blob-browser@npm:3.329.0" +"@aws-sdk/hash-blob-browser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/hash-blob-browser@npm:3.342.0" dependencies: "@aws-sdk/chunked-blob-reader": "npm:3.310.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 5a46f85c60304a22ab190c110d648e7393935c982455e4cff100ed1d374f43f5500272ae4d6a2c6e09561be1af507fa6fc3d26a089eb6af37aa374cd843164bb + checksum: a5669c25e76c98440c4292d3ed9df99ebafaf78c36af5225cd759863d617e8011a2d51d0a520a377bbb11c92900615ea285285a5f344e3caf3959afc4a2194ad languageName: node linkType: hard -"@aws-sdk/hash-node@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/hash-node@npm:3.310.0" +"@aws-sdk/hash-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/hash-node@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-buffer-from": "npm:3.310.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: d0b0a999126e1cfbb4f54ceff13de331901bc3c642c51399e86146befb7d38255b9f56a2a7c299954c02624c90405599c1070349acad43ad656903f6c21a57c2 + checksum: aed80c2ff0ce31f09b257045c46fd263273377369ae1c6556667a25436341f3175b0da64c86c7ba761b70fdd01adba5c98f7f83af413bbd5d95102335f6752a6 languageName: node linkType: hard -"@aws-sdk/hash-node@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/hash-node@npm:3.329.0" +"@aws-sdk/hash-stream-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/hash-stream-node@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-buffer-from": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 7eaa0387ec49a58fc5ecd31b1a258540983058a5de7167c52ab570b44379afa3e006b5711692ee4891bfa998c14e08d9859eead0e0b004307af092ae87fb37b9 + checksum: 3a5f01d6ec5038f89b323115ad177b0c724d2a559e4c2dc954d2ec2321cfc550cb014fe35d12f0a840c7408ebd38925634cb18d72032b7e2c22bf5b38ba252c4 languageName: node linkType: hard -"@aws-sdk/hash-stream-node@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/hash-stream-node@npm:3.329.0" +"@aws-sdk/invalid-dependency@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/invalid-dependency@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-utf8": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 738f9d92be0405d04699299cb6c9f5f561decc99c0910fe063d68682183e38af07a62f6e031c67c3bf62cf759cb78b5dec1f76872581f8795c9c7cef4ec97e76 - languageName: node - linkType: hard - -"@aws-sdk/invalid-dependency@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/invalid-dependency@npm:3.310.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 2275aecde5a11184e862482d01858e6d89a5135eeb634934499580250da85616e41e93eff489b76747379e8bb00e15603ccc261d442d0ffe1a82e400989511db - languageName: node - linkType: hard - -"@aws-sdk/invalid-dependency@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/invalid-dependency@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: d81664bb97389a0436650b009e8ec5dc56a1d6b7bc8fd2718e1c5cf129381eddc77c06ea1241ee958470bd02c2df3837310a83087c43c42296a9f5246120dc32 + checksum: 999dd998854391e815937250d58a970fbd965c05886e50c97f537157d7866aeadda14817b92b2df78a788df563619e8e86db9001b1fbd74919996d1178010d21 languageName: node linkType: hard @@ -954,675 +638,384 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/md5-js@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/md5-js@npm:3.310.0" +"@aws-sdk/md5-js@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/md5-js@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: e0ea528190e54acafd4147293cbd467e584193b4adcf3264b90066af21479596cab2a814e391318ce06e4df1442abedd333ce0c37b7b7123e086f09855637930 + checksum: 32187b5846e055fe89494b0a4f6352abad340aecb4c5466a40657c5f16bfade3f5df505968bd99c71bf1dad6297d03fa14cf0a6fa683d7a94c2fea1594ad03f3 languageName: node linkType: hard -"@aws-sdk/md5-js@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/md5-js@npm:3.329.0" +"@aws-sdk/middleware-bucket-endpoint@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-bucket-endpoint@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-utf8": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 3157a9019d7320bec351b06dfffd79c9518e98b76b99ff2f6c8223f71a0765dd49b62d906b8e5b162a2cb328d2c8322f9223418e049905e3f7af94023bfac43f - languageName: node - linkType: hard - -"@aws-sdk/middleware-bucket-endpoint@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-bucket-endpoint@npm:3.329.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-arn-parser": "npm:3.310.0" "@aws-sdk/util-config-provider": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 904a121931fd3ead5576f165da2a505e9a0cdd361c050932caafe5346a10dc5b118f0703a5a990f4c032654f5da93515d502897c2597ba35bee0a4b764cb812f + checksum: d84299c6b71d9871f6c1056db8205fb99d0b8590dbce026281697c144bd3140671a049e7971a1d666600635f22ad1bd42edc1dc1dfd76ac46f40c826fe79a104 languageName: node linkType: hard -"@aws-sdk/middleware-content-length@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-content-length@npm:3.325.0" +"@aws-sdk/middleware-content-length@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-content-length@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 952497379396683177b81169a2cac90ebbbf3576a356d4b7f4e8eb36155b0cfa20de8fcba3e4acfae8e5dc2bf9a66326a2fb9e682b487ab99a463d90fb81f4ff + checksum: 15145175423eefdb06c64e3a34dd883da32e145f90c2edd08c423c8823ccd1adaa1785976a48a9443f3c3dc30aef7c846d82b660e00eb6254d864ffe718774da languageName: node linkType: hard -"@aws-sdk/middleware-content-length@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-content-length@npm:3.329.0" +"@aws-sdk/middleware-endpoint@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-endpoint@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/middleware-serde": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/url-parser": "npm:3.342.0" + "@aws-sdk/util-middleware": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: b6e8b7d79ae843cc7acc5fb2de7fcf1d621190570604c10fe877023b6caf07768ffc59a8dda717762321cf11aedd01282f2ae15a08c80b4b844b711e1cfdb3f7 + checksum: 252122a44b84a159aaad690036cf1b80a43663df5d67ba129122f6e51f6d3ad3e128249dfb3a4e6dc23813617821611155842656407b459340f7f64710be39b3 languageName: node linkType: hard -"@aws-sdk/middleware-endpoint@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-endpoint@npm:3.325.0" +"@aws-sdk/middleware-expect-continue@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-expect-continue@npm:3.342.0" dependencies: - "@aws-sdk/middleware-serde": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/url-parser": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.310.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 615efc3438f1051b6b0ed8aab9e2f18a0b192a776d3920f21b1da8971305f03446fc50b95f90c1b4364003a33805e86133be991e782e85a723bff7a47bbb5281 + checksum: 77e9090e121c8fe730a8198ff027babbb59eb2ab926bdac300ab39732a18bcdfcd1a137043a8d3157b200c519b4f4dec8e3c4757867d499b6b7293ac1b4e0b84 languageName: node linkType: hard -"@aws-sdk/middleware-endpoint@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-endpoint@npm:3.329.0" - dependencies: - "@aws-sdk/middleware-serde": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/url-parser": "npm:3.329.0" - "@aws-sdk/util-middleware": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 407dd4e70555035fd5c9a0ed4c61c4fad712499cf4a4f293cb1343e777788cb57b9feac17b47acceb1b2f60b3405fa563279b3ae69e1337548803b6fbe605387 - languageName: node - linkType: hard - -"@aws-sdk/middleware-expect-continue@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-expect-continue@npm:3.329.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 4fa5c1213cc3ff1ae5b5d71079212a3825db83fe6a8b9d9d23a971be7b9eaddb0b1908724571aba6fcbab7e3391915af0665c30c8a3a58c9326ad4543818ca5d - languageName: node - linkType: hard - -"@aws-sdk/middleware-flexible-checksums@npm:3.331.0": - version: 3.331.0 - resolution: "@aws-sdk/middleware-flexible-checksums@npm:3.331.0" +"@aws-sdk/middleware-flexible-checksums@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-flexible-checksums@npm:3.342.0" dependencies: "@aws-crypto/crc32": "npm:3.0.0" "@aws-crypto/crc32c": "npm:3.0.0" "@aws-sdk/is-array-buffer": "npm:3.310.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: cbfc42a47f95c9fb306148b03bdde4dae3124ea89f278a967953c0db8b2cf2073eda20bce244aa9170546072a4b51d718c1f9b82fa308c1653eb57c5ac64fffc + checksum: c1f5d6b03a04a0d4720069438189400d6ca3b352513be228789e3641d1acd0d642cc65f6ab8824193457824cc240b4f7731151c91a12f9a09ce843143ab087d2 languageName: node linkType: hard -"@aws-sdk/middleware-host-header@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-host-header@npm:3.325.0" +"@aws-sdk/middleware-host-header@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-host-header@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 0acb0c412af6245f2b5048b88891ba3aa32433f81549e34fee67ffe7d8e53d88a7b03274cc5ad81c0e571ac801c1c1fec5df008af4b0cea192831a78132e2853 + checksum: e2fffc9e6e1f966512535da8b1bfaf51c733da49d80354834d61b453e3be1012ef20b999c64dcb636329cc286c9455d2d6e4d8f285a575e062c7e1d085a634be languageName: node linkType: hard -"@aws-sdk/middleware-host-header@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-host-header@npm:3.329.0" +"@aws-sdk/middleware-location-constraint@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-location-constraint@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: f0470b64e8836c4da8825bad5a30b8af1d18df16dcd7702a436ed4e5c3c60b9c161512f3b7b2ba6f316ce2a92f4171d7de6e686896b679bcb789e178dde5f216 + checksum: e5280dd6e686a7a18ed1095243c248c49021fa427a55d36e0a87fe98434bf894f1f4f6d836e24ced8e6e96357ea720486829de2679061ca5c536de0a7cfb37b0 languageName: node linkType: hard -"@aws-sdk/middleware-location-constraint@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-location-constraint@npm:3.329.0" +"@aws-sdk/middleware-logger@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-logger@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 3fb7da295e490499d09fef5d858253d50c7a4c710bd310a236ca8b418e3a7b9606881f6001a672880a5f88ab8b2339700b93c886aa71cce0b9a5f3282931cea0 + checksum: dd21063fcf941689ba0fc8fdbf3502d17db935ba3a6c58105eab7aaf729eda98e13d8392addf2b9b5421ef56bc69888453f8b3020d85e6cc92d7c21adc37fd55 languageName: node linkType: hard -"@aws-sdk/middleware-logger@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-logger@npm:3.325.0" +"@aws-sdk/middleware-recursion-detection@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-recursion-detection@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: c672c3159c1945daf1ea7e32434e9c63693907ef8d481ffbf2f82e127c896f379d8f85e44eeb53e75f79616098c8ebb3b3c013dc3e01290a25406e2c928ddbcd + checksum: db1969cf8bcebf38ae1d912a480e9a479fde3e2ccf95e9588a2cf769e385d35985e59b19e69f1bf9c055df8ee4c270db535ff113e43e200808ec2c8ac99338d4 languageName: node linkType: hard -"@aws-sdk/middleware-logger@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-logger@npm:3.329.0" +"@aws-sdk/middleware-retry@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-retry@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: b8b4732902b0faffdb7ee6972151c04463a5f348100cbb8f53326125d213941d8c03b04fbc1472ea5b1be5a077723d3c419787be72fe8f9effce7d0d978c1df6 - languageName: node - linkType: hard - -"@aws-sdk/middleware-recursion-detection@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-recursion-detection@npm:3.325.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 23dd2098d11fa97445a1c2579fda1766df75851ddd61dba27c6936263ab7043254dcedd2b13772f1dadf3968fa854b21fe5b7f8cad88cf78fc7c4d3f4007c13f - languageName: node - linkType: hard - -"@aws-sdk/middleware-recursion-detection@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-recursion-detection@npm:3.329.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 7dff5457a71f4d711caa86980af638776c356b9d4885099648cfe75b0297e5daf835f89090894aec0cc5e39088c2decf187a2f4e59878bbc18b42c40d2536810 - languageName: node - linkType: hard - -"@aws-sdk/middleware-retry@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/middleware-retry@npm:3.327.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/service-error-classification": "npm:3.327.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.310.0" - "@aws-sdk/util-retry": "npm:3.327.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/service-error-classification": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/util-middleware": "npm:3.342.0" + "@aws-sdk/util-retry": "npm:3.342.0" tslib: "npm:^2.5.0" uuid: "npm:^8.3.2" - checksum: fad677af76892958aa896ddb7ce7e644e20a6a8af4499f9e0d688b899aa77b1b06b97545a3c479a7da11fc357b1954497fd04871a311f169131931ea7ed5c310 + checksum: 523f92bb273903de692e9c36f0c127b00b3510fdcd1eaf96bd1564f99512f1ce9978d592ca6a63e351ea623fc2d86e9fafc9d1faad2d962f09effe2846a5ffbf languageName: node linkType: hard -"@aws-sdk/middleware-retry@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-retry@npm:3.329.0" +"@aws-sdk/middleware-sdk-s3@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-sdk-s3@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/service-error-classification": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-middleware": "npm:3.329.0" - "@aws-sdk/util-retry": "npm:3.329.0" - tslib: "npm:^2.5.0" - uuid: "npm:^8.3.2" - checksum: 9d66667c569737e67df475debce8f579ce358384152aad69acf3f2219673008f3a42821e77b8f38294b587a9ea7e3af78f632e77321256cad530e97d118814a5 - languageName: node - linkType: hard - -"@aws-sdk/middleware-sdk-s3@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-sdk-s3@npm:3.329.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-arn-parser": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 8045000e8fdb2779ede8ce6199aed39e95724de5f0fb4bec374febaf4cc75a6ba8d4576c020c6534bb4395cd90c6142d22a1293b924354c4dcbfd6b3d89903f8 + checksum: 9566084c947c9ba499506af7e2f2c9aa005b11aee638a33693782ae12f9d3914e9fde5f36ef30c09c018e2b55abb5fc4fbf1285ee61fd0a83379d262600b1953 languageName: node linkType: hard -"@aws-sdk/middleware-sdk-sqs@npm:3.326.0": - version: 3.326.0 - resolution: "@aws-sdk/middleware-sdk-sqs@npm:3.326.0" +"@aws-sdk/middleware-sdk-sqs@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-sdk-sqs@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-hex-encoding": "npm:3.310.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 6cf46dede4c2c4f7259d64642a98d4660a670176d5675c9e32b621d3404610cf34b229f921295c74f859a60c74d20239600013270553354abf6191cd8fcba6c4 + checksum: 19853b3446a9916a6601eb0845842d740625950c5853c535748a666fae00f22fd9a4e188fdffbccfdcfc88556f7d9fbaccacfa8f80d2cb232e03c7fe0b806948 languageName: node linkType: hard -"@aws-sdk/middleware-sdk-sqs@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-sdk-sqs@npm:3.329.0" +"@aws-sdk/middleware-sdk-sts@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-sdk-sts@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-hex-encoding": "npm:3.310.0" - "@aws-sdk/util-utf8": "npm:3.310.0" + "@aws-sdk/middleware-signing": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 9d1e875bfbf28a2541b9cdfc89eada35b70cb50a052c62bda1c8e6bb4463053b0be6ea637c0195deb0a6199e3324f57bbcaab968de9a42601a3250b41857df04 + checksum: 39c8d9ae7e456e5c4138bf37aa0d10b478182b8272074f54328c5c626f11079c9d72590a2efe8dc55a468e5a00d1799e16092d1d7f13ff2fb96da0a9eefa48ca languageName: node linkType: hard -"@aws-sdk/middleware-sdk-sts@npm:3.326.0": - version: 3.326.0 - resolution: "@aws-sdk/middleware-sdk-sts@npm:3.326.0" +"@aws-sdk/middleware-serde@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-serde@npm:3.342.0" dependencies: - "@aws-sdk/middleware-signing": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: cc0650fea6af107ce7050bde043d7c0683a5950e44f2aacecb997e768a26d639d292da2ccf4ed21714df73d111854ff78c8ef5abe351caa1e52762d57ea8dcc5 + checksum: 9620ae05af6dd4d47b72e3b853f4bf249f2fe38149cf43a7632ed23e0a3709d3c89734687e56ad6644fe80646820a9f0eec6b5bf2d950bc5bc0de5ce0b7825ee languageName: node linkType: hard -"@aws-sdk/middleware-sdk-sts@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-sdk-sts@npm:3.329.0" +"@aws-sdk/middleware-signing@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-signing@npm:3.342.0" dependencies: - "@aws-sdk/middleware-signing": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/signature-v4": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/util-middleware": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 845b3f43bb71821887bf6c4b6b7677ec7b6f09b2adcba9af1d2c3be595b73b4d05090946d03a1cf5bcc1fef23f0bd34a167958241b5f7b72da3b7185d664018c + checksum: ccbede8d93ab48f7428f1fc8d383f6e42c9da218c3e2d3e2349c44184b5dab1dcb4413bc4020905cdd5ddb3dbeb204bf041f023d9f04279cf4db0fd28fb6cc2b languageName: node linkType: hard -"@aws-sdk/middleware-serde@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-serde@npm:3.325.0" +"@aws-sdk/middleware-ssec@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-ssec@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 8019efc312b98030e3f7b86c57aafebe39b594a3f4ab0ff812e6a6115a5d70da0614527f2fce7dcc91ebc05ec321ac9418a944235453daf173c39d0823cfb096 + checksum: d4f0daae975827035214a58d52e6446f76485dee05e08a04a2a972fff53761b29ed210162dd235adde0a58e1084cf128f5ee4c642c66565760b45e855da46917 languageName: node linkType: hard -"@aws-sdk/middleware-serde@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-serde@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: d200e913408fe754de33b1d0185120d148b21864c866d1e1f973ac7eae7094b6336d0f46655ab10aa8b4730d85cdaaa9d614b349da9fd9c031d0af77dc788105 - languageName: node - linkType: hard - -"@aws-sdk/middleware-signing@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-signing@npm:3.325.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/signature-v4": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 0343e4b4adbcd743c8c30a36609c82bdbf1ced456fa81369cae981116189ddfe4a0ad9380f06e236e7f9b24c6d4201b7412b3172376c69a09f5bdcb2b6608237 - languageName: node - linkType: hard - -"@aws-sdk/middleware-signing@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-signing@npm:3.329.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/signature-v4": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-middleware": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 06103d8a7d1ba42e5d31d56e962f222aa26486da2215d7a3eea3685b83d066637a72b7650917d8247cc2366e436d1fc7e33454334fdb2f05ff4e710c891e52ba - languageName: node - linkType: hard - -"@aws-sdk/middleware-ssec@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-ssec@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 60d044f82dba7916a6f0bd28f320e9b357cfb3d53d6f727dc9a844584f2278189bd71aa21b9c78ff43b900a92ba531e57ee9510e6824527b04823ed49af3c5b5 - languageName: node - linkType: hard - -"@aws-sdk/middleware-stack@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/middleware-stack@npm:3.325.0" +"@aws-sdk/middleware-stack@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-stack@npm:3.342.0" dependencies: tslib: "npm:^2.5.0" - checksum: 7223b76201986991bea5eb127ce9e542ea35c92e652ac562e72f5199660e1868b2e34075b22a560b47ea5292bd9bfb1afd96ce15a4606319dc71fe4c2824f966 + checksum: 1529e1a9b7cb487c538bb75d9aad201f0961303a832ab52b632c9048abe2cb384ec4dfca3b948b442f47eca019061d55f5198b8b3610400400a85cd9c7f297f7 languageName: node linkType: hard -"@aws-sdk/middleware-stack@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/middleware-stack@npm:3.329.0" +"@aws-sdk/middleware-user-agent@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/middleware-user-agent@npm:3.342.0" dependencies: + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" + "@aws-sdk/util-endpoints": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 80f34d8ff6c2dc0e6e7a431ee10e43a7e6480d082b99368845f329af6fbd406fb3b77f46013dff4bfe58e83027fdacdfea8ade20c80f8068cf5c3912292e16b6 + checksum: e308f45750b9a52e2d6758a4cf23a62f06b3ede488ab2685c85763bc83155746620c0fa970626b62b225028ec4f081e38209fa029648c651ffa071bba838cee1 languageName: node linkType: hard -"@aws-sdk/middleware-user-agent@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/middleware-user-agent@npm:3.327.0" +"@aws-sdk/node-config-provider@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/node-config-provider@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - "@aws-sdk/util-endpoints": "npm:3.327.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/shared-ini-file-loader": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: c3908a502095b2151d7e18925f8e2add9cc93ff8cbd6052aad32f8ce3492328738c5838a6e4d6ee778d6081f8290601f834e624ee1350928fffff09c64c59b6c + checksum: 6b3a6a132eac8a6dd76df0536c132dd49ad18e90794d6c7f84a4531b8360adf882f09c0907c3c59e0e03beb67f9b7f8a9b1de6b610d715e29e5cc45117ce1a83 languageName: node linkType: hard -"@aws-sdk/middleware-user-agent@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/middleware-user-agent@npm:3.332.0" +"@aws-sdk/node-http-handler@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/node-http-handler@npm:3.342.0" dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-endpoints": "npm:3.332.0" + "@aws-sdk/abort-controller": "npm:3.342.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/querystring-builder": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 75bfe862c10a7fea3ebdf28cfca41004f67a592ac273d279abd39d9b18fc6d1cb78d741116abf5489966c7bdd93d37a495c4285475fd63474ba958d828774e47 + checksum: 02c12aa1f85d4bea69e8aab8e99295a6dd1b8a33a380d529c4e6263c51b88a11bcdcd10b35cea74b658c55a9282f58d12ca7993fbf7a557fef9a5da1111ae19b languageName: node linkType: hard -"@aws-sdk/node-config-provider@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/node-config-provider@npm:3.310.0" +"@aws-sdk/property-provider@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/property-provider@npm:3.342.0" dependencies: - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 9c7e17db897b620e1efc38a73d72509cada50ec1743d48b3c5086988b046ea7345413c39e15d589e7729e4b7feb663a286d449871d9e94b130e040ffa51eec9a + checksum: 17996d9f76450d8b6248b046b4033107bca6b07c1865bffb53515ab432099a38a25568d6061fbfc09bf417f77afb0f3a55e84f5d8914127dae6bc2d8d02e226a languageName: node linkType: hard -"@aws-sdk/node-config-provider@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/node-config-provider@npm:3.329.0" +"@aws-sdk/protocol-http@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/protocol-http@npm:3.342.0" dependencies: - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 2af283e3f54af2cef15bcecc0eac37a133e71d95d4748f026c35a3a0066eb99d037bef6ad074b58860e0e4b0f469144e271ffa1893b5e4bf71cb3d3a212c134a + checksum: 223a433d48c253fa006a43a8aa85d8c4140382819457f213277504bd34cafad4f2d35ab69dc392e46ea2475fd419ad4f54878003626077aabd2c9b8a4e9d5b56 languageName: node linkType: hard -"@aws-sdk/node-http-handler@npm:3.321.1": - version: 3.321.1 - resolution: "@aws-sdk/node-http-handler@npm:3.321.1" +"@aws-sdk/querystring-builder@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/querystring-builder@npm:3.342.0" dependencies: - "@aws-sdk/abort-controller": "npm:3.310.0" - "@aws-sdk/protocol-http": "npm:3.310.0" - "@aws-sdk/querystring-builder": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 386b87a4a6cac61b69df68f8d48dba3139317ef07dc3d778eac66a188b9c6abc5fab731481f978e4b67b4e54bb358df01314fa60881a795b69f214a587a77381 - languageName: node - linkType: hard - -"@aws-sdk/node-http-handler@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/node-http-handler@npm:3.329.0" - dependencies: - "@aws-sdk/abort-controller": "npm:3.329.0" - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/querystring-builder": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 6b688a94f0dd5a4e66d6b1e0bd87d158e0b092c13054341afc5caa9624896fdc1c6d157200b149d7ed847c20d430615d69604b0af8a697ab37f75b029d18d67f - languageName: node - linkType: hard - -"@aws-sdk/property-provider@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/property-provider@npm:3.310.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 820dd3ffc90bb9b939f5b0a93bfe3d2ea1e967146ef87b23b558c03d4db36923210e0499a707d38e20b8784d6f5e1ee4a448f3eee33f88043c95864b73d74130 - languageName: node - linkType: hard - -"@aws-sdk/property-provider@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/property-provider@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: e11809cea3cc569f3b2ff4036045e33cc6cfbb32629cbb57552523fbc18650db2d45449dd1f2f9d889ce6faf7dca2e3ddaba6e13daf42ce3f42435741d07cca2 - languageName: node - linkType: hard - -"@aws-sdk/protocol-http@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/protocol-http@npm:3.310.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 920d072e6ad4b826a8aff9578676fc8447cb2594379e579aaa412997e4f500b409f31741f285424877331c4ae5220157c71011b17707f6da49f753179a1bfcb6 - languageName: node - linkType: hard - -"@aws-sdk/protocol-http@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/protocol-http@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 459a46d8c07fcd69ba09caf87174e2e79e315e83f5e782d80a1c25f67dd89d456099d8df3f0747f27920fa796f7cf57824ce0b441727025411c569cddda7c425 - languageName: node - linkType: hard - -"@aws-sdk/querystring-builder@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/querystring-builder@npm:3.310.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-uri-escape": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: d6551e9d96fe47ea92390bfc4c68ccacdce29b21e17fe8376429bfdec8b75bad38bd9180fa54cc9453f957ea91de81c1a4582f6942b4213de819e78b7684b1a3 + checksum: 4e383be6ef49a4284762292a7a6ece91fe315ddb698662d073650d9a86b96875c40db179b0290611a7db44fcd9a85610f8d1ba3d658ebea8c165266ff3308afb languageName: node linkType: hard -"@aws-sdk/querystring-builder@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/querystring-builder@npm:3.329.0" +"@aws-sdk/querystring-parser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/querystring-parser@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-uri-escape": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 681efb98ac8f0bdd16a231d47c431e1e3b6fd89bfe3f1c77d294935b90584d834e07c1ce407600c43d71374f4f0506ecc40eca1fa6f7d9bb07d6c22dd3f5a24a + checksum: 413436803251483d29c43e4765749d1acf3f9db6a87014479cb74df19406a697d0489051b49a7872a097b7c1d83da386603322ae7662e443eeec2fcf96129aa5 languageName: node linkType: hard -"@aws-sdk/querystring-parser@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/querystring-parser@npm:3.310.0" +"@aws-sdk/service-error-classification@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/service-error-classification@npm:3.342.0" + checksum: 539998f7b0274e18a2fdef804411f0f4d5a50a5dbf8fba12b5b0c536e5884f99024999388040b32d4a2a173185d244b6091d5ffdad9cbd0b152f318521adcce0 + languageName: node + linkType: hard + +"@aws-sdk/shared-ini-file-loader@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/shared-ini-file-loader@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: cac388e0b1785c1cd9fa07aed650ad2ddddd358509ba87bf929f8e599b3c745427c49dfc824a496016c3d4663d462e14c211008e92f9fe5fa3d44689d9066a00 + checksum: c81cbddccc7003c863cd199d7530356422eddf80702e33aa86adbc5d188099a47aa6e9374409ba5296aca55301c96de1204ec14679f4ef2146890b75444c8959 languageName: node linkType: hard -"@aws-sdk/querystring-parser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/querystring-parser@npm:3.329.0" +"@aws-sdk/signature-v4-multi-region@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/signature-v4-multi-region@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 9ed54dc61d4ce661b64094aa816f409d314beda508aa9d86df4133f23b87632ff25e1a30b78bf75b3fd2ad5e4773902cf18f59d7c28c831b9035ea3b0468d67b - languageName: node - linkType: hard - -"@aws-sdk/service-error-classification@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/service-error-classification@npm:3.327.0" - checksum: d773e8ccdf802c9a6f425b4329251c8e373a4add9b657283c2ac906408a428f5a6bcd9767c858f6db7867e316804af146d05febb950851948c3509284bf803f4 - languageName: node - linkType: hard - -"@aws-sdk/service-error-classification@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/service-error-classification@npm:3.329.0" - checksum: 215b61f2ccee40181d35ebc7d29ff29d9713ec03c74888feda613d9d8a66d763ad4ddec4fc33c8655e5cb447b227488fd8ab285c2406becae06513674e3b38ae - languageName: node - linkType: hard - -"@aws-sdk/shared-ini-file-loader@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/shared-ini-file-loader@npm:3.310.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 387a68d10339d8580063d0d66bbee21836391251e2595fdf949af4b39e2130c819ea1957cf7b5dabf5eb6a8cce46033a06c023399af9de1163674346ee6d1498 - languageName: node - linkType: hard - -"@aws-sdk/shared-ini-file-loader@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/shared-ini-file-loader@npm:3.329.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 4dda8a5a79034437375c789a9a5e5534ca3a86aa28c43d008cec50bb20946c0700ae033b5f4b5f691335d7c58305b9225b29ac50c96d7ffedf50e5e3cef60497 - languageName: node - linkType: hard - -"@aws-sdk/signature-v4-multi-region@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/signature-v4-multi-region@npm:3.329.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.329.0" - "@aws-sdk/signature-v4": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/protocol-http": "npm:3.342.0" + "@aws-sdk/signature-v4": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" peerDependencies: "@aws-sdk/signature-v4-crt": ^3.118.0 peerDependenciesMeta: "@aws-sdk/signature-v4-crt": optional: true - checksum: 1e7ad0e74e87150fe48dcc37a658d3fb51cfc40c2456f07d77cffe7bd26163909758b5861c5f51068da44bb7a00414e27cb6e07421a6a04b3c2d01bbde3d46fc + checksum: e086c0a4ea8977930ef0df3e428364bcc32e069e343e7e36fd5d6c98c229a368948d844877ec3e198ec300577cee408d22ec7eb4aedd3d48fa58806b46566090 languageName: node linkType: hard -"@aws-sdk/signature-v4@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/signature-v4@npm:3.310.0" +"@aws-sdk/signature-v4@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/signature-v4@npm:3.342.0" dependencies: + "@aws-sdk/eventstream-codec": "npm:3.342.0" "@aws-sdk/is-array-buffer": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-hex-encoding": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.310.0" + "@aws-sdk/util-middleware": "npm:3.342.0" "@aws-sdk/util-uri-escape": "npm:3.310.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 0bf52f2e2b711779147435c2b70387b3c3b0f8cdb4747e970f9da2ee74e71038a511ea8a5138a8739d7492d7917f84d3d299d496ce3a32bb5efd64542180d129 + checksum: f667c81ecfbb55735190e80da2e64e157542f01c74966d6f1ffdf930983c30945a326851541caa0f2e406902a6d66d1d9855da20d59aeb92c11c85a1de56189b languageName: node linkType: hard -"@aws-sdk/signature-v4@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/signature-v4@npm:3.329.0" +"@aws-sdk/smithy-client@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/smithy-client@npm:3.342.0" dependencies: - "@aws-sdk/is-array-buffer": "npm:3.310.0" - "@aws-sdk/types": "npm:3.329.0" - "@aws-sdk/util-hex-encoding": "npm:3.310.0" - "@aws-sdk/util-middleware": "npm:3.329.0" - "@aws-sdk/util-uri-escape": "npm:3.310.0" - "@aws-sdk/util-utf8": "npm:3.310.0" + "@aws-sdk/middleware-stack": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: aba37d7f611bf198c84dc4402a8b2727cb6bca311d9abb9c19f40d8dc8c61c3a1eb1322db257f7fec831a4f26471352eebedf3a20b5f7fc30d8dadab5e6ee368 + checksum: e7a5c54479a6d40203aab9f1128f1129703761bb13fb6d14f6658da6163129b734de8fd7d6061cb162bb4fe2c4855ad00c536aea60bef87c86155487d3de7fd5 languageName: node linkType: hard -"@aws-sdk/smithy-client@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/smithy-client@npm:3.325.0" +"@aws-sdk/token-providers@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/token-providers@npm:3.342.0" dependencies: - "@aws-sdk/middleware-stack": "npm:3.325.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/client-sso-oidc": "npm:3.342.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/shared-ini-file-loader": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: b3722bd6ce68cd9c77161557b908a95d61c6e25e38eed0276b24a321c582e41b5755c8c26c57076f674739009056f70c7ffa90ceb9d42ad9595935ce6a26ae7a + checksum: 25bedb256048f4484047056e233adc4149e271901026561e54ad46103358b6bff9eea0f5c85f1a26b99d1a45d0fb6489eb8d3b01de52a44aeeba7d64a5a55e68 languageName: node linkType: hard -"@aws-sdk/smithy-client@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/smithy-client@npm:3.329.0" +"@aws-sdk/types@npm:3.342.0, @aws-sdk/types@npm:^3.222.0": + version: 3.342.0 + resolution: "@aws-sdk/types@npm:3.342.0" dependencies: - "@aws-sdk/middleware-stack": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" tslib: "npm:^2.5.0" - checksum: 45f87ed84676ee6a11f3f0b4ec8ca6835967a2a3d626bc3e67187bcbbe7108c7aff02d0631008f1b20426545477695968d0eae7b3abfee5aa496bf848a636b06 + checksum: e72bd4001532319153e67f83c5ae224b71af7d16a76806f06499c69e2e9d7ee0b73944103ffefee50c921404cf94f58168d584d58f8345d30174ae666cc0cb05 languageName: node linkType: hard -"@aws-sdk/token-providers@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/token-providers@npm:3.327.0" +"@aws-sdk/url-parser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/url-parser@npm:3.342.0" dependencies: - "@aws-sdk/client-sso-oidc": "npm:3.327.0" - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/querystring-parser": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 5ad947776ca17702bff4935ec8e0a8e31e0a4f5b677dde7b879a9aedcb2b475ca18bc15fcb11aeba9f4e4b8f92a85861391a807e4c648b14e171399d8749e65e - languageName: node - linkType: hard - -"@aws-sdk/token-providers@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/token-providers@npm:3.332.0" - dependencies: - "@aws-sdk/client-sso-oidc": "npm:3.332.0" - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 0e04a9d0d65d30742beb6684055e2c60ce6d5ba20de9083095486428e44999bb94c0a665da336c573e1e67a02ebc8aad7d801738159378636a3463804b1a19cc - languageName: node - linkType: hard - -"@aws-sdk/types@npm:3.310.0, @aws-sdk/types@npm:^3.222.0": - version: 3.310.0 - resolution: "@aws-sdk/types@npm:3.310.0" - dependencies: - tslib: "npm:^2.5.0" - checksum: dea8ff032748c64a4388b0428eee23231e02a3c5e1efcf80969b3079a31abcbfecf46f7a55016f5e6522fd0be3fe4fe52a986ebc41aa6842d19ff7341a315309 - languageName: node - linkType: hard - -"@aws-sdk/types@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/types@npm:3.329.0" - dependencies: - tslib: "npm:^2.5.0" - checksum: 28aff60622da99fc386ff0960c5b57ce5e3197ccf7ed2ac0e0ae8eb86630cb5131fb478f2686957b6d0cb35f2ce5be4dad190ee0c96a3a6c2fae37edb6c0a507 - languageName: node - linkType: hard - -"@aws-sdk/url-parser@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/url-parser@npm:3.310.0" - dependencies: - "@aws-sdk/querystring-parser": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: 74fbdf462649a638df247bfe2fa86bebd075a5d44d9514984da1185e7ddaa23c39bd18e3f69ac980505d18a10b915be7282c4dd29138bf6641f0b360a087dfb4 - languageName: node - linkType: hard - -"@aws-sdk/url-parser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/url-parser@npm:3.329.0" - dependencies: - "@aws-sdk/querystring-parser": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 9ca336e5bb75873293292d4002dfca3eaafa465f13026d51e16c9cde949be94d821ab253a580d97f103dd2a63e390c7a23a805a30d99abec488b3c6c6845e1ca + checksum: 0aab9fc60c1451d050a950e57d3ea9beb1cbdf2dc59055af508716f52ec650421f5d245e348cc58eae1083c8cd4a769b08c306766f16c38a56eef9a8990652ca languageName: node linkType: hard @@ -1682,75 +1075,39 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-defaults-mode-browser@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/util-defaults-mode-browser@npm:3.325.0" +"@aws-sdk/util-defaults-mode-browser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-defaults-mode-browser@npm:3.342.0" dependencies: - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" bowser: "npm:^2.11.0" tslib: "npm:^2.5.0" - checksum: e3381e8d31151a7d9e7c878fe07251e2787d7b4b9526c074fe209a431b3f35ccf162a4fa37a0bf5e0a4f4d1a50db99c70b8534c9193db3512845de90656455d1 + checksum: 1791b2098f437941346c0aedd36f19d13d6b92e47e171e641819d3a0135f72292c0ea3a20f6e1d8a405697cd56d536c2adc19403667a342145692b20dcbdff2b languageName: node linkType: hard -"@aws-sdk/util-defaults-mode-browser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-defaults-mode-browser@npm:3.329.0" +"@aws-sdk/util-defaults-mode-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-defaults-mode-node@npm:3.342.0" dependencies: - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - bowser: "npm:^2.11.0" + "@aws-sdk/config-resolver": "npm:3.342.0" + "@aws-sdk/credential-provider-imds": "npm:3.342.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/property-provider": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: ccff18607b8549a840441465695d9ad054667a2ceceac87ffd77b2ccd20605a2ee31ff2dc44115af5e63a593cad4ead10d9bee54493c515d558f876f41aaf73e + checksum: 2aaceef844a2f32c5d62f8c6e71f4ccd05e1777f779e7a71a2fab5d25c030a12cd0cfb064f65bf704ba733f04e042055ba1849f8f39d46b830525a99d88c9bcf languageName: node linkType: hard -"@aws-sdk/util-defaults-mode-node@npm:3.325.0": - version: 3.325.0 - resolution: "@aws-sdk/util-defaults-mode-node@npm:3.325.0" +"@aws-sdk/util-endpoints@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-endpoints@npm:3.342.0" dependencies: - "@aws-sdk/config-resolver": "npm:3.310.0" - "@aws-sdk/credential-provider-imds": "npm:3.310.0" - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/property-provider": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 7da217a5e8c8b1cb07ea786dc7281fe5f3d27fe7081945f1ba4495332da8dc69604afd0813deb268b57dffb2bfcfa8ec6b08ed61f272f5450609d2b9e066ff90 - languageName: node - linkType: hard - -"@aws-sdk/util-defaults-mode-node@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-defaults-mode-node@npm:3.329.0" - dependencies: - "@aws-sdk/config-resolver": "npm:3.329.0" - "@aws-sdk/credential-provider-imds": "npm:3.329.0" - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/property-provider": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: f927efbc3dc8d59b8fcba7ac42b118006268854a9b77d763c4d3c8e5e0d2e5795a66a1652992e69e7f813286a74b5f266d35fa039551ac48acd19288ae100849 - languageName: node - linkType: hard - -"@aws-sdk/util-endpoints@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/util-endpoints@npm:3.327.0" - dependencies: - "@aws-sdk/types": "npm:3.310.0" - tslib: "npm:^2.5.0" - checksum: f9b1cfeb1a20de87f8190604986c1bf740127ba45a2147292060a8d02960a00294e52a2c957618eca536f3a3fae1226b5a1d663aaa367a03d139cab6a42eea8c - languageName: node - linkType: hard - -"@aws-sdk/util-endpoints@npm:3.332.0": - version: 3.332.0 - resolution: "@aws-sdk/util-endpoints@npm:3.332.0" - dependencies: - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 1974420c7788a63f13af5d4a970d94f5279e2c8b294ba18fe81cda493bf10260cb782ad51907a9a7eaade282fa4ad787e9e0bc704cbc552756c976a7b3ea19db + checksum: b93ab766a6613d89c0c0dab61479a33103a595eb9f5b8f30605d6c99b1853efc12035fe357b397bf693b6fc6346040f72c1d2523b100ddcb7d3f303d63f0355a languageName: node linkType: hard @@ -1772,67 +1129,48 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-middleware@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/util-middleware@npm:3.310.0" +"@aws-sdk/util-middleware@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-middleware@npm:3.342.0" dependencies: tslib: "npm:^2.5.0" - checksum: 7a206a6b5e5f2d181d0be9ffafbfb5aabf468e65e84557c2b9a3969792b84b7a737967c96cfa26ceef25aa66f279dbf12efd457ba08513b10cce5facd9e044a6 + checksum: 124e68ffe88e06f06f8ab32fa771666320af09da555a1d65bc0ef6495a26e93d9b3f93302fa76ba2b4aa2afd63e272fbbaf5550334838b96e230750fca4b024e languageName: node linkType: hard -"@aws-sdk/util-middleware@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-middleware@npm:3.329.0" +"@aws-sdk/util-retry@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-retry@npm:3.342.0" dependencies: + "@aws-sdk/service-error-classification": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: 0493c049ae7ac5269ff65a9ce8860f89f542ab9f32a54bcde3de6301ef70595c3a4eed8fe5df1fc5b9117dd3c2ccb7310f85a4ec2bd102c29bf79c13ad0715cd + checksum: ef695eb274406f5a43ed48d4ab8a26f9a0d47f91723284161ff51d1dcadfd10cd387eb1ccf536dfebb4cebb1df30f3e6d69d1862bccaf355cf4a1714d8fd88d9 languageName: node linkType: hard -"@aws-sdk/util-retry@npm:3.327.0": - version: 3.327.0 - resolution: "@aws-sdk/util-retry@npm:3.327.0" +"@aws-sdk/util-stream-browser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-stream-browser@npm:3.342.0" dependencies: - "@aws-sdk/service-error-classification": "npm:3.327.0" - tslib: "npm:^2.5.0" - checksum: 12b3d6b2f1e179a96afbd11380c11d054fa633c5b06fce9ebaf7a48b7c68fe34faa7e7edffcbac001df7be134d414833b608e3b1b713fa9de016055eb4e17c25 - languageName: node - linkType: hard - -"@aws-sdk/util-retry@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-retry@npm:3.329.0" - dependencies: - "@aws-sdk/service-error-classification": "npm:3.329.0" - tslib: "npm:^2.5.0" - checksum: 3612d19ae420f6de2e8137c17986b2ecb5d476ca66de160801b578d6381c7b761a0039a63dcfa9fcf73d7f73d689a340f3e340c17627c6c0a0e5e7870e5b9978 - languageName: node - linkType: hard - -"@aws-sdk/util-stream-browser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-stream-browser@npm:3.329.0" - dependencies: - "@aws-sdk/fetch-http-handler": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/fetch-http-handler": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-base64": "npm:3.310.0" "@aws-sdk/util-hex-encoding": "npm:3.310.0" "@aws-sdk/util-utf8": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: cf5f8ed1a1bace3f98a56387c1b0219b544a1726150afaf9376d09155d7b1116d2f3dd4e1c37826be799898adc97e714f6de42c796eda87266e707617c9115a4 + checksum: b29e4b4d0057f6cbfb8d284826b231d474bc135013784641d8ca5e7e7d07241752edb3c2fe98a9e542dfd2c1a5cdad5388548bee20052c58ebe0f980e0581400 languageName: node linkType: hard -"@aws-sdk/util-stream-node@npm:3.331.0": - version: 3.331.0 - resolution: "@aws-sdk/util-stream-node@npm:3.331.0" +"@aws-sdk/util-stream-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-stream-node@npm:3.342.0" dependencies: - "@aws-sdk/node-http-handler": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/node-http-handler": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" "@aws-sdk/util-buffer-from": "npm:3.310.0" tslib: "npm:^2.5.0" - checksum: 9519a1718d6f30848629de04cca975241e1a2aa1dc0937ba859ea31e8d6cf47ce512030a1fd596d2d22917950875483b9a974267acd373153d5a3b42af4e420a + checksum: 99c2e126e2d5d23e41541792f3a0d4f19965a898a73c0a454b339f71d912469a99726795b5a1d88156a8772df670039b63de2e9a996bd7441353a069679bc45f languageName: node linkType: hard @@ -1845,57 +1183,30 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-user-agent-browser@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/util-user-agent-browser@npm:3.310.0" +"@aws-sdk/util-user-agent-browser@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-user-agent-browser@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/types": "npm:3.342.0" bowser: "npm:^2.11.0" tslib: "npm:^2.5.0" - checksum: 6b99886964742bd3db8ba7a536c3e7dc4cfb0c561811d7369d3a3d47acaca9f00cd530adf51c5af0fc54d07ac041655876c43ed2a971ce896269b9a65bd776c5 + checksum: 2dc9690a7747d0899895a8fe8d346e5f5fb6e7738c74df3f6811428312b013b10282de81322ff6687b9faa8e23d0e50e55fd0cd77de15bae15b9e5cc2690c134 languageName: node linkType: hard -"@aws-sdk/util-user-agent-browser@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-user-agent-browser@npm:3.329.0" +"@aws-sdk/util-user-agent-node@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-user-agent-node@npm:3.342.0" dependencies: - "@aws-sdk/types": "npm:3.329.0" - bowser: "npm:^2.11.0" - tslib: "npm:^2.5.0" - checksum: 04f10b65e726303fbe0acd2a7f9b48ad26cc69e06dd7a6afb15589a4f45c43a368ca7d42622f36260a85da5895c150db47156f78edf4e7e14b5cb062760c6f46 - languageName: node - linkType: hard - -"@aws-sdk/util-user-agent-node@npm:3.310.0": - version: 3.310.0 - resolution: "@aws-sdk/util-user-agent-node@npm:3.310.0" - dependencies: - "@aws-sdk/node-config-provider": "npm:3.310.0" - "@aws-sdk/types": "npm:3.310.0" + "@aws-sdk/node-config-provider": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" peerDependencies: aws-crt: ">=1.0.0" peerDependenciesMeta: aws-crt: optional: true - checksum: bb28f9f8e77d9176bdf59e2743b9d6d97aeab72447befefc419d13bcc90bf65cd6f9ecac75cf936655140193efa1a21d146253b67d0c21876190d0bfe02af81e - languageName: node - linkType: hard - -"@aws-sdk/util-user-agent-node@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-user-agent-node@npm:3.329.0" - dependencies: - "@aws-sdk/node-config-provider": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" - tslib: "npm:^2.5.0" - peerDependencies: - aws-crt: ">=1.0.0" - peerDependenciesMeta: - aws-crt: - optional: true - checksum: cebebd6e4dc332cb1623845e7021d87946b02ff862268c2d1ee6ebde735a35d610b816cdd6bbf19046433e1d77a0b634dbe557fe8dcb8d05313734ea5c059a46 + checksum: 5703e2a13fa5c7dab5e145df4372fc961f5aa0a9df0bd4565ef8d568964abae2d478392865003e2b2494bf415a10d3f918660daadecf13b060f7d1882ff81774 languageName: node linkType: hard @@ -1918,14 +1229,14 @@ __metadata: languageName: node linkType: hard -"@aws-sdk/util-waiter@npm:3.329.0": - version: 3.329.0 - resolution: "@aws-sdk/util-waiter@npm:3.329.0" +"@aws-sdk/util-waiter@npm:3.342.0": + version: 3.342.0 + resolution: "@aws-sdk/util-waiter@npm:3.342.0" dependencies: - "@aws-sdk/abort-controller": "npm:3.329.0" - "@aws-sdk/types": "npm:3.329.0" + "@aws-sdk/abort-controller": "npm:3.342.0" + "@aws-sdk/types": "npm:3.342.0" tslib: "npm:^2.5.0" - checksum: f32fd95b7de9d49e435980ea40e5f90bc19e6c5206bf94a53522a322f47d38b7dd2c8e3ac33edba5b10f468d17f8ab1690435aba51a5786d825c7fd38c9d0c55 + checksum: 404a4ebece8cddcfd02b6982d8be0a7d398c6746a7009d1b3dd21a3ba65eee481950cc85e2aa87f8a0293cf28821e65a685bd52d683b763e8b94052d8f413392 languageName: node linkType: hard @@ -1938,7 +1249,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.21.4": +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.21.4": version: 7.21.4 resolution: "@babel/code-frame@npm:7.21.4" dependencies: @@ -1947,67 +1258,67 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.21.5": - version: 7.21.7 - resolution: "@babel/compat-data@npm:7.21.7" - checksum: 4a1451f70feeef41bc096402950b0ed027336c7b6238c113d28aeda5d9f6274adc6de23d9b6d22ab2d68c83ce23f6cd776b53492c48844e9a1e6dcfbe389dc89 +"@babel/compat-data@npm:^7.22.0": + version: 7.22.3 + resolution: "@babel/compat-data@npm:7.22.3" + checksum: 87573507cbbfbf3c0c146d64286355ce21437d0d4aa1bcd1b7480ae746f01a99aa484b40d184eeb3bd713579ba181652cef8b5ab9a5174130fe15231886907ca languageName: node linkType: hard "@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3": - version: 7.21.8 - resolution: "@babel/core@npm:7.21.8" + version: 7.22.1 + resolution: "@babel/core@npm:7.22.1" dependencies: "@ampproject/remapping": "npm:^2.2.0" "@babel/code-frame": "npm:^7.21.4" - "@babel/generator": "npm:^7.21.5" - "@babel/helper-compilation-targets": "npm:^7.21.5" - "@babel/helper-module-transforms": "npm:^7.21.5" - "@babel/helpers": "npm:^7.21.5" - "@babel/parser": "npm:^7.21.8" - "@babel/template": "npm:^7.20.7" - "@babel/traverse": "npm:^7.21.5" - "@babel/types": "npm:^7.21.5" + "@babel/generator": "npm:^7.22.0" + "@babel/helper-compilation-targets": "npm:^7.22.1" + "@babel/helper-module-transforms": "npm:^7.22.1" + "@babel/helpers": "npm:^7.22.0" + "@babel/parser": "npm:^7.22.0" + "@babel/template": "npm:^7.21.9" + "@babel/traverse": "npm:^7.22.1" + "@babel/types": "npm:^7.22.0" convert-source-map: "npm:^1.7.0" debug: "npm:^4.1.0" gensync: "npm:^1.0.0-beta.2" json5: "npm:^2.2.2" semver: "npm:^6.3.0" - checksum: 81e8853407b3a6b0808f7d8f196612f9a510dec1cec0a45a07bc7b0982c24abe848944fe0d8efc6840842e272ef55825537c5870e5a52def9e0111231d020fd8 + checksum: 8fd937c29889c9047bcc0ea627b2a4bf92c8b64b8845892aef3dfbe6121dab966137c11091680b6f234667ce47a24f23bb99f2a18948518fd320d623d7b143a3 languageName: node linkType: hard -"@babel/generator@npm:^7.21.5, @babel/generator@npm:^7.7.2": - version: 7.21.5 - resolution: "@babel/generator@npm:7.21.5" +"@babel/generator@npm:^7.22.0, @babel/generator@npm:^7.22.3, @babel/generator@npm:^7.7.2": + version: 7.22.3 + resolution: "@babel/generator@npm:7.22.3" dependencies: - "@babel/types": "npm:^7.21.5" + "@babel/types": "npm:^7.22.3" "@jridgewell/gen-mapping": "npm:^0.3.2" "@jridgewell/trace-mapping": "npm:^0.3.17" jsesc: "npm:^2.5.1" - checksum: 8ae5c7ece0da5d981ccc1456ad204178d6817318dc60c706cec779f8b2c6290d69e62c14e4463ca3076a194918aae57509d4e3f8a0c2936b454f9404ec6f7a6d + checksum: 29543a50bb5d017ca97839c422968ab981e237331f5378f5f9cc6b85eb316636dc378f2c79ab29e890ac4143c04ccab13f0551b3d5bc1660cd3c3094c5cdbb64 languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-compilation-targets@npm:7.21.5" +"@babel/helper-compilation-targets@npm:^7.22.1": + version: 7.22.1 + resolution: "@babel/helper-compilation-targets@npm:7.22.1" dependencies: - "@babel/compat-data": "npm:^7.21.5" + "@babel/compat-data": "npm:^7.22.0" "@babel/helper-validator-option": "npm:^7.21.0" browserslist: "npm:^4.21.3" lru-cache: "npm:^5.1.1" semver: "npm:^6.3.0" peerDependencies: "@babel/core": ^7.0.0 - checksum: d716fa2845e12a272ce4cc248fea2db0f3f4bec4be6fa09ee398eb57a2d191907984a09857f53a990e4fe0ab4625353ae32f9beeff0d903fa7b193ab5c8da948 + checksum: 41b4c96c17e6935b0c92af1eef45f97896fd2cc44472f0702bca858da3f97f5d3599f4abfa88e72c9127a6fd52df4c10bbb30039dc21e9ee0c33dbc8a612bbc1 languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-environment-visitor@npm:7.21.5" - checksum: b9177ab55aa830d4baa5c99a8c1b55b014ab361905e27bbe7e12a53982795fec7c624067235afdb9543722bae0384d862ad821366f6eac90176d26f3cd8fbb26 +"@babel/helper-environment-visitor@npm:^7.22.1": + version: 7.22.1 + resolution: "@babel/helper-environment-visitor@npm:7.22.1" + checksum: 0849bb9a9d9b2a8d95bcaf5d021215162066b3261c4b5df198e9a39f18ae0986e72d768a6c13c7c7504bc6bcba45097a6c4f77874b018377e06d7bf18414f621 languageName: node linkType: hard @@ -2039,19 +1350,19 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-module-transforms@npm:7.21.5" +"@babel/helper-module-transforms@npm:^7.22.1": + version: 7.22.1 + resolution: "@babel/helper-module-transforms@npm:7.22.1" dependencies: - "@babel/helper-environment-visitor": "npm:^7.21.5" + "@babel/helper-environment-visitor": "npm:^7.22.1" "@babel/helper-module-imports": "npm:^7.21.4" "@babel/helper-simple-access": "npm:^7.21.5" "@babel/helper-split-export-declaration": "npm:^7.18.6" "@babel/helper-validator-identifier": "npm:^7.19.1" - "@babel/template": "npm:^7.20.7" - "@babel/traverse": "npm:^7.21.5" - "@babel/types": "npm:^7.21.5" - checksum: 024306552da190f9ae4e56214aa3aa1b5ed5479104caf6c1a6ff435cc3edb8b2ac2f5fb4aa70f22ae2a8c8b2d0344c9ecbb42b0eb88f83fa01ef4bb0f2867aae + "@babel/template": "npm:^7.21.9" + "@babel/traverse": "npm:^7.22.1" + "@babel/types": "npm:^7.22.0" + checksum: f4d4a4aabfc8f77e4b36e6b6a26352581992c598e448f1e44e0c252272add351eea7a5d18bbb62a781ea95233014d6ab407d8891ec7e88df13a5f33bb83c6c51 languageName: node linkType: hard @@ -2101,14 +1412,14 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helpers@npm:7.21.5" +"@babel/helpers@npm:^7.22.0": + version: 7.22.3 + resolution: "@babel/helpers@npm:7.22.3" dependencies: - "@babel/template": "npm:^7.20.7" - "@babel/traverse": "npm:^7.21.5" - "@babel/types": "npm:^7.21.5" - checksum: 55c2ca9987ea5bd7222bf52d9d0c6b80a2003e1a0ddac3f36ef4932d53b722cf19c22808399e16ff73dddaf1b9fb8545deab6f3161f9744ab8653be16d230d26 + "@babel/template": "npm:^7.21.9" + "@babel/traverse": "npm:^7.22.1" + "@babel/types": "npm:^7.22.3" + checksum: fe9bed4b8844614c46fd861b4615e805a25da023ab2d47acbff9545937c286e1d793ce355f139d802300b36b080c17ed81fd538c87c61de0f3a1709403fe109b languageName: node linkType: hard @@ -2123,12 +1434,12 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.5, @babel/parser@npm:^7.21.8": - version: 7.21.8 - resolution: "@babel/parser@npm:7.21.8" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.9, @babel/parser@npm:^7.22.0, @babel/parser@npm:^7.22.4": + version: 7.22.4 + resolution: "@babel/parser@npm:7.22.4" bin: parser: ./bin/babel-parser.js - checksum: bd71a12bc76ff70317a20d10b9a9de9142b00608eeb45904e40a1337af82538aae8c18f30ee0ef16b384de28584197e39c960cdd10576a8e72f34f7ecdadff5e + checksum: 98c5dc2de79decef81ca4c224fcc0347c268464fe344a891a03b2f31ccda28387259f01280357fa8b312fdfd61db222c75efcb4443d009880be5fd6bcc0dd69a languageName: node linkType: hard @@ -2286,43 +1597,52 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.20.7, @babel/template@npm:^7.3.3": - version: 7.20.7 - resolution: "@babel/template@npm:7.20.7" +"@babel/runtime@npm:^7.21.0": + version: 7.22.3 + resolution: "@babel/runtime@npm:7.22.3" dependencies: - "@babel/code-frame": "npm:^7.18.6" - "@babel/parser": "npm:^7.20.7" - "@babel/types": "npm:^7.20.7" - checksum: a655fb476be89195fd0e0e89b278d0ad5edd351d7fec6e9902c9797b831895f6bcfc2b9a29de4228cdabd2904230b1db3f3ebff88aed6f3f6d4dd85db8a4d8a8 + regenerator-runtime: "npm:^0.13.11" + checksum: f42e4e8ef50e6b8676ab996d224ed8ed7e6927a43c131cb55092246a368ccfd9f7909bbe51b1d01ad330ea18920865ef0a46cbd89b6d1a3f1e5f26c1089c4196 languageName: node linkType: hard -"@babel/traverse@npm:^7.21.5, @babel/traverse@npm:^7.7.2": - version: 7.21.5 - resolution: "@babel/traverse@npm:7.21.5" +"@babel/template@npm:^7.20.7, @babel/template@npm:^7.21.9, @babel/template@npm:^7.3.3": + version: 7.21.9 + resolution: "@babel/template@npm:7.21.9" dependencies: "@babel/code-frame": "npm:^7.21.4" - "@babel/generator": "npm:^7.21.5" - "@babel/helper-environment-visitor": "npm:^7.21.5" + "@babel/parser": "npm:^7.21.9" + "@babel/types": "npm:^7.21.5" + checksum: c57a31ccbad9549395e99a643b2efca02094da4723475abeb0bb2c306e70d2bfae9b6f31727826b3b645827c3fb9d679a1f9a22b1b647279ac27fe683722aca3 + languageName: node + linkType: hard + +"@babel/traverse@npm:^7.22.1, @babel/traverse@npm:^7.7.2": + version: 7.22.4 + resolution: "@babel/traverse@npm:7.22.4" + dependencies: + "@babel/code-frame": "npm:^7.21.4" + "@babel/generator": "npm:^7.22.3" + "@babel/helper-environment-visitor": "npm:^7.22.1" "@babel/helper-function-name": "npm:^7.21.0" "@babel/helper-hoist-variables": "npm:^7.18.6" "@babel/helper-split-export-declaration": "npm:^7.18.6" - "@babel/parser": "npm:^7.21.5" - "@babel/types": "npm:^7.21.5" + "@babel/parser": "npm:^7.22.4" + "@babel/types": "npm:^7.22.4" debug: "npm:^4.1.0" globals: "npm:^11.1.0" - checksum: b6b54c978abff8118c82bb70741f91d9d64dea1948f391694b80d13f3cb452e50930e7fde37d9747605d57e51df36ce6a068541f001393129e05ba901e082257 + checksum: 9e1d2d08f401a1e5eaf8166b2c4f96308a28e867302f8d4a65f4a7436e6b1b940daad5d0f3e9da2cb0946dccf1b3e4b1846bf489f250f67be8e6ea9ab8900d6c languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.4, @babel/types@npm:^7.21.5, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": - version: 7.21.5 - resolution: "@babel/types@npm:7.21.5" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.4, @babel/types@npm:^7.21.5, @babel/types@npm:^7.22.0, @babel/types@npm:^7.22.3, @babel/types@npm:^7.22.4, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": + version: 7.22.4 + resolution: "@babel/types@npm:7.22.4" dependencies: "@babel/helper-string-parser": "npm:^7.21.5" "@babel/helper-validator-identifier": "npm:^7.19.1" to-fast-properties: "npm:^2.0.0" - checksum: 779c3c9552300cb1619e1f0761363d1f2e2167283f7dc54bb324fc83d41f7298bdcfca989c60ee2e656f674b2df7c6d077bc1f266ddd5834b3e34b13e5c7858a + checksum: 17c986be01b6cd19bbea2400b8773d706c0f8b573caeabba616862b9cbccf22ed3df4792e2a1d7cf41cd3ecd3a1ba481ad8be704c82de9f15f745619c04af98c languageName: node linkType: hard @@ -2377,6 +1697,41 @@ __metadata: languageName: node linkType: hard +"@chevrotain/cst-dts-gen@npm:10.5.0": + version: 10.5.0 + resolution: "@chevrotain/cst-dts-gen@npm:10.5.0" + dependencies: + "@chevrotain/gast": "npm:10.5.0" + "@chevrotain/types": "npm:10.5.0" + lodash: "npm:4.17.21" + checksum: e690e1e56796465f83487ad81a2e73d57dc376adff3558a0c2646e7ff888a06ba0e9ba31fd23b02e212831ae4d5481e4f74a4dd845af946654c11c2dfe5450e9 + languageName: node + linkType: hard + +"@chevrotain/gast@npm:10.5.0": + version: 10.5.0 + resolution: "@chevrotain/gast@npm:10.5.0" + dependencies: + "@chevrotain/types": "npm:10.5.0" + lodash: "npm:4.17.21" + checksum: d0fa1434e0c44a9f3fb7f2264803d4c6ad43f54d318e8e64bee1ad709bfe7f8090220381d57fb989a0fbb78a45da634cb1a6588aa2aecf4bbfad4cfda43cff2e + languageName: node + linkType: hard + +"@chevrotain/types@npm:10.5.0": + version: 10.5.0 + resolution: "@chevrotain/types@npm:10.5.0" + checksum: a12f5523998a6cc3fb81ab399a026cb9c75514e306ce726ea08bad8a28430173382f2610deb8b1eddf562541d4518d5c9d79c2225d3d9cfd90ce517071835d25 + languageName: node + linkType: hard + +"@chevrotain/utils@npm:10.5.0": + version: 10.5.0 + resolution: "@chevrotain/utils@npm:10.5.0" + checksum: b0e5ae2f2c45d1ebb780c036a581c45ffe1cc3012a156077aa2fdb7571a2252e01ca5534833fac407f062f39bd84fe0111043c96931df1c2fb4c7d963204b219 + languageName: node + linkType: hard + "@colors/colors@npm:1.5.0": version: 1.5.0 resolution: "@colors/colors@npm:1.5.0" @@ -2385,11 +1740,11 @@ __metadata: linkType: hard "@commitlint/cli@npm:^17.0.2": - version: 17.6.3 - resolution: "@commitlint/cli@npm:17.6.3" + version: 17.6.5 + resolution: "@commitlint/cli@npm:17.6.5" dependencies: "@commitlint/format": "npm:^17.4.4" - "@commitlint/lint": "npm:^17.6.3" + "@commitlint/lint": "npm:^17.6.5" "@commitlint/load": "npm:^17.5.0" "@commitlint/read": "npm:^17.5.1" "@commitlint/types": "npm:^17.4.4" @@ -2400,16 +1755,16 @@ __metadata: yargs: "npm:^17.0.0" bin: commitlint: cli.js - checksum: 118e13847416ff9ccced022a81d17019ac7d370cd572ecdbfd76e9d96664b7f898a48b179f48d0d8a2290c82fe583950fa7a4d93b2398e6d7b6fe37b647879a9 + checksum: 9bc387ae28dea3fef4b67beb4a2527e6aaa2cf1597f48e3f374e2841e78689f32fd9110a0e95d6b6cb2c6b514d0c9dab7cb0df9d24718480802db32ea3d7a100 languageName: node linkType: hard "@commitlint/config-conventional@npm:^17.0.2": - version: 17.6.3 - resolution: "@commitlint/config-conventional@npm:17.6.3" + version: 17.6.5 + resolution: "@commitlint/config-conventional@npm:17.6.5" dependencies: conventional-changelog-conventionalcommits: "npm:^5.0.0" - checksum: 8ebd54fde6116589aa404b4a594e718f1fc1d0de843475c95298789a561836501d329539dfaa98f9711137fbe353cd6f60c3af2f156d7e592b2b22fc1bc7d7a8 + checksum: e1e74bd1d476b60f2c2de47be6a5bb3a41b210529bdc9c05b5d0968177f7a14275e730a57b78858f8e3e02a58ea56e835428b6aaf08edf3496b03978cba3e0bb languageName: node linkType: hard @@ -2454,25 +1809,25 @@ __metadata: languageName: node linkType: hard -"@commitlint/is-ignored@npm:^17.6.3": - version: 17.6.3 - resolution: "@commitlint/is-ignored@npm:17.6.3" +"@commitlint/is-ignored@npm:^17.6.5": + version: 17.6.5 + resolution: "@commitlint/is-ignored@npm:17.6.5" dependencies: "@commitlint/types": "npm:^17.4.4" semver: "npm:7.5.0" - checksum: a7267396d64d10ded862145732a82b730906ea746da6ee22a355c0bd25e197ad15ce1d8ff065b4d5eda9d4e42a484c53b963963dffe74d807af4871f38193dc5 + checksum: f0b88f925ddf3ca10d6df64489c16da2bfcbc219ca9b2ea49fb2d88dd0cc9328e6551250989c20a34e5627f99d10fc4ca058ee45715f8a75bfc06ba888652836 languageName: node linkType: hard -"@commitlint/lint@npm:^17.6.3": - version: 17.6.3 - resolution: "@commitlint/lint@npm:17.6.3" +"@commitlint/lint@npm:^17.6.5": + version: 17.6.5 + resolution: "@commitlint/lint@npm:17.6.5" dependencies: - "@commitlint/is-ignored": "npm:^17.6.3" - "@commitlint/parse": "npm:^17.4.4" - "@commitlint/rules": "npm:^17.6.1" + "@commitlint/is-ignored": "npm:^17.6.5" + "@commitlint/parse": "npm:^17.6.5" + "@commitlint/rules": "npm:^17.6.5" "@commitlint/types": "npm:^17.4.4" - checksum: 6ba065cf07b925b9203bf2ca2ff5a96c38d485f5271044a3db73e737483c7f568996cfcaeaaf963cd86fb39c93d9e49f64223b71e48d623a633ec47a511e5647 + checksum: 16d7ae7f6954311de6201aa913fa1d0c423488b2c9420002bfca0e1effdaa28510df9e290e523f9015c6f9b8b72758edd0b201d63b6112923f67c5f01b64cf29 languageName: node linkType: hard @@ -2505,14 +1860,14 @@ __metadata: languageName: node linkType: hard -"@commitlint/parse@npm:^17.4.4": - version: 17.4.4 - resolution: "@commitlint/parse@npm:17.4.4" +"@commitlint/parse@npm:^17.6.5": + version: 17.6.5 + resolution: "@commitlint/parse@npm:17.6.5" dependencies: "@commitlint/types": "npm:^17.4.4" conventional-changelog-angular: "npm:^5.0.11" conventional-commits-parser: "npm:^3.2.2" - checksum: 354301638fe5349074729a063ed20ef7e5ab610cc1ff44937daf850528e76af5161b367213b600bff4f16e26ffa0a05706cf3fb02f3055cb69e8780133773290 + checksum: 017eb4ddd1398d4e65d26c9164beb0c6db1d1ab70ca0b411eb01ab8073c7e5b0dc4bbc5fb467b04ae6054505e793f70c1e8660a3c56a4700f47b3a1def19c5a8 languageName: node linkType: hard @@ -2543,16 +1898,16 @@ __metadata: languageName: node linkType: hard -"@commitlint/rules@npm:^17.6.1": - version: 17.6.1 - resolution: "@commitlint/rules@npm:17.6.1" +"@commitlint/rules@npm:^17.6.5": + version: 17.6.5 + resolution: "@commitlint/rules@npm:17.6.5" dependencies: "@commitlint/ensure": "npm:^17.4.4" "@commitlint/message": "npm:^17.4.2" "@commitlint/to-lines": "npm:^17.4.0" "@commitlint/types": "npm:^17.4.4" execa: "npm:^5.0.0" - checksum: 7e7c552fa925d39144ec48c4cd5f32580d23cb3bbac92d0776d5096a48bb26c3a956e99f1088b7d026a61e61c76cbb5fb3ce97d6367bad501401f716c0fd24ed + checksum: 29ee0da954157ef7a93ca117f06f202ac6e46d89fbc7bf6303342a66cbcd4c25d7a85368e967fd5677b04432edfe2e262fb3967e99aeda8ab8dbbc316e62eca6 languageName: node linkType: hard @@ -2630,27 +1985,27 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.0.2": - version: 2.0.2 - resolution: "@eslint/eslintrc@npm:2.0.2" +"@eslint/eslintrc@npm:^2.0.3": + version: 2.0.3 + resolution: "@eslint/eslintrc@npm:2.0.3" dependencies: ajv: "npm:^6.12.4" debug: "npm:^4.3.2" - espree: "npm:^9.5.1" + espree: "npm:^9.5.2" globals: "npm:^13.19.0" ignore: "npm:^5.2.0" import-fresh: "npm:^3.2.1" js-yaml: "npm:^4.1.0" minimatch: "npm:^3.1.2" strip-json-comments: "npm:^3.1.1" - checksum: 95c94b88d32373e07b14c6697df329f952ad79b0d8a1388f90e7753dfaba4c17d80295c9537e812056385a93b09971108a4c647d56e2c81e0856e9968d4062ac + checksum: 41c404e8cbca6e0717bce15425f15d34514c38ebcef5daf99467d405733bae73908227feea4d04edc64906e89cc53f30391c31864a5e51b3d3838a05a3a97356 languageName: node linkType: hard -"@eslint/js@npm:8.39.0": - version: 8.39.0 - resolution: "@eslint/js@npm:8.39.0" - checksum: 731360c47e3b2312b73e1f582c6105a585bb82a7ae1cd00d36d31d20a8616108aa4b8c286cf73f8fd05b24d49fd141aa40457ab54c1145b70a62346df78081cd +"@eslint/js@npm:8.41.0": + version: 8.41.0 + resolution: "@eslint/js@npm:8.41.0" + checksum: 7f4b1d920b5216c2c6a14574e5fc970c7858784c007358e5271c17bd8a8c51fcd5972ac4904c082722bb0fdf404bfe67f7d518c4b1e90ec77a82c92b3ef1e484 languageName: node linkType: hard @@ -3079,38 +2434,7 @@ __metadata: languageName: node linkType: hard -"@lerna-lite/cli@npm:2.3.0, @lerna-lite/cli@npm:^2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/cli@npm:2.3.0" - dependencies: - "@lerna-lite/core": "npm:2.3.0" - "@lerna-lite/init": "npm:2.3.0" - dedent: "npm:^0.7.0" - dotenv: "npm:^16.0.3" - import-local: "npm:^3.1.0" - load-json-file: "npm:^7.0.1" - npmlog: "npm:^7.0.1" - yargs: "npm:^17.7.2" - peerDependenciesMeta: - "@lerna-lite/exec": - optional: true - "@lerna-lite/list": - optional: true - "@lerna-lite/publish": - optional: true - "@lerna-lite/run": - optional: true - "@lerna-lite/version": - optional: true - "@lerna-lite/watch": - optional: true - bin: - lerna: dist/cli.js - checksum: 8bf301d379c93f3db8d48731229f7409a4391b3011fb6b4d7d8ad8a70716736322f2bccb77eaaccb7447787b96f9afc73c228523e937243dcf376fc117dfa743 - languageName: node - linkType: hard - -"@lerna-lite/cli@npm:2.4.0": +"@lerna-lite/cli@npm:2.4.0, @lerna-lite/cli@npm:^2.3.0": version: 2.4.0 resolution: "@lerna-lite/cli@npm:2.4.0" dependencies: @@ -3141,40 +2465,6 @@ __metadata: languageName: node linkType: hard -"@lerna-lite/core@npm:2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/core@npm:2.3.0" - dependencies: - "@npmcli/run-script": "npm:^6.0.1" - chalk: "npm:^5.2.0" - clone-deep: "npm:^4.0.1" - config-chain: "npm:^1.1.13" - cosmiconfig: "npm:^8.1.3" - dedent: "npm:^0.7.0" - execa: "npm:^7.1.1" - fs-extra: "npm:^11.1.1" - glob-parent: "npm:^6.0.2" - globby: "npm:^13.1.4" - inquirer: "npm:^9.2.1" - is-ci: "npm:^3.0.1" - json5: "npm:^2.2.3" - load-json-file: "npm:^7.0.1" - minimatch: "npm:^9.0.0" - npm-package-arg: "npm:^10.1.0" - npmlog: "npm:^7.0.1" - p-map: "npm:^6.0.0" - p-queue: "npm:^7.3.4" - resolve-from: "npm:^5.0.0" - semver: "npm:^7.5.0" - slash: "npm:^5.0.1" - strong-log-transformer: "npm:^2.1.0" - write-file-atomic: "npm:^5.0.1" - write-json-file: "npm:^5.0.0" - write-pkg: "npm:^5.1.0" - checksum: 54a0dc2558a06c10f93c3e664acca5fed698db0f7d63838e696392005c1ad26a62d8c866a3e0780355ede00e820f537e83a96f4466eeb9b876bb063d66b81a73 - languageName: node - linkType: hard - "@lerna-lite/core@npm:2.4.0": version: 2.4.0 resolution: "@lerna-lite/core@npm:2.4.0" @@ -3209,26 +2499,14 @@ __metadata: languageName: node linkType: hard -"@lerna-lite/filter-packages@npm:2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/filter-packages@npm:2.3.0" +"@lerna-lite/filter-packages@npm:2.4.0": + version: 2.4.0 + resolution: "@lerna-lite/filter-packages@npm:2.4.0" dependencies: - "@lerna-lite/core": "npm:2.3.0" + "@lerna-lite/core": "npm:2.4.0" multimatch: "npm:^6.0.0" npmlog: "npm:^7.0.1" - checksum: 3f943deb39598fbb0dd354ec77569e1f8d1831c154940ecd28b07afc64faa4f2a11a64b675b297856e6e1559f34bd288af9994d3f0f04fa4efe33cdb5e55a067 - languageName: node - linkType: hard - -"@lerna-lite/init@npm:2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/init@npm:2.3.0" - dependencies: - "@lerna-lite/core": "npm:2.3.0" - fs-extra: "npm:^11.1.1" - p-map: "npm:^6.0.0" - write-json-file: "npm:^5.0.0" - checksum: f087c5e417734a189fe4f86be0c786b1656f1c12c402cc173f075fdb5ce24da565489db9998620136182d4401f45cbd17340edf3ca20fde3bf74264b679e927d + checksum: 91718a038ed39d509e9df2b5334317e1053031e73c98f99bf59f579e8717e70332f251b93ea12a3496c741b65ef172c15c0bd55d539d0d128c95ff9e3252b77d languageName: node linkType: hard @@ -3245,37 +2523,37 @@ __metadata: linkType: hard "@lerna-lite/list@npm:^2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/list@npm:2.3.0" + version: 2.4.0 + resolution: "@lerna-lite/list@npm:2.4.0" dependencies: - "@lerna-lite/cli": "npm:2.3.0" - "@lerna-lite/core": "npm:2.3.0" - "@lerna-lite/filter-packages": "npm:2.3.0" - "@lerna-lite/listable": "npm:2.3.0" - checksum: 1f3f62fa071e9fd52b52ea45e85512897f85acc5b9e08d04b3e3e33d10941a1d76f8ffed7f04ad66405c2bf6688d9b2a3e82502b51fc9c75be8d670985cd508f + "@lerna-lite/cli": "npm:2.4.0" + "@lerna-lite/core": "npm:2.4.0" + "@lerna-lite/filter-packages": "npm:2.4.0" + "@lerna-lite/listable": "npm:2.4.0" + checksum: 73748b74a98c2a117bd2ed11afaeabbb8d55e97024b3ba23d4b961580d6487b110695fcdccd8f91b8319d590322a56d6adbe642295494b657a3eff242c8ba5eb languageName: node linkType: hard -"@lerna-lite/listable@npm:2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/listable@npm:2.3.0" +"@lerna-lite/listable@npm:2.4.0": + version: 2.4.0 + resolution: "@lerna-lite/listable@npm:2.4.0" dependencies: - "@lerna-lite/core": "npm:2.3.0" + "@lerna-lite/core": "npm:2.4.0" chalk: "npm:^5.2.0" columnify: "npm:^1.6.0" - checksum: bb096246d96739611f30ca2574746cd3cc1167207e4f678a1c2e42844b086dcf6c8847503cf7beede9b8b86b9ad752ba48107f60137602c22744aff2767310bc + checksum: 11e10c2a6ec9e2b243818700a890fd48c6b835176e137ecfbac61a28203dbc6f196aad82686b1f189ebfda05125a832dd48d1b9de6fc78c5b4fa56492f9f166f languageName: node linkType: hard -"@lerna-lite/profiler@npm:2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/profiler@npm:2.3.0" +"@lerna-lite/profiler@npm:2.4.0": + version: 2.4.0 + resolution: "@lerna-lite/profiler@npm:2.4.0" dependencies: - "@lerna-lite/core": "npm:2.3.0" + "@lerna-lite/core": "npm:2.4.0" fs-extra: "npm:^11.1.1" npmlog: "npm:^7.0.1" upath: "npm:^2.0.1" - checksum: bd55c4c2cebd0566c980eee786e3318649c6fc6b6a2e0cf3b93c3f1182788acfdcfca74ff4da5c4f8a87509a39c24a5d52ecb10371f347073d3c709979a95d0e + checksum: 76330c00c92c63c8e900595b8661438763e99a1dcc0711339283f893ba1ee59de8cf9594f5d527d72a4ab0f51a320388c64f8f63d74067cef55b286ce0e0e205 languageName: node linkType: hard @@ -3314,22 +2592,22 @@ __metadata: linkType: hard "@lerna-lite/run@npm:^2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/run@npm:2.3.0" + version: 2.4.0 + resolution: "@lerna-lite/run@npm:2.4.0" dependencies: - "@lerna-lite/cli": "npm:2.3.0" - "@lerna-lite/core": "npm:2.3.0" - "@lerna-lite/filter-packages": "npm:2.3.0" - "@lerna-lite/profiler": "npm:2.3.0" + "@lerna-lite/cli": "npm:2.4.0" + "@lerna-lite/core": "npm:2.4.0" + "@lerna-lite/filter-packages": "npm:2.4.0" + "@lerna-lite/profiler": "npm:2.4.0" chalk: "npm:^5.2.0" fs-extra: "npm:^11.1.1" npmlog: "npm:^7.0.1" p-map: "npm:^6.0.0" - checksum: 332634708dc014081afd2ba27baba6839d40983ce7d56e9b9c1edef8f1a750a04aa6ee12e428c71fa522b04f619bcbe5dc9d7a4dd95a0d1c365fe790d20b88cc + checksum: cb03607392b527761ddcdc1311c89f18ca15affebb85b8bf6610dfbd50aa03b2a4d36804b2cd33cf1e6d6abad9f7f13f65584f0a5dd0b60d07a8589e7867e1ee languageName: node linkType: hard -"@lerna-lite/version@npm:2.4.0": +"@lerna-lite/version@npm:2.4.0, @lerna-lite/version@npm:^2.3.0": version: 2.4.0 resolution: "@lerna-lite/version@npm:2.4.0" dependencies: @@ -3369,46 +2647,6 @@ __metadata: languageName: node linkType: hard -"@lerna-lite/version@npm:^2.3.0": - version: 2.3.0 - resolution: "@lerna-lite/version@npm:2.3.0" - dependencies: - "@lerna-lite/cli": "npm:2.3.0" - "@lerna-lite/core": "npm:2.3.0" - "@octokit/plugin-enterprise-rest": "npm:^6.0.1" - "@octokit/rest": "npm:^19.0.7" - chalk: "npm:^5.2.0" - conventional-changelog-angular: "npm:^5.0.13" - conventional-changelog-core: "npm:^4.2.4" - conventional-changelog-writer: "npm:^5.0.1" - conventional-commits-parser: "npm:^3.2.4" - conventional-recommended-bump: "npm:^6.1.0" - dedent: "npm:^0.7.0" - fs-extra: "npm:^11.1.1" - get-stream: "npm:^6.0.1" - git-url-parse: "npm:^13.1.0" - graceful-fs: "npm:^4.2.11" - is-stream: "npm:^3.0.0" - load-json-file: "npm:^7.0.1" - make-dir: "npm:^3.1.0" - minimatch: "npm:^9.0.0" - new-github-release-url: "npm:^2.0.0" - node-fetch: "npm:^3.3.1" - npm-package-arg: "npm:^10.1.0" - npmlog: "npm:^7.0.1" - p-map: "npm:^6.0.0" - p-pipe: "npm:^4.0.0" - p-reduce: "npm:^3.0.0" - pify: "npm:^6.1.0" - semver: "npm:^7.5.0" - slash: "npm:^5.0.1" - temp-dir: "npm:^3.0.0" - uuid: "npm:^9.0.0" - write-json-file: "npm:^5.0.0" - checksum: 3b59519c015f1d0a9ed00af00bd2ce6f7eecde2d2c039bd7a127de3d6c1d156ac26c805431cc44831be1889da0fcbe0ce86ea172748992606921fb03250e1567 - languageName: node - linkType: hard - "@mapbox/node-pre-gyp@npm:^1.0.0": version: 1.0.10 resolution: "@mapbox/node-pre-gyp@npm:1.0.10" @@ -3428,6 +2666,15 @@ __metadata: languageName: node linkType: hard +"@mrleebo/prisma-ast@npm:^0.5.2": + version: 0.5.2 + resolution: "@mrleebo/prisma-ast@npm:0.5.2" + dependencies: + chevrotain: "npm:^10.4.2" + checksum: 69a7f3c188aeb0d4d2a2afb7ea90dd88e0cfc28fb0322ff5c63cce385dd00bb059974cdc5912cac2b13caed4c9f7f43276cdb302cfbb5d6a8f865211eef068d8 + languageName: node + linkType: hard + "@newrelic/aws-sdk@npm:^5.0.2": version: 5.0.5 resolution: "@newrelic/aws-sdk@npm:5.0.5" @@ -3691,20 +2938,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/run-script@npm:^6.0.0, @npmcli/run-script@npm:^6.0.1": - version: 6.0.1 - resolution: "@npmcli/run-script@npm:6.0.1" - dependencies: - "@npmcli/node-gyp": "npm:^3.0.0" - "@npmcli/promise-spawn": "npm:^6.0.0" - node-gyp: "npm:^9.0.0" - read-package-json-fast: "npm:^3.0.0" - which: "npm:^3.0.0" - checksum: 97a944045a7ed051eeb59c32f92f87e0225bbd825164271ceaaa237e95934fffb7423d40360986e71169228383cf989d3049b4634b08a8349c9ca9dfd768ff9a - languageName: node - linkType: hard - -"@npmcli/run-script@npm:^6.0.2": +"@npmcli/run-script@npm:^6.0.0, @npmcli/run-script@npm:^6.0.2": version: 6.0.2 resolution: "@npmcli/run-script@npm:6.0.2" dependencies: @@ -3726,21 +2960,6 @@ __metadata: languageName: node linkType: hard -"@octokit/core@npm:^4.1.0": - version: 4.2.0 - resolution: "@octokit/core@npm:4.2.0" - dependencies: - "@octokit/auth-token": "npm:^3.0.0" - "@octokit/graphql": "npm:^5.0.0" - "@octokit/request": "npm:^6.0.0" - "@octokit/request-error": "npm:^3.0.0" - "@octokit/types": "npm:^9.0.0" - before-after-hook: "npm:^2.2.0" - universal-user-agent: "npm:^6.0.0" - checksum: 19e6914cf84fd4f4b835162bd9104401f7c7bd5b563f286493fba73d48ab097bb89ed4d0b742989612a21c8c779158ae1965f90855153c6b0d119bb82e87db74 - languageName: node - linkType: hard - "@octokit/core@npm:^4.2.1": version: 4.2.1 resolution: "@octokit/core@npm:4.2.1" @@ -3768,20 +2987,13 @@ __metadata: linkType: hard "@octokit/graphql@npm:^5.0.0": - version: 5.0.5 - resolution: "@octokit/graphql@npm:5.0.5" + version: 5.0.6 + resolution: "@octokit/graphql@npm:5.0.6" dependencies: "@octokit/request": "npm:^6.0.0" "@octokit/types": "npm:^9.0.0" universal-user-agent: "npm:^6.0.0" - checksum: c16cc2a2ed03877ac9fc260e3e2e19ef3538e3f970e576ead21e9ba9c0fd0651a7b2c3829f4c040c96507e53d52f563f850fb294a97b5ffb00da1423fe6954b8 - languageName: node - linkType: hard - -"@octokit/openapi-types@npm:^17.1.1": - version: 17.1.1 - resolution: "@octokit/openapi-types@npm:17.1.1" - checksum: 17c7992dc7cb04a1903b27057ffc234725c8b72e4fcfeedc7ca6125a1b549e361d62aff12861b4d24a0d064fb9c9efa8e534ed0acd66f378dcdb7b23f28e570d + checksum: 532c5aa6b81a4fe47dfd2f8ad61a90b30937e68a60cde0973feb0106be1b53ebf60192fe546064112821f3b87a9345f5faee308a6affe0aabf6fca02600c9ca5 languageName: node linkType: hard @@ -3799,17 +3011,6 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-paginate-rest@npm:^6.0.0": - version: 6.0.0 - resolution: "@octokit/plugin-paginate-rest@npm:6.0.0" - dependencies: - "@octokit/types": "npm:^9.0.0" - peerDependencies: - "@octokit/core": ">=4" - checksum: 6b28bb329c1c3569aad6bdb702127d35b20f4ddcff5144829a4701720ab48d355cfa3f842a04266e38e106f4f1279ac2a1343391a0353a50cbf198e9a4b7fe39 - languageName: node - linkType: hard - "@octokit/plugin-paginate-rest@npm:^6.1.2": version: 6.1.2 resolution: "@octokit/plugin-paginate-rest@npm:6.1.2" @@ -3831,18 +3032,6 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-rest-endpoint-methods@npm:^7.0.0": - version: 7.0.1 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:7.0.1" - dependencies: - "@octokit/types": "npm:^9.0.0" - deprecation: "npm:^2.3.1" - peerDependencies: - "@octokit/core": ">=3" - checksum: 0eddc079cbb1f75db014a06f880a2d81a92c862db1420d880fdcfbf5bdd5a97a45e33246c571bfe23ec54a6d95f0e17c0814d450689a93285b8c9d2cbae737da - languageName: node - linkType: hard - "@octokit/plugin-rest-endpoint-methods@npm:^7.1.2": version: 7.1.2 resolution: "@octokit/plugin-rest-endpoint-methods@npm:7.1.2" @@ -3867,8 +3056,8 @@ __metadata: linkType: hard "@octokit/request@npm:^6.0.0": - version: 6.2.3 - resolution: "@octokit/request@npm:6.2.3" + version: 6.2.5 + resolution: "@octokit/request@npm:6.2.5" dependencies: "@octokit/endpoint": "npm:^7.0.0" "@octokit/request-error": "npm:^3.0.0" @@ -3876,19 +3065,7 @@ __metadata: is-plain-object: "npm:^5.0.0" node-fetch: "npm:^2.6.7" universal-user-agent: "npm:^6.0.0" - checksum: d70a57f89746e7cf17f440aad68e4a1114d2af93117a069a4e97a63290a428582907e62d50ae737a2401b59d07d43c0115eeec382d86a0289e143133e6788eae - languageName: node - linkType: hard - -"@octokit/rest@npm:^19.0.7": - version: 19.0.7 - resolution: "@octokit/rest@npm:19.0.7" - dependencies: - "@octokit/core": "npm:^4.1.0" - "@octokit/plugin-paginate-rest": "npm:^6.0.0" - "@octokit/plugin-request-log": "npm:^1.0.4" - "@octokit/plugin-rest-endpoint-methods": "npm:^7.0.0" - checksum: 32f2d756e1aab8e44a64d9db38ef5e647681b9a1df9bf75c5cb36c04d11ba65f639fd683c4feb6eb7b53477a2baddb7ade301a67cb1e1496edf125a68db16efc + checksum: 0d1ba3c7e30debd47709a7cb491d79f95b03f066009dd1b05a6abb3d56c2886c1963d6d5dd39a2b8e48c1a0e7cf86fc2a9102c0d82ea57f7c4e8e92b02e6a1d8 languageName: node linkType: hard @@ -3911,16 +3088,7 @@ __metadata: languageName: node linkType: hard -"@octokit/types@npm:^9.0.0": - version: 9.2.1 - resolution: "@octokit/types@npm:9.2.1" - dependencies: - "@octokit/openapi-types": "npm:^17.1.1" - checksum: dc13c05e7831a170865df70c846136fbec528094ac9ecb611eb046544f1e5848bf35fcb3da2700eccf8181d689025b48b1d54bb8e7c655a5e6f9a1c109ff68fc - languageName: node - linkType: hard - -"@octokit/types@npm:^9.2.3": +"@octokit/types@npm:^9.0.0, @octokit/types@npm:^9.2.3": version: 9.2.3 resolution: "@octokit/types@npm:9.2.3" dependencies: @@ -4196,27 +3364,46 @@ __metadata: linkType: hard "@sindresorhus/is@npm:^5.2.0": - version: 5.3.0 - resolution: "@sindresorhus/is@npm:5.3.0" - checksum: f43c7625f31104a4b4c28d12cc8567d25b1f0c6005e7767ffe903eab19df6f047476781cf09337138b07d27ee8858ec23ce07f4524648dcfa117b0f9815d570a + version: 5.4.0 + resolution: "@sindresorhus/is@npm:5.4.0" + checksum: 972a33ba222e806647c49be30636fad4db6f5bf2c50cf7916d5cb2b46c14ab8073199c4776e68b974a6c26d53c4fe18e4e6431990f830871b17f96d670629a2f languageName: node linkType: hard -"@sinonjs/commons@npm:^2.0.0": - version: 2.0.0 - resolution: "@sinonjs/commons@npm:2.0.0" +"@sinonjs/commons@npm:^3.0.0": + version: 3.0.0 + resolution: "@sinonjs/commons@npm:3.0.0" dependencies: type-detect: "npm:4.0.8" - checksum: c0781f895a6630750580e1ed13f5fc94c52187a774322c8510be88691506d6627c5fb03992f2484b3abf49a8a0e633d227eaf640a682ec00136b7aa850c2f286 + checksum: 7cf247acf44a461c4972a022c1e7abd71e246a9e24e63985c841a5c6cdc7ecd3c3882e514b1e5eaf5e421379dfcc7fcec4f90a4c6bd9459f8f70d344ceba735b languageName: node linkType: hard "@sinonjs/fake-timers@npm:^10.0.2": - version: 10.0.2 - resolution: "@sinonjs/fake-timers@npm:10.0.2" + version: 10.2.0 + resolution: "@sinonjs/fake-timers@npm:10.2.0" dependencies: - "@sinonjs/commons": "npm:^2.0.0" - checksum: 71871b869836da889454e4aeceecc996d608e13accb0dd33d3234cd33a5394d72ed0334669df523df97a482d6b2a7119a5d853908812190ee718bdbc903198be + "@sinonjs/commons": "npm:^3.0.0" + checksum: 07348f4aaeb3c960867e598c1e9275fd411f555eb1dcff663adb6fb7c4fcd2cb9c6960f689f495ede40f3c2e7728acb6d580ddaa0cb416278303a1b051b378f9 + languageName: node + linkType: hard + +"@smithy/protocol-http@npm:^1.0.1": + version: 1.0.1 + resolution: "@smithy/protocol-http@npm:1.0.1" + dependencies: + "@smithy/types": "npm:^1.0.0" + tslib: "npm:^2.5.0" + checksum: 489ef06e886fa8199d09b49a612fe72a39b649ce743d934dda619b194596741d36fbd7deb6f6cb4679eb6a1bd08fdff13be2a4a118b5e36c8257cc04c6b45c11 + languageName: node + linkType: hard + +"@smithy/types@npm:^1.0.0": + version: 1.0.0 + resolution: "@smithy/types@npm:1.0.0" + dependencies: + tslib: "npm:^2.5.0" + checksum: d034933aaba0326570786113ea30d46fa1dcf010123bfac343754a3f7b700335022ec252ddb9754b169f9467dc51c5cdb1af2bd969674cd13c885db8933ff25a languageName: node linkType: hard @@ -4255,13 +3442,20 @@ __metadata: jest: "npm:^29.5.0" mixpanel: "npm:^0.17.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" prettier: "npm:^2.8.8" reflect-metadata: "npm:^0.1.13" ts-jest: "npm:^29.1.0" typeorm: "npm:^0.3.15" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4298,7 +3492,7 @@ __metadata: ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" jsonwebtoken: "npm:^9.0.0" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" nodemon: "npm:^2.0.19" npm-check-updates: "npm:^16.0.1" prettier: "npm:^2.8.8" @@ -4307,22 +3501,29 @@ __metadata: ts-jest: "npm:^29.1.0" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft "@standardnotes/api@npm:^1.25.3": - version: 1.26.5 - resolution: "@standardnotes/api@npm:1.26.5" + version: 1.26.10 + resolution: "@standardnotes/api@npm:1.26.10" dependencies: "@standardnotes/common": "npm:^1.46.6" "@standardnotes/domain-core": "npm:^1.12.0" - "@standardnotes/encryption": "npm:1.21.33" - "@standardnotes/models": "npm:1.45.0" - "@standardnotes/responses": "npm:1.13.21" + "@standardnotes/encryption": "npm:1.21.38" + "@standardnotes/models": "npm:1.45.5" + "@standardnotes/responses": "npm:1.13.24" "@standardnotes/security": "npm:^1.7.6" "@standardnotes/utils": "npm:1.16.5" reflect-metadata: "npm:^0.1.13" - checksum: d2e8d7345645acde23a49871b46830f2082ac9ffed7980d065015cbca8fadee72751eccb6f33ed62f57811e38b7e542e38a9d29d4c062741ca21a96da0abbb45 + checksum: 3c3561aec8edfb20549ad497c4cb1c287363385ec40a6aa90f8ad6a23a3f2bd53803f310c5bd31ec7a771c507aab5f9da99cd8446fd001be40c9764276e17787 languageName: node linkType: hard @@ -4376,7 +3577,7 @@ __metadata: ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" nodemon: "npm:^2.0.19" npm-check-updates: "npm:^16.0.1" otplib: "npm:12.0.1" @@ -4390,6 +3591,13 @@ __metadata: ua-parser-js: "npm:^1.0.32" uuid: "npm:^9.0.0" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4446,13 +3654,18 @@ __metadata: eslint-plugin-prettier: "npm:^4.2.1" ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" prettier: "npm:^2.8.8" reflect-metadata: "npm:^0.1.13" sqs-consumer: "npm:^6.2.1" ts-jest: "npm:^29.1.0" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4474,17 +3687,17 @@ __metadata: languageName: unknown linkType: soft -"@standardnotes/encryption@npm:1.21.33": - version: 1.21.33 - resolution: "@standardnotes/encryption@npm:1.21.33" +"@standardnotes/encryption@npm:1.21.38": + version: 1.21.38 + resolution: "@standardnotes/encryption@npm:1.21.38" dependencies: "@standardnotes/common": "npm:^1.46.6" - "@standardnotes/models": "npm:1.45.0" - "@standardnotes/responses": "npm:1.13.21" + "@standardnotes/models": "npm:1.45.5" + "@standardnotes/responses": "npm:1.13.24" "@standardnotes/sncrypto-common": "npm:1.13.3" "@standardnotes/utils": "npm:1.16.5" reflect-metadata: "npm:^0.1.13" - checksum: 087a72a88eba6b17f46bc41eafb05ab85c81e7d44107842c837fb170af3172fa54c802f99b1fd0fc36743b0f7b03e01147438f8aad94f72f83ba33d712b69046 + checksum: 13938405235e7e8cf22fec7cb850cd5515dccd083843d54784e4d058632d0c3b47a73f4def75a50b25af7b84b9593d4d5320479f3d9ba08f47d61fdf13706658 languageName: node linkType: hard @@ -4509,25 +3722,30 @@ __metadata: ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" prettier: "npm:^2.8.8" reflect-metadata: "npm:0.1.13" ts-jest: "npm:^29.1.0" typeorm: "npm:^0.3.15" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft -"@standardnotes/features@npm:1.59.3, @standardnotes/features@npm:^1.58.12": - version: 1.59.3 - resolution: "@standardnotes/features@npm:1.59.3" +"@standardnotes/features@npm:1.59.5, @standardnotes/features@npm:^1.58.12": + version: 1.59.5 + resolution: "@standardnotes/features@npm:1.59.5" dependencies: "@standardnotes/common": "npm:^1.46.6" "@standardnotes/domain-core": "npm:^1.12.0" "@standardnotes/security": "npm:^1.7.6" reflect-metadata: "npm:^0.1.13" - checksum: b6d1fba15b612936123351ea509a3727f596f4b57d7ce715251079bf1b1287922aaf7378ba0325435c65d3b82e6acbeed174fc19d9fe0fa16c3da9f00dfe7ea6 + checksum: 173b1f5d527fa8d8a0d22a3bf6740f1c5cc1c77a0db12669c869ee360a1f049a898705586035b08a9b851dac887ec82894225b0af776aad94c8a2f481c577598 languageName: node linkType: hard @@ -4572,7 +3790,7 @@ __metadata: ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" jsonwebtoken: "npm:^9.0.0" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" nodemon: "npm:^2.0.19" npm-check-updates: "npm:^16.0.1" prettier: "npm:^2.8.8" @@ -4582,6 +3800,11 @@ __metadata: typescript: "npm:^5.0.4" uuid: "npm:^9.0.0" winston: "npm:^3.8.1" + dependenciesMeta: + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4618,16 +3841,16 @@ __metadata: languageName: unknown linkType: soft -"@standardnotes/models@npm:1.45.0": - version: 1.45.0 - resolution: "@standardnotes/models@npm:1.45.0" +"@standardnotes/models@npm:1.45.5": + version: 1.45.5 + resolution: "@standardnotes/models@npm:1.45.5" dependencies: "@standardnotes/common": "npm:^1.46.6" - "@standardnotes/features": "npm:1.59.3" - "@standardnotes/responses": "npm:1.13.21" + "@standardnotes/features": "npm:1.59.5" + "@standardnotes/responses": "npm:1.13.24" "@standardnotes/utils": "npm:^1.16.5" lodash: "npm:^4.17.21" - checksum: dd47c916e984a39a4c1518014482bac37de17707551967e16ebf8b94d43963893434e519a9451e0f423cd2edc9c52bfb1d9b445d99c724528890506b91a14b22 + checksum: 15f26c11b22604c35d7a89452d655b7745c2b0a21aacb66d3deda22ae47df252984c2b3a6b1c80998c3006b73df4b40dc750cd8dbd6341b76cbd1bb2f2fa3e77 languageName: node linkType: hard @@ -4647,15 +3870,15 @@ __metadata: languageName: unknown linkType: soft -"@standardnotes/responses@npm:1.13.21, @standardnotes/responses@npm:^1.13.9": - version: 1.13.21 - resolution: "@standardnotes/responses@npm:1.13.21" +"@standardnotes/responses@npm:1.13.24, @standardnotes/responses@npm:^1.13.9": + version: 1.13.24 + resolution: "@standardnotes/responses@npm:1.13.24" dependencies: "@standardnotes/common": "npm:^1.46.6" - "@standardnotes/features": "npm:1.59.3" + "@standardnotes/features": "npm:1.59.5" "@standardnotes/security": "npm:^1.7.6" reflect-metadata: "npm:^0.1.13" - checksum: 3b0a65b68c3ea77798076e3db55a4062ae4d7ed2d084200103c207bb5bee227b53ea1cb4e8bc6bb56166724dd179caddf9d3961a64a6d38da966327ca645998c + checksum: 3bcfee90f0ec305ae714eefd758716a291f5fde86b87853233cbda659803cebd5f92a5ef21fc34f7ee13201a468e3abd2d87f67d972d4ae012444ee8f5d25065 languageName: node linkType: hard @@ -4691,7 +3914,7 @@ __metadata: inversify-express-utils: "npm:^6.4.3" jest: "npm:^29.5.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" npm-check-updates: "npm:^16.0.1" prettier: "npm:^2.8.8" reflect-metadata: "npm:0.1.13" @@ -4700,6 +3923,13 @@ __metadata: typeorm: "npm:^0.3.15" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4729,7 +3959,7 @@ __metadata: ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" npm-check-updates: "npm:^16.0.1" prettier: "npm:^2.8.8" reflect-metadata: "npm:^0.1.13" @@ -4737,6 +3967,13 @@ __metadata: typeorm: "npm:^0.3.15" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4776,13 +4013,15 @@ __metadata: eslint: "npm:^8.39.0" eslint-config-prettier: "npm:^8.8.0" ini: "npm:^3.0.0" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" npm-check-updates: "npm:^16.0.1" ts-node: "npm:^10.9.1" typescript: "npm:^5.0.4" dependenciesMeta: - newrelic@10.1.0: - unplugged: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4873,7 +4112,7 @@ __metadata: jest: "npm:^29.5.0" jsonwebtoken: "npm:^9.0.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" nodemon: "npm:^2.0.19" npm-check-updates: "npm:^16.0.1" prettier: "npm:^2.8.8" @@ -4886,6 +4125,13 @@ __metadata: ua-parser-js: "npm:^1.0.32" uuid: "npm:^9.0.0" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -4953,13 +4199,20 @@ __metadata: ioredis: "npm:^5.2.4" jest: "npm:^29.5.0" mysql2: "npm:^3.0.1" - newrelic: "npm:^10.1.0" + newrelic: "npm:^10.1.2" prettier: "npm:^2.8.8" reflect-metadata: "npm:0.1.13" ts-jest: "npm:^29.1.0" typeorm: "npm:^0.3.15" typescript: "npm:^5.0.4" winston: "npm:^3.8.1" + dependenciesMeta: + "@newrelic/winston-enricher": + optional: true + "@types/newrelic": + optional: true + newrelic: + optional: true languageName: unknown linkType: soft @@ -5008,9 +4261,9 @@ __metadata: linkType: hard "@tsconfig/node16@npm:^1.0.2": - version: 1.0.3 - resolution: "@tsconfig/node16@npm:1.0.3" - checksum: 4280081089783dfeab00e5bc18ff55e11e8e4577d4626f34730a062c99ec4136fe6c2036e6f20ebe50b1c3e01bc29db6e2cfa9541a7b6dc99825ccbe8f7f8395 + version: 1.0.4 + resolution: "@tsconfig/node16@npm:1.0.4" + checksum: d75e4f7d3edd74305383430d1fc9fd9bdf9af7fb2387853e6c06660a5325da6bce90846b853f5c69ec70b4e34de9ab05d508c9dc11c95a28ebbb000fc52b963b languageName: node linkType: hard @@ -5032,15 +4285,15 @@ __metadata: linkType: hard "@types/babel__core@npm:^7.1.14": - version: 7.20.0 - resolution: "@types/babel__core@npm:7.20.0" + version: 7.20.1 + resolution: "@types/babel__core@npm:7.20.1" dependencies: "@babel/parser": "npm:^7.20.7" "@babel/types": "npm:^7.20.7" "@types/babel__generator": "npm:*" "@types/babel__template": "npm:*" "@types/babel__traverse": "npm:*" - checksum: bf92f75954f36771eec94945ec0b38add06f3fb4605b67b7652d641604d60e9c6fd074810746f654bb3414efcc7fad648da4092ae7975d1b44dd2de59f86a577 + checksum: 49e743a5bf5d32f97b6c18a4293fb53ae4879a21893921940f739f91803fdf26d8648530f3013a433d118d18b10b6e4f9a739c120abcf58890f8d02a00e8da24 languageName: node linkType: hard @@ -5064,11 +4317,11 @@ __metadata: linkType: hard "@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.6": - version: 7.18.5 - resolution: "@types/babel__traverse@npm:7.18.5" + version: 7.20.0 + resolution: "@types/babel__traverse@npm:7.20.0" dependencies: - "@babel/types": "npm:^7.3.0" - checksum: 470a501a0db996256c5533a876723c9197dc5c68c2ec57a884c5653c1d6f2245115a67d8385312e0320898743c17eb5f453b1d7187c29d91f243676fe498243d + "@babel/types": "npm:^7.20.7" + checksum: dec5fb642f88e5cee238aab6be3a45fa913722f0ba011318c2502baa4640609a1b201dcc94c777806b919f004237c42940db7270a838dec59b5022e7abcff0c6 languageName: node linkType: hard @@ -5128,11 +4381,11 @@ __metadata: linkType: hard "@types/debug@npm:^4.1.7": - version: 4.1.7 - resolution: "@types/debug@npm:4.1.7" + version: 4.1.8 + resolution: "@types/debug@npm:4.1.8" dependencies: "@types/ms": "npm:*" - checksum: ba0607de3a9b1bdffcfdb70198163c40089c4ef4be1d5ee2cac2c1593e4f74f9677b115922a251f55bf4a380ca4693b56a3f76ade349d6840e82ec9b18032708 + checksum: 9c190e812984e0f6e02dfdfb0c7a3081a55cf3fc712a4e059336bd9f8329db70211eb851ce409311520876549cff2c4785ce48dd4c9fef8e48549c87bec29ded languageName: node linkType: hard @@ -5156,12 +4409,12 @@ __metadata: linkType: hard "@types/eslint@npm:*": - version: 8.37.0 - resolution: "@types/eslint@npm:8.37.0" + version: 8.40.0 + resolution: "@types/eslint@npm:8.40.0" dependencies: "@types/estree": "npm:*" "@types/json-schema": "npm:*" - checksum: 5a1b547b4fbebeb173fd3e4a717de868021a14322cb7bd1bc2b432f3ac3cfec2e268623d24543a4ca7787fe64c59dd310a6ee329199e9f16b0d168d26a2da026 + checksum: 64e7807d116fb55c95152443c32ebfcb66dcb8b71daf3be46b15ef1c07d0d6a3a63391ef8cd93a4ccc7e681995b713969db88bfd8082715874d835fce111f467 languageName: node linkType: hard @@ -5173,14 +4426,14 @@ __metadata: linkType: hard "@types/express-serve-static-core@npm:^4.17.33": - version: 4.17.34 - resolution: "@types/express-serve-static-core@npm:4.17.34" + version: 4.17.35 + resolution: "@types/express-serve-static-core@npm:4.17.35" dependencies: "@types/node": "npm:*" "@types/qs": "npm:*" "@types/range-parser": "npm:*" "@types/send": "npm:*" - checksum: db0f42fb7b36a394fefa8851d563dd59d9088b7eaa5105c552fd1f32c98f14466f3f6da133863e743c7c8f3bc9597941442bf52a6600dfe322ddd125d8e86716 + checksum: 20d48d5792a35342571dd709bbb1c5bf2d2ae1b833c01b89a89a8ebd92092986ae966f054a285962eb71f97449bfb7642cb15c987bb9713a393a44b1165de1df languageName: node linkType: hard @@ -5247,19 +4500,19 @@ __metadata: linkType: hard "@types/jest@npm:^29.5.1": - version: 29.5.1 - resolution: "@types/jest@npm:29.5.1" + version: 29.5.2 + resolution: "@types/jest@npm:29.5.2" dependencies: expect: "npm:^29.0.0" pretty-format: "npm:^29.0.0" - checksum: 1a67d4fe2de71feaaa46db749d748d4b13972bbe1fb536a3e8c6e81933a1c143c196b4c8be2656f1fba87f6d567d78a0581c3993a5fb0baeec8772d05fdf54f3 + checksum: 999a7c560e956f32a60842495e079964c1d2c816fbc98520c6f83b5947e6c93d6598f92687676619b309f759cc7ad276a8548ee1dd579267d76b18c89ec87439 languageName: node linkType: hard "@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": - version: 7.0.11 - resolution: "@types/json-schema@npm:7.0.11" - checksum: 8e5c6dd393411418e3d803ab0a09862b4ed47f73e7ed990f3b907dd41cc4d2f2b4f7aed9a39c7fd2acaa80314ac1397a5e2e5e6c25a338f01bbfba708cc70d8e + version: 7.0.12 + resolution: "@types/json-schema@npm:7.0.12" + checksum: 3a4aae29f990800c28c9af99e3c67e35ea0441aee2c8707b4eb0c509ca4a9ea58edeb43885a3871c5ee57c64fa429e18e78a2449977cd601ca0b4721f58fc946 languageName: node linkType: hard @@ -5329,39 +4582,32 @@ __metadata: linkType: hard "@types/newrelic@npm:^9.13.0": - version: 9.13.0 - resolution: "@types/newrelic@npm:9.13.0" - checksum: d0269b05c43b48756b0ff10e09d312cb22871b74dbc64ac85e0dfbd1a5cd81f15235ea47c02ba319e7d9e219db0629ef0474c0696961406faff43844c748920f + version: 9.14.0 + resolution: "@types/newrelic@npm:9.14.0" + checksum: 2ec951bd8f16c1233438fe6f620f5e0f953cd2fd5ffb31b3fe8f2cb1ff9ccc493c0f3b4b19b85b79fd64831efc96b8302b0b05b88f1754bb74b6ea36711dc6e4 languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0": - version: 20.1.0 - resolution: "@types/node@npm:20.1.0" - checksum: 299fe2b03230b10367862b2b7f4b618671377e20846276f5f435262080d7b01231d45a2b3a08c5de31495fac2eda8048e977aebf06b3c1e26502f74fc021da63 - languageName: node - linkType: hard - -"@types/node@npm:^18.11.9": - version: 18.16.4 - resolution: "@types/node@npm:18.16.4" - checksum: a7a5662d6589016ff13c41bdab7dd1eab57284e51788c9f75a6f472f5e12085d221bfb11fd9abd18323619a102a26c9e27194105caff72bbbed842631adecb1e - languageName: node - linkType: hard - -"@types/node@npm:^20.2.0, @types/node@npm:^20.2.5": +"@types/node@npm:*, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0, @types/node@npm:^20.2.0, @types/node@npm:^20.2.5": version: 20.2.5 resolution: "@types/node@npm:20.2.5" checksum: 55e4f8d08e3c225e48e012e04458d6c1db5af6e4991e3abb003b82d3f10018a14742c0512b27991cb02e54768be560ea1fe4c17208e04273247132c9eb07499a languageName: node linkType: hard +"@types/node@npm:^18.11.9": + version: 18.16.16 + resolution: "@types/node@npm:18.16.16" + checksum: 946bd4d8e6fa54220e4193bc594de8a2e138e6afebb6efb7d862d98e30ced25a19476a6f47c81e690b9ac77f616f64217e0bcf4811916ccd9b5935e5bea0e4a0 + languageName: node + linkType: hard + "@types/nodemailer@npm:^6.4.1": - version: 6.4.7 - resolution: "@types/nodemailer@npm:6.4.7" + version: 6.4.8 + resolution: "@types/nodemailer@npm:6.4.8" dependencies: "@types/node": "npm:*" - checksum: 4fefece34940e4344ecb7d41553ccfd63bf2697124e6335dec5c358953ee53b2b27cb45dec9b306c3fc848cf4ec4344d62ecb091d1a7aadc36c0b9721ab67322 + checksum: 8febb43b8abf43fcaa7aa2706364699f7b5ef36462661eac782817820441607bda688dcb4452e68464ad4e79e8103caa62c31daf0c7f3e5eace12ab65af4ff4d languageName: node linkType: hard @@ -5382,9 +4628,9 @@ __metadata: linkType: hard "@types/prettier@npm:^2.1.5": - version: 2.7.2 - resolution: "@types/prettier@npm:2.7.2" - checksum: d4d09d291ec7017ed30cc2bac5a51dbd5de02e2d75389a4c724ac6c3d7bb99da3173f57247d832b8f83c154dc8006cbdc35e565c1f1bf6869718d25857e430db + version: 2.7.3 + resolution: "@types/prettier@npm:2.7.3" + checksum: 940c06437f23a12b88ae7d36c40a35dd3ee8cc22f8bc1cba972bcc69904162331ef2fdfafc9cc46762475047194321c0c40ee9285e779353116018c1eeae2b4c languageName: node linkType: hard @@ -5410,9 +4656,9 @@ __metadata: linkType: hard "@types/semver@npm:^7.3.12": - version: 7.3.13 - resolution: "@types/semver@npm:7.3.13" - checksum: a76156ff60ddbd17bf2120c09dca3cd8ac7db4f8d8c69614a9ebc5202f05d1044def7fd8cf77415f7284ea8edfa1092b6e04dac07dc17c94762904c69dd2c85b + version: 7.5.0 + resolution: "@types/semver@npm:7.5.0" + checksum: dac255fae68157aec375fdb79d483a161c1b9c58e0ab9e18936dd1e9b89dd0ff85d64e482b1505de7e17455b404a0a530c4f9ddd6f21d333c2311c0068687b14 languageName: node linkType: hard @@ -5481,13 +4727,13 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/eslint-plugin@npm:5.59.2" + version: 5.59.8 + resolution: "@typescript-eslint/eslint-plugin@npm:5.59.8" dependencies: "@eslint-community/regexpp": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:5.59.2" - "@typescript-eslint/type-utils": "npm:5.59.2" - "@typescript-eslint/utils": "npm:5.59.2" + "@typescript-eslint/scope-manager": "npm:5.59.8" + "@typescript-eslint/type-utils": "npm:5.59.8" + "@typescript-eslint/utils": "npm:5.59.8" debug: "npm:^4.3.4" grapheme-splitter: "npm:^1.0.4" ignore: "npm:^5.2.0" @@ -5500,43 +4746,43 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 777969bdcc25925df91f8bf0c8b16400defad020dbdb2ea77091f1ecceeb57704d5c045d195c67a3c877231419c34e8f0c03f45d22abf0cb607596b455118dff + checksum: 47fb0317999aa10f57a716134411e7b068225154e9aaa1c92c8ecf4b421f49a00255f4802a5edeeaad57ecfcbab2cca06cbd8e4fc676de8866c0959209e0e7fb languageName: node linkType: hard "@typescript-eslint/parser@npm:^5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/parser@npm:5.59.2" + version: 5.59.8 + resolution: "@typescript-eslint/parser@npm:5.59.8" dependencies: - "@typescript-eslint/scope-manager": "npm:5.59.2" - "@typescript-eslint/types": "npm:5.59.2" - "@typescript-eslint/typescript-estree": "npm:5.59.2" + "@typescript-eslint/scope-manager": "npm:5.59.8" + "@typescript-eslint/types": "npm:5.59.8" + "@typescript-eslint/typescript-estree": "npm:5.59.8" debug: "npm:^4.3.4" peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 86d9a46672f9eedf17c0073f0f02ab941100b7cdd7158757095e5793e8e4d7c56c3f4887aa3afd9c3218706108d9647ec7729401ff7c13abfd420738b2bc72d5 + checksum: e912585cf397c92e582bdb263f169ae8279635d61b48ad853b50dcd4d71446b7651287ca66eb0cf80fa0126aeb717ce0a7bd3ab3026954caf6ff96092b4e347a languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/scope-manager@npm:5.59.2" +"@typescript-eslint/scope-manager@npm:5.59.8": + version: 5.59.8 + resolution: "@typescript-eslint/scope-manager@npm:5.59.8" dependencies: - "@typescript-eslint/types": "npm:5.59.2" - "@typescript-eslint/visitor-keys": "npm:5.59.2" - checksum: 4cd52a2f008d7ee68ec8424c0cfe1c6f668aa2d981a506abb7514a165e47f48dcda711b83d297ea23074005abca5eb30ff9c594938c1ff9c73700019e0d44548 + "@typescript-eslint/types": "npm:5.59.8" + "@typescript-eslint/visitor-keys": "npm:5.59.8" + checksum: e561598f5c26e27e2491e812e8a1d3cdef17a741e17910548334f59b6c5bd0f482d63027d61e72c50a1c871adda7a350af91164f1eb417c8ee195bce562bdc3c languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/type-utils@npm:5.59.2" +"@typescript-eslint/type-utils@npm:5.59.8": + version: 5.59.8 + resolution: "@typescript-eslint/type-utils@npm:5.59.8" dependencies: - "@typescript-eslint/typescript-estree": "npm:5.59.2" - "@typescript-eslint/utils": "npm:5.59.2" + "@typescript-eslint/typescript-estree": "npm:5.59.8" + "@typescript-eslint/utils": "npm:5.59.8" debug: "npm:^4.3.4" tsutils: "npm:^3.21.0" peerDependencies: @@ -5544,23 +4790,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: bc3aa3e29bf39a9adb6df6756e76e57e435d730f1597181dce432fb91ee0e9961b9c163d7d8975057fbcd982f4a9d70a36452ab1e260f58052e43b11749cfd35 + checksum: a2add3cf3f484bb1e14481e5b2fe45ee2ed23ddeb7861a53460fa18bbfd224e05bc0f7e8dc159c19518a302f4d0c55d9b1a85561ce6e01c121b07383d70d575a languageName: node linkType: hard -"@typescript-eslint/types@npm:5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/types@npm:5.59.2" - checksum: 4d565653b8d6cb6f5b72134bcd1efb3af18ca5792257613bd263f47b5be8faf94e3a90072758699900ef3e43a5ab68180f081b27a54b76a6d7006759ec63dc8f +"@typescript-eslint/types@npm:5.59.8": + version: 5.59.8 + resolution: "@typescript-eslint/types@npm:5.59.8" + checksum: d92f6417198c5002eccf4ddb787ce901974c4b78b3fb91d08c2866395f9cdc434e1e99ebf5122d79c944cba48388404f678a727d750e0f259c4a774df0c6368f languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/typescript-estree@npm:5.59.2" +"@typescript-eslint/typescript-estree@npm:5.59.8": + version: 5.59.8 + resolution: "@typescript-eslint/typescript-estree@npm:5.59.8" dependencies: - "@typescript-eslint/types": "npm:5.59.2" - "@typescript-eslint/visitor-keys": "npm:5.59.2" + "@typescript-eslint/types": "npm:5.59.8" + "@typescript-eslint/visitor-keys": "npm:5.59.8" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" @@ -5569,35 +4815,35 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 01f7a9abb914fe5399d4212990fa20c5b0b4ae61319a98730d10c95dfd04d3722637576c58dd95906c66a0f0cca503a25c844e922142f1f3e9c8d10c99a77a19 + checksum: 94f08e72bacb46cfce163c8776c2c1a21f5cde6e2e56dc1fa7f7c95378b384e59398a5e44ceeaf882cae8626c95988d7f90645ed9cd60057cada51f3b1b3333e languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/utils@npm:5.59.2" +"@typescript-eslint/utils@npm:5.59.8": + version: 5.59.8 + resolution: "@typescript-eslint/utils@npm:5.59.8" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@types/json-schema": "npm:^7.0.9" "@types/semver": "npm:^7.3.12" - "@typescript-eslint/scope-manager": "npm:5.59.2" - "@typescript-eslint/types": "npm:5.59.2" - "@typescript-eslint/typescript-estree": "npm:5.59.2" + "@typescript-eslint/scope-manager": "npm:5.59.8" + "@typescript-eslint/types": "npm:5.59.8" + "@typescript-eslint/typescript-estree": "npm:5.59.8" eslint-scope: "npm:^5.1.1" semver: "npm:^7.3.7" peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 18d221a1ed44ca1149fb8effa1957992e569ab49c88a7c4bc874a2233cbb005b7eba5abcfa1c100a358455bdaabb46dfbf7ee4e485f023ce3a91e7b8fb475e3a + checksum: 814d79eeb57d1eeb836af4e100d179226f573d92400e4c49b893e00162c44ce97507052043654aef74ba98203c1fac34b2a10f45b2a797b4c2aabe29475f23a2 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.59.2": - version: 5.59.2 - resolution: "@typescript-eslint/visitor-keys@npm:5.59.2" +"@typescript-eslint/visitor-keys@npm:5.59.8": + version: 5.59.8 + resolution: "@typescript-eslint/visitor-keys@npm:5.59.8" dependencies: - "@typescript-eslint/types": "npm:5.59.2" + "@typescript-eslint/types": "npm:5.59.8" eslint-visitor-keys: "npm:^3.3.0" - checksum: de546e6677b091c0f3f0b27e48f7d84fbdc4ffd21891d1634a1598a22953071690475c4caea99e5529dabebd0d1fb5b161221819129130e84b5ef3efcdbcf6ec + checksum: 859bf38ac7aa69b5736dc7b469a10e659b4d7ef08ce15a3dc82b98110898cfb90606b760a01b41d833ae4f2f401f2c0d8f6f4092646cc696f9e2b70fec2a9d5a languageName: node linkType: hard @@ -5608,154 +4854,154 @@ __metadata: languageName: node linkType: hard -"@webassemblyjs/ast@npm:1.11.5, @webassemblyjs/ast@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/ast@npm:1.11.5" +"@webassemblyjs/ast@npm:1.11.6, @webassemblyjs/ast@npm:^1.11.5": + version: 1.11.6 + resolution: "@webassemblyjs/ast@npm:1.11.6" dependencies: - "@webassemblyjs/helper-numbers": "npm:1.11.5" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.5" - checksum: c8b88cb98c6217f557d774ae050454b84255759692d461dc6090dd136e654be22d30881ef45ea6797501bb24b39da1559ae52af43a148620dd69a1b0722bd40b + "@webassemblyjs/helper-numbers": "npm:1.11.6" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" + checksum: 8d376b04d2cfbd0092ffbedcb8187c923864d3f7b900e9806f37b2e53a74601972e5774f869ef31cb6e455ee8f9dfa004fedf5477e8ddfd9fcb47b8543948dd2 languageName: node linkType: hard -"@webassemblyjs/floating-point-hex-parser@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.5" - checksum: 0fd24f6feb389bac753ca5d916b0a7c91b1a2b9a2a249c4d0f365a1983e077bbab64f5e1c477a72f620578a48d15dd61a0370a0319c2bebe71a3756132a67c8c +"@webassemblyjs/floating-point-hex-parser@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" + checksum: 574a1b5dafc59c145887c3b5fe0525dff3f1fc3d24bd3ced4b0b39de1ceaaa6ef6dff30af88de8f0e36e88c2393134258905783bd523af52bdcb1a79128e80a5 languageName: node linkType: hard -"@webassemblyjs/helper-api-error@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-api-error@npm:1.11.5" - checksum: b8047772c5c186d447f85969796906cc9283a2c0c527e36fb55b9fd8d3cdf90ffb1e1bfdfb3a3d600298293ea1289fe6a9b2f18c477b0e90098b6fc6ed944f43 +"@webassemblyjs/helper-api-error@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" + checksum: b5302eee13ecedfd9a0d9f54e5499809c2cc51f7882ddbdd59a237d141827c935d6fa5f2663c42729984f491f3391d690514688b9f36c2abfbc77ec15598fcd6 languageName: node linkType: hard -"@webassemblyjs/helper-buffer@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-buffer@npm:1.11.5" - checksum: 010b11dbefa1aad6a985833100203eb67c33dc3714148ba90664f41292132574c1b6d56c03c9462faaa0c2e51e198cff0e088d53a5becc1d67ff59efcc1846b7 +"@webassemblyjs/helper-buffer@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-buffer@npm:1.11.6" + checksum: b9536a8f5f723780a440fc95cf12090c5ae428b457fa79457966a93d2ba79ac7a731321001e8beaa99797c4db464f4ca473a8e7704b9aad9640c0800785c2ea9 languageName: node linkType: hard -"@webassemblyjs/helper-numbers@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-numbers@npm:1.11.5" +"@webassemblyjs/helper-numbers@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" dependencies: - "@webassemblyjs/floating-point-hex-parser": "npm:1.11.5" - "@webassemblyjs/helper-api-error": "npm:1.11.5" + "@webassemblyjs/floating-point-hex-parser": "npm:1.11.6" + "@webassemblyjs/helper-api-error": "npm:1.11.6" "@xtuc/long": "npm:4.2.2" - checksum: bff0ef813d765ac4ffb86de34503a927dddca55de979b625de2434c82e793ca59ac6de1e17a94cf0073eb6c76b843d779295f67e20bb7848871618476d4cde16 + checksum: a1f6b9db542e7308e6bddf6310f29c3d2d8e0bcd21dacad23df0b1cf7686ea9e362db2c6da64fd793f8684528e5035885b5ff33e5a2c9639176c0096210b62a1 languageName: node linkType: hard -"@webassemblyjs/helper-wasm-bytecode@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.5" - checksum: 33a9f88a0b713074ae9b27508551a90273fcf34fbbc7c4eb6ee828624c2f8efe2d361041129946626bdff705e6117443a2412d3d124d72882999621301637b05 +"@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" + checksum: 2563ee4cdc581b81421101143131a4319138ca4cd1b1299852764f3fd8773a59c358917d51690dec9978dba02e013d79440c94906f622e261afc01b2a5bcedcb languageName: node linkType: hard -"@webassemblyjs/helper-wasm-section@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/helper-wasm-section@npm:1.11.5" +"@webassemblyjs/helper-wasm-section@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/helper-wasm-section@npm:1.11.6" dependencies: - "@webassemblyjs/ast": "npm:1.11.5" - "@webassemblyjs/helper-buffer": "npm:1.11.5" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.5" - "@webassemblyjs/wasm-gen": "npm:1.11.5" - checksum: d6204a24e73bd49bde8ed47bf74fad8e04363c6422a68b1bb9ea35ce5582e32ce75850b810467e66a978e87c1fedfaa499170ecc159697933a1797b472af5f3c + "@webassemblyjs/ast": "npm:1.11.6" + "@webassemblyjs/helper-buffer": "npm:1.11.6" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" + "@webassemblyjs/wasm-gen": "npm:1.11.6" + checksum: 0edb6fff2b5b87505d6fdb1a14e9ec8bfaa6e79994cbfd533ff133352ee0a7cccc05973f70cdf1160defefec56f074dfae31987bd32b2b6dab04151454f959ef languageName: node linkType: hard -"@webassemblyjs/ieee754@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/ieee754@npm:1.11.5" +"@webassemblyjs/ieee754@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/ieee754@npm:1.11.6" dependencies: "@xtuc/ieee754": "npm:^1.2.0" - checksum: 111a10e44608f8d441809cc40307ece1a5747d3e9fc4dc741b76aa0f864dcb69c7ccab9dc777b03caa98857632289079ef6a5f80f3ee11c988b92cb5dcd28b0e + checksum: 2f17b3d8bd7503be76bbf00f319b3bfce3e5e85217095eab752ef8fef1b486e1e7d1c3959e49706d247b6490d02e16a0c9548526531cd4baa3b252d1335ab18c languageName: node linkType: hard -"@webassemblyjs/leb128@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/leb128@npm:1.11.5" +"@webassemblyjs/leb128@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/leb128@npm:1.11.6" dependencies: "@xtuc/long": "npm:4.2.2" - checksum: 0e2cd55445dcb0c57d1ac78aa9447747244320bf292354b74d52880942d6812582a982124c6b08711257e9b2d217a0e109b8e29657ee2aecdaa21cefe43db6d3 + checksum: 10edfc6b7ec7ab1a3fb6b4abd6e459ed396cd2fd9296f7a84118bc9c8b16ed28837f2c15a5f9d24a8feaebda6a041c39cb0b28a9d777b7e27e04599eef3fca52 languageName: node linkType: hard -"@webassemblyjs/utf8@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/utf8@npm:1.11.5" - checksum: 8f1ab885c60a72fc3ca175ff60fd447ea3a9885e05ffd0439fff52f9153f71f199e51975771d42922acc8de68faaaf1cfaabe99a0ea7b8f280a671fd1fa7ae46 +"@webassemblyjs/utf8@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/utf8@npm:1.11.6" + checksum: 6fa95283a6f1388b49afefeaff7a090ae4d8f2c6c4b98736d6dbf241739062bc25ec2216579cb15c2864afaeff4f8debf4356dcbd2b531ecfff3b14deb5ba85e languageName: node linkType: hard "@webassemblyjs/wasm-edit@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-edit@npm:1.11.5" + version: 1.11.6 + resolution: "@webassemblyjs/wasm-edit@npm:1.11.6" dependencies: - "@webassemblyjs/ast": "npm:1.11.5" - "@webassemblyjs/helper-buffer": "npm:1.11.5" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.5" - "@webassemblyjs/helper-wasm-section": "npm:1.11.5" - "@webassemblyjs/wasm-gen": "npm:1.11.5" - "@webassemblyjs/wasm-opt": "npm:1.11.5" - "@webassemblyjs/wasm-parser": "npm:1.11.5" - "@webassemblyjs/wast-printer": "npm:1.11.5" - checksum: 34b9ec8beb18fb343b5649e14e6cd000dfaf43ba888e8d321f51eb9fc68dd156abc8d0b04b494c1cf3ed01026f1d9685d3d758a300d72e38eb6b98454e31b805 + "@webassemblyjs/ast": "npm:1.11.6" + "@webassemblyjs/helper-buffer": "npm:1.11.6" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" + "@webassemblyjs/helper-wasm-section": "npm:1.11.6" + "@webassemblyjs/wasm-gen": "npm:1.11.6" + "@webassemblyjs/wasm-opt": "npm:1.11.6" + "@webassemblyjs/wasm-parser": "npm:1.11.6" + "@webassemblyjs/wast-printer": "npm:1.11.6" + checksum: 66831a6ad2cacc8f466ee9f5a1b12a5f38417efc8ac91a890636ecd203555722cb6cf616cdd177ff4effff2502e5b1394613dd98b5c56d4f301ef40f264a106a languageName: node linkType: hard -"@webassemblyjs/wasm-gen@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-gen@npm:1.11.5" +"@webassemblyjs/wasm-gen@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-gen@npm:1.11.6" dependencies: - "@webassemblyjs/ast": "npm:1.11.5" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.5" - "@webassemblyjs/ieee754": "npm:1.11.5" - "@webassemblyjs/leb128": "npm:1.11.5" - "@webassemblyjs/utf8": "npm:1.11.5" - checksum: 889c804f484276cfea767d2c75ba208720a3f2a5e49328f9ecbecaac19634353469c715c371154573b0432f4056b96da6be0342c4df1e8e6670d773b4262dffe + "@webassemblyjs/ast": "npm:1.11.6" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" + "@webassemblyjs/ieee754": "npm:1.11.6" + "@webassemblyjs/leb128": "npm:1.11.6" + "@webassemblyjs/utf8": "npm:1.11.6" + checksum: a4746a13ce144d5503a84e64a1c03cde86b068c855d42a8097761684c1af6ccb3c839247d778e1f84a198ca851fc414dddb6658f8e77ba3cdc905fcce8facf4f languageName: node linkType: hard -"@webassemblyjs/wasm-opt@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-opt@npm:1.11.5" +"@webassemblyjs/wasm-opt@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-opt@npm:1.11.6" dependencies: - "@webassemblyjs/ast": "npm:1.11.5" - "@webassemblyjs/helper-buffer": "npm:1.11.5" - "@webassemblyjs/wasm-gen": "npm:1.11.5" - "@webassemblyjs/wasm-parser": "npm:1.11.5" - checksum: af4ab63fab4185f68b8f4e8ff453b4c83558a1911e6c55c341757e1864e2c8e0a08e9faa30528c00ffc804341c800649834d0ea237a805a1a915d51bf94def15 + "@webassemblyjs/ast": "npm:1.11.6" + "@webassemblyjs/helper-buffer": "npm:1.11.6" + "@webassemblyjs/wasm-gen": "npm:1.11.6" + "@webassemblyjs/wasm-parser": "npm:1.11.6" + checksum: aa9fc4f9cd271ded5f9a751a5fd80cc8c8f59299aee64407e63aca99099b0243824e5661c3679bf7cd2a5963f1f7e10e5c4b0c5f0f89831fe2dffa7b725b14cf languageName: node linkType: hard -"@webassemblyjs/wasm-parser@npm:1.11.5, @webassemblyjs/wasm-parser@npm:^1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wasm-parser@npm:1.11.5" +"@webassemblyjs/wasm-parser@npm:1.11.6, @webassemblyjs/wasm-parser@npm:^1.11.5": + version: 1.11.6 + resolution: "@webassemblyjs/wasm-parser@npm:1.11.6" dependencies: - "@webassemblyjs/ast": "npm:1.11.5" - "@webassemblyjs/helper-api-error": "npm:1.11.5" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.5" - "@webassemblyjs/ieee754": "npm:1.11.5" - "@webassemblyjs/leb128": "npm:1.11.5" - "@webassemblyjs/utf8": "npm:1.11.5" - checksum: a7f20c9a9ca9a81b88aa7c2b3c6937e12782ce71b049f057ea25bad21c397db9c2c61d5075099f10d978c6c48bb59ed4a2dd2fcfef4e893feadf71d0525087cd + "@webassemblyjs/ast": "npm:1.11.6" + "@webassemblyjs/helper-api-error": "npm:1.11.6" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" + "@webassemblyjs/ieee754": "npm:1.11.6" + "@webassemblyjs/leb128": "npm:1.11.6" + "@webassemblyjs/utf8": "npm:1.11.6" + checksum: 22984aafc0e40909ef0984f73d729a69160a7356eb2aba3352eb470cdcb4e1d11762419ada5e38ecfe12377cb67fd667ee56e6e1c56c3f22924824a88f437e1b languageName: node linkType: hard -"@webassemblyjs/wast-printer@npm:1.11.5": - version: 1.11.5 - resolution: "@webassemblyjs/wast-printer@npm:1.11.5" +"@webassemblyjs/wast-printer@npm:1.11.6": + version: 1.11.6 + resolution: "@webassemblyjs/wast-printer@npm:1.11.6" dependencies: - "@webassemblyjs/ast": "npm:1.11.5" + "@webassemblyjs/ast": "npm:1.11.6" "@xtuc/long": "npm:4.2.2" - checksum: ffca102c335d4584d58d3e0a78145dcb4fb2cc99ba43ffbe1a49e126779757a9d6d8293e5cde6cac7cc1024196e61d396fc42e2d0e11fa460bdde522f418372c + checksum: 5e797fe94d0c54a99d7220562cf8f9d945a32a14a16e7f5e4184c6e5b4cad8c3f639e8b5f6b2f13fb63f9631fc360bfa0d1c9d23c88c5d0b9781076bf61a581e languageName: node linkType: hard @@ -5818,12 +5064,12 @@ __metadata: languageName: node linkType: hard -"acorn-import-assertions@npm:^1.7.6": - version: 1.8.0 - resolution: "acorn-import-assertions@npm:1.8.0" +"acorn-import-assertions@npm:^1.9.0": + version: 1.9.0 + resolution: "acorn-import-assertions@npm:1.9.0" peerDependencies: acorn: ^8 - checksum: 7963bf636b8ee03e93507beea867317bcbb09c53050aaebc86b49022478dda7ea3110ea0ffab1957db016d83f57e92c307c54adef113812bb19445a4e4a1aa98 + checksum: acfc1289383f81d7dfd4dbb184c00cfedc388af1e7669f23c3cbccf6062547536d8d41a6dd5ecacc55f26922f5606e079fae19e37433f0d83e95a990c6e5703f languageName: node linkType: hard @@ -6317,18 +5563,18 @@ __metadata: linkType: hard "boxen@npm:^7.0.0": - version: 7.0.2 - resolution: "boxen@npm:7.0.2" + version: 7.1.0 + resolution: "boxen@npm:7.1.0" dependencies: ansi-align: "npm:^3.0.1" - camelcase: "npm:^7.0.0" - chalk: "npm:^5.0.1" + camelcase: "npm:^7.0.1" + chalk: "npm:^5.2.0" cli-boxes: "npm:^3.0.0" string-width: "npm:^5.1.2" type-fest: "npm:^2.13.0" widest-line: "npm:^4.0.1" - wrap-ansi: "npm:^8.0.1" - checksum: 842bde782979f0b86150b67db9255e56589d6580bbc1bc7fdaafd86b6ad068bf6534e6f3f3661ab99f252ca3df8d48f2ff6f18426703275f3d0bee74d951bf61 + wrap-ansi: "npm:^8.1.0" + checksum: 9f7632f55f76da26480a5d046ef9322666d0989043423b25c3b9a800fe9887031e5ef94f9c47faff5acd8d99e3c0d1fd89c39d9ce1f72c747444af41c7291df5 languageName: node linkType: hard @@ -6361,16 +5607,16 @@ __metadata: linkType: hard "browserslist@npm:^4.14.5, browserslist@npm:^4.21.3": - version: 4.21.5 - resolution: "browserslist@npm:4.21.5" + version: 4.21.7 + resolution: "browserslist@npm:4.21.7" dependencies: - caniuse-lite: "npm:^1.0.30001449" - electron-to-chromium: "npm:^1.4.284" - node-releases: "npm:^2.0.8" - update-browserslist-db: "npm:^1.0.10" + caniuse-lite: "npm:^1.0.30001489" + electron-to-chromium: "npm:^1.4.411" + node-releases: "npm:^2.0.12" + update-browserslist-db: "npm:^1.0.11" bin: browserslist: cli.js - checksum: 66c055357fda71fcde8a9dc1f5af7e5bd320670ad5199196275703e305b77f92969c07a70a383e8130cd0f8c98a8b6d2a211b57ee6b5b4c2ac37779d9800a6c4 + checksum: 53860c8ab8a65c44e13475d6937070cc72053d335bd848e2ef856d6285906ecbb5a0e855fc05cec47cd37bea89b3bc2dc1f39d70a5ee1ef259fdba2b17a4c404 languageName: node linkType: hard @@ -6510,27 +5756,7 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^17.0.0": - version: 17.1.0 - resolution: "cacache@npm:17.1.0" - dependencies: - "@npmcli/fs": "npm:^3.1.0" - fs-minipass: "npm:^3.0.0" - glob: "npm:^10.2.2" - lru-cache: "npm:^7.7.1" - minipass: "npm:^5.0.0" - minipass-collect: "npm:^1.0.2" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - p-map: "npm:^4.0.0" - ssri: "npm:^10.0.0" - tar: "npm:^6.1.11" - unique-filename: "npm:^3.0.0" - checksum: 8b86bdcd406535efc3b30e6d4d4d5e8972cb2416409473e9a61cc9baf0e7e424144ca47cd4d21cc75ebf7dc597d5cec2e09e6b67377f6ae2e6b85cc349c757ec - languageName: node - linkType: hard - -"cacache@npm:^17.0.4": +"cacache@npm:^17.0.0, cacache@npm:^17.0.4": version: 17.1.3 resolution: "cacache@npm:17.1.3" dependencies: @@ -6614,17 +5840,17 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^7.0.0": +"camelcase@npm:^7.0.1": version: 7.0.1 resolution: "camelcase@npm:7.0.1" checksum: 8cc1909d4219769e835180fde379b5caeff681336506f9c4474b76a7ba0fe8eda4a183b3d05c09c39a118d8a44c384cf8a93e4326c655a82d03ded87a4eea829 languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001449": - version: 1.0.30001482 - resolution: "caniuse-lite@npm:1.0.30001482" - checksum: 73e24665e8416248283087eebdf82684ab3974069cfaee4c70ee2ec831562b7a5e4127e7718ac133c370a018d4de78ef7fc77b4baa5e675211d4838437d1b82f +"caniuse-lite@npm:^1.0.30001489": + version: 1.0.30001492 + resolution: "caniuse-lite@npm:1.0.30001492" + checksum: 216895408da8365110687590124e8aea0b11db96d7c115f347dd873db8bec84423d4ca3e6f45345c791983c7bd207d638e1549a0eb518ba9e2bcaf2090a5eb5a languageName: node linkType: hard @@ -6660,14 +5886,14 @@ __metadata: linkType: hard "cbor-x@npm:^1.4.1": - version: 1.5.2 - resolution: "cbor-x@npm:1.5.2" + version: 1.5.3 + resolution: "cbor-x@npm:1.5.3" dependencies: cbor-extract: "npm:^2.1.1" dependenciesMeta: cbor-extract: optional: true - checksum: 366e1caaa15e9c9f6a9bd3c4b9f111706eaa548e780bfd1e826af7cbf4b7c47a87c577a93d4f620817f137be717267f9b4c30931dc9bca20f06fa387f8ee38a9 + checksum: d4df85b33969826f4c96a4b4a8fbe03132fb0817fba876f16d41ad6d1a7d2668ec04c923f313220506029cc2b5ab212901ba24b4594d0115e0f527ef31506fbf languageName: node linkType: hard @@ -6713,6 +5939,20 @@ __metadata: languageName: node linkType: hard +"chevrotain@npm:^10.4.2": + version: 10.5.0 + resolution: "chevrotain@npm:10.5.0" + dependencies: + "@chevrotain/cst-dts-gen": "npm:10.5.0" + "@chevrotain/gast": "npm:10.5.0" + "@chevrotain/types": "npm:10.5.0" + "@chevrotain/utils": "npm:10.5.0" + lodash: "npm:4.17.21" + regexp-to-ast: "npm:0.5.0" + checksum: 06229e26177b47383726ee1ff3a4fa8de5a8349904a5c114015a5ad768754b4d78e029d86c799db58cd64543cb137e0e85a3be59261aba30e915768aee1bfbb9 + languageName: node + linkType: hard + "chokidar@npm:^3.5.2": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -7286,11 +6526,11 @@ __metadata: linkType: hard "cross-fetch@npm:^3.1.5": - version: 3.1.5 - resolution: "cross-fetch@npm:3.1.5" + version: 3.1.6 + resolution: "cross-fetch@npm:3.1.6" dependencies: - node-fetch: "npm:2.6.7" - checksum: 83fa7b13186c55abf289d6907b7d0be13e8c85066fb7d82a99b1b16ebcbf4cb49bcd9806020e386c94d69c7c09e15c4aade7de56ece40f86dba0147915d5c196 + node-fetch: "npm:^2.6.11" + checksum: a8989fca821cae97520976d00f85ce7c3ab8af7e00cc06c94fd94c49ada6847f4cdeabca8e0ebd4aa6c7343f70bea7e0c64d5910b846aab218136a450585aa61 languageName: node linkType: hard @@ -7337,6 +6577,15 @@ __metadata: languageName: node linkType: hard +"date-fns@npm:^2.29.3": + version: 2.30.0 + resolution: "date-fns@npm:2.30.0" + dependencies: + "@babel/runtime": "npm:^7.21.0" + checksum: 1edbb6ae2e10008de7f5ef37faee6c993926b008c98ca1d0cb4b0263c8448f2d3db5d84ac9475044f2295dee5d0d80bf6e92fe289f7f397420f0c8ad4bd7c069 + languageName: node + linkType: hard + "dateformat@npm:^3.0.0": version: 3.0.3 resolution: "dateformat@npm:3.0.3" @@ -7572,9 +6821,9 @@ __metadata: linkType: hard "dotenv@npm:*, dotenv@npm:^16.0.1, dotenv@npm:^16.0.3": - version: 16.0.3 - resolution: "dotenv@npm:16.0.3" - checksum: abce82d99b45e2ebbd42625a78cadbfafe03072c15e6538b6a3a7ed204b6e091c0de929dd09231edc61f78afbdcd5b8a2f21b9e933e8ab27d75bee865a0e58c9 + version: 16.1.3 + resolution: "dotenv@npm:16.1.3" + checksum: 8508f40434d54f878b2852142a01757dfd4a8caa12d88f65eafe9780e30fbb40fcac791d244860b7e21b82a9ebaeb37cd2fa16ca43a74fd4438b0ac60ef45816 languageName: node linkType: hard @@ -7608,10 +6857,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.284": - version: 1.4.384 - resolution: "electron-to-chromium@npm:1.4.384" - checksum: 3f318c499e3c49bb935f2c06176feb89ee89f42bca53c909faceea04b248cdc7a3aa11b0ba35ae2183339401a265b33688938bef3551b4953523b09a8a5cf828 +"electron-to-chromium@npm:^1.4.411": + version: 1.4.416 + resolution: "electron-to-chromium@npm:1.4.416" + checksum: d337a9c626b8b9f540d7003a62e3a0bd82ef11b43f3b28bc1fe6f9e69dfbbd788915bd8a590cd5b322c4e591cab2c7bb474bbb941e33b710f9e47d36199b4439 languageName: node linkType: hard @@ -7659,13 +6908,13 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.13.0": - version: 5.13.0 - resolution: "enhanced-resolve@npm:5.13.0" +"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.14.1": + version: 5.14.1 + resolution: "enhanced-resolve@npm:5.14.1" dependencies: graceful-fs: "npm:^4.2.4" tapable: "npm:^2.2.0" - checksum: ff54c25302309241f47d9555b1b6e5a315007c7e1178566ec02f538a322971bf6f4fe08170f7e7b98bafe3fccc49fa303ecd44ebf123090210d0c5b13b6140ae + checksum: d0dca4a78a824fddeacd5853ad7bd18d33469bc8556d3bca2eafbb4a2325ec462f830d58eeefbd9efb9708e9a65a2f52073a757b4c2ad928daab56a0aa394514 languageName: node linkType: hard @@ -7794,21 +7043,21 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.0": - version: 3.4.0 - resolution: "eslint-visitor-keys@npm:3.4.0" - checksum: c55d5b9300877e364e3c3c7929735408e2e75411faf1b02e634b29b737d938a93ec9a134883454572454125ee8831eb5a2c5d2b02bb3edc0f9365de9687ea79f +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1": + version: 3.4.1 + resolution: "eslint-visitor-keys@npm:3.4.1" + checksum: 97db79746bfe11a3ab0e60ce454cd809e7ac167ddd7d28736845ba57b8402d6b5d6c10fed2decf8c4026f7d3d659ebc024336ef30fdf473f0402bb1237c6a410 languageName: node linkType: hard "eslint@npm:^8.39.0": - version: 8.39.0 - resolution: "eslint@npm:8.39.0" + version: 8.41.0 + resolution: "eslint@npm:8.41.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/regexpp": "npm:^4.4.0" - "@eslint/eslintrc": "npm:^2.0.2" - "@eslint/js": "npm:8.39.0" + "@eslint/eslintrc": "npm:^2.0.3" + "@eslint/js": "npm:8.41.0" "@humanwhocodes/config-array": "npm:^0.11.8" "@humanwhocodes/module-importer": "npm:^1.0.1" "@nodelib/fs.walk": "npm:^1.2.8" @@ -7819,8 +7068,8 @@ __metadata: doctrine: "npm:^3.0.0" escape-string-regexp: "npm:^4.0.0" eslint-scope: "npm:^7.2.0" - eslint-visitor-keys: "npm:^3.4.0" - espree: "npm:^9.5.1" + eslint-visitor-keys: "npm:^3.4.1" + espree: "npm:^9.5.2" esquery: "npm:^1.4.2" esutils: "npm:^2.0.2" fast-deep-equal: "npm:^3.1.3" @@ -7828,13 +7077,12 @@ __metadata: find-up: "npm:^5.0.0" glob-parent: "npm:^6.0.2" globals: "npm:^13.19.0" - grapheme-splitter: "npm:^1.0.4" + graphemer: "npm:^1.4.0" ignore: "npm:^5.2.0" import-fresh: "npm:^3.0.0" imurmurhash: "npm:^0.1.4" is-glob: "npm:^4.0.0" is-path-inside: "npm:^3.0.3" - js-sdsl: "npm:^4.1.4" js-yaml: "npm:^4.1.0" json-stable-stringify-without-jsonify: "npm:^1.0.1" levn: "npm:^0.4.1" @@ -7847,18 +7095,18 @@ __metadata: text-table: "npm:^0.2.0" bin: eslint: bin/eslint.js - checksum: 742b8d2c8771b6b2875556eeb673db1c320edf03f2b424b399cf77b77677cf067f285405565bc71f5ddfbdb32c08bf278c1cad31009ebde20a2755a6c29796fe + checksum: 82a4a6fd28d88b15e2c8769d291449b93a2241934883d15236eccddce7154f60bf84657923a4840d62988ab099118b71b4ffa1bb7e3039bf1c69aad2ba15f236 languageName: node linkType: hard -"espree@npm:^9.5.1": - version: 9.5.1 - resolution: "espree@npm:9.5.1" +"espree@npm:^9.5.2": + version: 9.5.2 + resolution: "espree@npm:9.5.2" dependencies: acorn: "npm:^8.8.0" acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^3.4.0" - checksum: cdf0058252cbbbac5a36bf34809de1675558233fc04b74809a6e7f30b0cb41187044e816e596efb910d2f000e8a107d96d341efaf190c4cb9777d29da440aad0 + eslint-visitor-keys: "npm:^3.4.1" + checksum: 05c52faae1e5c72ba3ab639d06937a0570d64946d9062762cac1918c70921f67a17e1370a3503af1eb9ff27f36f9c1932389fcc810a98e9ee9887597d07911e5 languageName: node linkType: hard @@ -8072,9 +7320,9 @@ __metadata: linkType: hard "fast-diff@npm:^1.1.2": - version: 1.2.0 - resolution: "fast-diff@npm:1.2.0" - checksum: e75206672f583769d2270d4ab9960bef9bce5c0852c0553a2f3f960c977fb330ef01ae55b3e9c5877ed539065014d1e868140b2ee2666d21f1d833e9d0dfd82c + version: 1.3.0 + resolution: "fast-diff@npm:1.3.0" + checksum: 424cdf4f5f335fd33bcb4dd6e676746e351c3ed326db6f2ae2920937d224fa36064d7cfdac7521154153a3489b8f8cb59dad27778d127a680b658b7cd70a544e languageName: node linkType: hard @@ -8457,13 +7705,14 @@ __metadata: linkType: hard "get-intrinsic@npm:^1.0.2": - version: 1.2.0 - resolution: "get-intrinsic@npm:1.2.0" + version: 1.2.1 + resolution: "get-intrinsic@npm:1.2.1" dependencies: function-bind: "npm:^1.1.1" has: "npm:^1.0.3" + has-proto: "npm:^1.0.1" has-symbols: "npm:^1.0.3" - checksum: 6db1e521478d0a0f4e61c94c23e7a731b163d2904067b1b6efcac78e8b015404883dab4acb5570517df55aab6eb23eeef6a8d7310de76d9570fcbce4a3f80b18 + checksum: d1d5511cfe4fc46c1a7ec7e127cb4ac0b9e131124282724d7bd94ae5014db5d12403e6873dfd5feeca44cd57baa39f8b4dbda2147ec9bb3533a7d02ab033e352 languageName: node linkType: hard @@ -8592,22 +7841,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2": - version: 10.2.2 - resolution: "glob@npm:10.2.2" - dependencies: - foreground-child: "npm:^3.1.0" - jackspeak: "npm:^2.0.3" - minimatch: "npm:^9.0.0" - minipass: "npm:^5.0.0" - path-scurry: "npm:^1.7.0" - bin: - glob: dist/cjs/src/bin.js - checksum: 9ca0e52241115ba2ab302bccb346b71fc99a5760972cc94df23fdd714db32c1f2d6ebc91c07e53f2434235890db71cdd601213f50a1a44e2d2c2793e2746da9a - languageName: node - linkType: hard - -"glob@npm:^10.2.5": +"glob@npm:^10.2.2, glob@npm:^10.2.5": version: 10.2.6 resolution: "glob@npm:10.2.6" dependencies: @@ -8649,18 +7883,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^9.2.0": - version: 9.3.5 - resolution: "glob@npm:9.3.5" - dependencies: - fs.realpath: "npm:^1.0.0" - minimatch: "npm:^8.0.2" - minipass: "npm:^4.2.4" - path-scurry: "npm:^1.6.1" - checksum: e5cd25695c347c9a788f1b7af4bf9a562c06b54029e61c37119fd4ed529aeaf799e4d55fccd52013a30ac11ee0b9995aa767efd77403abeffd0be03ddecfa2f9 - languageName: node - linkType: hard - "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -8723,8 +7945,8 @@ __metadata: linkType: hard "got@npm:^12.1.0": - version: 12.6.0 - resolution: "got@npm:12.6.0" + version: 12.6.1 + resolution: "got@npm:12.6.1" dependencies: "@sindresorhus/is": "npm:^5.2.0" "@szmarczak/http-timer": "npm:^5.0.1" @@ -8737,7 +7959,7 @@ __metadata: lowercase-keys: "npm:^3.0.0" p-cancelable: "npm:^3.0.0" responselike: "npm:^3.0.0" - checksum: 2d5a329769b6bcef21bd6bc650803faae1eee51865aa3d15f3a166c9fae60bbf7dba050a364dd26443ae6e2bf4bf61d27695c12126c499e724bd794fad396a0a + checksum: be216dd251fa5f097ea4369ca97a99ccb0dad8fd4a4559d6cdef61f98379b7a1fe5fa36ca700830e4e51b429cb638bb6e9874863e275386429fa2d70b4e023be languageName: node linkType: hard @@ -8762,6 +7984,13 @@ __metadata: languageName: node linkType: hard +"graphemer@npm:^1.4.0": + version: 1.4.0 + resolution: "graphemer@npm:1.4.0" + checksum: a4ee139533e1d1683edb24eaf3e598451e7f1577da3dfc68f247f0601d5d11d264d0ccfad3de3bfcabbed891140fbae84c0403b9d68f4fcb6431c418f971434e + languageName: node + linkType: hard + "handlebars@npm:^4.7.7": version: 4.7.7 resolution: "handlebars@npm:4.7.7" @@ -8801,6 +8030,13 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: 0aa0de6013c2132a79fb8b885dc0274b99362807195bed0c69e2469eb0de41bf1695067d5e41adcd4bbd8daed8684250716c55db17478249f225ae3d0846e6bf + languageName: node + linkType: hard + "has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -8832,9 +8068,9 @@ __metadata: linkType: hard "helmet@npm:^6.0.0": - version: 6.1.5 - resolution: "helmet@npm:6.1.5" - checksum: 0c6b62e3a71591144abe2f1522889fd4cba6867615a80ef8f1efe3e1f5edac71839b74a11f9ea00367baebffd175cfb8d625538f132c2ac5861a635d24fc9cd0 + version: 6.2.0 + resolution: "helmet@npm:6.2.0" + checksum: 014ec4e5d33da8de3e5d46c0a8812e7754a2fd745e5c3b46ce452cfff81c865f03ac3f624c58f7dd80273ace5f8c935b879ab767b2afcc03df491f13201ad7c9 languageName: node linkType: hard @@ -9125,32 +8361,9 @@ __metadata: linkType: hard "ini@npm:^4.0.0": - version: 4.1.0 - resolution: "ini@npm:4.1.0" - checksum: 7bbdc8a0cd2f058a3d75103e50c363220c28b2cb9ca87df1b4dec29e314931f5e5659a09c5484417197942a9e05e56f7ec47fcd973ce450772d76b2d1884288f - languageName: node - linkType: hard - -"inquirer@npm:^9.2.1": - version: 9.2.2 - resolution: "inquirer@npm:9.2.2" - dependencies: - ansi-escapes: "npm:^4.3.2" - chalk: "npm:^5.2.0" - cli-cursor: "npm:^3.1.0" - cli-width: "npm:^4.0.0" - external-editor: "npm:^3.0.3" - figures: "npm:^5.0.0" - lodash: "npm:^4.17.21" - mute-stream: "npm:1.0.0" - ora: "npm:^5.4.1" - run-async: "npm:^2.4.0" - rxjs: "npm:^7.8.1" - string-width: "npm:^4.2.3" - strip-ansi: "npm:^7.0.1" - through: "npm:^2.3.6" - wrap-ansi: "npm:^6.0.1" - checksum: 6a154464dee92da567dfb0b920652447626132cb214fdc0ac99d30d594385c6a1590ec5c58b97b7843b3352c9d52f3370a2db3315c4a16ee43cf7974cccb44f8 + version: 4.1.1 + resolution: "ini@npm:4.1.1" + checksum: 0351902b49ab7a740130d011ada051a1edb5b0ec1e4ea8f64fad70509c99d080db4f6c553d757e8482301c78a1842b0c81812a767887bdb0e36ff32fb82a3992 languageName: node linkType: hard @@ -9227,9 +8440,9 @@ __metadata: linkType: hard "ipaddr.js@npm:^2.0.1": - version: 2.0.1 - resolution: "ipaddr.js@npm:2.0.1" - checksum: 04ce6c896c82b163a87d0be70fa1701dda54f1315f27419207c9ea95bea025cacbe6335d5e0c1270657158f60d17eeaa0bbb19b60e230e34532adfca786c6dc7 + version: 2.1.0 + resolution: "ipaddr.js@npm:2.1.0" + checksum: 1ec53ec67902cd62037a3b728079e9aa45502f310710d85bed3183f832e3db0d4d254a64d6e70be6391cb64d6f2c9b7a98fd139a4f369acfebfb54a896bab743 languageName: node linkType: hard @@ -9268,11 +8481,11 @@ __metadata: linkType: hard "is-core-module@npm:^2.12.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1": - version: 2.12.0 - resolution: "is-core-module@npm:2.12.0" + version: 2.12.1 + resolution: "is-core-module@npm:2.12.1" dependencies: has: "npm:^1.0.3" - checksum: 5619b73eeed50eb88c2941c4df535f080a2add4dc568e13411228121da6d7885da4f55be81167f221f4ddb3cb8feab27b00a36242721508a9b02743198aeaa43 + checksum: ad50fa9887d64a912837625b54df9489005180d829128c5d979355a969e80e65f772a54ac29e8f25a18a2ad2c6b45115deffb32a3e0c2d5b16ee7ad292066b5a languageName: node linkType: hard @@ -9529,15 +8742,15 @@ __metadata: linkType: hard "jackspeak@npm:^2.0.3": - version: 2.2.0 - resolution: "jackspeak@npm:2.2.0" + version: 2.2.1 + resolution: "jackspeak@npm:2.2.1" dependencies: "@isaacs/cliui": "npm:^8.0.2" "@pkgjs/parseargs": "npm:^0.11.0" dependenciesMeta: "@pkgjs/parseargs": optional: true - checksum: d967d29e540788fdfe7cc5983df6174c78ebe329d9997761fe0b3dece10f2fcd2056dfc8a7642fa20b89a68e2c5b3f2c35ab55716ace463f185924822f2d56e9 + checksum: b7c66988fb8575356fcf6b6c0fdcfb89a78fd0aaceb16d1318ae355fb7b6f51a456e9b8cf47ac0875bb7d6b94d82cc649762d5b819f4055ad5c5f5d617a0e20f languageName: node linkType: hard @@ -10001,13 +9214,6 @@ __metadata: languageName: node linkType: hard -"js-sdsl@npm:^4.1.4": - version: 4.4.0 - resolution: "js-sdsl@npm:4.4.0" - checksum: 8c85413f74e8bce8390d49474c8b0ff9d99626bd913ab41ad36f92ad297b89c50198daca84ff56bfb0dd1d5b4e64abfbd0e3ea8b016739dc64b5f076784d3b79 - languageName: node - linkType: hard - "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -10285,8 +9491,8 @@ __metadata: linkType: hard "libnpmpublish@npm:^7.1.4": - version: 7.2.0 - resolution: "libnpmpublish@npm:7.2.0" + version: 7.3.0 + resolution: "libnpmpublish@npm:7.3.0" dependencies: ci-info: "npm:^3.6.1" normalize-package-data: "npm:^5.0.0" @@ -10296,7 +9502,7 @@ __metadata: semver: "npm:^7.3.7" sigstore: "npm:^1.4.0" ssri: "npm:^10.0.1" - checksum: ae1c23f5242e3c8dd4257b3a6c399a703e21175b72fb3571e55fa00406d7efc80e459b740056eab3bf18af02c56ff3ac9c39dea5cdf86f400d5de8c9c1214649 + checksum: 831b45ed0160ddfb8e7fa7961ed356eeb361d1fc32bf98300e80aaba733da48269163ecc26fa325992ab3dcc9ccdcd9647f6b27c9720e11ff4f67a75f4ef4fe0 languageName: node linkType: hard @@ -10459,7 +9665,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.15, lodash@npm:^4.17.21": +"lodash@npm:4.17.21, lodash@npm:^4.17.15, lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 3ac18e92108d68f88429fcddee609e42cf2b653583d9bac22308815a4cd6b185b89a0ad0d9b0c670c371d9d6b61571a98fee6b36e1db14e52766ca253ed9cba0 @@ -10543,7 +9749,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^9.0.0": +"lru-cache@npm:^9.1.1": version: 9.1.1 resolution: "lru-cache@npm:9.1.1" checksum: 38c35791c90181b6810cbcd03f3808f335d4d9602fa86591b729dea72d7fb67e91765f97f94fa8af5dbe9b04f8e0e41f62223fd7249163c37354442bb26c8a61 @@ -10813,25 +10019,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^8.0.2, minimatch@npm:^8.0.3": - version: 8.0.4 - resolution: "minimatch@npm:8.0.4" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: eea8425c44427fa26a7a6bfc5835c29911cb3bc528817ecab3a143aa08709e26e30bb8e31fd943aac346e75123b9f28283650aca0b20a1f0b3127cfb5ad2c221 - languageName: node - linkType: hard - -"minimatch@npm:^9.0.0": - version: 9.0.0 - resolution: "minimatch@npm:9.0.0" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 07983996ed1698bb849aa39b42e295c76255720663ee53e5cf1904a87cf652ba54e038efabe3fa673e8fe2f64ab7872985b27a36da26220a2325162e7bededbe - languageName: node - linkType: hard - -"minimatch@npm:^9.0.1": +"minimatch@npm:^9.0.0, minimatch@npm:^9.0.1": version: 9.0.1 resolution: "minimatch@npm:9.0.1" dependencies: @@ -10958,7 +10146,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^4.0.0, minipass@npm:^4.2.4": +"minipass@npm:^4.0.0": version: 4.2.8 resolution: "minipass@npm:4.2.8" checksum: d648ef507b0600c2a18f4348ea39a8c8e09a2c740a80750bf10312de2674fa4141bf802bf4eb6d5d3cd71418d8eca7cb374a55cf8a58711816adf31936adf47f @@ -11064,8 +10252,8 @@ __metadata: linkType: hard "mysql2@npm:^3.0.1": - version: 3.2.4 - resolution: "mysql2@npm:3.2.4" + version: 3.3.3 + resolution: "mysql2@npm:3.3.3" dependencies: denque: "npm:^2.1.0" generate-function: "npm:^2.3.1" @@ -11075,7 +10263,7 @@ __metadata: named-placeholders: "npm:^1.1.3" seq-queue: "npm:^0.0.5" sqlstring: "npm:^2.3.2" - checksum: 01a668bad341570ed910f1b7d88521a29641875940232631d5cf783e07454d76fcda4987ee8c964699aefb2e61082912a9fbd5e134a3e13ebe8085a54d190c40 + checksum: a4e8f2967f024feaacab849745c28c093aaea590f3f31fa95d713ab419565e42a9dab65064e3bfd368362886f8566149834cfe335356068272f5782186d670e0 languageName: node linkType: hard @@ -11145,13 +10333,14 @@ __metadata: languageName: node linkType: hard -"newrelic@npm:^10.1.0": - version: 10.1.0 - resolution: "newrelic@npm:10.1.0" +"newrelic@npm:^10.1.2": + version: 10.1.2 + resolution: "newrelic@npm:10.1.2" dependencies: "@contrast/fn-inspect": "npm:^3.3.0" "@grpc/grpc-js": "npm:^1.8.10" "@grpc/proto-loader": "npm:^0.7.5" + "@mrleebo/prisma-ast": "npm:^0.5.2" "@newrelic/aws-sdk": "npm:^5.0.2" "@newrelic/koa": "npm:^7.1.1" "@newrelic/native-metrics": "npm:^9.0.0" @@ -11171,7 +10360,7 @@ __metadata: optional: true bin: newrelic-naming-rules: bin/test-naming-rules.js - checksum: 4be5e5e0c143caf9c952da0599b52d69fea9bc0eed5aa68fbbfea8a1233180c44f6b6f85b00a0e444ea76ffd674fa2c812a68188bd94e344a1f890334d6cb235 + checksum: 48f989612e6054323421b9912fb41103e83ac73dfaea3e8c61bb00e33a359da9a37016d6fae9c70c85b4444ba1d709f913c5bdb891942adf60b48fa0a1a233ba languageName: node linkType: hard @@ -11200,9 +10389,9 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.6.7": - version: 2.6.7 - resolution: "node-fetch@npm:2.6.7" +"node-fetch@npm:^2.6.11, node-fetch@npm:^2.6.7": + version: 2.6.11 + resolution: "node-fetch@npm:2.6.11" dependencies: whatwg-url: "npm:^5.0.0" peerDependencies: @@ -11210,21 +10399,7 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: 05c03fe66f38b9e349e691caf121b693a91adb41ab59c3af17d2c5f9d2f8d927c30b428e7c8049b739c674db06171117ba9d10dc72d6a2cf35ba8901dfb4de83 - languageName: node - linkType: hard - -"node-fetch@npm:^2.6.7": - version: 2.6.9 - resolution: "node-fetch@npm:2.6.9" - dependencies: - whatwg-url: "npm:^5.0.0" - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: 8457cf62f599e9d55b01d58f87ed2110c65f83c4fcce8be0e350909995384e96a55e2b810d0e1a67a1fbe7f9930cd0998146d2dcce4843f9ed3ac0b479bd5c64 + checksum: 3e7af7c0025f4bebd8f14efd0248344a5f0155253762810bf1be70e9e8d669e3ee74794754ca1a53e7d9ad8f4906d774e2b4e9e5209e2fd5d515e5c7299b3280 languageName: node linkType: hard @@ -11308,10 +10483,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.8": - version: 2.0.10 - resolution: "node-releases@npm:2.0.10" - checksum: 2047e77c66497fde77318ac163feb8ee18a3bca67c87b76642aeb0549bd01edcc88d7e002691b982513ebb46c809c456c7e027e38848ce9d2f915473552490b6 +"node-releases@npm:^2.0.12": + version: 2.0.12 + resolution: "node-releases@npm:2.0.12" + checksum: ae9ed0c2edca1127a0437a55e4467d6f32d496e8674bafdd1ffe42c3b90482727b178f37793a7041cc3287a42c624ada7a6a056857558134ba6b480ad9bc84db languageName: node linkType: hard @@ -11439,8 +10614,8 @@ __metadata: linkType: hard "npm-check-updates@npm:^16.0.1": - version: 16.10.9 - resolution: "npm-check-updates@npm:16.10.9" + version: 16.10.12 + resolution: "npm-check-updates@npm:16.10.12" dependencies: chalk: "npm:^5.2.0" cli-table3: "npm:^0.6.3" @@ -11456,7 +10631,7 @@ __metadata: json-parse-helpfulerror: "npm:^1.0.3" jsonlines: "npm:^0.1.1" lodash: "npm:^4.17.21" - minimatch: "npm:^8.0.3" + minimatch: "npm:^9.0.0" p-map: "npm:^4.0.0" pacote: "npm:15.1.1" parse-github-url: "npm:^1.0.2" @@ -11464,8 +10639,8 @@ __metadata: prompts-ncu: "npm:^3.0.0" rc-config-loader: "npm:^4.1.2" remote-git-tags: "npm:^3.0.0" - rimraf: "npm:^4.4.1" - semver: "npm:^7.3.8" + rimraf: "npm:^5.0.0" + semver: "npm:^7.4.0" semver-utils: "npm:^1.1.4" source-map-support: "npm:^0.5.21" spawn-please: "npm:^2.0.1" @@ -11475,7 +10650,7 @@ __metadata: bin: ncu: build/src/bin/cli.js npm-check-updates: build/src/bin/cli.js - checksum: 72ec7248a6e39d449c3e50436c329abb7e1a69c423348c3a32c006dfcb8e0f058ed1b20435754ca8213caa597d3d43cb0819ced3ba935f2a500960912482f118 + checksum: 4ec825b97d69b05e90243b60a362b26cd725744de7fbfc6e53c296493d4a877bc374dfc81c7c8cfdb0e41a6893c2a3ffccac5ec8d6f41a0be8dd805f13507a48 languageName: node linkType: hard @@ -12036,13 +11211,13 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.6.1, path-scurry@npm:^1.7.0": - version: 1.7.0 - resolution: "path-scurry@npm:1.7.0" +"path-scurry@npm:^1.7.0": + version: 1.9.2 + resolution: "path-scurry@npm:1.9.2" dependencies: - lru-cache: "npm:^9.0.0" - minipass: "npm:^5.0.0" - checksum: b51b3abc6b555915bed2aa2de7247e4e8a553cabd5a7662ede231deef85cd6210329e6902aeb62dc54d209ca5da2c8159dbcb6f13f3caa337b0820f9b1af2736 + lru-cache: "npm:^9.1.1" + minipass: "npm:^5.0.0 || ^6.0.2" + checksum: c60ad5b0decbff08e45a527de1e22a0e5667e9120ce8a007bc219125f5f2462cd167f9f7622681b2ff760c1deec1d2e49fdead4ff508da3f1ca7a7389240f7e9 languageName: node linkType: hard @@ -12537,14 +11712,14 @@ __metadata: linkType: hard "readable-stream@npm:^4.1.0": - version: 4.3.0 - resolution: "readable-stream@npm:4.3.0" + version: 4.4.0 + resolution: "readable-stream@npm:4.4.0" dependencies: abort-controller: "npm:^3.0.0" buffer: "npm:^6.0.3" events: "npm:^3.3.0" process: "npm:^0.11.10" - checksum: 14fa31e8b187abbfa3f48475ea181e02dd998143d40f93625b2db84737905cdf1886d54ce22784158b83d5ec653c6aeadf4aa3ecd680e8c00051737ca113caa7 + checksum: 4cacc2f32ea274caf870a3441aca66ff0a06ab21d115c9c564fd70a23663e447cfb9b091af40471d74a8274a40a9feb2bfcd4046d841aeb9ba8e7dacf782bbe1 languageName: node linkType: hard @@ -12605,13 +11780,20 @@ __metadata: languageName: node linkType: hard -"regenerator-runtime@npm:^0.13.9": +"regenerator-runtime@npm:^0.13.11, regenerator-runtime@npm:^0.13.9": version: 0.13.11 resolution: "regenerator-runtime@npm:0.13.11" checksum: 0485db63ce47760e28329590cb9f8b208365d076dbf2edaa32e551a7c0451fc6f7557b225268422c960ffa4fbc6ff86d63d6a747aacbf6b10ed6a747b432e3c8 languageName: node linkType: hard +"regexp-to-ast@npm:0.5.0": + version: 0.5.0 + resolution: "regexp-to-ast@npm:0.5.0" + checksum: 7f03ab05187a8e2bece21ef75ea844cf280202fc011e91408d109ea02f324d1662757f5a746ab68716606bb582e9490af4bf9ebece5f3200737fb99ac3132efc + languageName: node + linkType: hard + "registry-auth-token@npm:^5.0.1": version: 5.0.2 resolution: "registry-auth-token@npm:5.0.2" @@ -12767,21 +11949,14 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^4.4.1": - version: 4.4.1 - resolution: "rimraf@npm:4.4.1" +"rimraf@npm:^5.0.0": + version: 5.0.1 + resolution: "rimraf@npm:5.0.1" dependencies: - glob: "npm:^9.2.0" + glob: "npm:^10.2.5" bin: rimraf: dist/cjs/src/bin.js - checksum: 1dcc3cb6a13a806fc276996d2e0d20abae62a96f2a663a79e3e30be711a23da29f814a322412827b5b6e58b535382096cbaf261cbd2f7790c5a37e6ea31150dd - languageName: node - linkType: hard - -"run-async@npm:^2.4.0": - version: 2.4.1 - resolution: "run-async@npm:2.4.1" - checksum: bf03d6deaab379c48b1c0c9aae808a286cef93744da27841c6b28ba1310e9fc000272e54b0c34172818ec2f149e44e3a9791ddc4fcb9b9df64d43f5a4bebfc6f + checksum: 52dae5032c2557c832fd97aa174c006688b15811da72ef8412e556cc1fa99bb5485ae74ee0ea3725a2cb33c5dcd6a8486a0c72e1960aecd85e6c563d86a484e3 languageName: node linkType: hard @@ -12874,7 +12049,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.0, semver@npm:7.x, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.0": +"semver@npm:7.5.0": version: 7.5.0 resolution: "semver@npm:7.5.0" dependencies: @@ -12885,16 +12060,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.3.0": - version: 6.3.0 - resolution: "semver@npm:6.3.0" - bin: - semver: ./bin/semver.js - checksum: 18f3d42ec70a542e9efc498ecc3d0b9b088099115e8658b49d2bfc6470b46a6144b294374dac3f343fe1600039cbd80d5e830dd356053fd5abd4f1af5118a928 - languageName: node - linkType: hard - -"semver@npm:^7.5.1": +"semver@npm:7.x, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.4.0, semver@npm:^7.5.1": version: 7.5.1 resolution: "semver@npm:7.5.1" dependencies: @@ -12905,6 +12071,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^6.0.0, semver@npm:^6.3.0": + version: 6.3.0 + resolution: "semver@npm:6.3.0" + bin: + semver: ./bin/semver.js + checksum: 18f3d42ec70a542e9efc498ecc3d0b9b088099115e8658b49d2bfc6470b46a6144b294374dac3f343fe1600039cbd80d5e830dd356053fd5abd4f1af5118a928 + languageName: node + linkType: hard + "semver@npm:~7.0.0": version: 7.0.0 resolution: "semver@npm:7.0.0" @@ -13033,26 +12208,13 @@ __metadata: linkType: hard "signal-exit@npm:^4.0.1": - version: 4.0.1 - resolution: "signal-exit@npm:4.0.1" - checksum: ef082de589167a239a5cae4ab844dc8fac10b268d519ac34dbcb154990acb70c83a779b1843c5ad94eb3ef4d2c666df1da5685a930848c02a8e395050282332e + version: 4.0.2 + resolution: "signal-exit@npm:4.0.2" + checksum: 8d05e3167eb2b9798d10e005c8c8d011d06189089ebf5cace0400cfe20b4f7cad1a5ccc8b613c92425d25da843b08cf76e4c59827f6c6003b186a7c0c336d46c languageName: node linkType: hard -"sigstore@npm:^1.0.0": - version: 1.4.0 - resolution: "sigstore@npm:1.4.0" - dependencies: - "@sigstore/protobuf-specs": "npm:^0.1.0" - make-fetch-happen: "npm:^11.0.1" - tuf-js: "npm:^1.1.3" - bin: - sigstore: bin/sigstore.js - checksum: 3e2540f19a1b55ec25ec0f49ea40cfa29edded0c0a736f6298d005a860bc30468a19b9276db6e8aed8f45c730194beba3430d21896faeacfb705219316f7640e - languageName: node - linkType: hard - -"sigstore@npm:^1.3.0, sigstore@npm:^1.4.0": +"sigstore@npm:^1.0.0, sigstore@npm:^1.3.0, sigstore@npm:^1.4.0": version: 1.5.2 resolution: "sigstore@npm:1.5.2" dependencies: @@ -13104,13 +12266,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:^5.0.1": - version: 5.0.1 - resolution: "slash@npm:5.0.1" - checksum: dbbf13cc79b9753d885faf52a690d609567169367742707d7191a5f9b6d7b54013f8718836b148cfebfc518a984d907352c01d598f2f0066b124e76c7d116649 - languageName: node - linkType: hard - "slash@npm:^5.1.0": version: 5.1.0 resolution: "slash@npm:5.1.0" @@ -13424,11 +12579,11 @@ __metadata: linkType: hard "strip-ansi@npm:^7.0.1": - version: 7.0.1 - resolution: "strip-ansi@npm:7.0.1" + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" dependencies: ansi-regex: "npm:^6.0.1" - checksum: 552123468abae97929da64559af9c13f4518f8ea199038089bf5e49d7860d708e5e29b2e6401fcbab6f99f2c42f865c15a1976bcf51c5165f82152c7ce9a1043 + checksum: 09f81cbad0ac6e3dbe1c425429135432e91b1a61b7799587cb38aa24fb661aa5a83eaaf579e241ac1a4cac39fee97501c15226099728e56759abc6846b51917a languageName: node linkType: hard @@ -13551,21 +12706,7 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.1.14 - resolution: "tar@npm:6.1.14" - dependencies: - chownr: "npm:^2.0.0" - fs-minipass: "npm:^2.0.0" - minipass: "npm:^5.0.0" - minizlib: "npm:^2.1.1" - mkdirp: "npm:^1.0.3" - yallist: "npm:^4.0.0" - checksum: 5aeff09f5651983534cb7be7f8692ca202b0027c5a799d7037a863f1a1a2ecfdcc2e1358261d9a39459fca7b5bab7f35a0ee118de4bad8c07103d22edb661ec0 - languageName: node - linkType: hard - -"tar@npm:^6.1.15": +"tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.15, tar@npm:^6.1.2": version: 6.1.15 resolution: "tar@npm:6.1.15" dependencies: @@ -13587,14 +12728,14 @@ __metadata: linkType: hard "terser-webpack-plugin@npm:^5.3.7": - version: 5.3.7 - resolution: "terser-webpack-plugin@npm:5.3.7" + version: 5.3.9 + resolution: "terser-webpack-plugin@npm:5.3.9" dependencies: "@jridgewell/trace-mapping": "npm:^0.3.17" jest-worker: "npm:^27.4.5" schema-utils: "npm:^3.1.1" serialize-javascript: "npm:^6.0.1" - terser: "npm:^5.16.5" + terser: "npm:^5.16.8" peerDependencies: webpack: ^5.1.0 peerDependenciesMeta: @@ -13604,13 +12745,13 @@ __metadata: optional: true uglify-js: optional: true - checksum: d9a53e18366f053fabe191d3a32808ce0a52df2d4bc001786ae20da4c41215a8b75fb0ab5a1222690e32bf4611a870afe6ee4d9a79145f33e242b7a9e9760dca + checksum: c9e69dfff60a2bc95e8b4d24bcf9979be9f411b614617ad75a56eefa6be67a69b465c80e060ff9bc7baaf2f8dcff277b756be9219085d1c3930440f3447a1f26 languageName: node linkType: hard -"terser@npm:^5.16.5": - version: 5.17.1 - resolution: "terser@npm:5.17.1" +"terser@npm:^5.16.8": + version: 5.17.6 + resolution: "terser@npm:5.17.6" dependencies: "@jridgewell/source-map": "npm:^0.3.2" acorn: "npm:^8.5.0" @@ -13618,7 +12759,7 @@ __metadata: source-map-support: "npm:~0.5.20" bin: terser: bin/terser - checksum: d42eefe4381612b86ae5e451553b3a6c402ac62fdae09715b7cf71ed1b8cf4e89cf31feddee983a0cbf45256a2c2e7c8793c24651ba210753b3ce89cb170c724 + checksum: bb36bd1816639e1933afb19064b027ff195f63ef711cb9f7af7a38ecf83bdc4d4d8c67403c80dcee2ce60f72e9dd8de49ca0a36089d5a76c646703701ed60a25 languageName: node linkType: hard @@ -13817,8 +12958,8 @@ __metadata: linkType: hard "ts-loader@npm:^9.2.6": - version: 9.4.2 - resolution: "ts-loader@npm:9.4.2" + version: 9.4.3 + resolution: "ts-loader@npm:9.4.3" dependencies: chalk: "npm:^4.1.0" enhanced-resolve: "npm:^5.0.0" @@ -13827,7 +12968,7 @@ __metadata: peerDependencies: typescript: "*" webpack: ^5.0.0 - checksum: c93a9c27f057174961d0b9a227894cc5183e793d196b6f3d183eb0fffc67437d69cbbc6122eb672d671c9663532d83be3aeae6bfe17e57335c280ac67eba2e26 + checksum: 61bc1012db5b67e3106f2d4bd47efaecf3821315ac20ecd5a841f7cdc31b9b6798fb0041c5cc13b8fd908a18724c7106f33389972d0310307db60d9cd26c0b25 languageName: node linkType: hard @@ -13877,9 +13018,9 @@ __metadata: linkType: hard "tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0": - version: 2.5.0 - resolution: "tslib@npm:2.5.0" - checksum: 5a6ee935f56cd653af29de928483acbab7323f964b053e98b6b318abc69431fb0e4f660c4f4a396e2e93852510bef25eeb9f1d951d060b2d7bcc313811e5da6f + version: 2.5.2 + resolution: "tslib@npm:2.5.2" + checksum: ed22e23f3d390c305c714064679149f3dd298bc7473697480343c6ec4d2afc94270f85d947fca2ccc6324a22602ef04fe2c7177dda317fbea55f7da1dca3fa36 languageName: node linkType: hard @@ -13895,12 +13036,13 @@ __metadata: linkType: hard "tuf-js@npm:^1.1.3": - version: 1.1.5 - resolution: "tuf-js@npm:1.1.5" + version: 1.1.6 + resolution: "tuf-js@npm:1.1.6" dependencies: "@tufjs/models": "npm:1.0.4" + debug: "npm:^4.3.4" make-fetch-happen: "npm:^11.1.0" - checksum: 2eef3f7df7f25666cb73487e1b05b0b054b8d9876454a8685a7f3370245cc5b7f0bce6c8f6d6ba2060324a0f55bb1366b5fd4bb74a5f4c973544da60b1706b8a + checksum: d13ae54a51d9c98424b2198cdbbd20e63c8bd1d6d5751d188d3dc042ed1bb3b812f5770a5bab477ceef7ae29d6707d43817447f94a710bac670cbb311d112cb2 languageName: node linkType: hard @@ -13996,14 +13138,15 @@ __metadata: linkType: hard "typeorm@npm:^0.3.15": - version: 0.3.15 - resolution: "typeorm@npm:0.3.15" + version: 0.3.16 + resolution: "typeorm@npm:0.3.16" dependencies: "@sqltools/formatter": "npm:^1.2.5" app-root-path: "npm:^3.1.0" buffer: "npm:^6.0.3" chalk: "npm:^4.1.2" cli-highlight: "npm:^2.1.11" + date-fns: "npm:^2.29.3" debug: "npm:^4.3.4" dotenv: "npm:^16.0.3" glob: "npm:^8.1.0" @@ -14070,7 +13213,7 @@ __metadata: typeorm: cli.js typeorm-ts-node-commonjs: cli-ts-node-commonjs.js typeorm-ts-node-esm: cli-ts-node-esm.js - checksum: db890f14cbb9aacaef154cfe1b48e08354441c5e26cb2f5e5e294b55eb7e07e60fc22471f941829ccd80a73fbea7a356ae1b769b08320805a08a08685c0ad6a8 + checksum: 19803f935e2733982d04d505226092aa6aa109d233b5616f7c87d2acc578647590514c1580ff611499846bdfb90d901f388fd1700717bf0d4d36482fcdfa4304 languageName: node linkType: hard @@ -14215,7 +13358,7 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.10": +"update-browserslist-db@npm:^1.0.11": version: 1.0.11 resolution: "update-browserslist-db@npm:1.0.11" dependencies: @@ -14393,8 +13536,8 @@ __metadata: linkType: hard "webpack@npm:^5.82.0": - version: 5.82.0 - resolution: "webpack@npm:5.82.0" + version: 5.85.0 + resolution: "webpack@npm:5.85.0" dependencies: "@types/eslint-scope": "npm:^3.7.3" "@types/estree": "npm:^1.0.0" @@ -14402,10 +13545,10 @@ __metadata: "@webassemblyjs/wasm-edit": "npm:^1.11.5" "@webassemblyjs/wasm-parser": "npm:^1.11.5" acorn: "npm:^8.7.1" - acorn-import-assertions: "npm:^1.7.6" + acorn-import-assertions: "npm:^1.9.0" browserslist: "npm:^4.14.5" chrome-trace-event: "npm:^1.0.2" - enhanced-resolve: "npm:^5.13.0" + enhanced-resolve: "npm:^5.14.1" es-module-lexer: "npm:^1.2.1" eslint-scope: "npm:5.1.1" events: "npm:^3.2.0" @@ -14425,7 +13568,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: bd9641a552191e5a0b993bf9b6f9df0946ade444641a0357fcde2433868bfb11fe1c259a8ede3f47f243ff321b5f9fe89b256dad450edcbfa817d71e270461bf + checksum: 9a91ad39952b62ba86a1d050f74a425f7c1005bb1db74f9d5c6507815ad8fa288ea32cd784d9db52c6565f769dfc810aaa621104da2afe0c14108daef0405d5a languageName: node linkType: hard @@ -14491,8 +13634,8 @@ __metadata: linkType: hard "winston@npm:^3.8.1": - version: 3.8.2 - resolution: "winston@npm:3.8.2" + version: 3.9.0 + resolution: "winston@npm:3.9.0" dependencies: "@colors/colors": "npm:1.5.0" "@dabh/diagnostics": "npm:^2.0.2" @@ -14505,7 +13648,7 @@ __metadata: stack-trace: "npm:0.0.x" triple-beam: "npm:^1.3.0" winston-transport: "npm:^4.5.0" - checksum: 50d7712f49ebb22317b9619334f2dca55f5760257e44915013fd2c060267064386347048e6ecf9f550dfcfba705dc94f58163b44eca72abff388037e792af524 + checksum: 8395f2942e810046f2c5837d843ba11fdfaea9056d47181af9b171c63965fbf61ba4e2dfa292bceeaa6e54f0cd7b4e16f0fe806ca33ef707d4a3148f41f46f28 languageName: node linkType: hard @@ -14545,7 +13688,7 @@ __metadata: languageName: node linkType: hard -"wrap-ansi@npm:^8.0.1, wrap-ansi@npm:^8.1.0": +"wrap-ansi@npm:^8.1.0": version: 8.1.0 resolution: "wrap-ansi@npm:8.1.0" dependencies: