Merged in monorepo-step-1 (pull request #1080)
Migrate to a monorepo setup - step 1 * Move web to subfolder /apps/scandic-web * Yarn + transitive deps - Move to yarn - design-system package removed for now since yarn doesn't support the parameter for token (ie project currently broken) - Add missing transitive dependencies as Yarn otherwise prevents these imports - VS Code doesn't pick up TS path aliases unless you open /apps/scandic-web instead of root (will be fixed with monorepo) * Pin framer-motion to temporarily fix typing issue https://github.com/adobe/react-spectrum/issues/7494 * Pin zod to avoid typ error There seems to have been a breaking change in the types returned by zod where error is now returned as undefined instead of missing in the type. We should just handle this but to avoid merge conflicts just pin the dependency for now. * Pin react-intl version Pin version of react-intl to avoid tiny type issue where formatMessage does not accept a generic any more. This will be fixed in a future commit, but to avoid merge conflicts just pin for now. * Pin typescript version Temporarily pin version as newer versions as stricter and results in a type error. Will be fixed in future commit after merge. * Setup workspaces * Add design-system as a monorepo package * Remove unused env var DESIGN_SYSTEM_ACCESS_TOKEN * Fix husky for monorepo setup * Update netlify.toml * Add lint script to root package.json * Add stub readme * Fix react-intl formatMessage types * Test netlify.toml in root * Remove root toml * Update netlify.toml publish path * Remove package-lock.json * Update build for branch/preview builds Approved-by: Linus Flood
This commit is contained in:
committed by
Linus Flood
parent
667cab6fb6
commit
80100e7631
57
.gitignore
vendored
57
.gitignore
vendored
@@ -1,51 +1,10 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
node_modules
|
||||
**/.DS_Store
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
# Yarn
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
certificates
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
|
||||
#vscode
|
||||
.vscode/
|
||||
|
||||
#cursor
|
||||
.cursorrules
|
||||
|
||||
# localfile with all the CSS variables exported from design system
|
||||
variables.css
|
||||
# Sentry Config File
|
||||
.env.sentry-build-plugin
|
||||
.pnp.*
|
||||
.yarn/releases
|
||||
1
.husky/.gitignore
vendored
1
.husky/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
_
|
||||
@@ -1 +1 @@
|
||||
npx lint-staged
|
||||
yarn dlx lint-staged
|
||||
|
||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
6
.yarnrc.yml
Normal file
6
.yarnrc.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
packageExtensions:
|
||||
eslint-config-next@*:
|
||||
dependencies:
|
||||
next: '*'
|
||||
46
README.md
46
README.md
@@ -1,36 +1,20 @@
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
# Scandic Monorepo
|
||||
|
||||
This is the monorepo for Scandic's web projects.
|
||||
|
||||
## What's inside?
|
||||
|
||||
This repo includes the following packages/apps:
|
||||
|
||||
### Apps and Packages
|
||||
|
||||
- `scandic-web`: [Next.js](https://nextjs.org/) app for our public website
|
||||
- `design-system`: a shared library of styles
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
To get started, clone this repository and run `yarn install` in the root directory.
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
```
|
||||
### Running `scandic-web` locally
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
To run the `scandic-web` app locally see its [README](./apps/scandic-web/README.md).
|
||||
|
||||
@@ -16,7 +16,6 @@ CURITY_ISSUER_SERVICE="https://testlogin.scandichotels.com"
|
||||
CYPRESS_BASE_URL="http://localhost:3000"
|
||||
# See next.config.js for info
|
||||
DEPLOY_PRIME_URL="http://localhost:3000"
|
||||
DESIGN_SYSTEM_ACCESS_TOKEN=""
|
||||
NEXTAUTH_REDIRECT_PROXY_URL="http://localhost:3000/api/web/auth"
|
||||
NEXTAUTH_SECRET=""
|
||||
REVALIDATE_SECRET=""
|
||||
@@ -18,7 +18,6 @@ CYPRESS_API_BASEURL="test"
|
||||
CYPRESS_CURITY_USERNAME="test"
|
||||
CYPRESS_CURITY_PASSWORD="test"
|
||||
CYPRESS_BASE_URL="test"
|
||||
DESIGN_SYSTEM_ACCESS_TOKEN="test"
|
||||
DEPLOY_PRIME_URL="test"
|
||||
NEXTAUTH_SECRET="test"
|
||||
PUBLIC_URL="test"
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": ["next/core-web-vitals", "plugin:import/recommended"],
|
||||
"extends": ["next/core-web-vitals", "plugin:import/typescript"],
|
||||
"plugins": ["simple-import-sort", "@typescript-eslint"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"rules": {
|
||||
60
apps/scandic-web/.gitignore
vendored
Normal file
60
apps/scandic-web/.gitignore
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
.yarn/install-state.gz
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
certificates
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
|
||||
#vscode
|
||||
.vscode/
|
||||
|
||||
#cursor
|
||||
.cursorrules
|
||||
|
||||
# localfile with all the CSS variables exported from design system
|
||||
variables.css
|
||||
|
||||
# Sentry Config File
|
||||
.env.sentry-build-plugin
|
||||
|
||||
# Yarn
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
.yarn/releases
|
||||
28
apps/scandic-web/README.md
Normal file
28
apps/scandic-web/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
||||
- Firt, make sure you have built the `design-system` once:
|
||||
|
||||
```bash
|
||||
yarn workspace @scandic-hotels/design-system build
|
||||
```
|
||||
|
||||
- Create a `.env.local` file in the root of the `scandic-web` directory with the keys from the `.env.example` file.
|
||||
|
||||
- Then run the development server:
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user