Skip to content

Commit

Permalink
feat: add vendors/opening_hours.js
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Sep 27, 2023
1 parent edb611f commit 8cc0d88
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ coverage
build/Release

# Dependency directories
node_modules/
node_modules
jspm_packages/

vendors/opening_hours.js/build


# Optional npm cache directory
.npm
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ runs:

- name: Install dependencies 👨🏻‍💻
shell: bash
run: yarn install
run: yarn install --immutable
62 changes: 57 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ jobs:

steps:
- name: Checkout 🛎
uses: actions/checkout@master
uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git submodule update &&
cd vendors/opening_hours.js &&
npm install &&
npm run build &&
sed -i 's/"postinstall": "husky install",//' package.json &&
cd ../..
- uses: ./.github/actions/install

Expand All @@ -34,7 +44,17 @@ jobs:

steps:
- name: Checkout 🛎
uses: actions/checkout@master
uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git submodule update &&
cd vendors/opening_hours.js &&
npm install &&
npm run build &&
sed -i 's/"postinstall": "husky install",//' package.json &&
cd ../..
- uses: ./.github/actions/install

Expand All @@ -55,7 +75,17 @@ jobs:

steps:
- name: Checkout 🛎
uses: actions/checkout@master
uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git submodule update &&
cd vendors/opening_hours.js &&
npm install &&
npm run build &&
sed -i 's/"postinstall": "husky install",//' package.json &&
cd ../..
- uses: ./.github/actions/install

Expand Down Expand Up @@ -101,7 +131,17 @@ jobs:

steps:
- name: Checkout 🛎
uses: actions/checkout@master
uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git submodule update &&
cd vendors/opening_hours.js &&
sed -i 's/"postinstall": "husky install",//' package.json &&
npm install &&
npm run build &&
cd ../..
- uses: ./.github/actions/install

Expand Down Expand Up @@ -148,7 +188,19 @@ jobs:

steps:
- name: Checkout 🛎
uses: actions/checkout@master
uses: actions/checkout@v4
with:
submodules: recursive

- run: |
git submodule update &&
cd vendors/opening_hours.js &&
npm install &&
npm run build &&
sed -i 's/"postinstall": "husky install",//' package.json &&
cd ../..
- uses: ./.github/actions/install

- name: Deploy
uses: up9cloud/action-rsync@master
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendors/opening_hours.js"]
path = vendors/opening_hours.js
url = https://github.com/frodrigo/opening_hours.js.git
4 changes: 2 additions & 2 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.{js,ts,vue}": "yarn eslint --fix",
"*.{css,vue}": "yarn stylelint",
"!(vendors/**/*)*.{js,ts,vue}": "yarn eslint --fix",
"!(vendors/**/*)*.{css,vue}": "yarn stylelint",
}
1 change: 1 addition & 0 deletions .nuxtignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.git
cypress/*
vendors
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
ARG NODE_VERSION
FROM node:${NODE_VERSION}

RUN apk --no-cache add git
RUN apk --no-cache add git make

# Create app directory
RUN mkdir -p /usr/src/app/.nuxt
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json yarn.lock /usr/src/app/
RUN yarn install
COPY vendors /usr/src/app/vendors
RUN cd vendors/opening_hours.js && \
sed -i 's/"postinstall": "husky install",//' package.json && \
npm install && \
npm run build && \
cd ../..
COPY .yarn/ /usr/src/app/.yarn
COPY .yarnrc.yml package.json yarn.lock /usr/src/app/
RUN yarn install --immutable
COPY . /usr/src/app
RUN yarn install

ENV NODE_OPTIONS --openssl-legacy-provider
COPY vidos-config-empty.json vidos-config.json
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ Can be build directly (dev) or within Docker.

### Native Build Setup
```bash
# Build vendors deps
git submodule update
cd vendors/opening_hours.js
npm install
npm run build
cd ../..

# install dependencies
yarn install

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"start:histoire": "CONFIG=vidos-config-empty.json yarn histoire dev",
"start:cypress": "CONFIG=vidos-config-empty.json yarn build-fixture && yarn run cypress open",
"lint": "yarn lint:js && yarn lint:style",
"lint:js": "yarn eslint --ext .js,.ts,.vue --ignore-path .gitignore .",
"lint:style": "yarn stylelint **/*.{vue,css} --ignore-path .gitignore",
"lint:js": "yarn eslint --ext .js,.ts,.vue --ignore-path .gitignore --ignore-pattern vendors .",
"lint:style": "yarn stylelint **/*.{vue,css} --ignore-path .gitignore --ignore-pattern vendors",
"test": "yarn test:cypress && yarn test:histoire",
"test:cypress": "yarn build-fixture && yarn run cypress run",
"test:histoire:report": "yarn build:histoire && npx --yes -- reg-cli __screenshots__/current __screenshots__/actual __screenshots__/diff -R __screenshots__/diff/index.html -J __screenshots__/diff/index.json --thresholdPixel 5 --matchingThreshold 0.3 --extendedErrors || exit 0",
"test:histoire:check-report": "cat __screenshots__/diff/index.json | jq --exit-status '.failedItems + .newItems + .deletedItems | length == 0'",
"test:histoire": "yarn test:histoire:report && yarn test:histoire:check-report",
"postinstall": "[[ -d '.git' ]] && husky install || true"
"postinstall": "[ -d '.git' ] && husky install || true"
},
"dependencies": {
"@fortawesome/vue-fontawesome": "^3.0.3",
Expand All @@ -48,7 +48,7 @@
"maplibre-gl": "^3.1.0",
"nuxt": "^3.2.3",
"nuxt-simple-sitemap": "^2.7.0",
"opening_hours": "^3.8.0",
"opening_hours": "file:./vendors/opening_hours.js",
"pinia": "^2.0.33",
"pinia-shared-state": "^0.4.2",
"url-slug": "^4.0.1",
Expand Down
1 change: 1 addition & 0 deletions vendors/opening_hours.js
Submodule opening_hours.js added at 0038c7
9 changes: 4 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4411,7 +4411,7 @@ __metadata:
nuxi: ^3.5.3
nuxt: ^3.2.3
nuxt-simple-sitemap: ^2.7.0
opening_hours: ^3.8.0
opening_hours: "file:./vendors/opening_hours.js"
patch-package: ^7.0.0
pinia: ^2.0.33
pinia-shared-state: ^0.4.2
Expand Down Expand Up @@ -14841,14 +14841,13 @@ __metadata:
languageName: node
linkType: hard

"opening_hours@npm:^3.8.0":
version: 3.8.0
resolution: "opening_hours@npm:3.8.0"
"opening_hours@file:./vendors/opening_hours.js::locator=%40teritorio%2Fvido%40workspace%3A.":
version: 3.9.0-dev
resolution: "opening_hours@file:./vendors/opening_hours.js#./vendors/opening_hours.js::hash=28d0a7&locator=%40teritorio%2Fvido%40workspace%3A."
dependencies:
i18next: ^21.8.3
i18next-browser-languagedetector: ^6.1.4
suncalc: ^1.9.0
checksum: f45c9106492f9067cdb092b514383619a42e60668326667fc001379f90b7a37475857d4247e0596ce188687102f3fd2358f6b019d65ece85722a498dff2c1fb7
languageName: node
linkType: hard

Expand Down

0 comments on commit 8cc0d88

Please sign in to comment.