diff --git a/.env.development b/.env.development index 33bb7a1..6cb4594 100644 --- a/.env.development +++ b/.env.development @@ -1 +1,2 @@ -VUE_APP_PUBLICPATH=/dev/ost/ +VITE_PUBLICPATH=/dev/ost/program-locator/ +VITE_DEBUG=false diff --git a/.env.production b/.env.production index 96ede2d..776d0bd 100644 --- a/.env.production +++ b/.env.production @@ -1 +1,2 @@ -VUE_APP_PUBLICPATH=/ost/program-locator/ +VITE_PUBLICPATH=/ost/program-locator/ +VITE_DEBUG=false diff --git a/.env.testing b/.env.testing index ee10457..3b88495 100644 --- a/.env.testing +++ b/.env.testing @@ -1 +1,2 @@ -VUE_APP_PUBLICPATH=/ \ No newline at end of file +VITE_PUBLICPATH=/testing/ost/program-locator/ +VITE_DEBUG=true \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 6914a2f..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - "extends": [ - "eslint:recommended", - "plugin:vue/essential", - "plugin:vue/recommended", - ], - rules: { - // Disabled only on development - "no-console": process.env.NODE_ENV === "production" ? "error" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", - "no-unused-vars": process.env.NODE_ENV === "production" ? "error" : "off", - - // Eslint Rules - "brace-style": "error", - "nonblock-statement-body-position": [ "error", "below" ], - "curly": [ "error", "all" ], - "indent": [ "error", 2 ], - "no-else-return": "error", - "object-curly-spacing": [ "error", "always", { - arraysInObjects: false, - objectsInObjects: false, - }], - "array-bracket-spacing": [ "error", "always", { - objectsInArrays: false, - arraysInArrays: false, - }], - "comma-dangle": [ "error", "always-multiline" ], - "semi": [ "error", "always" ], - - // Vue Rules - "vue/no-v-html": "off", - "vue/order-in-components": "error", - "vue/attributes-order": "error", - "vue/no-use-v-if-with-v-for": "off", - }, - parserOptions: { - parser: "babel-eslint", - }, -}; \ No newline at end of file diff --git a/.github/workflows/dev_cache_and_push_to_s3.yml b/.github/workflows/dev_cache_and_push_to_s3.yml new file mode 100644 index 0000000..5cbb495 --- /dev/null +++ b/.github/workflows/dev_cache_and_push_to_s3.yml @@ -0,0 +1,56 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Development caching with npm and push + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + - name: Install dependencies + run: | + printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc + npm ci + npm list + env: + FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }} + + - name: Build for development + run: npm run build:development + + - name: Deploy to Dev s3, Set index headers + env: + AWS_DEFAULT_REGION: 'us-east-1' + AWS_S3_BUCKET: phila-resource-finder-v2/dev/ost/program-locator/ + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete + aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8" + \ No newline at end of file diff --git a/.github/workflows/dev_push_to_s3.yml b/.github/workflows/dev_push_to_s3.yml deleted file mode 100644 index d905689..0000000 --- a/.github/workflows/dev_push_to_s3.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: dev Push to S3 - -on: - push: - branches: - - dev - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Use Node.js 16.x - uses: actions/setup-node@v3 - with: - node-version: '16.x' - cache: 'npm' - - - name: install npm 6 - run: | - npm install -g npm@6 - - - name: npm install, and build - run: | - printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc - git config --global url."https://".insteadOf ssh:// - npm ci - npm run build:development - env: - FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }} - VUE_APP_GATEKEEPER_KEY: ${{ secrets.VUE_APP_GATEKEEPER_KEY }} - - - name: Deploy to Dev s3, Set index headers - env: - AWS_DEFAULT_REGION: 'us-east-1' - AWS_S3_BUCKET: phila-resource-finder-v2/dev/ost/ - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: | - aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete - aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8" diff --git a/.github/workflows/prod_cache_and_push_to_s3.yml b/.github/workflows/prod_cache_and_push_to_s3.yml new file mode 100644 index 0000000..71d43b1 --- /dev/null +++ b/.github/workflows/prod_cache_and_push_to_s3.yml @@ -0,0 +1,57 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Production caching with npm and push + +on: + push: + branches: + - production + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + - name: Install dependencies + run: | + printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc + npm ci + npm list + env: + FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }} + + - name: Build for production + run: npm run build:production + + - name: Deploy to Production s3, Set index headers + env: + AWS_DEFAULT_REGION: 'us-east-1' + AWS_S3_BUCKET: phila-resource-finder-v2/ost/program-locator/ + AWS_CLOUDFRONT_DISTRIBUTION: E2K2DCUMZ188JW + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete + aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8" + aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION --paths "/*" diff --git a/.github/workflows/prod_push_to_s3.yml b/.github/workflows/prod_push_to_s3.yml deleted file mode 100644 index 3e625d3..0000000 --- a/.github/workflows/prod_push_to_s3.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: prod Push to S3 - -on: - push: - branches: - - production - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Use Node.js 16.x - uses: actions/setup-node@v3 - with: - node-version: '16.x' - cache: 'npm' - - - name: install npm 6 - run: | - npm install -g npm@6 - - - name: npm install, and build - run: | - printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc - git config --global url."https://".insteadOf ssh:// - npm ci - npm run build:production - env: - FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }} - VUE_APP_GATEKEEPER_KEY: ${{ secrets.VUE_APP_GATEKEEPER_KEY }} - - - name: Deploy to Prod s3, Set index headers, and Invalidate Cloudfront - env: - AWS_DEFAULT_REGION: 'us-east-1' - AWS_S3_BUCKET: phila-resource-finder-v2/ost/program-locator/ - AWS_CLOUDFRONT_DISTRIBUTION: E2K2DCUMZ188JW - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: | - aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete - aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8" - aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION --paths "/*" diff --git a/.github/workflows/testing_cache_and_push.yml b/.github/workflows/testing_cache_and_push.yml new file mode 100644 index 0000000..070dc79 --- /dev/null +++ b/.github/workflows/testing_cache_and_push.yml @@ -0,0 +1,53 @@ +name: Testing caching with npm and push + +on: + push: + branches: + - vue3-pinboard + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + - name: Install dependencies + run: | + printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN}" >> ~/.npmrc + npm ci + npm list + env: + FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FA_AUTH_TOKEN }} + + - name: Build for testing + run: npm run build:testing + + - name: Deploy to Testing s3, Set index headers + env: + AWS_DEFAULT_REGION: 'us-east-1' + AWS_S3_BUCKET: phila-resource-finder-v2/testing/ost/program-locator/ + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + aws s3 sync dist s3://$AWS_S3_BUCKET --region us-east-1 --delete + aws s3 cp s3://$AWS_S3_BUCKET s3://$AWS_S3_BUCKET --recursive --exclude "*" --include "*.html" --metadata-directive REPLACE --acl public-read --cache-control max-age=0,no-cache,no-store,must-revalidate,proxy-revalidate,public --expires "0" --content-type "text/html; charset=utf-8" + \ No newline at end of file diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 91be244..0000000 --- a/babel.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - presets: [ - '@vue/app', - ], -}; diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..5a1d59c --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +import js from '@eslint/js' +import pluginVue from 'eslint-plugin-vue' + +export default [ + { + name: 'app/files-to-lint', + files: ['**/*.{js,mjs,jsx,vue}'], + }, + + { + name: 'app/files-to-ignore', + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + }, + + js.configs.recommended, + ...pluginVue.configs['flat/essential'], +] diff --git a/public/index.html b/index.html similarity index 62% rename from public/index.html rename to index.html index 7823674..a82c51e 100644 --- a/public/index.html +++ b/index.html @@ -18,10 +18,9 @@ })(window, document, "clarity", "script", "4l8dhsl6kn"); - - - - + + +