Skip to content

Commit

Permalink
feat(js): add verdaccio executor (#16928)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi authored May 25, 2023
1 parent fd6794f commit be2ccb8
Show file tree
Hide file tree
Showing 21 changed files with 611 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -5027,6 +5027,14 @@
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "verdaccio",
"path": "/packages/js/executors/verdaccio",
"name": "verdaccio",
"children": [],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
Expand Down Expand Up @@ -5060,6 +5068,14 @@
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "setup-verdaccio",
"path": "/packages/js/generators/setup-verdaccio",
"name": "setup-verdaccio",
"children": [],
"isExternal": false,
"disableCollapsible": false
}
],
"isExternal": false,
Expand Down
18 changes: 18 additions & 0 deletions docs/generated/manifests/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,15 @@
"originalFilePath": "/packages/js/src/executors/node/schema.json",
"path": "/packages/js/executors/node",
"type": "executor"
},
"/packages/js/executors/verdaccio": {
"description": "Start local registry with verdaccio",
"file": "generated/packages/js/executors/verdaccio.json",
"hidden": false,
"name": "verdaccio",
"originalFilePath": "/packages/js/src/executors/verdaccio/schema.json",
"path": "/packages/js/executors/verdaccio",
"type": "executor"
}
},
"generators": {
Expand Down Expand Up @@ -1031,6 +1040,15 @@
"originalFilePath": "/packages/js/src/generators/convert-to-swc/schema.json",
"path": "/packages/js/generators/convert-to-swc",
"type": "generator"
},
"/packages/js/generators/setup-verdaccio": {
"description": "Setup Verdaccio for local package management.",
"file": "generated/packages/js/generators/setup-verdaccio.json",
"hidden": false,
"name": "setup-verdaccio",
"originalFilePath": "/packages/js/src/generators/setup-verdaccio/schema.json",
"path": "/packages/js/generators/setup-verdaccio",
"type": "generator"
}
},
"path": "/packages/js"
Expand Down
18 changes: 18 additions & 0 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,15 @@
"originalFilePath": "/packages/js/src/executors/node/schema.json",
"path": "js/executors/node",
"type": "executor"
},
{
"description": "Start local registry with verdaccio",
"file": "generated/packages/js/executors/verdaccio.json",
"hidden": false,
"name": "verdaccio",
"originalFilePath": "/packages/js/src/executors/verdaccio/schema.json",
"path": "js/executors/verdaccio",
"type": "executor"
}
],
"generators": [
Expand Down Expand Up @@ -1015,6 +1024,15 @@
"originalFilePath": "/packages/js/src/generators/convert-to-swc/schema.json",
"path": "js/generators/convert-to-swc",
"type": "generator"
},
{
"description": "Setup Verdaccio for local package management.",
"file": "generated/packages/js/generators/setup-verdaccio.json",
"hidden": false,
"name": "setup-verdaccio",
"originalFilePath": "/packages/js/src/generators/setup-verdaccio/schema.json",
"path": "js/generators/setup-verdaccio",
"type": "generator"
}
],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
Expand Down
45 changes: 45 additions & 0 deletions docs/generated/packages/js/executors/verdaccio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "verdaccio",
"implementation": "/packages/js/src/executors/verdaccio/verdaccio.impl.ts",
"schema": {
"$schema": "http://json-schema.org/schema",
"version": 2,
"title": "Verdaccio Local Registry",
"description": "Start a local registry with Verdaccio.",
"cli": "nx",
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location option for npm config",
"default": "user",
"enum": ["global", "user", "project"]
},
"storage": {
"type": "string",
"description": "Path to the custom storage directory for Verdaccio"
},
"port": {
"type": "number",
"description": "Port of local registry that Verdaccio should listen to",
"default": 4873
},
"config": {
"type": "string",
"description": "Path to the custom Verdaccio config file"
},
"clear": {
"type": "boolean",
"description": "Clear local registry storage before starting Verdaccio",
"default": true
}
},
"required": ["port"],
"presets": []
},
"description": "Start local registry with verdaccio",
"aliases": [],
"hidden": false,
"path": "/packages/js/src/executors/verdaccio/schema.json",
"type": "executor"
}
28 changes: 28 additions & 0 deletions docs/generated/packages/js/generators/setup-verdaccio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "setup-verdaccio",
"factory": "./src/generators/setup-verdaccio/generator#setupVerdaccio",
"schema": {
"$schema": "http://json-schema.org/schema",
"$id": "SetupVerdaccio",
"title": "Setup Verdaccio",
"description": "Setup Verdaccio local-registry.",
"type": "object",
"properties": {
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
}
},
"required": [],
"presets": []
},
"alias": ["verdaccio"],
"description": "Setup Verdaccio for local package management.",
"implementation": "/packages/js/src/generators/setup-verdaccio/generator#setupVerdaccio.ts",
"aliases": [],
"hidden": false,
"path": "/packages/js/src/generators/setup-verdaccio/schema.json",
"type": "generator"
}
10 changes: 10 additions & 0 deletions packages/js/executors.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"implementation": "./src/executors/node/node.impl",
"schema": "./src/executors/node/schema.json",
"description": "Execute a Node application."
},
"verdaccio": {
"implementation": "./src/executors/verdaccio/verdaccio.impl",
"schema": "./src/executors/verdaccio/schema.json",
"description": "Start local registry with verdaccio"
}
},
"builders": {
Expand All @@ -32,6 +37,11 @@
"implementation": "./src/executors/node/compat",
"schema": "./src/executors/node/schema.json",
"description": "Execute a Node application."
},
"verdaccio": {
"implementation": "./src/executors/verdaccio/compat",
"schema": "./src/executors/verdaccio/schema.json",
"description": "Start local registry with verdaccio"
}
}
}
12 changes: 12 additions & 0 deletions packages/js/generators.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"aliases": ["swc"],
"x-type": "library",
"description": "Convert a TypeScript library to compile with SWC."
},
"setup-verdaccio": {
"factory": "./src/generators/setup-verdaccio/generator#setupVerdaccioSchematic",
"schema": "./src/generators/setup-verdaccio/schema.json",
"alias": ["verdaccio"],
"description": "Setup Verdaccio for local package management."
}
},
"generators": {
Expand All @@ -47,6 +53,12 @@
"aliases": ["swc"],
"x-type": "library",
"description": "Convert a TypeScript library to compile with SWC."
},
"setup-verdaccio": {
"factory": "./src/generators/setup-verdaccio/generator#setupVerdaccio",
"schema": "./src/generators/setup-verdaccio/schema.json",
"alias": ["verdaccio"],
"description": "Setup Verdaccio for local package management."
}
}
}
8 changes: 8 additions & 0 deletions packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
"@nx/devkit": "file:../devkit",
"@nx/workspace": "file:../workspace"
},
"peerDependencies": {
"verdaccio": "^5.0.4"
},
"peerDependenciesMeta": {
"verdaccio": {
"optional": true
}
},
"publishConfig": {
"access": "public"
}
Expand Down
5 changes: 5 additions & 0 deletions packages/js/src/executors/verdaccio/compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { convertNxExecutor } from '@nx/devkit';

import { verdaccioExecutor } from './verdaccio.impl';

export default convertNxExecutor(verdaccioExecutor);
7 changes: 7 additions & 0 deletions packages/js/src/executors/verdaccio/schema.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface VerdaccioExecutorSchema {
location?: string;
storage?: string;
port: number;
config?: string;
clear?: boolean;
}
35 changes: 35 additions & 0 deletions packages/js/src/executors/verdaccio/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/schema",
"version": 2,
"title": "Verdaccio Local Registry",
"description": "Start a local registry with Verdaccio.",
"cli": "nx",
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location option for npm config",
"default": "user",
"enum": ["global", "user", "project"]
},
"storage": {
"type": "string",
"description": "Path to the custom storage directory for Verdaccio"
},
"port": {
"type": "number",
"description": "Port of local registry that Verdaccio should listen to",
"default": 4873
},
"config": {
"type": "string",
"description": "Path to the custom Verdaccio config file"
},
"clear": {
"type": "boolean",
"description": "Clear local registry storage before starting Verdaccio",
"default": true
}
},
"required": ["port"]
}
Loading

1 comment on commit be2ccb8

@vercel
Copy link

@vercel vercel bot commented on be2ccb8 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.