Skip to content

Commit

Permalink
Fix: Run build before publish (#115)
Browse files Browse the repository at this point in the history
* Run build script before publish 🤦🏻‍♂️

* Use object nomenclature

* Bump version and update CHANGELOG
  • Loading branch information
jgarber623 authored Sep 27, 2023
1 parent 8a0d4e0 commit 28fc615
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -42,6 +43,7 @@ jobs:
cache: npm
registry-url: https://npm.pkg.github.com
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.0.1 (2023-09-27)

- 77b3c33 docs: Use object nomenclature
- a135a75 fix: Run build script before publish 🤦🏻‍♂️

## 2.0.0 (2023-09-27)

- 46460b8 chore: Add publish workflow
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You've got a couple options for adding TemplateTemplate to your project:

## Usage

TemplateTemplate takes two arguments: a reference to a `<template>` element and a hash of `insertions` defining the content to insert into the `<template>`.
TemplateTemplate takes two arguments: a reference to a `<template>` element and an object of `insertions` defining the content to insert into the `<template>`.

### Basic

Expand Down Expand Up @@ -69,7 +69,7 @@ A basic example, inserting a row into a `<table>`:
</script>
```

In the example above, a reference to the `<template>` element is passed to TemplateTemplate using [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector). The `insertions` hash is a map of key/value pairs where the key (e.g. `'.name'`) is a valid [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) and the `value` (e.g. `'TemplateTemplate'`) is a string of text to insert into the selected node.
In the example above, a reference to the `<template>` element is passed to TemplateTemplate using [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector). The `insertions` argument an object whose keys (e.g. `'.name'`) are valid [CSS selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) and whose values (e.g. `'TemplateTemplate'`) are strings of text to insert into the selected node.

### Advanced

Expand Down Expand Up @@ -140,8 +140,8 @@ TemplateTemplate('#row-template', {
// index in the array as the `textContent` for the node. If this value is
// `null`, TemplateTemplate skips setting the node's `textContent`.
//
// The second index is a hash of key/value pairs which are added to the node
// as HTML attributes.
// The second index is an object whose properties are added to the node as
// HTML attributes.
tr: [null, {
class: 'project',
id: 'project-cashcash'
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jgarber/templatetemplate",
"version": "2.0.0",
"version": "2.0.1",
"description": "A very small JavaScript <template> manipulation library.",
"keywords": [
"dom",
Expand Down

0 comments on commit 28fc615

Please sign in to comment.