Skip to content

Commit

Permalink
refactor: moved to more standard md extension
Browse files Browse the repository at this point in the history
  • Loading branch information
GauBen committed Apr 24, 2023
1 parent b315512 commit 02a87b3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This project is made of two separate parts:
- [app](./packages/app/) is a Svelte IDE that runs in the browser.
- [lessons](./packages/lessons/) contains all the tutorials.

A lesson is a regular npm package that contains at least a `package.json` file and a `README.svx` file.
A lesson is a regular npm package that contains at least a `package.json` file and a `README.md` (Svelte-enhanced markdown) file.

```bash
# Clone the repository
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/lessons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type Readme = {
};

export const lessons = new Map(
Object.entries(import.meta.glob<Readme>('./*/README.svx')).map(
([path, load]) => [path.slice('./'.length, -'/README.svx'.length), load]
Object.entries(import.meta.glob<Readme>('./*/README.md')).map(
([path, load]) => [path.slice('./'.length, -'/README.md'.length), load]
)
);
6 changes: 3 additions & 3 deletions packages/app/src/lib/editor/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
let children: PaneChild[] = [
{
type: 'readme',
name: 'README',
name: 'README.md',
context: { contents: readme.default },
},
];
Expand Down Expand Up @@ -87,7 +87,7 @@
};
const openFile = async (path: string) => {
const name = path === '/README.svx' ? 'README' : path;
const name = path.slice(1);
const matching = children.find((child) => child.name === name);
if (matching) {
Expand All @@ -96,7 +96,7 @@
}
const child =
name === 'README'
name === 'README.md'
? ({
type: 'readme',
name,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { mdsvex } from 'mdsvex';

/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.svx'],
preprocess: [vitePreprocess(), mdsvex()],
extensions: ['.md', '.svelte'],
preprocess: [mdsvex({ extension: '.md' }), vitePreprocess()],

kit: {
adapter: adapter(),
Expand Down
2 changes: 1 addition & 1 deletion packages/lessons/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const buildLesson = async (name: string, dir: URL) => {
try {
const files = await buildLessonFiles(dir);
await mkdir(relative(`${dest}${name}`), { recursive: true });
await copyFile(new URL('README.svx', dir), `${dest}${name}/README.svx`);
await copyFile(new URL('README.md', dir), `${dest}${name}/README.md`);
await writeFile(`${dest}${name}/files.json`, JSON.stringify(files));
} catch (error) {
console.error(`Error building lesson ${name}: ${error}`);
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This lesson does not currently work in the browser for security reasons. You can
- Install dependencies with `yarn install`
- Continue from here with `yarn start`, `yarn exploit`, etc.

*More details on [prisma#17710](https://github.com/prisma/prisma/issues/17710)*
_More details on [prisma#17710](https://github.com/prisma/prisma/issues/17710)_

## The vulnerability

Expand Down Expand Up @@ -61,8 +61,8 @@ query {

<Task>

- Start the API with `npm install` and `npm start`. <RunCommand cmd="npm install && npm start" on:cmd>▶️</RunCommand>
- Run the exploit in `exploit/index.ts` with `npm run exploit`. <RunCommand cmd="npm run exploit" on:cmd>▶️</RunCommand>
- Start the API with `npm install` and `npm start`. <RunCommand cmd="npm install && npm start" on:cmd>▶️</RunCommand>
- Run the exploit in `exploit/index.ts` with `npm run exploit`. <RunCommand cmd="npm run exploit" on:cmd>▶️</RunCommand>

</Task>

Expand Down Expand Up @@ -109,8 +109,8 @@ Query: {

<Task>

- Install zod with `npm install zod`. <RunCommand cmd="npm install zod" on:cmd>▶️</RunCommand>
- Write a zod schema that allows searching with `email`, `firstName` and `lastName` fields, but not others.
- Install zod with `npm install zod`. <RunCommand cmd="npm install zod" on:cmd>▶️</RunCommand>
- Write a zod schema that allows searching with `email`, `firstName` and `lastName` fields, but not others.

</Task>

Expand Down

0 comments on commit 02a87b3

Please sign in to comment.