Merge pull request #4107 from NoelDeMartin/MOBILE-4616
MOBILE-4616: CI and documentation improvementsmain
commit
2e94f835e2
|
@ -153,16 +153,14 @@ jobs:
|
||||||
|
|
||||||
- name: Initialise moodle-plugin-ci
|
- name: Initialise moodle-plugin-ci
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/NoelDeMartin/moodle-plugin-ci --branch selenium-env ci
|
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4.4
|
||||||
composer install -d ./ci
|
|
||||||
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
|
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
|
||||||
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
|
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
|
||||||
sudo locale-gen en_AU.UTF-8
|
sudo locale-gen en_AU.UTF-8
|
||||||
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
|
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
|
||||||
sed -i "58i\$CFG->behat_profiles['chrome']['capabilities'] = ['extra_capabilities' => ['chromeOptions' => ['args' => ['--ignore-certificate-errors', '--allow-running-insecure-content']]]];" ci/res/template/config.php.txt
|
|
||||||
|
|
||||||
- name: Install Behat Snapshots plugin
|
- name: Install Behat Snapshots plugin
|
||||||
run: moodle-plugin-ci add-plugin NoelDeMartin/moodle-local_behatsnapshots
|
run: moodle-plugin-ci add-plugin moodlemobile/moodle-local_behatsnapshots
|
||||||
|
|
||||||
- name: Install moodle-plugin-ci
|
- name: Install moodle-plugin-ci
|
||||||
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
|
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
|
||||||
|
@ -172,6 +170,7 @@ jobs:
|
||||||
MOODLE_REPO: ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle.git' }}
|
MOODLE_REPO: ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle.git' }}
|
||||||
MOODLE_BEHAT_IONIC_WWWROOT: https://localhost:8001
|
MOODLE_BEHAT_IONIC_WWWROOT: https://localhost:8001
|
||||||
MOODLE_BEHAT_DEFAULT_BROWSER: chrome
|
MOODLE_BEHAT_DEFAULT_BROWSER: chrome
|
||||||
|
MOODLE_BEHAT_CHROME_CAPABILITIES: "['extra_capabilities' => ['chromeOptions' => ['args' => ['--ignore-certificate-errors', '--allow-running-insecure-content']]]]"
|
||||||
|
|
||||||
- name: Update config
|
- name: Update config
|
||||||
run: moodle-plugin-ci add-config 'define("TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER", "http://localhost:8002/hash" . sha1($CFG->wwwroot));'
|
run: moodle-plugin-ci add-config 'define("TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER", "http://localhost:8002/hash" . sha1($CFG->wwwroot));'
|
||||||
|
|
|
@ -189,16 +189,14 @@ jobs:
|
||||||
|
|
||||||
- name: Initialise moodle-plugin-ci
|
- name: Initialise moodle-plugin-ci
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/NoelDeMartin/moodle-plugin-ci --branch selenium-env ci
|
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4.4
|
||||||
composer install -d ./ci
|
|
||||||
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
|
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
|
||||||
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
|
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
|
||||||
sudo locale-gen en_AU.UTF-8
|
sudo locale-gen en_AU.UTF-8
|
||||||
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
|
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
|
||||||
sed -i "58i\$CFG->behat_profiles['chrome']['capabilities'] = ['extra_capabilities' => ['chromeOptions' => ['args' => ['--ignore-certificate-errors', '--allow-running-insecure-content']]]];" ci/res/template/config.php.txt
|
|
||||||
|
|
||||||
- name: Install Behat Snapshots plugin
|
- name: Install Behat Snapshots plugin
|
||||||
run: moodle-plugin-ci add-plugin NoelDeMartin/moodle-local_behatsnapshots
|
run: moodle-plugin-ci add-plugin moodlemobile/moodle-local_behatsnapshots
|
||||||
|
|
||||||
- name: Install moodle-plugin-ci
|
- name: Install moodle-plugin-ci
|
||||||
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
|
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
|
||||||
|
@ -208,6 +206,7 @@ jobs:
|
||||||
MOODLE_REPO: ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle.git' }}
|
MOODLE_REPO: ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle.git' }}
|
||||||
MOODLE_BEHAT_IONIC_WWWROOT: https://localhost:8001
|
MOODLE_BEHAT_IONIC_WWWROOT: https://localhost:8001
|
||||||
MOODLE_BEHAT_DEFAULT_BROWSER: chrome
|
MOODLE_BEHAT_DEFAULT_BROWSER: chrome
|
||||||
|
MOODLE_BEHAT_CHROME_CAPABILITIES: "['extra_capabilities' => ['chromeOptions' => ['args' => ['--ignore-certificate-errors', '--allow-running-insecure-content']]]]"
|
||||||
|
|
||||||
- name: Update config
|
- name: Update config
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -62,7 +62,15 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
npm run build:prod
|
npm run build:prod
|
||||||
npm run prod --prefix cordova-plugin-moodleapp
|
npm run prod --prefix cordova-plugin-moodleapp
|
||||||
|
env:
|
||||||
|
MOODLE_APP_CIRCULAR_DEPENDENCIES: true
|
||||||
|
- name: Circular dependencies
|
||||||
|
run: |
|
||||||
|
cat circular-dependencies
|
||||||
|
lines=$(cat circular-dependencies | wc -l)
|
||||||
|
echo "Total circular dependencies: $lines"
|
||||||
|
test $lines -eq 204
|
||||||
- name: JavaScript code compatibility
|
- name: JavaScript code compatibility
|
||||||
run: |
|
run: |
|
||||||
npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Array.prototype.flatMap,Array.prototype.flat,Array.prototype.includes,globalThis,Object.fromEntries,Object.hasOwn,Promise.prototype.finally,String.prototype.matchAll,String.prototype.trimRight" | grep "No issues found. Files are compatible with the target runtimes."
|
npx check-es-compat www/*.js --polyfills="\{Array,String,TypedArray\}.prototype.at,Object.hasOwn"
|
||||||
npx check-es-compat cordova-plugin-moodleapp/www/*.js
|
npx check-es-compat cordova-plugin-moodleapp/www/*.js
|
||||||
|
|
|
@ -62,6 +62,7 @@ yarn-error.log
|
||||||
/libpeerconnection.log
|
/libpeerconnection.log
|
||||||
testem.log
|
testem.log
|
||||||
/typings
|
/typings
|
||||||
|
circular-dependencies
|
||||||
|
|
||||||
# System files
|
# System files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
#
|
#
|
||||||
# More info: https://github.com/browserslist/browserslist
|
# More info: https://github.com/browserslist/browserslist
|
||||||
|
|
||||||
Android >= 5.1
|
Android >= 7
|
||||||
iOS >= 14
|
iOS >= 14
|
||||||
Chrome >= 79
|
Chrome >= 79
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -152,6 +152,7 @@
|
||||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "^6.0.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
"check-es-compat": "3.2.0",
|
"check-es-compat": "3.2.0",
|
||||||
|
"circular-dependency-plugin": "^5.2.2",
|
||||||
"concurrently": "^8.2.0",
|
"concurrently": "^8.2.0",
|
||||||
"cordova-plugin-moodleapp": "file:cordova-plugin-moodleapp",
|
"cordova-plugin-moodleapp": "file:cordova-plugin-moodleapp",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
|
|
@ -73,6 +73,7 @@ const mainMenuRoutes: Routes = [
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Single Activity format navigation.
|
||||||
const courseContentsRoutes: Routes = conditionalRoutes(
|
const courseContentsRoutes: Routes = conditionalRoutes(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
|
@ -219,6 +219,9 @@ export function resolveModuleRoutes(injector: Injector, token: InjectionToken<Mo
|
||||||
|
|
||||||
export const APP_ROUTES = new InjectionToken('APP_ROUTES');
|
export const APP_ROUTES = new InjectionToken('APP_ROUTES');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register routes at the root of the application.
|
||||||
|
*/
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot([]),
|
RouterModule.forRoot([]),
|
||||||
|
|
|
@ -28,6 +28,10 @@ export function resolveContentsRoutes(injector: Injector): ModuleRoutes {
|
||||||
return resolveModuleRoutes(injector, COURSE_CONTENTS_ROUTES);
|
return resolveModuleRoutes(injector, COURSE_CONTENTS_ROUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register routes in the course contents page. These are routes that will only be used on
|
||||||
|
* single activity courses where the activity uses split-view navigation in tablets, such as forum or glossary.
|
||||||
|
*/
|
||||||
@NgModule()
|
@NgModule()
|
||||||
export class CoreCourseContentsRoutingModule {
|
export class CoreCourseContentsRoutingModule {
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,16 @@ export function resolveIndexRoutes(injector: Injector): ModuleRoutes {
|
||||||
return resolveModuleRoutes(injector, COURSE_INDEX_ROUTES);
|
return resolveModuleRoutes(injector, COURSE_INDEX_ROUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register routes in the main course page. These are routes that will appear as tabs in the main page of a course,
|
||||||
|
* and they must also be declared in a CoreCourseOptionsHandler or in plugins using the CoreCourseOptionsDelegate.
|
||||||
|
*
|
||||||
|
* Some examples of routes registered in this module are:
|
||||||
|
* - /main/{tab}/course/{courseId}/contents
|
||||||
|
* - /main/{tab}/course/{courseId}/participants
|
||||||
|
* - /main/{tab}/course/{courseId}/grades
|
||||||
|
* - ...
|
||||||
|
*/
|
||||||
@NgModule()
|
@NgModule()
|
||||||
export class CoreCourseIndexRoutingModule {
|
export class CoreCourseIndexRoutingModule {
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,15 @@ export function resolveHomeRoutes(injector: Injector): ModuleRoutes {
|
||||||
return resolveModuleRoutes(injector, MAIN_MENU_HOME_ROUTES);
|
return resolveModuleRoutes(injector, MAIN_MENU_HOME_ROUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register routes in the home main menu tab. These are routes that will appear as tabs in the home page,
|
||||||
|
* and they must also be declared in a CoreMainMenuHomeHandler or in plugins using the CoreMainMenuHomeDelegate.
|
||||||
|
*
|
||||||
|
* Some examples of routes registered in this module are:
|
||||||
|
* - /main/home/dashboard
|
||||||
|
* - /main/home/site
|
||||||
|
* - ...
|
||||||
|
*/
|
||||||
@NgModule()
|
@NgModule()
|
||||||
export class CoreMainMenuHomeRoutingModule {
|
export class CoreMainMenuHomeRoutingModule {
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,16 @@ export function resolveMainMenuRoutes(injector: Injector): ModuleRoutes {
|
||||||
return resolveModuleRoutes(injector, MAIN_MENU_ROUTES);
|
return resolveModuleRoutes(injector, MAIN_MENU_ROUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register routes in the main menu tab. These are routes that will appear as tabs in the main menu (or overflow
|
||||||
|
* into the more page), and they must also be declared in a CoreMainMenuHandler or in plugins using the CoreMainMenuDelegate.
|
||||||
|
*
|
||||||
|
* Some examples of routes registered in this module are:
|
||||||
|
* - /main/calendar
|
||||||
|
* - /main/messages
|
||||||
|
* - /main/notifications
|
||||||
|
* - ...
|
||||||
|
*/
|
||||||
@NgModule()
|
@NgModule()
|
||||||
export class CoreMainMenuRoutingModule {
|
export class CoreMainMenuRoutingModule {
|
||||||
|
|
||||||
|
|
|
@ -42,15 +42,19 @@ export function buildTabMainRoutes(injector: Injector, mainRoute: Route): Routes
|
||||||
return [mainRoute, ...routes.siblings];
|
return [mainRoute, ...routes.siblings];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register children routes for all main menu tabs. These are routes that can be navigated within any tab in the
|
||||||
|
* main menu, but will remain within the navigation stack of the tab rather than overriding the main menu or moving to another tab.
|
||||||
|
*
|
||||||
|
* Some examples of routes registered in this module are:
|
||||||
|
* - /main/{tab}/user
|
||||||
|
* - /main/{tab}/badges
|
||||||
|
* - /main/{tab}/mod_forum
|
||||||
|
* - ...
|
||||||
|
*/
|
||||||
@NgModule()
|
@NgModule()
|
||||||
export class CoreMainMenuTabRoutingModule {
|
export class CoreMainMenuTabRoutingModule {
|
||||||
|
|
||||||
/**
|
|
||||||
* Use this function to declare routes that will be children of all main menu tabs root routes.
|
|
||||||
*
|
|
||||||
* @param routes Routes to be children of main menu tabs.
|
|
||||||
* @returns Calculated module.
|
|
||||||
*/
|
|
||||||
static forChild(routes: ModuleRoutesConfig): ModuleWithProviders<CoreMainMenuTabRoutingModule> {
|
static forChild(routes: ModuleRoutesConfig): ModuleWithProviders<CoreMainMenuTabRoutingModule> {
|
||||||
return {
|
return {
|
||||||
ngModule: CoreMainMenuTabRoutingModule,
|
ngModule: CoreMainMenuTabRoutingModule,
|
||||||
|
|
|
@ -28,6 +28,16 @@ export function resolveSiteRoutes(injector: Injector): ModuleRoutes {
|
||||||
return resolveModuleRoutes(injector, SITE_PREFERENCES_ROUTES);
|
return resolveModuleRoutes(injector, SITE_PREFERENCES_ROUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module used to register routes in the site preferences page. These are routes that must also be declared in a
|
||||||
|
* CoreSettingsHandler or in plugins using the CoreSettingsDelegate.
|
||||||
|
*
|
||||||
|
* Some examples of routes registered in this module are:
|
||||||
|
* - /main/{tab}/preferences/storage
|
||||||
|
* - /main/{tab}/preferences/messages
|
||||||
|
* - /main/{tab}/preferences/notifications
|
||||||
|
* - ...
|
||||||
|
*/
|
||||||
@NgModule()
|
@NgModule()
|
||||||
export class CoreSitePreferencesRoutingModule {
|
export class CoreSitePreferencesRoutingModule {
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,8 @@ import 'zone.js';
|
||||||
|
|
||||||
// Platform polyfills
|
// Platform polyfills
|
||||||
import 'core-js/es/array/at';
|
import 'core-js/es/array/at';
|
||||||
import 'core-js/es/array/flat-map';
|
|
||||||
import 'core-js/es/array/flat';
|
|
||||||
import 'core-js/es/array/includes';
|
|
||||||
import 'core-js/es/global-this';
|
|
||||||
import 'core-js/es/object/from-entries';
|
|
||||||
import 'core-js/es/object/has-own';
|
import 'core-js/es/object/has-own';
|
||||||
import 'core-js/es/promise/finally';
|
|
||||||
import 'core-js/es/string/at';
|
import 'core-js/es/string/at';
|
||||||
import 'core-js/es/string/match-all';
|
|
||||||
import 'core-js/es/string/trim-right';
|
|
||||||
import 'core-js/es/typed-array/at';
|
import 'core-js/es/typed-array/at';
|
||||||
|
|
||||||
polyfillEventComposedPath();
|
polyfillEventComposedPath();
|
||||||
|
|
|
@ -15,7 +15,7 @@ For more information about upgrading, read the official documentation: https://m
|
||||||
- Due to a breaking change in cordova-plugin-file, avoid using FileEntry.toURL(). Use CoreFileProvider.getFileEntryURL instead.
|
- Due to a breaking change in cordova-plugin-file, avoid using FileEntry.toURL(). Use CoreFileProvider.getFileEntryURL instead.
|
||||||
- FileTransfer service is no longer available, now we recommend use window.FileTransfer instead.
|
- FileTransfer service is no longer available, now we recommend use window.FileTransfer instead.
|
||||||
- CSS variable --font-size-normal has been deprecated in favor of --font-size-md.
|
- CSS variable --font-size-normal has been deprecated in favor of --font-size-md.
|
||||||
- Activity modules services that does not admit plugins are not avaible for site plugins anymore.
|
- Activity modules services that do not admit plugins are not available for site plugins anymore.
|
||||||
- CoreUserDelegate type available values changed from newpage and communication to listitem and button.
|
- CoreUserDelegate type available values changed from newpage and communication to listitem and button.
|
||||||
|
|
||||||
=== 4.3.0 ===
|
=== 4.3.0 ===
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
const TerserPlugin = require('terser-webpack-plugin');
|
const TerserPlugin = require('terser-webpack-plugin');
|
||||||
|
const CircularDependencyPlugin = require('circular-dependency-plugin');
|
||||||
|
const { appendFileSync } = require('fs');
|
||||||
|
|
||||||
module.exports = config => {
|
module.exports = config => {
|
||||||
config.optimization.minimizer.push(
|
config.optimization.minimizer.push(
|
||||||
|
@ -46,5 +48,20 @@ module.exports = config => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.MOODLE_APP_CIRCULAR_DEPENDENCIES) {
|
||||||
|
config.plugins.push(
|
||||||
|
new CircularDependencyPlugin({
|
||||||
|
exclude: /node_modules/,
|
||||||
|
cwd: process.cwd(),
|
||||||
|
onDetected({ paths }) {
|
||||||
|
appendFileSync(
|
||||||
|
`${process.cwd()}/circular-dependencies`,
|
||||||
|
paths.join(' -> ') + '\n',
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue