4 Commits

Author SHA1 Message Date
8c4404ff68 5.0.1 2022-04-18 22:17:11 +02:00
f2e91b8e1b fix(core): update 2022-04-18 22:17:10 +02:00
31bcc5f8c2 5.0.0 2022-04-18 22:16:46 +02:00
216eabe035 BREAKING CHANGE(core): switch to ESM 2022-04-18 22:16:46 +02:00
15 changed files with 15764 additions and 2161 deletions

View File

@ -12,6 +12,9 @@ stages:
- release - release
- metadata - metadata
before_script:
- npm install -g @shipzone/npmci
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
@ -19,23 +22,36 @@ mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
only:
- tags
tags: tags:
- lossless - lossless
- docker - docker
- notpriv - notpriv
audit: 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 image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command npm audit --audit-level=high --only=dev
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -50,9 +66,7 @@ testStable:
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
@ -63,9 +77,7 @@ testBuild:
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- notpriv
release: release:
stage: release stage: release
@ -85,11 +97,12 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- lossless - lossless
- docker - docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${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"
} }
] ]
} }

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

View File

@ -9,7 +9,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "projectinfo", "gitrepo": "projectinfo",
"shortDescription": "gather information about projects. supports npm, git etc.", "description": "gather information about projects. supports npm, git etc.",
"npmPackagename": "@pushrocks/projectinfo", "npmPackagename": "@pushrocks/projectinfo",
"license": "MIT" "license": "MIT"
} }

17719
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,14 @@
{ {
"name": "@pushrocks/projectinfo", "name": "@pushrocks/projectinfo",
"version": "4.0.5", "version": "5.0.1",
"private": false, "private": false,
"description": "gather information about projects. supports npm, git etc.", "description": "gather information about projects. supports npm, git etc.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -27,19 +28,19 @@
}, },
"homepage": "https://gitlab.com/pushrocks/projectinfo#readme", "homepage": "https://gitlab.com/pushrocks/projectinfo#readme",
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@gitzone/tsbuild": "^2.1.61",
"@gitzone/tsrun": "^1.2.12", "@gitzone/tsrun": "^1.2.32",
"@gitzone/tstest": "^1.0.33", "@gitzone/tstest": "^1.0.70",
"@pushrocks/tapbundle": "^3.2.1", "@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^14.0.6", "@types/node": "^17.0.25",
"tslint": "^6.1.2", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartfile": "^7.0.12", "@pushrocks/smartfile": "^9.0.6",
"@pushrocks/smartpath": "^4.0.3", "@pushrocks/smartpath": "^5.0.5",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartstring": "^3.0.18" "@pushrocks/smartstring": "^4.0.2"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@ -52,5 +53,8 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"browserslist": [
"last 1 chrome versions"
] ]
} }

View File

@ -19,7 +19,7 @@ TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x
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/projectinfo)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/projectinfo)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/projectinfo)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/projectinfo)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/projectinfo)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/projectinfo)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)

View File

@ -2,6 +2,7 @@
"name": "testpackage", "name": "testpackage",
"version": "1.0.0", "version": "1.0.0",
"description": "some test", "description": "some test",
"type": "module",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/someuser/somerepo.git" "url": "git+https://github.com/someuser/somerepo.git"

View File

@ -1,31 +1,32 @@
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@pushrocks/tapbundle';
import projectinfo = require('../ts/index'); import * as smartpath from '@pushrocks/smartpath';
import * as projectinfo from '../ts/index.js';
let path = require('path'); import * as path from 'path';
let testBasePath = path.resolve(__dirname); let testBasePath = path.resolve(smartpath.get.dirnameFromImportMetaUrl(import.meta.url));
let myNpm = new projectinfo.ProjectinfoNpm(testBasePath, { gitAccessToken: 'sometoken' }); let myNpm = new projectinfo.ProjectinfoNpm(testBasePath, { gitAccessToken: 'sometoken' });
tap.test('should have .packageJson', async () => { tap.test('should have .packageJson', async () => {
expect(myNpm.packageJson).have.property('version', '1.0.0'); expect(myNpm.packageJson).property('version').toEqual('1.0.0');
expect(myNpm.packageJson).have.property('name', 'testpackage'); expect(myNpm.packageJson).property('name').toEqual('testpackage');
}); });
tap.test('should have .version', async () => { tap.test('should have .version', async () => {
expect(myNpm).have.property('version', '1.0.0'); expect(myNpm).property('version').toEqual('1.0.0');
}); });
tap.test('should have .name', async () => { tap.test('should have .name', async () => {
expect(myNpm).have.property('name', 'testpackage'); expect(myNpm).property('name').toEqual('testpackage');
}); });
tap.test('should have .license', async () => { tap.test('should have .license', async () => {
expect(myNpm).have.property('license', 'MIT'); expect(myNpm).property('license').toEqual('MIT');
}); });
tap.test('should have .git', async () => { tap.test('should have .git', async () => {
expect(myNpm.git.httpsUrl).equal('https://sometoken@github.com/someuser/somerepo.git'); expect(myNpm.git.httpsUrl).toEqual('https://sometoken@github.com/someuser/somerepo.git');
}); });
tap.test('should return a name', async () => { tap.test('should return a name', async () => {
expect(projectinfo.getNpmNameForDir(testBasePath)).equal('testpackage'); expect(projectinfo.getNpmNameForDir(testBasePath)).toEqual('testpackage');
}); });
tap.start(); tap.start();

View File

@ -1,12 +1,12 @@
import plugins = require('./projectinfo.plugins'); import * as plugins from './projectinfo.plugins.js';
// direct access to classes // direct access to classes
export * from './projectinfo.classes.git'; export * from './projectinfo.classes.git.js';
export * from './projectinfo.classes.npm'; export * from './projectinfo.classes.npm.js';
export * from './projectinfo.classes.projectinfo'; export * from './projectinfo.classes.projectinfo.js';
// npm // npm
import { ProjectinfoNpm } from './projectinfo.classes.npm'; import { ProjectinfoNpm } from './projectinfo.classes.npm.js';
// quick functions // quick functions

View File

@ -1,4 +1,4 @@
import * as plugins from './projectinfo.plugins'; import * as plugins from './projectinfo.plugins.js';
export class ProjectinfoGit { export class ProjectinfoGit {
isGit: boolean; isGit: boolean;

View File

@ -1,4 +1,5 @@
import plugins = require('./projectinfo.plugins'); import * as plugins from './projectinfo.plugins.js';
export class ProjectinfoNpm { export class ProjectinfoNpm {
isNpm: boolean = false; isNpm: boolean = false;
packageJson: any; packageJson: any;

View File

@ -1,6 +1,6 @@
import * as plugins from './projectinfo.plugins'; import * as plugins from './projectinfo.plugins.js';
import { ProjectinfoNpm } from './projectinfo.classes.npm'; import { ProjectinfoNpm } from './projectinfo.classes.npm.js';
import { ProjectinfoGit } from './projectinfo.classes.git'; import { ProjectinfoGit } from './projectinfo.classes.git.js';
export type TProjectType = 'git' | 'npm'; export type TProjectType = 'git' | 'npm';
/** /**

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}

View File

@ -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"
}