diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index 16b5d214..d0dc3c8d 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -2,63 +2,64 @@ name: Deploy static content to Pages on: - # Runs on pushes targeting the default branch - push: - branches: [ "main" ] + # Runs on pushes targeting the default branch + push: + branches: ['main'] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: read - pages: write - id-token: write - packages: write + contents: read + pages: write + id-token: write + packages: write # Allow one concurrent deployment concurrency: - group: "pages" - cancel-in-progress: true + group: 'pages' + cancel-in-progress: true jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 - - name: Use Node v16 & GitHub registry - uses: actions/setup-node@v3 - with: - node-version: 18 + - name: Use Node v16 & GitHub registry + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Build React App - run: | - yarn install:all - yarn build + - name: Build React App + run: | + yarn install:all + yarn build - - name: Setup Pages - uses: actions/configure-pages@v2 + - name: Setup Pages + uses: actions/configure-pages@v2 - - name: Copy Builds - run: | - mkdir build - cp -r apps/sample-vue-app/dist build/vue - cp -r apps/sample-react-app/build build/react - cp -r apps/sample-vanilla-app/dist build/vanilla + - name: Copy Builds + run: | + mkdir build + cp -r apps/sample-vue-app/dist build/vue + cp -r apps/sample-react-app/build build/react + cp -r apps/sample-vanilla-app/dist build/vanilla + cp -r apps/sample-svelte-app/dist build/svelte + cp -r apps/sample-angular-app/dist/easy-angular build/angular - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - # Upload build - path: './build' + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload build + path: './build' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/apps/sample-angular-app/package.json b/apps/sample-angular-app/package.json index e3706c3e..6e379c9b 100644 --- a/apps/sample-angular-app/package.json +++ b/apps/sample-angular-app/package.json @@ -4,10 +4,9 @@ "private": true, "scripts": { "add-page": "ng g m pages/page-name --routing && ng g component pages/page-name --skip-tests", + "build": "ng build --configuration development", "dev": "ng serve", "lint": "eslint src --ext .js,.jsx,.ts,.tsx", - "ng": "ng", - "test": "ng test", "watch": "ng build --watch --configuration development" }, "dependencies": { diff --git a/apps/sample-svelte-app/.eslintignore b/apps/sample-svelte-app/.eslintignore index 38972655..ca7e2daa 100644 --- a/apps/sample-svelte-app/.eslintignore +++ b/apps/sample-svelte-app/.eslintignore @@ -11,3 +11,4 @@ node_modules pnpm-lock.yaml package-lock.json yarn.lock +.eslintrc.cjs diff --git a/apps/sample-svelte-app/.eslintrc.cjs b/apps/sample-svelte-app/.eslintrc.cjs new file mode 100644 index 00000000..abfdd0be --- /dev/null +++ b/apps/sample-svelte-app/.eslintrc.cjs @@ -0,0 +1,8 @@ +const Config = require('@vechain/repo-config'); + +module.exports = { + ...Config.EslintLibrary, + rules: { + 'no-constant-binary-expression': 'off', + }, +}; diff --git a/apps/sample-svelte-app/.prettierignore b/apps/sample-svelte-app/.prettierignore new file mode 100644 index 00000000..82a9a730 --- /dev/null +++ b/apps/sample-svelte-app/.prettierignore @@ -0,0 +1 @@ +.eslintrc.js \ No newline at end of file diff --git a/apps/sample-svelte-app/package.json b/apps/sample-svelte-app/package.json index a8090734..d81eea8c 100644 --- a/apps/sample-svelte-app/package.json +++ b/apps/sample-svelte-app/package.json @@ -5,18 +5,17 @@ "type": "module", "scripts": { "build": "vite build", - "dev": "vite dev" + "dev": "vite dev", + "lint": "eslint src --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@vechainfoundation/dapp-kit-ui": "*", - "lru-cache": "5.1.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0" + "@vechainfoundation/dapp-kit-ui": "*" }, "devDependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "@sveltejs/adapter-auto": "^2.0.0", + "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/kit": "^1.27.4", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", diff --git a/apps/sample-svelte-app/src/routes/+layout.js b/apps/sample-svelte-app/src/routes/+layout.js index a3d15781..89da957b 100644 --- a/apps/sample-svelte-app/src/routes/+layout.js +++ b/apps/sample-svelte-app/src/routes/+layout.js @@ -1 +1,2 @@ export const ssr = false; +export const prerender = true; diff --git a/apps/sample-svelte-app/svelte.config.js b/apps/sample-svelte-app/svelte.config.js index dec797ab..70765857 100644 --- a/apps/sample-svelte-app/svelte.config.js +++ b/apps/sample-svelte-app/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/kit/vite'; /** @type {import('@sveltejs/kit').Config} */ @@ -11,7 +11,15 @@ const config = { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // If your environment is not supported or you settled on a specific environment, switch out the adapter. // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter(), + adapter: adapter({ + // default options are shown. On some platforms + // these options are set automatically — see below + pages: 'dist', + assets: 'dist', + fallback: undefined, + precompress: true, + strict: true, + }), }, }; diff --git a/apps/sample-svelte-app/tsconfig.json b/apps/sample-svelte-app/tsconfig.json index 9960ed49..761eece1 100644 --- a/apps/sample-svelte-app/tsconfig.json +++ b/apps/sample-svelte-app/tsconfig.json @@ -9,7 +9,7 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, - "moduleResolution": "bundler" + "moduleResolution": "node" } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias //