Skip to content

Commit 1ba1c89

Browse files
committed
Merge 3cc2a61 into 564b1e0
skip-checks: true
2 parents 564b1e0 + 3cc2a61 commit 1ba1c89

17 files changed

+571
-50
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Help me get rid of bugs
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Specifications:**
11+
12+
- code version:
13+
- platform:
14+
- npm version:
15+
- node version:
16+
17+
**Expected Behavior**
18+
19+
<!-- how it should work -->
20+
21+
**Actual Behavior**
22+
23+
<!-- how it's working -->
24+
25+
**Steps to Reproduce the Problem:**
26+
27+
1.
28+
1.
29+
1.
30+
31+
**Screenshots**
32+
33+
<!-- if applicable -->
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an improvement
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe what need the feature would fulfill**
11+
12+
<!-- how you came across the idea for this feature -->
13+
14+
**Describe how the need could be fulfilled**
15+
16+
<!-- suggestions you might have to fulfill this need -->
17+
18+
**Describe any alternatives considered**
19+
20+
<!-- other solutions or features you might have considered -->
21+
22+
**List any references that might showcase a similar feature:**
23+
24+
-
25+
-
26+
-

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Fixes #
2+
3+
**Proposed Changes:**
4+
5+
-
6+
-
7+
-

.github/workflows/cicd.yml

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ jobs:
2929
contents: write
3030
steps:
3131

32-
- run: curl -o 'GitVersion.yml' 'https://gist.githubusercontent.com/KamaranL/9e5c6d02123d4ef984a676e57602a4ef/raw/ContinuousDeployment.yml'
33-
working-directory: ${{ runner.temp }}
34-
3532
- uses: actions/checkout@v4
3633
with:
3734
fetch-depth: 0
@@ -41,23 +38,13 @@ jobs:
4138

4239
- run: npm run test
4340

41+
- run: npm run build:docs
42+
4443
- run: |
45-
SSH="${{ runner.temp }}/ssh"
46-
mkdir -p $SSH
47-
echo -e "${{ secrets.SSH_ID }}" >"$SSH/id"
48-
echo -e "${{ secrets.SSH_ID_PUB }}" >"$SSH/id.pub"
49-
echo -e "${{ secrets.SSH_ALLOWED_SIGNERS }}" >"$SSH/allowed_signers"
50-
chmod 0600 "$SSH/id"
51-
52-
git config --global user.name "GitHub Actions"
53-
git config --global user.email "lossy.typist.0i@icloud.com"
54-
git config --global user.signingkey "$SSH/id.pub"
55-
git config --global gpg.format "ssh"
56-
git config --global gpg.ssh.allowedsignersfile "$SSH/allowed_signers"
57-
git config --global commit.gpgsign true
58-
git config --global tag.gpgsign true
59-
git config --global push.followtags true
60-
name: Set up Git
44+
source <(curl -s -H "Authorization: token $GH_TOKEN" 'https://gist.githubusercontent.com/KamaranL/a3e6bc50b52459b103f6b36ec3428f5d/raw/.action_profile')
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
name: Set up environment
6148
6249
- uses: gittools/actions/gitversion/setup@v0
6350
with:
@@ -66,43 +53,35 @@ jobs:
6653
- uses: gittools/actions/gitversion/execute@v0
6754
with:
6855
useConfigFile: true
69-
configFilePath: '${{ runner.temp }}/GitVersion.yml'
70-
71-
- run: |
72-
[ "${{ github.event_name }}" == workflow_dispatch -a "${{ github.ref_name }}" != main ] && echo "CI_CREATE_TAG=true" >>"$GITHUB_ENV"
73-
74-
echo "CI_VERSION=${{ env.GITVERSION_FULLSEMVER }}" >>"$GITHUB_ENV"
75-
echo "CI_BRANCH=${{ github.ref_name }}" >>"$GITHUB_ENV"
76-
77-
if [ "${{ github.event_name }}" == pull_request -a "${{ github.base_ref }}" == main -a "${{ github.head_ref }}" == dev ]; then
78-
echo "CI_VERSION=${{ env.GITVERSION_MAJORMINORPATCH }}" >>"$GITHUB_ENV"
79-
echo "CI_BRANCH=${{ github.head_ref }}" >>"$GITHUB_ENV"
80-
echo "CI_CREATE_TAG=true" >>"$GITHUB_ENV"
56+
configFilePath: '${{ env.GV_CONFIG }}'
8157

82-
gh release view v1.0.0 >/dev/null 2>&1 || echo "CI_VERSION=1.0.0" >>"$GITHUB_ENV"
83-
fi
84-
env:
85-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86-
name: Set CI_ vars
58+
- run: bash $CI_SCRIPT
59+
name: Set CI vars
8760

8861
- run: |
89-
echo ${{ env.CI_VERSION }} >VERSION.txt
90-
npm version --quiet --allow-same-version --no-commit-hooks --no-git-tag-version ${{ env.CI_VERSION }}
62+
echo "$CI_VERSION" >VERSION.txt
63+
npm version --quiet --allow-same-version --no-commit-hooks --no-git-tag-version "$CI_VERSION"
9164
name: Update manifests
9265
9366
- run: |
67+
source $GH_RC
68+
9469
git commit -a --amend --no-edit --date=now --trailer "skip-checks: true"
9570
96-
[ ${{ env.CI_CREATE_TAG }} ] && git tag -a v${{ env.CI_VERSION }} -m v${{ env.CI_VERSION }} $(git rev-parse HEAD) && echo "CI_CREATE_RELEASE=true" >>"$GITHUB_ENV"
71+
[ $CI_CREATE_TAG ] && git tag -a v$CI_VERSION -m v$CI_VERSION $(git rev-parse HEAD) && core.set-env CI_CREATE_RELEASE "true"
9772
98-
git push origin $(git rev-parse HEAD):${{ env.CI_BRANCH }} --force-with-lease
73+
git push origin $(git rev-parse HEAD):$CI_BRANCH --force-with-lease
9974
name: Commit back to source
10075
101-
- run: gh release create v${{ env.CI_VERSION }} --generate-notes --verify-tag && echo "CI_CD=true" >>"$GITHUB_OUTPUT" && echo "CI_TAG=v${{ env.CI_VERSION }}" >>"$GITHUB_OUTPUT"
76+
- run: |
77+
source $GH_RC
78+
79+
gh release create v$CI_VERSION --latest --generate-notes --verify-tag && core.set-output CI_CD "true" && core.set-output CI_TAG "v$CI_VERSION"
10280
id: release
10381
if: env.CI_CREATE_RELEASE
10482
env:
10583
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
name: Create release v${{ env.CI_VERSION }}
10685
10786
outputs:
10887
cd: ${{ steps.release.outputs.CI_CD }}
@@ -112,8 +91,6 @@ jobs:
11291
needs: ci
11392
if: needs.ci.outputs.cd
11493
runs-on: ubuntu-latest
115-
permissions:
116-
packages: write
11794
steps:
11895

11996
- uses: actions/checkout@v4
@@ -131,6 +108,14 @@ jobs:
131108
node-version: 'latest'
132109
registry-url: 'https://registry.npmjs.org'
133110

134-
- run: npm publish
111+
- run: |
112+
source <(curl -s -H "Authorization: token $GH_TOKEN" 'https://gist.githubusercontent.com/KamaranL/e0c9feb6f3bc2a296cef3258c5fdc184/raw/.actionrc')
113+
114+
NPM_TOKEN=$(get-secret NPM.CICD)
115+
core.add-mask "$NPM_TOKEN"
116+
core.set-env NODE_AUTH_TOKEN "$NPM_TOKEN"
135117
env:
136-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
118+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
name: Get token
120+
121+
- run: npm publish

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ build/Release
9393
coverage
9494
dist/
9595
dist/**/*
96-
docs/
9796
ehthumbs.db
9897
ehthumbs_vista.db
9998
jspm_packages/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
> JavaScript standard library extensions
44
5-
[![cicd](https://github.com/KamaranL/js-stdlib-extensions/actions/workflows/cicd.yml/badge.svg?branch=dev)](https://github.com/KamaranL/js-stdlib-extensions/actions/workflows/cicd.yml)
5+
[![view cicd status](https://github.com/KamaranL/js-stdlib-extensions/actions/workflows/cicd.yml/badge.svg?branch=dev)](https://github.com/KamaranL/js-stdlib-extensions/actions/workflows/cicd.yml)
6+
[![view on npmjs](https://badgen.net/npm/v/js-stdlib-extensions?icon=)](https://www.npmjs.com/package/js-stdlib-extensions)
7+
![type status](https://badgen.net/npm/types/js-stdlib-extensions?icon=typescript)
68

79
## Installation and Usage
810

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.22.0
1+
1.0.0

docs/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
js-stdlib-extensions / [Exports](/docs/modules.md)
2+
3+
# js-stdlib-extensions
4+
5+
> JavaScript standard library extensions
6+
7+
[![view cicd status](https://github.com/KamaranL/js-stdlib-extensions/actions/workflows/cicd.yml/badge.svg?branch=dev)](https://github.com/KamaranL/js-stdlib-extensions/actions/workflows/cicd.yml)
8+
[![view on npmjs](https://badgen.net/npm/v/js-stdlib-extensions?icon=)](https://www.npmjs.com/package/js-stdlib-extensions)
9+
![type status](https://badgen.net/npm/types/js-stdlib-extensions?icon=typescript)
10+
11+
## Installation and Usage
12+
13+
### Prerequisites
14+
15+
- [Node.js](https://nodejs.org/) `>=20.10.0`
16+
17+
### Install
18+
19+
```bash
20+
npm i js-stdlib-extensions
21+
```
22+
23+
### Usage
24+
25+
#### Import into package
26+
27+
```javascript
28+
// javascript
29+
require('js-stdlib-extensions')
30+
31+
// typescript
32+
import 'js-stdlib-extensions'
33+
```
34+
35+
### [Docs](/docs/modules.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[js-stdlib-extensions](/docs/README.md) / [Exports](/docs/modules.md) / [ArrayExtensions](/docs/modules/ArrayExtensions.md) / Array
2+
3+
# Interface: Array\<T\>
4+
5+
[ArrayExtensions](/docs/modules/ArrayExtensions.md).Array
6+
7+
Array
8+
9+
## Type parameters
10+
11+
| Name |
12+
| :------ |
13+
| `T` |
14+
15+
## Table of contents
16+
17+
### Methods
18+
19+
- [isEmpty](/docs/interfaces/ArrayExtensions.Array.md#isempty)
20+
21+
## Methods
22+
23+
### isEmpty
24+
25+
**isEmpty**(): `boolean`
26+
27+
Returns true if the length of the array is 0.
28+
29+
#### Returns
30+
31+
`boolean`
32+
33+
**`Example`**
34+
35+
```ts
36+
// returns true
37+
[].isEmpty()
38+
```
39+
40+
#### Defined in
41+
42+
[array.ts:17](https://github.com/KamaranL/js-stdlib-extensions/blob/13d3725/src/ext/array.ts#L17)

0 commit comments

Comments
 (0)