5.2.1 • Published 6 months ago

ngx-prx-styleguide v5.2.1

Weekly downloads
22
License
MIT
Repository
github
Last release
6 months ago

PRX Style Guide and Component Library

Generated using the Angular CLI's library support. Uses ng-packagr under the hood and adheres to the Angular Package Format.

Install Dependencies

Run npm install.

Development Storybook Server

Run npm run storybook to start Storybook server. The Storybook server will automatically detect and load any files ending with .stories.ts.

Writing Stories

Each component should have a .stories.ts. Stories files should focus on one component or concept at a time. For example, the ButtonComponent's stories should only containing stories that provide usage examples for the button variations and states. Usage of the button in a menu component should be done in the menu component's stories.

Demo App (Deprecated)

Run npm run demo for a legacy demo server. Use this as reference when converting demo pages to stories. Do not add new demo pages. New compoents or examples of existing components should be done as Storybook stories.

Running Unit Tests

Run npm run test to execute the unit tests via Karma.

Build

Run npm run build:lib to build the library. The build artifacts will be stored in the dist/ directory.

You can have Angular's build system monitor for changes and rebuild when they're detected using npm run build:lib:watch. Also, if you'd like to use the built library in a Docker container, you can use the post-build watcher: CONTAINER_NAME=your_name_here npm run postbuild:lib:watch. This script will watch for the Angular build to complete, bundle in static assets and then attempt to find a running container with a name which matches the provided container name and copy the built files into the /app/node_modules directory. To find your container's name, run docker ps and look under the NAMES columns.

To test an AOT build locally, you must additionally:

  • Run Publish's build on the Docker container docker exec <container name from previous step> npm run-script build
  • Update Publish's docker-compose.yml to run the command that serves the production build. By convention, this would mean changing command: start to command: serve or (less destructively) adding a docker-compose.override.yml to the root directory with the following content:
publish:
  command: serve
  • Restart the container

Usage

To use this library in an angular-cli project:

npm install ngx-prx-styleguide

Then import the modules you want into your module:

import { ChartsModule, DatepickerModule } from 'ngx-prx-styleguide';

@NgModule({
  imports: [ChartsModule, DatepickerModule]
})

And add image assets, styles for the base stylesheet, and any components you are using, to your angular.json:

{
  "projects": {
    "your-project": {
      "architect": {
        "your-arch": {
          "options": {
            "assets": [
              {
                "glob": "**/*",
                "input": "node_modules/ngx-prx-styleguide/assets",
                "ignore": ["styles/*"],
                "output": "assets"
              }
            ],
            "styles": [
              "node_modules/pikaday/css/pikaday.css",
              "node_modules/pikaday/css/triangle.css",
              "node_modules/c3/c3.css",
              "node_modules/@ng-select/ng-select/themes/default.theme.css"
              "node_modules/ngx-prx-styleguide/assets/styles/bundle.scss"
            ],
          }
        }
      }
    }
  }
}

Releasing

Once a PR has been reviewed and approved, it's time to release!

The npm version command will run scripts to update the library version as well. To release to the npm registry, publish the dist/ngx-prx-styleguide directory. The package.json in the base directory has private set to true to prevent accidental publishing.

npm version [ major | minor | patch ... ]
npm run build:lib
npm publish dist/ngx-prx-styleguide

After the package has been published, push the npm generated commit and tag to the repository:

git push --follow-tags

License

This library is available as open source under the terms of the MIT License.

Contributing

Completing a Contributor License Agreement (CLA) is required for PRs to be accepted.

5.2.1

6 months ago

4.1.1

6 months ago

5.2.0

8 months ago

4.1.0

8 months ago

4.0.4

2 years ago

5.1.6

2 years ago

5.1.5

2 years ago

4.0.3

2 years ago

5.1.4

2 years ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.1

3 years ago

5.1.0

3 years ago

5.0.3

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.20.0

4 years ago

2.19.1

5 years ago

2.19.0

5 years ago

2.18.2

5 years ago

2.18.1

5 years ago

2.18.0

5 years ago

2.17.0

5 years ago

2.16.0

5 years ago

2.15.0

5 years ago

2.14.0

5 years ago

2.13.0

5 years ago

2.12.1

5 years ago

2.12.0

5 years ago

2.11.7

5 years ago

2.11.6

5 years ago

2.11.5

5 years ago

2.11.4

5 years ago

2.11.3

5 years ago

2.11.2

5 years ago

2.11.1

5 years ago

2.11.0

5 years ago

2.10.0

5 years ago

2.9.2

5 years ago

2.9.1

5 years ago

2.9.0

5 years ago

2.8.0

5 years ago

2.7.1

5 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.5.0

5 years ago

2.4.0

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.4.1

5 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.41

6 years ago

0.0.40

6 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

6 years ago

0.0.31

6 years ago

0.0.30

6 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago