Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
6b13e46947 | |||
096c38de9e | |||
7292b45d33 | |||
3ddad53d29 |
@ -19,23 +19,35 @@ mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
audit:
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
@ -50,9 +62,7 @@ testStable:
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
@ -63,9 +73,7 @@ testBuild:
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
@ -85,6 +93,8 @@ release:
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -15,7 +15,7 @@
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm"]
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8074
package-lock.json
generated
8074
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartnpm",
|
||||
"version": "1.0.17",
|
||||
"version": "1.0.19",
|
||||
"private": false,
|
||||
"description": "interface with npm to retrieve package information",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -12,19 +12,19 @@
|
||||
"build": "(tsbuild --web)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.24",
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@gitzone/tstest": "^1.0.33",
|
||||
"@pushrocks/tapbundle": "^3.2.1",
|
||||
"@types/node": "^14.0.14",
|
||||
"tslint": "^6.1.2",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.11.2",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/consolecolor": "^2.0.1",
|
||||
"@pushrocks/smartarchive": "^1.0.12",
|
||||
"@pushrocks/smartfile": "^7.0.12",
|
||||
"@pushrocks/smartrequest": "^1.1.47",
|
||||
"@pushrocks/smartfile": "^8.0.4",
|
||||
"@pushrocks/smartrequest": "^1.1.51",
|
||||
"package-json": "^6.5.0"
|
||||
},
|
||||
"files": [
|
||||
@ -38,5 +38,8 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ tap.test('should create valid instances', async () => {
|
||||
|
||||
tap.test('should produce a valid search string and this return npmts', async () => {
|
||||
const packages = await npmRegistry.searchOnNpm({
|
||||
name: '@pushrocks/smartupdate'
|
||||
name: '@pushrocks/smartupdate',
|
||||
});
|
||||
expect(packages[0].name).to.equal('@pushrocks/smartupdate');
|
||||
});
|
||||
@ -25,7 +25,7 @@ tap.test('should produce a valid search string and this return npmts', async ()
|
||||
// lets test things with the verdaccio registry
|
||||
tap.test('should create a verdaccio registry', async () => {
|
||||
verdaccioRegistry = new NpmRegistry({
|
||||
npmRegistryUrl: 'https://verdaccio.lossless.one'
|
||||
npmRegistryUrl: 'https://verdaccio.lossless.one',
|
||||
});
|
||||
expect(verdaccioRegistry).to.be.instanceOf(smartnpm.NpmRegistry);
|
||||
});
|
||||
|
@ -52,10 +52,10 @@ export class NpmRegistry {
|
||||
/**
|
||||
* gets a file from a package as Smartfile
|
||||
*/
|
||||
public async getFileFromPackage(packageName: string, filePath: string) {
|
||||
const baseDir = plugins.path.join(paths.nogitDir, packageName.replace('/', '__'));
|
||||
public async getFileFromPackage(packageNameArg: string, filePath: string) {
|
||||
const baseDir = plugins.path.join(paths.nogitDir, packageNameArg.replace('/', '__'));
|
||||
await plugins.smartfile.fs.ensureDir(baseDir);
|
||||
await this.savePackageToDisk(packageName, baseDir);
|
||||
await this.savePackageToDisk(packageNameArg, baseDir);
|
||||
const smartfile = await plugins.smartfile.Smartfile.fromFilePath(
|
||||
plugins.path.join(baseDir, 'package', filePath)
|
||||
);
|
||||
@ -63,6 +63,15 @@ export class NpmRegistry {
|
||||
return smartfile;
|
||||
}
|
||||
|
||||
public async getPackageAsSmartfileVirtualDir(packageNameArg: string): Promise<plugins.smartfile.VirtualDirectory> {
|
||||
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
|
||||
|
Reference in New Issue
Block a user