Skip to content

Commit

Permalink
Merge pull request #1 from Carifio24/updates
Browse files Browse the repository at this point in the history
Configuration updates and build/deploy workflows
  • Loading branch information
Carifio24 authored Jan 23, 2024
2 parents 7675572 + a418a1e commit 2e12b16
Show file tree
Hide file tree
Showing 10 changed files with 246 additions and 18 deletions.
58 changes: 55 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,62 @@
module.exports = {
root: true,
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.vue']
},
plugins: [
'@typescript-eslint',
],
extends: [
"../.eslintrc.js",
"plugin:vue/essential",
"@vue/typescript/recommended"
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/essential',
'@vue/typescript/recommended'
],
rules: {
"indent": ["error", 2],
"@typescript-eslint/naming-convention": [
"error", {
selector: ["variable", "memberLike", "function"],
format: ["camelCase"],
leadingUnderscore: "allow"
},
{
selector: ["variable"],
modifiers: ["global", "const"],
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow"
},
{
selector: "typeLike",
format: ["PascalCase"],
leadingUnderscore: "allow"
},
{
selector: [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
format: null,
modifiers: ["requiresQuotes"]
}
],
"@typescript-eslint/no-unused-vars": [
"error", {
"args": "all",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/semi": "error",
"vue/multi-word-component-names": "off"
}
};
59 changes: 59 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Deploy

on:
push:
branches:
main

jobs:
build:
if: ${{ github.repository_owner == 'cosmicds' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.17.1'

- name: Yarn install
run: yarn install

- name: Lint
run: yarn lint

- name: Build
run: yarn build
env:
VUE_APP_CDS_API_KEY: ${{ secrets.CDS_API_KEY }}

# - name: BrowserStack env setup
# uses: browserstack/github-actions/setup-env@master
# with:
# username: ${{ secrets.BROWSERSTACK_USERNAME }}
# access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

# - name: BrowserStack local tunnel setup
# uses: browserstack/github-actions/setup-local@master
# with:
# local-testing: start
# local-identifier: random

# - name: Run BrowserStack tests
# run: |
# set -xeuo pipefail
# yarn serve &
# sleep 10
# yarn test-bslocal -e default,firefox,edge,safari -o reports

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
ssh-key: ${{ secrets.DEPLOY_KEY }}
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on:
pull_request_target:
branches:
main

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.17.1'

- name: Yarn install
run: yarn install

- name: Lint
run: yarn lint

- name: Build
run: yarn build

# - name: BrowserStack env setup
# uses: browserstack/github-actions/setup-env@master
# with:
# username: ${{ secrets.BROWSERSTACK_USERNAME }}
# access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

# - name: 'BrowserStack local tunnel setup'
# uses: browserstack/github-actions/setup-local@master
# with:
# local-testing: start
# local-identifier: random

# - name: Run BrowserStack tests
# run: |
# set -xeuo pipefail
# yarn serve &
# sleep 10
# yarn test-bslocal -e default,firefox,edge,safari -o reports

# - name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection
# uses: browserstack/github-actions/setup-local@master
# with:
# local-testing: stop
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
**/dist/*
!./dist/index.html

node_modules/
tsconfig.tsbuildinfo
/.vs/
*.log

**/.yarn/*
!**/.yarn/releases
!**/.yarn/patches
!**/.yarn/plugins
!**/.yarn/sdks
!**/.yarn/versions

.pnp.*
.DS_Store

.DS_Store
*/.DS_Store
*/*/.DS_Store
.vscode/settings.json

**/tests_output/**

*.env
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 cosmicds

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"version": "0.0.0",
"dependencies": {
"@cosmicds/vue-toolkit": "^0.1.3",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/vue-fontawesome": "^3.0.3",
"@kyvg/vue3-notification": "^3.0.2",
"@minids/common": "workspace:0.0.0",
"@vuepic/vue-datepicker": "^7.4.1",
"@wwtelescope/engine-pinia": "^0.9.0",
"tz-lookup": "^6.1.25",
"uuid": "^9.0.1",
"vue": "^3.3.4",
"vue-slider-component": "^4.1.0-beta.7",
"vuetify": "^3.3.14",
"webpack-plugin-vuetify": "^2.0.1"
},
Expand All @@ -18,6 +22,7 @@
"serve": "./patch.sh; vue-cli-service serve"
},
"devDependencies": {
"@types/tz-lookup": "^6.1.2",
"@types/uuid": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
Expand Down
8 changes: 4 additions & 4 deletions src/AnnularEclipse2023.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@

<script lang="ts">
import { defineComponent, toRaw, PropType } from "vue";
import { MiniDSBase, BackgroundImageset, skyBackgroundImagesets, MINIDS_BASE_URL } from "@minids/common";
import { MiniDSBase, BackgroundImageset, skyBackgroundImagesets, MINIDS_BASE_URL } from "@cosmicds/vue-toolkit";
import { GotoRADecZoomParams } from "@wwtelescope/engine-pinia";
import { Classification, SolarSystemObjects } from "@wwtelescope/engine-types";
import { Folder, Grids, LayerManager, Planets, Poly, Settings, WWTControl, Place, Texture, CAAMoon } from "@wwtelescope/engine";
Expand Down Expand Up @@ -3015,7 +3015,7 @@ export default defineComponent({
<style lang="less">
@font-face {
font-family: "Highway Gothic Narrow";
src: url("../../assets/HighwayGothicNarrow.ttf");
src: url("https://cosmicds.github.io/cds-website/fonts/HighwayGothicNarrow.ttf");
}

:root {
Expand Down Expand Up @@ -3138,7 +3138,7 @@ body {
align-items: center;
justify-content: center;
.spinner {
background-image: url("../../assets/lunar_loader.gif");
background-image: url("https://cosmicds.github.io/cds-website/misc/lunar_loader.gif");
background-repeat: no-repeat;
background-size: contain;
width: 3rem;
Expand All @@ -3163,7 +3163,7 @@ body {
div {
margin: 0;
padding: 0;
background-image: url("../../assets/wwt_globe_bg.png");
background-image: url("https://cosmicds.github.io/cds-website/logos/wwt_globe_bg.png");
background-repeat: no-repeat;
background-size: contain;
background-position: center;
Expand Down
10 changes: 5 additions & 5 deletions src/CreditLogos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<div id="logo-credits">
<div id="icons-container">
<a href="https://www.cosmicds.cfa.harvard.edu/" target="_blank" rel="noopener noreferrer"
><img alt="CosmicDS Logo" :src="require('../../assets/cosmicds_logo_for_dark_backgrounds.png')"
><img alt="CosmicDS Logo" src="https://cosmicds.github.io/cds-website/logos/cosmicds_logo_for_dark_backgrounds.png"
/></a>
<a href="https://worldwidetelescope.org/home/" target="_blank" rel="noopener noreferrer"
><img alt="WWT Logo" src="../../assets/logo_wwt.png"
><img alt="WWT Logo" src="https://cosmicds.github.io/cds-website/logos/logo_wwt.png"
/></a>
<a href="https://science.nasa.gov/learners" target="_blank" rel="noopener noreferrer" class="pl-1"
><img alt="SciAct Logo" src="../../assets/logo_sciact.png"
><img alt="SciAct Logo" src="https://cosmicds.github.io/cds-website/logos/logo_sciact.png"
/></a>
<a href="https://nasa.gov/" target="_blank" rel="noopener noreferrer" class="pl-1"
><img alt="SciAct Logo" src="../../assets/NASA_Partner_color_300_no_outline.png"
><img alt="SciAct Logo" src="https://cosmicds.github.io/cds-website/logos/NASA_Partner_color_300_no_outline.png"
/></a>
</div>
</div>
Expand Down Expand Up @@ -53,4 +53,4 @@ export default defineComponent({
watch: {
}
});
</script>
</script>
6 changes: 2 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Vue, { createApp } from "vue";

import { IconButton } from "@minids/common";
import { LocationSelector } from "@minids/common";
import { FundingAcknowledgment } from "@minids/common";
import { FundingAcknowledgment, IconButton, LocationSelector } from "@cosmicds/vue-toolkit";
import AnnularEclipse2023 from "./AnnularEclipse2023.vue";
import TransitionExpand from "./TransitionExpand.vue";
import GifPlayPause from "./GifPlayPause.vue";
Expand Down Expand Up @@ -92,7 +90,7 @@ library.add(faStreetView);
const update = (el: HTMLElement, binding: Vue.DirectiveBinding) => el.style.visibility = (binding.value) ? "hidden" : "";

createApp(AnnularEclipse2023, {
wwtNamespace: "wwt-minids-annular-eclipse-2023",
wwtNamespace: "annular-eclipse-2023",
// wtml: { // use this just as a test for the sun
// eclipse: "https://raw.githubusercontent.com/patudom/star-life-cycle/master/content/BUACStellarLifeCycles.wtml",
// },
Expand Down
13 changes: 12 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { VuetifyPlugin } = require('webpack-plugin-vuetify');
const DotenvWebpack = require("dotenv-webpack");
const { defineConfig } = require("@vue/cli-service")
const webpack = require("webpack");
const path = require("path");

module.exports = defineConfig({
publicPath: "./",
Expand All @@ -14,8 +16,17 @@ module.exports = defineConfig({

// See https://stackoverflow.com/questions/67431401/conflicting-values-for-process-env-with-webpack-encore-and-dotenv
ignoreStub: true
}),
new webpack.DefinePlugin({
// https://github.com/vuejs/vue-cli/pull/7443
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
})
]
],
resolve: {
alias: {
vue: path.resolve("./node_modules/vue")
}
}
},

// Needed for BrowserStack/Safari testing as of 2023 March. This makes the
Expand Down

0 comments on commit 2e12b16

Please sign in to comment.