-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from lsst-sqre/tickets/DM-40259
DM-40259: Update storybook to v7 and adopt pnpm
- Loading branch information
Showing
16 changed files
with
18,031 additions
and
53,944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
const path = require('path'); | ||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
module.exports = { | ||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
'@storybook/addon-a11y', | ||
{ | ||
name: 'storybook-addon-next', | ||
options: { | ||
nextConfigPath: path.resolve(__dirname, '../next.config.js'), | ||
}, | ||
}, | ||
], | ||
framework: '@storybook/react', | ||
framework: '@storybook/nextjs', | ||
core: { | ||
builder: '@storybook/builder-webpack5', | ||
}, | ||
staticDirs: ['../public'], | ||
docs: { | ||
autodocs: true, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Squareone | ||
|
||
[![GitHub Actions](https://github.com/lsst-sqre/squareone/actions/workflows/ci.yaml/badge.svg)](https://github.com/lsst-sqre/squareone/actions/) [![Documentation](https://img.shields.io/badge/squareone-lsst.io-brightgreen.svg)](https://squareone.lsst.io) | ||
|
||
Squareone is the home page for the [Rubin Science Platform](https://data.lsst.cloud). It's where you start on your journey to use the RSP's portal, notebooks, and APIs to do science with Rubin/LSST data. [Squareone is deployed with Phalanx](https://phalanx.lsst.io/applications/squareone/). | ||
|
||
**Documentation for developers and operators:** https://squareone.lsst.io | ||
|
||
## Technology stack | ||
|
||
- The site is built with [Next.js](https://nextjs.org) and [React](https://reactjs.org). Next.js allows the site to be dynamically configured for different Science Platform deployments. | ||
|
||
- Styling is done through [styled-components](https://styled-components.com) (along with global CSS). | ||
|
||
## Development | ||
|
||
To set up your development environment and run the site locally, see Squareone's development documentation: https://squareone.lsst.io/dev/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
|
||
.. _CommonMark: https://commonmark.org/ | ||
.. _MDX: https://mdxjs.com | ||
.. _Next.js: https://nextjs.org | ||
.. _next lint: https://nextjs.org/docs/basic-features/eslint | ||
.. _nvm: https://nvm.sh | ||
.. _Phalanx: https://phalanx.lsst.io | ||
.. _pnpm: https://pnpm.io | ||
.. _Prettier: https://prettier.io/ | ||
.. _React: https://reactjs.org | ||
.. _Rubin Observatory: https://www.lsst.org | ||
.. _Semaphore: https://github.com/lsst-sqre/semaphore | ||
.. _Storybook: https://storybook.js.org/ | ||
.. _styled-components: https://styled-components.com | ||
.. _Squareone repository: https://github.com/lsst-sqre/squareone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
################# | ||
Development tasks | ||
################# | ||
|
||
Once you have a working development environment (see :doc:`set-up`), you can run tasks to help you develop and test the project. | ||
This page outlines those development tasks. | ||
|
||
Start the development server | ||
============================ | ||
|
||
.. code-block:: sh | ||
pnpm dev | ||
View the site at http://localhost:3000. | ||
This site auto-updates when running with the development server. | ||
|
||
`API routes <https://nextjs.org/docs/api-routes/introduction>`__ are accessed on ``http://localhost:3000/api/*``. | ||
The ``pages/api`` directory is mapped to ``/api/*``. | ||
Files in this directory are treated as API routes instead of React pages. | ||
The purpose of the ``pages/api/dev`` endpoints are to mock external services in the RSP; see the re-writes in :file:`next.config.js`. | ||
|
||
Start the Storybook server | ||
========================== | ||
|
||
Storybook_ is an environment for documenting and designing React components. | ||
You can start up Squareone's Storybook development site:: | ||
|
||
.. code-block:: bash | ||
pnpm storybook | ||
Manual linting and formatting | ||
----------------------------- | ||
|
||
Typically linting is run by your IDE while you develop and again when you commit code (via Husky). | ||
You can also manually lint and format code. | ||
|
||
Lint JavaScript via `next lint`_: | ||
|
||
.. code-block:: bash | ||
pnpm lint | ||
Check formatting with Prettier_: | ||
|
||
.. code-block:: bash | ||
pnpm format:check | ||
Or automatically fix files with Prettier_: | ||
|
||
.. code-block:: bash | ||
pnpm format | ||
Create a production build | ||
========================= | ||
|
||
You can create a production build of the application, which can be a useful check of a process that typically runs inside the Docker image build: | ||
|
||
.. code-block:: bash | ||
npm run build | ||
You can serve the production build locally: | ||
|
||
.. code-block:: bash | ||
npm run serve | ||
VS Code tasks | ||
============= | ||
|
||
Many of these tasks are also available as VS Code tasks. | ||
From the VS Code command pallet run ``Tasks: Run Task`` and select the task you want to run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.