Skip to content

Commit

Permalink
chore: merge pull request vuestorefront#6849 from vuestorefront/main
Browse files Browse the repository at this point in the history
chore: synchronize develop and main branches
  • Loading branch information
WojtekTheWebDev authored Nov 28, 2022
2 parents a8700bb + ad6a505 commit b902ba8
Show file tree
Hide file tree
Showing 110 changed files with 3,183 additions and 2,512 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- packages/docs/**
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -55,13 +56,17 @@ jobs:
environment: production
initial_status: in_progress
- name: Deploy on docs.europe-west1.gcp.storefrontcloud.io/v2
run: |
if curl -s -H 'X-User-Id: ${{ secrets.DOCS_CLOUD_USERNAME }}' -H 'X-Api-Key: ${{ secrets.DOCS_CLOUD_PASSWORD }}' -H 'Content-Type: application/json' -X POST -d '{"code":"docs","region":"europe-west1.gcp","additionalApps":{"apps":[{"name":"docs-v2","tag":"${{ steps.get_version.outputs.VERSION }}","image":"registry.storefrontcloud.io/docs-storefrontcloud-io/v2","path":"/v2","port":"80"}]}}' https://farmer.storefrontcloud.io/instances | grep -q '{"code":200,"result":"Instance updated!"}'; then
echo "Instance updated"
else
echo "Something went wrong during the update process..."
exit 1
fi
id: publish
uses: vuestorefront/publish-docs-action@main
with:
user-id: ${{ secrets.DOCS_CLOUD_USERNAME }}
api-key: ${{ secrets.DOCS_CLOUD_PASSWORD }}
name: "docs-v2"
tag: "${{ steps.get_version.outputs.VERSION }}"
image: "registry.storefrontcloud.io/docs-storefrontcloud-io/v2"
path: "/v2"
port: "80"
has-base-path: true
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:http-cache": "cd packages/http-cache && yarn test",
"test:cli": "cd packages/cli && yarn test",
"test:core": "cd packages/core && yarn test",
"test:middleware": "cd packages/middleware && yarn test"
"test:middleware": "cd packages/middleware && yarn test:unit && yarn test:integration"
},
"devDependencies": {
"@babel/core": "^7.10.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/cache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/cache",
"version": "2.6.0",
"version": "2.7.2",
"license": "MIT",
"main": "lib/index.cjs.js",
"module": "lib/index.es.js",
Expand All @@ -12,7 +12,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@vue-storefront/core": "~2.6.0"
"@vue-storefront/core": "~2.7.2"
},
"peerDependencies": {
"@nuxtjs/composition-api": "^0.29.3"
Expand Down
159 changes: 123 additions & 36 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,55 @@
# Vue Storefront CLI

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->
# Usage
<!-- usage -->
```sh-session
$ npm install -g @vue-storefront/cli
$ @vue-storefront/cli COMMAND
running command...
$ @vue-storefront/cli (--version)
@vue-storefront/cli/0.0.0 linux-x64 node-v16.14.0
$ @vue-storefront/cli --help [COMMAND]
USAGE
$ @vue-storefront/cli COMMAND
...
## Usage

To create a new Vue Storefront project, use the following command:

```bash
npx @vue-storefront/cli generate store
```
<!-- usagestop -->
# Commands

To generate a new template project from the integration source code, use the following command:

```bash
npx @vue-storefront/cli generate template
```

## Commands

<!-- commands -->
* [`@vue-storefront/cli generate store`](#vue-storefrontcli-generate-store)
* [`@vue-storefront/cli generate template`](#vue-storefrontcli-generate-template)
* [`@vue-storefront/cli help [COMMAND]`](#vue-storefrontcli-help-command)
* [`@vue-storefront/cli init`](#vue-storefrontcli-init)
* [`@vue-storefront/cli plugins`](#vue-storefrontcli-plugins)
* [`@vue-storefront/cli plugins:inspect PLUGIN...`](#vue-storefrontcli-pluginsinspect-plugin)
* [`@vue-storefront/cli plugins:install PLUGIN...`](#vue-storefrontcli-pluginsinstall-plugin)
* [`@vue-storefront/cli plugins:inspect PLUGIN...`](#vue-storefrontcli-pluginsinspect-plugin)
* [`@vue-storefront/cli plugins:install PLUGIN...`](#vue-storefrontcli-pluginsinstall-plugin-1)
* [`@vue-storefront/cli plugins:link PLUGIN`](#vue-storefrontcli-pluginslink-plugin)
* [`@vue-storefront/cli plugins:uninstall PLUGIN...`](#vue-storefrontcli-pluginsuninstall-plugin)
* [`@vue-storefront/cli plugins:uninstall PLUGIN...`](#vue-storefrontcli-pluginsuninstall-plugin-1)
* [`@vue-storefront/cli plugins:uninstall PLUGIN...`](#vue-storefrontcli-pluginsuninstall-plugin-2)
* [`@vue-storefront/cli plugins update`](#vue-storefrontcli-plugins-update)
* [`@vue-storefront/cli update [CHANNEL]`](#vue-storefrontcli-update-channel)

## `@vue-storefront/cli generate store`

Generates a Vue Storefront store.

```
USAGE
$ @vue-storefront/cli generate store
DESCRIPTION
Generates a Vue Storefront store.
EXAMPLES
$ @vue-storefront/cli generate store
```

## `@vue-storefront/cli generate template`

Generates a template of your integration's for VSF

```
USAGE
$ @vue-storefront/cli generate template [--output <value>]
FLAGS
--output=<value> [default: ./] A path where the template will be generated
DESCRIPTION
Generates a template of your integration's for VSF
--output=<value> [default: .]
EXAMPLES
$ @vue-storefront/cli generate template
Expand All @@ -82,7 +73,19 @@ DESCRIPTION
Display help for @vue-storefront/cli.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.11/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.16/src/commands/help.ts)_

## `@vue-storefront/cli init`

```
USAGE
$ @vue-storefront/cli init
EXAMPLES
$ @vue-storefront/cli init
```

_See code: [dist/commands/init.ts](https://github.com/vuestorefront/vue-storefront/blob/v3.0.0/dist/commands/init.ts)_

## `@vue-storefront/cli plugins`

Expand All @@ -102,7 +105,45 @@ EXAMPLES
$ @vue-storefront/cli plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.0/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.5/src/commands/plugins/index.ts)_

## `@vue-storefront/cli plugins:install PLUGIN...`

Installs a plugin into the CLI.

```
USAGE
$ @vue-storefront/cli plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ @vue-storefront/cli plugins add
EXAMPLES
$ @vue-storefront/cli plugins:install myplugin
$ @vue-storefront/cli plugins:install https://github.com/someuser/someplugin
$ @vue-storefront/cli plugins:install someuser/someplugin
```

## `@vue-storefront/cli plugins:inspect PLUGIN...`

Expand Down Expand Up @@ -144,7 +185,6 @@ FLAGS
DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
Expand All @@ -153,11 +193,12 @@ DESCRIPTION
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ @vue-storefront/cli plugins add
EXAMPLES
$ @vue-storefront/cli plugins:install myplugin
$ @vue-storefront/cli plugins:install myplugin
$ @vue-storefront/cli plugins:install https://github.com/someuser/someplugin
Expand All @@ -181,12 +222,12 @@ FLAGS
DESCRIPTION
Links a plugin into the CLI for development.
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLES
$ @vue-storefront/cli plugins:link myplugin
```
Expand Down Expand Up @@ -214,6 +255,52 @@ ALIASES
$ @vue-storefront/cli plugins remove
```

## `@vue-storefront/cli plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ @vue-storefront/cli plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ @vue-storefront/cli plugins unlink
$ @vue-storefront/cli plugins remove
```

## `@vue-storefront/cli plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ @vue-storefront/cli plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ @vue-storefront/cli plugins unlink
$ @vue-storefront/cli plugins remove
```

## `@vue-storefront/cli plugins update`

Update installed plugins.
Expand Down Expand Up @@ -265,5 +352,5 @@ EXAMPLES
$ @vue-storefront/cli update --available
```

_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.0/src/commands/update.ts)_
_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.4/src/commands/update.ts)_
<!-- commandsstop -->
2 changes: 2 additions & 0 deletions packages/cli/__tests__/domains/directory/getDirectory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ describe('getDirectory | integration test', () => {
let io: MockSTDIN;
let output = '';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
(t as jest.MockedFunction<TFunction>).mockImplementation(identity);

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('getGitRepositoryURL', () => {
let io: MockSTDIN;
let output = '';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
(t as jest.MockedFunction<TFunction>).mockImplementation(identity);

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('getProjectName | integration tests', () => {
io = stdin();
output = '';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
(t as jest.MockedFunction<TFunction>).mockImplementation(identity);

jest.spyOn(process.stdout, 'write').mockImplementation((message) => {
Expand Down
17 changes: 16 additions & 1 deletion packages/cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
// @ts-check
const baseConfig = require('../jest.base.config.js');

/**
* Jest's configuration object.
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = require('../jest.base.config.js');
module.exports = {
...baseConfig,
preset: 'ts-jest/presets/js-with-babel-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
transform: {
'^.+\\.m?[tj]sx?$': [
'ts-jest',
{
useESM: true
}
]
}
};
Loading

0 comments on commit b902ba8

Please sign in to comment.