Skip to content

Commit

Permalink
feat: Initial Vagrant - Ready to dev (#2092)
Browse files Browse the repository at this point in the history
* Initial Ready to deev

* Update README.md
  • Loading branch information
berviantoleo authored Aug 12, 2023
1 parent 8a82c29 commit 0ff7c6c
Show file tree
Hide file tree
Showing 11 changed files with 1,211 additions and 671 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ docs/
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

# General
.vagrant/

# Log files (if you are creating logs in debug mode, uncomment this)
# *.log
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:20 AS build
WORKDIR /app
COPY . .
RUN ./deploy.sh
FROM nginx:stable-alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/docs /app/docs
COPY --from=build /app/examples/demo/build /app/examples
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ Version `0.22` and newer will be hosted at [npmjs](https://www.npmjs.com/package
2. Mouse event, `double click` into box-crop will duplicate your box-crop.
3. Also there are some action in button that can be used, add shape (box-crop), delete selected object (box-crop), select all (box-crop), and discard current active selection (box-crop).

## Running the Example use Docker and Vagrant

### Initialization

`vagrant up --provider=docker`

### Refresh Image

`vagrant reload`

### Ports

* Container Port Demo: 8080
* Container Port Examples: 8081

## LICENSE

MIT
```md
MIT License

Copyright (c) 2020-2021 Bervianto Leo Pratama
Copyright (c) 2020 Bervianto Leo Pratama

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 6 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vagrant.configure("2") do |config|
config.vm.provider "docker" do |d|
d.build_dir = "."
d.ports = ["8081:8081", "8080:8080"]
end
end
21 changes: 21 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
set -xe
# prepare env
export DISABLE_ESLINT_PLUGIN=true
export PUBLIC_URL="/"
export SKIP_PREFLIGHT_CHECK=true

# prepare yarn
corepack enable
corepack prepare yarn@stable --activate

# installation deps
yarn --immutable

# deploy examples
yarn lerna run build --scope @berviantoleo/react-multi-crop
yarn lerna run build --scope @berviantoleo/react-multi-crop-demo

# deploy docs
yarn docs:build
yarn lerna run docs --scope @berviantoleo/react-multi-crop
6 changes: 2 additions & 4 deletions documentation/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { defineConfig } from "vitepress";

export default defineConfig({
export default {
title: "React Multi Crop",
description: "React Multi Crop for easy crop",
lang: "en-US",
base: process.env.BASE_URL || "/",
lastUpdated: true,
outDir: "../docs"
});
};
8 changes: 4 additions & 4 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.3",
"@mui/styles": "^5.14.3",
"@mui/material": "^5.14.4",
"@mui/styles": "^5.14.4",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.8",
"@types/react": "^18.2.18",
"@types/node": "^20.4.10",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"cypress": "~12.17.3",
"fabric": "^5.3.0",
Expand Down
27 changes: 27 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# on alpine, copy to /etc/nginx/nginx.conf
user root;
worker_processes auto;

error_log /var/log/nginx/error.log warn;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile off;
access_log off;
keepalive_timeout 3000;
server {
listen 8080;
server_name docs;
root /app/docs/;
}
server {
listen 8081;
server_name examples;
root /app/examples/;
}
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
},
"private": true,
"devDependencies": {
"@commitlint/cli": "^17.6.7",
"@commitlint/config-lerna-scopes": "^17.6.6",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-lerna-scopes": "^17.7.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"cross-env": "^7.0.3",
"eslint": "^8.46.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.3",
"lerna": "^7.1.4",
"lerna": "^7.1.5",
"prettier": "^3.0.1",
"typescript": "^5.1.6",
"vitepress": "^1.0.0-beta.7",
"vitepress": "^1.0.0-rc.4",
"vue": "^3.3.4"
},
"husky": {
Expand Down
28 changes: 14 additions & 14 deletions packages/react-multi-crop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
"url": "https://github.com/berviantoleo"
},
"devDependencies": {
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.10",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/plugin-transform-runtime": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/runtime": "^7.22.6",
"@babel/runtime": "^7.22.10",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@storybook/addon-essentials": "^7.2.1",
"@storybook/addon-links": "^7.2.1",
"@storybook/addon-storysource": "^7.2.1",
"@storybook/addons": "^7.2.1",
"@storybook/react": "^7.2.1",
"@storybook/react-webpack5": "7.2.1",
"@storybook/source-loader": "^7.2.1",
"@storybook/addon-essentials": "^7.2.3",
"@storybook/addon-links": "^7.2.3",
"@storybook/addon-storysource": "^7.2.3",
"@storybook/addons": "^7.2.3",
"@storybook/react": "^7.2.3",
"@storybook/react-webpack5": "7.2.3",
"@storybook/source-loader": "^7.2.3",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@types/fabric": "^5.3.3",
Expand All @@ -54,13 +54,13 @@
"jest-environment-jsdom": "^29.6.2",
"node-sass": "^9.0.0",
"react-test-renderer": "^18.2.0",
"rollup": "^3.26.3",
"rollup": "^3.28.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-sizes": "^1.0.5",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.35.0",
"storybook": "7.2.1",
"storybook": "7.2.3",
"ts-jest": "^29.1.1"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 0ff7c6c

Please sign in to comment.