Skip to content

Commit

Permalink
Change project structure
Browse files Browse the repository at this point in the history
https://monorepo.guide/getting-started suggests that apps directory
should contain "user-facing apps and websites" and packages directory
should contain "packages designed to be consumed by other packages
(published OR internal)". I'm not sure if this is a common convention,
but it lookes simple and clear enough for me.

Rename our nextjs app to @thunderstore/nextjs and components package
to @thunderstore/components. Fix imports to reflect the changes.

Update the references in GitHub Actions files to reflect the new file
paths.
  • Loading branch information
anttimaki committed Nov 29, 2021
1 parent ff1a9a1 commit 15db678
Show file tree
Hide file tree
Showing 35 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install yarn dependencies
run: yarn install
- name: Run ESLint
run: yarn run eslint nextjs thunderstore-components -f node_modules/@microsoft/eslint-formatter-sarif/sarif.js -o results.sarif || ":"
run: yarn run eslint apps packages -f node_modules/@microsoft/eslint-formatter-sarif/sarif.js -o results.sarif || ":"
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v1
with:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ jobs:
yarn-${{ runner.os }}-
- name: Install Yarn dependencies
run: yarn install --frozen-lockfile
- name: Build thunderstore-components
run: |
cd thunderstore-components
yarn build
- name: Build nextjs
run: |
cd nextjs
yarn build
- name: Build @thunderstore/components
run: yarn workspace @thunderstore/components build
- name: Build @thunderstore/nextjs
run: yarn workspace @thunderstore/nextjs build
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions nextjs/package.json → apps/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "nextjs",
"name": "@thunderstore/nextjs",
"version": "0.1.0",
"private": true,
"repository": "https://github.com/thunderstore-io/thunderstore-ui/tree/master/nextjs",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion nextjs/pages/_app.tsx → apps/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppProps } from "next/app";
import { RootWrapper, theme } from "thunderstore-components";
import { RootWrapper, theme } from "@thunderstore/components";

function MyApp({ Component, pageProps }: AppProps): JSX.Element {
return (
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Community, MultiCommunityPicker } from "thunderstore-components";
import { Community, MultiCommunityPicker } from "@thunderstore/components";
import React, { useState } from "react";
import { Box, Button, List, ListItem } from "@chakra-ui/react";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageUpload } from "thunderstore-components";
import { PackageUpload } from "@thunderstore/components";
import React from "react";

const PackageUploadPage: React.FC<Record<string, never>> = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TeamPicker } from "thunderstore-components";
import { TeamPicker } from "@thunderstore/components";
import React, { useState } from "react";
import { Box, Button, Text } from "@chakra-ui/react";

Expand Down
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion nextjs/tsconfig.json → apps/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"references": [{ "path": "../thunderstore-components" }]
"references": [{ "path": "../../packages/components" }]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "thunderstore-components",
"name": "@thunderstore/components",
"version": "0.1.0",
"description": "Shared components for Thunderstore",
"repository": "https://github.com/thunderstore-io/thunderstore-ui/tree/master/thunderstore-components",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 15db678

Please sign in to comment.