Skip to content
Draft
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/*
coverage/*
test/*/fixtures/*
vendor/*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
registry=https://registry.npmjs.org/
41,383 changes: 20,696 additions & 20,687 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"docs:build": "npx @redocly/cli build-docs -o ./docs/index.html --config docs/openapi/redocly-config.yaml",
"docs:lint": "npx @redocly/cli lint --config docs/openapi/redocly-config.yaml",
"docs:serve": "npx @redocly/cli preview-docs --config docs/openapi/redocly-config.yaml",
"update-local-deps": "./scripts/update-local-deps.sh",
"revert-local-deps": "./scripts/revert-local-deps.sh",
"prepare": "husky"
},
"wsk": {
Expand Down Expand Up @@ -74,7 +76,7 @@
"@adobe/spacecat-shared-brand-client": "1.1.11",
"@adobe/spacecat-shared-data-access": "2.23.3",
"@adobe/spacecat-shared-gpt-client": "1.5.14",
"@adobe/spacecat-shared-http-utils": "1.14.1",
"@adobe/spacecat-shared-http-utils": "file:./vendor/spacecat-shared-http-utils",
"@adobe/spacecat-shared-ims-client": "1.8.3",
"@adobe/spacecat-shared-rum-api-client": "2.28.1",
"@adobe/spacecat-shared-slack-client": "1.5.17",
Expand Down Expand Up @@ -146,4 +148,4 @@
],
"ext": ".js, .cjs, .ejs, .css"
}
}
}
32 changes: 32 additions & 0 deletions scripts/revert-local-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Revert Local Dependencies Script
# This script reverts back to using npm packages instead of local copies

set -e

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

echo -e "${YELLOW}?? Reverting to npm packages...${NC}"

# Update package.json to use npm version
echo -e "${YELLOW}?? Updating package.json...${NC}"
sed -i.bak 's|"@adobe/spacecat-shared-http-utils": "file:./vendor/spacecat-shared-http-utils"|"@adobe/spacecat-shared-http-utils": "1.14.1"|g' package.json

# Remove vendor directory
if [ -d "./vendor" ]; then
echo -e "${YELLOW}??? Removing vendor directory...${NC}"
rm -rf ./vendor
fi

# Reinstall dependencies
echo -e "${YELLOW}?? Reinstalling dependencies...${NC}"
rm -rf node_modules package-lock.json
npm install

echo -e "${GREEN}? Successfully reverted to npm packages!${NC}"
echo -e "${YELLOW}?? You're now using the published versions from npm.${NC}"
69 changes: 69 additions & 0 deletions scripts/update-local-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

# Update Local Dependencies Script
# This script copies the latest changes from spacecat-shared packages to the vendor directory

set -e

# Configuration
SHARED_REPO_PATH="$HOME/code/spacecat-shared"
VENDOR_DIR="./vendor"
HTTP_UTILS_PACKAGE="spacecat-shared-http-utils"

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

echo -e "${YELLOW}🔄 Updating local dependencies...${NC}"

# Check if the shared repo exists
if [ ! -d "$SHARED_REPO_PATH" ]; then
echo -e "${RED}❌ Error: spacecat-shared repository not found at $SHARED_REPO_PATH${NC}"
echo "Please make sure the spacecat-shared repository is cloned at ~/code/spacecat-shared"
exit 1
fi

# Create vendor directory if it doesn't exist
mkdir -p "$VENDOR_DIR"

# Function to update a package
update_package() {
local package_name=$1
local source_path="$SHARED_REPO_PATH/packages/$package_name"
local dest_path="$VENDOR_DIR/$package_name"

if [ ! -d "$source_path" ]; then
echo -e "${RED}❌ Error: Package $package_name not found at $source_path${NC}"
return 1
fi

echo -e "${YELLOW}📦 Updating $package_name...${NC}"

# Remove existing copy
if [ -d "$dest_path" ]; then
rm -rf "$dest_path"
fi

# Copy the package
cp -r "$source_path" "$dest_path"

# Clean up unnecessary files
cd "$dest_path"
rm -rf node_modules coverage junit .git 2>/dev/null || true

echo -e "${GREEN}✅ $package_name updated successfully${NC}"
cd - > /dev/null
}

# Update the http-utils package
update_package "$HTTP_UTILS_PACKAGE"

# Reinstall dependencies to ensure the local package is properly linked
echo -e "${YELLOW}📦 Reinstalling dependencies...${NC}"
npm install

echo -e "${GREEN}🎉 All local dependencies updated successfully!${NC}"
echo -e "${YELLOW}💡 The following packages are now using local versions:${NC}"
echo -e " • @adobe/spacecat-shared-http-utils"
17 changes: 17 additions & 0 deletions vendor/spacecat-shared-http-utils/.jsdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"plugins": [],
"recurseDepth": 10,
"source": {
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"sourceType": "module",
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
"templates": {
"cleverLinks": false,
"monospaceLinks": false
}
}
6 changes: 6 additions & 0 deletions vendor/spacecat-shared-http-utils/.mocha-multi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporterEnabled": "spec,xunit",
"xunitReporterOptions": {
"output": "junit/test-results.xml"
}
}
9 changes: 9 additions & 0 deletions vendor/spacecat-shared-http-utils/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage/
node_modules/
junit/
test/
docs/
logs/
test-results.xml
renovate.json
.*
1 change: 1 addition & 0 deletions vendor/spacecat-shared-http-utils/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
14 changes: 14 additions & 0 deletions vendor/spacecat-shared-http-utils/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"reporter": [
"lcov",
"text"
],
"check-coverage": true,
"lines": 100,
"branches": 97,
"statements": 100,
"all": true,
"include": [
"src/**/*.js"
]
}
17 changes: 17 additions & 0 deletions vendor/spacecat-shared-http-utils/.releaserc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: "semantic-release-monorepo",
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md",
}],
"@semantic-release/npm",
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/github", {}],
],
branches: ['main'],
};
Loading