diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4135d20..ae629f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,6 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 - with: - node-version: 16 - name: Install dependencies run: npm ci diff --git a/README.md b/README.md index 626d7c4..fdcda11 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,21 @@ npx primer-react-migrate [src directory] -p [preset name] [--create-commits] npx primer-react-migrate [src directory] -m [migration name] [--create-commits] # Example: -npx primer-react-migrate src -p v35 --create-commits +npx primer-react-migrate src -p v37 --create-commits npx primer-react-migrate src -m use-deprecated-button ```   -### Available migrations:: +### Available presets: + +- v37 +- v35 + +  + +### Available migrations: ``` use-deprecated-flex @@ -45,4 +52,16 @@ use-main-button use-main-actionlist use-main-actionmenu use-main-pagelayout + +use-deprecated-dialog +use-deprecated-tooltip +use-deprecated-octicon +use-deprecated-pagehead +use-deprecated-tabnav + +rename-drafts-to-experimental + +use-main-dialog +use-main-tooltip +use-main-stack ``` diff --git a/index.js b/index.js index 3d866fd..125f20b 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ const { resolve } = require('path'); const loader = require('./src/utils/loader'); const createProject = require('./src/utils/create-project'); const { createCommit, getPrettyMessage } = require('./src/utils/create-commit'); +const { deprecate } = require('util'); const project = createProject(); @@ -18,7 +19,7 @@ const preset = args.preset || args.p; const migration = args.migration || args.m; const createCommits = args['create-commits']; -const migrations = [ +const v35Migrations = [ // old deprecations 'use-deprecated-borderbox', 'use-deprecated-flex', @@ -46,9 +47,36 @@ const migrations = [ 'use-main-pagelayout' ]; -if (preset === 'v35') { - async function runSequentially() { - for (const migrationName of migrations) { +const v37Migrations = [ + // deprecrations + 'use-deprecated-dialog', + 'use-deprecated-tooltip', + 'use-deprecated-octicon', + 'use-deprecated-pagehead', + 'use-deprecated-tabnav', + + // drafts is renamed to experimental + 'rename-drafts-to-experimental', + + // promotions, should be run after deprecations + 'use-main-dialog', + 'use-main-tooltip', + 'use-main-stack' +]; + +const allMigrations = [...v35Migrations, ...v37Migrations]; + +if (preset) { + if (preset === 'v35') runSequentially(v35Migrations); + else if (preset === 'v37') runSequentially(v37Migrations); + else { + console.log( + 'Preset not found! Check the list of available presets on https://github.com/primer/react-migrate' + ); + } + + async function runSequentially(presetMigrations) { + for (const migrationName of presetMigrations) { const message = getPrettyMessage(migrationName); const { success, skip } = loader(message); @@ -60,10 +88,8 @@ if (preset === 'v35') { } else await success(); } } - - runSequentially(); } else { - if (migrations.includes(migration)) { + if (allMigrations.includes(migration)) { const path = './src/' + migration + '.js'; require(path)(project); if (createCommits) createCommit(migration); diff --git a/package-lock.json b/package-lock.json index 0998aaf..7dd1637 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,11 +35,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -83,24 +86,32 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.0", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", + "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/parser": "^7.26.2", + "@babel/types": "^7.26.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", "dev": true, - "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@babel/types": "^7.25.9" + }, "engines": { - "node": ">=0.10.0" + "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { @@ -131,47 +142,14 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/types": "^7.16.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -196,9 +174,10 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -225,10 +204,20 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -254,87 +243,14 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.16.10", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", + "node_modules/@babel/parser": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, - "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "@babel/types": "^7.26.0" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/parser": { - "version": "7.17.0", - "dev": true, - "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -397,6 +313,22 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "dev": true, @@ -503,32 +435,31 @@ } }, "node_modules/@babel/template": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.17.0", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.0", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.0", - "@babel/types": "^7.17.0", - "debug": "^4.1.0", + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -536,12 +467,13 @@ } }, "node_modules/@babel/types": { - "version": "7.17.0", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, - "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -552,6 +484,37 @@ "dev": true, "license": "MIT" }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.3.1.tgz", + "integrity": "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==", + "dev": true, + "peer": true, + "dependencies": { + "@emotion/memoize": "^0.9.0" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "dev": true, + "peer": true + }, + "node_modules/@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", + "dev": true, + "peer": true + }, + "node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", + "dev": true, + "peer": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "dev": true, @@ -812,26 +775,52 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.4", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "license": "MIT", "engines": { "node": ">=6.0.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.10", + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "license": "MIT" + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.2", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, - "license": "MIT", "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@kwsites/file-exists": { @@ -1415,6 +1404,23 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, + "node_modules/babel-plugin-styled-components": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.4.tgz", + "integrity": "sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.22.5", + "lodash": "^4.17.21", + "picomatch": "^2.3.1" + }, + "peerDependencies": { + "styled-components": ">= 2" + } + }, "node_modules/babel-preset-current-node-syntax": { "version": "1.0.1", "dev": true, @@ -1585,6 +1591,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/camelize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001309", "dev": true, @@ -1748,6 +1764,28 @@ "node": ">= 8" } }, + "node_modules/css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/css-to-react-native": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", + "dev": true, + "peer": true, + "dependencies": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, "node_modules/cssom": { "version": "0.4.4", "dev": true, @@ -3192,14 +3230,15 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, - "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-parse-even-better-errors": { @@ -3285,6 +3324,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "dev": true, @@ -3624,6 +3676,13 @@ "node": ">=8" } }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "peer": true + }, "node_modules/prelude-ls": { "version": "1.1.2", "dev": true, @@ -3703,6 +3762,35 @@ ], "license": "MIT" }, + "node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, "node_modules/react-is": { "version": "16.13.1", "dev": true, @@ -3853,6 +3941,17 @@ "node": ">=10" } }, + "node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "node_modules/semver": { "version": "6.3.0", "dev": true, @@ -3861,6 +3960,13 @@ "semver": "bin/semver.js" } }, + "node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", + "dev": true, + "peer": true + }, "node_modules/shebang-command": { "version": "2.0.0", "dev": true, @@ -4033,6 +4139,60 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/styled-components": { + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.11.tgz", + "integrity": "sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^1.1.0", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/styled-components" + }, + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0", + "react-is": ">= 16.8.0" + } + }, + "node_modules/styled-components/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/styled-components/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/styled-system": { "version": "5.1.5", "dev": true, @@ -4129,14 +4289,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "license": "MIT", @@ -4465,10 +4617,14 @@ } }, "@babel/code-frame": { - "version": "7.16.7", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" } }, "@babel/compat-data": { @@ -4497,18 +4653,26 @@ } }, "@babel/generator": { - "version": "7.17.0", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.2.tgz", + "integrity": "sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==", "dev": true, "requires": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "dev": true - } + "@babel/parser": "^7.26.2", + "@babel/types": "^7.26.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", + "dev": true, + "peer": true, + "requires": { + "@babel/types": "^7.25.9" } }, "@babel/helper-compilation-targets": { @@ -4528,34 +4692,14 @@ "@babel/types": "^7.16.7" } }, - "@babel/helper-function-name": { - "version": "7.16.7", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.7", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.16.7", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } - }, "@babel/helper-module-imports": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" } }, "@babel/helper-module-transforms": { @@ -4573,7 +4717,9 @@ } }, "@babel/helper-plugin-utils": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true }, "@babel/helper-simple-access": { @@ -4590,8 +4736,16 @@ "@babel/types": "^7.16.7" } }, + "@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true }, "@babel/helper-validator-option": { @@ -4607,63 +4761,15 @@ "@babel/types": "^7.17.0" } }, - "@babel/highlight": { - "version": "7.16.10", + "@babel/parser": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "@babel/types": "^7.26.0" } }, - "@babel/parser": { - "version": "7.17.0", - "dev": true - }, "@babel/plugin-syntax-async-generators": { "version": "7.8.4", "dev": true, @@ -4699,6 +4805,16 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", + "dev": true, + "peer": true, + "requires": { + "@babel/helper-plugin-utils": "^7.25.9" + } + }, "@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "dev": true, @@ -4763,42 +4879,76 @@ } }, "@babel/template": { - "version": "7.16.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" } }, "@babel/traverse": { - "version": "7.17.0", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.0", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.0", - "@babel/types": "^7.17.0", - "debug": "^4.1.0", + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", + "debug": "^4.3.1", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.17.0", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" } }, "@bcoe/v8-coverage": { "version": "0.2.3", "dev": true }, + "@emotion/is-prop-valid": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.3.1.tgz", + "integrity": "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==", + "dev": true, + "peer": true, + "requires": { + "@emotion/memoize": "^0.9.0" + } + }, + "@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "dev": true, + "peer": true + }, + "@emotion/stylis": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", + "dev": true, + "peer": true + }, + "@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", + "dev": true, + "peer": true + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "dev": true, @@ -4989,20 +5139,43 @@ "chalk": "^4.0.0" } }, + "@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "@jridgewell/resolve-uri": { - "version": "3.0.4", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.10", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.2", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@kwsites/file-exists": { @@ -5449,6 +5622,20 @@ "@types/babel__traverse": "^7.0.6" } }, + "babel-plugin-styled-components": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-2.1.4.tgz", + "integrity": "sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==", + "dev": true, + "peer": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.22.5", + "lodash": "^4.17.21", + "picomatch": "^2.3.1" + } + }, "babel-preset-current-node-syntax": { "version": "1.0.1", "dev": true, @@ -5549,6 +5736,13 @@ "version": "6.3.0", "dev": true }, + "camelize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", + "dev": true, + "peer": true + }, "caniuse-lite": { "version": "1.0.30001309", "dev": true @@ -5658,6 +5852,25 @@ "which": "^2.0.1" } }, + "css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", + "dev": true, + "peer": true + }, + "css-to-react-native": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", + "dev": true, + "peer": true, + "requires": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, "cssom": { "version": "0.4.4", "dev": true @@ -6622,7 +6835,9 @@ } }, "jsesc": { - "version": "2.5.2", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true }, "json-parse-even-better-errors": { @@ -6676,6 +6891,16 @@ "is-unicode-supported": "^0.1.0" } }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, "lru-cache": { "version": "6.0.0", "dev": true, @@ -6882,6 +7107,13 @@ "find-up": "^4.0.0" } }, + "postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "peer": true + }, "prelude-ls": { "version": "1.1.2", "dev": true @@ -6924,6 +7156,29 @@ "queue-microtask": { "version": "1.2.3" }, + "react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + } + }, "react-is": { "version": "16.13.1", "dev": true @@ -7010,10 +7265,28 @@ "xmlchars": "^2.2.0" } }, + "scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "semver": { "version": "6.3.0", "dev": true }, + "shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", + "dev": true, + "peer": true + }, "shebang-command": { "version": "2.0.0", "dev": true, @@ -7119,6 +7392,44 @@ "version": "3.1.1", "dev": true }, + "styled-components": { + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.3.11.tgz", + "integrity": "sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==", + "dev": true, + "peer": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/traverse": "^7.4.5", + "@emotion/is-prop-valid": "^1.1.0", + "@emotion/stylis": "^0.8.4", + "@emotion/unitless": "^0.7.4", + "babel-plugin-styled-components": ">= 1.12.0", + "css-to-react-native": "^3.0.0", + "hoist-non-react-statics": "^3.0.0", + "shallowequal": "^1.1.0", + "supports-color": "^5.5.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "peer": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "styled-system": { "version": "5.1.5", "dev": true, @@ -7185,10 +7496,6 @@ "version": "1.0.5", "dev": true }, - "to-fast-properties": { - "version": "2.0.0", - "dev": true - }, "to-regex-range": { "version": "5.0.1", "requires": { diff --git a/src/rename-drafts-to-experimental.js b/src/rename-drafts-to-experimental.js new file mode 100644 index 0000000..bd2a2db --- /dev/null +++ b/src/rename-drafts-to-experimental.js @@ -0,0 +1,23 @@ +const { SyntaxKind } = require('ts-morph'); +const changeDraftsImportToExperimental = require('./utils/change-drafts-import-to-experimental'); + +const renameDraftsToExperimental = (project) => { + const sourceFiles = project.getSourceFiles(); + + sourceFiles.forEach((sourceFile) => { + try { + sourceFile + .getDescendantsOfKind(SyntaxKind.ImportDeclaration) + .forEach((declaration) => { + declaration = changeDraftsImportToExperimental(declaration); + }); + + // save source back to file + sourceFile.saveSync(); + } catch (error) { + console.log(error); + } + }); +}; + +module.exports = renameDraftsToExperimental; diff --git a/src/use-deprecated-dialog.js b/src/use-deprecated-dialog.js new file mode 100644 index 0000000..5b5c871 --- /dev/null +++ b/src/use-deprecated-dialog.js @@ -0,0 +1,10 @@ +const deprecateComponent = require('./utils/deprecate-component'); + +const componentImportNames = ['Dialog', 'DialogProps, DialogHeaderProps']; +const fileName = 'Dialog'; + +const transform = (project) => { + deprecateComponent(project, componentImportNames, fileName); +}; + +module.exports = transform; diff --git a/src/use-deprecated-octicon.js b/src/use-deprecated-octicon.js new file mode 100644 index 0000000..ccb47a0 --- /dev/null +++ b/src/use-deprecated-octicon.js @@ -0,0 +1,10 @@ +const deprecateComponent = require('./utils/deprecate-component'); + +const componentImportNames = ['Octicon', 'OcticonProps']; +const fileName = 'Octicon'; + +const transform = (project) => { + deprecateComponent(project, componentImportNames, fileName); +}; + +module.exports = transform; diff --git a/src/use-deprecated-pagehead.js b/src/use-deprecated-pagehead.js new file mode 100644 index 0000000..3d6dcae --- /dev/null +++ b/src/use-deprecated-pagehead.js @@ -0,0 +1,10 @@ +const deprecateComponent = require('./utils/deprecate-component'); + +const componentImportNames = ['Pagehead', 'PageheadProps']; +const fileName = 'Pagehead'; + +const transform = (project) => { + deprecateComponent(project, componentImportNames, fileName); +}; + +module.exports = transform; diff --git a/src/use-deprecated-tabnav.js b/src/use-deprecated-tabnav.js new file mode 100644 index 0000000..967c5db --- /dev/null +++ b/src/use-deprecated-tabnav.js @@ -0,0 +1,10 @@ +const deprecateComponent = require('./utils/deprecate-component'); + +const componentImportNames = ['TabNav', 'TabNavProps', 'TabNavLinkProps']; +const fileName = 'TabNav'; + +const transform = (project) => { + deprecateComponent(project, componentImportNames, fileName); +}; + +module.exports = transform; diff --git a/src/use-deprecated-tooltip.js b/src/use-deprecated-tooltip.js new file mode 100644 index 0000000..0fdaa2d --- /dev/null +++ b/src/use-deprecated-tooltip.js @@ -0,0 +1,10 @@ +const deprecateComponent = require('./utils/deprecate-component'); + +const componentImportNames = ['Tooltip', 'TooltipProps']; +const fileName = 'Tooltip'; + +const transform = (project) => { + deprecateComponent(project, componentImportNames, fileName); +}; + +module.exports = transform; diff --git a/src/use-main-dialog.js b/src/use-main-dialog.js new file mode 100644 index 0000000..0421cb8 --- /dev/null +++ b/src/use-main-dialog.js @@ -0,0 +1,32 @@ +const promoteExperimentalComponent = require('./utils/promote-experimental-component'); +const promoteDraftsComponent = require('./utils/promote-drafts-component'); + +const componentImportNames = [ + 'Dialog', + 'DialogProps', + 'DialogHeaderProps', + 'DialogButtonProps', + 'DialogWidth', + 'DialogHeight' +]; +const experimentalFileName = 'Dialog/Dialog'; +const newFileName = 'Dialog/Dialog'; + +const transform = (project) => { + declaration = promoteExperimentalComponent( + project, + componentImportNames, + experimentalFileName, + newFileName + ); + + // for backward compatibility with drafts, don't need this after v37 + declaration = promoteDraftsComponent( + project, + componentImportNames, + experimentalFileName, + newFileName + ); +}; + +module.exports = transform; diff --git a/src/use-main-stack.js b/src/use-main-stack.js new file mode 100644 index 0000000..29db13f --- /dev/null +++ b/src/use-main-stack.js @@ -0,0 +1,25 @@ +const promoteExperimentalComponent = require('./utils/promote-experimental-component'); +const promoteDraftsComponent = require('./utils/promote-drafts-component'); + +const componentImportNames = ['Stack', 'StackProps', 'StackItemProps']; +const experimentalFileName = 'Stack'; +const newFileName = 'Stack'; + +const transform = (project) => { + declaration = promoteExperimentalComponent( + project, + componentImportNames, + experimentalFileName, + newFileName + ); + + // for backward compatibility with drafts, don't need this after v37 + declaration = promoteDraftsComponent( + project, + componentImportNames, + experimentalFileName, + newFileName + ); +}; + +module.exports = transform; diff --git a/src/use-main-tooltip.js b/src/use-main-tooltip.js new file mode 100644 index 0000000..e76fbb5 --- /dev/null +++ b/src/use-main-tooltip.js @@ -0,0 +1,25 @@ +const promoteExperimentalComponent = require('./utils/promote-experimental-component'); +const promoteDraftsComponent = require('./utils/promote-drafts-component'); + +const componentImportNames = ['Tooltip', 'TooltipProps']; +const experimentalFileName = 'TooltipV2'; +const newFileName = 'TooltipV2'; + +const transform = (project) => { + declaration = promoteExperimentalComponent( + project, + componentImportNames, + experimentalFileName, + newFileName + ); + + // for backward compatibility with drafts, don't need this after v37 + declaration = promoteDraftsComponent( + project, + componentImportNames, + experimentalFileName, + newFileName + ); +}; + +module.exports = transform; diff --git a/src/utils/change-drafts-import-to-experimental.js b/src/utils/change-drafts-import-to-experimental.js new file mode 100644 index 0000000..ff31576 --- /dev/null +++ b/src/utils/change-drafts-import-to-experimental.js @@ -0,0 +1,33 @@ +const { convertToStringLiteral } = require('./string-literal'); + +const updateImportDeclaration = (declaration) => { + /** import { ... } from '....' + * importClause moduleSpecifier + */ + const moduleSpecifier = declaration.getModuleSpecifier().getText(); + + // import { ... } from '@primer/react/drafts' + /** import { PageLayout, Button, ActioLiist } from '@primer/react/drafts' + * [ nameBindings ] + */ + if (moduleSpecifier === '@primer/react/drafts') { + declaration.setModuleSpecifier('@primer/react/experimental'); + return declaration; + } + + // import ... from '@primer/react/lib-esm/*' + if ( + moduleSpecifier.includes('lib-esm/drafts/') || + moduleSpecifier.includes('lib/drafts/') + ) { + const newModuleSpecifier = moduleSpecifier + .replace('lib-esm/drafts/', 'lib-esm/experimental/') + .replace('lib/drafts/', 'lib/experimental/'); + + // have to remove quotes from string + declaration.setModuleSpecifier(convertToStringLiteral(newModuleSpecifier)); + return declaration; + } +}; + +module.exports = updateImportDeclaration; diff --git a/src/utils/change-experimental-import-to-main.js b/src/utils/change-experimental-import-to-main.js new file mode 100644 index 0000000..3125b9d --- /dev/null +++ b/src/utils/change-experimental-import-to-main.js @@ -0,0 +1,89 @@ +const { convertToStringLiteral } = require('./string-literal'); + +const updateImportDeclaration = ( + declaration, + sourceFile, + componentImportNames, + experimentalFileName, + newFileName +) => { + /** import { ... } from '....' + * importClause moduleSpecifier + */ + const moduleSpecifier = declaration.getModuleSpecifier().getText(); + + // import ... from '@primer/react...' + const isPrimerReact = moduleSpecifier.includes('@primer/react'); + if (!isPrimerReact) return declaration; + + // import ... from '@primer/react/lib-esm/*' + if ( + moduleSpecifier.includes('lib-esm/experimental/' + experimentalFileName) || + moduleSpecifier.includes('lib/experimental/' + experimentalFileName) || + moduleSpecifier.includes('lib-esm/' + experimentalFileName) || + moduleSpecifier.includes('lib/' + experimentalFileName) + ) { + const newModuleSpecifier = moduleSpecifier + .replace('lib-esm/experimental/', 'lib-esm/') + .replace('lib/experimental/', 'lib/') + .replace(experimentalFileName, newFileName); + // have to remove quotes from string + declaration.setModuleSpecifier(convertToStringLiteral(newModuleSpecifier)); + return declaration; + } + + // if it isn't experimental, skip + if (!moduleSpecifier.includes('experimental')) return declaration; + + const importClause = declaration.getImportClause(); + + // import { ... } from '@primer/react/experimental' + /** import { PageLayout, Button, ActioLiist } from '@primer/react' + * [ nameBindings ] + */ + const nameBindings = importClause.getNamedBindings(); + + if (nameBindings) { + // nameBindings is array of elements + const elements = nameBindings.getElements(); + + const componentElements = elements.filter((element) => { + const importName = element.getName(); + return componentImportNames.includes(importName); + }); + + // if there are no componnent imports in this import, skip this import + if (componentElements.length === 0) return declaration; + + // only experimental component in this import + if (elements.length === componentElements.length) { + declaration.setModuleSpecifier('@primer/react'); + return declaration; + } + + // mixed imports: import {Button, TextInput} from '@primer/react' + // we need to split the import statement + const componentElementNames = componentElements.map((element) => + element.getName() + ); + const otherElementNames = elements + .filter((element) => !componentImportNames.includes(element.getName())) + .map((element) => element.getFullText().trim()); + + // reset imports and add non-deprecated imports back + declaration.removeNamedImports().addNamedImports(otherElementNames); + + // create new import declaration for deprecated component on the next line + sourceFile.insertImportDeclaration(declaration.getChildIndex() + 1, { + moduleSpecifier: '@primer/react', + namedImports: componentElementNames + }); + return declaration; + } + + // if there is an unhandled import statement that makes it till the end + console.log('skipping unhandled import', declaration.getFullText()); + return declaration; +}; + +module.exports = updateImportDeclaration; diff --git a/src/utils/promote-experimental-component.js b/src/utils/promote-experimental-component.js new file mode 100644 index 0000000..132cc73 --- /dev/null +++ b/src/utils/promote-experimental-component.js @@ -0,0 +1,34 @@ +const { SyntaxKind } = require('ts-morph'); +const updateImportDeclaration = require('./change-experimental-import-to-main'); + +const promoteExperimentalComponent = ( + project, + componentImportNames, + experimentalFileName, + newFileName +) => { + const sourceFiles = project.getSourceFiles(); + + sourceFiles.forEach((sourceFile) => { + try { + sourceFile + .getDescendantsOfKind(SyntaxKind.ImportDeclaration) + .forEach((declaration) => { + declaration = updateImportDeclaration( + declaration, + sourceFile, + componentImportNames, + experimentalFileName, + newFileName + ); + }); + + // save source back to file + sourceFile.saveSync(); + } catch (error) { + console.log(error); + } + }); +}; + +module.exports = promoteExperimentalComponent;