Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation and dependencies for Apple Silicon support #3008

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ group :jekyll_plugins do
gem "jekyll-algolia", "~> 1.0"
gem "page_template_validator", path: "./_plugins/page_template_validator"
gem "jekyll-sitemap"
gem "jekyll-last-modified-at"
# Use a newer version of jekyll-last-modified-at for MacOS compatibility
gem "jekyll-last-modified-at", "~> 1.3.0"
gem "jekyll-include-cache"
end

Expand Down
111 changes: 70 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,53 @@ PATH
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
Ascii85 (2.0.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
afm (0.2.2)
algolia_html_extractor (2.6.4)
json (~> 2.0)
nokogiri (~> 1.10)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
async (2.6.5)
console (~> 1.10)
async (2.21.1)
console (~> 1.29)
fiber-annotation
io-event (~> 1.1)
timers (~> 4.1)
io-event (~> 1.6, >= 1.6.5)
bigdecimal (3.1.8)
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.2.2)
console (1.23.2)
concurrent-ruby (1.3.4)
console (1.29.2)
fiber-annotation
fiber-local
fiber-local (~> 1.1)
json
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
ffi (1.16.3)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
fiber-annotation (0.2.0)
fiber-local (1.0.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.0)
filesize (0.2.0)
forwardable-extended (2.6.0)
hashery (2.1.2)
html-proofer (5.0.8)
html-proofer (5.0.9)
addressable (~> 2.3)
async (~> 2.1)
nokogiri (~> 1.13)
Expand All @@ -51,9 +63,9 @@ GEM
zeitwerk (~> 2.5)
http_parser.rb (0.8.0)
httpclient (2.8.3)
i18n (1.14.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-event (1.3.3)
io-event (1.7.5)
jekyll (4.2.2)
addressable (~> 2.4)
colorator (~> 1.0)
Expand Down Expand Up @@ -89,9 +101,8 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-last-modified-at (1.3.0)
jekyll-last-modified-at (1.3.2)
jekyll (>= 3.7, < 5.0)
posix-spawn (~> 0.3.9)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.2.0)
Expand All @@ -100,41 +111,48 @@ GEM
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.6.3)
kramdown (2.4.0)
rexml
json (2.9.1)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
liquid-c (4.0.1)
liquid (>= 3.0.0)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.15.4-x86_64-darwin)
nokogiri (1.17.2-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.17.2-arm-linux)
racc (~> 1.4)
parallel (1.23.0)
nokogiri (1.17.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86-linux)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-linux)
racc (~> 1.4)
parallel (1.26.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
pdf-reader (2.11.0)
Ascii85 (~> 1.0)
pdf-reader (2.13.0)
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
afm (~> 0.2.1)
hashery (~> 2.0)
ruby-rc4
ttfunk
posix-spawn (0.3.15)
progressbar (1.13.0)
public_suffix (5.0.3)
racc (1.7.3)
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.1.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.2.6)
rexml (3.4.0)
rouge (3.30.0)
ruby-enum (0.9.0)
i18n
Expand All @@ -144,20 +162,31 @@ GEM
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
timers (4.3.5)
ttfunk (1.7.0)
typhoeus (1.4.0)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
unicode-display_width (1.8.0)
verbal_expressions (0.1.5)
webrick (1.8.1)
webrick (1.9.1)
yell (2.2.2)
zeitwerk (2.6.12)
zeitwerk (2.7.1)

PLATFORMS
x86_64-darwin-22
x86_64-darwin-23
aarch64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm-linux
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86-linux
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
html-proofer
Expand All @@ -166,7 +195,7 @@ DEPENDENCIES
jekyll-commonmark-ghpages
jekyll-feed (~> 0.12)
jekyll-include-cache
jekyll-last-modified-at
jekyll-last-modified-at (~> 1.3.0)
jekyll-redirect-from
jekyll-sitemap
liquid-c
Expand All @@ -182,4 +211,4 @@ RUBY VERSION
ruby 3.2.2p53

BUNDLED WITH
2.4.22
2.6.1
2 changes: 1 addition & 1 deletion _data/sidebars/pbc_all_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,7 @@ entries:
- title: Embed the Stripe payment page as an iframe
url: /docs/pbc/all/payment-service-provider/base-shop/third-party-integrations/stripe/project-guidelines-for-stripe/embed-the-stripe-payment-page-as-an-iframe.html
- title: Implement Stripe checkout as a hosted payment page
url: /docs/pbc/all/payment-service-provider/base-shop/third-party-integrations/stripe/project-guidelines-for-stripe/project-prerequisites-for-implementing-Stripe-checkout-as-a-hosted-payment-page.html
url: /docs/pbc/all/payment-service-provider/base-shop/third-party-integrations/stripe/project-guidelines-for-stripe/implement-stripe-checkout-as-a-hosted-payment-page.html
- title: OMS configuration for Stripe
url: /docs/pbc/all/payment-service-provider/base-shop/third-party-integrations/stripe/project-guidelines-for-stripe/oms-configuration-for-stripe.html
- title: Processing refunds with Stripe
Expand Down
83 changes: 61 additions & 22 deletions docs/about/all/about-the-docs/run-the-docs-locally.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Run the docs locally
description: Learn how to Build and run Spryker Documentation directly on your local machine with this guide.
last_updated: Jul 18, 2022
last_updated: Dec 20, 2024
template: howto-guide-template
redirect_from:
- /docs/scos/user/intro-to-spryker/contributing-to-documentation/building-the-documentation-site.html
Expand Down Expand Up @@ -33,36 +33,69 @@ Depending on your operating system, follow the Jekyll installation guides below.

### Install Jekyll on MacOS

The installation process is different depending whether you are using a Mac with an Intel processor or with a Silicon M1 chip. To find out whether you have an Intel or a Silicon M1 Mac, click the **Apple** menu and choose **About This Mac**.
The installation process is different depending whether you are using a Mac with an Intel processor or with Apple Silicon. To find out which type of Mac you have, click the **Apple** menu and choose **About This Mac**.

* Silicon Macs with the M1 processor show an item labeled _Chip_ followed by the name of the Apple chip.
* Apple Silicon Macs show an item labeled _Chip_ followed by the name of the Apple chip.

* Intel-based Macs show an item labeled _Processor_ followed by the name and/or model number of the Intel processor.

{% info_block warningBox "MacOS on M1 processor – Open Terminal using Rosetta" %}
{% info_block warningBox "MacOS on Apple Silicon" %}

On a MacBook with the M1 processor, make sure your Terminal is opened with Rosetta 2, by following the instructions here. Rosetta is a translation layer that enables non-native Intel x86 apps, including Homebrew, to run on Apple Silicon Macs.
To open your terminal using Rosetta, follow these steps:
1. Open a _Finder_ window.
2. In _Applications_, locate _Terminal_.
3. Right click on **Terminal** and select **Get Info**.
4. Make sure _Open using Rosetta_ is checked.
For Macs with Apple Silicon, we recommend using rbenv to manage Ruby versions. Follow these steps:

1. Install rbenv using Homebrew:
```bash
brew install rbenv ruby-build
```

2. Set up rbenv in your shell:
```bash
# Add rbenv to your shell configuration
echo 'eval "$(rbenv init -)"' >> ~/.zshrc

# Reload the shell configuration to apply changes
source ~/.zshrc
```

3. Install and set up Ruby 3.2.2:
```bash
# Install Ruby 3.2.2
rbenv install 3.2.2

# Set Ruby 3.2.2 as the local version for this directory
rbenv local 3.2.2

# Update rbenv shims to ensure all commands are available
rbenv rehash
```

4. Verify the installation:
```bash
# Should show ~/.rbenv/shims/ruby (indicating rbenv is managing Ruby)
which ruby

# Should show Ruby 3.2.2
ruby -v

# Should show bundler is available
gem list bundler
```

{% endinfo_block %}

On either an M1 or an Intel Mac, follow the steps below to install Jekyll. M1-specific instructions appear as notes wherever necessary.
On either an Apple Silicon or Intel Mac, follow the steps below to install Jekyll. Apple Silicon-specific instructions appear as notes wherever necessary.

#### 1. Install Homebrew

Homebrew is a package manager for macOS because by default Mac doesnt have a package manager. You use Homebrew to install Ruby in the next step. Additionally, when you install Homebrew, Xcode command line tools and GCC are also installed automatically.
Homebrew is a package manager for macOS because by default Mac doesn't have a package manager. You use Homebrew to install Ruby in the next step. Additionally, when you install Homebrew, Xcode command line tools and GCC are also installed automatically.

To install Homebrew, follow these steps:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
{% info_block infoBox "MacOS on M1 processor" %}
{% info_block infoBox "MacOS on Apple Silicon" %}

On an M1 Mac, Homebrew files are installed into the `/opt/homebrew` folder. Because this folder is not part of the default $PATH, you need to follow the next steps that Homebrew includes at the end of the installation output to add Homebrew to your PATH. In the example below, we've replaced your actual username with: `/Users/_username_/.zprofile`.
On Apple Silicon Macs, Homebrew files are installed into the `/opt/homebrew` folder. Because this folder is not part of the default $PATH, you need to follow the next steps that Homebrew includes at the end of the installation output to add Homebrew to your PATH. In the example below, we've replaced your actual username with: `/Users/_username_/.zprofile`.

```bash
==> Next steps:
Expand Down Expand Up @@ -94,7 +127,7 @@ To save the updated .zprofile file, click **control o**. Then, to exit the .zpro
brew install make
```

#### 3. Install Ruby
#### 3. Install Ruby and Configure Path
Check your current Ruby version:

```bash
Expand Down Expand Up @@ -126,7 +159,7 @@ Add the brew Ruby and gems path to your shell configuration:
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.bash_profile
```

#### 3. Install Jekyll and Bundler
#### 4. Install Jekyll and Bundler
1. Install Jekyll and Bundler gems:
```bash
gem install --user-install bundler jekyll
Expand Down Expand Up @@ -181,14 +214,18 @@ cd spryker-docs
```bash
bundle install
```
{% info_block infoBox "MacOS on M1 processor" %}
{% info_block infoBox "MacOS on Apple Silicon" %}

On a MacBook with the M1 processor, run the following command instead:
On Apple Silicon Macs, after setting up rbenv and Ruby 3.2.2 as described above, simply run:

```bash
arch -arch x86_64 bundle install
bundle install
```

Note:
- You may need to run `npm install` to set up the Node.js dependencies for asset processing.
- The site uses jekyll-last-modified-at to track file modifications through Git history.

{% endinfo_block %}

## Run the documentation site locally
Expand All @@ -205,14 +242,16 @@ bundle exec jekyll serve
```
Now, you can access the local copy of the Spryker documentation site at `http://localhost:4000`.

{% info_block infoBox "MacOS on M1 processor" %}
{% info_block infoBox "MacOS on Apple Silicon" %}

On a MacBook with the M1 processor, run the following command instead:
On Apple Silicon Macs, after setting up rbenv and Ruby 3.2.2 as described above, you can run the server normally:

```bash
arch -arch x86_64 bundle exec jekyll serve
bundle exec jekyll serve --incremental --livereload
```

The `--incremental` flag ensures only changed files are rebuilt, and `--livereload` automatically refreshes your browser when changes are made.

{% endinfo_block %}

## Tips and tricks
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var syntax = 'scss', // Syntax: sass or scss;

var gulp = require('gulp'),
gutil = require('gulp-util' ),
sass = require('gulp-sass'),
sass = require('gulp-sass')(require('sass')),
browserSync = require('browser-sync'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
Expand Down
Loading
Loading