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:
@@ -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
|
||||
6
.github/copilot-instructions.md
vendored
6
.github/copilot-instructions.md
vendored
@@ -24,9 +24,3 @@ Framework to be used:
|
||||
## Containerization
|
||||
|
||||
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.
|
||||
|
||||
2
.github/workflows/build-container.yml
vendored
2
.github/workflows/build-container.yml
vendored
@@ -8,7 +8,6 @@ on:
|
||||
- 'public/**'
|
||||
- 'package*.json'
|
||||
- 'Dockerfile'
|
||||
- 'Containerfile'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
@@ -16,7 +15,6 @@ on:
|
||||
- 'public/**'
|
||||
- 'package*.json'
|
||||
- 'Dockerfile'
|
||||
- 'Containerfile'
|
||||
|
||||
env:
|
||||
IMAGE_NAME: jmespath-playground
|
||||
|
||||
@@ -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"]
|
||||
@@ -2,26 +2,10 @@
|
||||
|
||||
## Quick Start Commands
|
||||
|
||||
### macOS Development (Recommended)
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
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)
|
||||
npm start
|
||||
|
||||
@@ -35,22 +19,7 @@ npm test
|
||||
npm run serve
|
||||
```
|
||||
|
||||
## Container 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)
|
||||
## Docker Commands
|
||||
|
||||
```bash
|
||||
# Build Docker container
|
||||
@@ -140,4 +109,4 @@ npm run docker:build
|
||||
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.
|
||||
82
README.md
82
README.md
@@ -13,7 +13,7 @@ A React-based web application for testing and validating JMESPath expressions ag
|
||||
- 🎨 **Bootstrap UI**: Clean, responsive interface with Bootstrap styling
|
||||
- 🔄 **Sample Data**: Pre-loaded examples to get started quickly
|
||||
- 📱 **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
|
||||
- 🚀 **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
|
||||
- npm or yarn package manager
|
||||
- **macOS recommended** (optimized for Apple's container toolset)
|
||||
|
||||
### Local Development
|
||||
|
||||
@@ -48,10 +47,8 @@ The application is divided into three main sections:
|
||||
npm install
|
||||
```
|
||||
|
||||
3. **Start the development server** (macOS optimized):
|
||||
3. **Start the development server**:
|
||||
```bash
|
||||
npm run dev
|
||||
# or traditional:
|
||||
npm start
|
||||
```
|
||||
|
||||
@@ -59,22 +56,7 @@ The application is divided into three main sections:
|
||||
|
||||
### Container Deployment
|
||||
|
||||
#### macOS with Apple Container (Recommended)
|
||||
|
||||
```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)
|
||||
#### Docker
|
||||
|
||||
```bash
|
||||
# Build the Docker image
|
||||
@@ -112,26 +94,14 @@ Try these examples with the sample data:
|
||||
|
||||
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`
|
||||
|
||||
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`
|
||||
|
||||
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`
|
||||
|
||||
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.
|
||||
|
||||
### Container 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.
|
||||
### Docker Scripts
|
||||
|
||||
### `npm run docker:build`
|
||||
|
||||
Builds a Docker container (fallback option).
|
||||
Builds a Docker container.
|
||||
|
||||
### `npm run docker:run`
|
||||
|
||||
@@ -179,10 +141,9 @@ jmespath-playground/
|
||||
│ ├── setupTests.js # Test configuration
|
||||
│ └── reportWebVitals.js
|
||||
├── scripts/
|
||||
│ ├── build.sh # macOS-optimized build script
|
||||
│ └── dev.sh # macOS-optimized development script
|
||||
├── Containerfile # Apple container build file
|
||||
├── Dockerfile # Docker container (fallback)
|
||||
│ ├── build.sh # Build script
|
||||
│ └── dev.sh # Development script
|
||||
├── Dockerfile # Docker container
|
||||
├── Dockerfile.dev # Development container
|
||||
├── docker-compose.yml # Container orchestration
|
||||
├── package.json # Dependencies and scripts
|
||||
@@ -197,8 +158,7 @@ jmespath-playground/
|
||||
- **Bootstrap 5.3.2**: CSS framework for styling
|
||||
- **JMESPath 0.16.0**: JMESPath expression evaluation
|
||||
- **Node.js 24 LTS**: Runtime environment
|
||||
- **Apple Container**: Primary containerization (macOS)
|
||||
- **Docker**: Containerization fallback
|
||||
- **Docker**: Containerization
|
||||
- **GitHub Actions**: Automated 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
|
||||
- 📦 **Builds** the React application with Node.js 24 LTS
|
||||
- 🧪 **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
|
||||
- 🏗️ **Builds** multi-platform images (amd64/arm64) for main branch
|
||||
- 📤 **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
|
||||
|
||||
### Container Deployment (macOS Recommended)
|
||||
### Docker Deployment
|
||||
|
||||
The application is designed for macOS-first containerization:
|
||||
|
||||
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:
|
||||
The application is containerized and ready for deployment:
|
||||
|
||||
1. **Build the Docker image**:
|
||||
```bash
|
||||
|
||||
40
demo.sh
40
demo.sh
@@ -1,19 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# JMESPath Testing Tool - Demo Script
|
||||
# Optimized for macOS with Apple container command
|
||||
|
||||
echo "🍎 JMESPath Testing Tool Demo"
|
||||
echo "🚀 JMESPath Testing Tool Demo"
|
||||
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
|
||||
if command -v node &> /dev/null; then
|
||||
echo "✅ Node.js version: $(node --version)"
|
||||
@@ -30,16 +22,11 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check container runtimes
|
||||
if command -v container &> /dev/null; then
|
||||
echo "✅ Apple container command available"
|
||||
else
|
||||
echo "⚠️ Apple container command not found"
|
||||
# Check Docker
|
||||
if command -v docker &> /dev/null; then
|
||||
echo "✅ Docker available as fallback"
|
||||
echo "✅ Docker available"
|
||||
else
|
||||
echo "⚠️ No container runtime found"
|
||||
fi
|
||||
echo "⚠️ Docker not found"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -47,25 +34,22 @@ echo "📦 Installing dependencies..."
|
||||
npm install
|
||||
|
||||
echo ""
|
||||
echo "🔨 Building with macOS-optimized script..."
|
||||
npm run build:macos
|
||||
echo "🔨 Building production version..."
|
||||
npm run build
|
||||
|
||||
echo ""
|
||||
echo "🎉 Demo completed successfully!"
|
||||
echo ""
|
||||
echo "To start development (macOS optimized):"
|
||||
echo " npm run dev"
|
||||
echo ""
|
||||
echo "To start development (traditional):"
|
||||
echo "To start development:"
|
||||
echo " npm start"
|
||||
echo ""
|
||||
echo "To serve the production build:"
|
||||
echo " npm run serve"
|
||||
echo ""
|
||||
echo "To run with containers:"
|
||||
if command -v container &> /dev/null; then
|
||||
echo " npm run container:run # Apple container (recommended)"
|
||||
fi
|
||||
echo "To run with Docker:"
|
||||
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
|
||||
@@ -9,10 +9,6 @@
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"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:run": "docker run -p 3000:3000 jmespath-playground"
|
||||
},
|
||||
@@ -54,8 +50,7 @@
|
||||
"json",
|
||||
"query",
|
||||
"testing",
|
||||
"react",
|
||||
"macos"
|
||||
"react"
|
||||
],
|
||||
"author": "",
|
||||
"license": "MIT"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# JMESPath Testing Tool - Build Script
|
||||
# Targets macOS with Apple container command as first-class environment
|
||||
|
||||
set -e
|
||||
|
||||
echo "🍎 JMESPath Testing Tool - macOS Build Script"
|
||||
echo "============================================="
|
||||
echo "🚀 JMESPath Testing Tool - Build Script"
|
||||
echo "======================================="
|
||||
echo ""
|
||||
|
||||
# Check Node.js version
|
||||
@@ -31,27 +30,19 @@ npm install
|
||||
echo "🔨 Building production bundle..."
|
||||
npm run build
|
||||
|
||||
# Container build - prioritize Apple container command
|
||||
if command -v container &> /dev/null; then
|
||||
echo "🍎 Building container with Apple container command..."
|
||||
container build -t jmespath-playground .
|
||||
else
|
||||
# Fallback to Docker if available
|
||||
# Container build with Docker
|
||||
if command -v docker &> /dev/null; then
|
||||
echo "🐳 Apple container command not found, falling back to Docker..."
|
||||
echo "🐳 Building Docker container..."
|
||||
docker build -t jmespath-playground .
|
||||
else
|
||||
echo "⚠️ No container runtime found. Skipping container build."
|
||||
echo " Install Apple container command or Docker to build containers."
|
||||
fi
|
||||
echo "⚠️ Docker not found. Skipping container build."
|
||||
echo " Install Docker to build containers."
|
||||
fi
|
||||
|
||||
echo "✅ Build completed successfully!"
|
||||
echo ""
|
||||
echo "To run the application:"
|
||||
echo " npm run serve # Serve production build locally"
|
||||
if command -v container &> /dev/null; then
|
||||
echo " container run -p 3000:3000 jmespath-playground # Run with Apple container"
|
||||
elif command -v docker &> /dev/null; then
|
||||
if command -v docker &> /dev/null; then
|
||||
echo " docker run -p 3000:3000 jmespath-playground # Run with Docker"
|
||||
fi
|
||||
@@ -1,21 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# JMESPath Testing Tool - Development Script
|
||||
# Optimized for macOS development environment
|
||||
|
||||
set -e
|
||||
|
||||
echo "🍎 JMESPath Testing Tool - macOS Development"
|
||||
echo "==========================================="
|
||||
echo "🚀 JMESPath Testing Tool - Development"
|
||||
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
|
||||
if command -v node &> /dev/null; then
|
||||
echo "✅ Node.js version: $(node --version)"
|
||||
|
||||
Reference in New Issue
Block a user