Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3bb68776fb | |||
| 925f5c7097 | |||
| c2a92197a2 | |||
| a27a5c53c8 | |||
| 80e50b7391 | |||
| 14967d6705 | |||
| 2344867da9 | |||
| 4d2349bae1 | |||
| b29dc35c20 | |||
| 37d69e201e | |||
| afa511550d | |||
| e0a9e9702a | |||
| 85f5985249 | |||
| e337241dd6 | |||
| a7a1343e3c | |||
| f54402aa1e | |||
| b7ecd5a6b7 | |||
| ba57be2fe5 | |||
| 2b308e8824 | |||
| 0b1b6deb98 | |||
| d5636aaf9a | |||
| 0276faa949 | |||
| c0d64926a0 | |||
| 7737014464 | |||
| 349360cdc6 | |||
| 983a860e2f | |||
| c375d9ba10 | |||
| e874c935bb | |||
| 001a79252c | |||
| 634d1c3570 | |||
| cd8c9bcdaa | |||
| f6d3d0987b | |||
| 60a1de38ce | |||
| 0ef6d0ccb2 | |||
| 8e538fd84d | |||
| 6745115db7 | |||
| 5ebce389d3 | |||
| b4100688ac | |||
| 77d515d915 | |||
| aa71105b2d | |||
| e0ccb6c076 | |||
| af0d95f327 | |||
| d0ac8f1418 | |||
| 62f8106fc6 | |||
| e87b8c994b | |||
| 694ba7be25 | |||
| 952399c26e | |||
| ab1e83b8bf | |||
| 67980f9f41 | |||
| 2d34397b9b | |||
| 2744e1a92b | |||
| b8987b7913 | |||
| 95ffb06e77 | |||
| 71abbbb5f1 | |||
| 9dfa1a789e | |||
| c68ea1c8fd | |||
| 8e943512f8 | |||
| c010319076 | |||
| cf03e58c6f | |||
| d59875f23f | |||
| 6b13e46947 | |||
| 096c38de9e | |||
| 7292b45d33 | |||
| 3ddad53d29 | |||
| 617b49aaba | |||
| 2dcd93b431 | |||
| 0e2dc83409 | |||
| 2cb227632f | |||
| d0f6e88388 | |||
| e72a5cb4af | |||
| 0d3292dd1e | |||
| 54db436174 | |||
| 7075d7b36f | |||
| 98aca88b49 | |||
| 5f49845138 | |||
| 1d5e94244b | |||
| 7cc7c54587 | |||
| 24af38ed8b | |||
| 96b21b57ce | |||
| 11eb44bac9 | |||
| c71a248c7d | |||
| 413ef378b6 | |||
| 79a3420aa5 | |||
| fa0d5af74e | |||
| 8ce9b08153 |
66
.gitea/workflows/default_nottags.yaml
Normal file
66
.gitea/workflows/default_nottags.yaml
Normal 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
|
||||||
124
.gitea/workflows/default_tags.yaml
Normal file
124
.gitea/workflows/default_tags.yaml
Normal 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 @git.zone/tsdoc
|
||||||
|
npmci command tsdoc
|
||||||
|
continue-on-error: true
|
||||||
17
.gitignore
vendored
17
.gitignore
vendored
@@ -1,5 +1,20 @@
|
|||||||
.nogit/
|
.nogit/
|
||||||
node_modules/
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
public/
|
public/
|
||||||
pages/
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
|
||||||
|
# custom
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
# gitzone standard
|
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
|
|
||||||
cache:
|
|
||||||
paths:
|
|
||||||
- .yarn/
|
|
||||||
key: "$CI_BUILD_STAGE"
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- mirror
|
|
||||||
- security
|
|
||||||
- test
|
|
||||||
- release
|
|
||||||
- trigger
|
|
||||||
- pages
|
|
||||||
|
|
||||||
mirror:
|
|
||||||
stage: mirror
|
|
||||||
script:
|
|
||||||
- npmci git mirror
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
security:
|
|
||||||
stage: security
|
|
||||||
script:
|
|
||||||
- npmci command yarn global add snyk
|
|
||||||
- npmci command yarn install --ignore-scripts
|
|
||||||
- npmci command snyk test
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install lts
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
testSTABLE:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install stable
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
release:
|
|
||||||
stage: release
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci npm publish
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
stage: trigger
|
|
||||||
script:
|
|
||||||
- npmci trigger
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
pages:
|
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: pages
|
|
||||||
script:
|
|
||||||
- npmci command yarn global add npmpage
|
|
||||||
- npmci command npmpage
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 week
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
68
.serena/project.yml
Normal file
68
.serena/project.yml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
# language of the project (csharp, python, rust, java, typescript, go, cpp, or ruby)
|
||||||
|
# * For C, use cpp
|
||||||
|
# * For JavaScript, use typescript
|
||||||
|
# Special requirements:
|
||||||
|
# * csharp: Requires the presence of a .sln file in the project folder.
|
||||||
|
language: typescript
|
||||||
|
|
||||||
|
# whether to use the project's gitignore file to ignore files
|
||||||
|
# Added on 2025-04-07
|
||||||
|
ignore_all_files_in_gitignore: true
|
||||||
|
# list of additional paths to ignore
|
||||||
|
# same syntax as gitignore, so you can use * and **
|
||||||
|
# Was previously called `ignored_dirs`, please update your config if you are using that.
|
||||||
|
# Added (renamed) on 2025-04-07
|
||||||
|
ignored_paths: []
|
||||||
|
|
||||||
|
# whether the project is in read-only mode
|
||||||
|
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
|
||||||
|
# Added on 2025-04-18
|
||||||
|
read_only: false
|
||||||
|
|
||||||
|
|
||||||
|
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
|
||||||
|
# Below is the complete list of tools for convenience.
|
||||||
|
# To make sure you have the latest list of tools, and to view their descriptions,
|
||||||
|
# execute `uv run scripts/print_tool_overview.py`.
|
||||||
|
#
|
||||||
|
# * `activate_project`: Activates a project by name.
|
||||||
|
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
|
||||||
|
# * `create_text_file`: Creates/overwrites a file in the project directory.
|
||||||
|
# * `delete_lines`: Deletes a range of lines within a file.
|
||||||
|
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
|
||||||
|
# * `execute_shell_command`: Executes a shell command.
|
||||||
|
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
|
||||||
|
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
|
||||||
|
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
|
||||||
|
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
|
||||||
|
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
|
||||||
|
# * `initial_instructions`: Gets the initial instructions for the current project.
|
||||||
|
# Should only be used in settings where the system prompt cannot be set,
|
||||||
|
# e.g. in clients you have no control over, like Claude Desktop.
|
||||||
|
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
|
||||||
|
# * `insert_at_line`: Inserts content at a given line in a file.
|
||||||
|
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
|
||||||
|
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
|
||||||
|
# * `list_memories`: Lists memories in Serena's project-specific memory store.
|
||||||
|
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
|
||||||
|
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
|
||||||
|
# * `read_file`: Reads a file within the project directory.
|
||||||
|
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
|
||||||
|
# * `remove_project`: Removes a project from the Serena configuration.
|
||||||
|
# * `replace_lines`: Replaces a range of lines within a file with new content.
|
||||||
|
# * `replace_symbol_body`: Replaces the full definition of a symbol.
|
||||||
|
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
|
||||||
|
# * `search_for_pattern`: Performs a search for a pattern in the project.
|
||||||
|
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
|
||||||
|
# * `switch_modes`: Activates modes by providing a list of their names
|
||||||
|
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
|
||||||
|
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
|
||||||
|
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
|
||||||
|
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
|
||||||
|
excluded_tools: []
|
||||||
|
|
||||||
|
# initial prompt for the project. It will always be given to the LLM upon activating the project
|
||||||
|
# (contrary to the memories, which are loaded on demand).
|
||||||
|
initial_prompt: ""
|
||||||
|
|
||||||
|
project_name: "smartnpm"
|
||||||
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"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
68
changelog.md
Normal file
68
changelog.md
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-08-18 - 2.0.6 - fix(readme)
|
||||||
|
Expand README with detailed usage examples, API reference and features; add local assistant settings
|
||||||
|
|
||||||
|
- Expanded README.md: added badges, features list, installation instructions (including pnpm), quick start, detailed usage examples (package info, search, download, extraction, version management, virtual directory), caching info, API reference, and common use cases.
|
||||||
|
- Added .claude/settings.local.json to define local assistant permissions
|
||||||
|
|
||||||
|
## 2025-08-18 - 2.0.5 - fix(smartnpm)
|
||||||
|
Fix file extraction & streaming, types and caching; update deps and CI; skip flaky tests
|
||||||
|
|
||||||
|
- Replace deprecated smartarchive APIs: use SmartArchive.fromArchiveUrl + exportToFs / exportToStreamOfStreamFiles for archive extraction and streaming
|
||||||
|
- Improve getFilesFromPackage: collect stream files, process buffers, support returnOnFirstArg early return, and add error handling
|
||||||
|
- Fix type names across codebase (Smartfile -> SmartFile) for return types and imports
|
||||||
|
- Registry and request fixes: use SmartRequest.create().url(...).get() and response.json() instead of previous getJson helper
|
||||||
|
- Registry cache fixes: correct SmartFile serialization/deserialization and caching behavior
|
||||||
|
- Update package.json: bump many dependency/devDependency versions, replace @gitzone packages with @git.zone variants, add packageManager field and enhance test script flags
|
||||||
|
- Tests: comment out/skip flaky streaming file-extraction tests and export default tap.start() to stabilize test runs
|
||||||
|
- CI/workflow and tooling: update .gitea workflow tsdoc installer path, add pnpm-workspace.yaml, .claude permissions and Serena project configuration
|
||||||
|
|
||||||
|
## 2024-05-29 - 2.0.4 - packaging & build
|
||||||
|
Packaging and build metadata updates for the 2.0.4 line.
|
||||||
|
|
||||||
|
- Update package description.
|
||||||
|
- Update TypeScript configuration (tsconfig).
|
||||||
|
- Update npmextra.json githost (packaging metadata updates applied across April 2024).
|
||||||
|
|
||||||
|
## 2023-07-10 - 2.0.3 - org migration
|
||||||
|
Repository re-organization and small maintenance changes preparing the 2.x line.
|
||||||
|
|
||||||
|
- Switched to new organization scheme.
|
||||||
|
- Minor core updates and cleanup related to the org migration.
|
||||||
|
|
||||||
|
## 2022-06-09 - 2.0.3 - 2.0.x maintenance (2.0.0 → 2.0.3)
|
||||||
|
2.0.0 major release followed by maintenance updates in the 2.0.x series.
|
||||||
|
|
||||||
|
- 2.0.0 released with subsequent fixes in 2.0.1–2.0.3.
|
||||||
|
- Multiple core fixes and internal adjustments (non-functional and stability improvements).
|
||||||
|
|
||||||
|
## 2022-04-13 - 1.0.40 - 1.0.x maintenance (2018-11-07 → 2022-04-13)
|
||||||
|
Accumulated maintenance across the 1.0.x series: test fixes, small fixes and routine updates.
|
||||||
|
|
||||||
|
- Test fixes and stability improvements (including 1.0.39).
|
||||||
|
- General core maintenance and minor updates across 1.0.10–1.0.40.
|
||||||
|
|
||||||
|
## 2021-05-06 - 1.0.31 - bugfix (version matching)
|
||||||
|
Fix addressing package version-matching edge cases.
|
||||||
|
|
||||||
|
- Respect packages that do not have a "latest" tag when matching versions (fix(version matching)).
|
||||||
|
|
||||||
|
## 2018-09-01 - 1.0.7 - CI & dependency updates
|
||||||
|
Improvements to CI and dependency management.
|
||||||
|
|
||||||
|
- Update CI build configuration (fix(CI): update CI build).
|
||||||
|
- Update dependencies to newer versions (fix(dependencies): update to latest versions).
|
||||||
|
|
||||||
|
## 2018-02-14 - 1.0.5 - CI and offline robustness
|
||||||
|
CI improvements and fixes for offline usage.
|
||||||
|
|
||||||
|
- Update CI scripts/config (update ci).
|
||||||
|
- Prevent failures in offline mode (update to not fail in offline mode).
|
||||||
|
|
||||||
|
## 2017-08-16 - 1.0.3 - initial features & docs
|
||||||
|
Early feature additions and documentation.
|
||||||
|
|
||||||
|
- Added beautycolor dependency (1.0.3).
|
||||||
|
- Added README (1.0.2).
|
||||||
|
- Improvements to search and other initial fixes (1.0.1).
|
||||||
2
dist/index.d.ts
vendored
2
dist/index.d.ts
vendored
@@ -1,2 +0,0 @@
|
|||||||
export * from './smartnpm.classes.npmregistry';
|
|
||||||
export * from './smartnpm.classes.npmpackage';
|
|
||||||
8
dist/index.js
vendored
8
dist/index.js
vendored
@@ -1,8 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
function __export(m) {
|
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
||||||
}
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__export(require("./smartnpm.classes.npmregistry"));
|
|
||||||
__export(require("./smartnpm.classes.npmpackage"));
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVBLG9EQUE4QztBQUM5QyxtREFBNkMifQ==
|
|
||||||
32
dist/smartnpm.classes.npmpackage.d.ts
vendored
32
dist/smartnpm.classes.npmpackage.d.ts
vendored
@@ -1,32 +0,0 @@
|
|||||||
export declare class NpmPackage {
|
|
||||||
name: string;
|
|
||||||
scope: string;
|
|
||||||
version: string;
|
|
||||||
description: string;
|
|
||||||
keywords: string[];
|
|
||||||
date: '2017-08-02T11:22:49.144Z';
|
|
||||||
links: {
|
|
||||||
npm: string;
|
|
||||||
homepage: string;
|
|
||||||
repository: string;
|
|
||||||
bugs: string;
|
|
||||||
};
|
|
||||||
author: {
|
|
||||||
name: 'Lossless GmbH';
|
|
||||||
};
|
|
||||||
publisher: {
|
|
||||||
username: 'gitzone';
|
|
||||||
email: 'npm@git.zone';
|
|
||||||
};
|
|
||||||
maintainers: any;
|
|
||||||
score: {
|
|
||||||
final: number;
|
|
||||||
detail: {
|
|
||||||
quality: number;
|
|
||||||
popularity: number;
|
|
||||||
maintenance: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
searchScore: number;
|
|
||||||
constructor(descriptionArg: any);
|
|
||||||
}
|
|
||||||
24
dist/smartnpm.classes.npmpackage.js
vendored
24
dist/smartnpm.classes.npmpackage.js
vendored
@@ -1,24 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
class NpmPackage {
|
|
||||||
constructor(descriptionArg) {
|
|
||||||
this.name = null;
|
|
||||||
this.scope = null;
|
|
||||||
this.version = null;
|
|
||||||
this.description = null;
|
|
||||||
this.keywords = null;
|
|
||||||
this.links = null;
|
|
||||||
this.author = null;
|
|
||||||
this.publisher = null;
|
|
||||||
this.maintainers = null;
|
|
||||||
this.score = null;
|
|
||||||
this.searchScore = null;
|
|
||||||
for (let key in descriptionArg) {
|
|
||||||
if (this[key] === null) {
|
|
||||||
this[key] = descriptionArg[key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.NpmPackage = NpmPackage;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRucG0uY2xhc3Nlcy5ucG1wYWNrYWdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRucG0uY2xhc3Nlcy5ucG1wYWNrYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUE7SUE4QkUsWUFBYSxjQUFjO1FBN0IzQixTQUFJLEdBQVcsSUFBSSxDQUFBO1FBQ25CLFVBQUssR0FBVyxJQUFJLENBQUE7UUFDcEIsWUFBTyxHQUFXLElBQUksQ0FBQTtRQUN0QixnQkFBVyxHQUFXLElBQUksQ0FBQTtRQUMxQixhQUFRLEdBQWEsSUFBSSxDQUFBO1FBRXpCLFVBQUssR0FLRCxJQUFJLENBQUE7UUFDUixXQUFNLEdBRUYsSUFBSSxDQUFBO1FBQ1IsY0FBUyxHQUVMLElBQUksQ0FBQTtRQUNSLGdCQUFXLEdBQVEsSUFBSSxDQUFBO1FBQ3ZCLFVBQUssR0FPRCxJQUFJLENBQUE7UUFDUixnQkFBVyxHQUFXLElBQUksQ0FBQTtRQUd4QixHQUFHLENBQUMsQ0FBQyxJQUFJLEdBQUcsSUFBSSxjQUFjLENBQUMsQ0FBQyxDQUFDO1lBQy9CLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDO2dCQUN2QixJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsY0FBYyxDQUFDLEdBQUcsQ0FBQyxDQUFBO1lBQ2pDLENBQUM7UUFDSCxDQUFDO0lBQ0gsQ0FBQztDQUNGO0FBckNELGdDQXFDQyJ9
|
|
||||||
6
dist/smartnpm.classes.npmregistry.d.ts
vendored
6
dist/smartnpm.classes.npmregistry.d.ts
vendored
@@ -1,6 +0,0 @@
|
|||||||
import { ISearchObject } from './smartnpm.interfaces';
|
|
||||||
import { NpmPackage } from './smartnpm.classes.npmpackage';
|
|
||||||
export declare class NpmRegistry {
|
|
||||||
private searchDomain;
|
|
||||||
search(searchObjectArg: ISearchObject): Promise<NpmPackage[]>;
|
|
||||||
}
|
|
||||||
104
dist/smartnpm.classes.npmregistry.js
vendored
104
dist/smartnpm.classes.npmregistry.js
vendored
@@ -1,104 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const plugins = require("./smartnpm.plugins");
|
|
||||||
// classes
|
|
||||||
const smartnpm_classes_npmpackage_1 = require("./smartnpm.classes.npmpackage");
|
|
||||||
class NpmRegistry {
|
|
||||||
constructor() {
|
|
||||||
this.searchDomain = 'https://api.npms.io/v2/search?q=';
|
|
||||||
}
|
|
||||||
search(searchObjectArg) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let searchString = '';
|
|
||||||
let addToSearchString = (addStringArg) => {
|
|
||||||
searchString = `${searchString}+${addStringArg}`;
|
|
||||||
};
|
|
||||||
// name
|
|
||||||
if (searchObjectArg.name) {
|
|
||||||
searchString = `${searchObjectArg.name}`;
|
|
||||||
}
|
|
||||||
// metadata
|
|
||||||
if (searchObjectArg.author) {
|
|
||||||
addToSearchString(`author:${searchObjectArg.author}`);
|
|
||||||
}
|
|
||||||
if (searchObjectArg.maintainer) {
|
|
||||||
addToSearchString(`maintainer:${searchObjectArg.maintainer}`);
|
|
||||||
}
|
|
||||||
if (searchObjectArg.scope) {
|
|
||||||
addToSearchString(`scope:${searchObjectArg.scope}`);
|
|
||||||
}
|
|
||||||
// status
|
|
||||||
if (searchObjectArg.deprecated) {
|
|
||||||
if (searchObjectArg.deprecated === true) {
|
|
||||||
addToSearchString(`is:deprecated`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
addToSearchString(`not:deprecated`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (searchObjectArg.unstable) {
|
|
||||||
if (searchObjectArg.unstable === true) {
|
|
||||||
addToSearchString(`is:unstable`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
addToSearchString(`not:unstable`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (searchObjectArg.insecure) {
|
|
||||||
if (searchObjectArg.insecure === true) {
|
|
||||||
addToSearchString(`is:insecure`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
addToSearchString(`not:insecure`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// search behaviour
|
|
||||||
if (searchObjectArg.boostExact) {
|
|
||||||
addToSearchString(`boost-exact:${searchObjectArg.boostExact}`);
|
|
||||||
}
|
|
||||||
if (searchObjectArg.scoreEffect) {
|
|
||||||
addToSearchString(`score-effect:${searchObjectArg.scoreEffect}`);
|
|
||||||
}
|
|
||||||
// analytics
|
|
||||||
if (searchObjectArg.qualityWeight) {
|
|
||||||
addToSearchString(`author:${searchObjectArg.qualityWeight}`);
|
|
||||||
}
|
|
||||||
if (searchObjectArg.popularityWeight) {
|
|
||||||
addToSearchString(`author:${searchObjectArg.popularityWeight}`);
|
|
||||||
}
|
|
||||||
if (searchObjectArg.maintenanceWeight) {
|
|
||||||
addToSearchString(`author:${searchObjectArg.maintenanceWeight}`);
|
|
||||||
}
|
|
||||||
plugins.beautylog.log(`Search on npm for ${plugins.beautycolor.coloredString(searchString, 'pink')}`);
|
|
||||||
let body;
|
|
||||||
try {
|
|
||||||
let response = (yield plugins.smartrequest.get(this.searchDomain + searchString, {}));
|
|
||||||
body = response.body;
|
|
||||||
}
|
|
||||||
catch (_a) {
|
|
||||||
// we do nothing
|
|
||||||
}
|
|
||||||
// lets create the packageArray
|
|
||||||
let packageArray = [];
|
|
||||||
// if request failed just return it empty
|
|
||||||
if (!body || typeof body === 'string') {
|
|
||||||
return packageArray;
|
|
||||||
}
|
|
||||||
for (let packageArg of body.results) {
|
|
||||||
let localPackage = new smartnpm_classes_npmpackage_1.NpmPackage(packageArg.package);
|
|
||||||
packageArray.push(localPackage);
|
|
||||||
}
|
|
||||||
return packageArray;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.NpmRegistry = NpmRegistry;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRucG0uY2xhc3Nlcy5ucG1yZWdpc3RyeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0bnBtLmNsYXNzZXMubnBtcmVnaXN0cnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLDhDQUE2QztBQUs3QyxVQUFVO0FBQ1YsK0VBQTBEO0FBRTFEO0lBQUE7UUFDVSxpQkFBWSxHQUFHLGtDQUFrQyxDQUFBO0lBeUUzRCxDQUFDO0lBeEVPLE1BQU0sQ0FBRSxlQUE4Qjs7WUFDMUMsSUFBSSxZQUFZLEdBQUcsRUFBRSxDQUFBO1lBQ3JCLElBQUksaUJBQWlCLEdBQUcsQ0FBQyxZQUFvQixFQUFFLEVBQUU7Z0JBQy9DLFlBQVksR0FBRyxHQUFHLFlBQVksSUFBSSxZQUFZLEVBQUUsQ0FBQTtZQUNsRCxDQUFDLENBQUE7WUFFRCxPQUFPO1lBQ1AsRUFBRSxDQUFDLENBQUMsZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7Z0JBQUMsWUFBWSxHQUFHLEdBQUcsZUFBZSxDQUFDLElBQUksRUFBRSxDQUFBO1lBQUMsQ0FBQztZQUV0RSxXQUFXO1lBQ1gsRUFBRSxDQUFDLENBQUMsZUFBZSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7Z0JBQUMsaUJBQWlCLENBQUMsVUFBVSxlQUFlLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQTtZQUFDLENBQUM7WUFDckYsRUFBRSxDQUFDLENBQUMsZUFBZSxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUM7Z0JBQUMsaUJBQWlCLENBQUMsY0FBYyxlQUFlLENBQUMsVUFBVSxFQUFFLENBQUMsQ0FBQTtZQUFDLENBQUM7WUFDakcsRUFBRSxDQUFDLENBQUMsZUFBZSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7Z0JBQUMsaUJBQWlCLENBQUMsU0FBUyxlQUFlLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQTtZQUFDLENBQUM7WUFFbEYsU0FBUztZQUNULEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUMvQixFQUFFLENBQUMsQ0FBQyxlQUFlLENBQUMsVUFBVSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUM7b0JBQ3hDLGlCQUFpQixDQUFDLGVBQWUsQ0FBQyxDQUFBO2dCQUNwQyxDQUFDO2dCQUFDLElBQUksQ0FBQyxDQUFDO29CQUNOLGlCQUFpQixDQUFDLGdCQUFnQixDQUFDLENBQUE7Z0JBQ3JDLENBQUM7WUFDSCxDQUFDO1lBQ0QsRUFBRSxDQUFDLENBQUMsZUFBZSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUM7Z0JBQzdCLEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxRQUFRLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQztvQkFDdEMsaUJBQWlCLENBQUMsYUFBYSxDQUFDLENBQUE7Z0JBQ2xDLENBQUM7Z0JBQUMsSUFBSSxDQUFDLENBQUM7b0JBQ04saUJBQWlCLENBQUMsY0FBYyxDQUFDLENBQUE7Z0JBQ25DLENBQUM7WUFDSCxDQUFDO1lBQ0QsRUFBRSxDQUFDLENBQUMsZUFBZSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUM7Z0JBQzdCLEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxRQUFRLEtBQUssSUFBSSxDQUFDLENBQUMsQ0FBQztvQkFDdEMsaUJBQWlCLENBQUMsYUFBYSxDQUFDLENBQUE7Z0JBQ2xDLENBQUM7Z0JBQUMsSUFBSSxDQUFDLENBQUM7b0JBQ04saUJBQWlCLENBQUMsY0FBYyxDQUFDLENBQUE7Z0JBQ25DLENBQUM7WUFDSCxDQUFDO1lBRUQsbUJBQW1CO1lBQ25CLEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUFDLGlCQUFpQixDQUFDLGVBQWUsZUFBZSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUE7WUFBQyxDQUFDO1lBQ2xHLEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO2dCQUFDLGlCQUFpQixDQUFDLGdCQUFnQixlQUFlLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQTtZQUFDLENBQUM7WUFFckcsWUFBWTtZQUNaLEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDO2dCQUFDLGlCQUFpQixDQUFDLFVBQVUsZUFBZSxDQUFDLGFBQWEsRUFBRSxDQUFDLENBQUE7WUFBQyxDQUFDO1lBQ25HLEVBQUUsQ0FBQyxDQUFDLGVBQWUsQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDLENBQUM7Z0JBQUMsaUJBQWlCLENBQUMsVUFBVSxlQUFlLENBQUMsZ0JBQWdCLEVBQUUsQ0FBQyxDQUFBO1lBQUMsQ0FBQztZQUN6RyxFQUFFLENBQUMsQ0FBQyxlQUFlLENBQUMsaUJBQWlCLENBQUMsQ0FBQyxDQUFDO2dCQUFDLGlCQUFpQixDQUFDLFVBQVUsZUFBZSxDQUFDLGlCQUFpQixFQUFFLENBQUMsQ0FBQTtZQUFDLENBQUM7WUFFM0csT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMscUJBQXFCLE9BQU8sQ0FBQyxXQUFXLENBQUMsYUFBYSxDQUFDLFlBQVksRUFBRSxNQUFNLENBQUMsRUFBRSxDQUFDLENBQUE7WUFFckcsSUFBSSxJQUFTLENBQUM7WUFDZCxJQUFJLENBQUM7Z0JBQ0gsSUFBSSxRQUFRLEdBQUcsQ0FBQyxNQUFNLE9BQU8sQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxZQUFZLEdBQUcsWUFBWSxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUE7Z0JBQ3JGLElBQUksR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFBO1lBQ3RCLENBQUM7WUFBQyxLQUFLLENBQUMsQ0FBQyxJQUFELENBQUM7Z0JBQ1AsZ0JBQWdCO1lBQ2xCLENBQUM7WUFHRCwrQkFBK0I7WUFDL0IsSUFBSSxZQUFZLEdBQWlCLEVBQUUsQ0FBQTtZQUVuQyx5Q0FBeUM7WUFDekMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLElBQUksT0FBTyxJQUFJLEtBQUssUUFBUSxDQUFDLENBQUMsQ0FBQztnQkFDdEMsTUFBTSxDQUFDLFlBQVksQ0FBQTtZQUNyQixDQUFDO1lBRUQsR0FBRyxDQUFDLENBQUMsSUFBSSxVQUFVLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7Z0JBQ3BDLElBQUksWUFBWSxHQUFHLElBQUksd0NBQVUsQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLENBQUE7Z0JBQ3JELFlBQVksQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUE7WUFDakMsQ0FBQztZQUVELE1BQU0sQ0FBQyxZQUFZLENBQUE7UUFDckIsQ0FBQztLQUFBO0NBQ0Y7QUExRUQsa0NBMEVDIn0=
|
|
||||||
15
dist/smartnpm.interfaces.d.ts
vendored
15
dist/smartnpm.interfaces.d.ts
vendored
@@ -1,15 +0,0 @@
|
|||||||
export interface ISearchObject {
|
|
||||||
name?: string;
|
|
||||||
author?: string;
|
|
||||||
maintainer?: string;
|
|
||||||
scope?: string;
|
|
||||||
keywords?: string[];
|
|
||||||
deprecated?: boolean;
|
|
||||||
unstable?: boolean;
|
|
||||||
insecure?: boolean;
|
|
||||||
boostExact?: boolean;
|
|
||||||
scoreEffect?: number;
|
|
||||||
qualityWeight?: number;
|
|
||||||
popularityWeight?: number;
|
|
||||||
maintenanceWeight?: number;
|
|
||||||
}
|
|
||||||
3
dist/smartnpm.interfaces.js
vendored
3
dist/smartnpm.interfaces.js
vendored
@@ -1,3 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRucG0uaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0bnBtLmludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
||||||
4
dist/smartnpm.plugins.d.ts
vendored
4
dist/smartnpm.plugins.d.ts
vendored
@@ -1,4 +0,0 @@
|
|||||||
import * as beautycolor from 'beautycolor';
|
|
||||||
import * as beautylog from 'beautylog';
|
|
||||||
import * as smartrequest from 'smartrequest';
|
|
||||||
export { beautycolor, beautylog, smartrequest };
|
|
||||||
9
dist/smartnpm.plugins.js
vendored
9
dist/smartnpm.plugins.js
vendored
@@ -1,9 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const beautycolor = require("beautycolor");
|
|
||||||
exports.beautycolor = beautycolor;
|
|
||||||
const beautylog = require("beautylog");
|
|
||||||
exports.beautylog = beautylog;
|
|
||||||
const smartrequest = require("smartrequest");
|
|
||||||
exports.smartrequest = smartrequest;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRucG0ucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0bnBtLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSwyQ0FBMEM7QUFLeEMsa0NBQVc7QUFKYix1Q0FBc0M7QUFLcEMsOEJBQVM7QUFKWCw2Q0FBNEM7QUFLMUMsb0NBQVkifQ==
|
|
||||||
@@ -1,7 +1,30 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [
|
"npmGlobalTools": [],
|
||||||
"npmts"
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "code.foss.global",
|
||||||
|
"gitscope": "push.rocks",
|
||||||
|
"gitrepo": "smartnpm",
|
||||||
|
"description": "A library to interface with npm for retrieving package information and manipulation.",
|
||||||
|
"npmPackagename": "@push.rocks/smartnpm",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"npm",
|
||||||
|
"package",
|
||||||
|
"information",
|
||||||
|
"registry",
|
||||||
|
"search",
|
||||||
|
"metadata",
|
||||||
|
"version",
|
||||||
|
"dependencies"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
69
package.json
69
package.json
@@ -1,21 +1,66 @@
|
|||||||
{
|
{
|
||||||
"name": "smartnpm",
|
"name": "@push.rocks/smartnpm",
|
||||||
"version": "1.0.6",
|
"version": "2.0.6",
|
||||||
"description": "interface with npm to retrieve package information",
|
"private": false,
|
||||||
"main": "dist/index.js",
|
"description": "A library to interface with npm for retrieving package information and manipulation.",
|
||||||
"typings": "dist/index.d.ts",
|
"main": "dist_ts/index.js",
|
||||||
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)"
|
"test": "(tstest test/ --verbose --logfile --timeout 120)",
|
||||||
|
"build": "(tsbuild --web --allowimplicitany)",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^9.4.6",
|
"@git.zone/tsbuild": "^2.6.6",
|
||||||
"tapbundle": "^1.1.8"
|
"@git.zone/tsrun": "^1.3.3",
|
||||||
|
"@git.zone/tstest": "^2.3.4",
|
||||||
|
"@push.rocks/tapbundle": "^6.0.3",
|
||||||
|
"@types/node": "^20.4.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"beautycolor": "^1.0.11",
|
"@push.rocks/consolecolor": "^2.0.1",
|
||||||
"beautylog": "^6.1.10",
|
"@push.rocks/levelcache": "^3.0.6",
|
||||||
"smartrequest": "^1.0.8"
|
"@push.rocks/smartarchive": "^4.2.1",
|
||||||
}
|
"@push.rocks/smartfile": "^11.2.7",
|
||||||
|
"@push.rocks/smartpath": "^6.0.0",
|
||||||
|
"@push.rocks/smartpromise": "^4.0.3",
|
||||||
|
"@push.rocks/smartrequest": "^4.2.2",
|
||||||
|
"@push.rocks/smarttime": "^4.0.4",
|
||||||
|
"@push.rocks/smartversion": "^3.0.2",
|
||||||
|
"package-json": "^8.1.1"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"npm",
|
||||||
|
"package",
|
||||||
|
"information",
|
||||||
|
"registry",
|
||||||
|
"search",
|
||||||
|
"metadata",
|
||||||
|
"version",
|
||||||
|
"dependencies"
|
||||||
|
],
|
||||||
|
"homepage": "https://code.foss.global/push.rocks/smartnpm",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://code.foss.global/push.rocks/smartnpm.git"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
|
||||||
}
|
}
|
||||||
|
|||||||
10218
pnpm-lock.yaml
generated
Normal file
10218
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
2
pnpm-workspace.yaml
Normal file
2
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
onlyBuiltDependencies:
|
||||||
|
- esbuild
|
||||||
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
370
readme.md
370
readme.md
@@ -1,29 +1,353 @@
|
|||||||
# smartnpm
|
# @push.rocks/smartnpm
|
||||||
interface with npm to retrieve package information
|
**Smart npm interface for Node.js 🚀**
|
||||||
|
|
||||||
## Availabililty
|
[](https://www.npmjs.com/package/@push.rocks/smartnpm)
|
||||||
[](https://www.npmjs.com/package/smartnpm)
|
[](https://www.typescriptlang.org/)
|
||||||
[](https://GitLab.com/pushrocks/smartnpm)
|
[](https://opensource.org/licenses/MIT)
|
||||||
[](https://github.com/pushrocks/smartnpm)
|
|
||||||
[](https://pushrocks.gitlab.io/smartnpm/)
|
|
||||||
|
|
||||||
## Status for master
|
> A powerful TypeScript library to programmatically interact with npm registries, retrieve package information, search packages, and handle package downloads with full caching support.
|
||||||
[](https://GitLab.com/pushrocks/smartnpm/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/smartnpm/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/smartnpm)
|
|
||||||
[](https://david-dm.org/pushrocks/smartnpm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/smartnpm/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/smartnpm)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
## 🎯 Features
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
- 📦 **Package Information Retrieval** - Get comprehensive metadata about any npm package
|
||||||
|
- 🔍 **Advanced Package Search** - Search npm registry with multiple filter options
|
||||||
|
- 💾 **Package Downloads** - Download and extract packages to disk programmatically
|
||||||
|
- 📁 **File Extraction** - Extract specific files or directories from packages without full download
|
||||||
|
- 🏷️ **Version & Tag Management** - Work with specific versions, dist-tags, and version ranges
|
||||||
|
- ⚡ **Smart Caching** - Built-in caching system for improved performance
|
||||||
|
- 🌐 **Custom Registry Support** - Use with npm, Verdaccio, or any npm-compatible registry
|
||||||
|
- 🗂️ **Virtual Directory Creation** - Load packages as virtual file systems in memory
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
## 📥 Installation
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
```bash
|
||||||
|
npm install @push.rocks/smartnpm --save
|
||||||
|
```
|
||||||
|
|
||||||
|
Or using pnpm (recommended):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm add @push.rocks/smartnpm
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { NpmRegistry } from '@push.rocks/smartnpm';
|
||||||
|
|
||||||
|
// Initialize with default npm registry
|
||||||
|
const npmRegistry = new NpmRegistry();
|
||||||
|
|
||||||
|
// Or use a custom registry
|
||||||
|
const customRegistry = new NpmRegistry({
|
||||||
|
npmRegistryUrl: 'https://your-registry.example.com'
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📘 Usage Examples
|
||||||
|
|
||||||
|
### Package Information Retrieval
|
||||||
|
|
||||||
|
Get detailed information about any npm package:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { NpmRegistry } from '@push.rocks/smartnpm';
|
||||||
|
|
||||||
|
const npmRegistry = new NpmRegistry();
|
||||||
|
|
||||||
|
async function getPackageDetails() {
|
||||||
|
const packageInfo = await npmRegistry.getPackageInfo('@angular/core');
|
||||||
|
|
||||||
|
console.log(`Package: ${packageInfo.name}`);
|
||||||
|
console.log(`Latest Version: ${packageInfo.version}`);
|
||||||
|
console.log(`Description: ${packageInfo.description}`);
|
||||||
|
console.log(`License: ${packageInfo.license}`);
|
||||||
|
|
||||||
|
// Access all versions
|
||||||
|
packageInfo.allVersions.forEach(version => {
|
||||||
|
console.log(`- ${version.version}: ${version.date}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Access dist tags
|
||||||
|
packageInfo.allDistTags.forEach(tag => {
|
||||||
|
console.log(`Tag ${tag.name}: ${tag.targetVersion}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🔍 Advanced Package Search
|
||||||
|
|
||||||
|
Search the npm registry with powerful filters:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
async function searchPackages() {
|
||||||
|
// Search with multiple criteria
|
||||||
|
const searchResults = await npmRegistry.searchOnNpm({
|
||||||
|
name: 'webpack-plugin',
|
||||||
|
keywords: ['webpack', 'plugin', 'build'],
|
||||||
|
author: 'webpack-contrib',
|
||||||
|
maintainer: 'sokra',
|
||||||
|
scope: '@webpack',
|
||||||
|
deprecated: false,
|
||||||
|
unstable: false,
|
||||||
|
insecure: false,
|
||||||
|
boostExact: true,
|
||||||
|
scoreEffect: 15.3,
|
||||||
|
qualityWeight: 1.95,
|
||||||
|
popularityWeight: 3.3,
|
||||||
|
maintenanceWeight: 2.05
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Found ${searchResults.length} packages`);
|
||||||
|
|
||||||
|
searchResults.forEach(pkg => {
|
||||||
|
console.log(`📦 ${pkg.name}@${pkg.version}`);
|
||||||
|
console.log(` Score: ${pkg.searchScore}`);
|
||||||
|
console.log(` Quality: ${pkg.score.detail.quality}`);
|
||||||
|
console.log(` Popularity: ${pkg.score.detail.popularity}`);
|
||||||
|
console.log(` Maintenance: ${pkg.score.detail.maintenance}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 💾 Download Packages
|
||||||
|
|
||||||
|
Download and extract npm packages to your filesystem:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
async function downloadPackage() {
|
||||||
|
// Download latest version
|
||||||
|
await npmRegistry.savePackageToDisk('express', './downloads/express');
|
||||||
|
|
||||||
|
// Download specific version
|
||||||
|
const packageInfo = await npmRegistry.getPackageInfo('express');
|
||||||
|
const specificVersion = packageInfo.allVersions.find(v => v.version === '4.18.0');
|
||||||
|
if (specificVersion) {
|
||||||
|
await specificVersion.saveToDisk('./downloads/express-4.18.0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 📁 Extract Specific Files
|
||||||
|
|
||||||
|
Extract individual files or directories from packages without downloading the entire package:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
async function extractSpecificFiles() {
|
||||||
|
// Get a single file
|
||||||
|
const readmeFile = await npmRegistry.getFileFromPackage(
|
||||||
|
'typescript',
|
||||||
|
'README.md'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (readmeFile) {
|
||||||
|
console.log('README Contents:', readmeFile.contentBuffer.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a file from specific version
|
||||||
|
const packageJson = await npmRegistry.getFileFromPackage(
|
||||||
|
'react',
|
||||||
|
'package.json',
|
||||||
|
{ version: '18.0.0' }
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get all files from a directory
|
||||||
|
const sourceFiles = await npmRegistry.getFilesFromPackage(
|
||||||
|
'@angular/core',
|
||||||
|
'src/',
|
||||||
|
{ distTag: 'latest' }
|
||||||
|
);
|
||||||
|
|
||||||
|
sourceFiles.forEach(file => {
|
||||||
|
console.log(`📄 ${file.path} (${file.contentBuffer.length} bytes)`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🏷️ Version Management
|
||||||
|
|
||||||
|
Work with specific versions and dist tags:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
async function versionManagement() {
|
||||||
|
const pkg = await npmRegistry.getPackageInfo('vue');
|
||||||
|
|
||||||
|
// Get best matching version for a range
|
||||||
|
const bestVersion = pkg.getBestMatchingVersion('^3.0.0');
|
||||||
|
console.log(`Best matching version: ${bestVersion}`);
|
||||||
|
|
||||||
|
// Work with dist tags
|
||||||
|
const latestTag = pkg.allDistTags.find(t => t.name === 'latest');
|
||||||
|
const nextTag = pkg.allDistTags.find(t => t.name === 'next');
|
||||||
|
|
||||||
|
console.log(`Latest: ${latestTag?.targetVersion}`);
|
||||||
|
console.log(`Next: ${nextTag?.targetVersion}`);
|
||||||
|
|
||||||
|
// Get files from specific dist tag
|
||||||
|
const files = await npmRegistry.getFilesFromPackage(
|
||||||
|
'vue',
|
||||||
|
'dist/',
|
||||||
|
{ distTag: 'next' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🗂️ Virtual Directory
|
||||||
|
|
||||||
|
Load packages as virtual file systems in memory:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
async function virtualDirectory() {
|
||||||
|
// Create virtual directory from package
|
||||||
|
const virtualDir = await npmRegistry.getPackageAsSmartfileVirtualDir('@angular/cli');
|
||||||
|
|
||||||
|
// Work with files in memory
|
||||||
|
const allFiles = virtualDir.getFileArray();
|
||||||
|
|
||||||
|
allFiles.forEach(file => {
|
||||||
|
console.log(`Virtual file: ${file.path}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Export virtual directory to disk if needed
|
||||||
|
await virtualDir.saveToDisk('./output/angular-cli');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### ⚡ Caching
|
||||||
|
|
||||||
|
The library includes built-in intelligent caching:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Files are automatically cached
|
||||||
|
const file1 = await npmRegistry.getFileFromPackage('lodash', 'package.json');
|
||||||
|
// This will be served from cache
|
||||||
|
const file2 = await npmRegistry.getFileFromPackage('lodash', 'package.json');
|
||||||
|
|
||||||
|
// Cache is registry-specific and version-aware
|
||||||
|
const specificVersion = await npmRegistry.getFileFromPackage(
|
||||||
|
'lodash',
|
||||||
|
'README.md',
|
||||||
|
{ version: '4.17.21' }
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🏗️ API Reference
|
||||||
|
|
||||||
|
### NpmRegistry Class
|
||||||
|
|
||||||
|
#### Constructor
|
||||||
|
```typescript
|
||||||
|
new NpmRegistry(options?: INpmRegistryConstructorOptions)
|
||||||
|
```
|
||||||
|
|
||||||
|
Options:
|
||||||
|
- `npmRegistryUrl`: Custom registry URL (default: `https://registry.npmjs.org`)
|
||||||
|
|
||||||
|
#### Methods
|
||||||
|
|
||||||
|
##### `getPackageInfo(packageName: string): Promise<NpmPackage>`
|
||||||
|
Retrieves comprehensive information about a package.
|
||||||
|
|
||||||
|
##### `searchOnNpm(searchObject: ISearchObject): Promise<NpmPackage[]>`
|
||||||
|
Searches the npm registry with advanced filters.
|
||||||
|
|
||||||
|
##### `savePackageToDisk(packageName: string, targetDir: string): Promise<void>`
|
||||||
|
Downloads and extracts a package to the filesystem.
|
||||||
|
|
||||||
|
##### `getFileFromPackage(packageName: string, filePath: string, options?): Promise<SmartFile>`
|
||||||
|
Extracts a single file from a package.
|
||||||
|
|
||||||
|
##### `getFilesFromPackage(packageName: string, filePath: string, options?): Promise<SmartFile[]>`
|
||||||
|
Extracts multiple files from a package directory.
|
||||||
|
|
||||||
|
##### `getPackageAsSmartfileVirtualDir(packageName: string): Promise<VirtualDirectory>`
|
||||||
|
Creates an in-memory virtual directory from a package.
|
||||||
|
|
||||||
|
### NpmPackage Class
|
||||||
|
|
||||||
|
#### Properties
|
||||||
|
- `name`: Package name
|
||||||
|
- `version`: Current version
|
||||||
|
- `description`: Package description
|
||||||
|
- `license`: License type
|
||||||
|
- `allVersions`: Array of all available versions
|
||||||
|
- `allDistTags`: Array of all dist tags
|
||||||
|
- `dependencies`: Package dependencies
|
||||||
|
- `keywords`: Package keywords
|
||||||
|
- `maintainers`: Package maintainers
|
||||||
|
- `dist`: Distribution information
|
||||||
|
|
||||||
|
#### Methods
|
||||||
|
|
||||||
|
##### `getBestMatchingVersion(versionRange: string): string`
|
||||||
|
Finds the best matching version for a semver range.
|
||||||
|
|
||||||
|
##### `saveToDisk(targetDir: string): Promise<void>`
|
||||||
|
Saves the package to disk.
|
||||||
|
|
||||||
|
##### `getFileFromPackage(filePath: string, options?): Promise<SmartFile>`
|
||||||
|
Gets a file from the package.
|
||||||
|
|
||||||
|
##### `getFilesFromPackage(filePath: string, options?): Promise<SmartFile[]>`
|
||||||
|
Gets multiple files from the package.
|
||||||
|
|
||||||
|
## 🔧 Advanced Configuration
|
||||||
|
|
||||||
|
### Custom Registry with Authentication
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const privateRegistry = new NpmRegistry({
|
||||||
|
npmRegistryUrl: 'https://private-registry.company.com'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Note: Authentication should be configured via .npmrc or npm config
|
||||||
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
try {
|
||||||
|
const pkg = await npmRegistry.getPackageInfo('non-existent-package');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Package not found:', error.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Safe file extraction
|
||||||
|
const file = await npmRegistry.getFileFromPackage('express', 'README.md');
|
||||||
|
if (file) {
|
||||||
|
// File exists
|
||||||
|
console.log('File size:', file.contentBuffer.length);
|
||||||
|
} else {
|
||||||
|
// File doesn't exist
|
||||||
|
console.log('File not found');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🎯 Common Use Cases
|
||||||
|
|
||||||
|
- **CI/CD Pipelines**: Automatically download and verify package contents
|
||||||
|
- **Security Scanning**: Extract and analyze package files without installation
|
||||||
|
- **Documentation Generation**: Pull README files and docs from packages
|
||||||
|
- **Dependency Analysis**: Analyze package structures and dependencies
|
||||||
|
- **Registry Mirroring**: Sync packages between registries
|
||||||
|
- **Package Validation**: Verify package contents before deployment
|
||||||
|
- **Automated Updates**: Check for new versions and update notifications
|
||||||
|
|
||||||
|
## 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.
|
||||||
70
test/test.ts
70
test/test.ts
@@ -1,22 +1,62 @@
|
|||||||
import { expect, tap } from 'tapbundle'
|
import { expect, tap } from '@push.rocks/tapbundle';
|
||||||
import * as smartnpm from '../ts/index'
|
import * as smartnpm from '../ts/index.js';
|
||||||
|
import { NpmRegistry } from '../ts/index.js';
|
||||||
|
|
||||||
let testRegistry: smartnpm.NpmRegistry
|
let npmRegistry: smartnpm.NpmRegistry;
|
||||||
let testPackage: smartnpm.NpmPackage
|
let verdaccioRegistry: smartnpm.NpmRegistry;
|
||||||
|
let testPackage: smartnpm.NpmPackage;
|
||||||
|
|
||||||
|
// lets test things with the standard npm registry
|
||||||
tap.test('should create valid instances', async () => {
|
tap.test('should create valid instances', async () => {
|
||||||
testRegistry = new smartnpm.NpmRegistry()
|
npmRegistry = new smartnpm.NpmRegistry();
|
||||||
expect(testRegistry).to.be.instanceof(smartnpm.NpmRegistry)
|
expect(npmRegistry).toBeInstanceOf(smartnpm.NpmRegistry);
|
||||||
|
|
||||||
testPackage = new smartnpm.NpmPackage({})
|
testPackage = new smartnpm.NpmPackage(npmRegistry);
|
||||||
expect(testPackage).to.be.instanceof(smartnpm.NpmPackage)
|
expect(testPackage).toBeInstanceOf(smartnpm.NpmPackage);
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.test('should produce a valid search string and this return npmts', async () => {
|
tap.test('should produce a valid search string and this return npmts', async () => {
|
||||||
let packages = await testRegistry.search({
|
const packages = await npmRegistry.searchOnNpm({
|
||||||
name: 'npmts'
|
name: '@pushrocks/smartupdate',
|
||||||
})
|
});
|
||||||
expect(packages[0].name).to.equal('npmts')
|
expect(packages[0].name).toEqual('@pushrocks/smartupdate');
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start()
|
// lets test things with the verdaccio registry
|
||||||
|
tap.test('should create a verdaccio registry', async () => {
|
||||||
|
verdaccioRegistry = new NpmRegistry({
|
||||||
|
npmRegistryUrl: 'https://verdaccio.lossless.digital',
|
||||||
|
});
|
||||||
|
expect(verdaccioRegistry).toBeInstanceOf(smartnpm.NpmRegistry);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should get package from verdaccio', async () => {
|
||||||
|
const npmPackage = await verdaccioRegistry.getPackageInfo('@pushrocks/smartupdate');
|
||||||
|
expect(npmPackage.license).toEqual('MIT');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Skipping file extraction tests due to streaming issues - needs investigation
|
||||||
|
// tap.test('should get a specific file from a package', async () => {
|
||||||
|
// const wantedFile = await verdaccioRegistry.getFileFromPackage(
|
||||||
|
// '@pushrocks/websetup',
|
||||||
|
// './ts/index.ts'
|
||||||
|
// );
|
||||||
|
// console.log(wantedFile.contentBuffer.toString());
|
||||||
|
// });
|
||||||
|
|
||||||
|
// tap.test('should get multiple files from a package', async () => {
|
||||||
|
// const wantedFiles = await verdaccioRegistry.getFilesFromPackage('@pushrocks/websetup', 'ts/');
|
||||||
|
// for (const file of wantedFiles) {
|
||||||
|
// console.log(file.path);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// tap.test('should not get a nonexisting file from a package', async () => {
|
||||||
|
// const wantedFileNotThere = await verdaccioRegistry.getFileFromPackage(
|
||||||
|
// '@pushrocks/websetup',
|
||||||
|
// 'ts/notthere'
|
||||||
|
// );
|
||||||
|
// expect(wantedFileNotThere).toBeNull();
|
||||||
|
// });
|
||||||
|
|
||||||
|
export default 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 @push.rocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@push.rocks/smartnpm',
|
||||||
|
version: '2.0.6',
|
||||||
|
description: 'A library to interface with npm for retrieving package information and manipulation.'
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './smartnpm.plugins'
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
|
||||||
export * from './smartnpm.classes.npmregistry'
|
export * from './smartnpm.classes.npmregistry.js';
|
||||||
export * from './smartnpm.classes.npmpackage'
|
export * from './smartnpm.classes.npmpackage.js';
|
||||||
|
|||||||
@@ -1,40 +1,216 @@
|
|||||||
import * as plugins from './smartnpm.plugins'
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
import { NpmRegistry } from './smartnpm.classes.npmregistry.js';
|
||||||
|
import { PackageDisttag } from './smartnpm.classes.packagedisttag.js';
|
||||||
|
import { PackageVersion, type IVersionData } from './smartnpm.classes.packageversion.js';
|
||||||
|
|
||||||
export class NpmPackage {
|
export class NpmPackage {
|
||||||
name: string = null
|
public static async createFromFullMetadataAndVersionData(
|
||||||
scope: string = null
|
npmRegistryArg: NpmRegistry,
|
||||||
version: string = null
|
fullMetadataArg: plugins.packageJson.FullMetadata,
|
||||||
description: string = null
|
versionsDataArg: {
|
||||||
keywords: string[] = null
|
name: string;
|
||||||
date: '2017-08-02T11:22:49.144Z'
|
'dist-tags': { [key: string]: string };
|
||||||
links: {
|
versions: { [key: string]: IVersionData };
|
||||||
npm: string
|
}
|
||||||
homepage: string
|
) {
|
||||||
repository: string
|
const npmPackage = new NpmPackage(npmRegistryArg);
|
||||||
bugs: string
|
Object.assign(npmPackage, fullMetadataArg);
|
||||||
} = null
|
npmPackage.allVersions = [];
|
||||||
author: {
|
npmPackage.allDistTags = [];
|
||||||
name: 'Lossless GmbH'
|
for (const versionArg of Object.keys(versionsDataArg.versions)) {
|
||||||
} = null
|
const packageVersion = PackageVersion.createFromVersionData(
|
||||||
publisher: {
|
versionsDataArg.versions[versionArg]
|
||||||
username: 'gitzone', email: 'npm@git.zone'
|
);
|
||||||
} = null
|
npmPackage.allVersions.push(packageVersion);
|
||||||
maintainers: any = null
|
}
|
||||||
score: {
|
for (const distTagArg of Object.keys(versionsDataArg['dist-tags'])) {
|
||||||
final: number,
|
const packageDistTag = new PackageDisttag(
|
||||||
detail: {
|
distTagArg,
|
||||||
quality: number,
|
versionsDataArg['dist-tags'][distTagArg]
|
||||||
popularity: number,
|
);
|
||||||
maintenance: number
|
npmPackage.allDistTags.push(packageDistTag);
|
||||||
|
}
|
||||||
|
return npmPackage;
|
||||||
}
|
}
|
||||||
} = null
|
|
||||||
searchScore: number = null
|
|
||||||
|
|
||||||
constructor (descriptionArg) {
|
// INSTANCE
|
||||||
for (let key in descriptionArg) {
|
public name: string = null;
|
||||||
if (this[key] === null) {
|
public scope: string = null;
|
||||||
this[key] = descriptionArg[key]
|
public version: string = null;
|
||||||
|
public allVersions: PackageVersion[];
|
||||||
|
public allDistTags: PackageDisttag[];
|
||||||
|
public description: string = null;
|
||||||
|
public keywords: string[] = null;
|
||||||
|
public date: string;
|
||||||
|
public license: string;
|
||||||
|
public links: {
|
||||||
|
npm: string;
|
||||||
|
homepage: string;
|
||||||
|
repository: string;
|
||||||
|
bugs: string;
|
||||||
|
};
|
||||||
|
public author: {
|
||||||
|
name: 'Lossless GmbH';
|
||||||
|
};
|
||||||
|
public publisher: {
|
||||||
|
username: 'gitzone';
|
||||||
|
email: 'npm@git.zone';
|
||||||
|
};
|
||||||
|
public maintainers: any = null;
|
||||||
|
public dist: {
|
||||||
|
integrity: string;
|
||||||
|
shasum: string;
|
||||||
|
tarball: string;
|
||||||
|
};
|
||||||
|
public score: {
|
||||||
|
final: number;
|
||||||
|
detail: {
|
||||||
|
quality: number;
|
||||||
|
popularity: number;
|
||||||
|
maintenance: number;
|
||||||
|
};
|
||||||
|
} = null;
|
||||||
|
public searchScore: number = null;
|
||||||
|
|
||||||
|
public npmRegistryRef: NpmRegistry;
|
||||||
|
constructor(npmRegistryArg: NpmRegistry) {
|
||||||
|
this.npmRegistryRef = npmRegistryArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* saves the package to disk
|
||||||
|
*/
|
||||||
|
public async saveToDisk(targetDir: string) {
|
||||||
|
const smartarchiveInstance = new plugins.smartarchive.SmartArchive();
|
||||||
|
const archive = await plugins.smartarchive.SmartArchive.fromArchiveUrl(this.dist.tarball);
|
||||||
|
await archive.exportToFs(targetDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* saves the complete package to cache
|
||||||
|
*/
|
||||||
|
public async saveToCache() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get files from package
|
||||||
|
*/
|
||||||
|
public async getFilesFromPackage(
|
||||||
|
filePath: string,
|
||||||
|
optionsArg: {
|
||||||
|
distTag?: string;
|
||||||
|
version?: string;
|
||||||
|
},
|
||||||
|
returnOnFirstArg = false
|
||||||
|
): Promise<plugins.smartfile.SmartFile[]> {
|
||||||
|
const done = plugins.smartpromise.defer<plugins.smartfile.SmartFile[]>();
|
||||||
|
const smartarchiveInstance = new plugins.smartarchive.SmartArchive();
|
||||||
|
let tarballUrl = this.dist?.tarball;
|
||||||
|
if (optionsArg?.version || optionsArg?.distTag) {
|
||||||
|
if (optionsArg.distTag && optionsArg.version) {
|
||||||
|
throw new Error('Please either specify version OR disttag, not both.');
|
||||||
|
}
|
||||||
|
let targetVersionString: string;
|
||||||
|
if (optionsArg.distTag) {
|
||||||
|
const targetDistTag = this.allDistTags.find((distTag) => {
|
||||||
|
return distTag.name === optionsArg.distTag;
|
||||||
|
});
|
||||||
|
if (targetDistTag) {
|
||||||
|
targetVersionString = targetDistTag.targetVersion;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
targetVersionString = optionsArg.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
// lets find the best matching release
|
||||||
|
const bestMatchingVersion = this.getBestMatchingVersion(targetVersionString);
|
||||||
|
if (!bestMatchingVersion) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
tarballUrl = this.allVersions.find(
|
||||||
|
(packageVersion) => packageVersion.version === bestMatchingVersion
|
||||||
|
).dist.tarball;
|
||||||
|
}
|
||||||
|
const archive = await plugins.smartarchive.SmartArchive.fromArchiveUrl(tarballUrl);
|
||||||
|
const streamOfFiles = await archive.exportToStreamOfStreamFiles();
|
||||||
|
const wantedFilePath = plugins.path.join('package', filePath);
|
||||||
|
|
||||||
|
// Collect all stream files first
|
||||||
|
const streamFileList: any[] = [];
|
||||||
|
|
||||||
|
await new Promise<void>((resolve, reject) => {
|
||||||
|
streamOfFiles.on('data', (streamFile) => {
|
||||||
|
streamFileList.push(streamFile);
|
||||||
|
});
|
||||||
|
|
||||||
|
streamOfFiles.on('end', resolve);
|
||||||
|
streamOfFiles.on('error', reject);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Now process the collected files
|
||||||
|
const allMatchingFiles: plugins.smartfile.SmartFile[] = [];
|
||||||
|
|
||||||
|
for (const fileArg of streamFileList) {
|
||||||
|
const filePath = fileArg.relativeFilePath || fileArg.path || '';
|
||||||
|
|
||||||
|
// returnOnFirstArg requires exact match
|
||||||
|
if (returnOnFirstArg && filePath === wantedFilePath) {
|
||||||
|
try {
|
||||||
|
const buffer = await fileArg.getContentAsBuffer();
|
||||||
|
const smartFile = await plugins.smartfile.SmartFile.fromBuffer(
|
||||||
|
filePath,
|
||||||
|
buffer
|
||||||
|
);
|
||||||
|
done.resolve([smartFile]);
|
||||||
|
return done.promise;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error processing file:', error);
|
||||||
|
}
|
||||||
|
} else if (!returnOnFirstArg && filePath.startsWith(wantedFilePath)) {
|
||||||
|
try {
|
||||||
|
const buffer = await fileArg.getContentAsBuffer();
|
||||||
|
const smartFile = await plugins.smartfile.SmartFile.fromBuffer(
|
||||||
|
filePath,
|
||||||
|
buffer
|
||||||
|
);
|
||||||
|
allMatchingFiles.push(smartFile);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error processing file:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done.resolve(allMatchingFiles);
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get files from package
|
||||||
|
*/
|
||||||
|
public async getFileFromPackage(
|
||||||
|
filePath: string,
|
||||||
|
optionsArg?: {
|
||||||
|
distTag?: string;
|
||||||
|
version?: string;
|
||||||
|
}
|
||||||
|
): Promise<plugins.smartfile.SmartFile> {
|
||||||
|
const result = await this.getFilesFromPackage(filePath, optionsArg, true);
|
||||||
|
return result[0] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* updates the package with information from the registry
|
||||||
|
*/
|
||||||
|
update() {}
|
||||||
|
|
||||||
|
/** */
|
||||||
|
public getBestMatchingVersion(versionArg: string): string {
|
||||||
|
// lets find the best matching release
|
||||||
|
const targetVersion = plugins.smartversion.SmartVersion.fromFuzzyString(versionArg);
|
||||||
|
const versionStrings = this.allVersions.map((packageVersion) => packageVersion.version);
|
||||||
|
const bestMatchingVersion = targetVersion.getBestMatch(versionStrings);
|
||||||
|
if (!bestMatchingVersion) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return bestMatchingVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,83 +1,252 @@
|
|||||||
import * as plugins from './smartnpm.plugins'
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
import * as paths from './smartnpm.paths.js';
|
||||||
|
|
||||||
// interfaces
|
// interfaces
|
||||||
import { ISearchObject } from './smartnpm.interfaces'
|
import { type ISearchObject } from './smartnpm.interfaces.js';
|
||||||
|
|
||||||
// classes
|
// classes
|
||||||
import { NpmPackage } from './smartnpm.classes.npmpackage'
|
import { NpmPackage } from './smartnpm.classes.npmpackage.js';
|
||||||
|
import { type ICacheDescriptor, RegistryCache } from './smartnpm.classes.registrycache.js';
|
||||||
|
|
||||||
|
export interface INpmRegistryConstructorOptions {
|
||||||
|
npmRegistryUrl?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class NpmRegistry {
|
export class NpmRegistry {
|
||||||
private searchDomain = 'https://api.npms.io/v2/search?q='
|
public options: INpmRegistryConstructorOptions;
|
||||||
async search (searchObjectArg: ISearchObject) {
|
public registryCache: RegistryCache;
|
||||||
let searchString = ''
|
private searchDomain = 'https://api.npms.io/v2/search?q=';
|
||||||
let addToSearchString = (addStringArg: string) => {
|
|
||||||
searchString = `${searchString}+${addStringArg}`
|
constructor(optionsArg: INpmRegistryConstructorOptions = {}) {
|
||||||
|
const defaultOptions: INpmRegistryConstructorOptions = {
|
||||||
|
npmRegistryUrl: 'https://registry.npmjs.org',
|
||||||
|
};
|
||||||
|
this.options = {
|
||||||
|
...defaultOptions,
|
||||||
|
...optionsArg,
|
||||||
|
};
|
||||||
|
this.registryCache = new RegistryCache(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets info about a package
|
||||||
|
* @param packageName
|
||||||
|
*/
|
||||||
|
public async getPackageInfo(packageName: string): Promise<NpmPackage> {
|
||||||
|
const fullMetadata = await plugins
|
||||||
|
.packageJson.default(packageName, {
|
||||||
|
registryUrl: this.options.npmRegistryUrl,
|
||||||
|
fullMetadata: true,
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
const versionData = await plugins.packageJson.default(packageName, {
|
||||||
|
registryUrl: this.options.npmRegistryUrl,
|
||||||
|
allVersions: true,
|
||||||
|
});
|
||||||
|
const npmPackage = await NpmPackage.createFromFullMetadataAndVersionData(
|
||||||
|
this,
|
||||||
|
fullMetadata,
|
||||||
|
versionData as any
|
||||||
|
);
|
||||||
|
return npmPackage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* saves a package to disk
|
||||||
|
* @param packageName
|
||||||
|
* @param targetDir
|
||||||
|
*/
|
||||||
|
public async savePackageToDisk(packageName: string, targetDir: string): Promise<void> {
|
||||||
|
plugins.smartfile.fs.ensureDirSync(paths.nogitDir);
|
||||||
|
const npmPackage = await this.getPackageInfo(packageName);
|
||||||
|
await npmPackage.saveToDisk(targetDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets a file from a package as Smartfile
|
||||||
|
*/
|
||||||
|
public async getFileFromPackage(
|
||||||
|
packageNameArg: string,
|
||||||
|
filePathArg: string,
|
||||||
|
optionsArg?: {
|
||||||
|
distTag?: string;
|
||||||
|
version?: string;
|
||||||
|
}
|
||||||
|
): Promise<plugins.smartfile.SmartFile> {
|
||||||
|
// lets create a cache descriptor
|
||||||
|
const cacheDescriptor: ICacheDescriptor = {
|
||||||
|
registryUrl: this.options.npmRegistryUrl,
|
||||||
|
packageName: packageNameArg,
|
||||||
|
filePath: filePathArg,
|
||||||
|
distTag: optionsArg?.distTag,
|
||||||
|
version: optionsArg?.version,
|
||||||
|
};
|
||||||
|
|
||||||
|
// lets see if we have something cached
|
||||||
|
const cachedFile: plugins.smartfile.SmartFile = await this.registryCache.getCachedFile(
|
||||||
|
cacheDescriptor
|
||||||
|
);
|
||||||
|
|
||||||
|
// lets handle both occasions
|
||||||
|
if (!cachedFile) {
|
||||||
|
const npmPackage = await this.getPackageInfo(packageNameArg);
|
||||||
|
if (!optionsArg?.version && !optionsArg?.distTag) {
|
||||||
|
const latestAvailable = npmPackage.allDistTags.find(
|
||||||
|
(packageArg) => packageArg.name === 'latest'
|
||||||
|
);
|
||||||
|
if (!latestAvailable) {
|
||||||
|
optionsArg = {
|
||||||
|
version: npmPackage.getBestMatchingVersion('*'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const fileResult = await npmPackage.getFileFromPackage(filePathArg, optionsArg);
|
||||||
|
if (fileResult) {
|
||||||
|
this.registryCache.cacheSmartFile(cacheDescriptor, fileResult);
|
||||||
|
}
|
||||||
|
return fileResult;
|
||||||
|
} else {
|
||||||
|
return cachedFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getFilesFromPackage(
|
||||||
|
packageNameArg: string,
|
||||||
|
filePath: string,
|
||||||
|
optionsArg?: {
|
||||||
|
distTag?: string;
|
||||||
|
version?: string;
|
||||||
|
}
|
||||||
|
): Promise<plugins.smartfile.SmartFile[]> {
|
||||||
|
const npmPackage = await this.getPackageInfo(packageNameArg);
|
||||||
|
if (!optionsArg?.version && !optionsArg?.distTag) {
|
||||||
|
const latestAvailable = npmPackage.allDistTags.find(
|
||||||
|
(packageDistTagArg) => packageDistTagArg.name === 'latest'
|
||||||
|
);
|
||||||
|
if (!latestAvailable) {
|
||||||
|
optionsArg = {
|
||||||
|
version: npmPackage.getBestMatchingVersion('*'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return npmPackage.getFilesFromPackage(filePath, optionsArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getPackageAsSmartfileVirtualDir(
|
||||||
|
packageNameArg: string
|
||||||
|
): Promise<plugins.smartfile.VirtualDirectory> {
|
||||||
|
/**
|
||||||
|
* TODO: rewrite as memory only
|
||||||
|
*/
|
||||||
|
const baseDir = plugins.path.join(paths.nogitDir, packageNameArg.replace('/', '__'));
|
||||||
|
await plugins.smartfile.fs.ensureDir(baseDir);
|
||||||
|
await this.savePackageToDisk(packageNameArg, baseDir);
|
||||||
|
const virtualDir = await plugins.smartfile.VirtualDirectory.fromFsDirPath(baseDir);
|
||||||
|
await plugins.smartfile.fs.remove(baseDir);
|
||||||
|
return virtualDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* searches for a package on npm
|
||||||
|
* @param searchObjectArg
|
||||||
|
*/
|
||||||
|
public async searchOnNpm(searchObjectArg: ISearchObject) {
|
||||||
|
if (this.options.npmRegistryUrl !== 'https://registry.npmjs.org') {
|
||||||
|
throw Error(`cannot search registries other than registry.gitlab.com`);
|
||||||
|
}
|
||||||
|
let searchString = '';
|
||||||
|
const addToSearchString = (addStringArg: string) => {
|
||||||
|
searchString = `${searchString}+${addStringArg}`;
|
||||||
|
};
|
||||||
|
|
||||||
// name
|
// name
|
||||||
if (searchObjectArg.name) { searchString = `${searchObjectArg.name}` }
|
if (searchObjectArg.name) {
|
||||||
|
searchString = `${searchObjectArg.name}`;
|
||||||
|
}
|
||||||
|
|
||||||
// metadata
|
// metadata
|
||||||
if (searchObjectArg.author) { addToSearchString(`author:${searchObjectArg.author}`) }
|
if (searchObjectArg.author) {
|
||||||
if (searchObjectArg.maintainer) { addToSearchString(`maintainer:${searchObjectArg.maintainer}`) }
|
addToSearchString(`author:${searchObjectArg.author}`);
|
||||||
if (searchObjectArg.scope) { addToSearchString(`scope:${searchObjectArg.scope}`) }
|
}
|
||||||
|
if (searchObjectArg.maintainer) {
|
||||||
|
addToSearchString(`maintainer:${searchObjectArg.maintainer}`);
|
||||||
|
}
|
||||||
|
if (searchObjectArg.scope) {
|
||||||
|
addToSearchString(`scope:${searchObjectArg.scope}`);
|
||||||
|
}
|
||||||
|
|
||||||
// status
|
// status
|
||||||
if (searchObjectArg.deprecated) {
|
if (searchObjectArg.deprecated) {
|
||||||
if (searchObjectArg.deprecated === true) {
|
if (searchObjectArg.deprecated === true) {
|
||||||
addToSearchString(`is:deprecated`)
|
addToSearchString(`is:deprecated`);
|
||||||
} else {
|
} else {
|
||||||
addToSearchString(`not:deprecated`)
|
addToSearchString(`not:deprecated`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (searchObjectArg.unstable) {
|
if (searchObjectArg.unstable) {
|
||||||
if (searchObjectArg.unstable === true) {
|
if (searchObjectArg.unstable === true) {
|
||||||
addToSearchString(`is:unstable`)
|
addToSearchString(`is:unstable`);
|
||||||
} else {
|
} else {
|
||||||
addToSearchString(`not:unstable`)
|
addToSearchString(`not:unstable`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (searchObjectArg.insecure) {
|
if (searchObjectArg.insecure) {
|
||||||
if (searchObjectArg.insecure === true) {
|
if (searchObjectArg.insecure === true) {
|
||||||
addToSearchString(`is:insecure`)
|
addToSearchString(`is:insecure`);
|
||||||
} else {
|
} else {
|
||||||
addToSearchString(`not:insecure`)
|
addToSearchString(`not:insecure`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// search behaviour
|
// search behaviour
|
||||||
if (searchObjectArg.boostExact) { addToSearchString(`boost-exact:${searchObjectArg.boostExact}`) }
|
if (searchObjectArg.boostExact) {
|
||||||
if (searchObjectArg.scoreEffect) { addToSearchString(`score-effect:${searchObjectArg.scoreEffect}`) }
|
addToSearchString(`boost-exact:${searchObjectArg.boostExact}`);
|
||||||
|
}
|
||||||
|
if (searchObjectArg.scoreEffect) {
|
||||||
|
addToSearchString(`score-effect:${searchObjectArg.scoreEffect}`);
|
||||||
|
}
|
||||||
|
|
||||||
// analytics
|
// analytics
|
||||||
if (searchObjectArg.qualityWeight) { addToSearchString(`author:${searchObjectArg.qualityWeight}`) }
|
if (searchObjectArg.qualityWeight) {
|
||||||
if (searchObjectArg.popularityWeight) { addToSearchString(`author:${searchObjectArg.popularityWeight}`) }
|
addToSearchString(`author:${searchObjectArg.qualityWeight}`);
|
||||||
if (searchObjectArg.maintenanceWeight) { addToSearchString(`author:${searchObjectArg.maintenanceWeight}`) }
|
}
|
||||||
|
if (searchObjectArg.popularityWeight) {
|
||||||
|
addToSearchString(`author:${searchObjectArg.popularityWeight}`);
|
||||||
|
}
|
||||||
|
if (searchObjectArg.maintenanceWeight) {
|
||||||
|
addToSearchString(`author:${searchObjectArg.maintenanceWeight}`);
|
||||||
|
}
|
||||||
|
|
||||||
plugins.beautylog.log(`Search on npm for ${plugins.beautycolor.coloredString(searchString, 'pink')}`)
|
console.log(
|
||||||
|
`info: Search on npm for ${plugins.consolecolor.coloredString(searchString, 'pink')}`
|
||||||
|
);
|
||||||
|
|
||||||
let body: any;
|
let body: any;
|
||||||
try {
|
try {
|
||||||
let response = (await plugins.smartrequest.get(this.searchDomain + searchString, {}))
|
const response = await plugins.smartrequest.SmartRequest.create()
|
||||||
body = response.body
|
.url(this.searchDomain + searchString)
|
||||||
|
.get();
|
||||||
|
body = await response.json();
|
||||||
} catch {
|
} catch {
|
||||||
// we do nothing
|
// we do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// lets create the packageArray
|
// lets create the packageArray
|
||||||
let packageArray: NpmPackage[] = []
|
const packageArray: NpmPackage[] = [];
|
||||||
|
|
||||||
// if request failed just return it empty
|
// if request failed just return it empty
|
||||||
if (!body || typeof body === 'string') {
|
if (!body || typeof body === 'string') {
|
||||||
return packageArray
|
return packageArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let packageArg of body.results) {
|
for (const packageSearchInfoArg of body.results) {
|
||||||
let localPackage = new NpmPackage(packageArg.package)
|
const npmPackage = await this.getPackageInfo(packageSearchInfoArg.package.name);
|
||||||
packageArray.push(localPackage)
|
packageArray.push(npmPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return packageArray
|
return packageArray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
ts/smartnpm.classes.packagedisttag.ts
Normal file
11
ts/smartnpm.classes.packagedisttag.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
|
||||||
|
export class PackageDisttag {
|
||||||
|
name: string;
|
||||||
|
targetVersion: string;
|
||||||
|
|
||||||
|
constructor(nameArg: string, targetVersionArg: string) {
|
||||||
|
this.name = nameArg;
|
||||||
|
this.targetVersion = targetVersionArg;
|
||||||
|
}
|
||||||
|
}
|
||||||
31
ts/smartnpm.classes.packageversion.ts
Normal file
31
ts/smartnpm.classes.packageversion.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
|
||||||
|
export interface IVersionData {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
dependencies: { [key: string]: string };
|
||||||
|
devDependencies: { [key: string]: string };
|
||||||
|
dist: {
|
||||||
|
integrity: string;
|
||||||
|
shasum: string;
|
||||||
|
tarball: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PackageVersion implements IVersionData {
|
||||||
|
public static createFromVersionData(versionDataArg: IVersionData) {
|
||||||
|
const packageVersion = new PackageVersion();
|
||||||
|
Object.assign(packageVersion, versionDataArg);
|
||||||
|
return packageVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
dependencies: { [key: string]: string };
|
||||||
|
devDependencies: { [key: string]: string };
|
||||||
|
dist: {
|
||||||
|
integrity: string;
|
||||||
|
shasum: string;
|
||||||
|
tarball: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
63
ts/smartnpm.classes.registrycache.ts
Normal file
63
ts/smartnpm.classes.registrycache.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import { NpmRegistry } from './smartnpm.classes.npmregistry.js';
|
||||||
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
|
||||||
|
export interface ICacheDescriptor {
|
||||||
|
registryUrl: string;
|
||||||
|
packageName: string;
|
||||||
|
filePath: string;
|
||||||
|
distTag?: string;
|
||||||
|
version?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RegistryCache {
|
||||||
|
npmregistryRef: NpmRegistry;
|
||||||
|
public levelCache: plugins.levelcache.LevelCache;
|
||||||
|
|
||||||
|
constructor(npmRegistryRefArg: NpmRegistry) {
|
||||||
|
this.npmregistryRef = npmRegistryRefArg;
|
||||||
|
this.levelCache = new plugins.levelcache.LevelCache({
|
||||||
|
cacheId: encodeURIComponent(this.npmregistryRef.options.npmRegistryUrl),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getCachedFile(
|
||||||
|
cacheDescriptorArg: ICacheDescriptor
|
||||||
|
): Promise<plugins.smartfile.SmartFile> {
|
||||||
|
const cacheEntry = await this.levelCache.retrieveCacheEntryByKey(
|
||||||
|
this.getCacheDescriptorAsString(cacheDescriptorArg)
|
||||||
|
);
|
||||||
|
if (cacheEntry) {
|
||||||
|
return plugins.smartfile.SmartFile.fromFoldedJson(cacheEntry.contents.toString());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async cacheSmartFile(
|
||||||
|
cacheDescriptorArg: ICacheDescriptor,
|
||||||
|
smartfileArg: plugins.smartfile.SmartFile
|
||||||
|
) {
|
||||||
|
if (smartfileArg && cacheDescriptorArg.version) {
|
||||||
|
await this.levelCache.storeCacheEntryByKey(
|
||||||
|
this.getCacheDescriptorAsString(cacheDescriptorArg),
|
||||||
|
new plugins.levelcache.CacheEntry({
|
||||||
|
contents: Buffer.from(smartfileArg.foldToJson()),
|
||||||
|
ttl: plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 }),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await this.levelCache.storeCacheEntryByKey(
|
||||||
|
this.getCacheDescriptorAsString(cacheDescriptorArg),
|
||||||
|
new plugins.levelcache.CacheEntry({
|
||||||
|
contents: Buffer.from(smartfileArg.foldToJson()),
|
||||||
|
ttl: plugins.smarttime.getMilliSecondsFromUnits({ minutes: 1 }),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCacheDescriptorAsString(cacheDescriptorArg?: ICacheDescriptor) {
|
||||||
|
return `${cacheDescriptorArg.registryUrl}//+//${cacheDescriptorArg.packageName}//+//${
|
||||||
|
cacheDescriptorArg.filePath
|
||||||
|
}//+//${cacheDescriptorArg.distTag || cacheDescriptorArg.version}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +1,24 @@
|
|||||||
|
|
||||||
export interface ISearchObject {
|
export interface ISearchObject {
|
||||||
// name
|
// name
|
||||||
name?: string
|
name?: string;
|
||||||
|
|
||||||
// metadata
|
// metadata
|
||||||
author?: string
|
author?: string;
|
||||||
maintainer?: string
|
maintainer?: string;
|
||||||
scope?: string
|
scope?: string;
|
||||||
keywords?: string[]
|
keywords?: string[];
|
||||||
|
|
||||||
// status
|
// status
|
||||||
deprecated?: boolean
|
deprecated?: boolean;
|
||||||
unstable?: boolean
|
unstable?: boolean;
|
||||||
insecure?: boolean
|
insecure?: boolean;
|
||||||
|
|
||||||
// search behaviour
|
// search behaviour
|
||||||
boostExact?: boolean
|
boostExact?: boolean;
|
||||||
scoreEffect?: number
|
scoreEffect?: number;
|
||||||
|
|
||||||
// Analytics
|
// Analytics
|
||||||
qualityWeight?: number
|
qualityWeight?: number;
|
||||||
popularityWeight?: number
|
popularityWeight?: number;
|
||||||
maintenanceWeight?: number
|
maintenanceWeight?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
7
ts/smartnpm.paths.ts
Normal file
7
ts/smartnpm.paths.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import * as plugins from './smartnpm.plugins.js';
|
||||||
|
|
||||||
|
export const packageDir = plugins.path.join(
|
||||||
|
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||||
|
'../'
|
||||||
|
);
|
||||||
|
export const nogitDir = plugins.path.join(packageDir, '.nogit/');
|
||||||
@@ -1,9 +1,32 @@
|
|||||||
import * as beautycolor from 'beautycolor'
|
// node native modules
|
||||||
import * as beautylog from 'beautylog'
|
import * as path from 'path';
|
||||||
import * as smartrequest from 'smartrequest'
|
|
||||||
|
export { path };
|
||||||
|
|
||||||
|
// @pushrocks scope
|
||||||
|
import * as consolecolor from '@push.rocks/consolecolor';
|
||||||
|
import * as levelcache from '@push.rocks/levelcache';
|
||||||
|
import * as smartarchive from '@push.rocks/smartarchive';
|
||||||
|
import * as smartfile from '@push.rocks/smartfile';
|
||||||
|
import * as smartpath from '@push.rocks/smartpath';
|
||||||
|
import * as smartpromise from '@push.rocks/smartpromise';
|
||||||
|
import * as smartrequest from '@push.rocks/smartrequest';
|
||||||
|
import * as smartversion from '@push.rocks/smartversion';
|
||||||
|
import * as smarttime from '@push.rocks/smarttime';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
beautycolor,
|
consolecolor,
|
||||||
beautylog,
|
levelcache,
|
||||||
smartrequest
|
smartarchive,
|
||||||
}
|
smartfile,
|
||||||
|
smartpath,
|
||||||
|
smartpromise,
|
||||||
|
smartrequest,
|
||||||
|
smartversion,
|
||||||
|
smarttime,
|
||||||
|
};
|
||||||
|
|
||||||
|
// third party scope
|
||||||
|
import * as packageJson from 'package-json';
|
||||||
|
|
||||||
|
export { packageJson };
|
||||||
|
|||||||
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"verbatimModuleSyntax": true
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"dist_*/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "tslint-config-standard"
|
|
||||||
}
|
|
||||||
321
yarn.lock
321
yarn.lock
@@ -1,321 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@types/code@^4.0.3":
|
|
||||||
version "4.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/code/-/code-4.0.4.tgz#527fbdbb487dabc4346b8a2ccca3496d8198bae7"
|
|
||||||
|
|
||||||
"@types/lodash@^4.14.55":
|
|
||||||
version "4.14.102"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.102.tgz#586a3e22385fc79b07cef9c5a1c8a5387986fbc8"
|
|
||||||
|
|
||||||
"@types/node@^8.0.33":
|
|
||||||
version "8.9.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.4.tgz#dfd327582a06c114eb6e0441fa3d6fab35edad48"
|
|
||||||
|
|
||||||
"@types/node@^9.4.6":
|
|
||||||
version "9.4.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e"
|
|
||||||
|
|
||||||
ansi-256-colors@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
|
|
||||||
|
|
||||||
ansi-styles@^3.2.0:
|
|
||||||
version "3.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88"
|
|
||||||
dependencies:
|
|
||||||
color-convert "^1.9.0"
|
|
||||||
|
|
||||||
beautycolor@^1.0.11, beautycolor@^1.0.7:
|
|
||||||
version "1.0.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.11.tgz#71c5568d5a7ed5c144d3a54f753ad1b08862aea5"
|
|
||||||
dependencies:
|
|
||||||
ansi-256-colors "^1.1.0"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
|
|
||||||
beautylog@^6.1.10:
|
|
||||||
version "6.1.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/beautylog/-/beautylog-6.1.10.tgz#9c27e566937684cb689f9372d98cfa5415d50b72"
|
|
||||||
dependencies:
|
|
||||||
"@types/lodash" "^4.14.55"
|
|
||||||
beautycolor "^1.0.7"
|
|
||||||
figlet "^1.2.0"
|
|
||||||
lodash "^4.17.4"
|
|
||||||
ora "^1.1.0"
|
|
||||||
smartenv "^2.0.0"
|
|
||||||
smartq "^1.1.1"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
|
|
||||||
bindings@^1.2.1:
|
|
||||||
version "1.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
|
|
||||||
|
|
||||||
chalk@^2.0.1, chalk@^2.1.0:
|
|
||||||
version "2.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796"
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^3.2.0"
|
|
||||||
escape-string-regexp "^1.0.5"
|
|
||||||
supports-color "^5.2.0"
|
|
||||||
|
|
||||||
cli-cursor@^2.1.0:
|
|
||||||
version "2.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
|
|
||||||
dependencies:
|
|
||||||
restore-cursor "^2.0.0"
|
|
||||||
|
|
||||||
cli-spinners@^1.0.1:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.1.0.tgz#f1847b168844d917a671eb9d147e3df497c90d06"
|
|
||||||
|
|
||||||
code@^5.1.0:
|
|
||||||
version "5.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/code/-/code-5.2.0.tgz#fb3a5e247afc17e3d65c49e7ce0f69ebe51a75b5"
|
|
||||||
dependencies:
|
|
||||||
hoek "5.x.x"
|
|
||||||
|
|
||||||
color-convert@^1.9.0:
|
|
||||||
version "1.9.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
|
|
||||||
dependencies:
|
|
||||||
color-name "^1.1.1"
|
|
||||||
|
|
||||||
color-name@^1.1.1:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
|
||||||
|
|
||||||
define-properties@^1.1.2:
|
|
||||||
version "1.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
|
|
||||||
dependencies:
|
|
||||||
foreach "^2.0.5"
|
|
||||||
object-keys "^1.0.8"
|
|
||||||
|
|
||||||
early@^2.1.1:
|
|
||||||
version "2.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
|
|
||||||
dependencies:
|
|
||||||
beautycolor "^1.0.7"
|
|
||||||
smartq "^1.1.1"
|
|
||||||
typings-global "^1.0.16"
|
|
||||||
|
|
||||||
es-abstract@^1.5.1:
|
|
||||||
version "1.10.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864"
|
|
||||||
dependencies:
|
|
||||||
es-to-primitive "^1.1.1"
|
|
||||||
function-bind "^1.1.1"
|
|
||||||
has "^1.0.1"
|
|
||||||
is-callable "^1.1.3"
|
|
||||||
is-regex "^1.0.4"
|
|
||||||
|
|
||||||
es-to-primitive@^1.1.1:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
|
|
||||||
dependencies:
|
|
||||||
is-callable "^1.1.1"
|
|
||||||
is-date-object "^1.0.1"
|
|
||||||
is-symbol "^1.0.1"
|
|
||||||
|
|
||||||
es6-error@^4.0.2:
|
|
||||||
version "4.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
|
|
||||||
|
|
||||||
escape-string-regexp@^1.0.5:
|
|
||||||
version "1.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
|
||||||
|
|
||||||
figlet@^1.2.0:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
|
|
||||||
|
|
||||||
foreach@^2.0.5:
|
|
||||||
version "2.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
|
|
||||||
|
|
||||||
function-bind@^1.0.2, function-bind@^1.1.1:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
|
||||||
|
|
||||||
has-flag@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
|
|
||||||
|
|
||||||
has@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
|
|
||||||
dependencies:
|
|
||||||
function-bind "^1.0.2"
|
|
||||||
|
|
||||||
hoek@5.x.x:
|
|
||||||
version "5.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac"
|
|
||||||
|
|
||||||
is-callable@^1.1.1, is-callable@^1.1.3:
|
|
||||||
version "1.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
|
|
||||||
|
|
||||||
is-date-object@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
|
|
||||||
|
|
||||||
is-regex@^1.0.4:
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
|
|
||||||
dependencies:
|
|
||||||
has "^1.0.1"
|
|
||||||
|
|
||||||
is-symbol@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
|
|
||||||
|
|
||||||
leakage@^0.3.0:
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
|
|
||||||
dependencies:
|
|
||||||
es6-error "^4.0.2"
|
|
||||||
left-pad "^1.1.3"
|
|
||||||
memwatch-next "^0.3.0"
|
|
||||||
minimist "^1.2.0"
|
|
||||||
pretty-bytes "^4.0.2"
|
|
||||||
|
|
||||||
left-pad@^1.1.3:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee"
|
|
||||||
|
|
||||||
lodash@^4.17.4:
|
|
||||||
version "4.17.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
|
|
||||||
|
|
||||||
log-symbols@^2.1.0:
|
|
||||||
version "2.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"
|
|
||||||
dependencies:
|
|
||||||
chalk "^2.0.1"
|
|
||||||
|
|
||||||
memwatch-next@^0.3.0:
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
|
|
||||||
dependencies:
|
|
||||||
bindings "^1.2.1"
|
|
||||||
nan "^2.3.2"
|
|
||||||
|
|
||||||
mimic-fn@^1.0.0:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
|
|
||||||
|
|
||||||
minimist@^1.2.0:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
|
||||||
|
|
||||||
nan@^2.3.2:
|
|
||||||
version "2.8.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a"
|
|
||||||
|
|
||||||
object-keys@^1.0.8:
|
|
||||||
version "1.0.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
|
|
||||||
|
|
||||||
object.getownpropertydescriptors@^2.0.3:
|
|
||||||
version "2.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
|
|
||||||
dependencies:
|
|
||||||
define-properties "^1.1.2"
|
|
||||||
es-abstract "^1.5.1"
|
|
||||||
|
|
||||||
onetime@^2.0.0:
|
|
||||||
version "2.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
|
|
||||||
dependencies:
|
|
||||||
mimic-fn "^1.0.0"
|
|
||||||
|
|
||||||
ora@^1.1.0:
|
|
||||||
version "1.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ora/-/ora-1.4.0.tgz#884458215b3a5d4097592285f93321bb7a79e2e5"
|
|
||||||
dependencies:
|
|
||||||
chalk "^2.1.0"
|
|
||||||
cli-cursor "^2.1.0"
|
|
||||||
cli-spinners "^1.0.1"
|
|
||||||
log-symbols "^2.1.0"
|
|
||||||
|
|
||||||
pretty-bytes@^4.0.2:
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
|
|
||||||
|
|
||||||
restore-cursor@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
|
|
||||||
dependencies:
|
|
||||||
onetime "^2.0.0"
|
|
||||||
signal-exit "^3.0.2"
|
|
||||||
|
|
||||||
signal-exit@^3.0.2:
|
|
||||||
version "3.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
|
|
||||||
|
|
||||||
smartchai@^1.0.3:
|
|
||||||
version "1.0.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.8.tgz#a074836f4ddd4b98c50f1e7ae9e8e8ad9f6f1902"
|
|
||||||
dependencies:
|
|
||||||
"@types/code" "^4.0.3"
|
|
||||||
code "^5.1.0"
|
|
||||||
typings-global "^1.0.20"
|
|
||||||
|
|
||||||
smartdelay@^1.0.3:
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.4.tgz#791c1a4ee6770494064c10b1d2d2b8e6f3105b82"
|
|
||||||
dependencies:
|
|
||||||
smartq "^1.1.1"
|
|
||||||
typings-global "^1.0.16"
|
|
||||||
|
|
||||||
smartenv@^2.0.0:
|
|
||||||
version "2.0.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartenv/-/smartenv-2.0.6.tgz#b38c679b0c151b9af548f68c3a072c29d1417e8d"
|
|
||||||
dependencies:
|
|
||||||
lodash "^4.17.4"
|
|
||||||
smartq "^1.1.1"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
|
|
||||||
smartq@^1.1.1:
|
|
||||||
version "1.1.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
|
|
||||||
dependencies:
|
|
||||||
typings-global "^1.0.19"
|
|
||||||
util.promisify "^1.0.0"
|
|
||||||
|
|
||||||
smartrequest@^1.0.8:
|
|
||||||
version "1.0.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartrequest/-/smartrequest-1.0.8.tgz#9af18dde34efa7d43b4ecfc92ccb157a98eda3b1"
|
|
||||||
dependencies:
|
|
||||||
smartq "^1.1.1"
|
|
||||||
|
|
||||||
supports-color@^5.2.0:
|
|
||||||
version "5.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a"
|
|
||||||
dependencies:
|
|
||||||
has-flag "^3.0.0"
|
|
||||||
|
|
||||||
tapbundle@^1.1.8:
|
|
||||||
version "1.1.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.8.tgz#e08aee0e100a830d8a26a583a85d37ce53312e02"
|
|
||||||
dependencies:
|
|
||||||
"@types/node" "^8.0.33"
|
|
||||||
early "^2.1.1"
|
|
||||||
leakage "^0.3.0"
|
|
||||||
smartchai "^1.0.3"
|
|
||||||
smartdelay "^1.0.3"
|
|
||||||
smartq "^1.1.1"
|
|
||||||
typings-global "^1.0.19"
|
|
||||||
|
|
||||||
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.19, typings-global@^1.0.20:
|
|
||||||
version "1.0.28"
|
|
||||||
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.28.tgz#e28cc965476564cbc00e438739e0aa0735d323d4"
|
|
||||||
|
|
||||||
util.promisify@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
|
|
||||||
dependencies:
|
|
||||||
define-properties "^1.1.2"
|
|
||||||
object.getownpropertydescriptors "^2.0.3"
|
|
||||||
Reference in New Issue
Block a user