Skip to content

Commit

Permalink
Merge pull request #56 from Sitecore/development
Browse files Browse the repository at this point in the history
Version 1.0.0-alpha.1 release
  • Loading branch information
crhistianramirez committed Mar 14, 2023
2 parents 57ecdde + 892aa6d commit 8116ec0
Show file tree
Hide file tree
Showing 316 changed files with 24,666 additions and 9,755 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/release-please.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run pre-commit
npm run pre-commit
4 changes: 0 additions & 4 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing to the React Admin project
Hello! Thank you for your interest in contributing! Before making pull requests, please read this contributing guide so that your contribution doesn't go unnoticed!

## Open Issues
Every contribution / pull request needs to be associated to one or more [GitHub issues](https://github.com/ordercloud-api/ordercloud-javascript-sdk/issues). New issues are added to the [project backlog](https://github.com/orgs/Sitecore/projects/3) for review before they are considered "ready" to be worked on.

Before logging a new issue, please check to see if your concern / idea has already been logged.

Once an issue is moved (by a project maintainer) to the "Todo" column in the project backlog it is considered ready to be worked on. Please assign yourself and mark the issue as "In Progress" once development has started in order to avoid duplicate work.

## Development
1. Fork and clone the template repository locally
2. Follow the working locally guide outlined in the main README.md
3. After you have completed development, run `npm test` and `npm build` locally to ensure everything still works.
4. Feel free to push changes to your forked development branch or create a new feature branch if it's a larger change.
5. Open a pull request to the main repository `development` branch. Ensure that the pull request is linked to the issues you are addressing in the pull request and include a verbose description of the changes / fix / feature.
6. A maintainer will review your pull request. They will either approve and merge or request further changes.
7. Once your PR is merged, it will be slotted for the next release (merge into `main` branch).

> **Important Note** - Ensure that you have recently pulled the latest from the main repository `development` branch before you begin new development.
## Repository Structure
Coming soon! A brief description of the directory structure their general purposes.
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Sitecore Commerce Seller app
Welcome to Sitecore Commerce Seller App. This is a basic implementation of the Sitecore Commerce using the OrderCloud Javascript SDK.
You can use it as a starting point to discover, understand, and learn more about the Sitecore Commerce OrderCloud capabilities.
# Sitecore Commerce Headstart: React Admin
This is an Open Source implementation of Sitecore Commerce using the OrderCloud Javascript SDK. You can use it as a starting point to discover how Sitecore Commerce administrative projects are built and teach you about the various Sitecore services that are involved and how they work together.

This app showcase different marketplace scenarios and commerce strategies: B2B, B2C, B2B2C.
> **Important Note:** This application is **not production-ready**.
>
> It is meant as a demonstration and learning tool for enabling sales and speeding up the solution development process.
This app is capable of showcasing different marketplace scenarios and commerce strategies: B2B, B2C, B2B2C. It is actively being worked on and maintained by internal developers at Sitecore and the larger Sitecore community. You can expect some major changes in the near future regarding design system choice, feature additions / modifications, and further integrations with additional Sitecore services.

## What is Sitecore Commerce OrderCloud?
----
Expand Down Expand Up @@ -38,8 +41,9 @@ Using the Deploy Button below, you'll deploy on Vercel the Next.js project as we

## Working locally
----
1. Pull the latest version from this github repository
2. Copy the `.env.local.example` file in the root directory to `.env.local` (ignored by default during your next Git commit):
1. Using this repository as a template, create a new repository.
2. Clone your new repository locally
3. Copy the `.env.local.example` file in the root directory to `.env.local` (ignored by default during your next Git commit):

```bash
cp .env.local.example .env.local
Expand All @@ -66,12 +70,12 @@ NEXT_PUBLIC_OC_USELIVEANALYTICSDATA='false'

3. Run Next.js in development mode
```bash
yarn install
yarn dev
npm install
npm run dev
```

Your app should be up and running on [http://localhost:3000](http://localhost:3000)!
If it doesn't work, post on [GitHub issues](https://github.com/medkrimi/commercenext.js/discussions).
If it doesn't work, post on [GitHub issues](https://github.com/Sitecore/Sitecore.Commerce.Headstart.ReactAdmin/issues).

### Seeding a new marketplace

Expand All @@ -85,13 +89,24 @@ Next, find the admin client ID and set it as NEXT_PUBLIC_OC_CLIENT_ID in your .e

Finally log in as `initialadminuser` with the password `Testingsetup123!`

### Unit Tests
This project uses [Jest](https://jestjs.io/) for unit testing. To write a unit test:

1. Create a file under either test/components or tests/pages that ends in .test.tsx (so it gets picked up by test runner)
2. Write your unit test
3. Run unit tests by running the command `npm test`

### Deploy on Vercel
To deploy your local project to Vercel, push it to public GitHub/GitLab/Bitbucket repository then [import to Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example).

## Not implemented / on the Roadmap
* Create, read, update, delete sellers and suppliers
* Create, read, update, delete addresses
* ....
## Contributing Guide
Check out our [Contributing](./CONTRIBUTING.md) guide.

## Changelog
Changes from release-to-release are tracked in the [Changelog wiki page](https://github.com/Sitecore/Sitecore.Commerce.Headstart.ReactAdmin/wiki/Changelog).

## Roadmap
Larger roadmap items are outlined in the [project milestones](https://github.com/Sitecore/Sitecore.Commerce.Headstart.ReactAdmin/milestones)

## References
- [OrderCloud Javascript SDK](https://www.npmjs.com/package/ordercloud-javascript-sdk)
Expand Down
23 changes: 23 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const nextJest = require("next/jest")

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: "./"
})

// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const customJestConfig = {
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],

testEnvironment: "jest-environment-jsdom",
modulePaths: ["<rootDir>", "src"],
moduleNameMapper: {
"^@/pages/(.*)$": "<rootDir>/src/pages/$1",
"^@/components/(.*)$": "<rootDir>/src/components/$1"
}
}

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = createJestConfig(customJestConfig)
9 changes: 2 additions & 7 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/** @type {import('next').NextConfig} */

const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx"
})

module.exports = withNextra({
module.exports = {
devIndicators: {
autoPrerender: true
},
Expand All @@ -27,4 +22,4 @@ module.exports = withNextra({
},
// !! WARN !!
ignoreBuildErrors: true
})
}
Loading

0 comments on commit 8116ec0

Please sign in to comment.