Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/rare-pumas-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'polaris-for-vscode': patch
'@shopify/polaris-icons': patch
'@shopify/polaris': patch
'polaris.shopify.com': patch
---

Replaced glob with globby
3 changes: 1 addition & 2 deletions polaris-for-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@
},
"devDependencies": {
"@shopify/polaris-tokens": "^5.5.1",
"@types/glob": "^7.2.0",
"@types/node": "14.x",
"@types/vscode": "^1.64.0",
"@vscode/test-electron": "^2.1.2",
"glob": "^7.2.0",
"globby": "^11.1.0",
"vsce": "^2.7.0"
}
}
2 changes: 1 addition & 1 deletion polaris-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"homepage": "https://polaris.shopify.com/icons",
"devDependencies": {
"@svgr/core": "^4.3.3",
"glob": "^7.1.6",
"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,14 +5,14 @@ import * as path from 'path';
import {createFilter} from '@rollup/pluginutils';
import {babel} from '@rollup/plugin-babel';
import virtual from '@rollup/plugin-virtual';
import glob from 'glob';
import globby from 'globby';
import jsYaml from 'js-yaml';
import svgr from '@svgr/core';
import {optimize} from 'svgo';

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

const iconExports = [];
const iconTypes = [];
Expand Down
6 changes: 3 additions & 3 deletions polaris-icons/tests/validate-data-pairs.test.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const path = require('path');

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

const iconBasePath = path.resolve(__dirname, '../icons');

const allSVGs = glob
const allSVGs = globby
.sync('*.svg', {
cwd: iconBasePath,
})
.map((filename) => path.basename(filename));

const allYMLs = glob
const allYMLs = globby
.sync('*.yml', {
cwd: iconBasePath,
})
Expand Down
4 changes: 2 additions & 2 deletions polaris-icons/tests/validate-svg-content.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');

const glob = require('glob');
const globby = require('globby');
const unified = require('unified');
const parse = require('rehype-parse');
const {select, selectAll} = require('hast-util-select');
Expand All @@ -13,7 +13,7 @@ const configPerSet = new Map([
['Minor', {viewbox: '0 0 20 20', colors: ['#5C5F62', '#5c5f62']}],
]);

const allIconFiles = glob
const allIconFiles = globby
.sync(path.resolve(__dirname, '../icons/*.svg'))
.map((absoluteIconPath) => {
// We don't care about the first item, only the groups matches
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 @@
"chromatic": "^6.5.4",
"core-js": "^3.6.5",
"create-file-webpack": "^1.0.2",
"glob": "^7.1.6",
"globby": "^11.1.0",
"node-cmd": "^3.0.0",
"node-sass": "^7.0.1",
"object-hash": "^1.3.1",
Expand Down
8 changes: 4 additions & 4 deletions polaris-react/scripts/build-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const assert = require('assert').strict;
const fs = require('fs');

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

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

Expand All @@ -22,7 +22,7 @@ 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 = glob.sync('./build/cjs/**/*.js');
const files = globby.sync('./build/cjs/**/*.js');
assert.notStrictEqual(files.length, 0);
const filesContainingUnwantedReactUsage = [];
files.forEach((file) => {
Expand Down Expand Up @@ -91,7 +91,7 @@ function validateAncillaryOutput() {
}

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

assert.notStrictEqual(files.length, 0);

Expand All @@ -118,7 +118,7 @@ function validateVersionReplacement() {
'./build/cjs/configure.js',
'./build/esm/configure.js',
'./build/esm/styles.css',
'./build/esnext/components/AppProvider/AppProvider.css',
'./build/esnext/configure.esnext',
'./build/esnext/components/AppProvider/AppProvider.css',
]);
}
2 changes: 1 addition & 1 deletion polaris.shopify.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@shopify/polaris-tokens": "^5.5.1",
"codesandbox": "^2.2.3",
"fuse.js": "^6.5.3",
"glob": "^7.1.6",
"next": "12.1.0",
"prismjs": "^1.27.0",
"react": "^17.0.2",
Expand All @@ -43,6 +42,7 @@
"eslint-config-next": "12.1.0",
"frontmatter": "^0.0.3",
"generact": "^0.4.0",
"globby": "^11.1.0",
"js-yaml": "^4.1.0",
"marked": "^4.0.16",
"rehype-raw": "^6.1.1",
Expand Down
4 changes: 2 additions & 2 deletions polaris.shopify.com/src/pages/components/[component].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import glob from 'glob';
import globby from 'globby';
import path from 'path';
import type {GetStaticPaths, GetStaticProps} from 'next';
import ComponentExamples from '../../components/ComponentExamples';
Expand Down Expand Up @@ -133,7 +133,7 @@ export const getStaticProps: GetStaticProps<

export const getStaticPaths: GetStaticPaths = async () => {
const globPath = path.resolve(process.cwd(), 'content/components/*/*.md');
const paths = glob.sync(globPath).map((fileName: string) => {
const paths = globby.sync(globPath).map((fileName: string) => {
return fileName
.replace(`${process.cwd()}/content`, '')
.replace('/index.md', '');
Expand Down
4 changes: 2 additions & 2 deletions polaris.shopify.com/src/pages/contributing/[doc].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {GetStaticPaths, GetStaticProps, NextPage} from 'next';
import fs from 'fs';
import path from 'path';
import glob from 'glob';
import globby from 'globby';

import Layout from '../../components/Layout';
import Longform from '../../components/Longform';
Expand Down Expand Up @@ -58,7 +58,7 @@ export const getStaticProps: GetStaticProps<Props, {doc: string}> = async ({

export const getStaticPaths: GetStaticPaths = async () => {
const globPath = path.resolve(process.cwd(), 'content/contributing/*/*.md');
const paths = glob.sync(globPath).map((fileName: string) => {
const paths = globby.sync(globPath).map((fileName: string) => {
return fileName
.replace(`${process.cwd()}/content`, '')
.replace('/index.md', '');
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3639,7 +3639,7 @@
resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-7.3.5.tgz#7aee678c4e7c7e1a168bae8fdab5b8d712e377f6"
integrity sha512-sLecm9ohBdGIpYUP9rWk5/XIKY2xHMYTBJIcJuBBM8IJWnYoQ1DAj8F4OVjnfD0API1drlkWEV0LPNk+ACuhsg==

"@types/glob@*", "@types/glob@^7.1.1", "@types/glob@^7.2.0":
"@types/glob@*", "@types/glob@^7.1.1":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==
Expand Down