1.3.4 • Published 3 years ago

cra-template-pwa-starter-test v1.3.4

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
3 years ago

PWA Starter

This application is a react starter application used by DHA developers for developing progressive web applications

This project was bootstrapped with Create React App. You can find more information about getting started with Create React App here, and available scripts here.

Table of Contents

Quick Start

  • npx create-react-app app-name-here --template pwa-starter-test
  • cd app-name-here
  • npm start

New Project Instructions

  • npx create-react-app app-name-here --template pwa-starter-test
  • .gitignore
    • Uncomment build folder if its not needed in the repository for CI/CD or hosting.
  • package.json
    • Add or replace the values for: name, version, author, description, repository.url, and bug.url.
  • Copyright Headers
    • Add copyright headers to every new file.
    • Add the file name on the first line.
    • Add the file description on the second line
    • Replace firstName, lastName, and date for the line "Created by firstName lastName on date".
      • Search and replace all instances of "pwa-starter" with your application name in all project files.

DHA SDK Packages

The application uses the following DHA SDK packages:

  • dha-rating

Built With

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode. See the section about running tests for more information.

npm run test:ci

Launches the test runner in non-interactive watch mode. This script lets the ci and build complete without any other interactions when running.

npm run test:coverage

Launches the test runner in the interactive watch mode. This will generate the test coverage report in the coverage folder and viewed in the console.

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

npm run format

Runs Prettier to format project files. Prettier doesn't have a parser for every file extension. If you get the error "No parser could be inferred for file: file.png", add the file or extension to .prettierignore.

npm run lint

Runs TSLint to check for linting errors in project files.

Testing

  • Tests can be ran with the npm test command
  • Tests are ran using Jest with enzyme - More information about getting started with jest can be found here
  • Example Render Test
it('renders without crashing', () => {
    shallow(<Home/>);
});`

Create React App Template

Using and Installing the Template

To get started use the following commands, replacing the name of your app. Having yarn installed can potentially cause problems during the install process.

  • npx create-react-app app-name-here --template pwa-starter-test
  • cd app-name-here
  • npm start

PWA Starter Development

When ready to merge to Master ensure version number is updated in the package.json and the package.json.template or publishing will fail the pipeline

Pipeline and Deployment

Create template

  • Set shopt environment variables so following commands function properly
  • Gitignore is renamed to remove “.” as a templating requirement
  • All except for a few files are moved to template folder
  • Moves all hidden files to template folder
  • Edits project name in package.json to template name format
  • Publish to npm

Maintenance of template

Template requirements are needed in root directory. All of these structure changes are temporary and handled by the pipeline when changes are made to the Master branch

  • README.md: Contents for npm page
  • template.json: Gets added to package.json for those using template to install
  • package.json: Contains versioning and info for CRA template on npm, modified copy by pipeline from package.json for PWA-Starter
    • Name must start with “cra-template-”
  • Template Folder: Contains all of the content to be downloaded when someone uses the CRA template
    • The gitignore file must have the period removed and it is renamed automatically during the Create-React-App template install command process

License

This project is licensed under the MIT License.

1.3.4

3 years ago

1.3.3

3 years ago

1.6.5

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.6.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago