1.2.10 • Published 4 months ago

nhl97-ngx-atoms-lib v1.2.10

Weekly downloads
-
License
SEE LICENSE IN 'L...
Repository
-
Last release
4 months ago

AtomsLib Public Readme

Please note the licensing conditions detailed in the file 'License AtomsLib.md'. To summarize it quickly (and non-bindingly): At this time, you're not allowed to use this library in any way, shape or form.

About This Project / Package

AtomsLib - published as the npm package nhl97-ngx-atoms-lib - is a library of Angular components, services and more that I, Nikolaus-Mathias Herl, reuse throughout my programming and web development projects. It aims to follow the "Atomic Design" pattern/system, hence the name.

AtomsLib is primarily meant to be consumed by (my) other Angular projects, though building to framework-agnostic Web Components is also a goal.

The following notes and instructions are meant for myself - and the latter are specific to my development environment (/my mono repo).

Roadmap / (Want) TODOs / I'll probably need the following eventually

  • 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.2.8

4 months ago

1.2.7

4 months ago

1.2.6

4 months ago

1.2.9

4 months ago

1.2.10

4 months ago

1.2.5

6 months ago

1.2.4

6 months ago

1.2.3

6 months ago

1.2.2

6 months ago

1.1.10

7 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago