Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Node/NPM distribution code and docs #66

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/release-package.yml

This file was deleted.

1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

70 changes: 35 additions & 35 deletions docs/api-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Lorem ipsum...some description, if necessary, for the API usage section.

- [API Documentation](#api-documentation)
- [Table of Contents](#table-of-contents)
- [`guitar-diagrams.js` Class](#guitar-diagramsjs-class)
- [`guitar-diagrams.js` Constructors (non-default)](#guitar-diagramsjs-constructors-non-default)
- [`guitar-diagrams.js` Static Public Members](#guitar-diagramsjs-static-public-members)
- [`guitar-diagrams.js` Public Properties](#guitar-diagramsjs-public-properties)
- [`guitar-diagrams.js` Public Methods](#guitar-diagramsjs-public-methods)
- [`guitar-diagrams-config.js` Class](#guitar-diagrams-configjs-class)
- [`guitar-diagrams-config.js` Constructors (non-default)](#guitar-diagrams-configjs-constructors-non-default)
- [`guitar-diagrams-config.js` Public Properties](#guitar-diagrams-configjs-public-properties)
- [`guitar-diagrams.mjs` Class](#guitar-diagramsmjs-class)
- [`guitar-diagrams.mjs` Constructors (non-default)](#guitar-diagramsmjs-constructors-non-default)
- [`guitar-diagrams.mjs` Static Public Members](#guitar-diagramsmjs-static-public-members)
- [`guitar-diagrams.mjs` Public Properties](#guitar-diagramsmjs-public-properties)
- [`guitar-diagrams.mjs` Public Methods](#guitar-diagramsmjs-public-methods)
- [`guitar-diagrams-config.mjs` Class](#guitar-diagrams-configmjs-class)
- [`guitar-diagrams-config.mjs` Constructors (non-default)](#guitar-diagrams-configmjs-constructors-non-default)
- [`guitar-diagrams-config.mjs` Public Properties](#guitar-diagrams-configmjs-public-properties)
- [canvasID (get)](#canvasid-get)
- [canvasID (set)](#canvasid-set)
- [colorFretboard (get)](#colorfretboard-get)
Expand Down Expand Up @@ -52,41 +52,41 @@ Lorem ipsum...some description, if necessary, for the API usage section.
- [stringNames (set)](#stringnames-set)
- [downloadImageEnabled (get)](#downloadimageenabled-get)
- [downloadImageEnabled (set)](#downloadimageenabled-set)
- [`guitar-diagrams-config.js` Public Methods](#guitar-diagrams-configjs-public-methods)
- [`guitar-diagrams-marker.js` Class](#guitar-diagrams-markerjs-class)
- [`guitar-diagrams-marker.js` Constructors (non-default)](#guitar-diagrams-markerjs-constructors-non-default)
- [`guitar-diagrams-marker.js` Public Properties](#guitar-diagrams-markerjs-public-properties)
- [`guitar-diagrams-marker.js` Public Methods](#guitar-diagrams-markerjs-public-methods)
- [`guitar-diagrams-config.mjs` Public Methods](#guitar-diagrams-configmjs-public-methods)
- [`guitar-diagrams-marker.mjs` Class](#guitar-diagrams-markermjs-class)
- [`guitar-diagrams-marker.mjs` Constructors (non-default)](#guitar-diagrams-markermjs-constructors-non-default)
- [`guitar-diagrams-marker.mjs` Public Properties](#guitar-diagrams-markermjs-public-properties)
- [`guitar-diagrams-marker.mjs` Public Methods](#guitar-diagrams-markermjs-public-methods)

---

## <a name="guitar-diagrams.js"></a>`guitar-diagrams.js` Class
## <a name="guitar-diagrams.mjs"></a>`guitar-diagrams.mjs` Class

### <a name="guitar-diagrams.js-constructor"></a>`guitar-diagrams.js` Constructors (non-default)
### <a name="guitar-diagrams.mjs-constructor"></a>`guitar-diagrams.mjs` Constructors (non-default)

Constructor(s) in `guitar-diagrams.js` go here... or _None._
Constructor(s) in `guitar-diagrams.mjs` go here... or _None._

### <a name="guitar-diagrams.js-static-public-members"></a>`guitar-diagrams.js` Static Public Members
### <a name="guitar-diagrams.mjs-static-public-members"></a>`guitar-diagrams.mjs` Static Public Members

Static members in `guitar-diagrams.js` go here... (We might need to talk about how to handled these.)
Static members in `guitar-diagrams.mjs` go here... (We might need to talk about how to handled these.)

### <a name="guitar-diagrams.js-public-properties"></a>`guitar-diagrams.js` Public Properties
### <a name="guitar-diagrams.mjs-public-properties"></a>`guitar-diagrams.mjs` Public Properties

Properties in `guitar-diagrams.js` go here...
Properties in `guitar-diagrams.mjs` go here...

### <a name="guitar-diagrams.js-public-methods"></a>`guitar-diagrams.js` Public Methods
### <a name="guitar-diagrams.mjs-public-methods"></a>`guitar-diagrams.mjs` Public Methods

Methods in `guitar-diagrams.js` go here...
Methods in `guitar-diagrams.mjs` go here...

## <a name="guitar-diagrams-config.js"></a>`guitar-diagrams-config.js` Class
## <a name="guitar-diagrams-config.mjs"></a>`guitar-diagrams-config.mjs` Class

### <a name="guitar-diagrams.js-constructors"></a>`guitar-diagrams-config.js` Constructors (non-default)
### <a name="guitar-diagrams.mjs-constructors"></a>`guitar-diagrams-config.mjs` Constructors (non-default)

Constructor(s) in `guitar-diagrams-config.js` go here...
Constructor(s) in `guitar-diagrams-config.mjs` go here...

### <a name="guitar-diagrams.js-public-properties"></a>`guitar-diagrams-config.js` Public Properties
### <a name="guitar-diagrams.mjs-public-properties"></a>`guitar-diagrams-config.mjs` Public Properties

Properties in `guitar-diagrams-config.js` go here...
Properties in `guitar-diagrams-config.mjs` go here...

#### canvasID (get)

Expand Down Expand Up @@ -620,20 +620,20 @@ _Example:_
gdj1.config.downloadImageEnabled = true;
```

### <a name="guitar-diagrams.js-public-methods"></a>`guitar-diagrams-config.js` Public Methods
### <a name="guitar-diagrams.mjs-public-methods"></a>`guitar-diagrams-config.mjs` Public Methods

_None._

## <a name="guitar-diagrams-marker.js"></a>`guitar-diagrams-marker.js` Class
## <a name="guitar-diagrams-marker.mjs"></a>`guitar-diagrams-marker.mjs` Class

### <a name="guitar-diagrams-marker.js-contstructors"></a>`guitar-diagrams-marker.js` Constructors (non-default)
### <a name="guitar-diagrams-marker.mjs-contstructors"></a>`guitar-diagrams-marker.mjs` Constructors (non-default)

Constructor(s) in `guitar-diagram-marker.js` go here... (There's only a default constructor as of now.)
Constructor(s) in `guitar-diagram-marker.mjs` go here... (There's only a default constructor as of now.)

### <a name="guitar-diagrams-marker.js-public-properties">`guitar-diagrams-marker.js` Public Properties
### <a name="guitar-diagrams-marker.mjs-public-properties">`guitar-diagrams-marker.mjs` Public Properties

Properties in `guitar-diagrams-marker.js` go here...
Properties in `guitar-diagrams-marker.mjs` go here...

### <a name="guitar-diagrams-marker.js-public-methods">`guitar-diagrams-marker.js` Public Methods
### <a name="guitar-diagrams-marker.mjs-public-methods">`guitar-diagrams-marker.mjs` Public Methods

Methods in `guitar-diagrams-marker.js` go here...
Methods in `guitar-diagrams-marker.mjs` go here...
13 changes: 2 additions & 11 deletions docs/code-owner-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ This section outlines the directory structure of the project.
- `workflows/`: YML files to define GitHub Actions.
- `demo-hosting.yml`: GitHub Actions workflow to deploy `examples/` content to GoDaddy hosting for demos.
- `linting.yml`: GitHub Actions workflow for linting codebase.
- `release-package.yml`: GitHub Actions workflow to create an NPM package for release and hosting on GitHub.
- `.scripts/`: Local scripts used for development, packaging, and releases.
- `build.sh`: Build script to prepare package for deployment by running linting and deployment tasks. Run with `npm run build`.
- `linting.sh`: Script to run Super-Linter for HTML, JS, CSS, and Markdown linting. Runs as part of the `build.sh` script.
Expand All @@ -63,11 +62,7 @@ This section outlines the directory structure of the project.
- `guitar-diagrams-config.mjs`: Config object for defining the library's behavior.
- `guitar-diagrams-marker.mjs`: Object for a marker instance.
- `.gitignore`: File patterns to ignore for Git.
- `.npmignore`: File patterns to ignore for NPM.
- `.npmrc`: Config values for NPM deployments.
- `LICENSE`: Software license file (GPL-3.0)
- `package.json`: NPM package config.
- `package-lock.json`: NPM dependency tree, automatically generated by NPM from `package.json`.
- `README.md`: Main/intro documentation for the project.

## Code Architecture
Expand Down Expand Up @@ -109,13 +104,11 @@ There are three workflows defined for GitHub Actions and those exist at the foll
- `workflows/`
- `demo-hosting.yml`
- `linting.yml`
- `release-package.yml`

| File Name | Workflow Name | Trigger(s) | Branch(es) | Description |
| --------- | ------------- | ---------- | ---------- | ----------- |
| Deploy docs/examples/* to demo hosting | `demo-hosting.yml` | Release published | `main` | Copies `docs/examples/*` to @KCarlile's personal GoDaddy hosting via FTP for public demo of functionality at <https://demo.kcarlile.com/guitar-diagrams-js/>. |
| Lint codebase | `linting.yml` | Push, PR | `main`, `develop` | Runs Super-Linter against HTML, CSS, JS, and Markdown files in the codebase when code is pushed to `main` or `develop` and when a PR is created against `main` or `develop`. |
| Build and publish to NPM | `release-package.yml` | Release created | `main` | Builds and publishes the project to NPM when release are created on `main`. |

## Demo Hosting

Expand All @@ -130,7 +123,7 @@ The `.scripts/build.sh` script, which is run by calling `npm run build` from the
### Local Builds and Releases

- When all of your code changes are complete, AND...
- You've executed `.scripts/build.sh`, AND...
- You've executed `.scripts/build.sh` via `npm run build`, AND...
- You're not seeing any errors in the output of the build script, THEN...
- Commit your changes and push to GitHub, then issue a PR into the `develop` branch for testing.

Expand All @@ -140,9 +133,7 @@ When enough changes (bugs and new features) have been merged into the `develop`

1. Create a PR from the `develop` branch into `main` branch.
1. Once that PR is merged into `main`, checkout `main` locally and pull to get the latest changes. Then, update the version number in `package.json` in your local `main` branch and commit, then push back up to GitHub. (Release creation will fail if the version in `package.json` is not the same as the version you are creating.)
1. Use the [Release page](https://github.com/KCarlile/guitar-diagrams-js/releases) to create a new release which will kick off a new package deployment using the GitHub Action workflow defined in `.github/workflows/release-package.yml`.

Once the workflow has completed successfully, the package will be hosted on the [Packages page](https://github.com/KCarlile/guitar-diagrams-js/pkgs/npm/guitar-diagrams-js).
1. Use the [Release page](https://github.com/KCarlile/guitar-diagrams-js/releases) to create a new release.

### Versioning

Expand Down
14 changes: 7 additions & 7 deletions docs/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2 class="border-bottom border-1 mb-4">Preface - Setup</h2>
<p>Before adding the code to draw your diagram, you'll need to include the Guitar Diagrams JS library and
provide a target element (e.g., a <code class="language-html">&lt;div&gt;</code>) to which the app can add the canvas and begin drawing.</p>
<p>To include the library, use an import statement at the top of your script<sup>1</sup> with the following:</p>
<pre><code class="language-javascript">import { GuitarDiagramsJS } from 'path/to/guitar-diagrams.js';</code></pre>
<pre><code class="language-javascript">import { GuitarDiagramsJS } from 'path/to/guitar-diagrams.mjs';</code></pre>
<p class="small"><sup>1</sup>The <em>script</em> can be an inline script with <code class="language-html">&lt;script&gt;</code>
tags, or it could be in its own JavaScript file that you include or reference in some other way.</p>
<p>To give Guitar Diagrams JS a place to add the drawing, you'll need to specify a block-level element
Expand Down Expand Up @@ -110,12 +110,12 @@ <h5>Code</h5>
gdj3.addMarker(3, 1);
gdj3.drawAllMarkers();</code></pre>
<p>The markers that would be rendered off the fretboard are logged in the browser's console log as the errors seen below:</p>
<pre><code>guitar-diagrams.js:677 [State] GuitarDiagramsJS.addMarker(): { minFret: 0 | maxFret: 3 }
guitar-diagrams.js:679 [Error] GuitarDiagramsJS.addMarker(): Fret marker could not be placed on fretboard. { paramString: 4 | paramFret: 4 | paramText: 4 | paramShape: null }
guitar-diagrams.js:677 [State] GuitarDiagramsJS.addMarker(): { minFret: 0 | maxFret: 3 }
guitar-diagrams.js:679 [Error] GuitarDiagramsJS.addMarker(): Fret marker could not be placed on fretboard. { paramString: 5 | paramFret: 5 | paramText: 5 | paramShape: null }
guitar-diagrams.js:677 [State] GuitarDiagramsJS.addMarker(): { minFret: 0 | maxFret: 3 }
guitar-diagrams.js:679 [Error] GuitarDiagramsJS.addMarker(): Fret marker could not be placed on fretboard. { paramString: 6 | paramFret: 4 | paramText: 6 | paramShape: null }</code></pre>
<pre><code>guitar-diagrams.mjs:677 [State] GuitarDiagramsJS.addMarker(): { minFret: 0 | maxFret: 3 }
guitar-diagrams.mjs:679 [Error] GuitarDiagramsJS.addMarker(): Fret marker could not be placed on fretboard. { paramString: 4 | paramFret: 4 | paramText: 4 | paramShape: null }
guitar-diagrams.mjs:677 [State] GuitarDiagramsJS.addMarker(): { minFret: 0 | maxFret: 3 }
guitar-diagrams.mjs:679 [Error] GuitarDiagramsJS.addMarker(): Fret marker could not be placed on fretboard. { paramString: 5 | paramFret: 5 | paramText: 5 | paramShape: null }
guitar-diagrams.mjs:677 [State] GuitarDiagramsJS.addMarker(): { minFret: 0 | maxFret: 3 }
guitar-diagrams.mjs:679 [Error] GuitarDiagramsJS.addMarker(): Fret marker could not be placed on fretboard. { paramString: 6 | paramFret: 4 | paramText: 6 | paramShape: null }</code></pre>
</div>
</div>
<!-- END: example 3 -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file Guitar Diagrams JS config class.
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-config.js
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-config.mjs
* @link https://github.com/KCarlile/guitar-diagrams-js
*
* @author Kenny Carlile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file Guitar Diagrams JS marker class.
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-marker.js
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-marker.mjs
* @link https://github.com/KCarlile/guitar-diagrams-js
*
* @author Kenny Carlile
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/js/guitar-diagrams-js/guitar-diagrams.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file Guitar Diagrams JS main class.
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams.js
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams.mjs
* @link https://github.com/KCarlile/guitar-diagrams-js
*
* @author Kenny Carlile
Expand Down
33 changes: 9 additions & 24 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,18 @@

There are three primary ways to include the Guitar Diagrams JS library into your project:

1. Install the Guitar Diagrams JS library as a Node JS dependency
1. Reference the Guitar Diagrams JS library from a hosted CDN provider
1. Reference the Guitar Diagrams JS library from a local copy of the JavaScript (JS) files

#### Option 1: Installation as a Node JS Dependency
:information_source: Note: in some future state, Guitar Diagrams JS may be available as a NPM package. (See issue [#65](https://github.com/KCarlile/guitar-diagrams-js/issues/65).)

For full details, see the Node JS packages released by this project here: <https://github.com/KCarlile/guitar-diagrams-js/pkgs/npm/guitar-diagrams-js>
#### Option 1: Manual Reference via CDN-Hosted Files

You can install Guitar Diagrams JS in your project as a Node JS dependency via NPM. Run the following command from your project's directory where `x.y.z` (e.g., `1.0.2`) is the version (or branch name, such as `main`) of the library you want to use:

```bash
npm install @kcarlile/[email protected]
```

Or, alternately, you can manually edit your `package.json` file and add the following entry:

```json
"@kcarlile/guitar-diagrams-js": "x.y.z",
```

#### Option 2: Manual Reference via CDN-Hosted Files

If you want to use a CDN-hosted package (e.g., Guitar Diagrams JS on JSDelivr at `https://cdn.jsdelivr.net/gh/KCarlile/guitar-diagrams-js@main/guitar-diagrams.js`), you can reference it in your code like this:
If you want to use a CDN-hosted package (e.g., Guitar Diagrams JS on JSDelivr at `https://cdn.jsdelivr.net/gh/KCarlile/guitar-diagrams-js@main/src/guitar-diagrams.mjs`), you can reference it in your code like this:

```html
<script type="module">
import { GuitarDiagramsJS } from 'https://cdn.jsdelivr.net/gh/KCarlile/guitar-diagrams-js@main/guitar-diagrams.js';
import { GuitarDiagramsJS } from 'https://cdn.jsdelivr.net/gh/KCarlile/guitar-diagrams-js@main/src/guitar-diagrams.mjs';
// code to configure and use Guitar Diagrams JS goes here
</script>
```
Expand All @@ -43,21 +28,21 @@ Be sure to add some target HTML element to your page with a matching ID (`gdj1.a
<div id="diagram-1"></div>
```

#### Option 3: Manual Reference via Local Copies of Files
#### Option 2: Manual Reference via Local Copies of Files

You can also install this package manually by downloading it, placing the files in the correct location, and modifying your site's code to reference the library. The following steps outline this process:

1. Download the repository files from the [GitHub repository for Guitar Diagrams JS](https://github.com/KCarlile/guitar-diagrams-js).
1. The only files about which you should be concerned are the following:
- `guitar-diagrams.js`: main functionality
- `guitar-diagrams-config.js`: config object
- `guitar-diagrams-marker.js`: marker object
- `guitar-diagrams.mjs`: main functionality
- `guitar-diagrams-config.mjs`: config object
- `guitar-diagrams-marker.mjs`: marker object
1. Place those files in your application at `wherever/you/put/your/js/files/guitar-diagram-js/`.
1. In the JS file with your primary entrypoint, add an import statement:

```javascript
<script type="module">
import { GuitarDiagramsJS } from 'wherever/you/put/your/js/files/guitar-diagrams-js/guitar-diagrams.js';
import { GuitarDiagramsJS } from 'wherever/you/put/your/js/files/guitar-diagrams-js/guitar-diagrams.mjs';
// code to configure and use Guitar Diagrams JS goes here
</script>
```
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,5 @@
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/KCarlile/guitar-diagrams-js/issues"
},
"publishConfig": {
"@KCarlile:registry": "https://npm.pkg.github.com"
}
}
2 changes: 1 addition & 1 deletion src/guitar-diagrams-config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file Guitar Diagrams JS config class.
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-config.js
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-config.mjs
* @link https://github.com/KCarlile/guitar-diagrams-js
*
* @author Kenny Carlile
Expand Down
2 changes: 1 addition & 1 deletion src/guitar-diagrams-marker.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file Guitar Diagrams JS marker class.
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-marker.js
* @module js/lib/Guitar-Diagrams-JS/guitar-diagrams-marker.mjs
* @link https://github.com/KCarlile/guitar-diagrams-js
*
* @author Kenny Carlile
Expand Down
Loading