BREAKING CHANGE(core): switch to esm
This commit is contained in:
parent
cf6d1b2b04
commit
548c8147e6
@ -12,40 +12,36 @@ stages:
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- pnpm install -g pnpm
|
||||
- pnpm install -g @shipzone/npmci
|
||||
- npmci npm prepare
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
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
|
||||
- npmci command pnpm audit --audit-level=high --prod
|
||||
tags:
|
||||
- lossless
|
||||
- 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
|
||||
- npmci command pnpm audit --audit-level=high --dev
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
@ -56,7 +52,6 @@ auditDevDependencies:
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -67,7 +62,6 @@ testStable:
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
@ -96,10 +90,9 @@ codequality:
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
@ -119,11 +112,9 @@ trigger:
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
- npmci command npm run buildDocs
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,28 +2,10 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${relativeFile}"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"name": "test.ts",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"test/test.ts"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitrepo": "smartcrypto",
|
||||
"shortDescription": "easy crypto methods",
|
||||
"description": "easy crypto methods",
|
||||
"npmPackagename": "@pushrocks/smartcrypto",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks"
|
||||
|
11264
package-lock.json
generated
11264
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@ -9,20 +9,20 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
"build": "(tsbuild --web)",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsrun": "^1.2.39",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@pushrocks/tapbundle": "^3.2.14",
|
||||
"@types/node": "^14.14.31",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"@pushrocks/tapbundle": "^5.0.4",
|
||||
"@types/node": "^18.11.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.1.3",
|
||||
"@types/node-forge": "^0.9.7",
|
||||
"node-forge": "^0.10.0"
|
||||
"@types/node-forge": "^1.3.0",
|
||||
"node-forge": "^1.3.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
@ -38,5 +38,6 @@
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
],
|
||||
"type": "module"
|
||||
}
|
4351
pnpm-lock.yaml
generated
Normal file
4351
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,10 @@ Platform support | [ or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
||||
|
||||
## Contribution
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartcrypto from '../ts/index';
|
||||
import * as smartcrypto from '../ts/index.js';
|
||||
|
||||
let testSmartCrypto: smartcrypto.Smartcrypto;
|
||||
|
||||
tap.test('first test', async () => {
|
||||
testSmartCrypto = new smartcrypto.Smartcrypto();
|
||||
expect(testSmartCrypto).to.be.instanceOf(smartcrypto.Smartcrypto);
|
||||
expect(testSmartCrypto).toBeInstanceOf(smartcrypto.Smartcrypto);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartcrypto',
|
||||
version: '2.0.0',
|
||||
description: 'easy crypto methods'
|
||||
}
|
10
ts/index.ts
10
ts/index.ts
@ -1,8 +1,8 @@
|
||||
export * from './smartcrypto.classes.smartcrypto';
|
||||
export * from './smartcrypto.classes.keypair';
|
||||
export * from './smartcrypto.classes.privatekey';
|
||||
export * from './smartcrypto.classes.publickey';
|
||||
export * from './smartcrypto.classes.smartcrypto.js';
|
||||
export * from './smartcrypto.classes.keypair.js';
|
||||
export * from './smartcrypto.classes.privatekey.js';
|
||||
export * from './smartcrypto.classes.publickey.js';
|
||||
|
||||
import { nodeForge } from './smartcrypto.plugins';
|
||||
import { nodeForge } from './smartcrypto.plugins.js';
|
||||
|
||||
export { nodeForge };
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from './smartcrypto.plugins';
|
||||
import { PublicKey } from './smartcrypto.classes.publickey';
|
||||
import { PrivateKey } from './smartcrypto.classes.privatekey';
|
||||
import * as plugins from './smartcrypto.plugins.js';
|
||||
import { PublicKey } from './smartcrypto.classes.publickey.js';
|
||||
import { PrivateKey } from './smartcrypto.classes.privatekey.js';
|
||||
|
||||
export class KeyPair {
|
||||
// STATIC
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smartcrypto.plugins';
|
||||
import * as plugins from './smartcrypto.plugins.js';
|
||||
|
||||
export class PrivateKey {
|
||||
// STATIC
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smartcrypto.plugins';
|
||||
import * as plugins from './smartcrypto.plugins.js';
|
||||
|
||||
export class PublicKey {
|
||||
// STATIC
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './smartcrypto.plugins';
|
||||
import { KeyPair } from './smartcrypto.classes.keypair';
|
||||
import * as plugins from './smartcrypto.plugins.js';
|
||||
import { KeyPair } from './smartcrypto.classes.keypair.js';
|
||||
|
||||
export class Smartcrypto {
|
||||
public async createKeyPair(): Promise<KeyPair> {
|
||||
|
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
17
tslint.json
17
tslint.json
@ -1,17 +0,0 @@
|
||||
{
|
||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||
"rules": {
|
||||
"semicolon": [true, "always"],
|
||||
"no-console": false,
|
||||
"ordered-imports": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"member-ordering": {
|
||||
"options":{
|
||||
"order": [
|
||||
"static-method"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultSeverity": "warning"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user