Compare commits

...

13 Commits

Author SHA1 Message Date
9e79ea4e70 update description 2024-05-29 14:11:27 +02:00
ecc5dee2ee update tsconfig 2024-04-14 17:15:51 +02:00
5ac7470e24 update npmextra.json: githost 2024-04-01 21:33:28 +02:00
3f9e0f2907 update npmextra.json: githost 2024-04-01 19:57:31 +02:00
c3bc4630bd update npmextra.json: githost 2024-03-30 21:46:28 +01:00
3d346b0515 5.0.2 2023-08-08 18:06:23 +02:00
6d12041154 fix(core): update 2023-08-08 18:06:23 +02:00
db6b2aa8c1 switch to new org scheme 2023-07-11 00:06:23 +02:00
fd4bd1919e switch to new org scheme 2023-07-10 02:41:49 +02:00
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
21 changed files with 5178 additions and 4958 deletions

View File

@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
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_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
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 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:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
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_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Audit production dependencies
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 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:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @gitzone/tsdoc
npmci command tsdoc
continue-on-error: true

View File

@ -1,127 +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
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- lossless
- docker
- notpriv
audit:
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
tags:
- lossless
- docker
- notpriv
# ====================
# 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:
- lossless
- docker
- priv
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:
- lossless
- docker
- notpriv
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
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

24
.vscode/launch.json vendored
View File

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

View File

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

View File

@ -6,12 +6,23 @@
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "projectinfo",
"shortDescription": "gather information about projects. supports npm, git etc.",
"npmPackagename": "@pushrocks/projectinfo",
"license": "MIT"
"description": "A tool for gathering project information, supporting npm, git, and more.",
"npmPackagename": "@push.rocks/projectinfo",
"license": "MIT",
"keywords": [
"project-info",
"npm",
"git",
"typescript",
"package-info",
"repository"
]
}
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

4705
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +1,46 @@
{
"name": "@pushrocks/projectinfo",
"version": "4.0.5",
"name": "@push.rocks/projectinfo",
"version": "5.0.2",
"private": false,
"description": "gather information about projects. supports npm, git etc.",
"description": "A tool for gathering project information, supporting npm, git, and more.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web --allowimplicitany)",
"buildDocs": "tsdoc"
},
"repository": {
"type": "git",
"url": "git+https://gitlab.com/pushrocks/projectinfo.git"
"url": "https://code.foss.global/push.rocks/projectinfo.git"
},
"keywords": [
"project",
"project-info",
"npm",
"git",
"info",
"package"
"typescript",
"package-info",
"repository"
],
"author": "Lossless GmbH",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/pushrocks/projectinfo/issues"
},
"homepage": "https://gitlab.com/pushrocks/projectinfo#readme",
"homepage": "https://code.foss.global/push.rocks/projectinfo",
"devDependencies": {
"@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.33",
"@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^14.0.6",
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0"
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsrun": "^1.2.44",
"@git.zone/tstest": "^1.0.77",
"@push.rocks/tapbundle": "^5.0.12",
"@types/node": "^20.4.8"
},
"dependencies": {
"@pushrocks/smartfile": "^7.0.12",
"@pushrocks/smartpath": "^4.0.3",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartstring": "^3.0.18"
"@push.rocks/smartfile": "^10.0.28",
"@push.rocks/smartpath": "^5.0.11",
"@push.rocks/smartpromise": "^4.0.3",
"@push.rocks/smartstring": "^4.0.2"
},
"files": [
"ts/**/*",
@ -52,5 +53,8 @@
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
]
}
}

4804
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

122
readme.md
View File

@ -1,51 +1,103 @@
# @pushrocks/projectinfo
# @push.rocks/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/)
## Install
## Status for master
To install `@push.rocks/projectinfo`, you need a Node.js environment with npm. It's recommended to have TypeScript and ts-node installed for the best development experience. Run the following command:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/projectinfo/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/projectinfo/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/projectinfo)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/projectinfo)](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/)
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 (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)
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)
```bash
npm install @push.rocks/projectinfo --save
```
This will add it to your project's `package.json` file and download the package into the `node_modules` folder.
## Usage
Use TypeScript for best in class instellisense.
The `@push.rocks/projectinfo` module provides a powerful interface to gather detailed information about your projects, focusing on common project management tools like npm and git. Below are various examples and use cases demonstrating how to use this module effectively.
```javascript
import { ProjectInfo } from 'projectinfo';
### Setup
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
First, make sure to import `ProjectInfo` from the package in your TypeScript file. Here's how to get started:
// for more info check out the module in your IDE with TypeScript intellisense enabled
```typescript
import { ProjectInfo } from '@push.rocks/projectinfo';
```
## Contribution
### Gathering NPM Information
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). :)
If you wish to extract npm-related information such as the project name and version from your `package.json`, you can instantiate `ProjectInfo` and access the `npm` property.
For further information read the linked docs at the top of this readme.
```typescript
const projectInfo = new ProjectInfo('./path/to/your/project');
console.log(`Project Name: ${projectInfo.npm.name}`);
console.log(`Project Version: ${projectInfo.npm.version}`);
```
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
This example assumes that your current working directory (`cwd`) is set correctly relative to your project. Adjust `'./path/to/your/project'` as necessary.
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
### Accessing Git Information
Similarly, to extract git-related information, you can access the `git` property. This allows you to get details about the git repository;
```typescript
console.log(`Git Repository: ${projectInfo.git.gitrepo}`);
// Outputs the git repository name
console.log(`Git User/Organization: ${projectInfo.git.gituser}`);
// Outputs the git user or organization name
```
It is important to note that these git properties are parsed from the local git configuration, so your project needs to be initialized with git and properly configured.
### Working with Asynchronous Operations
While the basic usage examples above are synchronous, `@push.rocks/projectinfo` might also offer functionality that requires async/await for operations that involve I/O processes, such as reading files or fetching data from remote APIs. Always refer to the specific method documentation to understand its nature (synchronous or asynchronous) and use it appropriately in your code.
### Integrating with Other Push.rocks Modules
The `@push.rocks/projectinfo` package is designed to work seamlessly with other packages from the Push.rocks suite. For instance, it utilizes `@push.rocks/smartfile` for efficient file handling, `@push.rocks/smartpath` for path manipulations, and `@push.rocks/smartpromise` for enhanced promise-based operations. This interconnectivity allows for a more integrated and efficient toolset when managing complex project setups.
### Advanced Usage and Customization
For more advanced use cases, such as customizing the way information is gathered or integrating `@push.rocks/projectinfo` into larger workflows, you are encouraged to explore the package's source code and accompanying documentation. The modular design and comprehensive TypeScript typings facilitate customization and extension to meet specific project requirements.
### Error Handling
When utilizing `@push.rocks/projectinfo` in your project automation or scripts, make sure to implement proper error handling. This helps in gracefully handling situations where project information might be missing, malformatted, or when underlying tools (npm, git) are not available in the environment.
```typescript
try {
const projectInfo = new ProjectInfo('./path/to/your/project');
// Use projectInfo as needed
} catch (error) {
console.error('Failed to gather project info:', error);
}
```
### Summary
`@push.rocks/projectinfo` offers a versatile and powerful API for gathering and managing project information, making it an invaluable tool for developers looking to automate project setups, CI/CD pipelines, or simply organize and access project metadata more efficiently. Its integration with npm and git provides a solid foundation for extracting, analyzing, and utilizing essential project data across various aspects of software development and deployment workflows.
By leveraging TypeScript for development, users are afforded the benefits of static typing, including better autocompletion, easier refactorings, and improved code quality. This document has outlined basic and advanced usage scenarios, aiming to equip developers with the knowledge to effectively incorporate `@push.rocks/projectinfo` into their projects.
Note: The examples above are designed to be straightforward and easy to follow. Depending on the complexity and requirements of your specific project, you might need to adapt these examples. Always refer to the official documentation and TypeScript typings for the most accurate and up-to-date information.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

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

View File

@ -1,31 +1,32 @@
import { tap, expect } from '@pushrocks/tapbundle';
import projectinfo = require('../ts/index');
import { tap, expect } from '@push.rocks/tapbundle';
import * as smartpath from '@push.rocks/smartpath';
import * as projectinfo from '../ts/index.js';
let path = require('path');
let testBasePath = path.resolve(__dirname);
import * as path from 'path';
let testBasePath = path.resolve(smartpath.get.dirnameFromImportMetaUrl(import.meta.url));
let myNpm = new projectinfo.ProjectinfoNpm(testBasePath, { gitAccessToken: 'sometoken' });
tap.test('should have .packageJson', async () => {
expect(myNpm.packageJson).have.property('version', '1.0.0');
expect(myNpm.packageJson).have.property('name', 'testpackage');
expect(myNpm.packageJson).property('version').toEqual('1.0.0');
expect(myNpm.packageJson).property('name').toEqual('testpackage');
});
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 () => {
expect(myNpm).have.property('name', 'testpackage');
expect(myNpm).property('name').toEqual('testpackage');
});
tap.test('should have .license', async () => {
expect(myNpm).have.property('license', 'MIT');
expect(myNpm).property('license').toEqual('MIT');
});
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 () => {
expect(projectinfo.getNpmNameForDir(testBasePath)).equal('testpackage');
expect(projectinfo.getNpmNameForDir(testBasePath)).toEqual('testpackage');
});
tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/projectinfo',
version: '5.0.2',
description: 'gather information about projects. supports npm, git etc.'
}

View File

@ -1,19 +1,19 @@
import plugins = require('./projectinfo.plugins');
import * as plugins from './projectinfo.plugins.js';
// direct access to classes
export * from './projectinfo.classes.git';
export * from './projectinfo.classes.npm';
export * from './projectinfo.classes.projectinfo';
export * from './projectinfo.classes.git.js';
export * from './projectinfo.classes.npm.js';
export * from './projectinfo.classes.projectinfo.js';
// npm
import { ProjectinfoNpm } from './projectinfo.classes.npm';
import { ProjectinfoNpm } from './projectinfo.classes.npm.js';
// quick functions
/**
* 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);
if (localNpm.status === 'ok') {
return localNpm.name;

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
import * as path from 'path';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartfile from '@pushrocks/smartfile';
import * as smartstring from '@pushrocks/smartstring';
import * as smartpath from '@pushrocks/smartpath';
import * as smartpromise from '@push.rocks/smartpromise';
import * as smartfile from '@push.rocks/smartfile';
import * as smartstring from '@push.rocks/smartstring';
import * as smartpath from '@push.rocks/smartpath';
export { path, smartpromise, smartfile, smartstring, smartpath };

14
tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

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