Skip to content
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

fix: correct use of dependencies rather than dev dependencies #183

Merged
merged 1 commit into from
Apr 5, 2022
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
3 changes: 2 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"files": [
"README.md"
"README.md",
"docs/xx-appendices/thanks.md"
],
"imageSize": 100,
"commit": false,
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

# Check typescript compiles properly.
- name: Check TypeScript
run: make typescript-check

# Fixup Git URLs, see:
# https://stackoverflow.com/questions/70663523/the-unauthenticated-git-protocol-on-port-9418-is-no-longer-supported
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig

# Run the build - this will fail if there are broken links etc.
- name: Build
run: make build
6 changes: 6 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}

# Fixup Git URLs, see:
# https://stackoverflow.com/questions/70663523/the-unauthenticated-git-protocol-on-port-9418-is-no-longer-supported
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
if: ${{ steps.release.outputs.release_created }}

# Run the build - this will fail if there are broken links etc.
- name: Build
run: make build
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,25 @@ This section contains information on how to built, use and edit the site. To hel

To setup dependencies, run:

```sh
```bash
make setup
```

To test that TypeScript types compile, run:

```bash
make typescript-check
```

To serve the site locally, run:

```sh
```bash
make serve
```

To build the site, run:

```sh
```bash
make build
```

Expand Down
5 changes: 5 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ setup:
serve:
npm start

# Check typescript types.
typescript-check:
npm install
npm run ts:check

# Build the site, including the downloads directory. This requires that we also
# run the 'build-samples.sh' script to zip and tar the effective shell samples.
# The build recipe also tests that the samples files are created in the downloads
Expand Down
2,695 changes: 1,281 additions & 1,414 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
"write-heading-ids": "docusaurus write-heading-ids",
"ts:check": "tsc"
},
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^0.10.0",
"@docusaurus/core": "2.0.0-beta.15",
"@docusaurus/preset-classic": "2.0.0-beta.15",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/module-type-aliases": "^2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@mdx-js/react": "^1.6.21",
"@tsconfig/docusaurus": "^1.0.5",
"@types/react": "^17.0.43",
"asciinema-player": "^3.0.0-rc.1",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-mailchimp-email-signup-form": "^2.0.2"
"react-mailchimp-email-signup-form": "^2.0.2",
"typescript": "^4.6.3"
},
"browserslist": {
"production": [
Expand All @@ -35,11 +41,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-beta.18",
"@tsconfig/docusaurus": "^1.0.5",
"asciinema-player": "^3.0.0-rc.1",
"typescript": "^4.6.3"
}
}
27 changes: 20 additions & 7 deletions src/components/AsciinemaPlayer/AsciinemaPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
// Props to https://github.com/dunnkers

import React, { useEffect, useRef } from 'react';
import * as AsciinemaPlayerLibrary from 'asciinema-player';
import BrowserOnly from '@docusaurus/BrowserOnly';
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';

type AsciinemaPlayerProps = {
src: string;
Expand All @@ -30,14 +31,26 @@ const AsciinemaPlayer: React.FC<AsciinemaPlayerProps> = ({
style,
...asciinemaOptions
}) => {
const ref = useRef<HTMLDivElement>(null);
return (
<BrowserOnly>
{
() => {
if (!ExecutionEnvironment.canUseDOM) {
return <div>ASCII Cinema Player Unavailable</div>;
}
const AsciinemaPlayerLibrary = require('asciinema-player');
const ref = useRef<HTMLDivElement>(null);

useEffect(() => {
const currentRef = ref.current;
AsciinemaPlayerLibrary.create(src, currentRef, asciinemaOptions);
}, [src]);
useEffect(() => {
const currentRef = ref.current;
AsciinemaPlayerLibrary.create(src, currentRef, asciinemaOptions);
}, [src]);

return <div ref={ref} style={style} />;
return <div ref={ref} style={style} />;
}
}
</BrowserOnly>
)
};

export default AsciinemaPlayer;