Skip to content

Commit

Permalink
Merge branch 'quasarframework:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sainf authored Dec 5, 2023
2 parents 15edb72 + 3d03c2a commit c876066
Show file tree
Hide file tree
Showing 177 changed files with 10,818 additions and 7,444 deletions.
177 changes: 177 additions & 0 deletions .github/workflows/project-creation-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Project creation tests

on:
workflow_dispatch:
release:
types:
- released # A release was published, or a pre-release was changed to a release.
pull_request:
types: [opened, synchronize]
branches:
- 'dev'
paths:
- '.github/workflows/project-creation-tests.yml'
- 'create-quasar/**'

jobs:
lint:
if: >-
${{
github.event_name == 'pull_request' ||
startsWith(github.event.release.tag_name, 'quasar') ||
startsWith(github.event.release.tag_name, '@quasar/extras') ||
startsWith(github.event.release.tag_name, '@quasar/app-webpack') ||
startsWith(github.event.release.tag_name, '@quasar/app-vite')
}}
permissions:
contents: read # to fetch code (actions/checkout)

runs-on: ubuntu-latest

defaults:
run:
working-directory: create-quasar

name: Lint create-quasar
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
# create-quasar is not included in workspaces, and it's yarn.lock is .gitignored, so we can't have caching
# cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Lint the code
run: yarn lint

test:
needs: lint

permissions:
contents: read # to fetch code (actions/checkout)

runs-on: ubuntu-latest

defaults:
run:
working-directory: create-quasar

strategy:
fail-fast: false
matrix:
script-type: [js, ts]
app-engine: [vite, webpack]
node-version: [16, 18, 20]
package-manager: [yarn, npm, pnpm]

name: Test ${{ matrix.script-type }}-${{ matrix.app-engine }} (Node v${{ matrix.node-version }} - ${{ matrix.package-manager }})

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# create-quasar is not included in workspaces, and it's yarn.lock is .gitignored, so we can't have caching
# cache: 'yarn'

- name: Install dependencies
run: yarn

# pnpm
- name: Install pnpm
if: ${{ matrix.package-manager == 'pnpm' }}
uses: pnpm/action-setup@v2
with:
version: 8
- name: Get pnpm store directory
if: ${{ matrix.package-manager == 'pnpm' }}
id: pnpm-cache
run: |
echo "PNPM_CACHE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
if: ${{ matrix.package-manager == 'pnpm' }}
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.PNPM_CACHE_PATH }}
key: pnpm-cache-${{ matrix.app-engine }}-${{ matrix.script-type }}
restore-keys: |
pnpm-cache-${{ matrix.app-engine }}-
pnpm-cache-
# yarn
- name: Get yarn cache directory
if: ${{ matrix.package-manager == 'yarn' }}
id: yarn-cache
run: |
echo "YARN_CACHE_PATH=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Setup yarn cache
if: ${{ matrix.package-manager == 'yarn' }}
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_PATH }}
key: yarn-cache-${{ matrix.app-engine }}-${{ matrix.script-type }}
restore-keys: |
yarn-cache-${{ matrix.app-engine }}-
yarn-cache-
# npm
- name: Get npm cache directory
if: ${{ matrix.package-manager == 'npm' }}
id: npm-cache
run: |
echo "NPM_CACHE_PATH=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Setup npm cache
if: ${{ matrix.package-manager == 'npm' }}
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.NPM_CACHE_PATH }}
key: npm-cache-${{ matrix.app-engine }}-${{ matrix.script-type }}
restore-keys: |
npm-cache-${{ matrix.app-engine }}-
npm-cache-
- name: Create the test project
run: yarn create-test-project ${{ matrix.script-type }} ${{ matrix.app-engine }} ${{ matrix.package-manager }}

- name: Lint the project
working-directory: create-quasar/test-project
run: ${{ matrix.package-manager }} run lint

- name: Test the build
working-directory: create-quasar/test-project
run: ${{ matrix.package-manager }} run build

- name: Test the development server
working-directory: create-quasar/test-project
env:
# For Vite, see https://github.com/jeffbski/wait-on/issues/78#issuecomment-867813529
WAIT_ON_CONFIG: |
{
"headers": {
"accept": "text/html"
}
}
run: |
${{ matrix.package-manager }} run dev &
if [ '${{ matrix.app-engine }}' = 'vite' ]; then
echo $WAIT_ON_CONFIG > wait-on.json
npx wait-on@7.0.1 --config wait-on.json --timeout 5000 http-get://127.0.0.1:9000
else
# 15s is almost enough, but due to possible fluctuations in the CI environment, we set it higher than that
npx wait-on@7.0.1 --timeout 20000 http-get://127.0.0.1:8080
fi
kill $!
4 changes: 2 additions & 2 deletions app-vite/lib/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ if (argv.help) {
electron-builder as bundler
--debug, -d Build for debugging purposes
--skip-pkg, -s Build only UI (skips creating Cordova/Capacitor/Electron executables)
- Cordova (it only fills in /src/cordova/www folder with the UI code)
- Capacitor (it only fills in /src/capacitor/www folder with the UI code)
- Cordova (it only fills in /src-cordova/www folder with the UI code)
- Capacitor (it only fills in /src-capacitor/www folder with the UI code)
- Electron (it only creates the /dist/electron/UnPackaged folder)
--help, -h Displays this message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function quasarVitePluginDevCordovaPlatformInject (quasarConf) {

transformIndexHtml: {
order: 'pre',
transform: html => html.replace(
handler: html => html.replace(
entryPointMarkup,
`<script src="cordova.js"></script>${ entryPointMarkup }`
)
Expand Down
2 changes: 1 addition & 1 deletion app-vite/lib/modes/pwa/vite-plugin.pwa-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function quasarVitePluginPwaResources (quasarConf) {
enforce: 'pre',

transformIndexHtml: {
transform: html => {
handler: html => {
updateCache()
return html.replace(
/(<\/head>)/i,
Expand Down
2 changes: 1 addition & 1 deletion app-vite/lib/plugins/vite.index-html-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function quasarViteIndexHtmlTransformPlugin (quasarConf) {
enforce: 'pre',
transformIndexHtml: {
order: 'pre',
transform: html => transformHtml(html, quasarConf)
handler: html => transformHtml(html, quasarConf)
}
}
}
10 changes: 5 additions & 5 deletions app-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quasar/app-vite",
"version": "2.0.0-alpha.39",
"version": "2.0.0-alpha.42",
"description": "Quasar Framework App CLI with Vite",
"bin": {
"quasar": "./bin/quasar.js"
Expand Down Expand Up @@ -79,11 +79,11 @@
"open": "^9.1.0",
"register-service-worker": "^1.7.2",
"rollup-plugin-visualizer": "^5.9.2",
"sass": "1.32.12",
"sass": "^1.33.0",
"semver": "^7.5.3",
"serialize-javascript": "^6.0.0",
"table": "^6.8.0",
"vite": "^5.0.0-beta.13",
"vite": "^5.0.0",
"webpack-merge": "^5.9.0"
},
"devDependencies": {
Expand All @@ -95,7 +95,7 @@
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
"pinia": "^2.1.3",
"quasar": "^2.11.5",
"quasar": "^2.14.0",
"ts-essentials": "^9.1.2",
"typescript": "^5.2.2",
"vue": "^3.3.4",
Expand All @@ -108,7 +108,7 @@
"electron-packager": ">= 15",
"eslint": "^8.11.0",
"pinia": "^2.0.0",
"quasar": "^2.8.0",
"quasar": "^2.14.0",
"vue": "^3.2.29",
"vue-router": "^4.0.12",
"vuex": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions app-webpack/lib/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ if (argv.help) {
electron-builder as bundler
--debug, -d Build for debugging purposes
--skip-pkg, -s Build only UI (skips creating Cordova/Capacitor/Electron executables)
- Cordova (it only fills in /src/cordova/www folder with the UI code)
- Capacitor (it only fills in /src/capacitor/www folder with the UI code)
- Cordova (it only fills in /src-cordova/www folder with the UI code)
- Capacitor (it only fills in /src-capacitor/www folder with the UI code)
- Electron (it only creates the /dist/electron/UnPackaged folder)
--help, -h Displays this message
Expand Down
8 changes: 4 additions & 4 deletions app-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quasar/app-webpack",
"version": "4.0.0-alpha.28",
"version": "4.0.0-alpha.29",
"description": "Quasar Framework App CLI with Webpack",
"bin": {
"quasar": "./bin/quasar"
Expand Down Expand Up @@ -97,7 +97,7 @@
"postcss-rtlcss": "^4.0.6",
"register-service-worker": "^1.7.2",
"rollup-plugin-visualizer": "^5.5.4",
"sass": "1.32.12",
"sass": "^1.33.0",
"sass-loader": "13.2.2",
"semver": "^7.5.3",
"serialize-javascript": "^6.0.0",
Expand All @@ -124,7 +124,7 @@
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
"pinia": "^2.1.3",
"quasar": "^2.11.5",
"quasar": "^2.14.0",
"ts-essentials": "^9.1.2",
"vue": "^3.3.4",
"vue-router": "^4.2.1",
Expand All @@ -137,7 +137,7 @@
"electron-packager": ">= 15",
"eslint": "^8.11.0",
"pinia": "^2.0.0",
"quasar": "^2.8.0",
"quasar": "^2.14.0",
"vue": "^3.2.29",
"vue-router": "^4.0.12",
"vuex": "^4.0.0",
Expand Down
15 changes: 15 additions & 0 deletions create-quasar/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,19 @@ module.exports = {
rules: {
'no-empty': 'off',
},

overrides: [
{
files: './scripts/**/*.ts',

parserOptions: {
sourceType: 'module',
},

extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
}
]
}
2 changes: 2 additions & 0 deletions create-quasar/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ yarn-error.log*
*.njsproj
*.sln

# create-test-project script output
test-project/
5 changes: 4 additions & 1 deletion create-quasar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"node": ">=12"
},
"scripts": {
"lint": "eslint --ext .js,.ts ./ --fix"
"lint": "eslint --ext .js,.ts ./ --fix",
"create-test-project": "tsx scripts/create-test-project.ts"
},
"dependencies": {
"fast-glob": "^3.2.11",
Expand All @@ -37,10 +38,12 @@
},
"devDependencies": {
"@types/lodash": "^4.6.7",
"@types/prompts": "^2.4.7",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint": "^8.11.0",
"eslint-plugin-lodash-template": "^0.21.0",
"tsx": "^3.14.0",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit c876066

Please sign in to comment.