1.3.6 • Published 5 months ago

nhl97-ngx-atoms-lib v1.3.6

Weekly downloads
-
License
CC BY-NC-SA 4.0
Repository
-
Last release
5 months ago

AtomsLib Public Readme

About This Project / Package

AtomsLib, published as the npm package nhl97-ngx-atoms-lib, is a library of Angular components, services, SCSS mixins, font assets and such, which I, Nikolaus-Mathias Herl, built/collected and reuse throughout my web development projects. AtomsLib is named after the "Atomic Design" pattern/system, i.e. it aims to provide a set of basic, reusable, well-typed components, such as buttons or inputs, that can then be instantiated and recombined to build more complex UIs.

The library is a work-in-progress and partially a playground for me, not currently suitable as a quality dependency for external developers. It does provide some components and styles to my BSc thesis project AdMaTilE.

The following notes and instructions are meant for myself, are often specific to my development environment (/my mono repo), and are in good part about the no-longer pursued compilation to WebComponent.

Roadmap / (Want) TODOs

  • button/clickable Directive
  • bundle ('import') all essential AtomsLib styles into a single file 'atoms-lib.scss' (or similar)
  • dropdown (from small enum/selection)
  • ShortString editor (single row text input) @Input placeholder @Output txt$
  • time editor @Input start-with: Time | DateTime | "now" @Output selected$: O
  • date editor @Input year-format = Human Era (12021) @Output selected$: O
  • composite: formfield {describing label, input-type, missing/data-error messages/handler}

Build

Building For Other Angular Projects

To this end, AtomsLib gets compiled using the Ivy engine's "partial compilation" feature. This means it should be compatible with Angular v12+.

ng build AtomsLib will build the artifacts into the 'AngularMono/dist/atoms-lib' directory.

Building To Web Components

... is broken as of now. Back when it worked / was set up for that purpose, the relevant command was:

ng build --configuration=prod --output-hashing none

(I don't know how the '--output-hashing' option affects things, but an article back then prescribed it)

Publish

Go to the full dist folder 'AngularMono/dist/atoms-lib' and run npm publish.

Consume

In Another Angular Project

Add 'nhl97-ngx-atoms-lib' to the consuming project's package.json under 'dependencies'. Run npm install.

In the consuming Angular module, add AtomsLibModule to the 'imports' array:

imports: [...,
          AtomsLibModule,
          ...]

In the consuming 'angular.json' file:

  • Add to the 'styles' array all stylesheets that should apply styles on their own. (full key: projects/<project-name>/architect/build/options/styles)
  • Also register the AtomsLib styles folder as a source for SCSS partial files, so these files can be @use'd, and their mixins @included in the consuming project's SCSS files. (full key: projects/<project-name>/architect/build/options/stylePreprocessorOptions/includePaths):
"styles": [
  ...
  "node_modules/nhl97-ngx-atoms-lib/styles/base_consts.scss",
  "node_modules/nhl97-ngx-atoms-lib/styles/colors.scss",
  "node_modules/nhl97-ngx-atoms-lib/styles/material_icons.scss",
  ...
  ],
  "stylePreprocessorOptions": {
    "includePaths": [
      "node_modules/nhl97-ngx-atoms-lib/styles"
    ]
  },

After rebuilding / restarting ng serve, AtomsLib's components, services styling, etc. should be available.

As WebComps

<head>
<script type="text/javascript" src="runtime.js"></script>
<script type="text/javascript" src="es2015-polyfills.js" nomodule></script>
<script type="text/javascript" src="polyfills.js"></script>
<script type="text/javascript" src="scripts.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<!-- mby more accurate? -->
    <script type="text/javascript" src="./atoms/runtime-es2020.js"></script>
    <script type="text/javascript" src="./atoms/polyfills-es5.js" nomodule></script>
    <script type="text/javascript" src="./atoms/polyfills-es2020.js"></script>
    <!-- TODO: get scripts.js to be produced + included here? -->
    <script type="text/javascript" src="./atoms/main-es2020.js"></script>
    <script type="text/javascript" src="./atoms/styles.css"></script>

Input properties' naming pattern are forced into kebab-case: (from camelCase. and snake_case??)

Goals:

1.3.6

5 months ago

1.3.5

5 months ago

1.3.3

5 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.9

2 years ago

1.2.10

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago