Compare commits

...

7 Commits

Author SHA1 Message Date
8a0c3fe906 4.0.11 2024-01-08 14:17:10 +01:00
ae861fa271 4.0.10 2023-12-27 21:57:45 +01:00
3e78466e5f fix(core): update 2023-12-27 21:57:45 +01:00
eea19bcd89 4.0.9 2023-08-31 16:31:24 +02:00
1fc95fcf0e fix(core): update 2023-08-31 16:31:23 +02:00
14ba4465d9 4.0.8 2023-08-18 13:12:26 +02:00
707e31d517 fix(core): update 2023-08-18 13:12:25 +02:00
18 changed files with 2328 additions and 1148 deletions

View File

@ -7,13 +7,13 @@ on:
env: env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}} NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs: jobs:
security: security:
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
@ -21,27 +21,27 @@ jobs:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install pnpm and npmci - name: Install pnpm and npmci
run: | run: |
pnpm install -g pnpm pnpm install -g pnpm
pnpm install -g @shipzone/npmci pnpm install -g @shipzone/npmci
- name: Run npm prepare - name: Run npm prepare
run: npmci npm prepare run: npmci npm prepare
- name: Audit production dependencies - name: Audit production dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod npmci command pnpm audit --audit-level=high --prod
continue-on-error: true continue-on-error: true
- name: Audit development dependencies - name: Audit development dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev npmci command pnpm audit --audit-level=high --dev
continue-on-error: true continue-on-error: true
test: test:
if: ${{ always() }} if: ${{ always() }}
@ -51,16 +51,16 @@ jobs:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Test stable - name: Test stable
run: | run: |
npmci node install stable npmci node install stable
npmci npm install npmci npm install
npmci npm test npmci npm test
- name: Test build - name: Test build
run: | run: |
npmci node install stable npmci node install stable
npmci npm install npmci npm install
npmci npm build npmci npm build

View File

@ -7,13 +7,13 @@ on:
env: env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}} NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}} NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}} NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}} NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs: jobs:
security: security:
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
@ -21,27 +21,25 @@ jobs:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install pnpm and npmci - name: Prepare
run: | run: |
pnpm install -g pnpm pnpm install -g pnpm
pnpm install -g @shipzone/npmci pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Run npm prepare - name: Audit production dependencies
run: npmci npm prepare run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit production dependencies - name: Audit development dependencies
run: | run: |
npmci command npm config set registry https://registry.npmjs.org npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod npmci command pnpm audit --audit-level=high --dev
continue-on-error: true continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test: test:
if: ${{ always() }} if: ${{ always() }}
@ -51,19 +49,25 @@ jobs:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Test stable - name: Prepare
run: | run: |
npmci node install stable pnpm install -g pnpm
npmci npm install pnpm install -g @shipzone/npmci
npmci npm test npmci npm prepare
- name: Test build - name: Test stable
run: | run: |
npmci node install stable npmci node install stable
npmci npm install npmci npm install
npmci npm build npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release: release:
needs: test needs: test
@ -73,12 +77,18 @@ jobs:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Release - name: Prepare
run: | run: |
npmci node install stable pnpm install -g pnpm
npmci npm publish pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata: metadata:
needs: test needs: test
@ -89,21 +99,26 @@ jobs:
continue-on-error: true continue-on-error: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Code quality - name: Prepare
run: | run: |
npmci command npm install -g typescript pnpm install -g pnpm
npmci npm prepare pnpm install -g @shipzone/npmci
npmci npm install npmci npm prepare
- name: Trigger - name: Code quality
run: npmci trigger run: |
npmci command npm install -g typescript
npmci npm install
- name: Build docs and upload artifacts - name: Trigger
run: | run: npmci trigger
npmci node install stable
npmci npm install - name: Build docs and upload artifacts
pnpm install -g @gitzone/tsdoc run: |
npmci command tsdoc npmci node install stable
continue-on-error: true npmci npm install
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

View File

@ -1,128 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -12,10 +12,10 @@
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "push.rocks",
"gitrepo": "smartstring", "gitrepo": "smartstring",
"description": "handle strings in smart ways. TypeScript ready.", "description": "handle strings in smart ways. TypeScript ready.",
"npmPackagename": "@pushrocks/smartstring", "npmPackagename": "@push.rocks/smartstring",
"license": "MIT" "license": "MIT"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartstring", "name": "@push.rocks/smartstring",
"version": "4.0.7", "version": "4.0.11",
"private": false, "private": false,
"description": "handle strings in smart ways. TypeScript ready.", "description": "handle strings in smart ways. TypeScript ready.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -13,7 +13,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://gitlab.com/pushrocks/smartstring.git" "url": "git+https://gitlab.com/push.rocks/smartstring.git"
}, },
"keywords": [ "keywords": [
"regex", "regex",
@ -22,29 +22,27 @@
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://gitlab.com/pushrocks/smartstring/issues" "url": "https://gitlab.com/push.rocks/smartstring/issues"
}, },
"homepage": "https://gitlab.com/pushrocks/smartstring#readme", "homepage": "https://gitlab.com/push.rocks/smartstring#readme",
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.66", "@git.zone/tsbuild": "^2.1.66",
"@gitzone/tsrun": "^1.2.42", "@git.zone/tsrun": "^1.2.42",
"@gitzone/tstest": "^1.0.74", "@git.zone/tstest": "^1.0.84",
"@pushrocks/tapbundle": "^5.0.8", "@push.rocks/tapbundle": "^5.0.15",
"@types/node": "^20.3.1", "@types/node": "^20.10.5"
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/isounique": "^1.0.5", "@push.rocks/isounique": "^1.0.5",
"@pushrocks/smartenv": "^5.0.5", "@push.rocks/smartenv": "^5.0.12",
"@types/randomatic": "^3.1.3", "@types/randomatic": "^3.1.5",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"crypto-random-string": "^5.0.0", "crypto-random-string": "^5.0.0",
"js-base64": "^3.7.5", "js-base64": "^3.7.5",
"normalize-newline": "^4.1.0", "normalize-newline": "^4.1.0",
"randomatic": "^3.1.1", "randomatic": "^3.1.1",
"strip-indent": "^4.0.0", "strip-indent": "^4.0.0",
"url": "^0.11.1" "url": "^0.11.3"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

3045
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,26 @@
# @pushrocks/smartstring # @push.rocks/smartstring
handle strings in smart ways. TypeScript ready. handle strings in smart ways. TypeScript ready.
## Availabililty and Links ## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartstring) * [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartstring)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartstring) * [gitlab.com (source)](https://gitlab.com/push.rocks/smartstring)
* [github.com (source mirror)](https://github.com/pushrocks/smartstring) * [github.com (source mirror)](https://github.com/push.rocks/smartstring)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartstring/) * [docs (typedoc)](https://push.rocks.gitlab.io/smartstring/)
## Status for master ## Status for master
Status Category | Status Badge Status Category | Status Badge
-- | -- -- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartstring/badges/master/pipeline.svg)](https://lossless.cloud) GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/smartstring/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartstring/badges/master/coverage.svg)](https://lossless.cloud) GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/smartstring/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartstring)](https://lossless.cloud) npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartstring)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartstring)](https://lossless.cloud) Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/smartstring)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartstring)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartstring)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartstring)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartstring)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartstring)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartstring)](https://lossless.cloud)
## Usage ## Usage

View File

@ -1,5 +1,5 @@
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
// Base64 // Base64
let testBase64: smartstring.Base64; let testBase64: smartstring.Base64;

View File

@ -1,5 +1,5 @@
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
// Docker // Docker
tap.test('expect create a Env Object', async () => { tap.test('expect create a Env Object', async () => {

View File

@ -1,5 +1,5 @@
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
// Domain // Domain
let testDomain: smartstring.Domain; let testDomain: smartstring.Domain;

View File

@ -1,5 +1,5 @@
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
// git // git
let testGit: smartstring.GitRepo; let testGit: smartstring.GitRepo;

View File

@ -1,5 +1,5 @@
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
// indent // indent
let testString = ` let testString = `

View File

@ -1,4 +1,4 @@
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
@ -9,8 +9,7 @@ tap.test('should normalize a string', async () => {
`; `;
const normalizedString = smartstring.normalize.standard(testString); const normalizedString = smartstring.normalize.standard(testString);
expect(normalizedString).toEqual( expect(normalizedString).toEqual(
` `myawesome string;
myawesome string;
is indented with two spaces is indented with two spaces
` `
); );

View File

@ -1,4 +1,4 @@
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@push.rocks/tapbundle';
import * as smartstring from '../ts/index.js'; import * as smartstring from '../ts/index.js';
tap.test('should state valuid utf8', async () => { tap.test('should state valuid utf8', async () => {

View File

@ -2,7 +2,7 @@
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @pushrocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartstring', name: '@push.rocks/smartstring',
version: '4.0.7', version: '4.0.10',
description: 'handle strings in smart ways. TypeScript ready.' description: 'handle strings in smart ways. TypeScript ready.'
} }

View File

@ -10,13 +10,42 @@ export const replaceAll = (stringArg: string, searchPattern: string, replacement
return stringArg.replace(new RegExp(searchPattern, 'g'), replacementString); return stringArg.replace(new RegExp(searchPattern, 'g'), replacementString);
}; };
export interface INormalizeOptions {
stripLeadingTrailingEmptyLines?: boolean;
stripAllEmptyLines?: boolean;
stripIndent?: boolean;
normalizeNewline?: boolean;
replaceTabs?: boolean;
}
/** /**
* normalizes a string * Normalizes a string
* @param stringArg * @param stringArg
* @param options
*/ */
export const standard = (stringArg: string): string => { export const standard = (stringArg: string, options?: INormalizeOptions): string => {
let fix1 = plugins.stripIndent(stringArg); // fix indention let result = stringArg;
let fix2 = plugins.normalizeNewline(fix1); // fix newlines
let fix3 = replaceAll(fix2, '\t/', ' '); // fix tabs if (!options || options.stripIndent) {
return fix3; result = plugins.stripIndent(result); // fix indention
}
if (!options || options.normalizeNewline) {
result = plugins.normalizeNewline(result); // fix newlines
}
if (!options || options.replaceTabs) {
result = replaceAll(result, '\t/', ' '); // fix tabs
}
if (!options || options.stripLeadingTrailingEmptyLines) {
result = result.replace(/^\s*[\r\n]/gm, '').replace(/\s*[\r\n]$/gm, '');
}
if (!options || options.stripAllEmptyLines) {
result = result.replace(/^\s*[\r\n]/gm, '');
}
return result;
}; };

View File

@ -1,7 +1,7 @@
// node native // node native
import * as smartenv from '@pushrocks/smartenv'; import * as smartenv from '@push.rocks/smartenv';
const smartenvInstance = new smartenv.Smartenv(); const smartenvInstance = new smartenv.Smartenv();
import * as isounique from '@pushrocks/isounique'; import * as isounique from '@push.rocks/isounique';
export { isounique }; export { isounique };

View File

@ -1,7 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "ES2022",
"moduleResolution": "nodenext" "moduleResolution": "nodenext",
"esModuleInterop": true,
"verbatimModuleSyntax": true,
} }
} }