Skip to content

Commit

Permalink
fix: app paths (#8729)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Oct 10, 2022
1 parent 7b8966b commit caba122
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/guide/src/util/constants.ts
@@ -1,3 +1,3 @@
export const DESCRIPTION = 'Imagine a guide... that explores the many possibilities for your discord.js bot.';

export const GITHUB_BASE_PAGES_PATH = 'https://github.com/discordjs/discord.js/tree/main/packages/guide/src/pages';
export const GITHUB_BASE_PAGES_PATH = 'https://github.com/discordjs/discord.js/tree/main/apps/guide/src/pages';
11 changes: 7 additions & 4 deletions apps/website/src/pages/docs/[...slug].tsx
Expand Up @@ -51,7 +51,10 @@ export const getStaticPaths: GetStaticPaths = async () => {
let data: any[] = [];
let versions: string[] = [];
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
const res = await readFile(join(cwd(), '..', packageName, 'docs', 'docs.api.json'), 'utf8');
const res = await readFile(
join(cwd(), '..', '..', 'packages', packageName, 'docs', 'docs.api.json'),
'utf8',
);
data = JSON.parse(res);
} else {
const response = await fetch(`https://docs.discordjs.dev/api/info?package=${packageName}`);
Expand Down Expand Up @@ -137,7 +140,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
const [memberName, overloadIndex] = member?.split(':') ?? [];

try {
const readme = await readFile(join(cwd(), '..', packageName, 'README.md'), 'utf8');
const readme = await readFile(join(cwd(), '..', '..', 'packages', packageName, 'README.md'), 'utf8');

const mdxSource = await serialize(readme, {
mdxOptions: {
Expand Down Expand Up @@ -173,7 +176,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {

let data;
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
const res = await readFile(join(cwd(), '..', packageName, 'docs', 'docs.api.json'), 'utf8');
const res = await readFile(join(cwd(), '..', '..', 'packages', packageName, 'docs', 'docs.api.json'), 'utf8');
data = JSON.parse(res);
} else {
const res = await fetch(`https://docs.discordjs.dev/docs/${packageName}/${branchName}.api.json`);
Expand Down Expand Up @@ -280,5 +283,5 @@ export default function SlugPage(props: Partial<SidebarLayoutProps & { error?: s
}

export const config = {
unstable_includeFiles: ['../{builders,collection,proxy,rest,util,voice,ws}/README.md'],
unstable_includeFiles: [`../../packages/{${PACKAGES.join(',')}}/README.md`],
};
18 changes: 12 additions & 6 deletions packages/actions/src/uploadCoverage/action.yml
Expand Up @@ -3,6 +3,18 @@ description: 'Uploads code coverage reports to codecov with separate flags for s
runs:
using: 'composite'
steps:
- name: Upload Guide Coverage
uses: codecov/codecov-action@v3
with:
files: ./apps/guide/coverage/cobertura-coverage.xml
flags: guide

- name: Upload Website Coverage
uses: codecov/codecov-action@v3
with:
files: ./apps/website/coverage/cobertura-coverage.xml
flags: website

- name: Upload Builders Coverage
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -39,12 +51,6 @@ runs:
files: ./packages/voice/coverage/cobertura-coverage.xml
flags: voice

- name: Upload Website Coverage
uses: codecov/codecov-action@v3
with:
files: ./packages/website/coverage/cobertura-coverage.xml
flags: website

- name: Upload WS Coverage
uses: codecov/codecov-action@v3
with:
Expand Down

2 comments on commit caba122

@vercel
Copy link

@vercel vercel bot commented on caba122 Oct 10, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on caba122 Oct 10, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.