Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Salakar committed Feb 24, 2024
1 parent cb49aa8 commit 2c9c264
Show file tree
Hide file tree
Showing 32 changed files with 5,334 additions and 332 deletions.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ public
.next
package-lock.json
yarn.lock
/public/_docs.page/shiki/themes/
/public/_docs.page/shiki/languages/
bundler/dist
dist
build
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,3 @@ jobs:
run: yarn run check:linting
- name: Check Formatting
run: yarn run check:formatting
# TODO: refactor to tsc on individual packages
# - name: Check TS Compiles
# run: yarn run check:typescript
# - name: Check Spelling & Grammar
# run: yarn run check:spelling
# TODO: tests need fixing
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2-beta
# with:
# node-version: '14'
# - name: NPM Install
# run: yarn
# - name: Jest Tests
# run: yarn run test
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
node_modules
build
dist
repositories.json
domains.json
spelling.json
_docs.page
1 change: 0 additions & 1 deletion .sample.env

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

41 changes: 0 additions & 41 deletions __tests__/config.test.ts

This file was deleted.

5 changes: 0 additions & 5 deletions __tests__/index.test.ts

This file was deleted.

99 changes: 0 additions & 99 deletions __tests__/utils.test.ts

This file was deleted.

2 changes: 2 additions & 0 deletions api/src/bundler/plugins/rehype-code-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const languages = shiki.BUNDLED_LANGUAGES.reduce(
* @returns
*/
export default function rehypeCodeBlocks(): (ast: Node) => void {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function visitor(node: any, _i: number, parent: any) {
if (!parent || parent.tagName !== 'pre' || node.tagName !== 'code') {
return;
Expand Down Expand Up @@ -67,6 +68,7 @@ function extractTitle(meta: string): string | null {
}

// Get the programming language of `node`.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function getLanguage(node: any): string | undefined {
const className = node.properties.className || [];
let index = -1;
Expand Down
5 changes: 2 additions & 3 deletions api/src/bundler/plugins/rehype-headings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { visit } from 'unist-util-visit';
import { hasProperty } from 'hast-util-has-property';
import { headingRank } from 'hast-util-heading-rank';
import type { Node, Content } from 'hast-util-heading-rank/lib';
import type { Node } from 'hast-util-heading-rank/lib';
import { toString } from 'mdast-util-to-string';
import { parseSelector } from 'hast-util-parse-selector';
import { Data as UnistData, Node as UnistNode } from 'unist';
Expand Down Expand Up @@ -81,8 +81,7 @@ const wrapSection: (children: HastElement[], id: string) => HastElement = (child
return wrap;
};

const headingTest: (node: Node) => boolean = node =>
!!headingRank(node) && hasProperty(node, 'id');
const headingTest: (node: Node) => boolean = node => !!headingRank(node) && hasProperty(node, 'id');

// partition an array based on a test function, e.g [a,b,b,b,a,b,b,a,b] should become [[a,b,b,b],[a,b,b],[a,b]]
function partition<T>(array: T[], test: (input: T) => boolean): T[][] {
Expand Down
2 changes: 1 addition & 1 deletion api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"skipLibCheck": true /* Skip type checking of declaration files. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
"typeRoots": ["node_modules/@types"],
"typeRoots": ["node_modules/@types"]
}
}
33 changes: 0 additions & 33 deletions dictionary.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/components/callouts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Displays a green box with a check icon, useful for showing the user they did som
```jsx
<Success>This draws attention to a successful action the user has taken.</Success>
```
```
27 changes: 14 additions & 13 deletions docs/components/code-blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export async function apiRequest(options) {

The above code block was created with the following snippet:

```text
````text
```javascript
export async function apiRequest(options) {
// ...
```
````

Syntax highlighting is generated using [Shiki](https://github.com/shikijs/shiki). You can find a list of
[supported languages here](https://github.com/shikijs/shiki/blob/main/docs/languages.md#all-languages).
Expand All @@ -65,31 +65,32 @@ export async function apiRequest(options) {

The above code block was created with the following snippet:

```text
````text
```javascript title="Sending a request"
export async function apiRequest(options) {
// ...
```
````

## Code Groups

You can group multiple code blocks together by using the `<CodeGroup>` component. This is useful for showing
You can group multiple code blocks together by using the `<CodeGroup>` component. This is useful for showing
variations of the "same" code in a different language

<CodeGroup title="Logging: Hello World">
```javascript
console.log("Hello World");
```

```python
print('Hello World!')
```
```python
print('Hello World!')
```

```dart
void main() {
print('Hello World!');
}
```

```dart
void main() {
print('Hello World!');
}
```
</CodeGroup>

Specify each of the code blocks and their language as children of the component.
Expand Down
16 changes: 6 additions & 10 deletions docs/components/tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ First, import the package:
```js
import axios from 'axios';
````

</TabItem>
<TabItem value="dart">
Add the `dio` package:
Expand All @@ -109,6 +110,7 @@ First, import the package:
```dart
import 'package:dio/dio.dart';
```

</TabItem>
</Tabs>

Expand All @@ -122,16 +124,10 @@ Next, perform a network request to 'https://example.com':
]}
>
<TabItem value="js">
```js
const response = await axios.get('https://example.com');
console.log(response.data);
````
```js const response = await axios.get('https://example.com'); console.log(response.data); ````
</TabItem>
<TabItem value="dart">
```dart
var dio = Dio();
final response = await dio.get('https://example.com');
print(response.data);
````
```dart var dio = Dio(); final response = await dio.get('https://example.com');
print(response.data); ````
</TabItem>
</Tabs>
</Tabs>
1 change: 0 additions & 1 deletion docs/components/video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ A general purpose video component, extends the HTML `<video>` element.
```jsx
<Video muted autoPlay src="https://your-video-source.com/video.mp4" type="video/mp4" />
```

1 change: 0 additions & 1 deletion docs/components/vimeo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ Use the `<Vimeo>` component and pass the ID of the video you want to embed.
```

<Vimeo id="253989945" />

1 change: 0 additions & 1 deletion docs/components/youtube.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ Use the `<YouTube>` component and pass the ID of the video you want to embed.
```

<YouTube id="X8ipUgXH6jw" />

Loading

0 comments on commit 2c9c264

Please sign in to comment.