Skip to content

Commit

Permalink
Update resources
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed May 8, 2024
1 parent e87c418 commit 582428f
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 142 deletions.
10 changes: 5 additions & 5 deletions .dnt.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { dirname as pathDirname } from "node:path";
import { transform, type TransformOutput } from "DNT/transform";
import { copy as fsCopy } from "STD/fs/copy.ts";
import { emptyDir } from "STD/fs/empty_dir.ts";
import { ensureDir } from "STD/fs/ensure_dir.ts";
import { walk as readDir, type WalkEntry } from "STD/fs/walk.ts";
import { copy as fsCopy } from "STD/fs/copy";
import { emptyDir } from "STD/fs/empty-dir";
import { ensureDir } from "STD/fs/ensure-dir";
import { walk as readDir, type WalkEntry } from "STD/fs/walk";
import { dirname as pathDirname } from "node:path";
const pathsMain: WalkEntry[] = await Array.fromAsync(readDir("."));
const transformResult: TransformOutput = await transform({
entryPoints: ["mod.ts"],
Expand Down
7 changes: 0 additions & 7 deletions .github/CONTRIBUTING.md

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing Guide

This Contributing Guide is depend on the "[hxhS (hugoalh & hugoalh Studio) Universal Contributing Guide](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md)", along with revises and take precedence over it.

## Revises

*This project does not have any revise.*
142 changes: 31 additions & 111 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,127 +8,43 @@

An ES (JavaScript & TypeScript) module to dissect the string; Safe with the emojis, URLs, and words.

## 🎯 Target
## 🔰 Begin

- Bun ^ v1.0.0
- Cloudflare Workers
- Deno >= v1.34.0 / >= v1.41.1 (For JSR Only)
> **🛡️ Require Permission**
>
> *N/A*
- NodeJS >= v20.9.0
### 🎯 Targets

## 🔰 Usage

### Via JSR With `node_modules`

> **🎯 Supported Target**
>
> - Bun
> - Cloudflare Workers
> - NodeJS
1. Install via:
- Bun
```sh
bunx jsr add @hugoalh/string-dissect[@${Tag}]
```
- NPM
```sh
npx jsr add @hugoalh/string-dissect[@${Tag}]
```
- PNPM
```sh
pnpm dlx jsr add @hugoalh/string-dissect[@${Tag}]
```
- Yarn
```sh
yarn dlx jsr add @hugoalh/string-dissect[@${Tag}]
```
2. Import at the script:
```ts
import ... from "@hugoalh/string-dissect";
```
| | **Registry - JSR** | **Registry - NPM** | **Remote Import** |
|:--|:--|:--|:--|
| **[Bun](https://bun.sh/)** >= v1.1.0 | [✔️ `node_modules`](https://jsr.io/docs/npm-compatibility) | [✔️ Specifier `npm:`](https://bun.sh/docs/runtime/autoimport) ||
| **[Cloudflare Workers](https://workers.cloudflare.com/)** | [✔️ `node_modules`](https://jsr.io/docs/with/cloudflare-workers) | [✔️ `node_modules`](https://docs.npmjs.com/using-npm-packages-in-your-projects) ||
| **[Deno](https://deno.land/)** >= v1.42.0 | [✔️ Specifier `jsr:`](https://jsr.io/docs/with/deno) | [✔️ Specifier `npm:`](https://docs.deno.com/runtime/manual/node/npm_specifiers) | [✔️](https://docs.deno.com/runtime/manual/basics/modules/#remote-import) |
| **[NodeJS](https://nodejs.org/)** >= v20.9.0 | [✔️ `node_modules`](https://jsr.io/docs/with/node) | [✔️ `node_modules`](https://docs.npmjs.com/using-npm-packages-in-your-projects) ||

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.
> It is possible to use this module in other methods/ways which not listed in here, however it is not officially supported.
### Via JSR With Specifier
### #️⃣ Registries Identifier

> **🎯 Supported Target**
>
> - Deno

1. Import at the script:
```ts
import ... from "jsr:@hugoalh/string-dissect[@${Tag}]";
```

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.

### Via NPM With `node_modules`

> **🎯 Supported Target**
>
> - Cloudflare Workers
> - NodeJS

1. Install via:
- NPM
```sh
npm install @hugoalh/string-dissect[@${Tag}]
```
- PNPM
```sh
pnpm add @hugoalh/string-dissect[@${Tag}]
```
- Yarn
```sh
yarn add @hugoalh/string-dissect[@${Tag}]
```
2. Import at the script:
```ts
import ... from "@hugoalh/string-dissect";
```

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.

### Via NPM With Specifier

> **🎯 Supported Target**
>
> - Bun
> - Deno

1. Import at the script:
```ts
import ... from "npm:@hugoalh/string-dissect[@${Tag}]";
```
- **JSR:**
```
@hugoalh/string-dissect
```
- **NPM:**
```
@hugoalh/string-dissect
```

> **ℹ️ Note**
>
> - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.
> - It is recommended to import the module with tag for immutability.
> - It is recommended to use this module with tag for immutability.
### Via Remote Import

> **🎯 Supported Target**
>
> - Deno
### #️⃣ Remote Import Paths

1. Import at the script:
```ts
/* Via GitHub Raw (Require Tag) */
import ... from "https://raw.githubusercontent.com/hugoalh-studio/string-dissect-es/${Tag}/mod.ts";
```
- **GitHub Raw:** (Require Tag)
```
https://raw.githubusercontent.com/hugoalh-studio/string-dissect-es/${Tag}/mod.ts
```

> **ℹ️ Note**
>
Expand All @@ -141,7 +57,11 @@ An ES (JavaScript & TypeScript) module to dissect the string; Safe with the emoj
> These elements are not considered part of the public API, thus no stability is guaranteed for them.
> - Although there have 3rd party services which provide enhanced, equal, or similar methods/ways to remote import the module, beware these services maybe inject unrelated elements and thus affect the security.
## 🧩 API
### 🛡️ Permissions

*This module does not require any permission.*

## 🧩 APIs

- ```ts
class StringDissector {
Expand Down Expand Up @@ -199,7 +119,7 @@ An ES (JavaScript & TypeScript) module to dissect the string; Safe with the emoj
```
- ```ts
interface StringSegmentDescriptor {
type: StringSegmentType;
type: `${StringSegmentType}`;
value: string;
}
```
Expand All @@ -220,7 +140,7 @@ An ES (JavaScript & TypeScript) module to dissect the string; Safe with the emoj
> - [Deno CLI `deno doc`](https://deno.land/manual/tools/documentation_generator)
> - [JSR](https://jsr.io/@hugoalh/string-dissect)

## ✍️ Example
## ✍️ Examples

- ```ts
const sample1 = "Vel ex sit est sit est tempor enim et voluptua consetetur gubergren gubergren ut.";
Expand Down
14 changes: 6 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
> LTS("Long Term Support")
> Maintenance("Maintenance")
> EOL("End Of Life")
> Unstable --> Pre
> Pre --> Release
> subgraph Support
> Unstable --> Pre --> Release
> subgraph Supported
> Release -- Major = 0 --> Maintenance
> Release -- Major > 0 --> LTS
> LTS --> Maintenance
> Release -- Major > 0 --> LTS --> Maintenance
> end
> Maintenance --> EOL
> ```
Expand All @@ -32,10 +30,10 @@

> **ℹ️ Note**
>
> - The date format is according to ISO 8601 standard.
> - The date format is according to the specification ISO 8601.
> - Values in italic format are subject to change.
> - Versions which not in the list are also end of life.
## Report A Vulnerability
## Report Vulnerabilities

You can report a security vulnerability by [create a security vulnerability report](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md#create-a-security-vulnerability-report).
You can report security vulnerabilities by [create security vulnerability report](https://github.com/hugoalh/hugoalh/blob/main/universal-guide/contributing.md#create-a-security-vulnerability-report).
11 changes: 6 additions & 5 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"singleQuote": false,
"useTabs": true
},
"imports": {
// Only remap development dependencies! For more information, please visit https://docs.deno.com/runtime/manual/basics/import_maps.
"imports": { // IMPORTANT: Remap development dependencies only!
"DNT": "jsr:@deno/dnt@0.41.1",
"STD/": "https://deno.land/std@0.222.1/"
"STD/assert": "jsr:@std/assert@0.224.0",
"STD/fs": "jsr:@std/fs@0.224.0"
},
"lint": {
"rules": {
Expand All @@ -36,9 +36,10 @@
},
"lock": false,
"tasks": {
// Check JSR package metadata. `deno publish` have weird behaviours, always check before release! For more information, please visit https://github.com/denoland/deno/issues/22648.
// Check JSR package metadata. `deno publish` maybe have different behaviours between different versions, always check before release!
"jsr-check": "deno publish --allow-dirty --config jsr.jsonc --dry-run --no-provenance",
// Build NPM package.
"npm-build": "deno run --allow-all --deny-hrtime --no-prompt --quiet .dnt.ts"
}
},
"unstable": [ ]
}
5 changes: 3 additions & 2 deletions jsr.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is only for JSR related, non-JSR related must set in the file `deno.jsonc`!
{
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
"name": "@hugoalh/string-dissect",
"version": "3.0.0",
"version": "3.0.1",
"exports": {
".": "./mod.ts"
},
Expand All @@ -27,6 +27,7 @@
"npm/**"
],
"include": [
"**/*.json",
"**/*.ts",
"**/*.tsx",
"jsr.jsonc",
Expand Down
2 changes: 1 addition & 1 deletion mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "STD/assert/assert_equals.ts";
import { assertEquals } from "STD/assert/assert-equals";
import { StringDissector } from "./mod.ts";
const sample1 = "Vel ex sit est sit est tempor enim et voluptua consetetur gubergren gubergren ut.";
const sample2 = "🤝💑💏👪👨‍👩‍👧‍👦👩‍👦👩‍👧‍👦🧑‍🤝‍🧑";
Expand Down
4 changes: 2 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export enum StringSegmentType {
* String segment descriptor.
*/
export interface StringSegmentDescriptor {
type: StringSegmentType;
type: `${StringSegmentType}`;
value: string;
}
/**
Expand All @@ -62,7 +62,7 @@ export interface StringSegmentDescriptorExtend extends StringSegmentDescriptor {
interface StringDissectSegmentByRegExpParameters {
matcher: RegExp;
segment: string;
type: StringSegmentType;
type: `${StringSegmentType}`;
}
/**
* @access private
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hugoalh/string-dissect",
"version": "3.0.0",
"version": "3.0.1",
"description": "A module to dissect the string; Safe with the emojis, URLs, and words.",
"keywords": [
"dissect",
Expand Down

0 comments on commit 582428f

Please sign in to comment.