Skip to content

Commit

Permalink
refactor(protocol-tag-utils): rename module #1059
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Oct 31, 2024
1 parent d2adbb4 commit 219e532
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: 📊🛠 Test & Deploy Data-Protocols Lib
name: 🔖🛠 Test & Deploy Protocol Tag Utils

on:
pull_request:
branches:
- main
paths:
- "data-protocols/**"
- "protocol-tag-utils/**"
push:
branches:
- main
paths:
- "data-protocols/**"
- "protocol-tag-utils/**"

# Perform a release using a workflow dispatch
workflow_dispatch:
Expand Down Expand Up @@ -38,12 +38,12 @@ jobs:
node-version: 20

- name: 📥 Download deps
working-directory: data-protocols
working-directory: protocol-tag-utils
run: |
npm i
- name: ⚡ Run Tests
working-directory: data-protocols
working-directory: protocol-tag-utils
run: |
npm test
env:
Expand Down Expand Up @@ -87,20 +87,20 @@ jobs:
uses: hyper63/[email protected]
with:
bump-to: ${{ github.event.inputs.version }}
package: data-protocols
package: protocol-tag-utils

- name: ⬆️ Push
run: |
git push
git push --tags
- name: 📥 Download deps
working-directory: data-protocols
working-directory: protocol-tag-utils
run: |
npm i
- name: 🦠 Publish to NPM
working-directory: data-protocols
working-directory: protocol-tag-utils
run: |
npm run build
npm publish --access=public
Expand Down
34 changes: 17 additions & 17 deletions data-protocols/README.md → protocol-tag-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# data-protocols
# protocol-tag-utils

A _tiny_, zero-dependency, set of utilities for interacting with `Data-Protocol`
tags. Browser, Node, Bun, and Deno compatible.
Expand Down Expand Up @@ -94,7 +94,7 @@ import {
removeAll,
removeAllByName,
update,
} from "@permaweb/data-protocols";
} from "@permaweb/protocol-tag-utils";

const tags = [
{ name: "Data-Protocol", value: "ao" },
Expand Down Expand Up @@ -127,7 +127,7 @@ Extract the tags associated with the provided `Data-Protocol`.
If the `Data-Protocol` tag is NOT found, then an empty array is returned

```js
import { findAll } from "@permaweb/data-protocols";
import { findAll } from "@permaweb/protocol-tag-utils";

const tags = [/*...*/];

Expand All @@ -140,7 +140,7 @@ const aoTags = findAll("ao", tags);
Extract the tags, with the name, associated with the provided `Data-Protocol`.

```js
import { findAllByName } from '@permaweb/data-protocols'
import { findAllByName } from '@permaweb/protocol-tag-utils'

const tags = [/*...*/]

Expand All @@ -154,7 +154,7 @@ Extract the FIRST tag, with the name, associated with the provided
`Data-Protocol`.

```js
import { findByName } from '@permaweb/data-protocols'
import { findByName } from '@permaweb/protocol-tag-utils'

const tags = [/*...*/]

Expand All @@ -168,7 +168,7 @@ Associate an array of tags associated with the `Data-Protocol`. The
`Data-Protocol` tag will be prepended to the front of the array.

```js
import { create } from "@permaweb/data-protocols";
import { create } from "@permaweb/protocol-tag-utils";

const pTags = [{ name: "Foo", value: "Bar" }];

Expand All @@ -191,7 +191,7 @@ concatenated to the end of all tags.
NO deduplication is performed on the associated tags.

```js
import { update } from "@permaweb/data-protocols";
import { update } from "@permaweb/protocol-tag-utils";

const tags = [
{ name: "Data-Protocol", value: "ao" },
Expand Down Expand Up @@ -225,7 +225,7 @@ Same [`update`](#update), except do not replace the associated tags, and instead
concatenate to them.

```js
import { concat } from "@permaweb/data-protocols";
import { concat } from "@permaweb/protocol-tag-utils";

const tags = [
{ name: "Data-Protocol", value: "ao" },
Expand Down Expand Up @@ -261,7 +261,7 @@ concat("ao", pTags, tags);
Remove the `Data-Protocol` section and all associated tags

```js
import { removeAll } from "@permaweb/data-protocols";
import { removeAll } from "@permaweb/protocol-tag-utils";

const tags = [
{ name: "Unassociated", value: "Tag" },
Expand Down Expand Up @@ -297,7 +297,7 @@ removeAll("ao", tags);
Remove all tags, with the name, associated with the `Data-Protocol`.

```js
import { removeAllByName } from "@permaweb/data-protocols";
import { removeAllByName } from "@permaweb/protocol-tag-utils";

const tags = [
{ name: "Unassociated", value: "Tag" },
Expand Down Expand Up @@ -337,7 +337,7 @@ values are discarded. If you'd like to preserve all values, then use
[`parseAll`](#parseall)

```js
import { parse } from "@permaweb/data-protocols";
import { parse } from "@permaweb/protocol-tag-utils";

const tags = [/*...*/];

Expand All @@ -353,7 +353,7 @@ pairs of name -> an array of values.
At each key, the values in each array will be in order of appearance

```js
import { parseAll } from "@permaweb/data-protocols";
import { parseAll } from "@permaweb/protocol-tag-utils";

const tags = [/*...*/];

Expand All @@ -366,10 +366,10 @@ const aoParsed = parseAll("ao", tags);
Instead of constantly passing `protocol` as the first argument every time, you
can use this helper.

Build a `@permaweb/data-protocols` API for a single `Data-Protocol`
Build a `@permaweb/protocol-tag-utils` API for a single `Data-Protocol`

```js
import { proto } from "@permaweb/data-protocols";
import { proto } from "@permaweb/protocol-tag-utils";

const ao = proto("ao");
const zone = proto("zone");
Expand Down Expand Up @@ -403,7 +403,7 @@ to as "unassociated" tags.
Add unassociated tags to the end of unassociated section.

```js
import { concatUnassoc } from "@permaweb/data-protocols"
import { concatUnassoc } from "@permaweb/protocol-tag-utils"

const tags = [
{ name: 'Random', value: 'Tag' }
Expand All @@ -430,7 +430,7 @@ concatUnassoc([{ name: 'Another', value: 'One' }], tags)
Same as [`parse`](#parse), but for unassociated tags

```js
import { parseUnassoc } from "@permaweb/data-protocols";
import { parseUnassoc } from "@permaweb/protocol-tag-utils";

const tags = [/*...*/];

Expand All @@ -443,7 +443,7 @@ parseUnassoc(tags);
Same as [`parseAll`](#parseAll), but for unassociated tags

```js
import { parseAllUnassoc } from "@permaweb/data-protocols";
import { parseAllUnassoc } from "@permaweb/protocol-tag-utils";

const tags = [/*...*/];

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@permaweb/data-protocols",
"name": "@permaweb/protocol-tag-utils",
"version": "0.0.1",
"description": "A utility for extracting and parsing tags associated with ANS-115 Data-Protocols",
"repository": {
Expand Down
File renamed without changes.

0 comments on commit 219e532

Please sign in to comment.