index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/icons/WholesaleMajor.svg
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M15 4.25a.75.75 0 0 0-1.5 0v3.98l-.8-2.001a2.75 2.75 0 0 0-2.554-1.729h-3.396a.75.75 0 0 0-.75.75v3.25h-1.75a.75.75 0 0 0-.75.75v3.159a2.5 2.5 0 1 0 4.636 1.841h2.479a2.501 2.501 0 0 0 4.835-1.25h1.8a.75.75 0 0 0 0-1.5h-2.25v-7.25Z...
8,900
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/icons/WholesaleMajor.yml
name: Wholesale set: major description: Used to represent a forklift or equipment used in a warehouse. keywords: - forklift - lift - delivery - warehouse authors: - Adam Whitcroft - Joe Thomas version: 1 date_added: 2019-03-15 date_modified: 2023-06-23 exclusive_use:
8,901
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/icons/WifiMajor.svg
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.25 7.218a.75.75 0 0 0 1.06 1.06 9.5 9.5 0 0 1 13.435 0 .75.75 0 1 0 1.061-1.06c-4.296-4.296-11.26-4.296-15.556 0Z" fill="#5C5F62"/><path d="M4.725 10.753a.75.75 0 0 1 0-1.06 7.5 7.5 0 0 1 10.606 0 .75.75 0 1 1-1.06 1.06 6 6 0 0 0-8.486 0 .75.75 0 0...
8,902
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/icons/WifiMajor.yml
name: Wifi set: major description: N/A keywords: - N/A authors: - N/A - Joe Thomas version: 1 date_added: 2019-03-15 date_modified: 2023-06-23 exclusive_use:
8,903
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/icons/YoutubeMinor.svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="#5C5F62" d="M16.86 7s-.14-.97-.56-1.4c-.53-.56-1.13-.56-1.4-.6-1.96-.14-4.9-.14-4.9-.14s-2.94 0-4.9.14c-.28.04-.87.04-1.4.6-.43.43-.56 1.4-.56 1.4s-.14 1.14-.14 2.28v1.07c0 1.14.14 2.28.14 2.28s.14.98.55 1.4c.54.56 1.24.55 1.55.6 1.12.11 4.76.15 4....
8,904
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/icons/YoutubeMinor.yml
name: Youtube set: minor description: Used to represent Youtube. keywords: - Youtube - social media authors: - Joe Thomas version: 1 date_added: 2023-07-20 date_modified: 2023-07-28 exclusive_use:
8,905
0
petrpan-code/Shopify/polaris/polaris-icons/icons
petrpan-code/Shopify/polaris/polaris-icons/icons/ICON_TEMPLATES/IconNameSet.svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="#5C5F62" d=""/></svg>
8,906
0
petrpan-code/Shopify/polaris/polaris-icons/icons
petrpan-code/Shopify/polaris/polaris-icons/icons/ICON_TEMPLATES/IconNameSet.yml
name: Name of the icon set: major or minor description: # Icon type | Example description # ----------- | -------------------------- # Action | Used to denote <x action>. # Wayfinding | Used to help direct merchants to <x>. # Concept | Used to represent <x>. # Education | Used to give merchant...
8,907
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/tests/validate-data-pairs.test.js
const path = require('path'); const globby = require('globby'); const iconBasePath = path.resolve(__dirname, '../icons'); const allSVGs = globby .sync('*.svg', { cwd: iconBasePath, }) .map((filename) => path.basename(filename)); const allYMLs = globby .sync('*.yml', { cwd: iconBasePath, }) .map(...
8,908
0
petrpan-code/Shopify/polaris/polaris-icons
petrpan-code/Shopify/polaris/polaris-icons/tests/validate-svg-content.test.js
const fs = require('fs'); const path = require('path'); const globby = require('globby'); const unified = require('unified'); const parse = require('rehype-parse'); const {select, selectAll} = require('hast-util-select'); const nameRegex = /(?<=)(Major|Minor)(?=\.svg)/; const configPerSet = new Map([ ['Major', {vi...
8,909
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/CHANGELOG.md
# @shopify/polaris-migrator ## 0.26.3 ### Patch Changes - Updated dependencies [[`23055adcf`](https://github.com/Shopify/polaris/commit/23055adcfa97decbfbc51924bd121d1dae76ac6f)]: - @shopify/polaris-tokens@8.1.0 - @shopify/stylelint-polaris@15.0.3 ## 0.26.2 ### Patch Changes - [#11029](https://github.com/Shop...
8,910
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/README.md
# [Polaris Migrator](https://polaris.shopify.com/docs/advanced-features) [![npm version](https://img.shields.io/npm/v/@shopify/polaris-migrator.svg?style=flat)](https://www.npmjs.com/package/@shopify/polaris-migrator) Codemod transformations to help upgrade your Polaris codebase. [Polaris migrator documentation](htt...
8,911
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/codeshift.config.js
function resolve(transform) { return require.resolve(`./dist/cjs/migrations/${transform}/transform`); } module.exports = { presets: { 'react-rename-component': resolve('react-rename-component'), 'react-rename-component-prop': resolve('react-rename-component-prop'), 'scss-remove-unused-at-use': resolve(...
8,912
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/jest.config.js
module.exports = { transform: { '\\.(js|tsx?)$': [ 'babel-jest', {targets: 'current node', envName: 'test', rootMode: 'upward'}, ], }, };
8,913
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/package.json
{ "name": "@shopify/polaris-migrator", "version": "0.26.3", "description": "Codemod transformations to help upgrade your Polaris codebase", "license": "SEE LICENSE IN LICENSE.md", "author": "Shopify <dev@shopify.com>", "homepage": "https://polaris.shopify.com", "repository": "https://github.com/Shopify/po...
8,914
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/plopfile.mjs
import * as fs from 'fs'; import * as url from 'url'; import * as path from 'path'; import {plopDir} from 'plop-dir'; const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); /** @param {import('plop').NodePlopAPI} plop */ // eslint-disable-next-line import/no-default-export export default async function ...
8,915
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/rollup.config.mjs
import * as fs from 'fs'; import * as path from 'path'; import * as url from 'url'; import {babel} from '@rollup/plugin-babel'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import globby from 'globby'; const __dirname ...
8,916
0
petrpan-code/Shopify/polaris
petrpan-code/Shopify/polaris/polaris-migrator/tsconfig.json
{ "extends": "@shopify/typescript-configs/node-base", "compilerOptions": { "module": "commonjs", "composite": true, "emitDeclarationOnly": true, "outDir": "dist/types", "rootDir": "src", "jsx": "react", "types": ["node", "jest"] }, "include": ["src"], "exclude": ["node_modules", "d...
8,917
0
petrpan-code/Shopify/polaris/polaris-migrator
petrpan-code/Shopify/polaris/polaris-migrator/bin/migrator-cli.js
#!/usr/bin/env node const {run} = require('./../dist/cjs'); run();
8,918
0
petrpan-code/Shopify/polaris/polaris-migrator
petrpan-code/Shopify/polaris/polaris-migrator/src/cli.ts
import type {Exact} from 'type-fest'; import meow from 'meow'; import type {AnyFlag} from 'meow'; import {migrate} from './migrate'; import type {Alias} from './utilities/types'; import type {MigrateOptions} from './migrate'; interface Arg { name: string; description: string; } interface Flag { type: 'boolean'...
8,919
0
petrpan-code/Shopify/polaris/polaris-migrator
petrpan-code/Shopify/polaris/polaris-migrator/src/index.ts
export {run, cliConfig} from './cli'; export type {CLIConfig} from './cli'; export {migrate} from './migrate'; export type {MigrateOptions} from './migrate';
8,920
0
petrpan-code/Shopify/polaris/polaris-migrator
petrpan-code/Shopify/polaris/polaris-migrator/src/migrate.ts
import fs from 'fs'; import path from 'path'; // @ts-expect-error TS can't resolve the type of this import import * as jscodeshift from 'jscodeshift/src/Runner'; import chalk from 'chalk'; import isGitClean from 'is-git-clean'; import globby from 'globby'; export interface MigrateOptions { dry?: boolean; print?: ...
8,921
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/transform.ts
import type {API, FileInfo, Options} from 'jscodeshift'; import {renameProps} from '../../utilities/jsx'; export default function transformer( file: FileInfo, {jscodeshift: j}: API, options: Options, ) { const componentParts = options.componentName?.split('.'); const {componentName, from, to, fromValue, toV...
8,922
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop-with-boolean.input.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; export function App() { return ( <MyComponent foo="bar" booleanProp> Hello world </MyComponent> ); }
8,923
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop-with-boolean.output.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; export function App() { return ( <MyComponent foo="bar" variant="boolean-prop-value"> Hello world </MyComponent> ); }
8,924
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop-with-new-value.input.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; export function App() { return ( <MyComponent prop="value"> Hello <Child prop="value" /> </MyComponent> ); }
8,925
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop-with-new-value.output.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; export function App() { return ( <MyComponent newProp="new-value"> Hello <Child prop="value" /> </MyComponent> ); }
8,926
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop-with-specific-value.input.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; export function App() { return ( <> <MyComponent foo="bar" prop="non-targeted-value"> Hello world </MyComponent> <MyComponent foo="bar" prop="targeted-value"> Hello world </MyComponent> ...
8,927
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop-with-specific-value.output.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; export function App() { return ( <> <MyComponent foo="bar" variant="non-targeted-value"> Hello world </MyComponent> <MyComponent foo="bar" variant="new-targeted-value"> Hello world </MyCompo...
8,928
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop.input.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; export function App() { return ( <MyComponent prop="value" foo="bar"> Hello <Child prop="value" /> </MyComponent> ); }
8,929
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-component-prop.output.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; export function App() { return ( <MyComponent newProp="value" foo="bar"> Hello <Child prop="value" /> </MyComponent> ); }
8,930
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-compound-component-prop-with-new-value.input.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; declare function CompoundComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; MyComponent.CompoundComponent = CompoundComponent; export function App() { return ( <MyComponent> <MyComponent.Co...
8,931
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/react-rename-compound-component-prop-with-new-value.output.tsx
import React from 'react'; declare function MyComponent(props: any): JSX.Element; declare function CompoundComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; MyComponent.CompoundComponent = CompoundComponent; export function App() { return ( <MyComponent> <MyComponent.Co...
8,932
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component-prop/tests/transform.test.ts
import {check} from '../../../utilities/check'; const transform = 'react-rename-component-prop'; const fixtures = [ { name: 'react-rename-component-prop', options: { componentName: 'MyComponent', from: 'prop', to: 'newProp', }, }, { name: 'react-rename-component-prop-with-new-va...
8,933
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/transform.ts
import type {API, FileInfo, Options} from 'jscodeshift'; import {POLARIS_MIGRATOR_COMMENT} from '../../utilities/constants'; import { getImportSpecifierName, hasImportDeclaration, hasImportSpecifier, hasImportSpecifiers, insertImportDeclaration, insertImportSpecifier, normalizeImportSourcePaths, remove...
8,934
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/react-rename-component.input.tsx
import React from 'react'; import {Card} from '@shopify/polaris'; const MyCard = Card; export function App() { return ( <> <div className={styles.Card}>hello</div> <Card>hello</Card> <MyCard>hello</MyCard> <Card content="hello" /> <Card> <Card.Header title="hello" /> ...
8,935
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/react-rename-component.output.tsx
import React from 'react'; import {LegacyCard} from '@shopify/polaris'; const MyCard = LegacyCard; export function App() { return ( <> <div className={styles.Card}>hello</div> <LegacyCard>hello</LegacyCard> <MyCard>hello</MyCard> <LegacyCard content="hello" /> <LegacyCard> ...
8,936
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/react-rename-stack-component.input.tsx
import React from 'react'; import {Stack} from '@shopify/polaris'; const MyStack = Stack; export function App() { return ( <> <div className={styles.Stack}>hello</div> <Stack>hello</Stack> <MyStack>hello</MyStack> <Stack> <Stack.Header>hello</Stack.Header> <Stack.Section>...
8,937
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/react-rename-stack-component.output.tsx
import React from 'react'; import {LegacyStack} from '@shopify/polaris'; const MyStack = LegacyStack; export function App() { return ( <> <div className={styles.Stack}>hello</div> <LegacyStack>hello</LegacyStack> <MyStack>hello</MyStack> <LegacyStack> <LegacyStack.Header>hello</L...
8,938
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/rename-prop-types.input.tsx
import React from 'react'; import type {CardProps} from '@shopify/polaris'; export interface MyCardProps extends CardProps {}
8,939
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/rename-prop-types.output.tsx
import React from 'react'; import type {LegacyCardProps} from '@shopify/polaris'; export interface MyCardProps extends LegacyCardProps {}
8,940
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/renamed-available-identifier.input.tsx
import React from 'react'; import {Card as PolarisCard} from '@shopify/polaris'; const MyCard = PolarisCard; export const LegacyCard = () => null; export function App() { return ( <> <PolarisCard>hello</PolarisCard> <MyCard>hello</MyCard> </> ); }
8,941
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/renamed-available-identifier.output.tsx
import React from 'react'; import {Card as PolarisCard} from '@shopify/polaris'; const MyCard = PolarisCard; export const /* polaris-migrator: Unable to migrate the following expression. Please upgrade manually. */ LegacyCard = () => null; export function App() { return ( <> <PolarisCard>hello</PolarisC...
8,942
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/renamed-available-jsx.input.tsx
import React from 'react'; import {Card as PolarisCard} from '@shopify/polaris'; const MyCard = PolarisCard; const Card = () => null; const LegacyCard = () => null; export function App() { return ( <> <PolarisCard>hello</PolarisCard> <MyCard>hello</MyCard> <Card>local</Card> <LegacyCard>...
8,943
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/renamed-available-jsx.output.tsx
import React from 'react'; import {Card as PolarisCard} from '@shopify/polaris'; const MyCard = PolarisCard; const Card = () => null; const LegacyCard = () => null; export function App() { return ( <> <PolarisCard>hello</PolarisCard> <MyCard>hello</MyCard> <Card>local</Card> {/* polaris-...
8,944
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/renamed-import.input.tsx
import React from 'react'; import {Card as PolarisCard} from '@shopify/polaris'; const MyCard = PolarisCard; export function App() { return ( <> <PolarisCard>hello</PolarisCard> <MyCard>hello</MyCard> </> ); }
8,945
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/renamed-import.output.tsx
import React from 'react'; import {LegacyCard} from '@shopify/polaris'; const MyCard = LegacyCard; export function App() { return ( <> <LegacyCard>hello</LegacyCard> <MyCard>hello</MyCard> </> ); }
8,946
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-rename-component/tests/transform.test.ts
import {check} from '../../../utilities/check'; const transform = 'react-rename-component'; const fixtures = [ { name: 'react-rename-component', options: { relative: false, renameFrom: 'Card', renameTo: 'LegacyCard', renamePropsFrom: 'CardProps', renamePropsTo: 'LegacyCardProps'...
8,947
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/transform.ts
import type { API, FileInfo, JSXAttribute, JSXOpeningElement, Options, } from 'jscodeshift'; import {insertCommentBefore, insertJSXComment} from '../../utilities/jsx'; import {POLARIS_MIGRATOR_COMMENT} from '../../utilities/constants'; import { getImportSpecifierName, hasImportDeclaration, hasImportSpe...
8,948
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/basic.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare function Child(props: any): JSX.Element; const MyComponentWrapper = MyComponent; export function App() { return ( <MyComponent prop="value" foo="bar"> Hello <Child prop="value" /> <MyComponent...
8,949
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/basic.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare function Child(props: any): JSX.Element; const MyComponentWrapper = /* polaris-migrator: Unable to migrate the following expression. Please upgrade manually. */ MyComponent; export function App() { return ( ...
8,950
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/compound-component-nested-with-new-value.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent as MyPolarisComponent} from '@shopify/polaris'; declare function CompoundComponent(props: any): JSX.Element; declare function Nested(props: any): JSX.Element; declare function Child(props: any): JSX.Element; MyPolarisComponent.CompoundComponent = Comp...
8,951
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/compound-component-nested-with-new-value.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent as MyPolarisComponent} from '@shopify/polaris'; declare function CompoundComponent(props: any): JSX.Element; declare function Nested(props: any): JSX.Element; declare function Child(props: any): JSX.Element; MyPolarisComponent.CompoundComponent = Comp...
8,952
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/compound-component-with-new-value.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent as MyPolarisComponent} from '@shopify/polaris'; declare function CompoundComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; MyPolarisComponent.CompoundComponent = CompoundComponent; export function App() { return (...
8,953
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/compound-component-with-new-value.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent as MyPolarisComponent} from '@shopify/polaris'; declare function CompoundComponent(props: any): JSX.Element; declare function Child(props: any): JSX.Element; MyPolarisComponent.CompoundComponent = CompoundComponent; export function App() { return (...
8,954
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/transform.test.ts
import {check} from '../../../utilities/check'; const transform = 'react-update-component-prop'; const fixtures = [ { name: 'basic', options: { componentName: 'MyComponent', fromProp: 'prop', toProp: 'newProp', }, }, { name: 'with-new-value', options: { componentName: ...
8,955
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-boolean.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; export function App() { return ( <MyComponent foo="bar" booleanProp> Hello world </MyComponent> ); }
8,956
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-boolean.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; export function App() { return ( <MyComponent foo="bar" variant="boolean-prop-value"> Hello world </MyComponent> ); }
8,957
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-comments-boolean-prop.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare const mySpreadProps: {[key: string]: any}; declare const myProp: boolean; export function App() { return ( <> <MyComponent foo="bar" booleanProp> Hello world </MyComponent> <MyComponent...
8,958
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-comments-boolean-prop.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare const mySpreadProps: {[key: string]: any}; declare const myProp: boolean; export function App() { return ( <> <MyComponent foo="bar" newProp="new-value"> Hello world </MyComponent> {/* ...
8,959
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-comments-string-prop.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare const mySpreadProps: {[key: string]: any}; declare const myProp: string; export function App() { return ( <> <MyComponent foo="bar" prop="value"> Hello world </MyComponent> <MyComponent...
8,960
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-comments-string-prop.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare const mySpreadProps: {[key: string]: any}; declare const myProp: string; export function App() { return ( <> <MyComponent foo="bar" newProp="new-value"> Hello world </MyComponent> {/* p...
8,961
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-new-value.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare function Child(props: any): JSX.Element; export function App() { return ( <MyComponent prop="value"> Hello <Child prop="value" /> </MyComponent> ); }
8,962
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-new-value.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; declare function Child(props: any): JSX.Element; export function App() { return ( <MyComponent newProp="new-value"> Hello <Child prop="value" /> </MyComponent> ); }
8,963
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-specific-value.input.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; export function App() { return ( <> <MyComponent foo="bar" prop="non-targeted-value"> Hello world </MyComponent> <MyComponent foo="bar" prop="targeted-value"> Hello world </MyCompo...
8,964
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/react-update-component-prop/tests/with-specific-value.output.tsx
import React from 'react'; // @ts-expect-error import {MyComponent} from '@shopify/polaris'; export function App() { return ( <> <MyComponent foo="bar" prop="non-targeted-value"> Hello world </MyComponent> <MyComponent foo="bar" variant="new-targeted-value"> Hello world </...
8,965
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/transform.ts
import type {FileInfo, API, Options} from 'jscodeshift'; import postcss from 'postcss'; import type {Plugin} from 'postcss'; import {createInlineComment} from '../../utilities/sass'; import {POLARIS_MIGRATOR_COMMENT} from '../../utilities/constants'; import {matchesStringOrRegExp} from '../../utilities/matches'; inte...
8,966
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/scss-remove-unused-at-use.input.scss
@use 'global-styles/legacy-polaris-v8'; @use './styles/overrides'; .BaseCase { padding: 1rem; }
8,967
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/scss-remove-unused-at-use.output.scss
@use './styles/overrides'; .BaseCase { padding: 1rem; }
8,968
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/transform.test.ts
import {check} from '../../../utilities/check'; const transform = 'scss-remove-unused-at-use'; const fixtures = [ 'scss-remove-unused-at-use', 'with-used-at-use', 'with-at-use-namespace', 'with-used-at-use-namespace', 'with-options', 'with-configuration', ]; for (const fixture of fixtures) { check(__dir...
8,969
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-at-use-namespace.input.scss
@use 'global-styles/legacy-polaris-v8' as legacy; .BaseCase { padding: 1rem; }
8,970
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-at-use-namespace.output.scss
.BaseCase { padding: 1rem; }
8,971
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-configuration.input.scss
@use 'global-styles/legacy-polaris-v8' as v8 with ( $var1: 1px, $var2: 2px ); .BaseCase { padding: 16px; }
8,972
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-configuration.output.scss
.BaseCase { padding: 16px; }
8,973
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-options.input.scss
@use 'media-queries'; .BaseCase { padding: 1rem; }
8,974
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-options.output.scss
.BaseCase { padding: 1rem; }
8,975
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-used-at-use-namespace.input.scss
@use 'global-styles/legacy-polaris-v8' as legacy; .BaseCase { padding: legacy.rem(1rem); }
8,976
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-used-at-use-namespace.output.scss
@use 'global-styles/legacy-polaris-v8' as legacy; .BaseCase { padding: legacy.rem(1rem); }
8,977
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-used-at-use.input.scss
@use 'global-styles/legacy-polaris-v8'; .BaseCase { padding: legacy-polaris-v8.rem(16px); }
8,978
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/scss-remove-unused-at-use/tests/with-used-at-use.output.scss
@use 'global-styles/legacy-polaris-v8'; .BaseCase { padding: legacy-polaris-v8.rem(16px); }
8,979
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable/transform.ts
import os from 'os'; import type {API, FileInfo, Options} from 'jscodeshift'; import type {Node, Comment, Plugin, Root} from 'postcss'; import postcss from 'postcss'; import type {StylelintPostcssResult} from 'stylelint'; import stylelint from 'stylelint'; const crossPlatformNewlineRegExp = /\r\n?|\n/; const polarisC...
8,980
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable/tests/styles-insert-stylelint-disable.input.scss
@import 'styles/common'; $no-extra-newlines-above-this: 1rem; .BaseCase { padding: 1rem; } .NoInsert { padding: var(--p-space-4); } .ExistingDisableComment { // stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY padding: 1rem; } .Nested { .Keeps { .Spacing { padding: 1rem;...
8,981
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable/tests/styles-insert-stylelint-disable.output.scss
@import 'styles/common'; // stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY $no-extra-newlines-above-this: 1rem; .BaseCase { // stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY padding: 1rem; } .NoInsert { padding: var(--p-space-4); } .ExistingDisableComment { ...
8,982
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable/tests/test-config.js
const path = require('path'); module.exports = { customSyntax: 'postcss-scss', reportDescriptionlessDisables: true, plugins: [ path.join( __dirname, '../../../../../stylelint-polaris/plugins/at-rule-disallowed-list', ), ], rules: { 'unit-disallowed-list': ['rem'], 'selector-pseudo...
8,983
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-insert-stylelint-disable/tests/transform.test.ts
import path from 'path'; import {check} from '../../../utilities/check'; const transform = 'styles-insert-stylelint-disable'; const fixtures = ['styles-insert-stylelint-disable']; for (const fixture of fixtures) { check(__dirname, { fixture, transform, extension: 'scss', options: { config: pa...
8,984
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/transform.ts
import path from 'path'; import type {FileInfo, API, Options} from 'jscodeshift'; import type {Plugin} from 'postcss'; import postcss from 'postcss'; import valueParser from 'postcss-value-parser'; import {isSassFunction} from '../../utilities/sass'; import {isKeyOf} from '../../utilities/types'; import {matchesStrin...
8,985
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/replacement-maps.js
const colorMap = { '--p-text': '--p-color-text', '--p-black': '#000', }; const durationMap = { '--p-duration-200': '--p-motion-duration-200', '--p-fast': '100ms', }; // eslint-disable-next-line import/no-anonymous-default-export, import/no-default-export export default { color: colorMap, '/^animation/': d...
8,986
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/transform.test.ts
import {check} from '../../../utilities/check'; const transform = 'styles-replace-custom-property'; const fixtures = [ { name: 'with-from-to-flags-basic', options: { decl: 'color', from: '--p-text', to: '--p-color-text', }, }, { name: 'with-from-to-flags-regexp', options: { ...
8,987
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-from-to-flags-basic.input.scss
.basic { color: var(--p-text); } .with-fallback-var { color: var(--p-text, var(--p-text)); } .with-fallback-value { color: var(--p-text, #000); }
8,988
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-from-to-flags-basic.output.scss
.basic { color: var(--p-color-text); } .with-fallback-var { color: var(--p-color-text, var(--p-color-text)); } .with-fallback-value { color: var(--p-color-text, #000); }
8,989
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-from-to-flags-regexp.input.scss
.basic { animation-duration: var(--p-duration-200); animation-delay: var(--p-duration-200); } .with-fallback-var { animation-duration: var(--p-duration-200, var(--p-duration-200)); animation-delay: var(--p-duration-200, var(--p-duration-200)); } .with-fallback-value { animation-duration: var(--p-duration-20...
8,990
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-from-to-flags-regexp.output.scss
.basic { animation-duration: var(--p-motion-duration-200); animation-delay: var(--p-motion-duration-200); } .with-fallback-var { animation-duration: var( --p-motion-duration-200, var(--p-motion-duration-200) ); animation-delay: var(--p-motion-duration-200, var(--p-motion-duration-200)); } .with-fall...
8,991
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-maps-flag.input.scss
.basic { color: var(--p-text); color: var(--p-black); animation-duration: var(--p-duration-200); animation-delay: var(--p-fast); } .with-fallback-var { color: var(--p-text, var(--p-text)); color: var(--p-text, var(--p-black)); color: var(--p-black, var(--p-text)); animation-duration: var(--p-duration...
8,992
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-maps-flag.output.scss
.basic { color: var(--p-color-text); color: #000; animation-duration: var(--p-motion-duration-200); animation-delay: 100ms; } .with-fallback-var { color: var(--p-color-text, var(--p-color-text)); color: var(--p-color-text, #000); color: #000; animation-duration: var( --p-motion-duration-200, ...
8,993
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-replacementMaps-option.input.scss
.basic { color: var(--p-text); } .with-fallback-var { color: var(--p-text, var(--p-text)); } .with-fallback-value { color: var(--p-text, #000); }
8,994
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/styles-replace-custom-property/tests/with-replacementMaps-option.output.scss
.basic { color: var(--p-color-text); } .with-fallback-var { color: var(--p-color-text, var(--p-color-text)); } .with-fallback-value { color: var(--p-color-text, #000); }
8,995
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components/transform.ts
import type {API, FileInfo, Options} from 'jscodeshift'; import {hasImportDeclaration} from '../../utilities/imports'; import {replaceDisplayText} from './steps/replace-display-text'; import type {components} from './steps/replace-other'; import {replaceOther} from './steps/replace-other'; import {replaceTextStyle} f...
8,996
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components/steps/replace-display-text.ts
import type { ASTNode, Collection, JSCodeshift, JSXOpeningElement, JSXAttribute, } from 'jscodeshift'; import { hasJSXAttribute, replaceJSXElement, replaceJSXAttributes, insertJSXAttribute, insertJSXComment, insertCommentBefore, } from '../../../utilities/jsx'; import {isKeyOf} from '../../../uti...
8,997
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components/steps/replace-other.ts
import type { ASTNode, Collection, JSCodeshift, JSXAttribute, JSXOpeningElement, } from 'jscodeshift'; import { hasJSXAttribute, insertJSXAttribute, insertJSXComment, insertCommentBefore, replaceJSXAttributes, replaceJSXElement, } from '../../../utilities/jsx'; import { getImportSpecifierName, ...
8,998
0
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components
petrpan-code/Shopify/polaris/polaris-migrator/src/migrations/v10-react-replace-text-components/steps/replace-text-style.ts
import type { ASTNode, Collection, JSCodeshift, JSXAttribute, JSXOpeningElement, } from 'jscodeshift'; import { insertCommentBefore, insertJSXAttribute, insertJSXComment, removeJSXAttributes, replaceJSXElement, } from '../../../utilities/jsx'; import { getImportSpecifierName, hasImportSpecifier...
8,999