Skip to the content

App Scaffolding

@apollion-dsi/scripts is a zero-config CLI for React apps that use Apollion. It hides webpack, Babel, Jest and TypeScript behind the scripts binary, with Relay and styled-components Babel plugins already wired.
Contributing

Create a project

yarn dlx @apollion-dsi/scripts create my-app
cd my-app
yarn start

create copies the template, writes package.json, installs dependencies and makes the first Git commit. The template contains src/index.tsx, src/App.tsx, src/App.test.tsx, public/index.html, tsconfig.json, jest.config.js, eslint.config.js, .prettierrc.js, commitlint.config.js, .editorconfig and .gitignore.

Add it to an existing project

yarn add --dev @apollion-dsi/scripts
{
  "scripts": {
    "start": "scripts dev",
    "build": "scripts build",
    "test": "scripts test"
  }
}

dev and build require public/index.html and src/index (.tsx, .ts or .js).

Commands

Command
Effect
scripts dev
webpack dev server with hot reload, on the first free port from 3000
scripts build
production bundle in build/
scripts test
Jest; watches changed files unless CI is set or --watchAll=false
scripts lint
ESLint over src with the Apollion config
scripts prettier
Prettier check; pass --write to format
scripts check-types
tsc --noEmit against the project tsconfig.json
scripts validate
check-types, prettier and lint in parallel, then the test run
Scrolls sideways inside the table. The page does not.

The scaffolded package.json maps these to yarn start, yarn build, yarn test, yarn lint, yarn check-types and yarn validate.

See also