Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Feb 4, 2024
1 parent bf80121 commit a0b9a5c
Show file tree
Hide file tree
Showing 51 changed files with 300 additions and 272 deletions.
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"trailingComma": "none",
"plugins": ["prettier-plugin-organize-imports"]
}
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")]
};
10 changes: 5 additions & 5 deletions blog/2023-02-14-introducing-juno/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const key = "my_key";

const doc = await getDoc({
collection,
key,
key
});

await setDoc({
Expand All @@ -77,9 +77,9 @@ await setDoc({
key,
...doc,
data: {
email: myNewEmail,
},
},
email: myNewEmail
}
}
});
```
Expand All @@ -96,7 +96,7 @@ const input = document.querySelector("input");

const { downloadUrl } = await uploadFile({
data: input.files[0],
collection: "images",
collection: "images"
});
```
Expand Down
10 changes: 5 additions & 5 deletions blog/2023-03-21-whats-new-in-juno-v0-0-8/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ const myList = await listDocs({
filter: {
order: {
desc: true,
field: "updated_at",
},
},
field: "updated_at"
}
}
});
```

Expand All @@ -104,8 +104,8 @@ import { initJuno } from "@junobuild/core";
await initJuno({
satelliteId: "aaaaa-bbbbb-ccccc-ddddd-cai",
workers: {
auth: true, // ----------------------------------|
}, //|
auth: true // ----------------------------------|
} //|
}); //|
//|
authSubscribe((user: User | null) => {
Expand Down
18 changes: 9 additions & 9 deletions blog/2023-03-28-build-a-web3-app-with-react-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function App() {
useEffect(() => {
(async () =>
await initJuno({
satelliteId: "pycrs-xiaaa-aaaal-ab6la-cai",
satelliteId: "pycrs-xiaaa-aaaal-ab6la-cai"
}))();
}, []);

Expand Down Expand Up @@ -141,8 +141,8 @@ await setDoc<Example>({
collection: "my_collection_key",
doc: {
key: "my_document_key",
data: myExample,
},
data: myExample
}
});
```

Expand All @@ -162,9 +162,9 @@ export const Example = () => {
doc: {
key: nanoid(),
data: {
text: inputText,
},
},
text: inputText
}
}
});
};

Expand Down Expand Up @@ -204,7 +204,7 @@ export const ListExample = () => {
const list = async () => {
const { items } = await listDocs({
collection: "notes",
filter: {},
filter: {}
});

setItems(items);
Expand Down Expand Up @@ -258,7 +258,7 @@ export const UploadExample = () => {
const { downloadUrl } = await uploadFile({
collection: "images",
data: file,
filename,
filename
});

setImage(downloadUrl);
Expand Down Expand Up @@ -305,7 +305,7 @@ export const ListAssetsExample = () => {
const list = async () => {
const { assets } = await listAssets({
collection: "images",
filter: {},
filter: {}
});

setAssets(assets);
Expand Down
46 changes: 23 additions & 23 deletions blog/2023-04-21-develop-an-angular-app-on-blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ import { initJuno } from "@junobuild/core";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"],
styleUrls: ["./app.component.scss"]
})
export class AppComponent implements OnInit {
async ngOnInit() {
await initJuno({
satelliteId: "pycrs-xiaaa-aaaal-ab6la-cai",
satelliteId: "pycrs-xiaaa-aaaal-ab6la-cai"
});
}
}
Expand All @@ -84,7 +84,7 @@ import { signIn, signOut } from "@junobuild/core";
selector: "app-demo",
template: `<button (click)="signIn()">Sign-in</button>
<button (click)="signOut()">Sign-out</button>`,
standalone: true,
standalone: true
})
export class DemoComponent {
readonly signOut = signOut;
Expand All @@ -102,7 +102,7 @@ import { authSubscribe, User } from "@junobuild/core";
import { map, Observable } from "rxjs";

@Injectable({
providedIn: "root",
providedIn: "root"
})
export class AuthService {
readonly user$: Observable<User | null> = new Observable((observer) =>
Expand Down Expand Up @@ -135,8 +135,8 @@ await setDoc<Example>({
collection: "my_collection_key",
doc: {
key: "my_document_key",
data: myExample,
},
data: myExample
}
});
```

Expand All @@ -157,11 +157,11 @@ import { Entry } from "../../types/entry";
<button [disabled]="entryForm.disabled">Submit</button>
</form>`,
standalone: true,
imports: [ReactiveFormsModule],
imports: [ReactiveFormsModule]
})
export class InputComponent {
entryForm = this.formBuilder.group({
entry: "",
entry: ""
});

constructor(private formBuilder: FormBuilder) {}
Expand All @@ -178,9 +178,9 @@ export class InputComponent {
doc: {
key,
data: {
text: this.entryForm.value.entry,
},
},
text: this.entryForm.value.entry
}
}
});
}
}
Expand Down Expand Up @@ -220,20 +220,20 @@ import {
shareReplay,
startWith,
Subject,
switchMap,
switchMap
} from "rxjs";
import type { Entry } from "../types/entry";
import { AuthService } from "./auth.service";

@Injectable({
providedIn: "root",
providedIn: "root"
})
export class DocsService {
private reloadSubject = new Subject<void>();

docs$: Observable<Doc<Entry>[]> = combineLatest([
this.authService.user$,
this.reloadSubject.pipe(startWith(undefined)),
this.reloadSubject.pipe(startWith(undefined))
]).pipe(
switchMap(([user, _]) => {
if (user === null) {
Expand All @@ -243,7 +243,7 @@ export class DocsService {
return from(
listDocs<Entry>({
collection: "notes",
filter: {},
filter: {}
})
).pipe(map(({ items }) => items));
}),
Expand Down Expand Up @@ -275,7 +275,7 @@ import type { Entry } from "../../types/entry";
{{ doc.key }}: {{ doc.data.text }}
</p>`,
imports: [BrowserModule],
standalone: true,
standalone: true
})
export class ListComponent {
readonly docs$: Observable<Doc<Entry>[]> = this.docsService.docs$;
Expand Down Expand Up @@ -315,7 +315,7 @@ import { BrowserModule } from "@angular/platform-browser";
<button (click)="add()">Upload</button>
`,
standalone: true,
imports: [BrowserModule],
imports: [BrowserModule]
})
export class UploadComponent {
private file: File | undefined;
Expand Down Expand Up @@ -347,7 +347,7 @@ export class UploadComponent {
return uploadFile({
collection: "images",
data: this.file,
filename,
filename
});
}
}
Expand Down Expand Up @@ -376,19 +376,19 @@ import {
shareReplay,
startWith,
Subject,
switchMap,
switchMap
} from "rxjs";
import { AuthService } from "./auth.service";

@Injectable({
providedIn: "root",
providedIn: "root"
})
export class AssetsService {
private reloadSubject = new Subject<void>();

assets$: Observable<Assets[]> = combineLatest([
this.authService.user$,
this.reloadSubject.pipe(startWith(undefined)),
this.reloadSubject.pipe(startWith(undefined))
]).pipe(
switchMap(([user, _]) => {
if (user === null) {
Expand All @@ -398,7 +398,7 @@ export class AssetsService {
return from(
listAssets({
collection: "images",
filter: {},
filter: {}
})
).pipe(map(({ assets }) => assets));
}),
Expand Down Expand Up @@ -431,7 +431,7 @@ import { AssetsService } from "../../services/assets.service";
loading="lazy"
/>`,
imports: [BrowserModule],
standalone: true,
standalone: true
})
export class AssetsComponent {
readonly assets$: Observable<Asset[]> = this.assetsService.assets$;
Expand Down
18 changes: 9 additions & 9 deletions blog/2023-05-24-build-a-web3-app-with-vuejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ After completing both of these steps, you can initialize Juno with your satellit
onMounted(
async () =>
await initJuno({
satelliteId: "pycrs-xiaaa-aaaal-ab6la-cai",
satelliteId: "pycrs-xiaaa-aaaal-ab6la-cai"
})
);
</script>
Expand Down Expand Up @@ -155,8 +155,8 @@ await setDoc<Example>({
collection: "my_collection_key",
doc: {
key: "my_document_key",
data: myExample,
},
data: myExample
}
});
```

Expand All @@ -178,9 +178,9 @@ Since the documents in the collection are identified by a unique key, we create
doc: {
key,
data: {
text: inputText.value,
},
},
text: inputText.value
}
}
});
};
</script>
Expand Down Expand Up @@ -215,7 +215,7 @@ For the purpose of this tutorial, we will keep the example minimalistic. Our obj
const list = async () => {
const { items: data } = await listDocs({
collection: "notes",
collection: "notes"
});
items.value = data;
Expand Down Expand Up @@ -269,7 +269,7 @@ To accomplish this, we can create a key using a combination of the user's unique
const { downloadUrl } = await uploadFile({
collection: "images",
data: file.value,
filename,
filename
});
console.log("Uploaded", downloadUrl);
Expand Down Expand Up @@ -302,7 +302,7 @@ Similar to the previous example with documents, we will keep this example minima
const list = async () => {
const { assets: images } = await listAssets({
collection: "images",
collection: "images"
});
assets.value = images;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export const setMetadata = ({ key, name }: Metadata) =>
[
[KEY_LAST_CHANGE, Date.now()],
[KEY_SCENE, key],
[KEY_NAME, name],
[KEY_NAME, name]
],
stateStore
);
Expand Down Expand Up @@ -288,7 +288,7 @@ As mentioned in the architecture chapter, the concept of the project is to conti

```typescript
onmessage = async ({
data: { msg, data },
data: { msg, data }
}: MessageEvent<PostMessage<PostMessageDataRequest>>) => {
switch (msg) {
case "start":
Expand Down
Loading

0 comments on commit a0b9a5c

Please sign in to comment.