Remove macOS and Apple container references

- Remove Containerfile and .containerignore (Apple container specific)
- Update package.json to remove Apple container scripts
- Replace macOS-specific build scripts with Docker-focused versions
- Update README to prioritize Docker over Apple container
- Update DEVELOPMENT.md to remove macOS-first approach
- Update demo script to remove Apple container references
- Update workflow to remove Containerfile path triggers
- Simplify project to be Docker-first for cross-platform compatibility
This commit is contained in:
2026-01-18 13:44:09 +01:00
parent a891d736ef
commit 393c798080
10 changed files with 42 additions and 216 deletions

View File

@@ -1,19 +0,0 @@
# Ignore files for Apple container command builds
node_modules
npm-debug.log
build
.git
.gitignore
README.md
DEVELOPMENT.md
.env
.nyc_output
coverage
.coverage
**/*.test.js
**/*.spec.js
scripts/
demo.sh
.dockerignore
docker-compose.yml
Dockerfile.dev

View File

@@ -24,9 +24,3 @@ Framework to be used:
## Containerization ## Containerization
The application should be prepared for deployment using containerization. It should extend minimal Node 24 LTS container image. The application should be prepared for deployment using containerization. It should extend minimal Node 24 LTS container image.
Do not assume the Docker is installed on the development machine.
The development machine is a MacOS system with Apple `container` command from @github/apple/container.
Build scripts should target MacOS with the above toolset as first class environment. Docker should be used only as secondary option.

View File

@@ -8,7 +8,6 @@ on:
- 'public/**' - 'public/**'
- 'package*.json' - 'package*.json'
- 'Dockerfile' - 'Dockerfile'
- 'Containerfile'
pull_request: pull_request:
branches: [ main ] branches: [ main ]
paths: paths:
@@ -16,7 +15,6 @@ on:
- 'public/**' - 'public/**'
- 'package*.json' - 'package*.json'
- 'Dockerfile' - 'Dockerfile'
- 'Containerfile'
env: env:
IMAGE_NAME: jmespath-playground IMAGE_NAME: jmespath-playground

View File

@@ -1,24 +0,0 @@
# Containerfile for Apple container command
# Use Node 24 LTS as base image
FROM node:24-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy application source
COPY . .
# Build the application
RUN npm run build
# Expose port 3000
EXPOSE 3000
# Start the application
CMD ["npm", "run", "serve"]

View File

@@ -2,26 +2,10 @@
## Quick Start Commands ## Quick Start Commands
### macOS Development (Recommended)
```bash ```bash
# Install dependencies # Install dependencies
npm install npm install
# Start macOS-optimized development server
npm run dev
# Build with macOS toolset (Apple container + Docker fallback)
npm run build:macos
# Container operations (macOS)
npm run container:build
npm run container:run
```
### Traditional Commands
```bash
# Start development server (with hot reload) # Start development server (with hot reload)
npm start npm start
@@ -35,22 +19,7 @@ npm test
npm run serve npm run serve
``` ```
## Container Commands ## Docker Commands
### Apple Container (Primary - macOS)
```bash
# Build container with Apple's container command
container build -t jmespath-playground .
# Run container
container run -p 3000:3000 jmespath-playground
# Using Containerfile (Apple's format)
container build -f Containerfile -t jmespath-playground .
```
### Docker (Fallback)
```bash ```bash
# Build Docker container # Build Docker container
@@ -140,4 +109,4 @@ npm run docker:build
npm run docker:run npm run docker:run
``` ```
The workflow uses Docker in the GitHub Actions environment while maintaining compatibility with the project's macOS-first development approach. The workflow uses Docker for consistent containerization across all environments.

View File

@@ -13,7 +13,7 @@ A React-based web application for testing and validating JMESPath expressions ag
- 🎨 **Bootstrap UI**: Clean, responsive interface with Bootstrap styling - 🎨 **Bootstrap UI**: Clean, responsive interface with Bootstrap styling
- 🔄 **Sample Data**: Pre-loaded examples to get started quickly - 🔄 **Sample Data**: Pre-loaded examples to get started quickly
- 📱 **Responsive Design**: Works on desktop, tablet, and mobile devices - 📱 **Responsive Design**: Works on desktop, tablet, and mobile devices
- 🐳 **Container Ready**: Containerized for easy deployment (macOS + Docker) - 🐳 **Docker Ready**: Containerized for easy deployment
-**Error Handling**: Clear error messages for both JSON and JMESPath syntax issues -**Error Handling**: Clear error messages for both JSON and JMESPath syntax issues
- 🚀 **CI/CD Ready**: GitHub Actions workflow for automated container builds - 🚀 **CI/CD Ready**: GitHub Actions workflow for automated container builds
@@ -33,7 +33,6 @@ The application is divided into three main sections:
- Node.js 24 LTS or higher - Node.js 24 LTS or higher
- npm or yarn package manager - npm or yarn package manager
- **macOS recommended** (optimized for Apple's container toolset)
### Local Development ### Local Development
@@ -48,10 +47,8 @@ The application is divided into three main sections:
npm install npm install
``` ```
3. **Start the development server** (macOS optimized): 3. **Start the development server**:
```bash ```bash
npm run dev
# or traditional:
npm start npm start
``` ```
@@ -59,22 +56,7 @@ The application is divided into three main sections:
### Container Deployment ### Container Deployment
#### macOS with Apple Container (Recommended) #### Docker
```bash
# Build using macOS-optimized script
npm run build:macos
# Or manually with Apple container command
container build -t jmespath-playground .
container run -p 3000:3000 jmespath-playground
# Using npm scripts
npm run container:build
npm run container:run
```
#### Docker (Fallback Option)
```bash ```bash
# Build the Docker image # Build the Docker image
@@ -112,26 +94,14 @@ Try these examples with the sample data:
In the project directory, you can run: In the project directory, you can run:
### Development Scripts
### `npm run dev`
Starts the development server with macOS optimizations. Checks environment and opens the app at http://localhost:3000.
### `npm start` ### `npm start`
Runs the app in development mode using React's default development server. The page will reload when you make edits. Runs the app in development mode. The page will reload when you make edits.
### `npm test` ### `npm test`
Launches the test runner in interactive watch mode. Launches the test runner in interactive watch mode.
### Build Scripts
### `npm run build:macos`
Builds the application and creates containers using macOS-optimized build script. Prioritizes Apple's container command with Docker fallback.
### `npm run build` ### `npm run build`
Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance. Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance.
@@ -140,19 +110,11 @@ Builds the app for production to the `build` folder. It correctly bundles React
Serves the production build locally on port 3000. Serves the production build locally on port 3000.
### Container Scripts ### Docker Scripts
### `npm run container:build`
Builds a container using Apple's container command (macOS).
### `npm run container:run`
Runs the container using Apple's container command.
### `npm run docker:build` ### `npm run docker:build`
Builds a Docker container (fallback option). Builds a Docker container.
### `npm run docker:run` ### `npm run docker:run`
@@ -179,10 +141,9 @@ jmespath-playground/
│ ├── setupTests.js # Test configuration │ ├── setupTests.js # Test configuration
│ └── reportWebVitals.js │ └── reportWebVitals.js
├── scripts/ ├── scripts/
│ ├── build.sh # macOS-optimized build script │ ├── build.sh # Build script
│ └── dev.sh # macOS-optimized development script │ └── dev.sh # Development script
├── Containerfile # Apple container build file ├── Dockerfile # Docker container
├── Dockerfile # Docker container (fallback)
├── Dockerfile.dev # Development container ├── Dockerfile.dev # Development container
├── docker-compose.yml # Container orchestration ├── docker-compose.yml # Container orchestration
├── package.json # Dependencies and scripts ├── package.json # Dependencies and scripts
@@ -197,8 +158,7 @@ jmespath-playground/
- **Bootstrap 5.3.2**: CSS framework for styling - **Bootstrap 5.3.2**: CSS framework for styling
- **JMESPath 0.16.0**: JMESPath expression evaluation - **JMESPath 0.16.0**: JMESPath expression evaluation
- **Node.js 24 LTS**: Runtime environment - **Node.js 24 LTS**: Runtime environment
- **Apple Container**: Primary containerization (macOS) - **Docker**: Containerization
- **Docker**: Containerization fallback
- **GitHub Actions**: Automated CI/CD pipeline - **GitHub Actions**: Automated CI/CD pipeline
## CI/CD Pipeline ## CI/CD Pipeline
@@ -208,32 +168,18 @@ The project includes a GitHub Actions workflow that automatically:
- 🔍 **Triggers** on pushes to `main` or `develop` branches when `src/` directory changes - 🔍 **Triggers** on pushes to `main` or `develop` branches when `src/` directory changes
- 📦 **Builds** the React application with Node.js 24 LTS - 📦 **Builds** the React application with Node.js 24 LTS
- 🧪 **Runs** the test suite with coverage reporting - 🧪 **Runs** the test suite with coverage reporting
- 🐳 **Creates** container image using Docker (GitHub Actions environment) - 🐳 **Creates** container image using Docker
- ✅ **Tests** the container by starting it and verifying HTTP response - ✅ **Tests** the container by starting it and verifying HTTP response
- 🏗️ **Builds** multi-platform images (amd64/arm64) for main branch - 🏗️ **Builds** multi-platform images (amd64/arm64) for main branch
- 📤 **Uploads** build artifacts for later use - 📤 **Uploads** build artifacts for later use
The workflow is optimized for the GitHub Actions environment while respecting the project's macOS-first philosophy for local development. The workflow uses Docker for containerization and is optimized for cross-platform deployment.
## Deployment ## Deployment
### Container Deployment (macOS Recommended) ### Docker Deployment
The application is designed for macOS-first containerization: The application is containerized and ready for deployment:
1. **Build using macOS toolset**:
```bash
npm run build:macos
```
2. **Deploy using Apple container command**:
```bash
container run -p 3000:3000 jmespath-playground
```
### Docker Deployment (Fallback)
For environments without Apple's container toolset:
1. **Build the Docker image**: 1. **Build the Docker image**:
```bash ```bash

42
demo.sh
View File

@@ -1,19 +1,11 @@
#!/bin/bash #!/bin/bash
# JMESPath Testing Tool - Demo Script # JMESPath Testing Tool - Demo Script
# Optimized for macOS with Apple container command
echo "🍎 JMESPath Testing Tool Demo" echo "🚀 JMESPath Testing Tool Demo"
echo "===============================" echo "==============================="
echo "" echo ""
# Check if running on macOS
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "✅ Running on macOS (recommended platform)"
else
echo "⚠️ Not running on macOS. This demo is optimized for macOS."
fi
# Check if Node.js is installed # Check if Node.js is installed
if command -v node &> /dev/null; then if command -v node &> /dev/null; then
echo "✅ Node.js version: $(node --version)" echo "✅ Node.js version: $(node --version)"
@@ -30,16 +22,11 @@ else
exit 1 exit 1
fi fi
# Check container runtimes # Check Docker
if command -v container &> /dev/null; then if command -v docker &> /dev/null; then
echo "✅ Apple container command available" echo "✅ Docker available"
else else
echo "⚠️ Apple container command not found" echo "⚠️ Docker not found"
if command -v docker &> /dev/null; then
echo "✅ Docker available as fallback"
else
echo "⚠️ No container runtime found"
fi
fi fi
echo "" echo ""
@@ -47,25 +34,22 @@ echo "📦 Installing dependencies..."
npm install npm install
echo "" echo ""
echo "🔨 Building with macOS-optimized script..." echo "🔨 Building production version..."
npm run build:macos npm run build
echo "" echo ""
echo "🎉 Demo completed successfully!" echo "🎉 Demo completed successfully!"
echo "" echo ""
echo "To start development (macOS optimized):" echo "To start development:"
echo " npm run dev"
echo ""
echo "To start development (traditional):"
echo " npm start" echo " npm start"
echo "" echo ""
echo "To serve the production build:" echo "To serve the production build:"
echo " npm run serve" echo " npm run serve"
echo "" echo ""
echo "To run with containers:" echo "To run with Docker:"
if command -v container &> /dev/null; then
echo " npm run container:run # Apple container (recommended)"
fi
if command -v docker &> /dev/null; then if command -v docker &> /dev/null; then
echo " npm run docker:run # Docker (fallback)" echo " npm run docker:build"
echo " npm run docker:run"
else
echo " (Docker not available - install Docker first)"
fi fi

View File

@@ -9,10 +9,6 @@
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"serve": "serve -s build -l 3000", "serve": "serve -s build -l 3000",
"dev": "./scripts/dev.sh",
"build:macos": "./scripts/build.sh",
"container:build": "container build -t jmespath-playground .",
"container:run": "container run -p 3000:3000 jmespath-playground",
"docker:build": "docker build -t jmespath-playground .", "docker:build": "docker build -t jmespath-playground .",
"docker:run": "docker run -p 3000:3000 jmespath-playground" "docker:run": "docker run -p 3000:3000 jmespath-playground"
}, },
@@ -54,8 +50,7 @@
"json", "json",
"query", "query",
"testing", "testing",
"react", "react"
"macos"
], ],
"author": "", "author": "",
"license": "MIT" "license": "MIT"

View File

@@ -1,12 +1,11 @@
#!/bin/bash #!/bin/bash
# JMESPath Testing Tool - Build Script # JMESPath Testing Tool - Build Script
# Targets macOS with Apple container command as first-class environment
set -e set -e
echo "🍎 JMESPath Testing Tool - macOS Build Script" echo "🚀 JMESPath Testing Tool - Build Script"
echo "=============================================" echo "======================================="
echo "" echo ""
# Check Node.js version # Check Node.js version
@@ -31,27 +30,19 @@ npm install
echo "🔨 Building production bundle..." echo "🔨 Building production bundle..."
npm run build npm run build
# Container build - prioritize Apple container command # Container build with Docker
if command -v container &> /dev/null; then if command -v docker &> /dev/null; then
echo "🍎 Building container with Apple container command..." echo "🐳 Building Docker container..."
container build -t jmespath-playground .
else
# Fallback to Docker if available
if command -v docker &> /dev/null; then
echo "🐳 Apple container command not found, falling back to Docker..."
docker build -t jmespath-playground . docker build -t jmespath-playground .
else else
echo "⚠️ No container runtime found. Skipping container build." echo "⚠️ Docker not found. Skipping container build."
echo " Install Apple container command or Docker to build containers." echo " Install Docker to build containers."
fi
fi fi
echo "✅ Build completed successfully!" echo "✅ Build completed successfully!"
echo "" echo ""
echo "To run the application:" echo "To run the application:"
echo " npm run serve # Serve production build locally" echo " npm run serve # Serve production build locally"
if command -v container &> /dev/null; then if command -v docker &> /dev/null; then
echo " container run -p 3000:3000 jmespath-playground # Run with Apple container"
elif command -v docker &> /dev/null; then
echo " docker run -p 3000:3000 jmespath-playground # Run with Docker" echo " docker run -p 3000:3000 jmespath-playground # Run with Docker"
fi fi

View File

@@ -1,21 +1,13 @@
#!/bin/bash #!/bin/bash
# JMESPath Testing Tool - Development Script # JMESPath Testing Tool - Development Script
# Optimized for macOS development environment
set -e set -e
echo "🍎 JMESPath Testing Tool - macOS Development" echo "🚀 JMESPath Testing Tool - Development"
echo "===========================================" echo "====================================="
echo "" echo ""
# Check environment
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "✅ Running on macOS"
else
echo "⚠️ This script is optimized for macOS but will attempt to run anyway."
fi
# Check Node.js # Check Node.js
if command -v node &> /dev/null; then if command -v node &> /dev/null; then
echo "✅ Node.js version: $(node --version)" echo "✅ Node.js version: $(node --version)"