Skip to content

Commit

Permalink
Revert "Bump globby from 11.0.1 to 14.0.2" (#12360)
Browse files Browse the repository at this point in the history
Reverts #12326
  • Loading branch information
sam-b-rose authored Jul 11, 2024
1 parent f6728a4 commit 2d79644
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 369 deletions.
359 changes: 34 additions & 325 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion polaris-for-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@types/node": "^20.10.0",
"@types/vscode": "^1.64.0",
"globby": "^14.0.2",
"globby": "^11.1.0",
"vsce": "^2.15.0"
}
}
2 changes: 1 addition & 1 deletion polaris-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"homepage": "https://polaris.shopify.com/icons",
"devDependencies": {
"@svgr/core": "^4.3.3",
"globby": "^14.0.2",
"globby": "^11.1.0",
"hast-util-select": "^3.0.0",
"js-yaml": "^4.0.0",
"rehype-parse": "^7.0.1",
Expand Down
4 changes: 2 additions & 2 deletions polaris-icons/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import * as path from 'path';
import {createFilter} from '@rollup/pluginutils';
import {babel} from '@rollup/plugin-babel';
import virtual from '@rollup/plugin-virtual';
import {globbySync} from 'globby';
import globby from 'globby';
import jsYaml from 'js-yaml';
import svgr from '@svgr/core';

const convert = svgr.default;
const iconBasePath = new URL('./icons', import.meta.url).pathname;
const iconPaths = globbySync(path.join(iconBasePath, '*.yml'));
const iconPaths = globby.sync(path.join(iconBasePath, '*.yml'));

const iconExports = [];
const iconTypes = [];
Expand Down
2 changes: 1 addition & 1 deletion polaris-migrator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@shopify/polaris-tokens": "^9.2.0",
"@shopify/stylelint-polaris": "^16.0.3",
"chalk": "^4.1.0",
"globby": "14.0.2",
"globby": "11.0.1",
"is-git-clean": "^1.1.0",
"jscodeshift": "^0.13.1",
"meow": "^9.0.0",
Expand Down
4 changes: 2 additions & 2 deletions polaris-migrator/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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 {globbySync} from 'globby';
import globby from 'globby';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json')));

const extensions = ['.js', '.jsx', '.ts', '.tsx'];

const migrationPaths = globbySync('./src/migrations/*!(tests)/*.ts');
const migrationPaths = globby.sync('./src/migrations/*!(tests)/*.ts');

/** @type {import('rollup').RollupOptions} */
export default {
Expand Down
4 changes: 2 additions & 2 deletions polaris-migrator/src/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';
import * as jscodeshift from 'jscodeshift/src/Runner';
import chalk from 'chalk';
import isGitClean from 'is-git-clean';
import {globbySync} from 'globby';
import globby from 'globby';

export interface MigrateOptions {
dry?: boolean;
Expand Down Expand Up @@ -37,7 +37,7 @@ export async function migrate(
checkGitStatus(options.force);
}

const filepaths = globbySync(files, {cwd: process.cwd()});
const filepaths = globby.sync(files, {cwd: process.cwd()});
if (filepaths.length === 0) {
throw new Error(`No files found for ${files}`);
}
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"change-case": "^3.1.0",
"chromatic": "^6.5.4",
"concurrently": "^8.2.2",
"globby": "^14.0.2",
"globby": "^11.1.0",
"http-server": "^14.1.1",
"js-yaml": "^4.1.0",
"postcss": "^8.3.1",
Expand Down
25 changes: 12 additions & 13 deletions polaris-react/scripts/build-validate.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
const assert = require('assert').strict;
const fs = require('fs');

let globby;
const globby = require('globby');

const packageJSON = require('../package.json');

// Validation to assert the output of the build.
(async () => {
globby = (await import('globby')).globby;
await validateStandardBuild();
validateEsNextBuild();
validateAncillaryOutput();
await validateVersionReplacement();
})();

async function validateStandardBuild() {

validateStandardBuild();
validateEsNextBuild();
validateAncillaryOutput();
validateVersionReplacement();

function validateStandardBuild() {
// Standard build
assert.ok(fs.existsSync('./build/cjs/index.js'));
assert.ok(fs.existsSync('./build/esm/index.js'));
Expand All @@ -22,7 +21,7 @@ async function validateStandardBuild() {
// Assert it uses named exports rather than properties from the React default
// export to help tree-shaking.
// React.createElement and React.Fragment are the allowed exceptions
const files = await globby('./build/cjs/**/*.js');
const files = globby.sync('./build/cjs/**/*.js');
assert.notStrictEqual(files.length, 0);
const filesContainingUnwantedReactUsage = [];
files.forEach((file) => {
Expand Down Expand Up @@ -94,8 +93,8 @@ function validateAncillaryOutput() {
assert.ok(fs.existsSync('./build/ts/src/index.d.ts'));
}

async function validateVersionReplacement() {
const files = await globby('./build/**/*.{js,mjs,esnext,css}');
function validateVersionReplacement() {
const files = globby.sync('./build/**/*.{js,mjs,esnext,css}');

assert.notStrictEqual(files.length, 0);

Expand Down
10 changes: 5 additions & 5 deletions polaris.shopify.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"next-build": "next build",
"create-component": "generact --root src/components src/components/Template/Template.tsx",
"gen-sitemap": "pnpm next-sitemap",
"get-props": "tsx ./scripts/get-props/src/get-props.ts",
"gen-assets": "pnpm get-props && tsx ./scripts/gen-assets.ts",
"gen-colors": "tsx ./scripts/gen-colors.ts",
"get-props": "./scripts/get-props/src/get-props.ts",
"gen-assets": "pnpm get-props && ts-node ./scripts/gen-assets.ts",
"gen-colors": "ts-node ./scripts/gen-colors.ts",
"test": "jest",
"postinstall": "patch-package"
},
Expand Down Expand Up @@ -90,7 +90,7 @@
"frontmatter": "^0.0.3",
"generact": "^0.4.0",
"get-site-urls": "3.0.0-alpha.1",
"globby": "^14.0.2",
"globby": "^11.1.0",
"inter-ui": "3.19.3",
"is-ci": "^3.0.1",
"js-yaml": "^4.1.0",
Expand All @@ -103,7 +103,7 @@
"sass": "^1.49.9",
"satori": "^0.10.11",
"style-loader": "^3.3.1",
"tsx": "4.16.2",
"ts-node": "^10.7.0",
"typescript": "^4.9.3",
"unified": "^10.1.2",
"unist-util-visit": "^4.1.0"
Expand Down
11 changes: 6 additions & 5 deletions polaris.shopify.com/pages/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
} from 'next';
import Link from 'next/link';
import fs from 'fs';
import {globbySync} from 'globby';
import globby from 'globby';
import {metaThemeDefault as tokenGroups} from '@shopify/polaris-tokens';
import mapValues from 'lodash.mapvalues';

Expand Down Expand Up @@ -143,7 +143,7 @@ function makeSerializable<T extends Record<string, any> = Record<string, any>>(
const getRichCards = async (
pathGlob: string,
): Promise<SortedRichCardGridProps[]> => {
const markdownFiles = globbySync(pathGlob, {onlyFiles: true});
const markdownFiles = globby.sync(pathGlob, {onlyFiles: true});

return (
(
Expand Down Expand Up @@ -380,9 +380,10 @@ function fileShouldNotBeRenderedWithCatchAllTemplate(
}

export const getStaticPaths: GetStaticPaths = async () => {
// Recursive search for all markdown files (globby requires posix paths)
// Note: files prefixed with an underscore are ignored
const paths = globbySync(`${contentDir}/**/!(_)*.mdx`)
const paths = globby
// Recursive search for all markdown files (globby requires posix paths)
// Note: files prefixed with an underscore are ignored
.sync(`${contentDir}/**/!(_)*.mdx`)
.map(extractSlugFromPath)
.filter(fileShouldNotBeRenderedWithCatchAllTemplate);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import {globbySync} from 'globby';
import globby from 'globby';
import path from 'path';
import {VFile} from 'vfile';
import type {GetStaticPaths, GetStaticProps} from 'next';
Expand Down Expand Up @@ -178,7 +178,8 @@ export const getStaticProps: GetStaticProps<

export const getStaticPaths: GetStaticPaths = async () => {
const globPath = path.resolve(process.cwd(), 'content/components/**/*.mdx');
const paths = globbySync(globPath)
const paths = globby
.sync(globPath)
.filter((path) => !path.endsWith('index.mdx'))
.map((path) =>
path.replace(`${process.cwd()}/content`, '').replace('.mdx', ''),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {GetStaticProps} from 'next';
import fs from 'fs';
import path from 'path';
import {globbySync} from 'globby';
import globby from 'globby';
import Longform from '../../../../src/components/Longform';
import Markdown from '../../../../src/components/Markdown';
import Page from '../../../../src/components/Page';
Expand Down Expand Up @@ -64,9 +64,9 @@ function indexPageMetadata() {

function ruleListMarkdown(directory: string): string {
const globPath = [`${directory}/*.mdx`];
const rulePagePaths = globbySync(globPath).filter(
(path) => !path.endsWith(`${rulesPath}/index.mdx`),
);
const rulePagePaths = globby
.sync(globPath)
.filter((path) => !path.endsWith(`${rulesPath}/index.mdx`));

const content: {[key: string]: string[]} = {};
rulePagePaths.forEach((markdownFilePath) => {
Expand Down
4 changes: 2 additions & 2 deletions polaris.shopify.com/scripts/change-file-structure.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import path from 'path';
import fs from 'fs';
import {globbySync} from 'globby';
import globby from 'globby';

const pathGlob = path.join(process.cwd(), 'content/**/index.mdx');

const filePaths = globbySync(pathGlob);
const filePaths = globby.sync(pathGlob);

filePaths.forEach((filePath) => {
const segments = filePath.split('/');
Expand Down
2 changes: 1 addition & 1 deletion polaris.shopify.com/scripts/gen-cache-json.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import {globby} from 'globby';
import globby from 'globby';
import {existsSync} from 'fs';
import {mkdir, writeFile, readFile} from 'fs/promises';
import matter from 'gray-matter';
Expand Down
2 changes: 1 addition & 1 deletion polaris.shopify.com/scripts/get-props/src/get-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as ts from 'typescript';
import * as fs from 'fs';
import path from 'path';
import {globby} from 'globby';
import globby from 'globby';
import {Type, FilteredTypes, AllTypes} from '../../../src/types';

type NodeParser = (
Expand Down
10 changes: 9 additions & 1 deletion polaris.shopify.com/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,13 @@
"constants.js",
"../polaris-tokens/dist"
],
"exclude": ["node_modules", "scripts/get-props/testData"]
"exclude": ["node_modules", "scripts/get-props/testData"],
"ts-node": {
"transpileOnly": true,
"files": true,
"compilerOptions": {
"module": "CommonJS",
"jsx": "react"
}
}
}

0 comments on commit 2d79644

Please sign in to comment.