Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
8c4404ff68 | |||
f2e91b8e1b | |||
31bcc5f8c2 | |||
216eabe035 | |||
bc79a9ae42 | |||
b82b6de5f5 | |||
b27c069177 | |||
b25be551f6 | |||
47da0afd4b | |||
f9296f1f26 |
23
.gitignore
vendored
23
.gitignore
vendored
@ -1,9 +1,20 @@
|
|||||||
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
docs/
|
public/
|
||||||
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
pages/
|
# caches
|
||||||
public
|
.yarn/
|
||||||
ts/**/*.js
|
.cache/
|
||||||
ts/**/*.js.map
|
.rpt2_cache
|
||||||
ts/typings/
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
|
||||||
|
# custom
|
150
.gitlab-ci.yml
150
.gitlab-ci.yml
@ -1,16 +1,19 @@
|
|||||||
# gitzone standard
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- npm install -g @shipzone/npmci
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@ -18,109 +21,114 @@ stages:
|
|||||||
mirror:
|
mirror:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g snyk
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --production --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
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
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci node install stable
|
||||||
- npmci npm test
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
testSTABLE:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci node install stable
|
||||||
- npmci npm test
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
# ====================
|
# ====================
|
||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
services:
|
only:
|
||||||
- docker:stable-dind
|
- tags
|
||||||
script:
|
script:
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
- npmci command npm install -g typescript
|
||||||
- docker run
|
- npmci npm prepare
|
||||||
--env SOURCE_CODE="$PWD"
|
- npmci npm install
|
||||||
--volume "$PWD":/code
|
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
|
||||||
artifacts:
|
|
||||||
paths: [codeclimate.json]
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g typedoc typescript
|
- npmci node install lts
|
||||||
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -128,15 +136,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
windowsCompatibility:
|
|
||||||
image: stefanscherer/node-windows:10-build-tools
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npm install & npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- windows
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm test",
|
||||||
|
"name": "Run npm test",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
45
README.md
45
README.md
@ -1,45 +0,0 @@
|
|||||||
# projectinfo
|
|
||||||
|
|
||||||
gather information about projects. supports npm, git etc.
|
|
||||||
|
|
||||||
## Availabililty
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/projectinfo)
|
|
||||||
[](https://GitLab.com/pushrocks/projectinfo)
|
|
||||||
[](https://github.com/pushrocks/projectinfo)
|
|
||||||
[](https://pushrocks.gitlab.io/projectinfo/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/projectinfo/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/projectinfo/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/projectinfo)
|
|
||||||
[](https://david-dm.org/pushrocks/projectinfo)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/projectinfo/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/projectinfo)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import { ProjectInfo } from 'projectinfo';
|
|
||||||
|
|
||||||
let myProjectInfo = new ProjectInfo('/some/path/to/proejct');
|
|
||||||
let npmName = myProjectInfo.npm.name; // returns npm name from package.json
|
|
||||||
let npmVersion = myProjectInfo.npm.version; // returns version from package.json
|
|
||||||
let gitRepo = myProjectInfo.git.gitrepo; // returns the name of the gitrepo
|
|
||||||
let gitRemotes = myProjectInfo.git.remotes; // returns array with registered remotes
|
|
||||||
|
|
||||||
// for more info check out the module in your IDE with TypeScript intellisense enabled
|
|
||||||
```
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -1,10 +1,17 @@
|
|||||||
{
|
{
|
||||||
"npmts": {
|
"npmci": {
|
||||||
"mode": "default",
|
"npmGlobalTools": [],
|
||||||
"coverageTreshold": 80
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"npmci": {
|
"gitzone": {
|
||||||
"npmGlobalTools": [],
|
"projectType": "npm",
|
||||||
"npmAccessLevel": "public"
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "projectinfo",
|
||||||
|
"description": "gather information about projects. supports npm, git etc.",
|
||||||
|
"npmPackagename": "@pushrocks/projectinfo",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
18403
package-lock.json
generated
18403
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/projectinfo",
|
"name": "@pushrocks/projectinfo",
|
||||||
"version": "4.0.2",
|
"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/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)"
|
"build": "(tsbuild --web --allowimplicitany)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -27,16 +28,33 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/projectinfo#readme",
|
"homepage": "https://gitlab.com/pushrocks/projectinfo#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.61",
|
||||||
"@gitzone/tsrun": "^1.1.12",
|
"@gitzone/tsrun": "^1.2.32",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.70",
|
||||||
"@pushrocks/tapbundle": "^3.0.5",
|
"@pushrocks/tapbundle": "^5.0.3",
|
||||||
"@types/node": "^10.9.4"
|
"@types/node": "^17.0.25",
|
||||||
|
"tslint": "^6.1.3",
|
||||||
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartfile": "^6.0.8",
|
"@pushrocks/smartfile": "^9.0.6",
|
||||||
"@pushrocks/smartpath": "^4.0.1",
|
"@pushrocks/smartpath": "^5.0.5",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"@pushrocks/smartstring": "^3.0.4"
|
"@pushrocks/smartstring": "^4.0.2"
|
||||||
}
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
51
readme.md
Normal file
51
readme.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# @pushrocks/projectinfo
|
||||||
|
gather information about projects. supports npm, git etc.
|
||||||
|
|
||||||
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/projectinfo)
|
||||||
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/projectinfo)
|
||||||
|
* [github.com (source mirror)](https://github.com/pushrocks/projectinfo)
|
||||||
|
* [docs (typedoc)](https://pushrocks.gitlab.io/projectinfo/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
|
||||||
|
Status Category | Status Badge
|
||||||
|
-- | --
|
||||||
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
|
npm | [](https://lossless.cloud)
|
||||||
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import { ProjectInfo } from 'projectinfo';
|
||||||
|
|
||||||
|
let myProjectInfo = new ProjectInfo('/some/path/to/proejct');
|
||||||
|
let npmName = myProjectInfo.npm.name; // returns npm name from package.json
|
||||||
|
let npmVersion = myProjectInfo.npm.version; // returns version from package.json
|
||||||
|
let gitRepo = myProjectInfo.git.gitrepo; // returns the name of the gitrepo
|
||||||
|
let gitRemotes = myProjectInfo.git.remotes; // returns array with registered remotes
|
||||||
|
|
||||||
|
// for more info check out the module in your IDE with TypeScript intellisense enabled
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
|
[](https://maintainedby.lossless.com)
|
@ -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"
|
||||||
|
21
test/test.ts
21
test/test.ts
@ -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();
|
||||||
|
22
ts/index.ts
22
ts/index.ts
@ -1,31 +1,21 @@
|
|||||||
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
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets the name from package.json in a specified directory
|
* gets the name from package.json in a specified directory
|
||||||
*/
|
*/
|
||||||
export let getNpmNameForDir = function(cwdArg) {
|
export let getNpmNameForDir = function (cwdArg) {
|
||||||
let localNpm = new ProjectinfoNpm(cwdArg);
|
let localNpm = new ProjectinfoNpm(cwdArg);
|
||||||
if (localNpm.status === 'ok') {
|
if (localNpm.status === 'ok') {
|
||||||
return localNpm.name;
|
return localNpm.name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* TODO
|
|
||||||
projectinfo.git = function(){
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
projectinfo.mojo = function(){
|
|
||||||
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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
9
tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext"
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "tslint-config-standard"
|
|
||||||
}
|
|
Reference in New Issue
Block a user