Skip to content

Commit

Permalink
chore: bump glob (#2922)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Jul 3, 2024
1 parent a04761b commit e49059f
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 87 deletions.
9 changes: 9 additions & 0 deletions .changeset/shy-wombats-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@latticexyz/abi-ts": patch
"@latticexyz/cli": patch
"@latticexyz/world-modules": patch
"@latticexyz/world": patch
"create-mud": patch
---

Bumped `glob` dependency.
2 changes: 1 addition & 1 deletion docs/pages/world/reference/world-external.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[Git Source](https://github.com/latticexyz/mud/blob/main/packages/world/src/codegen/interfaces/IBaseWorld.sol)

**Inherits:**
[IStore](/store/reference/store#istore), [IWorldKernel](/world/reference/world-external#iworldkernel), [IAccessManagementSystem](/world/reference/world-external#iaccessmanagementsystem), [IBalanceTransferSystem](/world/reference/world-external#ibalancetransfersystem), [IBatchCallSystem](/world/reference/world-external#ibatchcallsystem), [IModuleInstallationSystem](/world/reference/world-external#imoduleinstallationsystem), [IWorldRegistrationSystem](/world/reference/world-external#iworldregistrationsystem), [IRegistrationSystem](/world/reference/world-external#iregistrationsystem)
[IStore](/store/reference/store#istore), [IWorldKernel](/world/reference/world-external#iworldkernel), [IRegistrationSystem](/world/reference/world-external#iregistrationsystem), [IAccessManagementSystem](/world/reference/world-external#iaccessmanagementsystem), [IBalanceTransferSystem](/world/reference/world-external#ibalancetransfersystem), [IBatchCallSystem](/world/reference/world-external#ibatchcallsystem), [IModuleInstallationSystem](/world/reference/world-external#imoduleinstallationsystem), [IWorldRegistrationSystem](/world/reference/world-external#iworldregistrationsystem)

This interface integrates all systems and associated function selectors
that are dynamically registered in the World during deployment.
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@
"@arktype/attest": "0.7.5",
"@arktype/util": "0.0.43",
"@changesets/cli": "^2.26.1",
"@types/glob": "^7.2.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "7.1.1",
"@typescript-eslint/parser": "7.1.1",
"bun": "^1.0.11",
"chalk": "^5.2.0",
"eslint": "8.57.0",
"execa": "^7.0.0",
"glob": "^8.0.3",
"glob": "^10.4.2",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "3.2.5",
Expand Down
3 changes: 1 addition & 2 deletions packages/abi-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@
"chalk": "^5.3.0",
"debug": "^4.3.4",
"execa": "^7.0.0",
"glob": "^8.0.3",
"glob": "^10.4.2",
"yargs": "^17.7.1"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/glob": "^7.2.0",
"@types/node": "^18.15.11",
"@types/yargs": "^17.0.10",
"tsup": "^6.7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/abi-ts/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CommandModule } from "yargs";
import { readFileSync, writeFileSync } from "fs";
import glob from "glob";
import { globSync } from "glob";
import { debug } from "./debug";

type Options = {
Expand All @@ -24,7 +24,7 @@ const commandModule: CommandModule<Options, Options> = {
},

handler({ input }) {
const files = glob.sync(input);
const files = globSync(input).sort();

if (!files.length) {
console.error(`No files found for glob: ${input}`);
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"ethers": "^5.7.2",
"execa": "^7.0.0",
"find-up": "^6.3.0",
"glob": "^8.0.3",
"glob": "^10.4.2",
"openurl": "^1.1.1",
"p-queue": "^7.4.1",
"p-retry": "^5.1.2",
Expand All @@ -77,7 +77,6 @@
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/ejs": "^3.1.1",
"@types/glob": "^7.2.0",
"@types/node": "^18.15.11",
"@types/openurl": "^1.0.0",
"@types/throttle-debounce": "^5.0.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/commands/set-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { CommandModule } from "yargs";
import { MUDError } from "@latticexyz/common/errors";
import { logError } from "../utils/errors";
import localPackageJson from "../../package.json" assert { type: "json" };
import glob from "glob";
import { globSync } from "glob";
import { mudPackages } from "../mudPackages";

type Options = {
Expand Down Expand Up @@ -63,7 +63,10 @@ const commandModule: CommandModule<Options, Options> = {
}

// Update all package.json below the current working directory (except in node_modules)
const packageJsons = glob.sync("**/package.json").filter((p) => !p.includes("node_modules"));
const packageJsons = globSync("**/package.json")
.sort()
.filter((p) => !p.includes("node_modules"));

for (const packageJson of packageJsons) {
updatePackageJson(packageJson, options);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/deploy/findLibraries.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { readFileSync } from "fs";
import glob from "glob";
import { globSync } from "glob";
import { orderByDependencies } from "./orderByDependencies";
import { LinkReferences } from "../utils/findPlaceholders";

export function findLibraries(forgeOutDir: string): readonly {
readonly path: string;
readonly name: string;
}[] {
const artifacts = glob
.sync(`${forgeOutDir}/**/*.json`, { ignore: "**/*.abi.json" })
const artifacts = globSync(`${forgeOutDir}/**/*.json`, { ignore: "**/*.abi.json" })
.sort()
.map((path) => JSON.parse(readFileSync(path, "utf8")));

const libraries = artifacts.flatMap((artifact) => {
Expand Down
12 changes: 7 additions & 5 deletions packages/cli/src/utils/getExistingContracts.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import glob from "glob";
import { globSync } from "glob";
import { basename } from "path";

/**
* Get a list of all contract paths/names within the provided src directory
*/
export function getExistingContracts(srcDir: string) {
return glob.sync(`${srcDir}/**/*.sol`).map((path) => ({
path,
basename: basename(path, ".sol"),
}));
return globSync(`${srcDir}/**/*.sol`)
.sort()
.map((path) => ({
path,
basename: basename(path, ".sol"),
}));
}
6 changes: 3 additions & 3 deletions packages/cli/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { defineConfig } from "tsup";
import glob from "glob";
import { globSync } from "glob";
import { readFileSync } from "node:fs";
import path from "node:path";
import { MudPackages } from "./src/common";

const mudWorkspace = path.normalize(`${__dirname}/../..`);

const mudPackages: MudPackages = Object.fromEntries(
glob
.sync(path.join(mudWorkspace, `packages/*/package.json`))
globSync(path.join(mudWorkspace, `packages/*/package.json`))
.sort()
.map((filename) => [
path.relative(mudWorkspace, path.dirname(filename)),
JSON.parse(readFileSync(filename, "utf8")),
Expand Down
3 changes: 1 addition & 2 deletions packages/world-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@
"@latticexyz/abi-ts": "workspace:*",
"@latticexyz/gas-report": "workspace:*",
"@types/ejs": "^3.1.1",
"@types/glob": "^7.2.0",
"@types/mocha": "^9.1.1",
"@types/node": "^18.15.11",
"ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0",
"forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",
"glob": "^8.0.3",
"glob": "^10.4.2",
"solhint": "^3.3.7",
"tsup": "^6.7.0",
"tsx": "^3.12.6",
Expand Down
12 changes: 7 additions & 5 deletions packages/world-modules/ts/scripts/worldgen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import glob from "glob";
import { globSync } from "glob";
import path, { basename } from "path";
import { rmSync } from "fs";
import { loadConfig } from "@latticexyz/config/node";
Expand All @@ -12,10 +12,12 @@ const clean = false;
const srcDir = await getSrcDirectory();

// Get a list of all contract names
const existingContracts = glob.sync(`${srcDir}/**/*.sol`).map((path) => ({
path,
basename: basename(path, ".sol"),
}));
const existingContracts = globSync(`${srcDir}/**/*.sol`)
.sort()
.map((path) => ({
path,
basename: basename(path, ".sol"),
}));

// Load and resolve the config
const mudConfig = (await loadConfig(configPath)) as WorldConfig;
Expand Down
3 changes: 1 addition & 2 deletions packages/world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,12 @@
"@latticexyz/abi-ts": "workspace:*",
"@latticexyz/gas-report": "workspace:*",
"@types/ejs": "^3.1.1",
"@types/glob": "^7.2.0",
"@types/mocha": "^9.1.1",
"@types/node": "^18.15.11",
"ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0",
"ejs": "^3.1.10",
"forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",
"glob": "^8.0.3",
"glob": "^10.4.2",
"solhint": "^3.3.7",
"tsup": "^6.7.0",
"tsx": "^3.12.6",
Expand Down
6 changes: 3 additions & 3 deletions packages/world/src/codegen/interfaces/IBaseWorld.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions packages/world/ts/scripts/worldgen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import glob from "glob";
import { globSync } from "glob";
import path, { basename } from "path";
import { rmSync } from "fs";
import { loadConfig } from "@latticexyz/config/node";
Expand All @@ -12,10 +12,12 @@ const clean = false;
const srcDir = await getSrcDirectory();

// Get a list of all contract names
const existingContracts = glob.sync(`${srcDir}/**/*.sol`).map((path) => ({
path,
basename: basename(path, ".sol"),
}));
const existingContracts = globSync(`${srcDir}/**/*.sol`)
.sort()
.map((path) => ({
path,
basename: basename(path, ".sol"),
}));

// Load and resolve the config
const mudConfig = (await loadConfig(configPath)) as WorldConfig;
Expand Down
Loading

0 comments on commit e49059f

Please sign in to comment.