-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,433 additions
and
10,447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Continuous Integration (Storefront) | ||
on: | ||
pull_request: | ||
types: ["opened", "edited", "reopened", "synchronize"] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
scanning: | ||
name: GitGuardian scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # fetch all history so multiple commits can be scanned | ||
- name: GitGuardian scan | ||
uses: GitGuardian/[email protected] | ||
with: | ||
args: -v | ||
env: | ||
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} | ||
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} | ||
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | ||
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} | ||
|
||
run-ci: | ||
name: Run CI | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node_version: ["18"] | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- name: Expose github environment as shell variables | ||
env: | ||
SECRETS_CONTEXT: ${{ toJson(secrets) }} | ||
VARS_CONTEXT: ${{ toJson(vars) }} | ||
run: | | ||
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable | ||
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings | ||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | ||
to_envs() { jq -r "to_entries[] | \"\(.key)<<$EOF\n\(.value)\n$EOF\n\""; } | ||
echo "$SECRETS_CONTEXT" | to_envs >> $GITHUB_ENV | ||
- name: Checkout code 🛎️ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup node 🏗️ | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }} | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: HUSKY=0 yarn --frozen-lockfile && cd packages/storefront && yarn --frozen-lockfile | ||
|
||
- name: Build project | ||
run: yarn build | ||
working-directory: packages/storefront | ||
|
||
- name: Run tests | ||
run: yarn test | ||
working-directory: packages/storefront | ||
|
||
- name: Lint project | ||
run: yarn lint | ||
working-directory: packages/storefront |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ coverage | |
|
||
# Nuxt generated files | ||
.nuxt | ||
.output | ||
|
||
# Next generated files | ||
.next | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/storefront/packages/next/__tests__/apps/app-router/app/csr/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/storefront/packages/next/__tests__/apps/app-router/app/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/storefront/packages/next/__tests__/apps/app-router/app/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default async function Home() { | ||
return ( | ||
<main> | ||
<h1>Home Page</h1> | ||
</main> | ||
); | ||
} |
6 changes: 4 additions & 2 deletions
6
packages/storefront/packages/next/__tests__/apps/app-router/hooks/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { createSdkContext } from "../sdk.config"; | ||
// eslint-disable-next-line import/no-unresolved | ||
import { createSdkContext } from "@vue-storefront/next/client"; | ||
import { getSdk } from "../sdk.config"; | ||
|
||
export const [SdkProvider, useSdk] = createSdkContext(); | ||
export const [SdkProvider, useSdk] = createSdkContext(getSdk() as any); |
3 changes: 2 additions & 1 deletion
3
packages/storefront/packages/next/__tests__/apps/app-router/next.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
transpilePackages: ["@storefront/shared"], | ||
// With swcMinify set to true, the build will fail because of some transpilation error, probably an issue on Next.js side | ||
swcMinify: true, | ||
}; | ||
|
||
module.exports = nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
packages/storefront/packages/next/__tests__/apps/pages-router/hooks/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { createSdkContext } from "../sdk.config"; | ||
/* eslint-disable import/no-unresolved */ | ||
import { createSdkContext } from "@vue-storefront/next/client"; | ||
import { getSdk } from "../sdk.config"; | ||
|
||
export const [SdkProvider, useSdk] = createSdkContext(); | ||
export const [SdkProvider, useSdk] = createSdkContext(getSdk()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/storefront/packages/next/__tests__/apps/pages-router/pages/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Home() { | ||
return ( | ||
<main> | ||
<h1>Home Page</h1> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use client"; | ||
|
||
export * from "./sdk/client"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
// eslint-disable-next-line import/extensions, import/no-unresolved | ||
export * from "./SdkContext"; | ||
export * from "./resolveDynamicContext"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
entry: { | ||
index: "src/index.ts", | ||
client: "src/client.ts", | ||
}, | ||
target: "es2015", | ||
format: ["cjs", "esm"], | ||
dts: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
<template> | ||
<div> | ||
<nav> | ||
<ul> | ||
<li> | ||
<a href="/ssr">SSR Page</a> | ||
</li> | ||
<li> | ||
<a href="/csr">CSR Page</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
<NuxtPage /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/storefront/packages/nuxt/__tests__/app/pages/index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<h1>Home Page</h1> | ||
</template> |
Oops, something went wrong.