Skip to content

fix: prettier #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2024
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
10 changes: 5 additions & 5 deletions examples/example-vite-react-sdk/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useSystemCalls } from "./useSystemCalls.ts";

export const useDojoStore = createDojoStore<Schema>();

function App({ db }: { db: SDK<Schema> }) {
function App({ sdk }: { sdk: SDK<Schema> }) {
const {
account,
setup: { client },
Expand All @@ -29,7 +29,7 @@ function App({ db }: { db: SDK<Schema> }) {
let unsubscribe: (() => void) | undefined;

const subscribe = async () => {
const subscription = await db.subscribeEntityQuery(
const subscription = await sdk.subscribeEntityQuery(
{
dojo_starter: {
Moves: {
Expand Down Expand Up @@ -71,12 +71,12 @@ function App({ db }: { db: SDK<Schema> }) {
unsubscribe();
}
};
}, [db, account?.account.address]);
}, [sdk, account?.account.address]);

useEffect(() => {
const fetchEntities = async () => {
try {
await db.getEntities(
await sdk.getEntities(
{
dojo_starter: {
Moves: {
Expand Down Expand Up @@ -111,7 +111,7 @@ function App({ db }: { db: SDK<Schema> }) {
};

fetchEntities();
}, [db, account?.account.address]);
}, [sdk, account?.account.address]);

const moves = useModel(entityId, Models.Moves);
const position = useModel(entityId, Models.Position);
Expand Down
4 changes: 2 additions & 2 deletions examples/example-vite-react-sdk/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DojoContextProvider } from "./DojoContext.tsx";
import { setupBurnerManager } from "@dojoengine/create-burner";

async function main() {
const db = await init<Schema>(
const sdk = await init<Schema>(
{
client: {
rpcUrl: dojoConfig.rpcUrl,
Expand All @@ -34,7 +34,7 @@ async function main() {
<DojoContextProvider
burnerManager={await setupBurnerManager(dojoConfig)}
>
<App db={db} />
<App sdk={sdk} />
</DojoContextProvider>
</StrictMode>
);
Expand Down
3 changes: 3 additions & 0 deletions packages/create-dojo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
Comment on lines +13 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Dist directory is missing in the package.

The dist directory specified in the files field does not exist, which means the package may not include the necessary compiled files.

  • Ensure that the build process generates the dist directory before publishing.
🔗 Analysis chain

LGTM! Consider verifying package contents.

The addition of the files field to explicitly include the dist directory is a good practice. It ensures that the compiled code is included in the published package and provides better control over the package contents.

To ensure that all necessary files are included in the package, consider running a dry-run publish and verifying the contents:

This will help confirm that no essential files are accidentally excluded due to the new files field.


🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the contents of the package to be published

# Navigate to the package directory
cd packages/create-dojo

# Perform a dry-run publish and list the files that would be included
npm publish --dry-run

# Output the result
echo "Please review the list of files above to ensure all necessary files are included."

Length of output: 293


Script:

#!/bin/bash
# Description: List all files in the dist directory to verify package contents

# Navigate to the package directory
cd packages/create-dojo

# Check if the dist directory exists
if [ -d "dist" ]; then
    echo "Listing contents of the dist directory:"
    ls -R dist
else
    echo "Error: dist directory does not exist."
fi

Length of output: 128

"exports": "./dist/index.js",
"bin": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 0 additions & 2 deletions packages/create-dojo/src/commands/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

import { Command } from "commander";
import path from "path";
import { promises as fs } from "fs";
Expand Down
8 changes: 1 addition & 7 deletions packages/sdk/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ const subscription = await sdk.subscribeEntityQuery(
}
}
);

// Later, to unsubscribe
subscription.unsubscribe();
```

# Usage
Expand Down Expand Up @@ -259,9 +256,6 @@ const subscription = await sdk.subscribeEntityQuery(
}
}
);

// Later, to unsubscribe
subscription.unsubscribe();
```

## Sending Signed Messages
Expand All @@ -274,7 +268,7 @@ you'll have to properly set `relayUrl` in the `init` function.
// onchain_dash-Message is a composition of the ${namespace}-${Model} type you want to sign.
// Here we take example of a chat because we don't want to load up those messages onchain
// But keep in mind this could be any models defined in your cairo code
const msg = db.generateTypedData("onchain_dash-Message", {
const msg = sdk.generateTypedData("onchain_dash-Message", {
identity: account?.address,
content: toValidAscii(data.message),
timestamp: Date.now(),
Expand Down
Loading