Hierarchy

  • Manual

Properties

1. Motivations: void

MOTIVATIONS

This package provides a set of scripts to simplify projects management. It supports node and node-red projects in typescript.

It aims at simplify project management, by automating some repetitive operations. Please note that the scripts are opinionated, since they must match my workflow. This does not mean that they cannot fit other workflows, or that they cannot be extended to meet other requirements, but simply that my focus on developing them has been to support my way.

2. myscripts-copyFiles: void

myscripts-copyFiles

The script copy some files or directories put in pre-defined places, into the destination directory. This is useful, for example, for node-red custom nodes, which must ship not only the Javascript, but also HTML and icon files.

The sources at the moment are supposed to be in some special places, pre-defined into the code:

  • src/custom_d_ts: directory storing possible additional custom type definitions (.d.ts). Copied into dist.
  • src/custom_ts_d: the same of src/custom_d_ts. Deprecated.
  • src/**/*.html: copied into dist/src/**/*.html.
  • src/**/icons: directory storing icons. Copied into dist/src/**/icons.
  • src/**/json: directory storing support JSON files. Copied into dist/src/**/json.
3. myscripts-jsonSchemaToType: void

myscripts-jsonSchemaToType

This script converts a JSON schema to a Typescript data type. Useful to be able to type JSONs.

Synopsys

myscripts-jsonSchemaToType <schema> <typeFile>

  • schema: the input JSON schema.
  • typeFile: the output .d.ts file.
4. mochaReporter: void

mochaReporter

This is not a script, but a custom mocha reporter. It simply prints to console the errors.

Example usage:

mocha --reporter \
node_modules/@open-kappa/myscripts/dist/src/myscripts/mochaReporter.js \
"dist/src/tests/**/*_spec.js"
5. myscripts-prepublish: void

myscripts-prepublish

This script is meant to be used as a prepublish hook in the package.json. It performs the following sanity checks:

  1. Ensure to be on the main branch (allowd names: master, main, trunk).
  2. Ensure the latest commit has a tag.
  3. Ensure the tag match the package-json version.
  4. Remove the node_modules directory, and performs a new install.
  5. Remove the dist directory, and performs a build.

Options

  • --no-fix: do not run npm audit --fix
6. myscripts-updatePackages: void

myscripts-updatePackages

This script performs a brutal update of all packages listed in the package.json. It aim is to forcefully update the versions, even if this could break the codebase.

Please note that this means that afer this upgrade, the user must check by hand what changed, and if its code still compiles/works.

It assumes the following:

  • The supported versions are simple constraints: ~, ^, >, >=, file:.
  • Since also exact matches are updated (~), these changes must be undone by hand if not desired.
  • "Greather" constraints (>, >=) are not updated.
7. Copyright: void

COPYRIGHT

@open-kappa/myscripts - A simple authentication and authorization server

Copyright 2022 Francesco Stefanni

https://bitbucket.org/open-kappa/myscripts

@open-kappa/myscripts is distributed under the MIT license. Please see the license section to get a copy of the full license.

License

Copyright (c) 2022 Francesco Stefanni

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributors and patreons

The following individuals and institutions are among the contributors:

  • Francesco Stefanni: main developer and project initiator.

This library has been sponsored by the following patreons:

8. Changelog: void

CHANGELOG

  • 0.0.3 2023-04-04
    • Added an option for prepublish script
    • Updated dependencies
  • 0.0.2 2022-09-28
    • Fixed mocha reporter
  • 0.0.1 2022-09-24
    • First release

Generated using TypeDoc