Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Tharanishwaran <[email protected]>
  • Loading branch information
Tharanishwaran committed Jan 5, 2025
2 parents 513a156 + 6e2e6c2 commit 325288b
Show file tree
Hide file tree
Showing 247 changed files with 7,055 additions and 1,537 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/community_member_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Let's recognize <@github-username> as a contributor and community member by crea
- GitHub: <!-- username only -->
- Twitter: <!-- handle only -->
- LinkedIn: <!-- <profilename> only https://www.linkedin.com/in/<profilename> -->
- Layer5 Cloud: <!-- <user ID> only UUID https://meshery.layer5.io/user/<uuid> -->
- Layer5 Cloud: <!-- <user ID> only UUID https://cloud.layer5.io/user/<uuid> -->
- Link to profile picture:

A detailed explanation on how to set up a community member profile can be found in the [CONTRIBUTING.md](https://github.com/layer5io/layer5/blob/master/CONTRIBUTING.md)
Expand Down
119 changes: 119 additions & 0 deletions .github/build/features-to-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#!/usr/bin/env node

const fs = require("fs").promises; // Use fs.promises
const csv = require("csvtojson");
const [major, minor, patch] = process.versions.node.split(".").map(Number);
console.log(`Using Node.js version: ${major}.${minor}.${patch}`);

const headers = [
"Theme",
"Category Order",
"Category",
"Function Order",
"Function",
"Feature",
"Subscription Tier",
"Free",
"Team Designer",
"Team Operator",
"Enterprise",
"Exclude",
"Docs",
];


async function processCSV() {
try {
const csvFilePath = process.argv[2] || ".github/build/spreadsheet.csv";
if (process.argv[2]) {
console.log("Downloading features to: " + process.argv[2]);
}
const rows = await csv({
noheader: true,
headers: headers,
output: "json",
}).fromFile(csvFilePath);

const filteredData = rows.map(row => {
try {
const exclude = row["Exclude"]?.toLowerCase();
const hasXTier = [
"Free",
"Team Designer",
"Team Operator",
"Enterprise"]
.some(tier => row[tier]?.trim().toLowerCase() === "x");
// const includeRow = hasXTier && !(exclude && ["x", "X"].includes(exclude.toLowerCase()));

// if (!includeRow) return null;
if (!exclude) {
return {
theme: row["Theme"],
categoryOrder: row["Category Order"],
category: row["Category"],
functionOrder: row["Function Order"],
function: row["Function"],
feature: row["Feature"],
subscription_tier: row["Subscription Tier"],
comparison_tiers: {
free: row["Free"],
teamDesigner: row["Team Designer"],
teamOperator: row["Team Operator"],
enterprise: row["Enterprise"],
},
docs: row["Docs"]
};
}
} catch (error) {
console.error("Error processing row:", row, error);
return null;
}
}).filter(Boolean);

// Read existing JSON data
// const featuresFile = process.env.FEATURES_FILE;

const featuresFile = process.argv[3] || "src/sections/Pricing/feature_data.json";
if (process.argv[3]) {
console.log("Converting CSV to JSON in: " + process.argv[3]);
}
// const featuresFile = "src/sections/Pricing/feature_data.json";


if (await fs.access(featuresFile).then(() => true, () => false)) {
existingData = JSON.parse(await fs.readFile(featuresFile, "utf8"));
}

// Identify new updates
const newUpdates = filteredData.filter(
newRow =>
!existingData.some(
existingRow =>
existingRow.function === newRow.function &&
existingRow.feature === newRow.feature
)
);

// Set output for has-updates
// if (newUpdates.length > 0) {
// fs.appendFileSync(process.env.GITHUB_ENV, "has-updates=true\n");
// } else {
// fs.appendFileSync(process.env.GITHUB_ENV, "has-updates=false\n");
// }

// Merge new updates into existing data
const updatedData = [...existingData, ...newUpdates];

// Write updated data to file
try {
await fs.writeFile(featuresFile, JSON.stringify(filteredData, null, 2));
} catch (error) {
console.error("Error writing to feature_data.json:", error);
}
} catch (error) {
console.error("Error processing CSV:", error);
process.exit(1);
}
}

processCSV();
4 changes: 3 additions & 1 deletion .github/workflows/build-and-deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Build and Deploy Site
on:
push:
branches: [master]

workflow_dispatch:
workflow_call:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-preview-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
name: public-dir
path: ./public-dir.zip
retention-days: 1
- name: Triger Inner workflow
run: echo "trigering inner workflow"
- name: Trigger Inner workflow
run: echo "triggering inner workflow"
58 changes: 58 additions & 0 deletions .github/workflows/feature-list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Feature List

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

permissions:
contents: write
actions: read

jobs:
trigger-feature-list:
runs-on: ubuntu-latest
env:
FEATURES_FILE: 'src/sections/Pricing/feature_data.json'
SPREADSHEET_URL: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub?gid=1153419764&single=true&output=csv'

steps:
- name: Checkout current repository
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: |
npm install csvtojson --legacy-peer-deps
- name: Fetch spreadsheet and process updates
run: |
# Download the spreadsheet
curl -L $SPREADSHEET_URL -o .github/build/spreadsheet.csv
ls -al
# Process the CSV, filter data, and append to feature_data.json
node .github/build/features-to-json.js
- name: Commit changes
id: commit-changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Updated feature data from spreadsheet"
file_pattern: ${{ env.FEATURES_FILE }}
branch: master
commit_options: "--signoff"
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: 'l5io <[email protected]>'

call-build-and-deploy--workflow:
needs:
- trigger-feature-list
name: Build and Deploy Site
uses: layer5io/layer5/.github/workflows/build-and-deploy-site.yml@master
secrets: inherit
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@ default.profraw

# Lighthouse CI
.lighthouseci/
.gitpod.yml
.gitpod.yml

# Temporary files
spreadsheet.csv
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ We are beyond excited to see that you want to contribute! We would love to accep
- [Before You Get Started](#before-you-get-started)
- [Contributing to Layer5 Projects](#contributing-to-layer5-projects)
- [Contributing to Layer5's Blogs](#contributing-to-layer5s-blogs)
- [Contributing to Layer5's Sistent](#contributing-to-layer5s-sistent)
- [How to Contribute](#how-to-contribute)
- [Prerequisites](#prerequisites)
- [Set up your Local Development Environment](#set-up-your-local-development-environment)
Expand Down Expand Up @@ -129,6 +130,37 @@ If you'd like to contribute a post to layer5.io/blog, please open an Issue and s
3. Follow the instructions included in the news template and name the new file after the title of the news article.
4. Entries will be listed in chronological order automatically.

# Contributing to Layer5's Sistent

If you'd like to contribute to Sistent, start by selecting the project/sistent label in the [#GitHub issue tracker](https://github.com/layer5io/layer5/labels/project%2Fsistent).

### General Contribution Guidelines

1. Select the [project/sistent](https://github.com/layer5io/layer5/labels/project%2Fsistent) label in the GitHub issue tracker.
1. Navigate to the relevant directory, such as:
```
src/sections/Projects/Sistent
```
> Note: For other parts of the project, the file path may vary. Ensure you're working in the correct file associated with the area you're contributing to.
1. Add or update content. The system dynamically generates pages and routes to maintain consistency.

### Adding Sistent Component

We've streamlined the process by introducing a dynamic page creation workflow, simplifying the addition of new pages and ensuring a consistent structure for all contributions.

1. Navigate to the relevant directory, such as:
```
src/sections/Projects/Sistent
```
1. To add a new page, simply update this `content.js` file with the necessary details. All content is managed in a centralized file:
```
src/sections/Projects/Sistent/components/content.js
```
1. The system will dynamically generate pages based on this content and handle routing automatically.

### Example
Refer to the [**Button component**](https://layer5.io/projects/sistent/components/button) in the Sistent Library for an example of how to structure the content.

# Common Types of Site Contributions

The following list of instructions pertains to commonplace site updates by contributors.
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ clean:
lint:
npm run lint

.PHONY: setup build site clean site-fast lint
## Prepare a list of features for the pricing page.
features:
curl -L https://docs.google.com/spreadsheets/d/e/2PACX-1vQwzrUSKfuSRcpkp7sJTw1cSB63s4HCjYLJeGPWECsvqn222hjaaONQlN4X8auKvlaB0es3BqV5rQyz/pub\?gid\=1153419764\&single\=true\&output\=csv -o .github/build/spreadsheet.csv
node .github/build/features-to-json.js .github/build/spreadsheet.csv src/sections/Pricing/feature_data.json
rm .github/build/spreadsheet.csv

.PHONY: setup build site clean site-fast lint features
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ alt="Nighthawk" align="left" />


<p style="clear:both;">
<h2><a href="https://meshery.layer5.io/catalog">Meshery Catalog</a></h2>
<h2><a href="https://cloud.layer5.io/catalog">Meshery Catalog</a></h2>
<a href="">
<img src=".github/assets/images/catalog/catalog.svg"
style="float:left;margin:10px;" width="125px"
Expand Down
15 changes: 0 additions & 15 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "./fonts.css";
import posthog from "posthog-js";

document.addEventListener("DOMContentLoaded", () => {
/** init gtm after 3500 seconds - this could be adjusted */
Expand Down Expand Up @@ -29,19 +28,5 @@ function initGTM() {
document.head.appendChild(script);
}

export const onClientEntry = () => {
if (process.env.NODE_ENV === "production") {
posthog.init("phc_Yynjz2lAiQDJFqTWeGT0FJrt50hl53WBx8do3eKImgX",
{
api_host: "https://us.i.posthog.com",
person_profiles: "always",
autocapture: {
url_ignorelist: ["community/newcomers", "/calendar", "/newcomers"]
}
}
);
}
};

export { wrapRootElement } from "./root-wrapper";
export { wrapPageElement } from "./page-wrapper";
3 changes: 2 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
},
trailingSlash: "never",
plugins: [
"@mediacurrent/gatsby-plugin-silence-css-order-warning",
{
resolve: "gatsby-plugin-webpack-bundle-analyser-v2",
options: {
Expand Down Expand Up @@ -545,7 +546,7 @@ module.exports = {
resolve: "gatsby-plugin-robots-txt",
options: {
host: "https://layer5.io",
sitemap: "https://layer5.io/sitemap/sitemap-index.xml",
sitemap: "https://layer5.io/sitemap-index.xml",
policy: [{ userAgent: "*", allow: "/" }],
}
},
Expand Down
Loading

0 comments on commit 325288b

Please sign in to comment.