2.0.5 • Published 1 year ago

@jdeighan/exceptions v2.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Creating the exceptions project

1.-

$ mkdir exceptions
$ cd exceptions
$ git init -b main
$ npm init
$ mkdir src
$ mkdir test
$ npm install js-yaml
$ npm install ava

NOTE: During 'npm init', make the package name '@jdeighan/exceptions' using your npm user name in place of 'jdeighan'

In the src/ folder, add your library, e.g. exceptions.coffee In the test/ folder, add your unit tests, e.g.

import test from 'ava'

import {
	haltOnError, logErrors, LOG, DEBUG, error, assert, croak,
	normalize, super_normalize,
	} from '@jdeighan/exceptions'

# ---------------------------------------------------------------------------

test 'foo', (t) => t.pass()

block = """
	abc\tdef
	\tabc     def
	"""

norm = normalize(block)
snorm = super_normalize(block)

test 'normalize', (t) => t.is(norm, "abc def\nabc def")
test 'super_normalize', (t) => t.is(snorm, "abc def abc def")

In your package.json file:

  1. Add key to 'scripts' section: "test": "ava"
  2. Add key "type": "module"
  3. Add key "exports": { ".": "./src/exceptions.js"}

Add a .gitignore file:

node_modules/

Add a .npmrc file:

engine-strict=true
loglevel=silent

Add a README.md file:

Creating this project
=====================
$ git status

Should not include ANYTHING inside the node_modules folder

$ git add -A
$ git commit -m "initial commit"

All unit tests should pass using npm test git status should show:

On branch main
nothing to commit, working tree clean

Create a GitHub repo

$ cd ..
$ gh repo create

The first command should put you in the parent folder

I followed instructions from:

https://docs.github.com/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-locally-hosted-code-to-github

Unfortunately, they didn't work. To make it work, I had to cd to the parent folder, then run 'gh repo create'.

At the initial prompt, you should select:

Push an existing local repository to GitHub

After that, you won't see the prompt, just a '?'. Enter the name of the folder, which will become the name of the repo.

Furthermore, later prompts also do not appear, so you should just keep hitting 'Enter' and eventually you'll get your bash prompt back and the repo will be created at GitHub.

Publishing on npm

$ publish

This is a synonum for npm publish --access=public (in my .bashrc file)

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

2.0.1

1 year ago

1.0.24

2 years ago

2.0.0

2 years ago

1.0.23

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago