From 4599a123d9127e1c662fbba633af23c85939e3e2 Mon Sep 17 00:00:00 2001 From: Chunpeng Huo Date: Thu, 7 May 2020 15:46:14 +1000 Subject: [PATCH] feat: au new wraps npx makes aurelia/v1 BREAKING CHANGE: skeleton files is moved to dedicated repo https://github.com/aurelia/v1 BREAKING CHANGE: release-check is removed. Skeletons check is done in aurelia/v1 repo. BREAKING CHANGE: "--unattended" is removed from "au new" params. BREAKING CHANGE: "au generate-skeletons" is removed. --- .circleci/config.yml | 308 ---------- .eslintignore | 6 - ACKNOWLEDGEMENTS.md | 237 -------- DESCRIPTIVE_SKELETON.md | 59 -- README.md | 5 +- RELEASE_INSTRUCTIONS.md | 22 +- appveyor.yml | 44 -- bin/aurelia-cli.js | 4 +- build/tasks/prepare-release.js | 3 +- build/tasks/release-check.js | 87 --- .../release-checks/message-history-logger.js | 46 -- build/tasks/release-checks/reporter.js | 32 -- build/tasks/release-checks/step-runner.js | 15 - build/tasks/release-checks/step.js | 21 - build/tasks/release-checks/suite-runner.js | 30 - build/tasks/release-checks/suite-steps.js | 91 --- .../tasks/release-checks/tasks/change-dir.js | 14 - .../tasks/check-javascript-errors.js | 47 -- .../release-checks/tasks/dotnet-new-web.js | 20 - .../release-checks/tasks/execute-command.js | 68 --- build/tasks/release-checks/tasks/index.js | 15 - .../tasks/install-latest-aurelia-cli.js | 42 -- .../tasks/install-node-modules.js | 24 - .../tasks/take-screenshot-of-page.js | 43 -- build/tasks/release-checks/tasks/task.js | 28 - .../release-checks/test-projects-selector.js | 62 --- .../tests/generic/au-cypress.js | 88 --- .../tests/generic/au-generate.js | 119 ---- .../release-checks/tests/generic/au-jest.js | 31 -- .../release-checks/tests/generic/au-karma.js | 30 - .../release-checks/tests/generic/au-lint.js | 38 -- .../tests/generic/au-protractor.js | 78 --- .../tests/generic/dotnet-run.js | 123 ---- .../release-checks/tests/generic/index.js | 9 - build/tasks/release-checks/tests/index.js | 6 - .../tests/plugin/au-build-plugin.js | 33 -- .../release-checks/tests/plugin/index.js | 3 - .../tests/requirejs/au-build.js | 86 --- .../release-checks/tests/requirejs/au-run.js | 174 ------ .../release-checks/tests/requirejs/index.js | 4 - build/tasks/release-checks/tests/test.js | 30 - .../release-checks/tests/webpack/au-build.js | 64 --- .../release-checks/tests/webpack/au-run.js | 179 ------ .../release-checks/tests/webpack/index.js | 4 - build/tasks/update-dependenciesjs.js | 57 -- gulpfile.js | 3 - lib/build/bundle.js | 4 +- lib/build/index.js | 11 +- lib/commands/generate-skeletons/command.js | 123 ---- lib/commands/generate-skeletons/command.json | 11 - lib/commands/new/command.js | 229 +------- lib/commands/new/command.json | 14 +- lib/commands/new/install-deps.js | 87 --- lib/dependencies.js | 5 - lib/dependencies.json | 111 ---- lib/{workflow => }/pretty-choices.js | 4 +- lib/resources/index.js | 9 - lib/ui.js | 2 +- lib/workflow/applicable.js | 38 -- lib/workflow/questionnaire.js | 235 -------- lib/workflow/run-questionnaire.js | 110 ---- lib/workflow/select-features.js | 146 ----- lib/workflow/write-project/index.js | 11 - lib/workflow/write-project/prepare-project.js | 260 --------- lib/workflow/write-project/write-project.js | 155 ------ package.json | 11 +- skeleton/cli-bundler/README.md | 23 - .../cli-bundler/aurelia_project/aurelia.json | 203 ------- .../aurelia_project/tasks/build.ext | 48 -- .../aurelia_project/tasks/build.json | 16 - .../aurelia_project/tasks/clear-cache.json | 4 - .../aurelia_project/tasks/copy-files.ext | 51 -- .../aurelia_project/tasks/lint.ext | 17 - .../aurelia_project/tasks/lint.json | 6 - .../aurelia_project/tasks/process-css.ext | 113 ---- .../aurelia_project/tasks/process-json.ext | 23 - .../aurelia_project/tasks/process-markup.ext | 66 --- .../cli-bundler/aurelia_project/tasks/run.ext | 69 --- .../aurelia_project/tasks/run.json | 33 -- .../aurelia_project/tasks/watch.ext | 139 ----- .../tasks__if_babel/clear-cache.js | 16 - .../tasks__if_babel/transpile.js | 84 --- .../tasks__if_typescript/clear-cache.ts | 6 - .../tasks__if_typescript/transpile.ts | 63 --- ...ex.html__ask-if-exists__if_not_dotnet-core | 18 - skeleton/cli-bundler/package.json | 71 --- skeleton/common/.editorconfig__skip-if-exists | 12 - skeleton/common/.eslintrc.json | 51 -- skeleton/common/.gitignore__append-if-exists | 39 -- skeleton/common/README.md__skip-if-exists | 3 - skeleton/common/aurelia_project/aurelia.json | 23 - .../environments__if_not_webpack/dev.ext | 4 - .../environments__if_not_webpack/prod.ext | 4 - .../environments__if_not_webpack/stage.ext | 4 - .../aurelia_project/generators/attribute.ext | 69 --- .../aurelia_project/generators/attribute.json | 4 - .../generators/binding-behavior.ext | 51 -- .../generators/binding-behavior.json | 4 - .../generators/component.ext__if_not_plugin | 70 --- .../generators/component.json__if_not_plugin | 4 - .../aurelia_project/generators/element.ext | 59 -- .../aurelia_project/generators/element.json | 4 - .../aurelia_project/generators/generator.ext | 87 --- .../aurelia_project/generators/generator.json | 4 - .../aurelia_project/generators/task.ext | 62 --- .../aurelia_project/generators/task.json | 4 - .../generators/value-converter.ext | 51 -- .../generators/value-converter.json | 4 - skeleton/common/babel.config.js__if_babel | 27 - .../config__if_webpack/environment.json | 4 - .../environment.production.json | 4 - skeleton/common/favicon.ico__skip-if-exists | Bin 15086 -> 0 bytes skeleton/common/package.json | 45 -- ...ronment.ext__if_not_plugin_and_not_webpack | 4 - skeleton/common/tsconfig.json__if_typescript | 63 --- skeleton/cypress/README.md | 18 - .../cypress/aurelia_project/tasks/cypress.ext | 37 -- .../aurelia_project/tasks/cypress.json | 26 - skeleton/cypress/cypress.config.js | 10 - skeleton/cypress/cypress.json | 1 - skeleton/cypress/cypress/.eslintrc.json | 8 - .../cypress/cypress/fixtures/example.json | 5 - skeleton/cypress/cypress/plugins/index.js | 20 - skeleton/cypress/cypress/support/commands.js | 25 - skeleton/cypress/cypress/support/index.js | 20 - .../cypress/tsconfig.json__if_typescript | 14 - skeleton/cypress/package.json | 10 - skeleton/docker/.dockerignore | 27 - skeleton/docker/Dockerfile | 122 ---- skeleton/docker/README.md | 14 - skeleton/docker/docker-compose.yml | 11 - skeleton/docker/nginx.conf | 25 - skeleton/docker/package.json | 7 - .../HomeController.cs__skip-if-exists | 24 - .../SampleDataController.cs__skip-if-exists | 44 -- .../Models/ErrorViewModel.cs__skip-if-exists | 11 - .../dotnet-core/Program.cs__skip-if-exists | 24 - .../launchSettings.json__skip-if-exists | 27 - skeleton/dotnet-core/Startup.cs__instructions | 62 --- .../dotnet-core/Startup.cs__skip-if-exists | 69 --- .../Views/Home/Index.cshtml__instructions | 17 - .../Views/Home/Index.cshtml__skip-if-exists | 13 - .../Views/Shared/Error.cshtml__skip-if-exists | 22 - .../Views/Shared/_Layout.cshtml__instructions | 18 - .../Shared/_Layout.cshtml__skip-if-exists | 14 - .../Views/_ViewImports.cshtml__skip-if-exists | 4 - .../Views/_ViewStart.cshtml__skip-if-exists | 3 - ...psettings.Development.json__skip-if-exists | 9 - .../appsettings.json__skip-if-exists | 8 - .../dotnet-core/global.json__skip-if-exists | 3 - skeleton/dotnet-core/package.json__if_webpack | 5 - .../project.csproj__skip-if-exists | 32 -- ...core.config.js__skip-if-exists__if_webpack | 29 - .../wwwroot/favicon.ico__skip-if-exists | Bin 15086 -> 0 bytes .../index.html__ask-if-exists__if_cli-bundler | 18 - skeleton/jest/README.md | 5 - skeleton/jest/aurelia_project/tasks/jest.ext | 1 - skeleton/jest/aurelia_project/tasks/jest.json | 11 - skeleton/jest/aurelia_project/tasks/test.ext | 31 -- skeleton/jest/aurelia_project/tasks/test.json | 11 - skeleton/jest/package.json | 91 --- skeleton/jest/test/jest-pretest.ext | 11 - .../mock-css.js__if_less_or_sass_or_stylus | 1 - skeleton/karma/README.md | 5 - .../karma/aurelia_project/tasks/karma.ext | 1 - .../tasks/karma.json | 16 - .../tasks/test.ext | 38 -- .../tasks/test.json | 16 - .../tasks/karma.json | 11 - .../tasks/test.ext | 21 - .../tasks/test.json | 11 - skeleton/karma/karma.conf.js__if_cli-bundler | 95 ---- skeleton/karma/package.json | 31 -- .../aurelia-karma.js__if_requirejs_or_alameda | 109 ---- .../aurelia-karma.js__if_systemjs | 54 -- .../karma/test__if_cli-bundler/unit/setup.ext | 3 - .../karma/test__if_webpack/karma-bundle.js | 43 -- skeleton/karma/test__if_webpack/karma.conf.js | 114 ---- skeleton/plugin/README.md | 157 ------ skeleton/plugin/aurelia_project/aurelia.json | 41 -- .../aurelia_project/tasks/build-plugin.ext | 54 -- skeleton/plugin/dev-app/app.ext | 13 - skeleton/plugin/dev-app/app.html | 29 - skeleton/plugin/dev-app/environment.ext | 4 - skeleton/plugin/dev-app/main.ext | 25 - skeleton/plugin/package.json | 25 - .../color.js__if_babel | 12 - .../color.ts__if_typescript | 10 - .../primary-click.ext | 21 - ...s__if_not_less_and_not_sass_and_not_stylus | 3 - skeleton/plugin/src/elements/hello-world.ext | 10 - skeleton/plugin/src/elements/hello-world.html | 4 - .../src/elements/hello-world.less__if_less | 3 - .../src/elements/hello-world.scss__if_sass | 3 - .../src/elements/hello-world.styl__if_stylus | 2 - skeleton/plugin/src/index.ext | 15 - .../upcase.ext | 10 - .../unit/.eslintrc__if_babel | 5 - .../color.spec.ext | 36 -- .../primary-click.spec.ext | 63 --- .../unit/elements/hello-world.spec.ext | 36 -- .../upcase.spec.ext | 23 - skeleton/protractor/README.md | 18 - .../aurelia_project/tasks/protractor.ext | 49 -- .../aurelia_project/tasks/protractor.json | 21 - .../e2e/tsconfig.json__if_typescript | 15 - skeleton/protractor/package.json | 16 - skeleton/protractor/protractor.conf.js | 86 --- .../integration/app.e2e.ext | 11 - .../e2e__if_protractor/demo.e2e.ext | 27 - .../e2e__if_protractor/skeleton.po.ext | 9 - .../e2e__if_protractor/welcome.po.ext | 9 - skeleton/scaffold-minimum/src/app.ext | 8 - skeleton/scaffold-minimum/src/app.html | 3 - skeleton/scaffold-minimum/src/main.ext | 44 -- .../scaffold-minimum/src/resources/index.ext | 7 - .../test__if_karma_or_jest/unit/app.spec.ext | 33 -- .../aurelia.json | 20 - .../integration/app.e2e.ext | 13 - .../e2e__if_protractor/demo.e2e.ext | 48 -- .../e2e__if_protractor/skeleton.po.ext | 16 - .../e2e__if_protractor/welcome.po.ext | 54 -- skeleton/scaffold-navigation/package.json | 10 - skeleton/scaffold-navigation/src/app.ext | 59 -- skeleton/scaffold-navigation/src/app.html | 24 - .../scaffold-navigation/src/blur-image.ext | 379 ------------- .../scaffold-navigation/src/child-router.ext | 61 -- .../scaffold-navigation/src/child-router.html | 22 - skeleton/scaffold-navigation/src/main.ext | 62 --- skeleton/scaffold-navigation/src/nav-bar.html | 26 - .../src/resources/index.ext | 7 - ...s__if_not_less_and_not_sass_and_not_stylus | 154 ----- .../src/styles.less__if_less | 154 ----- .../src/styles.scss__if_sass | 154 ----- .../src/styles.styl__if_stylus | 129 ----- skeleton/scaffold-navigation/src/users.html | 21 - skeleton/scaffold-navigation/src/welcome.html | 20 - .../src__if_babel/users.js | 24 - .../src__if_babel/welcome.js | 34 -- .../src__if_typescript/users.ts | 21 - .../src__if_typescript/welcome.ts | 32 -- .../unit/.eslintrc__if_babel | 5 - .../test__if_karma_or_jest/unit/app.spec.ext | 67 --- .../unit/child-router.spec.ext | 52 -- .../unit__if_babel/users.spec.js | 30 - .../unit__if_typescript/users.spec.ts | 36 -- skeleton/vscode/.vscode/extensions.json | 10 - .../.vscode/launch.json__if_cli-bundler | 32 -- .../vscode/.vscode/launch.json__if_webpack | 19 - .../.vscode/settings.json__if_typescript | 6 - skeleton/vscode/jsconfig.json__if_babel | 6 - skeleton/webpack/README.md | 23 - skeleton/webpack/aurelia_project/aurelia.json | 25 - .../webpack/aurelia_project/tasks/build.ext | 26 - .../webpack/aurelia_project/tasks/build.json | 21 - .../webpack/aurelia_project/tasks/run.ext | 52 -- .../webpack/aurelia_project/tasks/run.json | 36 -- skeleton/webpack/index.ejs | 12 - skeleton/webpack/package.json | 85 --- skeleton/webpack/static/favicon.ico | Bin 15086 -> 0 bytes skeleton/webpack/webpack.config.js | 381 ------------- spec/lib/workflow/applicable.spec.js | 74 --- spec/lib/workflow/run-questionnaire.spec.js | 311 ----------- spec/lib/workflow/select-features.spec.js | 319 ----------- .../write-project/prepare-project.spec.js | 527 ------------------ .../write-project/write-project.spec.js | 311 ----------- wallaby.conf.js | 1 - 267 files changed, 26 insertions(+), 12472 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 DESCRIPTIVE_SKELETON.md delete mode 100644 appveyor.yml delete mode 100644 build/tasks/release-check.js delete mode 100644 build/tasks/release-checks/message-history-logger.js delete mode 100644 build/tasks/release-checks/reporter.js delete mode 100644 build/tasks/release-checks/step-runner.js delete mode 100644 build/tasks/release-checks/step.js delete mode 100644 build/tasks/release-checks/suite-runner.js delete mode 100644 build/tasks/release-checks/suite-steps.js delete mode 100644 build/tasks/release-checks/tasks/change-dir.js delete mode 100644 build/tasks/release-checks/tasks/check-javascript-errors.js delete mode 100644 build/tasks/release-checks/tasks/dotnet-new-web.js delete mode 100644 build/tasks/release-checks/tasks/execute-command.js delete mode 100644 build/tasks/release-checks/tasks/index.js delete mode 100644 build/tasks/release-checks/tasks/install-latest-aurelia-cli.js delete mode 100644 build/tasks/release-checks/tasks/install-node-modules.js delete mode 100644 build/tasks/release-checks/tasks/take-screenshot-of-page.js delete mode 100644 build/tasks/release-checks/tasks/task.js delete mode 100644 build/tasks/release-checks/test-projects-selector.js delete mode 100644 build/tasks/release-checks/tests/generic/au-cypress.js delete mode 100644 build/tasks/release-checks/tests/generic/au-generate.js delete mode 100644 build/tasks/release-checks/tests/generic/au-jest.js delete mode 100644 build/tasks/release-checks/tests/generic/au-karma.js delete mode 100644 build/tasks/release-checks/tests/generic/au-lint.js delete mode 100644 build/tasks/release-checks/tests/generic/au-protractor.js delete mode 100644 build/tasks/release-checks/tests/generic/dotnet-run.js delete mode 100644 build/tasks/release-checks/tests/generic/index.js delete mode 100644 build/tasks/release-checks/tests/index.js delete mode 100644 build/tasks/release-checks/tests/plugin/au-build-plugin.js delete mode 100644 build/tasks/release-checks/tests/plugin/index.js delete mode 100644 build/tasks/release-checks/tests/requirejs/au-build.js delete mode 100644 build/tasks/release-checks/tests/requirejs/au-run.js delete mode 100644 build/tasks/release-checks/tests/requirejs/index.js delete mode 100644 build/tasks/release-checks/tests/test.js delete mode 100644 build/tasks/release-checks/tests/webpack/au-build.js delete mode 100644 build/tasks/release-checks/tests/webpack/au-run.js delete mode 100644 build/tasks/release-checks/tests/webpack/index.js delete mode 100644 build/tasks/update-dependenciesjs.js delete mode 100644 lib/commands/generate-skeletons/command.js delete mode 100644 lib/commands/generate-skeletons/command.json delete mode 100644 lib/commands/new/install-deps.js delete mode 100644 lib/dependencies.js delete mode 100644 lib/dependencies.json rename lib/{workflow => }/pretty-choices.js (91%) delete mode 100644 lib/resources/index.js delete mode 100644 lib/workflow/applicable.js delete mode 100644 lib/workflow/questionnaire.js delete mode 100644 lib/workflow/run-questionnaire.js delete mode 100644 lib/workflow/select-features.js delete mode 100644 lib/workflow/write-project/index.js delete mode 100644 lib/workflow/write-project/prepare-project.js delete mode 100644 lib/workflow/write-project/write-project.js delete mode 100644 skeleton/cli-bundler/README.md delete mode 100644 skeleton/cli-bundler/aurelia_project/aurelia.json delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/build.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/build.json delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/clear-cache.json delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/copy-files.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/lint.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/lint.json delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/process-css.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/process-json.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/process-markup.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/run.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/run.json delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks/watch.ext delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks__if_babel/clear-cache.js delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks__if_babel/transpile.js delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks__if_typescript/clear-cache.ts delete mode 100644 skeleton/cli-bundler/aurelia_project/tasks__if_typescript/transpile.ts delete mode 100644 skeleton/cli-bundler/index.html__ask-if-exists__if_not_dotnet-core delete mode 100644 skeleton/cli-bundler/package.json delete mode 100644 skeleton/common/.editorconfig__skip-if-exists delete mode 100644 skeleton/common/.eslintrc.json delete mode 100644 skeleton/common/.gitignore__append-if-exists delete mode 100644 skeleton/common/README.md__skip-if-exists delete mode 100644 skeleton/common/aurelia_project/aurelia.json delete mode 100644 skeleton/common/aurelia_project/environments__if_not_webpack/dev.ext delete mode 100644 skeleton/common/aurelia_project/environments__if_not_webpack/prod.ext delete mode 100644 skeleton/common/aurelia_project/environments__if_not_webpack/stage.ext delete mode 100644 skeleton/common/aurelia_project/generators/attribute.ext delete mode 100644 skeleton/common/aurelia_project/generators/attribute.json delete mode 100644 skeleton/common/aurelia_project/generators/binding-behavior.ext delete mode 100644 skeleton/common/aurelia_project/generators/binding-behavior.json delete mode 100644 skeleton/common/aurelia_project/generators/component.ext__if_not_plugin delete mode 100644 skeleton/common/aurelia_project/generators/component.json__if_not_plugin delete mode 100644 skeleton/common/aurelia_project/generators/element.ext delete mode 100644 skeleton/common/aurelia_project/generators/element.json delete mode 100644 skeleton/common/aurelia_project/generators/generator.ext delete mode 100644 skeleton/common/aurelia_project/generators/generator.json delete mode 100644 skeleton/common/aurelia_project/generators/task.ext delete mode 100644 skeleton/common/aurelia_project/generators/task.json delete mode 100644 skeleton/common/aurelia_project/generators/value-converter.ext delete mode 100644 skeleton/common/aurelia_project/generators/value-converter.json delete mode 100644 skeleton/common/babel.config.js__if_babel delete mode 100644 skeleton/common/config__if_webpack/environment.json delete mode 100644 skeleton/common/config__if_webpack/environment.production.json delete mode 100644 skeleton/common/favicon.ico__skip-if-exists delete mode 100644 skeleton/common/package.json delete mode 100644 skeleton/common/src/environment.ext__if_not_plugin_and_not_webpack delete mode 100644 skeleton/common/tsconfig.json__if_typescript delete mode 100644 skeleton/cypress/README.md delete mode 100644 skeleton/cypress/aurelia_project/tasks/cypress.ext delete mode 100644 skeleton/cypress/aurelia_project/tasks/cypress.json delete mode 100644 skeleton/cypress/cypress.config.js delete mode 100644 skeleton/cypress/cypress.json delete mode 100644 skeleton/cypress/cypress/.eslintrc.json delete mode 100644 skeleton/cypress/cypress/fixtures/example.json delete mode 100644 skeleton/cypress/cypress/plugins/index.js delete mode 100644 skeleton/cypress/cypress/support/commands.js delete mode 100644 skeleton/cypress/cypress/support/index.js delete mode 100644 skeleton/cypress/cypress/tsconfig.json__if_typescript delete mode 100644 skeleton/cypress/package.json delete mode 100644 skeleton/docker/.dockerignore delete mode 100644 skeleton/docker/Dockerfile delete mode 100644 skeleton/docker/README.md delete mode 100644 skeleton/docker/docker-compose.yml delete mode 100644 skeleton/docker/nginx.conf delete mode 100644 skeleton/docker/package.json delete mode 100644 skeleton/dotnet-core/Controllers/HomeController.cs__skip-if-exists delete mode 100644 skeleton/dotnet-core/Controllers/SampleDataController.cs__skip-if-exists delete mode 100644 skeleton/dotnet-core/Models/ErrorViewModel.cs__skip-if-exists delete mode 100644 skeleton/dotnet-core/Program.cs__skip-if-exists delete mode 100644 skeleton/dotnet-core/Properties/launchSettings.json__skip-if-exists delete mode 100644 skeleton/dotnet-core/Startup.cs__instructions delete mode 100644 skeleton/dotnet-core/Startup.cs__skip-if-exists delete mode 100644 skeleton/dotnet-core/Views/Home/Index.cshtml__instructions delete mode 100644 skeleton/dotnet-core/Views/Home/Index.cshtml__skip-if-exists delete mode 100644 skeleton/dotnet-core/Views/Shared/Error.cshtml__skip-if-exists delete mode 100644 skeleton/dotnet-core/Views/Shared/_Layout.cshtml__instructions delete mode 100644 skeleton/dotnet-core/Views/Shared/_Layout.cshtml__skip-if-exists delete mode 100644 skeleton/dotnet-core/Views/_ViewImports.cshtml__skip-if-exists delete mode 100644 skeleton/dotnet-core/Views/_ViewStart.cshtml__skip-if-exists delete mode 100644 skeleton/dotnet-core/appsettings.Development.json__skip-if-exists delete mode 100644 skeleton/dotnet-core/appsettings.json__skip-if-exists delete mode 100644 skeleton/dotnet-core/global.json__skip-if-exists delete mode 100644 skeleton/dotnet-core/package.json__if_webpack delete mode 100644 skeleton/dotnet-core/project.csproj__skip-if-exists delete mode 100644 skeleton/dotnet-core/webpack.netcore.config.js__skip-if-exists__if_webpack delete mode 100644 skeleton/dotnet-core/wwwroot/favicon.ico__skip-if-exists delete mode 100644 skeleton/dotnet-core/wwwroot/index.html__ask-if-exists__if_cli-bundler delete mode 100644 skeleton/jest/README.md delete mode 100644 skeleton/jest/aurelia_project/tasks/jest.ext delete mode 100644 skeleton/jest/aurelia_project/tasks/jest.json delete mode 100644 skeleton/jest/aurelia_project/tasks/test.ext delete mode 100644 skeleton/jest/aurelia_project/tasks/test.json delete mode 100644 skeleton/jest/package.json delete mode 100644 skeleton/jest/test/jest-pretest.ext delete mode 100644 skeleton/jest/test__if_cli-bundler/mock-css.js__if_less_or_sass_or_stylus delete mode 100644 skeleton/karma/README.md delete mode 100644 skeleton/karma/aurelia_project/tasks/karma.ext delete mode 100644 skeleton/karma/aurelia_project__if_cli-bundler/tasks/karma.json delete mode 100644 skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.ext delete mode 100644 skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.json delete mode 100644 skeleton/karma/aurelia_project__if_webpack/tasks/karma.json delete mode 100644 skeleton/karma/aurelia_project__if_webpack/tasks/test.ext delete mode 100644 skeleton/karma/aurelia_project__if_webpack/tasks/test.json delete mode 100644 skeleton/karma/karma.conf.js__if_cli-bundler delete mode 100644 skeleton/karma/package.json delete mode 100644 skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_requirejs_or_alameda delete mode 100644 skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_systemjs delete mode 100644 skeleton/karma/test__if_cli-bundler/unit/setup.ext delete mode 100644 skeleton/karma/test__if_webpack/karma-bundle.js delete mode 100644 skeleton/karma/test__if_webpack/karma.conf.js delete mode 100644 skeleton/plugin/README.md delete mode 100644 skeleton/plugin/aurelia_project/aurelia.json delete mode 100644 skeleton/plugin/aurelia_project/tasks/build-plugin.ext delete mode 100644 skeleton/plugin/dev-app/app.ext delete mode 100644 skeleton/plugin/dev-app/app.html delete mode 100644 skeleton/plugin/dev-app/environment.ext delete mode 100644 skeleton/plugin/dev-app/main.ext delete mode 100644 skeleton/plugin/package.json delete mode 100644 skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.js__if_babel delete mode 100644 skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.ts__if_typescript delete mode 100644 skeleton/plugin/src/binding-behaviors__if_plugin-scaffold-basic/primary-click.ext delete mode 100644 skeleton/plugin/src/elements/hello-world.css__if_not_less_and_not_sass_and_not_stylus delete mode 100644 skeleton/plugin/src/elements/hello-world.ext delete mode 100644 skeleton/plugin/src/elements/hello-world.html delete mode 100644 skeleton/plugin/src/elements/hello-world.less__if_less delete mode 100644 skeleton/plugin/src/elements/hello-world.scss__if_sass delete mode 100644 skeleton/plugin/src/elements/hello-world.styl__if_stylus delete mode 100644 skeleton/plugin/src/index.ext delete mode 100644 skeleton/plugin/src/value-converters__if_plugin-scaffold-basic/upcase.ext delete mode 100644 skeleton/plugin/test__if_karma_or_jest/unit/.eslintrc__if_babel delete mode 100644 skeleton/plugin/test__if_karma_or_jest/unit/attributes__if_plugin-scaffold-basic/color.spec.ext delete mode 100644 skeleton/plugin/test__if_karma_or_jest/unit/binding-behaviors__if_plugin-scaffold-basic/primary-click.spec.ext delete mode 100644 skeleton/plugin/test__if_karma_or_jest/unit/elements/hello-world.spec.ext delete mode 100644 skeleton/plugin/test__if_karma_or_jest/unit/value-converters__if_plugin-scaffold-basic/upcase.spec.ext delete mode 100644 skeleton/protractor/README.md delete mode 100644 skeleton/protractor/aurelia_project/tasks/protractor.ext delete mode 100644 skeleton/protractor/aurelia_project/tasks/protractor.json delete mode 100644 skeleton/protractor/e2e/tsconfig.json__if_typescript delete mode 100644 skeleton/protractor/package.json delete mode 100644 skeleton/protractor/protractor.conf.js delete mode 100644 skeleton/scaffold-minimum/cypress__if_cypress/integration/app.e2e.ext delete mode 100644 skeleton/scaffold-minimum/e2e__if_protractor/demo.e2e.ext delete mode 100644 skeleton/scaffold-minimum/e2e__if_protractor/skeleton.po.ext delete mode 100644 skeleton/scaffold-minimum/e2e__if_protractor/welcome.po.ext delete mode 100644 skeleton/scaffold-minimum/src/app.ext delete mode 100644 skeleton/scaffold-minimum/src/app.html delete mode 100644 skeleton/scaffold-minimum/src/main.ext delete mode 100644 skeleton/scaffold-minimum/src/resources/index.ext delete mode 100644 skeleton/scaffold-minimum/test__if_karma_or_jest/unit/app.spec.ext delete mode 100644 skeleton/scaffold-navigation/aurelia_project__if_cli-bundler/aurelia.json delete mode 100644 skeleton/scaffold-navigation/cypress__if_cypress/integration/app.e2e.ext delete mode 100644 skeleton/scaffold-navigation/e2e__if_protractor/demo.e2e.ext delete mode 100644 skeleton/scaffold-navigation/e2e__if_protractor/skeleton.po.ext delete mode 100644 skeleton/scaffold-navigation/e2e__if_protractor/welcome.po.ext delete mode 100644 skeleton/scaffold-navigation/package.json delete mode 100644 skeleton/scaffold-navigation/src/app.ext delete mode 100644 skeleton/scaffold-navigation/src/app.html delete mode 100644 skeleton/scaffold-navigation/src/blur-image.ext delete mode 100644 skeleton/scaffold-navigation/src/child-router.ext delete mode 100644 skeleton/scaffold-navigation/src/child-router.html delete mode 100644 skeleton/scaffold-navigation/src/main.ext delete mode 100644 skeleton/scaffold-navigation/src/nav-bar.html delete mode 100644 skeleton/scaffold-navigation/src/resources/index.ext delete mode 100644 skeleton/scaffold-navigation/src/styles.css__if_not_less_and_not_sass_and_not_stylus delete mode 100644 skeleton/scaffold-navigation/src/styles.less__if_less delete mode 100644 skeleton/scaffold-navigation/src/styles.scss__if_sass delete mode 100644 skeleton/scaffold-navigation/src/styles.styl__if_stylus delete mode 100644 skeleton/scaffold-navigation/src/users.html delete mode 100644 skeleton/scaffold-navigation/src/welcome.html delete mode 100644 skeleton/scaffold-navigation/src__if_babel/users.js delete mode 100644 skeleton/scaffold-navigation/src__if_babel/welcome.js delete mode 100644 skeleton/scaffold-navigation/src__if_typescript/users.ts delete mode 100644 skeleton/scaffold-navigation/src__if_typescript/welcome.ts delete mode 100644 skeleton/scaffold-navigation/test__if_karma_or_jest/unit/.eslintrc__if_babel delete mode 100644 skeleton/scaffold-navigation/test__if_karma_or_jest/unit/app.spec.ext delete mode 100644 skeleton/scaffold-navigation/test__if_karma_or_jest/unit/child-router.spec.ext delete mode 100644 skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_babel/users.spec.js delete mode 100644 skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_typescript/users.spec.ts delete mode 100644 skeleton/vscode/.vscode/extensions.json delete mode 100644 skeleton/vscode/.vscode/launch.json__if_cli-bundler delete mode 100644 skeleton/vscode/.vscode/launch.json__if_webpack delete mode 100644 skeleton/vscode/.vscode/settings.json__if_typescript delete mode 100644 skeleton/vscode/jsconfig.json__if_babel delete mode 100644 skeleton/webpack/README.md delete mode 100644 skeleton/webpack/aurelia_project/aurelia.json delete mode 100644 skeleton/webpack/aurelia_project/tasks/build.ext delete mode 100644 skeleton/webpack/aurelia_project/tasks/build.json delete mode 100644 skeleton/webpack/aurelia_project/tasks/run.ext delete mode 100644 skeleton/webpack/aurelia_project/tasks/run.json delete mode 100644 skeleton/webpack/index.ejs delete mode 100644 skeleton/webpack/package.json delete mode 100644 skeleton/webpack/static/favicon.ico delete mode 100644 skeleton/webpack/webpack.config.js delete mode 100644 spec/lib/workflow/applicable.spec.js delete mode 100644 spec/lib/workflow/run-questionnaire.spec.js delete mode 100644 spec/lib/workflow/select-features.spec.js delete mode 100644 spec/lib/workflow/write-project/prepare-project.spec.js delete mode 100644 spec/lib/workflow/write-project/write-project.spec.js diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d6d38e8f7..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,308 +0,0 @@ -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# -workflows: - version: 2 - node-multi-build: - jobs: - - test_node_10 - - test_node_12 - - test_docker_1 - - test_docker_2 - - test_docker_3 - - test_docker_4 - - test_docker_5 - - test_docker_7 - - test_docker_8 - -version: 2 -jobs: - test_docker_1: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - # four scaffolding using webpack with various configurations - - run: au new first -u -s htmlmin-max,sass,postcss-typical,karma,cypress,docker && cd ./first && npm install && npm link aurelia-cli && npm run docker:build - - test_docker_2: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - - run: au new second -u -s http2,typescript,htmlmin-min,less,postcss-typical,jest,protractor,scaffold-navigation,docker && cd ./second && npm install && npm link aurelia-cli && npm run docker:build - - test_docker_3: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - # four scaffolding using webpack with various configurations - - run: au new third -u -s dotnet-core,typescript,htmlmin-max,stylus,postcss-basic,jest,protractor,docker && cd ./third && npm install && npm link aurelia-cli && npm run docker:build - - test_docker_4: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - # four scaffolding using webpack with various configurations - - run: au new forth -u -s http2,dotnet-core,htmlmin-min,sass,postcss-typical,karma,cypress,scaffold-navigation,docker && cd ./forth && npm install && npm link aurelia-cli && npm run docker:build - - test_docker_5: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - # four scaffolding using webpack with various configurations - - run: au new fifth -u -s cli-bundler,alameda,htmlmin-max,sass,postcss-typical,karma,cypress,docker && cd ./fifth && npm install && npm link aurelia-cli && npm run docker:build - - test_docker_7: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - # four scaffolding using webpack with various configurations - - run: au new seventh -u -s cli-bundler,alameda,dotnet-core,typescript,htmlmin-max,stylus,postcss-basic,jest,protractor,docker && cd ./seventh && npm install && npm link aurelia-cli && npm run docker:build - - test_docker_8: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - - setup_remote_docker: - version: 18.06.0-ce - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - # create aurelia-apps based on the current cli, and test them inside docker containers - - run: sudo npm link - - run: au new eighth -u -s cli-bundler,alameda,http2,dotnet-core,htmlmin-min,sass,postcss-typical,karma,cypress,scaffold-navigation,docker && cd ./eighth && npm install && npm link aurelia-cli && npm run docker:build - - test_node_10: - docker: - - image: circleci/node:10-browsers - - working_directory: ~/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - node10-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node10-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node10-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - - test_node_12: - docker: - - image: circleci/node:12-browsers - - working_directory: ~/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - node12-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - node12-dependencies- - - - run: npm install - - - save_cache: - paths: - - node_modules - key: node12-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: npm test - diff --git a/.eslintignore b/.eslintignore index 23de06f5b..238923f0e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,8 +1,2 @@ lib/build/amodro-trace -lib/build/concat-with-sourcemaps -lib/build/convert-source-map -lib/build/map-stream -lib/resolve -lib/colors -lib/resources dist diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index 7981008e8..f0bf158d3 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -1,53 +1,5 @@ # Acknowledgements -## colors (embedded) - -Original Library - - Copyright (c) Marak Squires - -Additional functionality - - Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. - - -## node-resolve (embedded) - -This software is released under the MIT license: - -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. - ## amodro-trace (embedded) MIT License @@ -72,192 +24,3 @@ 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. - -## esprima (embedded) - -Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -## concat-with-sourcemaps (embedded) - -Copyright (c) 2014, Florian Reiterer - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -## convert-source-map (embedded) - -Copyright 2013 Thorsten Lorenz. -All rights reserved. - -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. - -## window-size (embedded) - -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -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. - -## map-stream (embedded) - -The MIT License (MIT) - -Copyright (c) 2011 Dominic Tarr - -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. - -## rev-hash (embedded) - -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. - -## rev-path (embedded) - -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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. - -## mkdirp - -/* Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -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. */ diff --git a/DESCRIPTIVE_SKELETON.md b/DESCRIPTIVE_SKELETON.md deleted file mode 100644 index d15aaf5ed..000000000 --- a/DESCRIPTIVE_SKELETON.md +++ /dev/null @@ -1,59 +0,0 @@ -# Descriptive Skeleton - -The aurelia-cli offers loads of features out of the box, such as webpack, http2, sass and more. In this document you can find information on how to add new features. Don't worry, it's as easy as moving files or templates into a directory, something we call "descriptive skeletons". - -To add a new feature, follow these 3 steps. - -1. Add a new question to `au new` or extend existing questions by adding new options. This can all be done in the file `lib/workflow/questionnaire.js`. -2. New questions must be registered to `appFlow` in the `lib/workflow/select-features.js` file. You may need to update the test code in `spec/lib/workflow/select-features.spec.js`. -3. Add source files or templates to the `skeleton/` folder. More information on how to do this can be found below. - -## Explanation on features - -All the "features" of the aurelia-cli (webpack, or sass, or http2) are represented as simple strings (`'webpack'`, `'sass'`, `'http2'`). - -## Explanation on the `skeleton/` folder - -The `skeleton/` folder is organized in feature folders. - -1. The `skeleton/common/` folder is special, since it's included in every app. -2. Some features have their dedicated folder like `skeleton/cli-bundler/` and `skeleton/webpack/`. Not all features need a dedicated folder though, it depends on how complex the feature is. It's your choice on whether to create a dedicated folder for a new feature or to use existing ones. -3. Every sub-folder in the `skeleton/` folder provides a partial application skeleton. The aurelia-cli will merge them all together to create the final application. - -## Conditional files, folders or contents - -There are few ways to conditionally include a file or folder. This is done by giving files a specific, structured name. Files can be templates, allowing you to conditionally add parts to a file. - -Here are some tips: - -1. As described earlier, all files of features belong inside the `skeleton/` folder. -2. Within the `skeleton/` folder, you can apply a suffix to any file name, such as `common/.babbelrc.js__if_babel`. -3. Similarly, you can apply a suffix on any folder as well, such as `scaffold-minimum/test__if_karma_or_jest/`. Note the condition `karma_or_jest`. You can use `and`/`or`/`not` in the condition expression. The example will be interpreted as `karma || jest`. -4. Within any file, you can use [preprocess syntax](https://github.com/jsoverson/preprocess) to add (or omit) parts of the file. -5. When a file is given an extension of `.ext`, like `app.ext`, it will ultimately be translated into `app.js` or `app.ts` depending on whether user chose TypeScript. - -Need some examples? Have a look of the `skeleton/` folder, there are lots of features in there already. - -Because of the conventions described above, the scaffolding system is very flexible. For example, there are three folders within `skeleton/cli-bundler/aurelia_project/` folder: -``` -tasks/ -tasks__if_babel/ -tasks__if_typescript -``` -Folder contents will be merged together based on what options the user has selected. - -## Write policy - -This is designed mainly for dotnet and `au new --here` when there is an existing file in the target folder. - -1. You can use the suffix `__skip-if-exists`, `__append-if-exists`, `__ask-if-exists` on any file (not folder). -2. You can mix write policy suffix with conditional suffix in any order. For example, `file.ext__skip-if-exists__if_babel` is equivalent to `file.ext__if_babel__skip-if-exists`. -3. You can provide an instructions file for any file with `__skip-if-exists`. If the file is skipped, the instructions will be printed out on screen and will also be written to file `instructions.txt` in the final app. Some existing examples are `skeleton/dotnet-core/Views/Home/Index.cshtml__instructions` and `skeleton/dotnet-core/Views/Home/Index.cshtml__skip-if-exists`. - -## Three special files - -There are three special files in `skeleton/`: - -1. `package.json`: there are multiple `package.json` in various `skeleton/` sub-folders. They will be merged to together. The recommendation is to leave dependency versions as empty strings `"aurelia-cli": ""`. The CLI will use `lib/dependencies.json` to determine which version to use for the dependency. -2. `aurelia_project/aurelia.json`: similarly to the `package.json` file, `aurelia.json` files will also be merged together. -3. `README.md` files are concatenated together. diff --git a/README.md b/README.md index 50503123b..d5d9c81e2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Aurelia CLI +![CI](https://github.com/aurelia/cli/workflows/CI/badge.svg) [![npm Version](https://img.shields.io/npm/v/aurelia-cli.svg)](https://www.npmjs.com/package/aurelia-cli) [![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Twitter](https://img.shields.io/twitter/follow/aureliaeffect.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=aureliaeffect) @@ -17,14 +18,14 @@ Please see the [contributing guidelines](./CONTRIBUTING.md). ## Providing new feature to app skeleton -For contributors planning to add new features to the skeleton application, please see the [descriptive skeleton guide](./DESCRIPTIVE_SKELETON.md) guide. +Skeleton has been moved to a dedicated repo [aurelia/v1](https://github.com/aurelia/v1). ## Building 1. Clone the aurelia-cli: `git clone https://github.com/aurelia/cli.git` 2. Go into the cli directory: `cd cli` 3. Run `npm install` -4. Run build `npm run build` +4. Run build `npm run build` 5. Link the cli with: `npm link` 6. Create a new project with `au new` or use an existing project. The linked CLI will be used to create the project. 7. In the project directory, run `npm link aurelia-cli`. The linked CLI will then be used for `au` commands such as `au run` diff --git a/RELEASE_INSTRUCTIONS.md b/RELEASE_INSTRUCTIONS.md index 8787be153..ca03409f3 100644 --- a/RELEASE_INSTRUCTIONS.md +++ b/RELEASE_INSTRUCTIONS.md @@ -1,22 +1,4 @@ -### 1. Release checks -This is an automated testing tool for projects that were generated by the Aurelia-CLI. It tests all "au" commands for every project. +### Prepare release -1. open the terminal, go into an empty directory and run `au generate-skeletons` -2. from the CLI repository folder, run `gulp release-check --path C:/Development/Aurelia/TestApps --latest-cli-url aurelia/cli#master`, substituting the path with the correct one. - * Note, on Windows, run PowerShell with "run as administrator". -3. Select for which projects you would like to run the tests. - * To test all projects automatically, add `--all` to previous command. - * To test subset projects automatically, add `--select requirejs,babel` (only tests projects using requirejs and babel) to previous command. -4. Wait until tests complete -5. in the CLI repository folder there is now a release-checks-results folder containing the output and other artifacts, such as screenshots. Check these screenshots to make sure that pages have rendered correctly - -### Add new tests -In the build/tasks/release-checks folder is a suite-steps.js file. This file contains a collection of tests per project. New tests can be added to this file. - -### Todo -- Tests for dotnet projects (the tool can run dotnet new, but dotnet does not serve the index.html file that exists in wwwrooot) - -### 2. Prepare release - -1. run `gulp prepare-release --bump major|minor|patch|prerelease`. This will update aurelia-cli version, update change log, update cli version in `lib/dependencies.json`. +1. run `gulp prepare-release --bump major|minor|patch|prerelease`. This will update aurelia-cli version, update change log 2. do `npm publish`. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ec1636be2..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: '1.1.2.{build}' -image: Windows Server 2019 - -environment: - nodejs_version: "12" -platform: - - Any CPU - -init: - - ps: git config --global core.autocrlf input - - -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node.js or io.js - - ps: Install-Product node $env:nodejs_version - # install modules - - npm install --global npm@latest - - set PATH=%APPDATA%\npm;%PATH% - - npm install - - docker version - - node --version - - npm --version - -before_build: - - npm run test - -build_script: - - npm run build - - npm link - -test_script: - - ps: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All - - docker-switch-linux - - au new sixth -u -s cli-bundler,alameda,http2,typescript,htmlmin-min,less,postcss-typical,jest,protractor,scaffold-navigation,docker - - cd ./sixth - - npm install - - npm link aurelia-cli - - npm run docker:build -cache: - - '%APPDATA%\npm-cache' - -on_success: - - ps: Write-Host "All Done" -ForegroundColor DarkGreen -BackgroundColor White diff --git a/bin/aurelia-cli.js b/bin/aurelia-cli.js index 896a984fb..22b8fadc0 100755 --- a/bin/aurelia-cli.js +++ b/bin/aurelia-cli.js @@ -4,9 +4,9 @@ const resolve = require('resolve'); const semver = require('semver'); const nodeVersion = process.versions.node; -if (semver.lt(nodeVersion, '8.9.0')) { +if (semver.lt(nodeVersion, '10.12.0')) { console.error(`You are running Node.js v${nodeVersion}. -aurelia-cli requires Node.js v8.9.0 or above. +aurelia-cli requires Node.js v10.12.0 or above. Please upgrade to latest Node.js https://nodejs.org`); process.exit(1); } diff --git a/build/tasks/prepare-release.js b/build/tasks/prepare-release.js index 479fa7ac1..5d819c754 100644 --- a/build/tasks/prepare-release.js +++ b/build/tasks/prepare-release.js @@ -18,6 +18,5 @@ gulp.task('changelog', function() { gulp.task('prepare-release', gulp.series( 'lint', 'bump-version', - 'changelog', - 'update-cli-dependenciesjs' + 'changelog' )); diff --git a/build/tasks/release-check.js b/build/tasks/release-check.js deleted file mode 100644 index 9f13364da..000000000 --- a/build/tasks/release-check.js +++ /dev/null @@ -1,87 +0,0 @@ -const gulp = require('gulp'); -const path = require('path'); -const SuiteRunner = require('./release-checks/suite-runner'); -const LogManager = require('aurelia-logging'); -const Utils = require('../../lib/build/utils'); -const {MessageHistoryLogger} = require('./release-checks/message-history-logger'); -const TestProjectsSelector = require('./release-checks/test-projects-selector'); -const Reporter = require('./release-checks/reporter'); -const del = require('del'); -const ConsoleUI = require('../../lib/ui').ConsoleUI; -const ui = new ConsoleUI(); -const c = require('ansi-colors'); - -let logger; -let msgHistoryLogger; -let originalDir = process.cwd(); -let resultOutputFolder = path.join(originalDir, 'release-checks-results'); - -gulp.task('empty-release-checks-results-folder', () => { - return del([ - resultOutputFolder + '/**/*' - ]); -}); - -gulp.task('release-check', gulp.series( - 'empty-release-checks-results-folder', - async function() { - configureLogging(); - - // turn off cypress video for reliable release-check - process.env.CYPRESS_VIDEO = 'false'; - - const reporter = new Reporter(); - const selector = new TestProjectsSelector(); - - const {testDir, dirs} = await selector.execute(); - const testSuitesResults = await Utils.runSequentially( - dirs, - async(dir, i) => { - logger.info(c.inverse(`Executing ${i + 1}/${dirs.length} ${dir}`)); - - const context = { - suite: dir, - resultOutputFolder: path.join(resultOutputFolder, dir), - workingDirectory: path.join(testDir, dir) - }; - const suiteRunner = new SuiteRunner(context, reporter); - - try { - const result = await suiteRunner.run(); - await writeLog(context.resultOutputFolder, 'log-full.txt'); - return result; - } catch (e) { - logger.error(e); - throw e; - } - } - ); - - if (testSuitesResults.length > 1) { - console.log('---------------------------'); - console.log('---------------------------'); - console.log('--------SUMMARY-----------'); - console.log('---------------------------'); - console.log('---------------------------'); - - for (const result of testSuitesResults) { - reporter.logSummary(result.suite, result.steps); - } - } - - await writeLog(resultOutputFolder, 'summary.txt'); - } -)); - -async function writeLog(dir, name) { - const filePath = path.join(dir, name); - await msgHistoryLogger.writeToDisk(filePath); - await msgHistoryLogger.clearHistory(); -} - -function configureLogging() { - msgHistoryLogger = new MessageHistoryLogger(ui); - LogManager.addAppender(msgHistoryLogger); - LogManager.setLevel('debug'); - logger = LogManager.getLogger('Release-Check'); -} diff --git a/build/tasks/release-checks/message-history-logger.js b/build/tasks/release-checks/message-history-logger.js deleted file mode 100644 index f52d89134..000000000 --- a/build/tasks/release-checks/message-history-logger.js +++ /dev/null @@ -1,46 +0,0 @@ -const fs = require('../../../lib/file-system'); - -exports.MessageHistoryLogger = class { - constructor(ui) { - this.ui = ui; - this.messages = []; - } - - debug(logger, message) { - this.log(logger, 'DEBUG', message, arguments); - } - - info(logger, message) { - this.log(logger, 'INFO', message, arguments); - } - - warn(logger, message) { - this.log(logger, 'WARN', message, arguments); - } - - error(logger, message) { - this.log(logger, 'ERROR', message, arguments); - } - - log(logger, level, message, rest) { - let msg = `${level} ${message}`; - let args = Array.prototype.slice.call(rest, 2); - - if (args.length > 0) { - msg += ` ${args.map(x => JSON.stringify(x)).join(' ')}`; - } - - this.messages.push(msg); - - this.ui.log(msg); - } - - writeToDisk(filePath) { - console.log('writing to ' + filePath); - return fs.writeFile(filePath, this.messages.join('\r\n'), 'utf-8'); - } - - clearHistory() { - this.messages = []; - } -}; diff --git a/build/tasks/release-checks/reporter.js b/build/tasks/release-checks/reporter.js deleted file mode 100644 index 89134a4a7..000000000 --- a/build/tasks/release-checks/reporter.js +++ /dev/null @@ -1,32 +0,0 @@ -const LogManager = require('aurelia-logging'); -const logger = LogManager.getLogger('Runner'); - -module.exports = class Reporter { - starting(context) { - const suite = context.suite; - logger.info('***********RUNNING SUITE************'); - logger.info(`*** Suite: ${suite}`); - logger.info(`*** Project: ${context.workingDirectory}`); - logger.info('************************************'); - } - - finished(steps, context) { - const suite = context.suite; - this.logSummary(suite, steps); - } - - logSummary(suite, steps) { - logger.info('************* RESULT ***************'); - logger.info(`*** Suite: ${suite}`); - logger.info('************************************'); - - logger.info('Executed tasks:'); - for (const task of steps.filter(x => x.type === 'task')) { - logger.info(`- [SUCCESS] ${task.getTitle()}`); - } - logger.info('Executed tests:'); - for (const test of steps.filter(x => x.type === 'test')) { - logger.info(`- [${test.getResultText()}] ${test.getTitle()}`); - } - } -}; diff --git a/build/tasks/release-checks/step-runner.js b/build/tasks/release-checks/step-runner.js deleted file mode 100644 index 0c5649481..000000000 --- a/build/tasks/release-checks/step-runner.js +++ /dev/null @@ -1,15 +0,0 @@ -const LogManager = require('aurelia-logging'); -const logger = LogManager.getLogger('StepRunner'); -const c = require('ansi-colors'); - -module.exports = class StepRunner { - constructor(step, context = null) { - this.step = step; - this.context = context; - } - - run() { - logger.info(c.inverse(`Executing ${this.step.getTitle()}`)); - return this.step.execute(this.context); - } -}; diff --git a/build/tasks/release-checks/step.js b/build/tasks/release-checks/step.js deleted file mode 100644 index 16fe2a7a1..000000000 --- a/build/tasks/release-checks/step.js +++ /dev/null @@ -1,21 +0,0 @@ -const LogManager = require('aurelia-logging'); -const _ = require('lodash'); - -module.exports = class Step { - constructor(title) { - this.logger = LogManager.getLogger(title); - this.title = title; - } - - execute() { - throw new Error('not implemented'); - } - - getTitle() { - throw new Error('not implemented'); - } - - debug(message) { - this.logger.debug(_.trimEnd(message)); - } -}; diff --git a/build/tasks/release-checks/suite-runner.js b/build/tasks/release-checks/suite-runner.js deleted file mode 100644 index 326142bc8..000000000 --- a/build/tasks/release-checks/suite-runner.js +++ /dev/null @@ -1,30 +0,0 @@ -const Utils = require('../../../lib/build/utils'); -const suiteSteps = require('./suite-steps'); -const StepRunner = require('./step-runner'); -const fs = require('../../../lib/file-system'); - -module.exports = class SuiteRunner { - constructor(context, reporter) { - this.context = context; - this.reporter = reporter; - } - - async run() { - if (!fs.existsSync(this.context.resultOutputFolder)) { - await fs.mkdirp(this.context.resultOutputFolder); - } - const {suite} = this.context; - - this.reporter.starting(this.context); - - const steps = await Utils.runSequentially(suiteSteps(suite), - async(step) => { - const runner = new StepRunner(step, this.context); - await runner.run(); - return step; - }); - - this.reporter.finished(steps, this.context); - return {steps: steps, suite: suite}; - } -}; diff --git a/build/tasks/release-checks/suite-steps.js b/build/tasks/release-checks/suite-steps.js deleted file mode 100644 index 4cc3fae1e..000000000 --- a/build/tasks/release-checks/suite-steps.js +++ /dev/null @@ -1,91 +0,0 @@ -const path = require('path'); -const tasks = require('./tasks/index'); -const tests = require('./tests/index'); -const applicable = require('../../../lib/workflow/applicable'); - -module.exports = function(suite) { - const features = suite.split('_'); - const ext = applicable(features, 'typescript') ? '.ts' : '.js'; - const plugin = applicable(features, 'plugin'); - - const steps = [ - new tasks.ChangeDirectory(), - new tasks.InstallNodeModules(), - new tasks.InstallLatestAureliaCLI(), - new tests.generic.AuGenerateAttributeTests(ext, plugin), - new tests.generic.AuGenerateElementTests(ext, plugin), - new tests.generic.AuGenerateValueConverterTests(ext, plugin), - new tests.generic.AuGenerateBindingBehaviorTests(ext, plugin), - new tests.generic.AuGenerateTaskTests(ext, plugin), - new tests.generic.AuGenerateGeneratorTests(ext, plugin) - ]; - - if (!plugin) { - steps.push(new tests.generic.AuGenerateComponentTests(ext)); - } else { - steps.push(new tests.plugin.AuBuildPluginDoesNotThrowCommandLineErrors()); - } - - if (applicable(features, 'jest')) { - steps.push( - new tests.generic.AuJestRunsTests() - ); - } - - if (applicable(features, 'karma')) { - steps.push( - new tests.generic.AuKarmaRunsTests() - ); - } - - if (applicable(features, 'protractor')) { - steps.push( - new tests.generic.AuProtractorRunsTests() - ); - } - - if (applicable(features, 'cypress')) { - steps.push( - new tests.generic.AuCypressRunsTests() - ); - } - - if (applicable(features, 'cli-bundler')) { - steps.push( - new tests.requirejs.AuBuildDoesNotThrowCommandLineErrors(), - new tests.requirejs.AuBuildWatchPicksUpFileChanges(plugin ? path.join('dev-app', 'app.html') : undefined), - new tests.requirejs.AuRunDoesNotThrowCommandLineErrors(), - new tests.requirejs.AuRunLaunchesServer(), - new tests.requirejs.AuRunWatchPicksUpFileChanges(plugin ? path.join('dev-app', 'app.html') : undefined), - new tests.requirejs.AuRunAppLaunchesWithoutJavascriptErrors(), - new tests.requirejs.AuRunRendersPage(), - new tests.generic.AuLintFinishes() - ); - } - - if (applicable(features, 'webpack')) { - steps.push( - new tests.webpack.AuBuildDoesNotThrowCommandLineErrors(), - new tests.webpack.AuBuildStartsWebpackInWatchMode(), - new tests.webpack.AuRunDoesNotThrowCommandLineErrors(), - new tests.webpack.AuRunLaunchesServer(), - new tests.webpack.AuRunRendersPage(), - new tests.webpack.AuRunAppLaunchesWithoutJavascriptErrors(), - new tests.webpack.AuRunWatchPicksUpFileChanges() - ); - } - - // if (applicable(features, 'dotnet-core')) { - // steps.push( - // // todo: dotnet project should serve the index.html from wwwroot, not a view on the server - // new tasks.DotNetNewWeb(), - // new tests.generic.dotnet.DotNetRunDoesNotThrowCommandLineErrors(), - // new tests.generic.dotnet.DotNetRunLaunchesServer(), - // new tests.generic.dotnet.DotnetRunRendersPage(), - // new tests.generic.dotnet.DotNetRunAppLaunchesWithoutJavascriptErrors(), - // new tests.generic.AuProtractorRunsTestsDotNet() - // ); - // } - - return steps; -}; diff --git a/build/tasks/release-checks/tasks/change-dir.js b/build/tasks/release-checks/tasks/change-dir.js deleted file mode 100644 index eb473e0a1..000000000 --- a/build/tasks/release-checks/tasks/change-dir.js +++ /dev/null @@ -1,14 +0,0 @@ -const Task = require('./task'); -const LogManager = require('aurelia-logging'); -const logger = LogManager.getLogger('change-dir'); - -module.exports = class ChangeDirectory extends Task { - constructor() { - super('Change directory'); - } - - execute(context) { - logger.debug('changing directory to ' + context.workingDirectory); - process.chdir(context.workingDirectory); - } -}; diff --git a/build/tasks/release-checks/tasks/check-javascript-errors.js b/build/tasks/release-checks/tasks/check-javascript-errors.js deleted file mode 100644 index 3fec71766..000000000 --- a/build/tasks/release-checks/tasks/check-javascript-errors.js +++ /dev/null @@ -1,47 +0,0 @@ -const Task = require('./task'); -const puppeteer = require('puppeteer'); -const PUPPETEER_TIMEOUT = 5000; - -module.exports = class CheckJavascriptErrors extends Task { - constructor(url) { - super('Check javascript errors'); - - this.url = url; - } - - execute() { - return new Promise((resolve, reject) => { - puppeteer.launch() - .then(browser => { - return browser.newPage() - .then(page => { - page.on('error', err=> { - reject(`error: ${err}`); - }); - - page.on('pageerror', pageerr=> { - reject(`page error: ${pageerr}`); - }); - - page.on('console', msg => { - if (msg.text().indexOf('error') > -1) { - reject('page error' + msg.text()); - } - }); - - return page.goto(this.url) - .then(() => { - setTimeout(() => { - return browser.close() - .then(resolve); - }, PUPPETEER_TIMEOUT); - }).catch(reject); - }); - }); - }); - } - - getTitle() { - return super.getTitle() + ` (url: ${this.url})`; - } -}; diff --git a/build/tasks/release-checks/tasks/dotnet-new-web.js b/build/tasks/release-checks/tasks/dotnet-new-web.js deleted file mode 100644 index 8c69b1cb8..000000000 --- a/build/tasks/release-checks/tasks/dotnet-new-web.js +++ /dev/null @@ -1,20 +0,0 @@ -const Task = require('./task'); -const ExecuteCommand = require('./execute-command'); -const fs = require('fs'); -const path = require('path'); - -module.exports = class DotNetNewWeb extends Task { - constructor() { - super('dotnet new web'); - } - - execute(context) { - if (fs.existsSync(path.join(context.workingDirectory, 'Startup.cs'))) { - this.logger.info('Startup.cs exists in project directory, skipping dotnet new'); - return Promise.resolve(); - } - - this.executeCommand = new ExecuteCommand('dotnet', ['new', 'web', '--force']); - return this.executeCommand.execute(); - } -}; diff --git a/build/tasks/release-checks/tasks/execute-command.js b/build/tasks/release-checks/tasks/execute-command.js deleted file mode 100644 index aa5101e33..000000000 --- a/build/tasks/release-checks/tasks/execute-command.js +++ /dev/null @@ -1,68 +0,0 @@ -const Task = require('./task'); -const { spawn } = require('child_process'); -const os = require('os'); - -module.exports = class ExecuteCommand extends Task { - constructor(command, parameters, outputCallback, errorCallback, closeCallback) { - super('Execute command'); - - this.command = command; - this.ignoreStdErr = false; - this.parameters = parameters; - this.outputCallback = outputCallback; - this.errorCallback = errorCallback; - this.closeCallback = closeCallback; - - if (!this.errorCallback) { - this.errorCallback = () => this.stop(); - } - if (!this.closeCallback) { - this.closeCallback = () => this.stop(); - } - } - - execute() { - this.proc = spawn(this.command, this.parameters); - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - - this.proc.stdout.on('data', (data) => { - this.outputCallback(this.stripANSI(data.toString())); - }); - - this.proc.stderr.on('data', (data) => { - if (!this.ignoreStdErr) { - const str = this.stripANSI(data.toString()); - // nodejs v12 DeprecationWarning - if (str.includes('DeprecationWarning')) return; - - this.outputCallback(str); - this.errorCallback(str); - } - }); - - this.proc.on('close', (code) => { - this.closeCallback(code); - }); - - return this.promise; - } - - stripANSI(input) { - return input.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, ''); - } - - executeAsNodeScript() { - if (os.platform() === 'win32' && !this.command.endsWith('.cmd')) { - this.command += '.cmd'; - } - - return this.execute(); - } - - getTitle() { - return super.getTitle() + ` (command: ${this.command} ${this.parameters.join(' ')})`; - } -}; diff --git a/build/tasks/release-checks/tasks/index.js b/build/tasks/release-checks/tasks/index.js deleted file mode 100644 index b6c15848d..000000000 --- a/build/tasks/release-checks/tasks/index.js +++ /dev/null @@ -1,15 +0,0 @@ -const InstallNodeModules = require('./install-node-modules'); -const ChangeDirectory = require('./change-dir'); -const ExecuteCommand = require('./execute-command'); -const TakeScreenShotOfPage = require('./take-screenshot-of-page'); -const InstallLatestAureliaCLI = require('./install-latest-aurelia-cli'); -const DotNetNewWeb = require('./dotnet-new-web'); - -module.exports = { - InstallNodeModules, - ChangeDirectory, - ExecuteCommand, - TakeScreenShotOfPage, - InstallLatestAureliaCLI, - DotNetNewWeb -}; diff --git a/build/tasks/release-checks/tasks/install-latest-aurelia-cli.js b/build/tasks/release-checks/tasks/install-latest-aurelia-cli.js deleted file mode 100644 index 0c72479ff..000000000 --- a/build/tasks/release-checks/tasks/install-latest-aurelia-cli.js +++ /dev/null @@ -1,42 +0,0 @@ -const Task = require('./task'); -const Yarn = require('../../../../lib/package-managers/yarn').Yarn; -const LogManager = require('aurelia-logging'); -const logger = LogManager.getLogger('link-aurelia-cli'); -const CLIOptions = require('../../../../lib/cli-options').CLIOptions; -const cliOptions = new CLIOptions(); -const ConsoleUI = require('../../../../lib/ui').ConsoleUI; -const ui = new ConsoleUI(); - -let userArgs = process.argv.slice(2); -Object.assign(cliOptions, { - args: userArgs.slice(1) -}); - -module.exports = class InstallLatestAureliaCLI extends Task { - constructor() { - super('Install latest Aurelia-CLI'); - } - - onOutput(message) { - this.logger.debug(message); - } - - async determineURL() { - if (cliOptions.hasFlag('latest-cli-url')) { - return cliOptions.getFlagValue('latest-cli-url'); - } - - return await ui.question( - 'Git URL of targeted Aurelia-CLI', - 'aurelia/cli#master' - ); - } - - async execute(context) { - const forkUrl = await this.determineURL(); - logger.debug('Install latest Aurelia-CLI (' + forkUrl + ') ' + context.workingDirectory); - - const yarn = new Yarn(); - return yarn.install([forkUrl], context.workingDirectory); - } -}; diff --git a/build/tasks/release-checks/tasks/install-node-modules.js b/build/tasks/release-checks/tasks/install-node-modules.js deleted file mode 100644 index 1e82e3e43..000000000 --- a/build/tasks/release-checks/tasks/install-node-modules.js +++ /dev/null @@ -1,24 +0,0 @@ -const Task = require('./task'); -const Yarn = require('../../../../lib/package-managers/yarn').Yarn; -const LogManager = require('aurelia-logging'); -const logger = LogManager.getLogger('install-node-modules'); -const fs = require('fs'); -const path = require('path'); - -module.exports = class InstallNodeModules extends Task { - constructor() { - super('Install node modules'); - } - - execute(context) { - if (fs.existsSync(path.join(context.workingDirectory, 'node_modules'))) { - logger.info('node_modules folder exists in the project directory, not installing node_modules again'); - return Promise.resolve(); - } - - logger.debug('installing packages in ' + context.workingDirectory); - - const yarn = new Yarn(); - return yarn.install([], context.workingDirectory); - } -}; diff --git a/build/tasks/release-checks/tasks/take-screenshot-of-page.js b/build/tasks/release-checks/tasks/take-screenshot-of-page.js deleted file mode 100644 index 16fc364f5..000000000 --- a/build/tasks/release-checks/tasks/take-screenshot-of-page.js +++ /dev/null @@ -1,43 +0,0 @@ -const Task = require('./task'); -const puppeteer = require('puppeteer'); -const PUPPETEER_TIMEOUT = 5000; - -module.exports = class TakeScreenShotOfPage extends Task { - constructor(url, path) { - super('Take screenshot of page'); - - this.url = url; - this.path = path; - } - - execute() { - return new Promise((resolve, reject) => { - puppeteer.launch() - .then(browser => { - return browser.newPage() - .then(page => { - page.on('error', err=> { - reject(`error: ${err}`); - }); - - page.on('pageerror', pageerr=> { - reject(`page error: ${pageerr}`); - }); - - return page.goto(this.url) - .then(() => { - setTimeout(() => { - return page.screenshot({path: this.path}) - .then(() => browser.close()) - .then(resolve); - }, PUPPETEER_TIMEOUT); - }).catch(reject); - }); - }); - }); - } - - getTitle() { - return super.getTitle() + ` (url: ${this.url})`; - } -}; diff --git a/build/tasks/release-checks/tasks/task.js b/build/tasks/release-checks/tasks/task.js deleted file mode 100644 index bbfb45ec5..000000000 --- a/build/tasks/release-checks/tasks/task.js +++ /dev/null @@ -1,28 +0,0 @@ -const Step = require('../step'); -const kill = require('tree-kill'); - -module.exports = class Task extends Step { - constructor(title) { - super(title); - this.type = 'task'; - } - - execute() { - return Promise.resolve(); - } - - getTitle() { - return `[TASK] ${this.title}`; - } - - stop() { - kill(this.proc.pid, err => { - // ignore windows taskkill error. - if (err && process.platform !== 'win32') { - this.reject && this.reject(err); - } else { - this.resolve && this.resolve(); - } - }); - } -}; diff --git a/build/tasks/release-checks/test-projects-selector.js b/build/tasks/release-checks/test-projects-selector.js deleted file mode 100644 index 52321fad7..000000000 --- a/build/tasks/release-checks/test-projects-selector.js +++ /dev/null @@ -1,62 +0,0 @@ -const CLIOptions = require('../../../lib/cli-options').CLIOptions; -const cliOptions = new CLIOptions(); -const fs = require('../../../lib/file-system'); -const path = require('path'); -const _ = require('lodash'); - -let userArgs = process.argv.slice(2); -Object.assign(cliOptions, { - args: userArgs.slice(1) -}); - -const ConsoleUI = require('../../../lib/ui').ConsoleUI; -const ui = new ConsoleUI(); - -module.exports = class TestProjectsSelector { - getSubDirs(dir) { - if (!fs.existsSync(dir)) { - throw new Error('The path does not exist'); - } - - // list all subdirs in the provided directory - const dirs = fs.readdirSync(dir) - .filter(d => fs.isDirectory(path.join(dir, d))); - - return dirs; - } - - async determineDir() { - if (cliOptions.hasFlag('path')) { - return cliOptions.getFlagValue('path'); - } - - return ui.question('Which directory contains all the projects to test?'); - } - - async execute() { - const dir = await this.determineDir(); - let dirs = await this.getSubDirs(dir); - - if (dirs.length === 0) throw new Error('No subdirectory to test.'); - - if (cliOptions.hasFlag('select')) { - const selectedFeatures = cliOptions.getFlagValue('select').split(','); - dirs = dirs.filter(d => { - const features = d.split('_'); - return _.every(selectedFeatures, f => _.includes(features, f)); - }); - } else if (!cliOptions.hasFlag('all')) { - dirs = await this.choose(dirs); - } - - return {testDir: dir, dirs}; - } - - async choose(dirs) { - let options = dirs.map(x => ({displayName: x})); - options.unshift({displayName: 'All'}); - - const answers = await ui.multiselect('Found test dirs.\r\nWhich would you like to run?', options); - return answers.includes('All') ? dirs : answers; - } -}; diff --git a/build/tasks/release-checks/tests/generic/au-cypress.js b/build/tasks/release-checks/tests/generic/au-cypress.js deleted file mode 100644 index 295f72159..000000000 --- a/build/tasks/release-checks/tests/generic/au-cypress.js +++ /dev/null @@ -1,88 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); - -class AuCypressRunsTests extends Test { - constructor() { - super('au cypress runs tests'); - } - - onCypressOutput(message) { - this.debug(message); - - if (isCypressCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - this.cypressCommand.stop(); - } else if (isCypressFailedMessage(message)) { - this.fail(); - this.executeCommand.stop(); - this.cypressCommand.stop(); - } - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.cypressCommand) { - this.cypressCommand = new ExecuteCommand('au', ['cypress', '--run'], (msg) => this.onCypressOutput(msg), (msg) => this.onCypressOutput(msg)); - return this.cypressCommand.executeAsNodeScript(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuCypressRunsTestsDotNet extends Test { - constructor() { - super('au cypress (dotnet run) runs tests'); - } - - onCypressOutput(message) { - this.debug(message); - - if (isCypressCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - this.cypressCommand.stop(); - } else if (isCypressFailedMessage(message)) { - this.fail(); - this.executeCommand.stop(); - this.cypressCommand.stop(); - } - } - - onOutput(message) { - this.debug(message); - - if (message.indexOf('Now listening on: http://') > -1 && !this.cypressCommand) { - this.cypressCommand = new ExecuteCommand('au', ['cypress', '--run'], (msg) => this.onCypressOutput(msg), (msg) => this.onCypressOutput(msg)); - return this.cypressCommand.executeAsNodeScript(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('dotnet', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.execute(); - } -} - -function isApplicationAvailableMessage(msg) { - return msg.indexOf('Application Available At: http://') > -1 || - msg.indexOf('Project is running at http://') > -1; -} - -function isCypressCompletedMessage(msg) { - return msg.indexOf('All specs passed') > -1; -} - -function isCypressFailedMessage(msg) { - return msg.indexOf('failed') > -1; -} - -module.exports = { - AuCypressRunsTests, - AuCypressRunsTestsDotNet -}; diff --git a/build/tasks/release-checks/tests/generic/au-generate.js b/build/tasks/release-checks/tests/generic/au-generate.js deleted file mode 100644 index 07d75e9d3..000000000 --- a/build/tasks/release-checks/tests/generic/au-generate.js +++ /dev/null @@ -1,119 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); -const fs = require('../../../../../lib/file-system'); -const path = require('path'); -const _ = require('lodash'); - -class AuGenerateTests extends Test { - constructor(objectType, ext, plugin) { - super(`au generate ${objectType}, writes ${objectType} file`); - this.objectType = objectType; - this.plugin = plugin; - this.ext = ext; - this.onFinish = this.onFinish.bind(this); - } - - onFinish(message) { - this.debug(message); - - if (_.every(this.createdFiles(), fs.isFile)) { - this.success(); - this.executeCommand.stop(); - } - } - - createdFiles() { - if (this.objectType === 'component') { - return [ - path.join('src', 'new-thing.html'), - path.join('src', `new-thing${this.ext}`) - ]; - } else if (this.objectType === 'element') { - if (this.plugin) { - return [ - path.join('src', 'elements', 'new-thing.html'), - path.join('src', 'elements', `new-thing${this.ext}`) - ]; - } - return [ - path.join('src', 'resources', 'elements', 'new-thing.html'), - path.join('src', 'resources', 'elements', `new-thing${this.ext}`) - ]; - } else if (this.objectType === 'task' || this.objectType === 'generator') { - return [path.join('aurelia_project', this.objectType + 's', `new-thing${this.ext}`)]; - } - if (this.plugin) { - return [path.join('src', this.objectType + 's', `new-thing${this.ext}`)]; - } - return [path.join('src', 'resources', this.objectType + 's', `new-thing${this.ext}`)]; - } - - additionalArguments() { - if (this.objectType === 'component') { - return ['NewThing', '.']; - } - return ['NewThing']; - } - - execute() { - this.executeCommand = new ExecuteCommand( - 'au', ['generate', this.objectType, ...this.additionalArguments()], - this.onFinish, - this.onFinish - ); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuGenerateAttributeTests extends AuGenerateTests { - constructor(ext, plugin) { - super('attribute', ext, plugin); - } -} - -class AuGenerateComponentTests extends AuGenerateTests { - constructor(ext, plugin) { - super('component', ext, plugin); - } -} - -class AuGenerateElementTests extends AuGenerateTests { - constructor(ext, plugin) { - super('element', ext, plugin); - } -} - -class AuGenerateValueConverterTests extends AuGenerateTests { - constructor(ext, plugin) { - super('value-converter', ext, plugin); - } -} - -class AuGenerateBindingBehaviorTests extends AuGenerateTests { - constructor(ext, plugin) { - super('binding-behavior', ext, plugin); - } -} - -class AuGenerateTaskTests extends AuGenerateTests { - constructor(ext, plugin) { - super('task', ext, plugin); - } -} - -class AuGenerateGeneratorTests extends AuGenerateTests { - constructor(ext, plugin) { - super('generator', ext, plugin); - } -} - - -module.exports = { - AuGenerateAttributeTests, - AuGenerateComponentTests, - AuGenerateElementTests, - AuGenerateValueConverterTests, - AuGenerateBindingBehaviorTests, - AuGenerateTaskTests, - AuGenerateGeneratorTests -}; diff --git a/build/tasks/release-checks/tests/generic/au-jest.js b/build/tasks/release-checks/tests/generic/au-jest.js deleted file mode 100644 index d4ae64aec..000000000 --- a/build/tasks/release-checks/tests/generic/au-jest.js +++ /dev/null @@ -1,31 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); - -class AuJestRunsTests extends Test { - constructor() { - super('au test runs jest tests'); - } - - onOutput(message) { - this.debug(message); - - if (isTestFinishedMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - // https://github.com/facebook/jest/issues/5064 - this.executeCommand = new ExecuteCommand('au', ['test'], (msg) => this.onOutput(msg), (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isTestFinishedMessage(msg) { - return /(.*) passed, (.*) total/.test(msg); -} - -module.exports = { - AuJestRunsTests -}; diff --git a/build/tasks/release-checks/tests/generic/au-karma.js b/build/tasks/release-checks/tests/generic/au-karma.js deleted file mode 100644 index 97c4656fa..000000000 --- a/build/tasks/release-checks/tests/generic/au-karma.js +++ /dev/null @@ -1,30 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); - -class AuKarmaRunsTests extends Test { - constructor() { - super('au test runs karma tests'); - } - - onOutput(message) { - this.debug(message); - - if (isTestFinishedMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['test'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isTestFinishedMessage(msg) { - return /TOTAL: (.*) SUCCESS/.test(msg); -} - -module.exports = { - AuKarmaRunsTests -}; diff --git a/build/tasks/release-checks/tests/generic/au-lint.js b/build/tasks/release-checks/tests/generic/au-lint.js deleted file mode 100644 index 572624741..000000000 --- a/build/tasks/release-checks/tests/generic/au-lint.js +++ /dev/null @@ -1,38 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); - -class AuLintFinishes extends Test { - constructor() { - super('au lint finishes'); - } - - onOutput(message) { - this.debug(message); - - if (isTestFinishedMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - if (isErrorMessage(message)) { - this.fail(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['lint'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isTestFinishedMessage(msg) { - return msg.indexOf('Finished \'lint\'') > -1; -} - -function isErrorMessage(msg) { - return !!msg.match(/\([1-9]\d*\s+errors/); -} - -module.exports = { - AuLintFinishes -}; diff --git a/build/tasks/release-checks/tests/generic/au-protractor.js b/build/tasks/release-checks/tests/generic/au-protractor.js deleted file mode 100644 index bacb3a958..000000000 --- a/build/tasks/release-checks/tests/generic/au-protractor.js +++ /dev/null @@ -1,78 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); - -class AuProtractorRunsTests extends Test { - constructor() { - super('au protractor runs tests'); - } - - onProtractorOutput(message) { - this.debug(message); - - if (isProtractorCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - this.protractorCommand.stop(); - } - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.protractorCommand) { - this.protractorCommand = new ExecuteCommand('au', ['protractor'], (msg) => this.onProtractorOutput(msg)); - this.protractorCommand.ignoreStdErr = true; - return this.protractorCommand.executeAsNodeScript(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuProtractorRunsTestsDotNet extends Test { - constructor() { - super('au protractor (dotnet run) runs tests'); - } - - onProtractorOutput(message) { - this.debug(message); - - if (isProtractorCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - this.protractorCommand.stop(); - } - } - - onOutput(message) { - this.debug(message); - - if (message.indexOf('Now listening on: http://') > -1 && !this.protractorCommand) { - this.protractorCommand = new ExecuteCommand('au', ['protractor'], (msg) => this.onProtractorOutput(msg)); - this.protractorCommand.ignoreStdErr = true; - return this.protractorCommand.executeAsNodeScript(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('dotnet', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.execute(); - } -} - -function isApplicationAvailableMessage(msg) { - return msg.indexOf('Application Available At: http://') > -1 || - msg.indexOf('Project is running at http://') > -1; -} - -function isProtractorCompletedMessage(msg) { - return msg.indexOf('specs, 0 failures') > -1; -} - -module.exports = { - AuProtractorRunsTests, - AuProtractorRunsTestsDotNet -}; diff --git a/build/tasks/release-checks/tests/generic/dotnet-run.js b/build/tasks/release-checks/tests/generic/dotnet-run.js deleted file mode 100644 index e216e2c33..000000000 --- a/build/tasks/release-checks/tests/generic/dotnet-run.js +++ /dev/null @@ -1,123 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); -const CheckForJavascriptErrors = require('../../tasks/check-javascript-errors'); -const TakeScreenShotOfPage = require('../../tasks/take-screenshot-of-page'); -const StepRunner = require('../../step-runner'); -const path = require('path'); - -class DotNetRunDoesNotThrowCommandLineErrors extends Test { - constructor() { - super('dotnet run does not throw commandline errors'); - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (isApplicationAvailableMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('dotnet', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.execute(); - } -} - -class DotNetRunLaunchesServer extends Test { - constructor() { - super('dotnet run launches server'); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('dotnet', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.execute(); - } -} - -class DotnetRunRendersPage extends Test { - constructor() { - super('dotnet run renders page'); - } - - onOutput(context, message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.isUp) { - this.isUp = true; - const url = getURL(message); - - const screenshot = new TakeScreenShotOfPage(url, path.join(context.resultOutputFolder, 'screenshot-of-dotnet-run.png')); - - return new StepRunner(screenshot).run() - .then(() => { - this.success(); - this.executeCommand.stop(); - }); - } - } - - execute(context) { - this.executeCommand = new ExecuteCommand('dotnet', ['run'], (msg) => this.onOutput(context, msg)); - return this.executeCommand.execute(); - } -} - -class DotNetRunAppLaunchesWithoutJavascriptErrors extends Test { - constructor() { - super('dotnet run app launches without javascript errors'); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.isUp) { - this.isUp = true; - const url = getURL(message); - - const checkJavascriptErrorsTask = new CheckForJavascriptErrors(url); - - return new StepRunner(checkJavascriptErrorsTask).run() - .then(() => { - this.success(); - this.executeCommand.stop(); - }); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('dotnet', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.execute(); - } -} - -function isApplicationAvailableMessage(msg) { - return msg.indexOf('Now listening on: http://') > -1; -} - -function getURL(msg) { - const regex = /Now listening on: http:\/\/(.*)/; - const match = regex.exec(msg); - return 'http://' + match[1]; -} - -module.exports = { - DotNetRunDoesNotThrowCommandLineErrors, - DotNetRunLaunchesServer, - DotnetRunRendersPage, - DotNetRunAppLaunchesWithoutJavascriptErrors -}; - diff --git a/build/tasks/release-checks/tests/generic/index.js b/build/tasks/release-checks/tests/generic/index.js deleted file mode 100644 index 6361f940a..000000000 --- a/build/tasks/release-checks/tests/generic/index.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - ...require('./au-generate'), - ...require('./au-jest'), - ...require('./au-karma'), - ...require('./au-lint'), - ...require('./au-cypress'), - ...require('./au-protractor'), - ...require('./dotnet-run') -}; diff --git a/build/tasks/release-checks/tests/index.js b/build/tasks/release-checks/tests/index.js deleted file mode 100644 index d1733a9fc..000000000 --- a/build/tasks/release-checks/tests/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - generic: require('./generic'), - requirejs: require('./requirejs'), - webpack: require('./webpack'), - plugin: require('./plugin') -}; diff --git a/build/tasks/release-checks/tests/plugin/au-build-plugin.js b/build/tasks/release-checks/tests/plugin/au-build-plugin.js deleted file mode 100644 index 9331fa04d..000000000 --- a/build/tasks/release-checks/tests/plugin/au-build-plugin.js +++ /dev/null @@ -1,33 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); - -class AuBuildPluginDoesNotThrowCommandLineErrors extends Test { - constructor() { - super('au build-plugin does not throw commandline errors'); - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (isBuildCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['build-plugin', '--watch'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isBuildCompletedMessage(msg) { - return msg.indexOf('Finish building Aurelia plugin') > -1; -} - -module.exports = { - AuBuildPluginDoesNotThrowCommandLineErrors -}; diff --git a/build/tasks/release-checks/tests/plugin/index.js b/build/tasks/release-checks/tests/plugin/index.js deleted file mode 100644 index 733bf001e..000000000 --- a/build/tasks/release-checks/tests/plugin/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('./au-build-plugin') -}; diff --git a/build/tasks/release-checks/tests/requirejs/au-build.js b/build/tasks/release-checks/tests/requirejs/au-build.js deleted file mode 100644 index b5e2250c0..000000000 --- a/build/tasks/release-checks/tests/requirejs/au-build.js +++ /dev/null @@ -1,86 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); -const path = require('path'); -const fs = require('fs'); - -class AuBuildDoesNotThrowCommandLineErrors extends Test { - constructor() { - super('au build does not throw commandline errors'); - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (isBuildCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['build', '--watch'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuBuildWatchPicksUpFileChanges extends Test { - constructor(fileToChange) { - super('au build --watch picks up file changes'); - - this.fileToChange = fileToChange || path.join('src', 'app.html'); - } - - changeFile() { - return new Promise(resolve => { - const fullPath = path.join(this.context.workingDirectory, this.fileToChange); - - this.debug(`changing file ${fullPath}`); - - fs.readFile(fullPath, 'utf-8', (err, data) => { - if (err) { - throw err; - } - - fs.writeFile(fullPath, data + ' ', 'utf-8', (error) => { - if (error) { - throw error; - } - - resolve(); - }); - }); - }); - } - - onOutput(message) { - this.debug(message); - - if (isBuildCompletedMessage(message)) { - setTimeout(() => this.changeFile(), 1000); - } - - if (message.indexOf('to pending build changes') > -1) { - this.success(); - this.executeCommand.stop(); - } - } - - execute(context) { - this.context = context; - - this.executeCommand = new ExecuteCommand('au', ['build', '--watch'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isBuildCompletedMessage(msg) { - return msg.indexOf('Finished \'writeBundles\'') > -1; -} - -module.exports = { - AuBuildDoesNotThrowCommandLineErrors, - AuBuildWatchPicksUpFileChanges -}; diff --git a/build/tasks/release-checks/tests/requirejs/au-run.js b/build/tasks/release-checks/tests/requirejs/au-run.js deleted file mode 100644 index f1c828b56..000000000 --- a/build/tasks/release-checks/tests/requirejs/au-run.js +++ /dev/null @@ -1,174 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); -const CheckForJavascriptErrors = require('../../tasks/check-javascript-errors'); -const TakeScreenShotOfPage = require('../../tasks/take-screenshot-of-page'); -const StepRunner = require('../../step-runner'); -const path = require('path'); -const fs = require('fs'); - -class AuRunDoesNotThrowCommandLineErrors extends Test { - constructor() { - super('au run does not throw commandline errors'); - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (isApplicationAvailableMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunLaunchesServer extends Test { - constructor() { - super('au run launches server'); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunWatchPicksUpFileChanges extends Test { - constructor(fileToChange) { - super('au run picks up file changes'); - - this.fileToChange = fileToChange || path.join('src', 'app.html'); - } - - changeFile() { - return new Promise(resolve => { - const fullPath = path.join(this.context.workingDirectory, this.fileToChange); - - this.debug(`changing file ${fullPath}`); - - fs.readFile(fullPath, 'utf-8', (err, data) => { - if (err) { - throw err; - } - - fs.writeFile(fullPath, data + ' ', 'utf-8', (error) => { - if (error) { - throw error; - } - - resolve(); - }); - }); - }); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message)) { - setTimeout(() => this.changeFile(), 1000); - } - - if (message.indexOf('to pending build changes') > -1) { - this.success(); - this.executeCommand.stop(); - } - } - - execute(context) { - this.context = context; - - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunAppLaunchesWithoutJavascriptErrors extends Test { - constructor() { - super('au run app launches without javascript errors'); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.isUp) { - this.isUp = true; - const url = getURL(message); - - const checkJavascriptErrorsTask = new CheckForJavascriptErrors(url); - - return new StepRunner(checkJavascriptErrorsTask).run() - .then(() => { - this.success(); - this.executeCommand.stop(); - }); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunRendersPage extends Test { - constructor() { - super('au run renders page'); - } - - onOutput(context, message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.isUp) { - this.isUp = true; - const url = getURL(message); - - const screenshot = new TakeScreenShotOfPage(url, path.join(context.resultOutputFolder, 'screenshot-of-au-run.png')); - - return new StepRunner(screenshot).run() - .then(() => { - this.success(); - this.executeCommand.stop(); - }); - } - } - - execute(context) { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(context, msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isApplicationAvailableMessage(msg) { - return msg.indexOf('Application Available At: http://') > -1; -} - -function getURL(msg) { - const regex = /Application Available At: (.*)/; - const match = regex.exec(msg); - return match[1]; -} - -module.exports = { - AuRunDoesNotThrowCommandLineErrors, - AuRunLaunchesServer, - AuRunAppLaunchesWithoutJavascriptErrors, - AuRunRendersPage, - AuRunWatchPicksUpFileChanges -}; diff --git a/build/tasks/release-checks/tests/requirejs/index.js b/build/tasks/release-checks/tests/requirejs/index.js deleted file mode 100644 index 86c3f4289..000000000 --- a/build/tasks/release-checks/tests/requirejs/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - ...require('./au-run'), - ...require('./au-build') -}; diff --git a/build/tasks/release-checks/tests/test.js b/build/tasks/release-checks/tests/test.js deleted file mode 100644 index b9d5f57de..000000000 --- a/build/tasks/release-checks/tests/test.js +++ /dev/null @@ -1,30 +0,0 @@ -const Step = require('../step'); - -module.exports = class Test extends Step { - constructor(title) { - super(title); - this._success = false; - this.type = 'test'; - } - - execute() { - return Promise.resolve(this); - } - - getTitle() { - return `[TEST] ${this.title}`; - } - - success() { - this._success = true; - } - - fail() { - this._success = false; - throw new Error('Test failed'); - } - - getResultText() { - return this._success ? 'SUCCESS' : 'FAIL'; - } -}; diff --git a/build/tasks/release-checks/tests/webpack/au-build.js b/build/tasks/release-checks/tests/webpack/au-build.js deleted file mode 100644 index 1cf479faa..000000000 --- a/build/tasks/release-checks/tests/webpack/au-build.js +++ /dev/null @@ -1,64 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); -const path = require('path'); -const fs = require('fs'); - -class AuBuildDoesNotThrowCommandLineErrors extends Test { - constructor() { - super('au build does not throw commandline errors'); - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (isBuildCompletedMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['build'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuBuildStartsWebpackInWatchMode extends Test { - constructor(fileToChange) { - super('au build --watch starts webpack in watch mode'); - - this.fileToChange = fileToChange || path.join('src', 'app.html'); - this.firstBuildCompleted = false; - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (message.indexOf('webpack is watching the files') > -1) { - this.success(); - this.executeCommand.stop(); - } - } - - execute(context) { - this.context = context; - - this.executeCommand = new ExecuteCommand('au', ['build', '--watch'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isBuildCompletedMessage(msg) { - return msg.indexOf('Built at') > -1; -} - -module.exports = { - AuBuildDoesNotThrowCommandLineErrors, - AuBuildStartsWebpackInWatchMode -}; diff --git a/build/tasks/release-checks/tests/webpack/au-run.js b/build/tasks/release-checks/tests/webpack/au-run.js deleted file mode 100644 index 16e5fe62d..000000000 --- a/build/tasks/release-checks/tests/webpack/au-run.js +++ /dev/null @@ -1,179 +0,0 @@ -const Test = require('../test'); -const ExecuteCommand = require('../../tasks/execute-command'); -const CheckForJavascriptErrors = require('../../tasks/check-javascript-errors'); -const TakeScreenShotOfPage = require('../../tasks/take-screenshot-of-page'); -const StepRunner = require('../../step-runner'); -const path = require('path'); -const fs = require('fs'); - -class AuRunDoesNotThrowCommandLineErrors extends Test { - constructor() { - super('au run does not throw commandline errors'); - } - - onOutput(message) { - this.debug(message); - - if (message.toLowerCase().indexOf('error') > -1) { - this.executeCommand.stop(); - this.fail(); - } else if (message.indexOf('Compiled successfully') > -1) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunLaunchesServer extends Test { - constructor() { - super('au run launches server'); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message)) { - this.success(); - this.executeCommand.stop(); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunWatchPicksUpFileChanges extends Test { - constructor(fileToChange) { - super('au run picks up file changes'); - - this.fileToChange = fileToChange || path.join('src', 'app.html'); - this.watchingForFileChangeNotification = false; - } - - changeFile() { - return new Promise(resolve => { - const fullPath = path.join(this.context.workingDirectory, this.fileToChange); - - this.debug(`changing file ${fullPath}`); - - fs.readFile(fullPath, 'utf-8', (err, data) => { - if (err) { - throw err; - } - - fs.writeFile(fullPath, data + ' ', 'utf-8', (error) => { - if (error) { - throw error; - } - - resolve(); - }); - }); - }); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message)) { - setTimeout(() => this.changeFile(), 1000); - } - - if (message.indexOf('Compiled successfully.') > -1) { - if (this.watchingForFileChangeNotification) { - this.success(); - this.executeCommand.stop(); - } else { - this.watchingForFileChangeNotification = true; - } - } - } - - execute(context) { - this.context = context; - - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunAppLaunchesWithoutJavascriptErrors extends Test { - constructor() { - super('au run app launches without javascript errors'); - } - - onOutput(message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.isUp) { - this.isUp = true; - const url = getURL(message); - - const checkJavascriptErrorsTask = new CheckForJavascriptErrors(url); - - return new StepRunner(checkJavascriptErrorsTask).run() - .then(() => { - this.success(); - this.executeCommand.stop(); - }); - } - } - - execute() { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -class AuRunRendersPage extends Test { - constructor() { - super('au run renders page'); - } - - onOutput(context, message) { - this.debug(message); - - if (isApplicationAvailableMessage(message) && !this.isUp) { - this.isUp = true; - const url = getURL(message); - - const screenshot = new TakeScreenShotOfPage(url, path.join(context.resultOutputFolder, 'screenshot-of-au-run.png')); - - return new StepRunner(screenshot).run() - .then(() => { - this.success(); - this.executeCommand.stop(); - }); - } - } - - execute(context) { - this.executeCommand = new ExecuteCommand('au', ['run'], (msg) => this.onOutput(context, msg)); - return this.executeCommand.executeAsNodeScript(); - } -} - -function isApplicationAvailableMessage(msg) { - return msg.indexOf('Project is running at http://') > -1; -} - -function getURL(msg) { - const regex = /Project is running at (.*)/; - const match = regex.exec(msg); - return match[1]; -} - -module.exports = { - AuRunDoesNotThrowCommandLineErrors, - AuRunLaunchesServer, - AuRunWatchPicksUpFileChanges, - AuRunAppLaunchesWithoutJavascriptErrors, - AuRunRendersPage -}; diff --git a/build/tasks/release-checks/tests/webpack/index.js b/build/tasks/release-checks/tests/webpack/index.js deleted file mode 100644 index 86c3f4289..000000000 --- a/build/tasks/release-checks/tests/webpack/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - ...require('./au-run'), - ...require('./au-build') -}; diff --git a/build/tasks/update-dependenciesjs.js b/build/tasks/update-dependenciesjs.js deleted file mode 100644 index 8d34ff2e6..000000000 --- a/build/tasks/update-dependenciesjs.js +++ /dev/null @@ -1,57 +0,0 @@ -const gulp = require('gulp'); -const latestVersion = require('latest-version'); -const fs = require('fs'); -const path = require('path'); - -const depJsonPath = path.resolve(__dirname, '../../lib/dependencies.json'); - -const ignore = ['text', 'gulp', 'extract-text-webpack-plugin']; - -gulp.task('update-cli-dependenciesjs', function(done) { - let deps = getDepsJSON(); - updateCLIVersion(deps); - - write(deps).then(() => done()); -}); - -// this task goes through ./lib/dependencies.json and updates all libs -// to use the latest version -gulp.task('update-all-dependenciesjs', async() => { - let deps = getDepsJSON(); - let lookup = Object.keys(deps).filter(x => !ignore.includes(x)); - - // for all entries in dependencies.json, lookup the latest version and update the json file - for (let i = 0; i < lookup.length; i++) { - const ver = await latestVersion(lookup[i]); - console.log(`Latest version of ${lookup[i]} (currently ${deps[lookup[i]]}) is: ${ver}`); - deps[lookup[i]] = '^' + ver; - } - - await updateCLIVersion(deps); - await write(deps); -}); - -function getDepsJSON() { - return require(depJsonPath); -} - -function write(deps) { - return new Promise((resolve, reject) => { - fs.writeFile(depJsonPath, JSON.stringify(deps, null, 2) + '\n', function(err) { - if (err) { - reject(err); - return console.log(err); - } - - console.log('dependencies.json was updated'); - resolve(); - }); - }); -} - -function updateCLIVersion(deps) { - let {version} = require('../../package.json'); - version = '^' + version; - deps['aurelia-cli'] = version; - console.log('Updated aurelia-cli version to what\'s currently in package.json: ' + version); -} diff --git a/gulpfile.js b/gulpfile.js index 64d25d0ac..ba57e1a1f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,3 @@ 'use strict'; -require('./build/tasks/release-check.js'); require('./build/tasks/lint.js'); -require('./build/tasks/release-check.js'); -require('./build/tasks/update-dependenciesjs.js'); require('./build/tasks/prepare-release.js'); diff --git a/lib/build/bundle.js b/lib/build/bundle.js index a94ee180d..0202d0601 100644 --- a/lib/build/bundle.js +++ b/lib/build/bundle.js @@ -2,6 +2,7 @@ const path = require('path'); const os = require('os'); const Terser = require('terser'); const Convert = require('convert-source-map'); +const Minimatch = require('minimatch').Minimatch; const fs = require('../file-system'); const SourceInclusion = require('./source-inclusion').SourceInclusion; const DependencyInclusion = require('./dependency-inclusion').DependencyInclusion; @@ -11,7 +12,6 @@ const logger = require('aurelia-logging').getLogger('Bundle'); exports.Bundle = class { constructor(bundler, config) { - this.Minimatch = require('minimatch').Minimatch; //nested dep of vinyl-fs this.bundler = bundler; this.config = config; this.dependencies = []; @@ -57,7 +57,7 @@ exports.Bundle = class { } createMatcher(pattern) { - return new this.Minimatch(pattern, { + return new Minimatch(pattern, { dot: true }); } diff --git a/lib/build/index.js b/lib/build/index.js index 3facef82d..68cf6f30b 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -1,3 +1,4 @@ +const {Transform} = require('stream'); const Bundler = require('./bundler').Bundler; const PackageAnalyzer = require('./package-analyzer').PackageAnalyzer; const PackageInstaller = require('./package-installer').PackageInstaller; @@ -7,7 +8,6 @@ const del = require('del'); let bundler; let project; let isUpdating = false; -let through; exports.src = function(p) { if (bundler) { @@ -15,7 +15,6 @@ exports.src = function(p) { return Promise.resolve(bundler); } - through = require('through2'); //dep of vinyl-fs project = p; return Bundler.create( project, @@ -46,8 +45,11 @@ exports.createLoaderConfig = function(p) { }; exports.bundle = function() { - return through.obj(function(file, encoding, callback) { - callback(null, capture(file)); + return new Transform({ + objectMode: true, + transform: function(file, encoding, callback) { + callback(null, capture(file)); + } }); }; @@ -63,7 +65,6 @@ exports.clearCache = function() { function buildLoaderConfig(p) { project = p || project; - through = require('through2'); //dep of vinyl-fs let configPromise = Promise.resolve(); if (!bundler) { diff --git a/lib/commands/generate-skeletons/command.js b/lib/commands/generate-skeletons/command.js deleted file mode 100644 index c4fbe03f8..000000000 --- a/lib/commands/generate-skeletons/command.js +++ /dev/null @@ -1,123 +0,0 @@ -const UI = require('../../ui').UI; -const fs = require('../../file-system'); -const _ = require('lodash'); -const CLIOptions = require('../../cli-options').CLIOptions; -const logger = require('aurelia-logging').getLogger('generate-skeletons'); -const selectFeatures = require('../../workflow/select-features'); -const writeProject = require('../../workflow/write-project'); -const applicable = require('../../workflow/applicable'); - -// Designed to cover all unit/e2e/transpiler combinations. -// Cover decent css/postcss/htmlmin combinations. -const projectDefs = [ - 'cli-bundler sass htmlmin-min jest dotnet-core protractor scaffold-navigation', - 'cli-bundler less htmlmin-min jest protractor', - 'cli-bundler karma dotnet-core protractor', - 'cli-bundler karma postcss-typical protractor vscode', - 'cli-bundler typescript jest dotnet-core protractor scaffold-navigation', - 'cli-bundler htmlmin-max typescript jest protractor', - 'cli-bundler typescript karma dotnet-core protractor', - 'cli-bundler typescript karma protractor scaffold-navigation', - - 'cli-bundler stylus jest dotnet-core cypress scaffold-navigation', - 'cli-bundler htmlmin-max jest cypress', - 'cli-bundler htmlmin-min karma dotnet-core cypress scaffold-navigation', - 'cli-bundler less htmlmin-min postcss-typical postcss-basic karma cypress scaffold-navigation', - 'cli-bundler typescript jest dotnet-core cypress', - 'cli-bundler typescript jest cypress', - 'cli-bundler typescript karma dotnet-core cypress scaffold-navigation vscode', - 'cli-bundler sass htmlmin-max typescript karma cypress', - - 'cli-bundler alameda jest dotnet-core protractor', - 'cli-bundler alameda jest protractor scaffold-navigation', - 'cli-bundler alameda htmlmin-max karma dotnet-core protractor', - 'cli-bundler alameda karma protractor', - 'cli-bundler alameda htmlmin-min typescript jest dotnet-core protractor', - 'cli-bundler alameda htmlmin-min typescript jest protractor', - 'cli-bundler alameda typescript postcss-basic karma dotnet-core protractor', - 'cli-bundler alameda typescript karma protractor', - - 'cli-bundler alameda jest dotnet-core cypress', - 'cli-bundler alameda jest cypress', - 'cli-bundler alameda karma dotnet-core cypress', - 'cli-bundler alameda karma cypress scaffold-navigation', - 'cli-bundler alameda stylus typescript jest dotnet-core cypress', - 'cli-bundler alameda less postcss-basic typescript jest cypress', - 'cli-bundler alameda htmlmin-min typescript karma dotnet-core cypress', - 'cli-bundler alameda htmlmin-min typescript karma cypress', - - 'cli-bundler htmlmin-max systemjs jest dotnet-core protractor', - 'cli-bundler systemjs jest protractor', - 'cli-bundler systemjs karma dotnet-core protractor', - 'cli-bundler systemjs htmlmin-max karma protractor', - 'cli-bundler systemjs sass typescript jest dotnet-core protractor scaffold-navigation', - 'cli-bundler systemjs typescript jest protractor', - 'cli-bundler systemjs typescript karma dotnet-core protractor', - 'cli-bundler systemjs stylus typescript karma protractor', - - 'cli-bundler systemjs jest dotnet-core cypress', - 'cli-bundler systemjs jest cypress', - 'cli-bundler systemjs stylus karma dotnet-core cypress scaffold-navigation', - 'cli-bundler systemjs sass karma postcss-typical cypress', - 'cli-bundler systemjs typescript jest dotnet-core cypress', - 'cli-bundler systemjs htmlmin-max typescript jest cypress', - 'cli-bundler systemjs htmlmin-max typescript karma dotnet-core cypress', - 'cli-bundler systemjs typescript karma cypress', - - 'webpack htmlmin-min jest dotnet-core protractor vscode', - 'webpack http2 less jest protractor scaffold-navigation', - 'webpack htmlmin-max karma dotnet-core protractor', - 'webpack http2 karma postcss-typical protractor', - 'webpack sass htmlmin-min typescript jest dotnet-core protractor', - 'webpack typescript postcss-basic jest protractor', - 'webpack stylus htmlmin-max typescript karma dotnet-core protractor scaffold-navigation', - 'webpack less typescript karma protractor', - - 'webpack stylus jest postcss-basic dotnet-core cypress', - 'webpack htmlmin-max jest cypress', - 'webpack karma dotnet-core cypress scaffold-navigation', - 'webpack htmlmin-min karma cypress', - 'webpack typescript jest dotnet-core cypress', - 'webpack http2 htmlmin-max typescript jest cypress scaffold-navigation', - 'webpack http2 sass typescript postcss-typical karma dotnet-core cypress scaffold-navigation vscode', - 'webpack htmlmin-min typescript karma cypress', - - 'plugin stylus htmlmin-min jest', - 'plugin karma postcss-typical vscode', - 'plugin htmlmin-max typescript jest', - 'plugin typescript karma plugin-scaffold-basic', - - 'plugin htmlmin-max jest', - 'plugin less htmlmin-min postcss-typical postcss-basic karma plugin-scaffold-basic', - 'plugin typescript jest', - 'plugin sass htmlmin-max typescript karma' -]; - -module.exports = class { - static inject() { return [UI, CLIOptions]; } - - constructor(ui, options) { - this.ui = ui; - this.options = options; - } - - async execute() { - let defs = projectDefs; - if (this.options.hasFlag('definitions')) { - const file = this.options.getFlagValue('definitions'); - defs = (await fs.readFile(file)).split(/(?:\r|\n)+/); - defs = _(defs).map(_.trim).compact().value(); - } - for (let i = 0, ii = defs.length; i < ii; i++) { - let features = _(defs[i].split(' ')).map(_.trim).compact().value(); - // Cleanup feature set, and fillup default. - features = await selectFeatures(features, {unattended: true, plugin: applicable(features, 'plugin')}); - const projectName = features.join('_'); - - logger.info(`Writing ${i + 1}/${ii} ${projectName}`); - await writeProject(projectName, features, projectName, true); - } - - logger.info('Created all projects'); - } -}; diff --git a/lib/commands/generate-skeletons/command.json b/lib/commands/generate-skeletons/command.json deleted file mode 100644 index 70bcd8107..000000000 --- a/lib/commands/generate-skeletons/command.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "generate-projects", - "description": "Generates skeleton applications in the current directory.", - "flags": [ - { - "name": "definitions", - "description": "optionally provide a file which contains project definitions", - "type": "string" - } - ] -} diff --git a/lib/commands/new/command.js b/lib/commands/new/command.js index dc3eb9e29..1e60c19d6 100644 --- a/lib/commands/new/command.js +++ b/lib/commands/new/command.js @@ -1,231 +1,10 @@ -const fs = require('../../file-system'); -const {CLIOptions} = require('../../cli-options'); -const UI = require('../../ui').UI; -const logger = require('aurelia-logging').getLogger('new'); -const selectFeatures = require('../../workflow/select-features'); -const writeProject = require('../../workflow/write-project'); -const applicable = require('../../workflow/applicable'); -const {choosePackageManager, installDeps} = require('./install-deps'); -const Configuration = require('../config/configuration'); -const c = require('ansi-colors'); -const _ = require('lodash'); +const {spawn} = require('child_process'); module.exports = class { - static inject() { return [UI, CLIOptions]; } - - constructor(ui, options) { - this.ui = ui; - this.options = options; - } - async execute(args) { - // Create project in current cwd - // --here - // -h - this.here = this.options.hasFlag('here'); - - // Unattended mode - // --unattended - // -u - this.unattended = this.options.hasFlag('unattended'); - - // Preselect features - // In unattended mode, these overwrite default-esnext selections. - // In interactive mode, some questions will be skipped because they are - // pre-answered. - // --select cli-bundler,alameda,karma - // -s cli-bundler,alameda,karma - let selectedFeatures = (this.options.getFlagValue('select') || '').split(','); - selectedFeatures = _(selectedFeatures).map(_.trim).map(_.toLower).compact().value(); - - // Auto install npm packages. - // This bypasses the question to choose package manager - // --install-deps yarn - // -i yarn - // --install-deps npm - // -i npm - let packageManager = this.options.getFlagValue('install-deps'); - - // TODO: Create aurelia plugin - // --plugin - // -p - this.plugin = this.options.hasFlag('plugin'); - - let projectName; - if (this.here) { - const dir = this.options.originalBaseDir; - projectName = dir.split(/\\|\//).pop(); - } else if (args[0] && !args[0].startsWith('-')) { - projectName = args[0]; - } - - await this.ui.displayLogo(); - - projectName = await this.ensureProjectName(projectName); - try { - const confirm = await this.confirmToWriteOnExistingFolder(projectName); - if (!confirm) return; - } catch (e) { - logger.error(e.message); - process.exit(1); - return; - } - - const projectFolder = this.here ? '.' : projectName; - - const features = await selectFeatures(selectedFeatures, { - unattended: this.unattended, - plugin: this.plugin - }); - await writeProject(projectName, features, projectFolder, this.unattended); - await this.showSummary(projectName, features); - await this.optionallyInstallDeps(packageManager, projectFolder); - await this.displayCompletionMessage(projectName, features, projectFolder); - } - - async ensureProjectName(name) { - name = (name || '').trim(); - if (name) return name; - if (this.unattended) return 'aurelia-app'; - - return await this.ui.ensureAnswer( - name, - 'Please enter a name for your new project:', - 'aurelia-app' - ); - } - - async confirmToWriteOnExistingFolder(projectName) { - let question; - let yesHint; - - if (!this.here && fs.isFile(projectName)) { - throw new Error(`There is an existing file named as ${projectName}, cannot create folder ${projectName}.`); - } else if (!this.here && fs.isDirectory(projectName)) { - if (this.unattended) { - throw new Error(`The '${projectName}' folder already exists. Please make sure it's not there for unattended mode.`); - } - question = `WARNING: The '${projectName}' folder already exists. Would you like to create the project in this folder?`; - yesHint = `Continue even though the '${projectName}' directory already exists.`; - } else if (this.here && fs.readdirSync(process.cwd()).length > 0) { - // Default answer is yes in unattended mode - if (this.unattended) return true; - question = 'WARNING: The current directory is not empty. Would you like to create the project in this folder?'; - yesHint = 'Continue even though the current directory is not empty.'; - } - - if (!question) return true; - - const confirm = await this.ui.question( - c.red(question), - [ - {value: 'abort', message: 'Abort', hint: 'Aborts the new project wizard.'}, - {value: 'continue', message: 'Continue', hint: c.red(yesHint)} - ] - ); - - return confirm === 'continue'; - } - - async showSummary(projectName, features) { - // Ensure to wrap projectName with quotes if there is white space in it. - const wrappedName = projectName.match(/\s/) ? JSON.stringify(projectName) : projectName; - const feats = await minFeatures(features, this.plugin); - - await this.ui.log(''); - await this.logTitle('Project Summary'); - await this.logBody(`This project was bootstrapped based on following selected features: -${c.green(features.join(' '))} -Next time, you can generate a new project faster in unattended mode with the same features: -${cmd(`au new ${wrappedName} --unattended${feats.length ? ' --select ' : ''}${feats.join(',')}${this.plugin ? ' --plugin' : ''}${this.here ? ' --here' : ''}`)} -Or use the shorter form: -${cmd(`au new ${wrappedName} -u${feats.length ? ' -s ' : ''}${feats.join(',')}${this.plugin ? ' -p' : ''}${this.here ? ' -h' : ''}`)} -Note the command might not supply all the selected features, as some features get installed by default, so those were omitted from the command.`); - } - - async optionallyInstallDeps(packageManager, projectFolder) { - await this.logTitle('Project Dependencies'); - if (packageManager || !this.unattended) { - packageManager = await choosePackageManager(packageManager, projectFolder, this.ui); - if (packageManager) { - await this.logBody('Installing project dependencies...'); - await installDeps(packageManager, projectFolder); - // Save to aurelia_project/aurelia.json - const config = new Configuration({originalBaseDir: projectFolder}); - await config.execute('set', 'packageManager', packageManager); - await config.save(false); - await this.logBody('Project dependencies were installed.'); - return; - } - } - - await this.logBody('Dependencies were not installed.'); - - if (this.unattended) { - await this.logBody(`By default, unattended mode does not install project dependencies. -If you want to auto-install deps, add one more option to the command: -${cmd('--install-deps yarn')}, or ${cmd('--install-deps npm')}, or shorter form ${cmd('-i npm')}.`); - } - } - - async displayCompletionMessage(projectName, features) { - let message = 'Now it\'s time to get started. It\'s easy.\n'; - - let runCommand = 'au run'; - - if (applicable(features, 'dotnet-core')) { - runCommand = 'dotnet run'; - } - - runCommand = cmd(runCommand); - - if (this.here) { - message += `Simply run your new app in dev mode with ${runCommand}.\n`; - } else { - message += `First, change directory into your new project's folder. You can use ${cmd(`cd ${projectName}`)} to get there.\n`; - message += `If dependencies were not installed, use ${cmd('npm i')} or ${cmd('yarn')} to install dependencies first.\n`; - message += `Then run your new app in dev mode with ${runCommand}.\n`; - } - - if (applicable(features, 'plugin')) { - message += `If you want to build the plugin, run ${cmd('au build-plugin')}.\n`; - message += 'Please read README.md file for more instructions.\n'; - } else { - message += `If you want to build your app for production, run ${cmd('au build --env prod')}.\n`; - message += `If you need help, simply run ${cmd('au help')}.\n`; - } - - await this.logTitle('Congratulations!'); - await this.logBody(`Your Project "${projectName}" Has Been Created!`); - await this.logTitle('Getting started'); - await this.logBody(message); - await this.logTitle('Happy Coding!'); - } - - async logTitle(message) { - await this.ui.log(c.bgGreen.black.bold(' ' + message + ' ')); - } - - async logBody(message) { - await this.ui.log(message); - await this.ui.log(''); + // Calls "npx makes aurelia/v1" + // https://github.com/aurelia/v1 + spawn('npx', ['makes', 'aurelia/v1', ...args], {stdio: 'inherit', shell: true}); } }; -function cmd(str) { - return c.inverse(' ' + str + ' '); -} - -async function minFeatures(features, plugin) { - const mustHave = []; - for (let i = 0, ii = features.length; i < ii; i++) { - const oneLess = [...features]; - oneLess.splice(i, 1); - const result = await selectFeatures(oneLess, {unattended: true, plugin}); - if (!_.isEqual(result, features)) { - mustHave.push(features[i]); - } - } - return mustHave; -} - diff --git a/lib/commands/new/command.json b/lib/commands/new/command.json index e966c6f5e..667321c00 100644 --- a/lib/commands/new/command.json +++ b/lib/commands/new/command.json @@ -1,6 +1,6 @@ { "name": "new", - "description": "Creates a new Aurelia application project.", + "description": "Creates a new Aurelia application project. Wraps \"npx makes aurelia/v1\". https://github.com/aurelia/v1", "parameters": [ { "name": "project-name", @@ -19,19 +19,9 @@ "description": "Creates a new Aurelia plugin project.", "type": "boolean" }, - { - "name": "unattended", - "description": "Creates project in unattended mode. It will fail if there is any conflicting file in target folder.", - "type": "boolean" - }, { "name": "select", - "description": "Preselect features (e.g. --select cli-bundler,alameda,karma). In unattended mode, these overwrite default-esnext selections. In interactive mode, some questions will be skipped because they are pre-answered.", - "type": "string" - }, - { - "name": "install-deps", - "description": "Auto install dependencies using yarn or npm (e.g --install-deps yarn)", + "description": "Preselect features (e.g. --select cli-bundler,alameda,karma). This option also turns on unattended mode.", "type": "string" } ] diff --git a/lib/commands/new/install-deps.js b/lib/commands/new/install-deps.js deleted file mode 100644 index 47da5bd5f..000000000 --- a/lib/commands/new/install-deps.js +++ /dev/null @@ -1,87 +0,0 @@ -const fs = require('../../file-system'); -const logger = require('aurelia-logging').getLogger('install-deps'); -const Yarn = require('../../package-managers/yarn').Yarn; -const NPM = require('../../package-managers/npm').NPM; - -exports.choosePackageManager = async function(packageManager, projectFolder, ui) { - if (packageManager === 'yarn' || packageManager === 'npm') return packageManager; - - const npmLockExists = fs.existsSync(fs.join(projectFolder, 'package-lock.json')); - const yarnLockExists = fs.existsSync(fs.join(projectFolder, 'yarn.lock')); - - if (npmLockExists && yarnLockExists) { - logger.warn("Found lock files for both npm and yarn! Lock files are not cross compatible between package managers. It's recommended to remove either package-lock.json (NPM) or yarn.lock (Yarn) from the project directory before installing new packages.\n"); - } else if (npmLockExists) { - logger.info('Found NPM lock file. Recommend continued use of npm as package manager.\n'); - } else if (yarnLockExists) { - logger.info('Found Yarn lock file. Recommend continued use of yarn as package manager.\n'); - } - - let defaultIndex = 0; - let options = []; - const yarn = new Yarn(); - if (yarn.isAvailable(projectFolder)) { - if (!yarnLockExists) { - logger.info('Lock files are not cross compatible between package managers. Choose Yarn here only if you intend to use Yarn for future package installs. Alternatively, remove either yarn.lock or package-lock.json from the project directory before installing new packages.\n'); - } - if (npmLockExists && !yarnLockExists) { - defaultIndex = 1; - } - options = [ - { - message: 'Yes, use Yarn', - hint: 'Installs all server, client and tooling dependencies needed to build the project using Yarn.', - value: 'yarn' - }, - { - message: 'Yes, use NPM', - hint: 'Installs all server, client and tooling dependencies needed to build the project using NPM.', - value: 'npm' - }, - { - message: 'No', - hint: 'Completes the new project wizard without installing dependencies.', - value: 'no' - } - ]; - } else { - options = [ - { - message: 'Yes', - hint: 'Installs all server, client and tooling dependencies needed to build the project.', - value: 'yes' - }, - { - message: 'No', - hint: 'Completes the new project wizard without installing dependencies.', - value: 'no' - } - ]; - } - - const answer = await ui.question( - 'Would you like to install all the npm dependencies?', - options, - defaultIndex - ); - - if (answer === 'yes' || answer === 'npm' || answer === 'yarn') { - return answer === 'yes' ? 'npm' : answer; - } -}; - -exports.installDeps = async function(packageManager, projectFolder) { - if (packageManager === 'yarn') { - const yarn = new Yarn(); - try { - await yarn.install([], projectFolder); - return; - } catch (e) { - logger.error('Something went wrong while attempting to use Yarn. Falling back to NPM'); - logger.info(e); - } - } - - const npm = new NPM(); - await npm.install([], projectFolder); -}; diff --git a/lib/dependencies.js b/lib/dependencies.js deleted file mode 100644 index ec27aa535..000000000 --- a/lib/dependencies.js +++ /dev/null @@ -1,5 +0,0 @@ -let versionMap = require('./dependencies.json'); - -exports.getSupportedVersion = function(name) { - return versionMap[name] || 'latest'; -}; diff --git a/lib/dependencies.json b/lib/dependencies.json deleted file mode 100644 index c2c7c47f3..000000000 --- a/lib/dependencies.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "@typescript-eslint/eslint-plugin": "^2.30.0", - "@typescript-eslint/parser": "^2.30.0", - "@types/jasmine": "^3.5.7", - "@types/jest": "^25.1.3", - "@types/lodash": "^4.14.149", - "@types/node": "^13.7.6", - "@types/webpack": "^4.41.6", - "app-settings-loader": "^1.0.3", - "aspnet-webpack": "^3.0.0", - "aurelia-animator-css": "^1.0.4", - "aurelia-bootstrapper": "^2.3.3", - "aurelia-cli": "^1.3.1", - "aurelia-loader-nodejs": "^1.1.0", - "aurelia-pal-nodejs": "^2.0.0", - "aurelia-protractor-plugin": "^1.0.6", - "aurelia-testing": "^1.0.0", - "aurelia-webpack-plugin": "^4.0.0", - "aurelia-polyfills": "^1.3.4", - "autoprefixer": "^9.7.4", - "@babel/core": "^7.8.4", - "babel-eslint": "^10.1.0", - "babel-jest": "^25.1.0", - "babel-loader": "^8.0.6", - "babel-plugin-istanbul": "^6.0.0", - "@babel/plugin-proposal-decorators": "^7.8.3", - "@babel/plugin-proposal-class-properties": "^7.8.3", - "@babel/preset-env": "^7.8.4", - "@babel/register": "^7.8.3", - "browser-sync": "^2.26.7", - "clean-webpack-plugin": "^3.0.0", - "connect-history-api-fallback": "^1.6.0", - "copy-webpack-plugin": "^5.1.1", - "cross-env": "^7.0.0", - "cssnano": "^4.1.10", - "css-loader": "^3.4.2", - "cypress": "^4.5.0", - "debounce": "^1.2.0", - "del": "^5.1.0", - "duplicate-package-checker-webpack-plugin": "^3.0.0", - "eslint-plugin-cypress": "^2.10.3", - "expose-loader": "^0.7.5", - "mini-css-extract-plugin": "^0.9.0", - "file-loader": "^5.1.0", - "gulp": "^4.0.0", - "gulp-babel": "^8.0.0", - "gulp-cache": "^1.1.3", - "gulp-eslint": "^6.0.0", - "gulp-htmlmin": "^5.0.1", - "gulp-less": "^4.0.1", - "gulp-notify": "^3.2.0", - "gulp-plumber": "^1.2.1", - "gulp-postcss": "^8.0.0", - "gulp-protractor": "^4.1.1", - "gulp-rename": "^2.0.0", - "gulp-dart-sass": "^1.0.0", - "gulp-sourcemaps": "^2.6.5", - "gulp-stylus": "^2.7.0", - "gulp-typescript": "^6.0.0-alpha.1", - "gulp-watch": "^5.0.1", - "html-minifier": "^4.0.0", - "html-webpack-plugin": "^3.2.0", - "istanbul-instrumenter-loader": "^3.0.1", - "jasmine-core": "^3.5.0", - "jest": "^25.1.0", - "jest-jasmine2": "^23.6.0", - "jest-cli": "^25.1.0", - "jest-matchers": "^20.0.3", - "jest-transform-stub": "^2.0.0", - "json-loader": "^0.5.7", - "html-loader": "^0.5.5", - "karma": "^4.4.1", - "karma-babel-preprocessor": "^8.0.1", - "karma-chrome-launcher": "^3.1.0", - "karma-coverage-istanbul-reporter": "^2.1.1", - "karma-jasmine": "^3.1.1", - "karma-sourcemap-loader": "^0.3.7", - "karma-typescript-preprocessor": "^0.4.0", - "karma-mocha": "^1.3.0", - "karma-webpack": "^4.0.2", - "less": "^3.11.1", - "less-loader": "^5.0.0", - "minimatch": "^3.0.4", - "postcss-loader": "^3.0.0", - "postcss-url": "^8.0.0", - "promise-polyfill": "^8.1.3", - "protractor": "^5.4.3", - "regenerator-runtime": "^0.13.3", - "requirejs": "^2.3.6", - "sass": "^1.26.3", - "sass-loader": "^8.0.2", - "style-loader": "^1.1.3", - "stylus": "^0.54.7", - "stylus-loader": "^3.0.2", - "systemjs": "^0.21.6", - "systemjs-plugin-text": "^0.0.11", - "text": "requirejs/text#latest", - "through2": "^3.0.1", - "ts-jest": "^25.2.1", - "ts-node": "^8.6.2", - "ts-loader": "^6.2.1", - "typescript": "^3.8.2", - "url-loader": "^3.0.0", - "vinyl-fs": "^3.0.3", - "wait-on": "^4.0.0", - "webpack": "^4.41.6", - "webpack-bundle-analyzer": "^3.6.0", - "webpack-cli": "^3.3.11", - "webpack-dev-server": "^3.10.3", - "webpack-hot-middleware": "^2.25.0" -} diff --git a/lib/workflow/pretty-choices.js b/lib/pretty-choices.js similarity index 91% rename from lib/workflow/pretty-choices.js rename to lib/pretty-choices.js index ebe99ce64..792f1a8e3 100644 --- a/lib/workflow/pretty-choices.js +++ b/lib/pretty-choices.js @@ -1,5 +1,5 @@ const {wordWrap} = require('enquirer/lib/utils'); -const getTtySize = require('../get-tty-size'); +const getTtySize = require('./get-tty-size'); // Check all values, indent hint line. module.exports = function(...choices) { @@ -12,7 +12,7 @@ module.exports = function(...choices) { // displayName and description are for compatibility in lib/ui.js const value = c.value || c.displayName; - const message = c.message || c.displayName; + const message = c.title || c.message || c.displayName; const hint = c.hint || c.description; if (typeof value !== 'string') { diff --git a/lib/resources/index.js b/lib/resources/index.js deleted file mode 100644 index 89551ec50..000000000 --- a/lib/resources/index.js +++ /dev/null @@ -1,9 +0,0 @@ -exports.locateResource = function(path) { - try { - return require.resolve('./' + path); - } catch (e) { - console.log(`Error locating resource: ${path}`); - console.error(e); - throw e; - } -}; diff --git a/lib/ui.js b/lib/ui.js index acd8a7a53..95c977c86 100644 --- a/lib/ui.js +++ b/lib/ui.js @@ -3,7 +3,7 @@ const fs = require('./file-system'); const {wordWrap} = require('enquirer/lib/utils'); const getTtySize = require('./get-tty-size'); const {Input, Select} = require('enquirer'); -const prettyChoices = require('./workflow/pretty-choices'); +const prettyChoices = require('./pretty-choices'); const {Writable} = require('stream'); const _ = require('lodash'); diff --git a/lib/workflow/applicable.js b/lib/workflow/applicable.js deleted file mode 100644 index d0cce5249..000000000 --- a/lib/workflow/applicable.js +++ /dev/null @@ -1,38 +0,0 @@ -const _ = require('lodash'); - -// features is like: ['webpack', 'babel'] -// condition is like: -// '! webpack', 'webpack && babel', 'requirejs || ! webpack' -// 'not_webpack', 'webpack_and_babel', 'requirejs_or_not_webpack' - -// Note the underscore form is to be used in suffix of file name, that -// is why we cannot use &&, ||, ! directly. - -// The 3 examples above are translated into -// ! true => false -// true && true => true -// false || ! true => false -module.exports = function(features, condition) { - const expression = _(condition.toLowerCase()) - // Super simple tokenizer: split on underscore or space or &&,||,!. - // Note with capture group in split regex, the &&,||,! are retained - // in result array. - .split(/_|\s|(&&|\|\||!)/) - .map(_.trim) - .compact() - .map(c => { - if (c === 'and' || c === '&&') return '&&'; - if (c === 'or' || c === '||') return '||'; - if (c === 'not' || c === '!') return '!'; - return features.includes(c) ? 'true' : 'false'; - }) - .join(' '); - - try { - // Eval expression like "! true || false" - // eslint-disable-next-line no-new-func - return (new Function(`return ${expression};`))(); - } catch (e) { - throw new Error(`Condition:${condition} error:${e.message}`); - } -}; diff --git a/lib/workflow/questionnaire.js b/lib/workflow/questionnaire.js deleted file mode 100644 index 793505949..000000000 --- a/lib/workflow/questionnaire.js +++ /dev/null @@ -1,235 +0,0 @@ -// For simplicity, all questions are selects. -// We use value 'none' as a convention for no feature selected, -// because enquirer doesn't support empty string '' as a value. - -exports.pickPlugin = { - // add "plugin" to feature set for pluginFlow. - // because this only provides one choice (default choice), it - // is never prompted to end user. - choices: [{ value: 'plugin' }] -}; - -exports.askDocker = { - message: 'Would you like to add a Dockerfile?', - choices: [{ - value: 'none', message: 'No' - }, { - value: 'docker', message: 'Sure, yes' - }] -}; - -exports.askBundler = { - message: 'Which bundler would you like to use?', - choices: [{ - value: 'webpack', - message: 'Webpack', - hint: 'A powerful and popular bundler for JavaScript.', - if: '!plugin' - }, { - value: 'cli-bundler', - message: "CLI's built-in bundler with an AMD module loader", - hint: 'Provides similar capabilities but with much simpler configuration.' - }] -}; - -exports.askLoader = { - message: 'Which AMD module loader would you like to use?', - choices: [{ - value: 'requirejs', - message: 'RequireJS', - hint: 'RequireJS is a mature and stable module loader for JavaScript.' - }, { - value: 'alameda', - message: 'Alameda', - hint: 'Alameda is a modern version of RequireJS using promises and native es6 features (modern browsers only).', - if: '!plugin' - }, { - value: 'systemjs', - message: 'SystemJS', - hint: 'SystemJS is Dynamic ES module loader, the most versatile module loader for JavaScript.', - if: '!plugin' - }], - // This if condition is not an enquirer feature. - // This is our convention, check ./applicable.js for acceptable expressions - if: 'cli-bundler' -}; - -exports.askHttp = { - message: 'Which HTTP Protocol do you wish the outputted Webpack bundle to be optimised for?', - choices: [{ - value: 'http1', - message: 'HTTP/1.1', - hint: 'The legacy HTTP/1.1 protocol, max 6 parallel requests/connections.' - }, { - value: 'http2', - message: 'HTTP/2', - hint: 'The modern HTTP/2 Protocol, uses request multiplexing over a single connection.' - }], - // This if condition is not an enquirer feature. - // This is our convention, check ./applicable.js for acceptable expressions - if: 'webpack' -}; - -exports.askPlatform = { - message: 'What platform are you targeting?', - choices: [{ - value: 'web', - message: 'Web', - hint: 'The default web platform setup.' - }, { - value: 'dotnet-core', - message: '.NET Core', - hint: 'A powerful, patterns-based way to build dynamic websites with .NET Core.', - if: '!plugin' - }] -}; - -exports.askTranspiler = { - message: 'What transpiler would you like to use?', - choices: [{ - value: 'babel', - message: 'Babel', - hint: 'An open source, standards-compliant ES2015 and ESNext transpiler.' - }, { - value: 'typescript', - message: 'TypeScript', - hint: 'An open source, ESNext superset that adds optional strong typing.' - }] -}; - -exports.askMarkupProcessor = { - message: 'How would you like to setup your HTML template?', - choices: [{ - value: 'none', - message: 'None', - hint: 'No markup processing' - }, { - value: 'htmlmin-min', - message: 'Minimum Minification', - hint: 'Removes comments and whitespace between block level elements such as div, blockquote, p, header, footer ...etc.' - }, { - value: 'htmlmin-max', - message: 'Maximum Minification', - hint: 'Removes comments, script & link element [type] attributes and all whitespace between all elements. Also remove attribute quotes where possible. Collapses boolean attributes.' - }] -}; - -exports.askCssProcessor = { - message: 'What css preprocessor would you like to use?', - choices: [{ - value: 'none', - message: 'None', - hint: 'Use standard CSS with no pre-processor.' - }, { - value: 'less', - message: 'Less', - hint: 'Extends the CSS language, adding features that allow variables, mixins, functions and many other techniques.' - }, { - value: 'sass', - message: 'Sass', - hint: 'A mature, stable, and powerful professional grade CSS extension.' - }, { - value: 'stylus', - message: 'Stylus', - hint: 'Expressive, dynamic and robust CSS.' - }] -}; - -exports.askPostCss = { - message: 'Do you want to add PostCSS processing', - choices: [{ - value: 'none', - message: 'None', - hint: 'No PostCSS processing' - }, { - value: 'postcss-basic', - message: 'Basic', - hint: 'With autoprefixer' - }, { - value: 'postcss-typical', - message: 'Typical', - hint: 'With autoprefixer, postcss-url to inline image/font resources, cssnano to minify', - if: 'cli-bundler' - }, { - value: 'postcss-typical', - message: 'Typical', - hint: 'With autoprefixer, plus cssnano to minify', - // don't need postcss-url for webpack, as webpack's css-loader does similar work - if: 'webpack' - }] -}; - -exports.askUnitTestRunner = { - message: 'Which unit test runner would you like to use?', - choices: [{ - value: 'none', - message: 'None', - hint: 'Skip testing. My code is always perfect :-)' - }, { - value: 'karma', - message: 'Karma + Jasmine', - hint: 'Unit testing with Karma and Jasmine' - }, { - value: 'jest', - message: 'Jest', - hint: 'Unit testing with Jest' - }] -}; - -exports.askIntegrationTestRunner = { - message: 'Would you like to configure integration testing?', - choices: [{ - value: 'none', - message: 'None', - hint: 'Skip testing. My code is always perfect :-)' - }, { - value: 'protractor', - message: 'Protractor', - hint: 'Integration testing with Protractor.' - }, { - value: 'cypress', - message: 'Cypress', - hint: "Integration testing with Cypress. Please note: If you've chosen a Typescript, Cypress will add webpack and ts-loader to dependencies due to limited availability of Cypress preprocessors at this point in time." - }] -}; - -exports.askEditor = { - message: 'What is your default code editor?', - choices: [{ - value: 'none', - message: 'None', - hint: 'Skip any editor specific options.' - }, { - value: 'vscode', - message: 'Visual Studio Code', - hint: 'Code editing. Redefined. Free. Open source. Runs everywhere.' - }] - // Removed atom/sublime/webstorm from the editor list, because they are - // no-ops in cli. -}; - -exports.askScaffold = { - message: 'Which features do you want scaffolded into your project?', - choices: [{ - value: 'scaffold-minimum', - message: 'Minimum', - hint: 'Just a bare minimum Aurelia app.' - }, { - value: 'scaffold-navigation', - message: 'Navigation App', - hint: 'Add a router and some sample routes, Bootstrap v4 and Font Awesome v5.' - }] -}; - -exports.askPluginScaffold = { - message: 'Which features do you want scaffolded into your Aurelia plugin project?', - choices: [{ - value: 'plugin-scaffold-minimum', - message: 'None', - hint: 'Just a bare minimum Aurelia plugin with one custom element.' - }, { - value: 'plugin-scaffold-basic', - message: 'Basic', - hint: 'Show examples for custom element, attribute, value converter and binding behavior.' - }] -}; diff --git a/lib/workflow/run-questionnaire.js b/lib/workflow/run-questionnaire.js deleted file mode 100644 index 50e4fa4ec..000000000 --- a/lib/workflow/run-questionnaire.js +++ /dev/null @@ -1,110 +0,0 @@ -const _ = require('lodash'); -const {Select} = require('enquirer'); -const applicable = require('./applicable'); -const prettyChoices = require('./pretty-choices'); -const {Writable} = require('stream'); - -// Get user provided preselectedFeatures, go through all the questions, -// Output a cleaned up features. -// -// _debug is used to pass in answers for prompts. -module.exports = async function(preselectedFeatures = [], questions, unattended, _debug = []) { - preselectedFeatures = _.map(preselectedFeatures, _.toLower); - const pickedFeatures = []; - - async function ask(question) { - let choices = prettyChoices(question.choices); - - choices.forEach(c => { - if (c.value !== 'string' && !c.value.match(/^([a-zA-Z0-9-])*$/)) { - throw new Error(`Value "${c.value}" is invalid. Only accept letters, numbers, and dash(-).`); - } - }); - - // Conditional choices - // {value: 'foo', message: 'Foo', hint: 'lorem', if: 'webpack && typescript'} - choices = choices.filter(c => !c.if || applicable(pickedFeatures, c.if)); - if (choices.length === 0) return; - if (choices.length === 1) { - pickedFeatures.push(choices[0].value); - return; - } - - // Run existing logic to skip question. - // check ./applicable.js for acceptable expression - if (question.if && !applicable(pickedFeatures, question.if)) { - return; - } - - // find the last match, in order to allow user to overwrite - let selected; - let matchingIndex; - _.each(choices, c => { - // skip empty value - if (c.value === 'none') return; - const idx = preselectedFeatures.indexOf(c.value); - if (idx === -1) return; - if (matchingIndex === undefined || matchingIndex < idx) { - matchingIndex = idx; - selected = c.value; - } - }); - - // Inject user selected answer into inquirer answers, - // then skip the question - if (selected) { - pickedFeatures.push(selected); - return; - } - - // Pick default answer in unattended mode - if (unattended) { - const first = _.trim(choices[0].value); - if (first !== 'none') pickedFeatures.push(first); - return true; - } - - // choice index is 1-based. - let debugChoiceIdx = _debug.shift(); - - // All questions are select. - const opts = { - ...question, - choices, - // Default to first choice. - initial: 0, - // https://github.com/enquirer/enquirer/issues/121#issuecomment-468413408 - result(name) { - return this.map(name)[name]; - } - }; - - if (debugChoiceIdx) { - // Silent output in debug mode - opts.stdout = new Writable({write(c, e, cb) {cb();}}); - } - - const prompt = new Select(opts); - - if (debugChoiceIdx) { - prompt.once('run', async() => { - while (debugChoiceIdx-- > 0) { - if (debugChoiceIdx) { - await prompt.keypress(null, { name: 'down' }); - } else { - await prompt.submit(); - } - } - }); - } - - const picked = await prompt.run(); - if (picked !== 'none') pickedFeatures.push(picked); - } - - for (let i = 0, ii = questions.length; i < ii; i++) { - await ask(questions[i]); - } - - return pickedFeatures; -}; diff --git a/lib/workflow/select-features.js b/lib/workflow/select-features.js deleted file mode 100644 index 3b4527783..000000000 --- a/lib/workflow/select-features.js +++ /dev/null @@ -1,146 +0,0 @@ -const runQuestionnaire = require('./run-questionnaire'); -const { - pickPlugin, - askBundler, - askLoader, - askHttp, - askPlatform, - askTranspiler, - askMarkupProcessor, - askCssProcessor, - askPostCss, - askUnitTestRunner, - askIntegrationTestRunner, - askEditor, - askScaffold, - askPluginScaffold, - askDocker -} = require('./questionnaire'); - -// Select features -// @param preselectedFeatures Optional preselected features, they can overwrite recommended features. -// @param opts Optional options, support two boolean options: unattended, plugin. -// -// Preselected features provided answer to some questions of the questionnaire, -// when it's answered, that questions will be skipped. -// -// In unattended mode, all questions without an answer (from features) will get the -// default answer (note: default answer is not always same as recommended feature). -// -// _debug is used to pass in answers for prompts. -module.exports = async function(preselectedFeatures = [], opts = {}, _debug = []) { - const workflow = await selectWorkFlow({ - // If user preselected some features, don't ask them to choose work flow. - unattended: opts.unattended || !!preselectedFeatures.length, - plugin: opts.plugin - }, _debug); - const { flow, recommendedFeatures, unattended } = workflow; - const flowUnattended = opts.unattended || unattended; - - // Allow user to overwrite recommended features. - // Conflicting features will be cleaned up by appFlow/pluginFlow questionnaire. - let features = [...(recommendedFeatures || []), ...preselectedFeatures]; - - if (flow === 'app') { - features = await appFlow(features, flowUnattended, _debug); - } else if (flow === 'plugin') { - features = await pluginFlow(features, flowUnattended, _debug); - } else { - throw new Error(`Workflow "${flow}" is not recognizable.`); - } - - return features; -}; - -// Recommended features are for default workflow choices, you only need to -// add a feature to this list if it's not the default answer of a question. -// For example, unit testing default answer is none (no unit testing), but -// we recommend user to have jest in all our default work flow choices. -const PRESETS = { - 'default-esnext': { flow: 'app', recommendedFeatures: ['jest', 'vscode'], unattended: true }, - 'default-typescript': { flow: 'app', recommendedFeatures: ['jest', 'typescript', 'vscode'], unattended: true }, - 'custom-app': { flow: 'app' }, - 'default-plugin-esnext': { flow: 'plugin', recommendedFeatures: ['jest', 'vscode'], unattended: true }, - 'default-plugin-typescript': { flow: 'plugin', recommendedFeatures: ['jest', 'typescript', 'vscode'], unattended: true }, - 'custom-plugin': { flow: 'plugin' } -}; - -async function selectWorkFlow(opts, _debug) { - let workflow; - - if (opts.unattended) { - // in unattended mode, auto pick the default workflow for app/plugin - workflow = opts.plugin ? 'custom-plugin' : 'custom-app'; - } else { - const ans = await runQuestionnaire([], [{ - message: 'Would you like to use the default setup or customize your choices?', - choices: opts.plugin ? - // plugin flows - [{ - value: 'default-plugin-esnext', - message: 'Default ESNext Aurelia Plugin', - hint: 'A basic Aurelia plugin with Babel' - }, { - value: 'default-plugin-typescript', - message: 'Default TypeScript Aurelia Plugin', - hint: 'A basic Aurelia plugin with TypeScript' - }, { - value: 'custom-plugin', - message: 'Custom Aurelia Plugin', - hint: 'Select transpiler, CSS pre-processor and more.' - }] : - // app flows - [{ - value: 'default-esnext', - message: 'Default ESNext App', - hint: 'A basic app with Babel and Webpack.' - }, { - value: 'default-typescript', - message: 'Default TypeScript App', - hint: 'A basic app with TypeScript and Webpack.' - }, { - value: 'custom-app', - message: 'Custom App', - hint: 'Select bundler, loader, transpiler, CSS pre-processor and more.' - }] - }], false, _debug); - - workflow = ans[0]; - } - - return PRESETS[workflow]; -} - -async function appFlow(features, unattended, _debug) { - return await runQuestionnaire(features, [ - askBundler, - askLoader, - askHttp, - askPlatform, - askTranspiler, - askMarkupProcessor, - askCssProcessor, - askPostCss, - askUnitTestRunner, - askIntegrationTestRunner, - askEditor, - askScaffold, - askDocker - ], unattended, _debug); -} - -async function pluginFlow(features, unattended, _debug) { - return await runQuestionnaire(features, [ - pickPlugin, - askBundler, - askLoader, - askPlatform, - askTranspiler, - askMarkupProcessor, - askCssProcessor, - askPostCss, - askUnitTestRunner, - askEditor, - askPluginScaffold - ], unattended, _debug); -} diff --git a/lib/workflow/write-project/index.js b/lib/workflow/write-project/index.js deleted file mode 100644 index f57920758..000000000 --- a/lib/workflow/write-project/index.js +++ /dev/null @@ -1,11 +0,0 @@ -const prepareProject = require('./prepare-project'); -const writeProject = require('./write-project'); - -module.exports = function(projectName, features, projectFolder, unattended) { - const stream = prepareProject(projectName, features) - .pipe(writeProject(projectFolder, {unattended})); - - return new Promise((resolve, reject) => { - stream.once('error', reject).on('finish', resolve); - }); -}; diff --git a/lib/workflow/write-project/prepare-project.js b/lib/workflow/write-project/prepare-project.js deleted file mode 100644 index 3d0cf197f..000000000 --- a/lib/workflow/write-project/prepare-project.js +++ /dev/null @@ -1,260 +0,0 @@ -const path = require('path'); -const gulp = require('gulp'); -const {preprocess} = require('preprocess'); -const through2 = require('through2'); -const _ = require('lodash'); -const applicable = require('../applicable'); -const {getSupportedVersion} = require('../../dependencies'); - -const DEFAULT_SKELETON = path.resolve(__dirname, '..', '..', '..', 'skeleton'); - -// Prepare project vinyl files, but does not write to disk yet. -// @param projectName Name of the project -// @param features Selected feature set -// @param _skeletonDir Optional stub for testing -module.exports = function(projectName, features = [], _skeletonDir) { - if (!_skeletonDir) _skeletonDir = DEFAULT_SKELETON; - - // Folder "common" is the base template folder - // Note: have to use /**/* on windows, because \**\* doesn't work as expected. - const globs = ['common', ...features].map(f => - path.join(_skeletonDir, f, '**', '*').replace(/\\/g, '/') - ); - - // Include dot files, skip empty folders. - return gulp.src(globs, {dot: true, nodir: true}) - // Extract write policy metadata from some-file.ext__skip-if-exists - // The information is saved on vinyl file for later usage - .pipe(markWritePolicy()) - // Filter by features on some-file.ext__if_sass_or_less - .pipe(filterBy(features)) - // Preprocess file content - .pipe(preprocessContent(projectName, features)) - // Rename file.ext to file.js or file.ts based on feat.babel or feat.typescript - .pipe(replaceExtname('.ext', applicable(features, 'typescript') ? '.ts' : '.js')) - // Merge package.json, aurelia.json and README.md. - // For other duplicated files, take the last one. - .pipe(mergeFiles()) - // Fillup package.json versions - .pipe(fillupVersions()); -}; - -const FILE_WITH_WRITE_POLICY = /__(skip|append|ask)-if-exists/; - -function markWritePolicy() { - return through2.obj((file, enc, cb) => { - if (file.isBuffer()) { - const match = file.basename.match(FILE_WITH_WRITE_POLICY); - if (match) { - const policyStr = match[0]; - const policy = match[1]; - // Only remove the policy token __skip-if-exists - const cleanBasename = file.basename.slice(0, match.index) + - file.basename.slice(match.index + policyStr.length); - // File name becomes some-file.ext or some-file.ext__if_feature - file.basename = cleanBasename; - file.writePolicy = policy; // skip, append, or ask - // If there is no writePolicy on the vinyl file, default behaviour is - // to overwrite existing file. - cb(null, file); - return; - } - } - // No special condition on file name, process as normal - cb(null, file); - }); -} - -const FILTERED_FILE = /^(.+)__if_(.+)$/; - -// filter by features on some-file.ext__if_sass_or_less -function filterBy(features) { - return through2.obj((file, enc, cb) => { - if (file.isBuffer()) { - const parts = file.relative.split(/\\|\//); - const cleanParts = []; - let filtered = false; - - for (let i = 0, ii = parts.length; i < ii; i++) { - const part = parts[i]; - const match = part.match(FILTERED_FILE); - - if (match) { - filtered = true; - const cleanPart = match[1]; - const condition = match[2]; - - if (applicable(features, condition)) { - // Remove __if_x from the part. - cleanParts.push(cleanPart); - } else { - // Not applicable, skip this file - cb(); - return; - } - } else { - cleanParts.push(part); - } - } - - if (filtered) { - file.path = path.join(file.base, ...cleanParts); - cb(null, file); - return; - } - } - - // No special condition on file name, process as normal - cb(null, file); - }); -} - -const BINARY_EXTS = ['.jpeg', '.jpg', '.png', '.gif', '.bmp', '.ico']; - -function preprocessContent(projectName, features) { - // Preprocess context: - // { - // projectName: 'aurelia-app', - // feat: {webpack: true, vscode: true, ...} - // } - const context = { - // Use cleaned up project name - projectName: _.kebabCase(projectName), - feat: {} - }; - features.forEach(feat => context.feat[feat] = true); - - return through2.obj((file, enc, cb) => { - const ext = file.extname.toLowerCase(); - // skip binary files - if (file.isBuffer() && !BINARY_EXTS.includes(ext)) { - // do all other files (including json) with js mode in preprocess - const mode = (ext === '.html' || ext === '.xml') ? 'html' : 'js'; - try { - const contents = preprocess(file.contents.toString('utf8'), context, mode); - file.contents = Buffer.from(contents); - } catch (e) { - throw new Error(`Could not preprocess ${file.path}: ${e.message}`); - } - } - - cb(null, file); - }); -} - -function replaceExtname(ext, newExt) { - return through2.obj((file, enc, cb) => { - if (file.isBuffer() && file.extname === ext) { - file.extname = newExt; - } - cb(null, file); - }); -} - -function mergeFiles() { - const groups = {}; - return through2.obj( - // capture - (file, env, cb) => { - if (file.isBuffer()) { - if (groups[file.relative]) { - groups[file.relative].push(file); - } else { - groups[file.relative] = [file]; - } - cb(); - } else { - cb(null, file); - } - }, - // flush - function(cb) { - _.each(groups, files => { - let file; - if (files.length > 1) { - file = files.reduce(merge); - } else { - file = files[0]; - if (file.extname === '.json') { - // clean up json file - const json = fromJson(file.contents.toString('utf8')); - file.contents = Buffer.from(JSON.stringify(json, null, 2)); - } - } - this.push(file); - }); - cb(); - } - ); -} - -function merge(file, nextFile) { - const relativePath = file.relative.replace(/\\/g, '/'); // normalize windows path - - let merged; - // If we want, we can open up to merge any json file. - // if (file.extname === '.json') - if (relativePath === 'aurelia_project/aurelia.json' || relativePath === 'package.json') { - const json = fromJson(file.contents.toString('utf8')); - const json2 = fromJson(nextFile.contents.toString('utf8')); - _.mergeWith(json, json2, mergeArray); - - if (relativePath === 'aurelia_project/aurelia.json' && _.get(json, 'build.bundles')) { - // after normal merge, there are maybe duplicated bundles config for vendor-bundle - const groups = _.groupBy(json.build.bundles, 'name'); - json.build.bundles = _(groups).values().map(duplicates => - duplicates.reduce((bundle, bundle2) => - // Reverse the merge to make sure the original vendor-bundle - // prepend is in the bottom - _.mergeWith(bundle2, bundle, mergeArray) - ) - ); - } - - file.contents = Buffer.from(JSON.stringify(json, null, 2)); - merged = file; - } else if (relativePath === 'README.md') { - file.contents = Buffer.concat([file.contents, Buffer.from('\n'), nextFile.contents]); - merged = file; - } else { - // for everything else, just use nextFile to overwrite previous file - merged = nextFile; - } - - // allow overwrite writePolicy - merged.writePolicy = nextFile.writePolicy || file.writePolicy; - return merged; -} - -function fromJson(str) { - // Use eval instead of JSON.parse, in order to tolerant malformed json. - // For example, an extra ',' comma due to our preprocess. - // eslint-disable-next-line no-new-func - return (new Function(`const json = ${_.trim(str)}; return json;`))(); -} - -function mergeArray(objValue, srcValue) { - if (_.isArray(objValue) && _.isArray(srcValue)) { - return _.uniq(objValue.concat(srcValue)); - } -} - -const DEP_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies']; - -function fillupVersions() { - return through2.obj( - (file, env, cb) => { - if (file.isBuffer() && file.relative === 'package.json') { - const json = fromJson(file.contents.toString('utf8')); - DEP_FIELDS.forEach(field => { - if (!json[field]) return; - json[field] = _.mapValues(json[field], (version, name) => - version || getSupportedVersion(name) - ); - }); - file.contents = Buffer.from(JSON.stringify(json, null, 2)); - } - cb(null, file); - } - ); -} diff --git a/lib/workflow/write-project/write-project.js b/lib/workflow/write-project/write-project.js deleted file mode 100644 index 40faa669d..000000000 --- a/lib/workflow/write-project/write-project.js +++ /dev/null @@ -1,155 +0,0 @@ -const path = require('path'); -const gulp = require('gulp'); -const Vinyl = require('vinyl'); -const pumpify = require('pumpify'); -const lead = require('lead'); -const through2 = require('through2'); -const {prompt} = require('enquirer'); -const prettyChoices = require('../pretty-choices'); -const fs = require('../../file-system'); -const _ = require('lodash'); -const logger = require('aurelia-logging').getLogger('WriteProject'); - -module.exports = function(targetFolder, opts = {}) { - // _question is an optional stub for easy testing - const {unattended, _question} = opts; - - return lead(pumpify.obj( - askIfExists(targetFolder, unattended, _question), - skipDotnetCsprojIfExists(targetFolder), - instructionsForSkippedFiles(targetFolder), - gulp.dest(targetFolder, { - overwrite: file => file.writePolicy !== 'skip', - append: file => file.writePolicy === 'append', - mode: parseInt('644', 8) // make sure files are writeable - }) - )); -}; - -function askIfExists(targetFolder, unattended, question = askQuestion) { - function exists(relativePath) { - return fs.isFile(path.join(targetFolder, relativePath)); - } - - return through2.obj((file, enc, cb) => { - if (file.isBuffer() && exists(file.relative)) { - if (file.relative.match(/readme(.md|.markdown|.txt|.html)?$/i)) { - // Special treatment for readme file, use append by default - if (!file.writePolicy) file.writePolicy = 'append'; - } else if (file.relative === 'package.json') { - // Special treatment for package.json file - if (file.writePolicy) file.writePolicy = null; - // Merge dependencies to existing package.json - const packageJson = JSON.parse(fs.readFileSync(path.join(targetFolder, 'package.json'), 'utf8')); - const newJson = JSON.parse(file.contents.toString('utf8')); - const deps = _.pick(newJson, 'dependencies', 'devDependencies', 'peerDependencies'); - _.merge(packageJson, deps); - file.contents = Buffer.from(JSON.stringify(packageJson, null, 2)); - } else if (file.writePolicy === 'ask') { - let ask = unattended ? Promise.resolve(false) : question(file.relative); - ask.then(toReplace => { - // Unset write policy - file.writePolicy = null; - if (toReplace) { - logger.warn(`Overwrites existing file '${file.relative}' with a new one designed for Aurelia.`); - } else { - const oldRelative = file.relative; - file.basename = file.basename + '__au-cli'; - logger.warn(`Keeps existing file '${oldRelative}'. New file '${file.relative}' is created. You may need to update existing contents to work with Aurelia.`); - } - cb(null, file); - }); - return; - } - } - - cb(null, file); - }); -} - -// Special treatment of 'project.csproj' file -function skipDotnetCsprojIfExists(targetFolder) { - let hasCsproj = false; - try { - hasCsproj = _.find(fs.readdirSync(targetFolder), f => f.endsWith('.csproj')); - } catch (e) { - // - } - - return through2.obj((file, enc, cb) => { - if (file.isBuffer() && hasCsproj && file.relative === 'project.csproj') { - // skip 'project.csproj' file - cb(); - return; - } - - cb(null, file); - }); -} - -function instructionsForSkippedFiles(targetFolder) { - const skipped = []; - const instructions = {}; - - return through2.obj( - // capture - (file, enc, cb) => { - if (file.isBuffer()) { - if (file.writePolicy === 'skip' && fs.isFile(path.join(targetFolder, file.relative))) { - // This file is to be skipped - skipped.push(file.relative); - } - if (file.basename.endsWith('__instructions')) { - instructions[file.relative.slice(0, -14)] = file.contents.toString('utf8'); - // remove instruction files - cb(); - return; - } - } - cb(null, file); - }, - // flush - cb => { - const text = _(instructions).pick(skipped).values().join('\n'); - if (!text) { - cb(); - return; - } - - const instFileName = 'instructions.txt'; - logger.warn('Manual changes are necessary:\n'); - console.log(text + '\n'); - logger.info(`If you would like to do this at a later time, we've written these instructions to a file called '${instFileName}' in the project directory for you.\n`); - - const cwd = process.cwd(); - const base = path.join(cwd, targetFolder); - const instFile = new Vinyl({ - cwd, - base, - path: path.join(base, instFileName), - contents: Buffer.from(text) - }); - cb(null, instFile); - } - ); -} - -async function askQuestion(relativePath) { - const {decision} = await prompt({ - type: 'select', - name: 'decision', - initial: 'keep', - message: `An existing file named '${relativePath}' was found. What would you like to do?`, - choices: prettyChoices({ - value: 'keep', - message: 'Keep the existing file', - hint: `Keeps your existing file. New file will be created as '${relativePath}__au-cli'. You may need to update existing contents to work with Aurelia.` - }, { - value: 'replace', - message: 'Replace the existing file ', - hint: 'Replaces the existing file with a new one designed for Aurelia.' - }) - }); - - return decision === 'replace'; -} diff --git a/package.json b/package.json index e03293ca1..af2b7d6b5 100644 --- a/package.json +++ b/package.json @@ -62,19 +62,16 @@ "enquirer": "^2.3.5", "esprima": "^4.0.1", "events": "^3.1.0", - "glob": "^7.1.6", "gulp": "^4.0.2", "htmlparser2": "^4.1.0", "https-browserify": "^1.0.0", - "lead": "^3.0.0", "lodash": "^4.17.15", "map-stream": "0.0.7", + "minimatch": "^3.0.4", "npm-which": "^3.0.1", "os-browserify": "^0.3.0", "path-browserify": "1.0.1", - "preprocess": "^3.2.0", "process": "^0.11.10", - "pumpify": "^2.0.1", "punycode": "^2.1.1", "querystring-es3": "1.0.0-0", "readable-stream": "^3.6.0", @@ -84,7 +81,6 @@ "stream-http": "^3.1.0", "string_decoder": "^1.3.0", "terser": "^4.6.12", - "through2": "^3.0.1", "timers-browserify": "^2.0.11", "tty-browserify": "0.0.1", "typescript": "^3.8.3", @@ -95,21 +91,16 @@ "devDependencies": { "@types/node": "^13.13.4", "babel-eslint": "^10.1.0", - "copyfiles": "^2.2.0", "gulp-bump": "^3.1.3", "gulp-clean": "^0.4.0", "gulp-conventional-changelog": "^2.0.29", "gulp-eslint": "^6.0.0", "jasmine": "^3.5.0", "jasmine-spec-reporter": "^5.0.2", - "latest-version": "^5.1.0", - "minimatch": "^3.0.4", "mock-fs": "^4.12.0", "nodemon": "^2.0.3", "nyc": "^15.0.1", - "puppeteer": "^3.0.2", "rimraf": "^3.0.2", - "tree-kill": "^1.2.2", "yargs": "^15.3.1" } } diff --git a/skeleton/cli-bundler/README.md b/skeleton/cli-bundler/README.md deleted file mode 100644 index d3b9daae9..000000000 --- a/skeleton/cli-bundler/README.md +++ /dev/null @@ -1,23 +0,0 @@ -For more information, go to https://aurelia.io/docs/cli/cli-bundler - -## Run dev app - -Run `au run`, then open `http://localhost:/* @if feat.web */9000/* @endif *//* @if feat['dotnet-core'] */5000/* @endif */` - -To open browser automatically, do `au run --open`. - -To change dev server port, do `au run --port 8888`. - -To change dev server host, do `au run --host 127.0.0.1` - -// @if feat.babel -To install new npm packages automatically, do `au run --auto-install` -// @endif - -**PS:** You could mix all the flags as well, `au run --host 127.0.0.1 --port 7070 --open` - -// @if !feat.plugin -## Build for production - -Run `au build --env prod`. -// @endif diff --git a/skeleton/cli-bundler/aurelia_project/aurelia.json b/skeleton/cli-bundler/aurelia_project/aurelia.json deleted file mode 100644 index b40a90292..000000000 --- a/skeleton/cli-bundler/aurelia_project/aurelia.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "transpiler": { - // @if feat.babel - "options": { - "plugins": [ - ["@babel/plugin-transform-modules-amd", {"loose": true}] - ] - }, - - "source": [ - // @if feat.plugin - "dev-app/**/*.js", - // @endif - "src/**/*.js" - ], - // @endif - - // @if feat.typescript - "dtsSource": ["./types/**/*.d.ts"], - "source": [ - // @if feat.plugin - "dev-app/**/*.ts", - // @endif - "src/**/*.ts" - ], - // @endif - }, - "markupProcessor": { - "source": [ - // @if feat.plugin - "dev-app/**/*.html", - // @endif - "src/**/*.html" - ], - }, - "cssProcessor": { - // @if ! (feat.less || feat.sass || feat.stylus) - "source": [ - // @if feat.plugin - "dev-app/**/*.css", - // @endif - "src/**/*.css" - ], - // @endif - - // @if feat.less - "source": [ - // @if feat.plugin - "dev-app/**/*.less", - // @endif - "src/**/*.less" - ], - // @endif - - // @if feat.sass - "source": [ - // @if feat.plugin - "dev-app/**/*.scss", - // @endif - "src/**/*.scss" - ], - // @endif - - // @if feat.stylus - "source": [ - // @if feat.plugin - "dev-app/**/*.styl", - // @endif - "src/**/*.styl" - ], - // @endif - }, - "jsonProcessor": { - "source": [ - // @if feat.plugin - "dev-app/**/*.json", - // @endif - "src/**/*.json" - ], - }, - // @if feat.karma - "unitTestRunner": { - // @if feat.babel - "source": "test/unit/**/*.js", - // @endif - // @if feat.typescript - "source": "test/unit/**/*.ts", - // @endif - }, - "testFramework": { - "id": "jasmine" - }, - // @endif - "platform": { - // @if feat.web - "port": 9000, - "host": "localhost", - "open": false, - "index": "index.html", - "baseDir": ".", - "output": "scripts", - // @endif - - // @if feat['dotnet-core'] - "port": 5000, - "host": "localhost", - "index": "wwwroot/index.html", - "baseDir": "./wwwroot", - "baseUrl": "scripts", - "output": "wwwroot/scripts", - // @endif - }, - "build": { - "targets": [ - // @if feat.web - { - "port": 9000, - "index": "index.html", - "baseDir": ".", - "output": "scripts" - }, - // @endif - - // @if feat['dotnet-core'] - { - "port": 5000, - "index": "wwwroot/index.html", - "baseDir": "./wwwroot", - "baseUrl": "scripts", - "output": "wwwroot/scripts" - } - // @endif - ], - "options": { - "minify": "stage & prod", - "sourcemaps": "dev & stage", - "rev": "prod", - "cache": "dev & stage" - }, - "bundles": [ - { - "name": "app-bundle.js", - "source": [ - "**/*.{js,json,css,html}" - ] - }, - { - "name": "vendor-bundle.js", - "prepend": [ - "node_modules/promise-polyfill/dist/polyfill.min.js", - // @if feat.requirejs - "node_modules/requirejs/require.js" - // @endif - // @if feat.alameda - "node_modules/alameda/alameda.js" - // @endif - // @if feat.systemjs - "node_modules/systemjs/dist/system.js" - // @endif - ], - "dependencies": [ - "aurelia-bootstrapper", - "aurelia-loader-default", - "aurelia-pal-browser", - { - "name": "aurelia-testing", - "env": "dev" - }, - // @if feat.requirejs || feat.alameda - "text", - // @endif - // @if feat.systemjs - { - "name": "text", - "path": "../node_modules/systemjs-plugin-text", - "main": "text" - } - // @endif - ] - } - ], - "loader": { - // @if feat.requirejs || feat.alameda - "type": "require", - // @endif - // @if feat.systemjs - "type": "system", - // @endif - "configTarget": "vendor-bundle.js", - "includeBundleMetadataInConfig": "auto", - "plugins": [ - { - "name": "text", - "extensions": [ - ".html", - ".css" - ], - "stub": false - } - ] - } - } -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/build.ext b/skeleton/cli-bundler/aurelia_project/tasks/build.ext deleted file mode 100644 index d8ec565f6..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/build.ext +++ /dev/null @@ -1,48 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import project from '../aurelia.json'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as project from '../aurelia.json'; -// @endif -import {CLIOptions, build as buildCLI} from 'aurelia-cli'; -import transpile from './transpile'; -import processMarkup from './process-markup'; -import processJson from './process-json'; -import processCSS from './process-css'; -import copyFiles from './copy-files'; -import watch from './watch'; - -let build = gulp.series( - readProjectConfiguration, - gulp.parallel( - transpile, - processMarkup, - processJson, - processCSS, - copyFiles - ), - writeBundles -); - -let main; - -if (CLIOptions.taskName() === 'build' && CLIOptions.hasFlag('watch')) { - main = gulp.series( - build, - (done) => { watch(); done(); } - ); -} else { - main = build; -} - -function readProjectConfiguration() { - return buildCLI.src(project); -} - -function writeBundles() { - return buildCLI.dest(); -} - -export { main as default }; diff --git a/skeleton/cli-bundler/aurelia_project/tasks/build.json b/skeleton/cli-bundler/aurelia_project/tasks/build.json deleted file mode 100644 index ada5ca483..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/build.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "build", - "description": "Builds and processes all application assets.", - "flags": [ - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "watch", - "description": "Watches source files for changes and refreshes the bundles automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/clear-cache.json b/skeleton/cli-bundler/aurelia_project/tasks/clear-cache.json deleted file mode 100644 index 4529ae970..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/clear-cache.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "clear-cache", - "description": "Clear both transpile cache (only for esnext), and tracing-cache (for CLI built-in tracer)." -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/copy-files.ext b/skeleton/cli-bundler/aurelia_project/tasks/copy-files.ext deleted file mode 100644 index e4ee4b55a..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/copy-files.ext +++ /dev/null @@ -1,51 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import path from 'path'; -import minimatch from 'minimatch'; -import project from '../aurelia.json'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as path from 'path'; -import * as minimatch from 'minimatch'; -import * as project from '../aurelia.json'; -// @endif - -export default function copyFiles(done) { - if (typeof project.build.copyFiles !== 'object') { - done(); - return; - } - - const instruction = getNormalizedInstruction(); - const files = Object.keys(instruction); - - return gulp.src(files, {since: gulp.lastRun(copyFiles)}) - .pipe(gulp.dest(x => { - const filePath = prepareFilePath(x.path); - const key = files.find(f => minimatch(filePath, f)); - return instruction[key]; - })); -} - -function getNormalizedInstruction() { - const files = project.build.copyFiles; - let normalizedInstruction = {}; - - for (let key in files) { - normalizedInstruction[path.posix.normalize(key)] = files[key]; - } - - return normalizedInstruction; -} - -function prepareFilePath(filePath) { - let preparedPath = filePath.replace(process.cwd(), '').slice(1); - - //if we are running on windows we have to fix the path - if (/^win/.test(process.platform)) { - preparedPath = preparedPath.replace(/\\/g, '/'); - } - - return preparedPath; -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/lint.ext b/skeleton/cli-bundler/aurelia_project/tasks/lint.ext deleted file mode 100644 index e44d2bb87..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/lint.ext +++ /dev/null @@ -1,17 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import eslint from 'gulp-eslint'; -import project from '../aurelia.json'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as eslint from 'gulp-eslint'; -import * as project from '../aurelia.json'; -// @endif - -export default function lint() { - return gulp.src(project.transpiler.source) - .pipe(eslint()) - .pipe(eslint.format()) - .pipe(eslint.failAfterError()); -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/lint.json b/skeleton/cli-bundler/aurelia_project/tasks/lint.json deleted file mode 100644 index 105c56382..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/lint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "lint", - "description": "Lint source files", - "flags": [ - ] -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/process-css.ext b/skeleton/cli-bundler/aurelia_project/tasks/process-css.ext deleted file mode 100644 index 80934f2c0..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/process-css.ext +++ /dev/null @@ -1,113 +0,0 @@ -import {build} from 'aurelia-cli'; -// @if feat.babel -import gulp from 'gulp'; -import project from '../aurelia.json'; -// @if feat.less || feat.stylus -import plumber from 'gulp-plumber'; -import notify from 'gulp-notify'; -// @endif -// @if feat.less -import less from 'gulp-less'; -// @endif -// @if feat.sass -import sass from 'gulp-dart-sass'; -// @endif -// @if feat.stylus -import stylus from 'gulp-stylus'; -// @endif -// @if feat['postcss-basic'] || feat['postcss-typical'] -import postcss from 'gulp-postcss'; -import autoprefixer from 'autoprefixer'; -// @endif -// @if feat['postcss-typical'] -import cssnano from 'cssnano'; -import postcssUrl from 'postcss-url'; -// @endif -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as project from '../aurelia.json'; -// @if feat.less || feat.stylus -import * as plumber from 'gulp-plumber'; -import * as notify from 'gulp-notify'; -// @endif -// @if feat.less -import * as less from 'gulp-less'; -// @endif -// @if feat.sass -import * as sass from 'gulp-dart-sass'; -// @endif -// @if feat.stylus -import * as stylus from 'gulp-stylus'; -// @endif -// @if feat['postcss-basic'] || feat['postcss-typical'] -import * as postcss from 'gulp-postcss'; -import * as autoprefixer from 'autoprefixer'; -// @endif -// @if feat['postcss-typical'] -import * as cssnano from 'cssnano'; -import * as postcssUrl from 'postcss-url'; -// @endif -// @endif - -export default function processCSS() { - return gulp.src(project.cssProcessor.source, {sourcemaps: true/* @if !feat.less && !feat.sass && !feat.stylus */, since: gulp.lastRun(processCSS)/* @endif */}) - // @if feat.less || feat.stylus - .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') })) - // @endif - // @if feat.less - .pipe(less()) - // @endif - // @if feat.sass - .pipe(sass.sync().on('error', sass.logError)) - // @endif - // @if feat.stylus - .pipe(stylus()) - // @endif - // @if feat['postcss-basic'] - .pipe(postcss([ - autoprefixer() - ])) - // @endif - // @if feat['postcss-typical'] - .pipe(postcss([ - autoprefixer(), - postcssUrl({url: 'inline', encodeType: 'base64'}), - cssnano() - ])) - // @endif - .pipe(build.bundle()); -} - -// @if feat.plugin -export function pluginCSS(dest) { - return function processPluginCSS() { - return gulp.src(project.plugin.source.css) - // @if feat.less || feat.stylus - .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') })) - // @endif - // @if feat.less - .pipe(less()) - // @endif - // @if feat.sass - .pipe(sass.sync().on('error', sass.logError)) - // @endif - // @if feat.stylus - .pipe(stylus()) - // @endif - // @if feat['postcss-basic'] - .pipe(postcss([ - autoprefixer() - ])) - // @endif - // @if feat['postcss-typical'] - .pipe(postcss([ - autoprefixer(), - postcssUrl({url: 'inline', encodeType: 'base64'}), - cssnano() - ])) - // @endif - .pipe(gulp.dest(dest)); - }; -} -// @endif diff --git a/skeleton/cli-bundler/aurelia_project/tasks/process-json.ext b/skeleton/cli-bundler/aurelia_project/tasks/process-json.ext deleted file mode 100644 index aba3ec037..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/process-json.ext +++ /dev/null @@ -1,23 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import project from '../aurelia.json'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as project from '../aurelia.json'; -// @endif -import {build} from 'aurelia-cli'; - -export default function processJson() { - return gulp.src(project.jsonProcessor.source, {since: gulp.lastRun(processJson)}) - .pipe(build.bundle()); -} - -// @if feat.plugin -export function pluginJson(dest) { - return function processPluginJson() { - return gulp.src(project.plugin.source.json) - .pipe(gulp.dest(dest)); - }; -} -// @endif diff --git a/skeleton/cli-bundler/aurelia_project/tasks/process-markup.ext b/skeleton/cli-bundler/aurelia_project/tasks/process-markup.ext deleted file mode 100644 index 3381b57ef..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/process-markup.ext +++ /dev/null @@ -1,66 +0,0 @@ -import {build} from 'aurelia-cli'; -// @if feat.babel -import gulp from 'gulp'; -import project from '../aurelia.json'; -// @if feat['htmlmin-min'] || feat['htmlmin-max'] -import htmlmin from 'gulp-htmlmin'; -import plumber from 'gulp-plumber'; -import notify from 'gulp-notify'; -// @endif -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as project from '../aurelia.json'; -// @if feat['htmlmin-min'] || feat['htmlmin-max'] -import * as htmlmin from 'gulp-htmlmin'; -import * as plumber from 'gulp-plumber'; -import * as notify from 'gulp-notify'; -// @endif -// @endif - -export default function processMarkup() { - return gulp.src(project.markupProcessor.source, {sourcemaps: true, since: gulp.lastRun(processMarkup)}) - // @if feat['htmlmin-min'] || feat['htmlmin-max'] - .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) - .pipe(htmlmin({ - // @if feat['htmlmin-max'] - collapseInlineTagWhitespace: true, - collapseBooleanAttributes: true, - removeAttributeQuotes: true, - removeScriptTypeAttributes: true, - removeStyleLinkTypeAttributes: true, - // @endif - removeComments: true, - collapseWhitespace: true, - minifyCSS: true, - minifyJS: true, - ignoreCustomFragments: [/\${.*?}/g] // ignore interpolation expressions - })) - // @endif - .pipe(build.bundle()); -} - -// @if feat.plugin -export function pluginMarkup(dest) { - return function processPluginMarkup() { - return gulp.src(project.plugin.source.html) - // @if feat['htmlmin-min'] || feat['htmlmin-max'] - .pipe(htmlmin({ - // @if feat['htmlmin-max'] - collapseInlineTagWhitespace: true, - collapseBooleanAttributes: true, - removeAttributeQuotes: true, - removeScriptTypeAttributes: true, - removeStyleLinkTypeAttributes: true, - // @endif - removeComments: true, - collapseWhitespace: true, - minifyCSS: true, - minifyJS: true, - ignoreCustomFragments: [/\${.*?}/g] // ignore interpolation expressions - })) - // @endif - .pipe(gulp.dest(dest)); - }; -} -// @endif diff --git a/skeleton/cli-bundler/aurelia_project/tasks/run.ext b/skeleton/cli-bundler/aurelia_project/tasks/run.ext deleted file mode 100644 index 7283c5150..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/run.ext +++ /dev/null @@ -1,69 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import browserSync from 'browser-sync'; -import historyApiFallback from 'connect-history-api-fallback/lib'; -import project from '../aurelia.json'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as browserSync from 'browser-sync'; -import * as historyApiFallback from 'connect-history-api-fallback/lib'; -import * as project from '../aurelia.json'; -// @endif -import {CLIOptions} from 'aurelia-cli'; -import build from './build'; -import watch from './watch'; - -const bs = browserSync.create(); - -let serve = gulp.series( - build, - done => { - bs.init({ - online: false, - open: CLIOptions.hasFlag('open') || project.platform.open, - port: CLIOptions.getFlagValue('port') || project.platform.port, - host: CLIOptions.getFlagValue('host') || project.platform.host || "localhost", - logLevel: 'silent', - server: { - baseDir: [project.platform.baseDir], - middleware: [historyApiFallback(), function(req, res, next) { - res.setHeader('Access-Control-Allow-Origin', '*'); - next(); - }] - } - }, function (err, bs) { - if (err) return done(err); - let urls = bs.options.get('urls').toJS(); - let host = bs.options.get('host'); - let port = bs.options.get('port'); - - if( host !== "localhost" ) - log(`Application Available At: http://${host}:${port}`); - - log(`Application Available At: ${urls.local}`); - log(`BrowserSync Available At: ${urls.ui}`); - done(); - }); - } -); - -function log(message) { - console.log(message); //eslint-disable-line no-console -} - -function reload() { - log('Refreshing the browser'); - bs.reload(); -} - -const run = gulp.series( - serve, - done => { watch(reload); done(); } -); - -const shutdownAppServer = () => { - bs.exit(); -}; - -export { run as default, serve , shutdownAppServer }; diff --git a/skeleton/cli-bundler/aurelia_project/tasks/run.json b/skeleton/cli-bundler/aurelia_project/tasks/run.json deleted file mode 100644 index 9de7be11d..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/run.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "run", - "description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.", - "flags": [ - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "open", - "description": "Open the default browser at the application location.", - "type": "boolean" - }, - // @if feat.babel - { - "name": "auto-install", - "description": "auto install missing npm package using npm or yarn (set by aurelia.json packageManager, or existence of yarn.lock file).", - "type": "boolean" - }, - // @endif - { - "name": "host", - "description": "Set host address of the dev server, the accessible URL", - "type": "string" - }, - { - "name": "port", - "description": "Set port number of the dev server", - "type": "string" - } - ] -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks/watch.ext b/skeleton/cli-bundler/aurelia_project/tasks/watch.ext deleted file mode 100644 index f83274795..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks/watch.ext +++ /dev/null @@ -1,139 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import minimatch from 'minimatch'; -import gulpWatch from 'gulp-watch'; -import debounce from 'debounce'; -import project from '../aurelia.json'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as minimatch from 'minimatch'; -import * as gulpWatch from 'gulp-watch'; -import * as debounce from 'debounce'; -import * as project from '../aurelia.json'; -// @endif -import transpile from './transpile'; -import processMarkup from './process-markup'; -import processCSS from './process-css'; -import processJson from './process-json'; -import copyFiles from './copy-files'; -import { build } from 'aurelia-cli'; - -const debounceWaitTime = 100; -let isBuilding = false; -let pendingRefreshPaths = []; -let watchCallback = () => { }; -let watches = [ - { name: 'transpile', callback: transpile, source: project.transpiler.source }, - { name: 'markup', callback: processMarkup, source: project.markupProcessor.source }, - { name: 'CSS', callback: processCSS, source: project.cssProcessor.source }, - { name: 'JSON', callback: processJson, source: project.jsonProcessor.source } -]; - -if (typeof project.build.copyFiles === 'object') { - for (let src of Object.keys(project.build.copyFiles)) { - watches.push({ name: 'file copy', callback: copyFiles, source: src }); - } -} - -let watch = (callback) => { - watchCallback = callback || watchCallback; - - // watch every glob individually - for(let watcher of watches) { - if (Array.isArray(watcher.source)) { - for(let glob of watcher.source) { - watchPath(glob); - } - } else { - watchPath(watcher.source); - } - } -}; - -let watchPath = (p) => { - gulpWatch( - p, - { - read: false, // performance optimization: do not read actual file contents - verbose: true - }, - (vinyl) => processChange(vinyl)); -}; - -let processChange = (vinyl) => { - if (vinyl.path && vinyl.cwd && vinyl.path.startsWith(vinyl.cwd)) { - let pathToAdd = vinyl.path.slice(vinyl.cwd.length + 1); - log(`Watcher: Adding path ${pathToAdd} to pending build changes...`); - pendingRefreshPaths.push(pathToAdd); - refresh(); - } -} - -let refresh = debounce(() => { - if (isBuilding) { - log('Watcher: A build is already in progress, deferring change detection...'); - return; - } - - isBuilding = true; - - let paths = pendingRefreshPaths.splice(0); - let refreshTasks = []; - - // determine which tasks need to be executed - // based on the files that have changed - for (let watcher of watches) { - if (Array.isArray(watcher.source)) { - for(let source of watcher.source) { - if (paths.find(path => minimatch(path, source))) { - refreshTasks.push(watcher); - } - } - } - else { - if (paths.find(path => minimatch(path, watcher.source))) { - refreshTasks.push(watcher); - } - } - } - - if (refreshTasks.length === 0) { - log('Watcher: No relevant changes found, skipping next build.'); - isBuilding = false; - return; - } - - log(`Watcher: Running ${refreshTasks.map(x => x.name).join(', ')} tasks on next build...`); - - let toExecute = gulp.series( - readProjectConfiguration, - gulp.parallel(refreshTasks.map(x => x.callback)), - writeBundles, - (done) => { - isBuilding = false; - watchCallback(); - done(); - if (pendingRefreshPaths.length > 0) { - log('Watcher: Found more pending changes after finishing build, triggering next one...'); - refresh(); - } - } - ); - - toExecute(); -}, debounceWaitTime); - -function log(message/* @if feat.typescript **: string/* @endif */) { - console.log(message); -} - -function readProjectConfiguration() { - return build.src(project); -} - -function writeBundles() { - return build.dest(); -} - -export default watch; \ No newline at end of file diff --git a/skeleton/cli-bundler/aurelia_project/tasks__if_babel/clear-cache.js b/skeleton/cli-bundler/aurelia_project/tasks__if_babel/clear-cache.js deleted file mode 100644 index 3ae04376c..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks__if_babel/clear-cache.js +++ /dev/null @@ -1,16 +0,0 @@ -import gulp from 'gulp'; -import {build} from 'aurelia-cli'; -import cache from 'gulp-cache'; - -function clearTraceCache() { - return build.clearCache(); -} - -function clearTranspileCache() { - return cache.clearAll(); -} - -export default gulp.series( - clearTraceCache, - clearTranspileCache -); diff --git a/skeleton/cli-bundler/aurelia_project/tasks__if_babel/transpile.js b/skeleton/cli-bundler/aurelia_project/tasks__if_babel/transpile.js deleted file mode 100644 index 9531742ac..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks__if_babel/transpile.js +++ /dev/null @@ -1,84 +0,0 @@ -import gulp from 'gulp'; -import plumber from 'gulp-plumber'; -import babel from 'gulp-babel'; -import notify from 'gulp-notify'; -import rename from 'gulp-rename'; -import cache from 'gulp-cache'; -import project from '../aurelia.json'; -import fs from 'fs'; -import through from 'through2'; -import { CLIOptions, build, Configuration } from 'aurelia-cli'; -// @if feat.plugin -import * as gulpSourcemaps from 'gulp-sourcemaps'; -// @endif - -let env = CLIOptions.getEnvironment(); -const buildOptions = new Configuration(project.build.options); -const useCache = buildOptions.isApplicable('cache'); - -function configureEnvironment() { - return gulp.src(`aurelia_project/environments/${env}.js`, { - since: gulp.lastRun(configureEnvironment) - }) - .pipe(rename('environment.js')) - .pipe(through.obj(function (file, _, cb) { - // https://github.com/aurelia/cli/issues/1031 - fs.unlink(`${project.paths.root}/${file.relative}`, function () { - cb(null, file); - }); - })) - .pipe(gulp.dest(project.paths.root)); -} - -function buildJavaScript() { - let transpile = babel(project.transpiler.options); - if (useCache) { - // the cache directory is "gulp-cache/projName-env" inside folder require('os').tmpdir() - // use command 'au clear-cache' to purge all caches - transpile = cache(transpile, { - name: project.name + '-' + env - }); - } - - return gulp.src(project.transpiler.source, { - sourcemaps: true, - since: gulp.lastRun(buildJavaScript) - }) - .pipe(plumber({ - errorHandler: notify.onError('Error: <%= error.message %>') - })) - .pipe(transpile) - .pipe(build.bundle()); -} - -export default gulp.series( - configureEnvironment, - buildJavaScript -); - -// @if feat.plugin -export function buildPluginJavaScript(dest, format) { - return function processPluginJavaScript() { - let opts = {}; - if (format === 'commonjs') { - opts = { - plugins: [ - ['@babel/plugin-transform-modules-commonjs', { - loose: true - }] - ] - }; - } - const transpile = babel(opts); - - return gulp.src(project.plugin.source.js) - .pipe(gulpSourcemaps.init()) - .pipe(transpile) - .pipe(gulpSourcemaps.write('.', { - includeContent: false, - sourceRoot: '../../src/' - })) - .pipe(gulp.dest(dest)); - }; -} -// @endif diff --git a/skeleton/cli-bundler/aurelia_project/tasks__if_typescript/clear-cache.ts b/skeleton/cli-bundler/aurelia_project/tasks__if_typescript/clear-cache.ts deleted file mode 100644 index b4644d92b..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks__if_typescript/clear-cache.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as gulp from 'gulp'; -import {build} from 'aurelia-cli'; - -export default function clearCache() { - return build.clearCache(); -} diff --git a/skeleton/cli-bundler/aurelia_project/tasks__if_typescript/transpile.ts b/skeleton/cli-bundler/aurelia_project/tasks__if_typescript/transpile.ts deleted file mode 100644 index c65f31d6a..000000000 --- a/skeleton/cli-bundler/aurelia_project/tasks__if_typescript/transpile.ts +++ /dev/null @@ -1,63 +0,0 @@ -import * as gulp from 'gulp'; -import * as plumber from 'gulp-plumber'; -import * as notify from 'gulp-notify'; -import * as rename from 'gulp-rename'; -import * as ts from 'gulp-typescript'; -import * as project from '../aurelia.json'; -import * as fs from 'fs'; -import * as through from 'through2'; -import { CLIOptions, build, Configuration } from 'aurelia-cli'; -// @if feat.plugin -import * as gulpSourcemaps from 'gulp-sourcemaps'; -// @endif - -function configureEnvironment() { - let env = CLIOptions.getEnvironment(); - - return gulp.src(`aurelia_project/environments/${env}.ts`, { since: gulp.lastRun(configureEnvironment) }) - .pipe(rename('environment.ts')) - .pipe(through.obj(function (file, _, cb) { - // https://github.com/aurelia/cli/issues/1031 - fs.unlink(`${project.paths.root}/${file.relative}`, function () { cb(null, file); }); - })) - .pipe(gulp.dest(project.paths.root)); -} - -function buildTypeScript() { - const typescriptCompiler = ts.createProject('tsconfig.json', { - typescript: require('typescript') - }); - - return gulp.src(project.transpiler.dtsSource) - .pipe(gulp.src(project.transpiler.source, { - sourcemaps: true, - since: gulp.lastRun(buildTypeScript) - })) - .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') })) - .pipe(typescriptCompiler()) - .pipe(build.bundle()); -} - -export default gulp.series( - configureEnvironment, - buildTypeScript -); - -// @if feat.plugin -export function buildPluginJavaScript(dest, format) { - // when format is missing, default is ESM as we turned off "modules": false in .babelrc.js - return function processPluginJavaScript() { - const typescriptCompiler = ts.createProject('tsconfig.json', { - typescript: require('typescript'), - module: format - }); - - return gulp.src(project.transpiler.dtsSource) - .pipe(gulp.src(project.plugin.source.js)) - .pipe(gulpSourcemaps.init()) - .pipe(typescriptCompiler()) - .pipe(gulpSourcemaps.write('.', { includeContent: false, sourceRoot: '../../src/' })) - .pipe(gulp.dest(dest)); - }; -} -// @endif diff --git a/skeleton/cli-bundler/index.html__ask-if-exists__if_not_dotnet-core b/skeleton/cli-bundler/index.html__ask-if-exists__if_not_dotnet-core deleted file mode 100644 index 4c28466dc..000000000 --- a/skeleton/cli-bundler/index.html__ask-if-exists__if_not_dotnet-core +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Aurelia - - - - - - - - - - - - - diff --git a/skeleton/cli-bundler/package.json b/skeleton/cli-bundler/package.json deleted file mode 100644 index 4e826bc6d..000000000 --- a/skeleton/cli-bundler/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "devDependencies": { - // @if feat.requirejs - "requirejs": "", - // @endif - // @if feat.alameda - "alameda": "", - // @endif - // @if feat.requirejs || feat.alameda - "text": "", - // @endif - // @if feat.systemjs - "systemjs": "", - "systemjs-plugin-text": "", - // @endif - - "babel-eslint": "", - "gulp-eslint": "", - - // @if feat.babel - "@babel/plugin-proposal-decorators": "", - "@babel/plugin-proposal-class-properties": "", - "@babel/preset-env": "", - "@babel/core": "", - "@babel/register": "", - "gulp-babel": "", - "gulp-cache": "", - // @endif - - // @if feat.typescript - "gulp-typescript": "", - "typescript": "", - "@types/node": "", - "@typescript-eslint/eslint-plugin": "", - "@typescript-eslint/parser": "", - // @endif - - // @if feat.less - "gulp-less": "", - // @endif - - // @if feat['postcss-basic'] || feat['postcss-typical'] - "gulp-postcss": "", - "autoprefixer": "", - // @endif - // @if feat['postcss-typical'] - "cssnano": "", - "postcss-url": "", - // @endif - - // @if feat.sass - "gulp-dart-sass": "", - // @endif - - // @if feat.stylus - "gulp-stylus": "", - // @endif - - // @if feat['htmlmin-min'] || feat['htmlmin-max'] - "gulp-htmlmin": "", - // @endif - - "browser-sync": "", - "connect-history-api-fallback": "", - "debounce": "", - "gulp-plumber": "", - "gulp-rename": "", - "gulp-notify": "", - "gulp-watch": "", - } -} diff --git a/skeleton/common/.editorconfig__skip-if-exists b/skeleton/common/.editorconfig__skip-if-exists deleted file mode 100644 index 26692da27..000000000 --- a/skeleton/common/.editorconfig__skip-if-exists +++ /dev/null @@ -1,12 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -# 2 space indentation -indent_style = space -indent_size = 2 diff --git a/skeleton/common/.eslintrc.json b/skeleton/common/.eslintrc.json deleted file mode 100644 index 27be4ab4a..000000000 --- a/skeleton/common/.eslintrc.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "root": true, - - // @if feat.babel - "extends": "eslint:recommended", - "parser": "babel-eslint", - // @endif - - // @if feat.typescript - "parser": "@typescript-eslint/parser", // Specifies the ESLint parser - "plugins": ["@typescript-eslint"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - // @endif - - "parserOptions": { - "ecmaVersion": 2019, - "sourceType": "module", - // @if feat.babel - "ecmaFeatures": { - "legacyDecorators": true - } - // @endif - // @if feat.typescript - "project": "./tsconfig.json", - "tsconfigRootDir": '.', - // @endif - }, - - "rules": { - "no-unused-vars": 0, - "no-prototype-builtins": 0, - "no-console": 0, - "getter-return": 0 - }, - - "env": { - "es6": true, - "browser": true, - "node": true, - // @if feat.karma - "jasmine": true, - // @endif - // @if feat.jest - "jest": true, - // @endif - } -} \ No newline at end of file diff --git a/skeleton/common/.gitignore__append-if-exists b/skeleton/common/.gitignore__append-if-exists deleted file mode 100644 index d4d23b9d5..000000000 --- a/skeleton/common/.gitignore__append-if-exists +++ /dev/null @@ -1,39 +0,0 @@ - -# You may want to customise this file depending on your Operating System -# and the editor that you use. -# -# We recommend that you use a Global Gitignore for files that are not related -# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore) - -# OS -# -# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore -.DS_STORE -Thumbs.db - -# Editors -# -# Ref: https://github.com/github/gitignore/blob/master/Global -# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore -# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore -.idea -.chrome -/*.log -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -# Dependencies -node_modules - -# Compiled files -/scripts -/src/environment.js -/src/environment.ts -/dist -/test/coverage-jest -/test/coverage-karma diff --git a/skeleton/common/README.md__skip-if-exists b/skeleton/common/README.md__skip-if-exists deleted file mode 100644 index bb4a55817..000000000 --- a/skeleton/common/README.md__skip-if-exists +++ /dev/null @@ -1,3 +0,0 @@ -# `/* @echo projectName */` - -This project is bootstrapped by [aurelia-cli](https://github.com/aurelia/cli). diff --git a/skeleton/common/aurelia_project/aurelia.json b/skeleton/common/aurelia_project/aurelia.json deleted file mode 100644 index 25551a12b..000000000 --- a/skeleton/common/aurelia_project/aurelia.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "/* @echo projectName */", - "type": "project:application", - "paths": { - "root": "src", - "resources": "resources", - "elements": "resources/elements", - "attributes": "resources/attributes", - "valueConverters": "resources/value-converters", - "bindingBehaviors": "resources/binding-behaviors" - }, - "transpiler": { - // @if feat.babel - "id": "babel", - "fileExtension": ".js", - // @endif - - // @if feat.typescript - "id": "typescript", - "fileExtension": ".ts", - // @endif - } -} diff --git a/skeleton/common/aurelia_project/environments__if_not_webpack/dev.ext b/skeleton/common/aurelia_project/environments__if_not_webpack/dev.ext deleted file mode 100644 index 3495e9a9d..000000000 --- a/skeleton/common/aurelia_project/environments__if_not_webpack/dev.ext +++ /dev/null @@ -1,4 +0,0 @@ -export default { - debug: true, - testing: true -}; diff --git a/skeleton/common/aurelia_project/environments__if_not_webpack/prod.ext b/skeleton/common/aurelia_project/environments__if_not_webpack/prod.ext deleted file mode 100644 index da32a4b87..000000000 --- a/skeleton/common/aurelia_project/environments__if_not_webpack/prod.ext +++ /dev/null @@ -1,4 +0,0 @@ -export default { - debug: false, - testing: false -}; diff --git a/skeleton/common/aurelia_project/environments__if_not_webpack/stage.ext b/skeleton/common/aurelia_project/environments__if_not_webpack/stage.ext deleted file mode 100644 index dafe69b3d..000000000 --- a/skeleton/common/aurelia_project/environments__if_not_webpack/stage.ext +++ /dev/null @@ -1,4 +0,0 @@ -export default { - debug: true, - testing: false -}; diff --git a/skeleton/common/aurelia_project/generators/attribute.ext b/skeleton/common/aurelia_project/generators/attribute.ext deleted file mode 100644 index 83d41b812..000000000 --- a/skeleton/common/aurelia_project/generators/attribute.ext +++ /dev/null @@ -1,69 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class AttributeGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the custom attribute?' - ); - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.attributes.add( - // @if feat.babel - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - // @endif - // @if feat.typescript - ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) - // @endif - ); - - await this.project.commitChanges(); - await this.ui.log(`Created ${fileName}.`); - } - - generateSource(className) { -// @if feat.babel - return `import {inject} from 'aurelia-framework'; - -@inject(Element) -export class ${className}CustomAttribute { - constructor(element) { - this.element = element; - } - - valueChanged(newValue, oldValue) { - // - } -} -`; -// @endif -// @if feat.typescript - return `import {autoinject} from 'aurelia-framework'; - -@autoinject() -export class ${className}CustomAttribute { - constructor(private element: Element) { } - - valueChanged(newValue, oldValue) { - // - } -} -`; -// @endif - } -} diff --git a/skeleton/common/aurelia_project/generators/attribute.json b/skeleton/common/aurelia_project/generators/attribute.json deleted file mode 100644 index ddf940c55..000000000 --- a/skeleton/common/aurelia_project/generators/attribute.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "attribute", - "description": "Creates a custom attribute class and places it in the project resources." -} diff --git a/skeleton/common/aurelia_project/generators/binding-behavior.ext b/skeleton/common/aurelia_project/generators/binding-behavior.ext deleted file mode 100644 index 54bfeb59f..000000000 --- a/skeleton/common/aurelia_project/generators/binding-behavior.ext +++ /dev/null @@ -1,51 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class BindingBehaviorGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the binding behavior?' - ); - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.bindingBehaviors.add( - // @if feat.babel - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - // @endif - // @if feat.typescript - ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) - // @endif - ); - - await this.project.commitChanges(); - await this.ui.log(`Created ${fileName}.`); - } - - generateSource(className) { - return `export class ${className}BindingBehavior { - bind(binding, source) { - // - } - - unbind(binding, source) { - // - } -} -` - } -} diff --git a/skeleton/common/aurelia_project/generators/binding-behavior.json b/skeleton/common/aurelia_project/generators/binding-behavior.json deleted file mode 100644 index 60906a174..000000000 --- a/skeleton/common/aurelia_project/generators/binding-behavior.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "binding-behavior", - "description": "Creates a binding behavior class and places it in the project resources." -} diff --git a/skeleton/common/aurelia_project/generators/component.ext__if_not_plugin b/skeleton/common/aurelia_project/generators/component.ext__if_not_plugin deleted file mode 100644 index 7bc02cca2..000000000 --- a/skeleton/common/aurelia_project/generators/component.ext__if_not_plugin +++ /dev/null @@ -1,70 +0,0 @@ -import { inject } from 'aurelia-dependency-injection'; -import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli'; -// @if feat.babel -import path from 'path'; -// @endif -// @if feat.typescript -import * as path from 'path'; -// @endif - -@inject(Project, CLIOptions, UI) -export default class ElementGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the component?' - ); - - const subFolders = await this.ui.ensureAnswer( - this.options.args[1], - 'What sub-folder would you like to add it to?\nIf it doesn\'t exist it will be created for you.\n\nDefault folder is the source folder (src).', "." - ); - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.root.add( - // @if feat.babel - ProjectItem.text(path.join(subFolders, fileName + '.js'), this.generateJSSource(className)), - // @endif - // @if feat.typescript - ProjectItem.text(path.join(subFolders, fileName + '.ts'), this.generateJSSource(className)), - // @endif - ProjectItem.text(path.join(subFolders, fileName + '.html'), this.generateHTMLSource(className)) - ); - - await this.project.commitChanges(); - await this.ui.log(`Created ${name} in the '${path.join(this.project.root.name, subFolders)}' folder`); - } - - generateJSSource(className) { - return `export class ${className} { -// @if feat.typescript - message: string; - -// @endif - constructor() { - this.message = 'Hello world'; - } -} -` - } - - generateHTMLSource(className) { - return ` -` - } -} diff --git a/skeleton/common/aurelia_project/generators/component.json__if_not_plugin b/skeleton/common/aurelia_project/generators/component.json__if_not_plugin deleted file mode 100644 index ec3907561..000000000 --- a/skeleton/common/aurelia_project/generators/component.json__if_not_plugin +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "component", - "description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)." -} \ No newline at end of file diff --git a/skeleton/common/aurelia_project/generators/element.ext b/skeleton/common/aurelia_project/generators/element.ext deleted file mode 100644 index ae2167c1d..000000000 --- a/skeleton/common/aurelia_project/generators/element.ext +++ /dev/null @@ -1,59 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class ElementGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the custom element?' - ); - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.elements.add( - // @if feat.babel - ProjectItem.text(`${fileName}.js`, this.generateJSSource(className)), - // @endif - // @if feat.typescript - ProjectItem.text(`${fileName}.ts`, this.generateJSSource(className)), - // @endif - ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className)) - ); - - await this.project.commitChanges(); - await this.ui.log(`Created ${fileName}.`); - } - - generateJSSource(className) { - return `import {bindable} from 'aurelia-framework'; - -export class ${className} { - @bindable value; - - valueChanged(newValue, oldValue) { - // - } -} -`; - } - - generateHTMLSource(className) { - return ` -`; - } -} diff --git a/skeleton/common/aurelia_project/generators/element.json b/skeleton/common/aurelia_project/generators/element.json deleted file mode 100644 index 68d8c54e0..000000000 --- a/skeleton/common/aurelia_project/generators/element.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "element", - "description": "Creates a custom element class and template, placing them in the project resources." -} diff --git a/skeleton/common/aurelia_project/generators/generator.ext b/skeleton/common/aurelia_project/generators/generator.ext deleted file mode 100644 index 07a036948..000000000 --- a/skeleton/common/aurelia_project/generators/generator.ext +++ /dev/null @@ -1,87 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class GeneratorGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the generator?' - ); - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.generators.add( - // @if feat.babel - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - // @endif - // @if feat.typescript - ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) - // @endif - ); - - await this.project.commitChanges() - await this.ui.log(`Created ${fileName}.`); - } - - generateSource(className) { - return `import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class ${className}Generator { - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - - execute() { - return this.ui - .ensureAnswer(this.options.args[0], 'What would you like to call the new item?') - .then(name => { - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.elements.add( - // @if feat.babel - ProjectItem.text(\`\${fileName}.js\`, this.generateSource(className)) - // @endif - // @if feat.typescript - ProjectItem.text(\`\${fileName}.ts\`, this.generateSource(className)) - // @endif - ); - - return this.project.commitChanges() - .then(() => this.ui.log(\`Created \${fileName}.\`)); - }); - } - - generateSource(className) { -return \`import {bindable} from 'aurelia-framework'; - -export class \${className} { - @bindable value; - - valueChanged(newValue, oldValue) { - // - } -} -\` - } -} -`; - } -} diff --git a/skeleton/common/aurelia_project/generators/generator.json b/skeleton/common/aurelia_project/generators/generator.json deleted file mode 100644 index be946a5a9..000000000 --- a/skeleton/common/aurelia_project/generators/generator.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "generator", - "description": "Creates a generator class and places it in the project generators folder." -} diff --git a/skeleton/common/aurelia_project/generators/task.ext b/skeleton/common/aurelia_project/generators/task.ext deleted file mode 100644 index fd6cf0948..000000000 --- a/skeleton/common/aurelia_project/generators/task.ext +++ /dev/null @@ -1,62 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class TaskGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the task?' - ); - - let fileName = this.project.makeFileName(name); - let functionName = this.project.makeFunctionName(name); - - this.project.tasks.add( - // @if feat.babel - ProjectItem.text(`${fileName}.js`, this.generateSource(functionName)) - // @endif - // @if feat.typescript - ProjectItem.text(`${fileName}.ts`, this.generateSource(functionName)) - // @endif - ); - - await this.project.commitChanges(); - await this.ui.log(`Created ${fileName}.`); - } - - generateSource(functionName) { -// @if feat.babel - return `import gulp from 'gulp'; -import project from '../aurelia.json'; - -export default function ${functionName}() { - return gulp.src(project.paths.???) - .pipe(gulp.dest(project.paths.output)); -} -`; -// @endif -// @if feat.typescript - return `import * as gulp from 'gulp'; -import * as project from '../aurelia.json'; - -export default function ${functionName}() { - return gulp.src(project.paths.???) - .pipe(gulp.dest(project.paths.output)); -} -`; -// @endif - - } -} diff --git a/skeleton/common/aurelia_project/generators/task.json b/skeleton/common/aurelia_project/generators/task.json deleted file mode 100644 index fd15bc626..000000000 --- a/skeleton/common/aurelia_project/generators/task.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "task", - "description": "Creates a task and places it in the project tasks folder." -} diff --git a/skeleton/common/aurelia_project/generators/value-converter.ext b/skeleton/common/aurelia_project/generators/value-converter.ext deleted file mode 100644 index ca8ee30f0..000000000 --- a/skeleton/common/aurelia_project/generators/value-converter.ext +++ /dev/null @@ -1,51 +0,0 @@ -import {inject} from 'aurelia-dependency-injection'; -import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli'; - -@inject(Project, CLIOptions, UI) -export default class ValueConverterGenerator { - // @if feat.babel - constructor(project, options, ui) { - this.project = project; - this.options = options; - this.ui = ui; - } - // @endif - // @if feat.typescript - constructor(private project: Project, private options: CLIOptions, private ui: UI) { } - // @endif - - async execute() { - const name = await this.ui.ensureAnswer( - this.options.args[0], - 'What would you like to call the value converter?' - ); - - let fileName = this.project.makeFileName(name); - let className = this.project.makeClassName(name); - - this.project.valueConverters.add( - // @if feat.babel - ProjectItem.text(`${fileName}.js`, this.generateSource(className)) - // @endif - // @if feat.typescript - ProjectItem.text(`${fileName}.ts`, this.generateSource(className)) - // @endif - ); - - await this.project.commitChanges(); - await this.ui.log(`Created ${fileName}.`); - } - - generateSource(className) { - return `export class ${className}ValueConverter { - toView(value) { - // - } - - fromView(value) { - // - } -} -`; - } -} diff --git a/skeleton/common/aurelia_project/generators/value-converter.json b/skeleton/common/aurelia_project/generators/value-converter.json deleted file mode 100644 index 11081226c..000000000 --- a/skeleton/common/aurelia_project/generators/value-converter.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "value-converter", - "description": "Creates a value converter class and places it in the project resources." -} diff --git a/skeleton/common/babel.config.js__if_babel b/skeleton/common/babel.config.js__if_babel deleted file mode 100644 index 19927ff5f..000000000 --- a/skeleton/common/babel.config.js__if_babel +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = api => { - api.cache.using(() => { - // cache based on the two env vars - return 'babel:' + process.env.BABEL_TARGET + - ' protractor:' + process.env.IN_PROTRACTOR; - }); - - return { - "plugins": [ - ['@babel/plugin-proposal-decorators', { legacy: true }], - ['@babel/plugin-proposal-class-properties', { loose: true }] - ], - "presets": [ - [ - "@babel/preset-env", { - "targets": process.env.BABEL_TARGET === 'node' ? { - "node": process.env.IN_PROTRACTOR ? '6' : 'current' - } : { - "browsers": [ "last 2 versions" ] - }, - "loose": true, - "modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false - } - ] - ] - } -} diff --git a/skeleton/common/config__if_webpack/environment.json b/skeleton/common/config__if_webpack/environment.json deleted file mode 100644 index a32129fd0..000000000 --- a/skeleton/common/config__if_webpack/environment.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "debug": true, - "testing": true -} \ No newline at end of file diff --git a/skeleton/common/config__if_webpack/environment.production.json b/skeleton/common/config__if_webpack/environment.production.json deleted file mode 100644 index 9ddbb4430..000000000 --- a/skeleton/common/config__if_webpack/environment.production.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "debug": false, - "testing": false -} \ No newline at end of file diff --git a/skeleton/common/favicon.ico__skip-if-exists b/skeleton/common/favicon.ico__skip-if-exists deleted file mode 100644 index 330515e9c1d77fdfe88d7989060380932ca13e99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15086 zcmdU$3s{v^*2iB&MJ)y8rl5$Lrg=*<(=2f+Q&TiWEh}#|Up1A23Y>G`00#uQh@v2< zs0f0opk^0GO-stu@-k+ZvFWR%>86&7*`sD~_V-)wxp48wFw@iX%y*t=x#94>d#}rX zueJADOHFgr+_gLJ)EI-c&D}L^u%>Cj!S>(1H0>+C^J0|0Ki^c-7V$t&p5Ya379`*6 zpWAH1f7`zWkIr%XZ{w-4{H%N={Fc?@=0@a?n>+OXqZ}(nMa;|_6Ml8|*zoU=A#zRV zT#)p~eTu^@?$8s^{gBh{8>S?-*)YWddK>>)`oR32%O09{D(B${l{Y#m-scd9efeheDfv0bgVZraQ#kvV|nqX5Cw#{MgAmIaETS8kQWv4xiUhp4RJSEYJ z3{~*IXTxO6unm*ro7{|d`9AsH$eF44MP5lCzCdLn!%}2eK60MQ8HFvzAVV!%tQ$Yq zY3GLKto=81@F#R}4t%Pthvxll@re14W<6-|D4A?|0G{82et_;To|-(oc{u^T)`8z!2S+fc-H2x zp`Urj7c9OlbBIpF#^~wi5APu*QHDmfE&WgFyd?jX}Ntp*3RKnnBl{h3yfhXM- zf+w*Bdt0}K4Nnn^*N>DBpnYL%_{hkzH&lbBS&iGQX@9dzV4Q3^4r+580-E@trnJ zOYXROY-DcU=y{hR^fh0t9dA@clM|3bWJoB0S_=QBUWn6l;BBhk!H7r;0f#=Mvs9G`5PMH-3Q$4t%nfP$RLDFf~im04?Sc}W4Bc;O+A(unR+f!raRJ=sZX-veSI$Q zqy$f*A8f4Kg1xQMLl#_QZ;x$=XUE@4CchxKiLJrSyc*n~7tvAdK+$~+YsRs5f-?0@ zf{&C-=yZ8>k0k;5q2Zn2JrDW?x{57kI_5WaT|3LzZRJ%{_Z(%qJxiH-WhhhcMa+>X zx)7TxGq#m=L|0;OFq;AY&b{N9%hibP?`OaN;J{6$Yuv!QS+~8cD>~G9xFg+a>Xmui z*dr@6W0*y3F_rz0v~tXXRytucFO;UvCBGT?6z8&y5}OpGGxf){WN3%Pv}GJ zDmsd@;ps4YyRo=w2X6K_aRcsT9|;yk7h>C5xY6w{YodFw!1}!wD;*cNFS~?(ml?XQ z3jF?+0NrQ5=(p^a7yOoPdeMKWiU`P4hR(>)b&WFKmZwZTvUzW*9ZxBCJeiTfcmb?F z;!4l;zbkvREfWG;s!tPZ{P;rb96pLr#e0a>zxa&#-QS3 z#!fGX&g+oh0vW>K|09t>$Yu*<)$z0v8FDUQ$423%HjX&|`4IEsiGSzxICX=+sf`=i zvku&_|D3p40skv)`V`)S*Teq?W$d(389Q#eWC$!>W(?R7@E5;Khb?~5Z6W(2Fjqwf zvnRT(&R{?2{-$tJtQT}g;l$Vm&ruFJh<8oE%?RS){)E9%)it;gUr(%QEN;4jiQocw zFH**!68L{v83MN`L%>$6p~LoLhW4+Gi||`7wwMgnw#EC=o!2^XQy6BBE)0wP1{n-c zTL+*2Y9yBXf*T9|=A1oFHRNx^<~QOdxDeip?YiF#|7GyMO&QwnPzL|kFB$xHX2tmJ z#TJXj7OSztw~V0<-U=s~hZcp!eODA_R><%h{O^K>LXEP8X<$?n_Us7uY&rg>+7_o8 zgB#Jk9XCNbZs5Jt#(RfX;QuxFe?uAl{%SS)?LKDm-8(MaZyo-1Nk9CQhwz^}D%^Y3 zBlCB!n_%KR7zc?A(4^RJp%D%l|JC@_@|{f#eat?@sYFwsg+JQkl-<`m{Eg_|?r&V+ z#@JEEjRH6D{;KF6-giQ~l*xAw^yVd#&%P|P&$|H*esV`eL?c7B+{f00M%R|%F#LCP zJlD`zHe*$LD0}P7m7`aTNpEWGoic(r^$u~W+8(F=6Wl0pBf3{c-`&Eyf_D|;^OiNn zd;if`?{~(>wmaA?Z*=&0`2QGEYsMQm2gZvG7oaf>@$C59)|qRYY@N9}aqG-g)|aPc zUnrcEo>4M2-9NH>hPSC_W)lA9CtIAV?Qd%1hCSPHlN~o((S04<)YAQ4;a$aezpY}u z%T;WkGZmRV-CBD0!zi9++?7Dv&{^8yG9r!<>%W0$Me)@5DV)6vk)ctz**0sf-?mw6_QSs_oxVyHPhBefJLn=mXOuja=5Oeh z=SQ4cNZk2JKa(}=Z@_(h+&FZ<-_HBH@cy1Mw>_ld+P<&iygs-T=Xq?Y`PP#GyW+<; z>fW+#_WCC9p9oozL2aG6MwQK2tu{@|cG$sTi?<5H(gQ|mWp11i9>U)oAWl{5zWzVM z4Z0WJ4?>59cj%~!_dI4z@H%lc!TY07i|?n+9QeN3xP5lPgWG1WI|u*DM#!Mcfi0fO zt8I%SaHZd;WG+*eLSKA+GI8p>4LA6D7yia*^EWrcjh%PV{So0^#e4ltCA9lcS$saO zO!WWz(xeWb-4sLHXRp5n{$GO>GQhu($WbGM-4>s)5A^#~MC;Pl;jK3(LXSlHZfR!h zxcNci)O*CKYFnHVU;l68#;*J0DxvKOc>hQx`hBXB+Mlu}1%7^XVW%%clY=X6um$|P zL!t106tdn#hF{nh(;W7L?`OkXZ~7Iw$j|BFw{Gz>cHHKRzga|_I&Y6tH~JeNr@y%w zZWOpt3En4_#rG4H*#4AC3iyXw*zpUM-1)1@lrCQ{U3A;GE^UDf9pOILKFPLE=>Pjks~_S>4~*_Ns72kru`cTV{gKq3XU3)V{;5uGP;`q7&EUVr7B(z>1fKNlJA11Y zR4h1+@jRd++q?$pUHo>FK2{Q;?xC`&%g9HH^YqrHwxUSQ-=)jJqY>=dK(%JInS&3 zu~zuA67g%uVe@hLIfoqtPcCfnQ$*`6_sRV8+&^@WX?tK4aq2K}%4&~Ob#deE^fwLR zM!|bdM&Ao{un(`dK-(dFs7`M%-s+GIKlThVTuo?qQuhzFWdKihIgT*a*aF@cN3GnzKQqhXJ zO2mhWUc?_uOp(|k>(-aSZj1BicC=&u4O13}6g;}w;(iyMn0Cxxe}s2uy#Sx}41V{T_}_({zR>3v9f__i zz8~xULbpY&J%J3V=C()l^DcJ?pVH~MdpABVXTem?!s%-BliAiSPh}t2GJW~&6E)QY zn~ue{AD|zrJx&zF(yqVa#QsR^oH@AzwId>Y~ z>-b8UzoAchp9{C(r#7YHYsKe^@0Iw$`9qI|H{uCfwEOUUyw{0Qj(NEQ4d)(r1{pZZ z=5Zz$%7s>3D4m{jL!JlSH$_L|Smy}qS?##F3Lnop=4|XpZ196#0drMpy^sM6ivO*# zMSVQ|-3ks;@k@5xYSfe94TS}bz8Q#~Ud*^w#vHZ(( z@ZT1S=Kb%9*T`^2rFO>_;8NnD#B}i!c3Zp$hIQP?yPTEAKo^lgmDQEu5d1rFBhR|} zuvRm0^8ow@yZU=$zf13X!3`OPBEv4``b}bYY7cB-$CF@{y?q|rJ8>g(%UKT!gHGr& z*lchCJKTVq#`5xep0nG+P}>%EJXx{DBKDq3Jivc2{O3ZK!4bI0bNSrw;jOXnX7s!0 zu*Gg{`O;lz!rx!@gJtbPz`@HtoS{t@5lw&?wn0X%)o-mZh2KVrQBC)m_Gj!&Z&aI&@)`mY``>p4v4ngwaDY z%6QGq5+UDLY84goT%|TZA1ky@dl@S=txXW) zHBEEBFNF1IU%J+r^%26zSY57ZL-_vMEKR#r#vz*Kk-&SLG-aI%4<6J~2s!Cx^(=J!Q0^`>eu)y<|%iS($RQ{F4{eaBF zm{=~O=8;&z{8r7={aS*IZQQFEl_khSDaP^;PkpQm$N7*=SNK+XE~Hi|{X5bt zAvH{7x(*Me=%T&j`T8TedW1Uv1$jq$PN;SM$eam@_rwHjd^}}hVOYY?`QxHFZ=3Bs z6qc*3pLoD%ax?Zx_M)z`(|ngv?>BJt;K)4EYa%sZ=6(wvyz8$kzw>>7U`C!3z86vB zrd}pB=W6Or`xEX;9GyST@EH9AC#9ET4ZR$NVewb6!%TUf8bTCx@2Z&o3A|&{Ywgm1 zBDHdz6R=a)QZj-??{cyyg&Aym181S z!pD_WV*?YeC-hG)8FYebG`0Q?*cV{d0+ZRutzn$D(0d|t}%$-N1>bZ4!w*0 zq~AfWFG~-EUL#DAdc4$0-ZJ-EI*LAoP_Wwd&t6$=BLZ@F>2=E6sC!GjSb8X=4}^E6 z2ZXuyVvn2YUGV;{Q}6VL2+#7KUgwj#d>?uWq_!&k1X5S+zT%vr>*_dT@CGmHbEBwp zRo2ve^YxmsUeBSAgI<&~^oF?9yVwD}N2B-ab@WdEkls&X(>rU^4thDtZH-?8yoWEP4_;s2ch?LaC)%;z1wQ=dM!WK zUdNX@IJMYL8_yX#mYT!;^Y4KNspbEo>mrDHdAC(>8oOtEZ+zU?iW-@-mR28s$lesc zF$TTAkKU~}*E@B+Zc@vZ+6?tbsijJ7AfT+;&|$~EX#ZCqw(H^(`Z~^n3tjKjxaLx8 zJOK~WAc>?dKe2a32bk_OrGxj2dTrFT-tBcEsi8{^nmVYS*ME(i^3HQ6zddGZpZC7t zmpR5u+v7&h%-!oI7{AtQonhuHtiKo{NZ%}?fai|wB{4*VX*c2*rnuJw-W zQpc3~vD7f7{;Jn6tEr#uBd2$NM&H7w)ccl8%@Q7@-d7DDaqA{TyTk+M;BlqXSDq@F zy2O}vZ)zW7&&BCrs8a8NaIJS+9Z#>HO8rr4r;^jvbLr>EDJEnNS~7Ii*oalsuCGw9 z+Y1ja_aS-kK<*UpZ+ap}>Oob|o`OfyL#Qc+Qj`0Deh{mz9_Lc;$Zo5B+G>a7!rMvh z>R>hbs(lu}_eSEU!-}VxUFHhN%QPjAy;$lZQV)6g@#WN|(}j<-g<)xb2FHQ;xJ>X~ zY3rMCsdrlq$J>^Nch=3QJCXM|8}E5CHqP^Nm$H+`9Y<}W(pj6K&bQ^MTw=_UtLrDF z;op^8gy-hY;C(!J{{Xzx^FaO7sdtgxsdr?j20-1*mJ6lkMQ+vNeX@#s^xH`RpNDWa zt&^)Fw?7dcPTT4$HT5Cxb?f#TEX}B)+(#YaLvr7yNWU$84FTITsijof>dr3p&iYbw zBai7t%}4508I0G4?+P&5fy=Q^0;-+Hf3F?HHU)tW8hut%r?DC{|IY?)1M0BwmU6j2w_m<7xue=cDk=kQN?^v(HSyCgGT&u0lcZ1&b90@s} zFOa>ztRo-R^nm6=2cZG-9l2=(^}#B^jpWvC`CRIsHM;mA#`E3#>?<$zE zcm!)t51rb9nb>J?|>@wHm$Wqj%?-RpzMufj4ik zxm(YL@t)*WrPh_$UUI5>E>d){C$`mzwy*rpiZa`c* zMHD`ws#XqhFFDXUK8_qxXXeQzKlU~AI%^O0*LD1E&mWA0j|1$HYT;XQzLFCpPhL$f zTi5%x*{fR+FIL0DZ}vPU`Pe*{=PcH4L0+hjtGcFR-TEUo@`r~M-aD`7SS7F5x)edbZ+ zp6PMT-P7}$hv)jLHl3B#bH7sSZ7cVLc~M+2{cjx~TwCDeOL>Es^4CPM!XYSLw--+&TaHp?7BYPx0;*W&C%$=~$`iV9F--mlr z7w+{(xXF&gw+))b=b9Rk45Z0_@yUV*=vLtlm$>o;YNk(^ETZkUb4NyxeX;aaos_smPewI9BQA5`FV6EOzIYz7uv+S# zQnO8H_fhGF@g>9X-4(>He-c0YCitEXhVONpQ?}uE>co@uK0kHFCub8EE_04NZSnuI z|MsWz`ccm+Cl0;jur)HbWbHcdI{t=VZH`Pc@Tt!@zQcd|Ku)|lzITjzZu79Fy?=n% pn#%bIlKg3TAURl8N#j=8.9.0" - } -} diff --git a/skeleton/common/src/environment.ext__if_not_plugin_and_not_webpack b/skeleton/common/src/environment.ext__if_not_plugin_and_not_webpack deleted file mode 100644 index 3495e9a9d..000000000 --- a/skeleton/common/src/environment.ext__if_not_plugin_and_not_webpack +++ /dev/null @@ -1,4 +0,0 @@ -export default { - debug: true, - testing: true -}; diff --git a/skeleton/common/tsconfig.json__if_typescript b/skeleton/common/tsconfig.json__if_typescript deleted file mode 100644 index ef9576fb2..000000000 --- a/skeleton/common/tsconfig.json__if_typescript +++ /dev/null @@ -1,63 +0,0 @@ -{ - "compileOnSave": false, - "compilerOptions": { - // @if feat['cli-bundler'] - - // @if feat.plugin - "declaration": true, - // @endif - - // @if !feat.plugin - "declaration": false, - // @endif - - // @endif - - // @if feat.webpack - "module": "esnext", - // @endif - - // @if feat.cypress && feat.karma - "types": ["jasmine"], - // @endif - - // @if feat.cypress && feat.jest && feat['cli-bundler'] - "types": ["node", "jest"], - // @endif - - // @if feat.protractor && feat.jest - "types": ["node", "jest"], - // @endif - - "typeRoots": ["./node_modules/@types"], - - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "sourceMap": true, - "target": "es5", - "lib": ["es2015", "dom"], - "moduleResolution": "node", - "baseUrl": "src", - "resolveJsonModule": true, - - // @if feat.plugin - "paths": { "resources": [ "" ] }, - "allowJs": false, - // @endif - - // @if !feat.plugin - "allowJs": true, - // @endif - }, - "include": [ - "src", - // @if feat.plugin - "dev-app", - // @endif - "test" - ], - "atom": { - "rewriteTsconfig": false - } -} diff --git a/skeleton/cypress/README.md b/skeleton/cypress/README.md deleted file mode 100644 index c75e50605..000000000 --- a/skeleton/cypress/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Integration (e2e) tests - -You need the app running for integration test. - -First, run `au run` and keep it running. - -Then run `au cypress` to run cypress in interactive mode. - -To perform a test-run and reports the results, do `au cypress --run`. - -To ask the `cypress` to start the application first and then start testing: `au cypress --run --start` - -The two following flags are useful when using `--start` flag: - * To change dev server port, do `au cypress --start --port 8888`. - * To change dev server host, do `au cypress --start --host 127.0.0.1` - - -**PS:** It is also possible to mix the flags `au cypress --run --start --port 7070 --host 127.0.0.1` diff --git a/skeleton/cypress/aurelia_project/tasks/cypress.ext b/skeleton/cypress/aurelia_project/tasks/cypress.ext deleted file mode 100644 index c1065d547..000000000 --- a/skeleton/cypress/aurelia_project/tasks/cypress.ext +++ /dev/null @@ -1,37 +0,0 @@ -// @if feat.babel -import cypress from 'cypress'; -import config from '../../cypress.config'; -// @endif -// @if feat.typescript -import * as cypress from 'cypress'; -import * as config from '../../cypress.config'; -// @endif -import { CLIOptions } from 'aurelia-cli'; -// @if feat["cli-bundler"] -import { serve as runAppServer, shutdownAppServer } from './run'; -// @endif -// @if feat.webpack -import { default as runAppServer, shutdownAppServer } from './run'; -// @endif - -const runCypress = (cb) => { - if (CLIOptions.hasFlag('run')) { - cypress - .run(config) - .then(results => (results.totalFailed === 0 ? cb() : cb('Run failed!'))) - .then(shutdownAppServer) - .catch(cb); - } else { - cypress.open(config); - } -} - -export default (cb) => { - if (CLIOptions.hasFlag('start')) { - runAppServer(); - runCypress(cb); - return; - } - - runCypress(cb); -}; diff --git a/skeleton/cypress/aurelia_project/tasks/cypress.json b/skeleton/cypress/aurelia_project/tasks/cypress.json deleted file mode 100644 index 822e4f05f..000000000 --- a/skeleton/cypress/aurelia_project/tasks/cypress.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "cypress", - "description": "Open Cypress to start developing tests. Start the application before running this task.", - "flags": [ - { - "name": "run", - "description": "Perform a test run and reports the results.", - "type": "boolean" - }, - { - "name": "host", - "description": "Set host address of the dev server, the accessible URL", - "type": "string" - }, - { - "name": "port", - "description": "Set port number of the dev server", - "type": "string" - }, - { - "name": "start", - "description": "Runs the application before starting to perform a testrun", - "type": "boolean" - } - ] -} diff --git a/skeleton/cypress/cypress.config.js b/skeleton/cypress/cypress.config.js deleted file mode 100644 index 4f1cc434a..000000000 --- a/skeleton/cypress/cypress.config.js +++ /dev/null @@ -1,10 +0,0 @@ -const CLIOptions = require( 'aurelia-cli').CLIOptions; -const aureliaConfig = require('./aurelia_project/aurelia.json'); -const PORT = CLIOptions.getFlagValue('port') || aureliaConfig.platform.port; -const HOST = CLIOptions.getFlagValue('host') || aureliaConfig.platform.host; - -module.exports = { - config: { - baseUrl: `http://${HOST}:${PORT}` - } -}; diff --git a/skeleton/cypress/cypress.json b/skeleton/cypress/cypress.json deleted file mode 100644 index 0967ef424..000000000 --- a/skeleton/cypress/cypress.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/skeleton/cypress/cypress/.eslintrc.json b/skeleton/cypress/cypress/.eslintrc.json deleted file mode 100644 index 58f0e8223..000000000 --- a/skeleton/cypress/cypress/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": [ - "plugin:cypress/recommended" - ], - "rules": { - "cypress/no-unnecessary-waiting": 0 - } -} diff --git a/skeleton/cypress/cypress/fixtures/example.json b/skeleton/cypress/cypress/fixtures/example.json deleted file mode 100644 index da18d9352..000000000 --- a/skeleton/cypress/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file diff --git a/skeleton/cypress/cypress/plugins/index.js b/skeleton/cypress/cypress/plugins/index.js deleted file mode 100644 index f1bc14544..000000000 --- a/skeleton/cypress/cypress/plugins/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -// eslint-disable-next-line no-unused-vars -module.exports = (on, config) => { - // bind to the event we care about - // on('', (arg1, arg2) => { - // // plugin stuff here - // }); -}; diff --git a/skeleton/cypress/cypress/support/commands.js b/skeleton/cypress/cypress/support/commands.js deleted file mode 100644 index c1f5a772e..000000000 --- a/skeleton/cypress/cypress/support/commands.js +++ /dev/null @@ -1,25 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add("login", (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This is will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/skeleton/cypress/cypress/support/index.js b/skeleton/cypress/cypress/support/index.js deleted file mode 100644 index c1dde2d2a..000000000 --- a/skeleton/cypress/cypress/support/index.js +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands'; - -// Alternatively you can use CommonJS syntax: -// require('./commands'); diff --git a/skeleton/cypress/cypress/tsconfig.json__if_typescript b/skeleton/cypress/cypress/tsconfig.json__if_typescript deleted file mode 100644 index ac2059ac9..000000000 --- a/skeleton/cypress/cypress/tsconfig.json__if_typescript +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "strict": true, - "baseUrl": "../node_modules", - "target": "es5", - "types": [ - "cypress" - ] - }, - "include": [ - "**/*.ts" - ] -} diff --git a/skeleton/cypress/package.json b/skeleton/cypress/package.json deleted file mode 100644 index 8b7a9ae07..000000000 --- a/skeleton/cypress/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "scripts": { - "e2e": "au cypress", - "e2e:headless": "au cypress --start --run" - }, - "devDependencies": { - "cypress": "", - "eslint-plugin-cypress": "" - } -} diff --git a/skeleton/docker/.dockerignore b/skeleton/docker/.dockerignore deleted file mode 100644 index e57caf880..000000000 --- a/skeleton/docker/.dockerignore +++ /dev/null @@ -1,27 +0,0 @@ -Dockerfile -.dockerignore -docker-compose.yml - -node_modules - -.git -.gitignore -.eslintrc.json -.editorconfig - -.DS_STORE -Thumbs.db - -.idea -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -**/*.csproj -**/*.cs -**/*.cshtml -Views -Controllers -**/*.Development.* diff --git a/skeleton/docker/Dockerfile b/skeleton/docker/Dockerfile deleted file mode 100644 index e300546d8..000000000 --- a/skeleton/docker/Dockerfile +++ /dev/null @@ -1,122 +0,0 @@ -# build stage -FROM node:lts as build-stage - -// @if feat.cypress || feat.protractor || feat.karma -ENV DEBIAN_FRONTEND=noninteractive - -#update apt-get -#update apt-get -RUN apt-get update && apt-get install -y \ - apt-utils \ - fonts-liberation \ - libappindicator3-1 \ - libatk-bridge2.0-0 \ - libatspi2.0-0 \ - libgtk-3-0 \ - libnspr4 \ - libnss3 \ - libx11-xcb1 \ - libxtst6 \ - lsb-release \ - xdg-utils \ - libgtk2.0-0 \ - libnotify-dev \ - libgconf-2-4 \ - libxss1 \ - libasound2 \ - xvfb \ - && rm -rf /var/lib/apt/lists/* - -# install chrome -RUN curl --silent --show-error --location --fail --retry 3 --output /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ - && ( dpkg -i /tmp/google-chrome-stable_current_amd64.deb || apt-get -fy install) \ - && rm -rf /tmp/google-chrome-stable_current_amd64.deb \ - && sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' \ - "/opt/google/chrome/google-chrome" \ - && google-chrome --version - -// @endif - -RUN npm install -g aurelia-cli@^1.2.0 - - -WORKDIR /app - -# install dependencies -COPY ./*.json ./ -RUN npm install - -// @if feat.webpack -COPY config ./config -// @endif -COPY aurelia_project ./aurelia_project - -// @if feat.webpack -COPY static ./static -// @endif - -# Copy files in the root folder -COPY *.* ./ - -# Copy source files -COPY src ./src - - -// @if feat.jest || feat.karma -COPY test ./test -// @endif - -// @if feat.cypress -COPY cypress ./cypress -// @endif - -// @if feat.protractor -COPY e2e ./e2e -// @endif - -// @if feat["cli-bundler"] && feat["dotnet-core"] -COPY wwwroot ./wwwroot -// @endif - -// @if feat.jest || feat.karma -# RUN UNIT TESTS -RUN au test -// @endif - -// @if feat.cypress || feat.protractor -# RUN E2E TESTS -RUN npm run e2e:headless -// @endif - -# build -FROM build-stage as publish-stage -RUN au build --env prod - -# production stage -FROM nginx:alpine as production-stage -COPY nginx.conf /etc/nginx/nginx.conf -WORKDIR /usr/share/nginx/html - -// @if feat.webpack && !feat["dotnet-core"] -COPY --from=publish-stage /app/dist/ . -// @endif - -// @if feat.webpack && feat["dotnet-core"] -COPY --from=publish-stage /app/wwwroot/dist/ . -// @endif - -// @if feat["cli-bundler"] && feat["dotnet-core"] -COPY --from=publish-stage /app/wwwroot/ . -// @endif - -// @if feat["cli-bundler"] && !feat["dotnet-core"] -COPY --from=publish-stage /app/scripts/ ./scripts/ -COPY --from=publish-stage /app/index.html/ . -// @endif -// @if feat['scaffold-navigation'] && feat["cli-bundler"] && !feat["dotnet-core"] -COPY --from=publish-stage /app/@fortawesome/ ./@fortawesome/ -// @endif - -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] diff --git a/skeleton/docker/README.md b/skeleton/docker/README.md deleted file mode 100644 index 20d3dc5b4..000000000 --- a/skeleton/docker/README.md +++ /dev/null @@ -1,14 +0,0 @@ - -## Build for Docker - -This is as simple as running a command: - -`yarn docker:build` or `npm run docker:build` - -if you want to bring up an instance on your machine run: - -`yarn docker:start` or `npm run docker:build` - -to stop the previously started instance: - -`yarn docker:stop` or `npm run docker:stop` diff --git a/skeleton/docker/docker-compose.yml b/skeleton/docker/docker-compose.yml deleted file mode 100644 index 095d79e5e..000000000 --- a/skeleton/docker/docker-compose.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: "3.7" - -services: - /* @echo projectName */: - image: /* @echo projectName */:0.1.0 - build: - context: . # relative to docker-compose.yml - dockerfile: Dockerfile - ports: - - "5050:80" - restart: unless-stopped diff --git a/skeleton/docker/nginx.conf b/skeleton/docker/nginx.conf deleted file mode 100644 index ea9434b3d..000000000 --- a/skeleton/docker/nginx.conf +++ /dev/null @@ -1,25 +0,0 @@ -worker_processes 1; - -events { - worker_connections 1024; -} - -http { - server { - listen 80; - server_name localhost; - - root /usr/share/nginx/html; - index index.html index.htm; - include /etc/nginx/mime.types; - - gzip on; - gzip_min_length 1000; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; - - location / { - try_files $uri $uri/ /index.html; - } - } -} diff --git a/skeleton/docker/package.json b/skeleton/docker/package.json deleted file mode 100644 index 32f1fa7a6..000000000 --- a/skeleton/docker/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "scripts": { - "docker:build": "docker build -t /* @echo projectName */:0.1.0 -t /* @echo projectName */:latest .", - "docker:start": "docker-compose up -d", - "docker:stop": "docker-compose down" - } -} diff --git a/skeleton/dotnet-core/Controllers/HomeController.cs__skip-if-exists b/skeleton/dotnet-core/Controllers/HomeController.cs__skip-if-exists deleted file mode 100644 index 5f737f480..000000000 --- a/skeleton/dotnet-core/Controllers/HomeController.cs__skip-if-exists +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using WebApplicationBasic.Models; - -namespace WebApplicationBasic.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] - public IActionResult Error() - { - return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); - } - } -} diff --git a/skeleton/dotnet-core/Controllers/SampleDataController.cs__skip-if-exists b/skeleton/dotnet-core/Controllers/SampleDataController.cs__skip-if-exists deleted file mode 100644 index 1f46d127a..000000000 --- a/skeleton/dotnet-core/Controllers/SampleDataController.cs__skip-if-exists +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - [Route("api/[controller]")] - public class SampleDataController : Controller - { - private static string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - [HttpGet("[action]")] - public IEnumerable WeatherForecasts() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - DateFormatted = DateTime.Now.AddDays(index).ToString("d"), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }); - } - - public class WeatherForecast - { - public string DateFormatted { get; set; } - public int TemperatureC { get; set; } - public string Summary { get; set; } - - public int TemperatureF - { - get - { - return 32 + (int)(this.TemperatureC / 0.5556); - } - } - } - } -} diff --git a/skeleton/dotnet-core/Models/ErrorViewModel.cs__skip-if-exists b/skeleton/dotnet-core/Models/ErrorViewModel.cs__skip-if-exists deleted file mode 100644 index eee1a026d..000000000 --- a/skeleton/dotnet-core/Models/ErrorViewModel.cs__skip-if-exists +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace WebApplicationBasic.Models -{ - public class ErrorViewModel - { - public string RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - } -} diff --git a/skeleton/dotnet-core/Program.cs__skip-if-exists b/skeleton/dotnet-core/Program.cs__skip-if-exists deleted file mode 100644 index 8ce09db2e..000000000 --- a/skeleton/dotnet-core/Program.cs__skip-if-exists +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; - -namespace WebApplicationBasic -{ - public class Program - { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); - } -} diff --git a/skeleton/dotnet-core/Properties/launchSettings.json__skip-if-exists b/skeleton/dotnet-core/Properties/launchSettings.json__skip-if-exists deleted file mode 100644 index 0dde1cbe8..000000000 --- a/skeleton/dotnet-core/Properties/launchSettings.json__skip-if-exists +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:63439/", - "sslPort": 44330 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "project": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} diff --git a/skeleton/dotnet-core/Startup.cs__instructions b/skeleton/dotnet-core/Startup.cs__instructions deleted file mode 100644 index af13950c4..000000000 --- a/skeleton/dotnet-core/Startup.cs__instructions +++ /dev/null @@ -1,62 +0,0 @@ -If you're not yet using ASP.NET Core 2.1 (or don't have the Microsoft.AspNetCore.App package installed) then you need to install JavascriptServices. -This can be done through the following command: "dotnet add package Microsoft.AspNetCore.SpaServices". - -Afterwards, open the Startup.cs file and add the following "using" statement at the top of the file: - -"using Microsoft.AspNetCore.SpaServices.Webpack;" - -Then move on to the Configure() method. Make sure that this method contains the following code, and add missing parts accordingly: - -if (env.IsDevelopment()) -{ - app.UseDeveloperExceptionPage(); - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions - { - HotModuleReplacement = true, - ConfigFile="webpack.netcore.config.js", - HotModuleReplacementClientOptions = new Dictionary{ - {"reload", "true"} - } - }); -} -else -{ - app.UseExceptionHandler("/Home/Error"); - app.UseHsts(); -} - -app.UseHttpsRedirection(); -app.UseStaticFiles(); - -app.UseMvc(routes => -{ - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - routes.MapSpaFallbackRoute( - name: "spa-fallback", - defaults: new { controller = "Home", action = "Index" }); -}); - - -Then, in the ConfigureServices method, make sure that the application uses Mvc: - -public void ConfigureServices(IServiceCollection services) -{ - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); -} - - -That's it for the Startup.cs file. - -If you're using Typescript then it's necessary to instruct Visual Studio not to transpile Typescript. This can be done by opening up the .csproj file. -In this .csproj file you need to specify a TypeScriptToolsVersion and TypeScriptCompileBlocked like so: - - - netcoreapp2.1 - true - Latest - - -That's it for the .csproj file. diff --git a/skeleton/dotnet-core/Startup.cs__skip-if-exists b/skeleton/dotnet-core/Startup.cs__skip-if-exists deleted file mode 100644 index 25183ce9e..000000000 --- a/skeleton/dotnet-core/Startup.cs__skip-if-exists +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.HttpsPolicy; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace WebApplicationBasic -{ - public class Startup - { - - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions - { - HotModuleReplacement = true, - ConfigFile="webpack.netcore.config.js", - HotModuleReplacementClientOptions = new Dictionary{ - {"reload", "true"} - } - }); - } - else - { - app.UseExceptionHandler("/Home/Error"); - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app.UseStaticFiles(); - - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - routes.MapSpaFallbackRoute( - name: "spa-fallback", - defaults: new { controller = "Home", action = "Index" }); - }); - } - } -} diff --git a/skeleton/dotnet-core/Views/Home/Index.cshtml__instructions b/skeleton/dotnet-core/Views/Home/Index.cshtml__instructions deleted file mode 100644 index 196405d42..000000000 --- a/skeleton/dotnet-core/Views/Home/Index.cshtml__instructions +++ /dev/null @@ -1,17 +0,0 @@ -Take a look at Views/Home/Index.cshtml and make sure that it contains the following parts: - -@{ - ViewData["Title"] = "Home Page"; -} - -
Loading...
- -@section scripts { - - - -} - -That's it for Index.cshtml diff --git a/skeleton/dotnet-core/Views/Home/Index.cshtml__skip-if-exists b/skeleton/dotnet-core/Views/Home/Index.cshtml__skip-if-exists deleted file mode 100644 index 271fefffd..000000000 --- a/skeleton/dotnet-core/Views/Home/Index.cshtml__skip-if-exists +++ /dev/null @@ -1,13 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -
Loading...
- -@section scripts { - - - -} diff --git a/skeleton/dotnet-core/Views/Shared/Error.cshtml__skip-if-exists b/skeleton/dotnet-core/Views/Shared/Error.cshtml__skip-if-exists deleted file mode 100644 index ac334e994..000000000 --- a/skeleton/dotnet-core/Views/Shared/Error.cshtml__skip-if-exists +++ /dev/null @@ -1,22 +0,0 @@ -@model ErrorViewModel -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

- -@if (Model.ShowRequestId) -{ -

- Request ID: @Model.RequestId -

-} - -

Development Mode

-

- Swapping to Development environment will display more detailed information about the error that occurred. -

-

- Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. -

diff --git a/skeleton/dotnet-core/Views/Shared/_Layout.cshtml__instructions b/skeleton/dotnet-core/Views/Shared/_Layout.cshtml__instructions deleted file mode 100644 index 355cbf92b..000000000 --- a/skeleton/dotnet-core/Views/Shared/_Layout.cshtml__instructions +++ /dev/null @@ -1,18 +0,0 @@ -Open at Views/Shared/_Layout.cshtml and make sure that it contains the following parts: - - - - - - - @ViewData["Title"] - Aurelia - - - - @RenderBody() - - @RenderSection("scripts", required: false) - - - -That's it for _Layout.cshtml diff --git a/skeleton/dotnet-core/Views/Shared/_Layout.cshtml__skip-if-exists b/skeleton/dotnet-core/Views/Shared/_Layout.cshtml__skip-if-exists deleted file mode 100644 index d92e89106..000000000 --- a/skeleton/dotnet-core/Views/Shared/_Layout.cshtml__skip-if-exists +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - @ViewData["Title"] - Aurelia - - - - @RenderBody() - - @RenderSection("scripts", required: false) - - diff --git a/skeleton/dotnet-core/Views/_ViewImports.cshtml__skip-if-exists b/skeleton/dotnet-core/Views/_ViewImports.cshtml__skip-if-exists deleted file mode 100644 index 3d405ddff..000000000 --- a/skeleton/dotnet-core/Views/_ViewImports.cshtml__skip-if-exists +++ /dev/null @@ -1,4 +0,0 @@ -@using WebApplicationBasic -@using WebApplicationBasic.Models -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/skeleton/dotnet-core/Views/_ViewStart.cshtml__skip-if-exists b/skeleton/dotnet-core/Views/_ViewStart.cshtml__skip-if-exists deleted file mode 100644 index 820a2f6e0..000000000 --- a/skeleton/dotnet-core/Views/_ViewStart.cshtml__skip-if-exists +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/skeleton/dotnet-core/appsettings.Development.json__skip-if-exists b/skeleton/dotnet-core/appsettings.Development.json__skip-if-exists deleted file mode 100644 index e203e9407..000000000 --- a/skeleton/dotnet-core/appsettings.Development.json__skip-if-exists +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/skeleton/dotnet-core/appsettings.json__skip-if-exists b/skeleton/dotnet-core/appsettings.json__skip-if-exists deleted file mode 100644 index def9159a7..000000000 --- a/skeleton/dotnet-core/appsettings.json__skip-if-exists +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/skeleton/dotnet-core/global.json__skip-if-exists b/skeleton/dotnet-core/global.json__skip-if-exists deleted file mode 100644 index aa09f9d88..000000000 --- a/skeleton/dotnet-core/global.json__skip-if-exists +++ /dev/null @@ -1,3 +0,0 @@ -{ - "sdk": { "version": "2.1.500" } -} diff --git a/skeleton/dotnet-core/package.json__if_webpack b/skeleton/dotnet-core/package.json__if_webpack deleted file mode 100644 index adfaaa4be..000000000 --- a/skeleton/dotnet-core/package.json__if_webpack +++ /dev/null @@ -1,5 +0,0 @@ -{ - "devDependencies": { - "clean-webpack-plugin": "" - } -} diff --git a/skeleton/dotnet-core/project.csproj__skip-if-exists b/skeleton/dotnet-core/project.csproj__skip-if-exists deleted file mode 100644 index 3da0345f3..000000000 --- a/skeleton/dotnet-core/project.csproj__skip-if-exists +++ /dev/null @@ -1,32 +0,0 @@ - - - netcoreapp2.1 - true - Latest - false - - - - - - - - - - - - - - - - - - - - - %(DistFiles.Identity) - PreserveNewest - - - - diff --git a/skeleton/dotnet-core/webpack.netcore.config.js__skip-if-exists__if_webpack b/skeleton/dotnet-core/webpack.netcore.config.js__skip-if-exists__if_webpack deleted file mode 100644 index d208208e8..000000000 --- a/skeleton/dotnet-core/webpack.netcore.config.js__skip-if-exists__if_webpack +++ /dev/null @@ -1,29 +0,0 @@ -const webpackConfig = require('./webpack.config'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const { CleanWebpackPlugin } = require('clean-webpack-plugin'); -const project = require('./aurelia_project/aurelia.json'); -var originalConfig = webpackConfig({}); - -module.exports = () => { - let config = originalConfig; - // output files without hashes - config.output.filename = '[name].bundle.js'; - config.plugins.splice(config.plugins.findIndex((x) => x.constructor.name === HtmlWebpackPlugin.name), 1); - // fix output path for .net core development - config.module.rules = config.module.rules.map(x => { - if (x.loader && (x.loader === 'url-loader' || x.loader === 'file-loader')) { - if (!x.options) { - x.options = {}; - } - x.options.publicPath = project.platform.output.replace('wwwroot', '') + '/'; - } - return x; - }); - config.plugins = [ - // first clean the output directory - new CleanWebpackPlugin([config.output.path]), - ...config.plugins - ]; - - return config; -}; diff --git a/skeleton/dotnet-core/wwwroot/favicon.ico__skip-if-exists b/skeleton/dotnet-core/wwwroot/favicon.ico__skip-if-exists deleted file mode 100644 index 330515e9c1d77fdfe88d7989060380932ca13e99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15086 zcmdU$3s{v^*2iB&MJ)y8rl5$Lrg=*<(=2f+Q&TiWEh}#|Up1A23Y>G`00#uQh@v2< zs0f0opk^0GO-stu@-k+ZvFWR%>86&7*`sD~_V-)wxp48wFw@iX%y*t=x#94>d#}rX zueJADOHFgr+_gLJ)EI-c&D}L^u%>Cj!S>(1H0>+C^J0|0Ki^c-7V$t&p5Ya379`*6 zpWAH1f7`zWkIr%XZ{w-4{H%N={Fc?@=0@a?n>+OXqZ}(nMa;|_6Ml8|*zoU=A#zRV zT#)p~eTu^@?$8s^{gBh{8>S?-*)YWddK>>)`oR32%O09{D(B${l{Y#m-scd9efeheDfv0bgVZraQ#kvV|nqX5Cw#{MgAmIaETS8kQWv4xiUhp4RJSEYJ z3{~*IXTxO6unm*ro7{|d`9AsH$eF44MP5lCzCdLn!%}2eK60MQ8HFvzAVV!%tQ$Yq zY3GLKto=81@F#R}4t%Pthvxll@re14W<6-|D4A?|0G{82et_;To|-(oc{u^T)`8z!2S+fc-H2x zp`Urj7c9OlbBIpF#^~wi5APu*QHDmfE&WgFyd?jX}Ntp*3RKnnBl{h3yfhXM- zf+w*Bdt0}K4Nnn^*N>DBpnYL%_{hkzH&lbBS&iGQX@9dzV4Q3^4r+580-E@trnJ zOYXROY-DcU=y{hR^fh0t9dA@clM|3bWJoB0S_=QBUWn6l;BBhk!H7r;0f#=Mvs9G`5PMH-3Q$4t%nfP$RLDFf~im04?Sc}W4Bc;O+A(unR+f!raRJ=sZX-veSI$Q zqy$f*A8f4Kg1xQMLl#_QZ;x$=XUE@4CchxKiLJrSyc*n~7tvAdK+$~+YsRs5f-?0@ zf{&C-=yZ8>k0k;5q2Zn2JrDW?x{57kI_5WaT|3LzZRJ%{_Z(%qJxiH-WhhhcMa+>X zx)7TxGq#m=L|0;OFq;AY&b{N9%hibP?`OaN;J{6$Yuv!QS+~8cD>~G9xFg+a>Xmui z*dr@6W0*y3F_rz0v~tXXRytucFO;UvCBGT?6z8&y5}OpGGxf){WN3%Pv}GJ zDmsd@;ps4YyRo=w2X6K_aRcsT9|;yk7h>C5xY6w{YodFw!1}!wD;*cNFS~?(ml?XQ z3jF?+0NrQ5=(p^a7yOoPdeMKWiU`P4hR(>)b&WFKmZwZTvUzW*9ZxBCJeiTfcmb?F z;!4l;zbkvREfWG;s!tPZ{P;rb96pLr#e0a>zxa&#-QS3 z#!fGX&g+oh0vW>K|09t>$Yu*<)$z0v8FDUQ$423%HjX&|`4IEsiGSzxICX=+sf`=i zvku&_|D3p40skv)`V`)S*Teq?W$d(389Q#eWC$!>W(?R7@E5;Khb?~5Z6W(2Fjqwf zvnRT(&R{?2{-$tJtQT}g;l$Vm&ruFJh<8oE%?RS){)E9%)it;gUr(%QEN;4jiQocw zFH**!68L{v83MN`L%>$6p~LoLhW4+Gi||`7wwMgnw#EC=o!2^XQy6BBE)0wP1{n-c zTL+*2Y9yBXf*T9|=A1oFHRNx^<~QOdxDeip?YiF#|7GyMO&QwnPzL|kFB$xHX2tmJ z#TJXj7OSztw~V0<-U=s~hZcp!eODA_R><%h{O^K>LXEP8X<$?n_Us7uY&rg>+7_o8 zgB#Jk9XCNbZs5Jt#(RfX;QuxFe?uAl{%SS)?LKDm-8(MaZyo-1Nk9CQhwz^}D%^Y3 zBlCB!n_%KR7zc?A(4^RJp%D%l|JC@_@|{f#eat?@sYFwsg+JQkl-<`m{Eg_|?r&V+ z#@JEEjRH6D{;KF6-giQ~l*xAw^yVd#&%P|P&$|H*esV`eL?c7B+{f00M%R|%F#LCP zJlD`zHe*$LD0}P7m7`aTNpEWGoic(r^$u~W+8(F=6Wl0pBf3{c-`&Eyf_D|;^OiNn zd;if`?{~(>wmaA?Z*=&0`2QGEYsMQm2gZvG7oaf>@$C59)|qRYY@N9}aqG-g)|aPc zUnrcEo>4M2-9NH>hPSC_W)lA9CtIAV?Qd%1hCSPHlN~o((S04<)YAQ4;a$aezpY}u z%T;WkGZmRV-CBD0!zi9++?7Dv&{^8yG9r!<>%W0$Me)@5DV)6vk)ctz**0sf-?mw6_QSs_oxVyHPhBefJLn=mXOuja=5Oeh z=SQ4cNZk2JKa(}=Z@_(h+&FZ<-_HBH@cy1Mw>_ld+P<&iygs-T=Xq?Y`PP#GyW+<; z>fW+#_WCC9p9oozL2aG6MwQK2tu{@|cG$sTi?<5H(gQ|mWp11i9>U)oAWl{5zWzVM z4Z0WJ4?>59cj%~!_dI4z@H%lc!TY07i|?n+9QeN3xP5lPgWG1WI|u*DM#!Mcfi0fO zt8I%SaHZd;WG+*eLSKA+GI8p>4LA6D7yia*^EWrcjh%PV{So0^#e4ltCA9lcS$saO zO!WWz(xeWb-4sLHXRp5n{$GO>GQhu($WbGM-4>s)5A^#~MC;Pl;jK3(LXSlHZfR!h zxcNci)O*CKYFnHVU;l68#;*J0DxvKOc>hQx`hBXB+Mlu}1%7^XVW%%clY=X6um$|P zL!t106tdn#hF{nh(;W7L?`OkXZ~7Iw$j|BFw{Gz>cHHKRzga|_I&Y6tH~JeNr@y%w zZWOpt3En4_#rG4H*#4AC3iyXw*zpUM-1)1@lrCQ{U3A;GE^UDf9pOILKFPLE=>Pjks~_S>4~*_Ns72kru`cTV{gKq3XU3)V{;5uGP;`q7&EUVr7B(z>1fKNlJA11Y zR4h1+@jRd++q?$pUHo>FK2{Q;?xC`&%g9HH^YqrHwxUSQ-=)jJqY>=dK(%JInS&3 zu~zuA67g%uVe@hLIfoqtPcCfnQ$*`6_sRV8+&^@WX?tK4aq2K}%4&~Ob#deE^fwLR zM!|bdM&Ao{un(`dK-(dFs7`M%-s+GIKlThVTuo?qQuhzFWdKihIgT*a*aF@cN3GnzKQqhXJ zO2mhWUc?_uOp(|k>(-aSZj1BicC=&u4O13}6g;}w;(iyMn0Cxxe}s2uy#Sx}41V{T_}_({zR>3v9f__i zz8~xULbpY&J%J3V=C()l^DcJ?pVH~MdpABVXTem?!s%-BliAiSPh}t2GJW~&6E)QY zn~ue{AD|zrJx&zF(yqVa#QsR^oH@AzwId>Y~ z>-b8UzoAchp9{C(r#7YHYsKe^@0Iw$`9qI|H{uCfwEOUUyw{0Qj(NEQ4d)(r1{pZZ z=5Zz$%7s>3D4m{jL!JlSH$_L|Smy}qS?##F3Lnop=4|XpZ196#0drMpy^sM6ivO*# zMSVQ|-3ks;@k@5xYSfe94TS}bz8Q#~Ud*^w#vHZ(( z@ZT1S=Kb%9*T`^2rFO>_;8NnD#B}i!c3Zp$hIQP?yPTEAKo^lgmDQEu5d1rFBhR|} zuvRm0^8ow@yZU=$zf13X!3`OPBEv4``b}bYY7cB-$CF@{y?q|rJ8>g(%UKT!gHGr& z*lchCJKTVq#`5xep0nG+P}>%EJXx{DBKDq3Jivc2{O3ZK!4bI0bNSrw;jOXnX7s!0 zu*Gg{`O;lz!rx!@gJtbPz`@HtoS{t@5lw&?wn0X%)o-mZh2KVrQBC)m_Gj!&Z&aI&@)`mY``>p4v4ngwaDY z%6QGq5+UDLY84goT%|TZA1ky@dl@S=txXW) zHBEEBFNF1IU%J+r^%26zSY57ZL-_vMEKR#r#vz*Kk-&SLG-aI%4<6J~2s!Cx^(=J!Q0^`>eu)y<|%iS($RQ{F4{eaBF zm{=~O=8;&z{8r7={aS*IZQQFEl_khSDaP^;PkpQm$N7*=SNK+XE~Hi|{X5bt zAvH{7x(*Me=%T&j`T8TedW1Uv1$jq$PN;SM$eam@_rwHjd^}}hVOYY?`QxHFZ=3Bs z6qc*3pLoD%ax?Zx_M)z`(|ngv?>BJt;K)4EYa%sZ=6(wvyz8$kzw>>7U`C!3z86vB zrd}pB=W6Or`xEX;9GyST@EH9AC#9ET4ZR$NVewb6!%TUf8bTCx@2Z&o3A|&{Ywgm1 zBDHdz6R=a)QZj-??{cyyg&Aym181S z!pD_WV*?YeC-hG)8FYebG`0Q?*cV{d0+ZRutzn$D(0d|t}%$-N1>bZ4!w*0 zq~AfWFG~-EUL#DAdc4$0-ZJ-EI*LAoP_Wwd&t6$=BLZ@F>2=E6sC!GjSb8X=4}^E6 z2ZXuyVvn2YUGV;{Q}6VL2+#7KUgwj#d>?uWq_!&k1X5S+zT%vr>*_dT@CGmHbEBwp zRo2ve^YxmsUeBSAgI<&~^oF?9yVwD}N2B-ab@WdEkls&X(>rU^4thDtZH-?8yoWEP4_;s2ch?LaC)%;z1wQ=dM!WK zUdNX@IJMYL8_yX#mYT!;^Y4KNspbEo>mrDHdAC(>8oOtEZ+zU?iW-@-mR28s$lesc zF$TTAkKU~}*E@B+Zc@vZ+6?tbsijJ7AfT+;&|$~EX#ZCqw(H^(`Z~^n3tjKjxaLx8 zJOK~WAc>?dKe2a32bk_OrGxj2dTrFT-tBcEsi8{^nmVYS*ME(i^3HQ6zddGZpZC7t zmpR5u+v7&h%-!oI7{AtQonhuHtiKo{NZ%}?fai|wB{4*VX*c2*rnuJw-W zQpc3~vD7f7{;Jn6tEr#uBd2$NM&H7w)ccl8%@Q7@-d7DDaqA{TyTk+M;BlqXSDq@F zy2O}vZ)zW7&&BCrs8a8NaIJS+9Z#>HO8rr4r;^jvbLr>EDJEnNS~7Ii*oalsuCGw9 z+Y1ja_aS-kK<*UpZ+ap}>Oob|o`OfyL#Qc+Qj`0Deh{mz9_Lc;$Zo5B+G>a7!rMvh z>R>hbs(lu}_eSEU!-}VxUFHhN%QPjAy;$lZQV)6g@#WN|(}j<-g<)xb2FHQ;xJ>X~ zY3rMCsdrlq$J>^Nch=3QJCXM|8}E5CHqP^Nm$H+`9Y<}W(pj6K&bQ^MTw=_UtLrDF z;op^8gy-hY;C(!J{{Xzx^FaO7sdtgxsdr?j20-1*mJ6lkMQ+vNeX@#s^xH`RpNDWa zt&^)Fw?7dcPTT4$HT5Cxb?f#TEX}B)+(#YaLvr7yNWU$84FTITsijof>dr3p&iYbw zBai7t%}4508I0G4?+P&5fy=Q^0;-+Hf3F?HHU)tW8hut%r?DC{|IY?)1M0BwmU6j2w_m<7xue=cDk=kQN?^v(HSyCgGT&u0lcZ1&b90@s} zFOa>ztRo-R^nm6=2cZG-9l2=(^}#B^jpWvC`CRIsHM;mA#`E3#>?<$zE zcm!)t51rb9nb>J?|>@wHm$Wqj%?-RpzMufj4ik zxm(YL@t)*WrPh_$UUI5>E>d){C$`mzwy*rpiZa`c* zMHD`ws#XqhFFDXUK8_qxXXeQzKlU~AI%^O0*LD1E&mWA0j|1$HYT;XQzLFCpPhL$f zTi5%x*{fR+FIL0DZ}vPU`Pe*{=PcH4L0+hjtGcFR-TEUo@`r~M-aD`7SS7F5x)edbZ+ zp6PMT-P7}$hv)jLHl3B#bH7sSZ7cVLc~M+2{cjx~TwCDeOL>Es^4CPM!XYSLw--+&TaHp?7BYPx0;*W&C%$=~$`iV9F--mlr z7w+{(xXF&gw+))b=b9Rk45Z0_@yUV*=vLtlm$>o;YNk(^ETZkUb4NyxeX;aaos_smPewI9BQA5`FV6EOzIYz7uv+S# zQnO8H_fhGF@g>9X-4(>He-c0YCitEXhVONpQ?}uE>co@uK0kHFCub8EE_04NZSnuI z|MsWz`ccm+Cl0;jur)HbWbHcdI{t=VZH`Pc@Tt!@zQcd|Ku)|lzITjzZu79Fy?=n% pn#%bIlKg3TAURl8N#j - - - - Aurelia - - - - - - - - - - - - - diff --git a/skeleton/jest/README.md b/skeleton/jest/README.md deleted file mode 100644 index 5edc4ce69..000000000 --- a/skeleton/jest/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Unit tests - -Run `au test` (or `au jest`). - -To run in watch mode, `au test --watch` or `au jest --watch`. diff --git a/skeleton/jest/aurelia_project/tasks/jest.ext b/skeleton/jest/aurelia_project/tasks/jest.ext deleted file mode 100644 index 5356c1552..000000000 --- a/skeleton/jest/aurelia_project/tasks/jest.ext +++ /dev/null @@ -1 +0,0 @@ -export {default} from './test'; diff --git a/skeleton/jest/aurelia_project/tasks/jest.json b/skeleton/jest/aurelia_project/tasks/jest.json deleted file mode 100644 index 274d1a888..000000000 --- a/skeleton/jest/aurelia_project/tasks/jest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "jest", - "description": "Runs Jest and reports the results.", - "flags": [ - { - "name": "watch", - "description": "Watches test files for changes and re-runs the tests automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/jest/aurelia_project/tasks/test.ext b/skeleton/jest/aurelia_project/tasks/test.ext deleted file mode 100644 index ffddc5b1c..000000000 --- a/skeleton/jest/aurelia_project/tasks/test.ext +++ /dev/null @@ -1,31 +0,0 @@ -import { runCLI } from '@jest/core'; -// @if feat.babel -import path from 'path'; -import packageJson from '../../package.json'; -// @endif -// @if feat.typescript -import * as path from 'path'; -import * as packageJson from '../../package.json'; -// @endif - -import { CLIOptions } from 'aurelia-cli'; - -export default (cb) => { - let options = packageJson.jest; - - if (CLIOptions.hasFlag('watch')) { - Object.assign(options, { watchAll: true}); - } - - // @if feat.babel - process.env.BABEL_TARGET = 'node'; - // @endif - - runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => { - if (results.numFailedTests || results.numFailedTestSuites) { - cb('Tests Failed'); - } else { - cb(); - } - }); -}; diff --git a/skeleton/jest/aurelia_project/tasks/test.json b/skeleton/jest/aurelia_project/tasks/test.json deleted file mode 100644 index db2e88ad3..000000000 --- a/skeleton/jest/aurelia_project/tasks/test.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "test", - "description": "Runs Jest and reports the results.", - "flags": [ - { - "name": "watch", - "description": "Watches test files for changes and re-runs the tests automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/jest/package.json b/skeleton/jest/package.json deleted file mode 100644 index 60080b90f..000000000 --- a/skeleton/jest/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "devDependencies": { - "jest": "", - "jest-cli": "", - "jest-transform-stub": "", - "aurelia-loader-nodejs": "", - "aurelia-pal-nodejs": "", - - // @if feat.babel - "babel-jest": "", - // @endif - - // @if feat.typescript - "ts-jest": "", - "@types/jest": "", - // @endif - }, - "scripts": { - "test": "au test" - }, - "jest": { - "moduleNameMapper": { - // avoid aurelia-bindings v1+v2 conflict - "^aurelia-binding$": "/node_modules/aurelia-binding", - // @if feat['cli-bundler'] && (feat.less || feat.sass || feat.stylus) - // Because with cli-bundler, requests file.css, - // But jest cannot find the css file (generated by gulp when running real app mode). - "^.+\\.css$": "/test/mock-css" - // @endif - }, - "modulePaths": [ - "/src", - "/node_modules" - ], - "moduleFileExtensions": [ - // @if feat.typescript - "ts", - // @endif - "js", - "json" - ], - "transform": { - "^.+\\.(css|less|sass|scss|styl|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "jest-transform-stub", - // @if feat.babel - "^.+\\.js$": "babel-jest", - // @endif - - // @if feat.typescript - "^.+\\.ts$": "ts-jest", - // @endif - }, - // @if feat.babel - "testRegex": "\\.spec\\.js$", - // @endif - - // @if feat.typescript - "testRegex": "\\.spec\\.(ts|js)$", - // @endif - "setupFiles": [ - // @if feat.babel - "/test/jest-pretest.js", - // @endif - - // @if feat.typescript - "/test/jest-pretest.ts", - // @endif - ], - "testEnvironment": "node", - "collectCoverage": true, - "collectCoverageFrom": [ - // @if feat.babel - "src/**/*.js", - "!**/*.spec.js", - // @endif - - // @if feat.typescript - "src/**/*.{js,ts}", - "!**/*.spec.{js,ts}", - // @endif - "!**/node_modules/**", - "!**/test/**" - ], - "coverageDirectory": "/test/coverage-jest", - "coverageReporters": [ - "json", - "lcov", - "text", - "html" - ] - } -} diff --git a/skeleton/jest/test/jest-pretest.ext b/skeleton/jest/test/jest-pretest.ext deleted file mode 100644 index 3fbeb04c5..000000000 --- a/skeleton/jest/test/jest-pretest.ext +++ /dev/null @@ -1,11 +0,0 @@ -import 'aurelia-polyfills'; -import {Options} from 'aurelia-loader-nodejs'; -import {globalize} from 'aurelia-pal-nodejs'; -// @if feat.babel -import path from 'path'; -// @endif -// @if feat.typescript -import * as path from 'path'; -// @endif -Options.relativeToDir = path.join(__dirname, 'unit'); -globalize(); diff --git a/skeleton/jest/test__if_cli-bundler/mock-css.js__if_less_or_sass_or_stylus b/skeleton/jest/test__if_cli-bundler/mock-css.js__if_less_or_sass_or_stylus deleted file mode 100644 index 9dc5fc1e4..000000000 --- a/skeleton/jest/test__if_cli-bundler/mock-css.js__if_less_or_sass_or_stylus +++ /dev/null @@ -1 +0,0 @@ -module.exports = ''; diff --git a/skeleton/karma/README.md b/skeleton/karma/README.md deleted file mode 100644 index dbb405c26..000000000 --- a/skeleton/karma/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Unit tests - -Run `au test` (or `au karma`). - -To run in watch mode, `au test --watch` or `au karma --watch`. diff --git a/skeleton/karma/aurelia_project/tasks/karma.ext b/skeleton/karma/aurelia_project/tasks/karma.ext deleted file mode 100644 index 5356c1552..000000000 --- a/skeleton/karma/aurelia_project/tasks/karma.ext +++ /dev/null @@ -1 +0,0 @@ -export {default} from './test'; diff --git a/skeleton/karma/aurelia_project__if_cli-bundler/tasks/karma.json b/skeleton/karma/aurelia_project__if_cli-bundler/tasks/karma.json deleted file mode 100644 index b7987fb91..000000000 --- a/skeleton/karma/aurelia_project__if_cli-bundler/tasks/karma.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "karma", - "description": "Runs all unit tests and reports the results.", - "flags": [ - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "watch", - "description": "Watches test files for changes and re-runs the tests automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.ext b/skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.ext deleted file mode 100644 index 2914d3160..000000000 --- a/skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.ext +++ /dev/null @@ -1,38 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import path from 'path'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as path from 'path'; -// @endif -import {Server as Karma} from 'karma'; -import {CLIOptions} from 'aurelia-cli'; -import build from './build'; -import watch from './watch'; - -let karma = done => { - new Karma({ - configFile: path.join(__dirname, '/../../karma.conf.js'), - singleRun: !CLIOptions.hasFlag('watch') - }, (err) => { done(); if (err) { process.exit(err); } }).start(); -}; - -let unit; - -if (CLIOptions.hasFlag('watch')) { - unit = gulp.series( - build, - gulp.parallel( - done => { watch(); done(); }, - karma - ) - ); -} else { - unit = gulp.series( - build, - karma - ); -} - -export { unit as default }; diff --git a/skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.json b/skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.json deleted file mode 100644 index 9e2a674b7..000000000 --- a/skeleton/karma/aurelia_project__if_cli-bundler/tasks/test.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "test", - "description": "Runs all unit tests and reports the results.", - "flags": [ - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "watch", - "description": "Watches test files for changes and re-runs the tests automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/karma/aurelia_project__if_webpack/tasks/karma.json b/skeleton/karma/aurelia_project__if_webpack/tasks/karma.json deleted file mode 100644 index 9ff49da7d..000000000 --- a/skeleton/karma/aurelia_project__if_webpack/tasks/karma.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "karma", - "description": "Runs Karma and reports the results.", - "flags": [ - { - "name": "watch", - "description": "Watches test files for changes and re-runs the tests automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/karma/aurelia_project__if_webpack/tasks/test.ext b/skeleton/karma/aurelia_project__if_webpack/tasks/test.ext deleted file mode 100644 index ce0cde0d9..000000000 --- a/skeleton/karma/aurelia_project__if_webpack/tasks/test.ext +++ /dev/null @@ -1,21 +0,0 @@ -import {Server as Karma} from 'karma'; -import {CLIOptions} from 'aurelia-cli'; -// @if feat.babel -import path from 'path'; -// @endif -// @if feat.typescript -import * as path from 'path'; -// @endif - -let karma = done => { - new Karma({ - configFile: path.join(__dirname, '/../../test/karma.conf.js'), - singleRun: !CLIOptions.hasFlag('watch'), - autoWatch: CLIOptions.hasFlag('watch') - }, function(exitCode) { - console.log('Karma has exited with ' + exitCode) - process.exit(exitCode) - }).start(); -}; - -export { karma as default }; diff --git a/skeleton/karma/aurelia_project__if_webpack/tasks/test.json b/skeleton/karma/aurelia_project__if_webpack/tasks/test.json deleted file mode 100644 index cd9931bf6..000000000 --- a/skeleton/karma/aurelia_project__if_webpack/tasks/test.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "test", - "description": "Runs Karma and reports the results.", - "flags": [ - { - "name": "watch", - "description": "Watches test files for changes and re-runs the tests automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/karma/karma.conf.js__if_cli-bundler b/skeleton/karma/karma.conf.js__if_cli-bundler deleted file mode 100644 index 286bff7bc..000000000 --- a/skeleton/karma/karma.conf.js__if_cli-bundler +++ /dev/null @@ -1,95 +0,0 @@ -const path = require('path'); -const project = require('./aurelia_project/aurelia.json'); -// @if feat.typescript -const tsconfig = require('./tsconfig.json'); -// @endif -const karmaConfig = project.unitTestRunner; - -let testSrc = [ - { pattern: karmaConfig.source, included: false }, - 'test/aurelia-karma.js' -]; - -let output = project.platform.output; -let appSrc = project.build.bundles.map(x => path.join(output, x.name)); -let entryIndex = appSrc.indexOf(path.join(output, project.build.loader.configTarget)); -let entryBundle = appSrc.splice(entryIndex, 1)[0]; -let sourceMaps = [{pattern:'scripts/**/*.js.map', included: false}]; -let files = [entryBundle].concat(testSrc).concat(appSrc).concat(sourceMaps); - -// @if feat.babel -let transpilerOptions = project.transpiler.options; -transpilerOptions.sourceMap = 'inline'; -// @endif -// @if feat.typescript -let compilerOptions = tsconfig.compilerOptions; -compilerOptions.inlineSourceMap = true; -compilerOptions.inlineSources = true; -compilerOptions.module = 'amd'; -// @endif - -module.exports = function(config) { - config.set({ - basePath: '', - frameworks: [project.testFramework.id], - files: files, - exclude: [], - preprocessors: { - [karmaConfig.source]: [project.transpiler.id], - [appSrc]: ['sourcemap'] - }, -// @if feat.babel - 'babelPreprocessor': { options: transpilerOptions }, -// @endif -// @if feat.typescript - typescriptPreprocessor: { - typescript: require('typescript'), - options: compilerOptions - }, -// @endif - reporters: ['progress'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - /* - * start these browsers - * available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - */ - // browsers: [ - // 'Chrome', - // ], - /* - * To run in non-headless mode: - * 1. Comment the following lines - * 2. Uncomment the above "browsers" setting - */ - browsers: [ - 'ChromeHeadless', - ], - customLaunchers: { - 'ChromeHeadless': { - base: 'Chrome', - flags: [ - '--no-sandbox', - '--headless', - '--disable-gpu', - '--remote-debugging-port=9222' - ] - } - }, - /** **************************************************************************** */ - - /* - * Continuous Integration mode - * if true, Karma captures browsers, runs the tests and exits - */ - singleRun: true, - // client.args must be a array of string. - // Leave 'aurelia-root', project.paths.root in this order so we can find - // the root of the aurelia project. - client: { - args: ['aurelia-root', project.paths.root] - } - }); -}; diff --git a/skeleton/karma/package.json b/skeleton/karma/package.json deleted file mode 100644 index fc1995400..000000000 --- a/skeleton/karma/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "devDependencies": { - "jasmine-core": "", - "karma": "", - "karma-chrome-launcher": "", - "karma-jasmine": "", - "karma-sourcemap-loader": "", - - // @if feat.webpack - "karma-coverage": "", - "karma-mocha-reporter": "", - "karma-webpack": "", - "karma-coverage-istanbul-reporter": "", - "jest-jasmine2": "", - "jest-matchers": "", - // @endif - - // @if feat.babel - "karma-babel-preprocessor": "", - // @endif - - // @if feat.typescript - "karma-typescript-preprocessor": "", - "@types/jasmine": "", - // @endif - }, - - "scripts": { - "test": "au test" - } -} \ No newline at end of file diff --git a/skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_requirejs_or_alameda b/skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_requirejs_or_alameda deleted file mode 100644 index 8ca18c6fd..000000000 --- a/skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_requirejs_or_alameda +++ /dev/null @@ -1,109 +0,0 @@ -(function(global) { - var karma = global.__karma__; - var requirejs = global.requirejs - var locationPathname = global.location.pathname; - var root = 'src'; - karma.config.args.forEach(function(value, index) { - if (value === 'aurelia-root') { - root = karma.config.args[index + 1]; - } - }); - - if (!karma || !requirejs) { - return; - } - - function normalizePath(path) { - var normalized = [] - var parts = path - .split('?')[0] // cut off GET params, used by noext requirejs plugin - .split('/') - - for (var i = 0; i < parts.length; i++) { - if (parts[i] === '.') { - continue - } - - if (parts[i] === '..' && normalized.length && normalized[normalized.length - 1] !== '..') { - normalized.pop() - continue - } - - normalized.push(parts[i]) - } - - // Use case of testing source code. RequireJS doesn't add .js extension to files asked via sibling selector - // If normalized path doesn't include some type of extension, add the .js to it - if (normalized.length > 0 && normalized[normalized.length - 1].indexOf('.') < 0) { - normalized[normalized.length - 1] = normalized[normalized.length - 1] + '.js' - } - - return normalized.join('/') - } - - function patchRequireJS(files, originalLoadFn, locationPathname) { - var IS_DEBUG = /debug\.html$/.test(locationPathname) - -// @if feat.requirejs - requirejs.load = function (context, moduleName, url) { - url = normalizePath(url) - - if (files.hasOwnProperty(url) && !IS_DEBUG) { - url = url + '?' + files[url] - } - - if (url.indexOf('/base') !== 0) { - url = '/base/' + url; - } - - return originalLoadFn.call(this, context, moduleName, url) - } -// @endif -// @if feat.alameda - var origNameToUrl = requirejs.nameToUrl; - requirejs.nameToUrl = function karmaNameToUrl(moduleName) { - let url = origNameToUrl(moduleName); - // Map paths to karma server - if (url.indexOf('/base') !== 0) { - url = `/base/${url}`; - } - // Prevent caching by appending file hash as query - if (files.hasOwnProperty(url) && !IS_DEBUG) { - url = `${url}?${files[url]}`; - } - return url; - }; -// @endif - - var originalDefine = global.define; - global.define = function(name, deps, m) { - if (typeof name === 'string') { - // alias from module "/base/root/name" to module "name" - originalDefine('/base/' + root + '/' + name, [name], function (result) { return result; }); - } - - // normal module define("name") - return originalDefine(name, deps, m); - }; - global.define.amd = originalDefine.amd; - } - - function requireTests() { - var TEST_REGEXP = /(spec)\.js$/i; - var allTestFiles = []; - - Object.keys(window.__karma__.files).forEach(function(file) { - if (TEST_REGEXP.test(file)) { - allTestFiles.push(file); - } - }); - - require(['/base/test/unit/setup.js'], function() { - require(allTestFiles, window.__karma__.start); - }); - } - - karma.loaded = function() {}; // make it async - patchRequireJS(karma.files, requirejs.load, locationPathname); - requireTests(); -})(window); diff --git a/skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_systemjs b/skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_systemjs deleted file mode 100644 index afd57e9ce..000000000 --- a/skeleton/karma/test__if_cli-bundler/aurelia-karma.js__if_systemjs +++ /dev/null @@ -1,54 +0,0 @@ -(function(global) { - var karma = global.__karma__; - var root = 'src'; - karma.config.args.forEach(function(value, index) { - if (value === 'aurelia-root') { - root = karma.config.args[index + 1]; - } - }); - - if (!karma) { - return; - } - - function patchSystemJS() { - SystemJS.config({ - "packages": { - "base/test": { - "defaultExtension": "js" - } - } - }); - - var originalDefine = global.define; - global.define = function(name, deps, m) { - if (typeof name === 'string') { - // alias from module "/base/root/name" to module "name" - originalDefine('/base/' + root + '/' + name, [name], function (result) { return result; }); - } - - // normal module define("name") - return originalDefine(name, deps, m); - }; - global.define.amd = originalDefine.amd; - } - - function requireTests() { - var TEST_REGEXP = /(spec)\.js$/i; - var allTestFiles = []; - - Object.keys(window.__karma__.files).forEach(function(file) { - if (TEST_REGEXP.test(file)) { - allTestFiles.push(file); - } - }); - - require(['/base/test/unit/setup.js'], function() { - require(allTestFiles, window.__karma__.start); - }); - } - - karma.loaded = function() {}; // make it async - patchSystemJS(); - requireTests(); -})(window); diff --git a/skeleton/karma/test__if_cli-bundler/unit/setup.ext b/skeleton/karma/test__if_cli-bundler/unit/setup.ext deleted file mode 100644 index a2498ccb1..000000000 --- a/skeleton/karma/test__if_cli-bundler/unit/setup.ext +++ /dev/null @@ -1,3 +0,0 @@ -import 'aurelia-polyfills'; -import {initialize} from 'aurelia-pal-browser'; -initialize(); diff --git a/skeleton/karma/test__if_webpack/karma-bundle.js b/skeleton/karma/test__if_webpack/karma-bundle.js deleted file mode 100644 index ddbec218e..000000000 --- a/skeleton/karma/test__if_webpack/karma-bundle.js +++ /dev/null @@ -1,43 +0,0 @@ -import 'aurelia-polyfills'; -import 'aurelia-loader-webpack'; -import {install as installJasmineAsync} from 'jest-jasmine2/jasmine_async'; - -// enable running Promise-returning tests: -installJasmineAsync(global); - -// disable stacktrace limit so we do not loose any error information -Error.stackTraceLimit = Infinity; - -// load and run tests: -const testModuleContexts = loadTestModules(); -runTests(testModuleContexts); - -function loadTestModules() { - const srcContext = require.context( - // directory: - '../src', - // recursive: - true, - // tests in /src folder regex: - /\.spec\.[tj]s$/im - ); - - const testContext = require.context( - // directory: - './unit', - // recursive: - true, - // tests in ./unit folder regex: - /\.spec\.[tj]s$/im - ); - - return [srcContext, testContext]; -} - -function runTests(contexts) { - contexts.forEach(requireAllInContext); -} - -function requireAllInContext(requireContext) { - return requireContext.keys().map(requireContext); -} diff --git a/skeleton/karma/test__if_webpack/karma.conf.js b/skeleton/karma/test__if_webpack/karma.conf.js deleted file mode 100644 index fbdb24c67..000000000 --- a/skeleton/karma/test__if_webpack/karma.conf.js +++ /dev/null @@ -1,114 +0,0 @@ -const path = require('path'); - -module.exports = function (config) { - config.set({ - /** - * base path that will be used to resolve all patterns (e.g. files, exclude) - */ - basePath: path.dirname(__dirname), - - /** - * Frameworks to use - * - * available frameworks: https://npmjs.org/browse/keyword/karma-adapter - */ - frameworks: [ 'jasmine' ], - - /** - * list of files / patterns to load in the browser - * we are building the test environment in ./spec-bundle.js - */ - files: [ - { pattern: 'test/karma-bundle.js', watched: false } - ], - - /* - * preprocess matching files before serving them to the browser - * available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - */ - preprocessors: { - 'test/karma-bundle.js': [ 'webpack' ] - }, - - webpack: require('../webpack.config')({ tests: true }), - - /* - * test results reporter to use - * - * possible values: 'dots', 'progress' - * available reporters: https://npmjs.org/browse/keyword/karma-reporter - */ -// @if feat.babel - reporters: [ 'mocha', 'progress', 'coverage' ], - - coverageReporter: { - reporters: [ { type: 'html' }, { type: 'lcovonly' }, { type: 'text-summary' } ], - dir: path.resolve(__dirname, 'coverage-karma'), - subdir: '.', - }, -// @endif - -// @if feat.typescript - reporters: [ 'mocha', 'progress', 'coverage-istanbul' ], - - coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly', 'text-summary' ], - dir: path.resolve(__dirname, 'coverage-karma'), - fixWebpackSourcePaths: true, - }, -// @endif - - // Webpack please don't spam the console when running in karma! - webpackServer: { noInfo: true }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - /* - * level of logging - * possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - */ - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - /* - * start these browsers - * available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - */ - // browsers: [ - // 'Chrome', - // ], - /* - * To run in non-headless mode: - * 1. Comment the following lines - * 2. Uncomment the above "browsers" setting - */ - browsers: [ - 'ChromeHeadless', - ], - - customLaunchers: { - 'ChromeHeadless': { - base: 'Chrome', - flags: [ - '--no-sandbox', - '--headless', - '--disable-gpu', - '--remote-debugging-port=9222' - ] - } - }, - /** **************************************************************************** */ - - /* - * Continuous Integration mode - * if true, Karma captures browsers, runs the tests and exits - */ - singleRun: true - }) -} diff --git a/skeleton/plugin/README.md b/skeleton/plugin/README.md deleted file mode 100644 index 2ce5a6953..000000000 --- a/skeleton/plugin/README.md +++ /dev/null @@ -1,157 +0,0 @@ -This Aurelia plugin project has a built-in dev app (with CLI built-in bundler and RequireJS) to simplify development. - -1. The local `src/` folder, is the source code for the plugin. -2. The local `dev-app/` folder, is the code for the dev app, just like a normal app bootstrapped by aurelia-cli. -3. You can use normal `au run` and `au test` in development just like developing an app. -4. You can use aurelia-testing to test your plugin, just like developing an app. -5. To ensure compatibility to other apps, always use `PLATFORM.moduleName()` wrapper in files inside `src/`. You don't need to use the wrapper in `dev-app/` folder as CLI built-in bundler supports module name without the wrapper. - -Note aurelia-cli doesn't provide a plugin skeleton with Webpack setup (not yet), but this plugin can be consumed by any app using Webpack, or CLI built-in bundler, or jspm. - -## How to write an Aurelia plugin - -For a full length tutorial, visit [Aurelia plugin guide](https://aurelia.io/docs/plugins/write-new-plugin). - -Here is some basics. You can create new custom element, custom attribute, value converter or binding behavior manually, or use command `au generate` to help. -```shell -au generate element some-name -au generate attribute some-name -au generate value-converter some-name -au generate binding-behavior some-name -``` - -By default, the cli generates command generates files in following folders: -``` -src/elements -src/attributes -src/value-converters -src/binding-behaviors -``` - -Note the folder structure is only to help you organising the files, it's not a requirement of Aurelia. You can manually create new element (or other thing) anywhere in `src/`. - -After you added some new file, you need to register it in `src/index./* @if feat.babel **js/* @endif *//* @if feat.typescript **ts/* @endif */`. Like this: -```js -config.globalResources([ - // ... - PLATFORM.moduleName('./path/to/new-file-without-ext') -]); -```` - -The usage of `PLATFORM.moduleName` wrapper is mandatory. It's needed for your plugin to be consumed by any app using webpack, CLI built-in bundler, or jspm. - -## Resource import within the dev app - -In dev app, when you need to import something from the inner plugin (for example, importing a class for dependency injection), use special name `"resources"` to reference the inner plugin. - -// @if feat.babel -```js -import {inject} from 'aurelia-framework'; -// "resources" refers the inner plugin src/index.js -import {MyService} from 'resources'; - -@inject(MyService) -export class App { - constructor(myService) { - this.myService = myService; - } -} -``` -// @endif -// @if feat.typescript -```js -import {autoinject} from 'aurelia-framework'; -// "resources" refers the inner plugin src/index.ts -import {MyService} from 'resources'; - -@autoinject() -export class App { - constructor(myService: MyService) {} -} -``` -// @endif - -## Manage dependencies - -By default, this plugin has no "dependencies" in package.json. Theoretically this plugin depends on at least `aurelia-pal` because `src/index./* @if feat.babel **js/* @endif *//* @if feat.typescript **ts/* @endif */` imports it. It could also depends on more core Aurelia package like `aurelia-binding` or `aurelia-templating` if you build advanced components that reference them. - -Ideally you need to carefully add those `aurelia-pal` (`aurelia-binding`...) to "dependencies" in package.json. But in practice you don't have to. Because every app that consumes this plugin will have full Aurelia core packages installed. - -Furthermore, there are two benefits by leaving those dependencies out of plugin's package.json. -1. ensure this plugin doesn't bring in a duplicated Aurelia core package to consumers' app. This is mainly for app built with webpack. We had been hit with `aurelia-binding` v1 and v2 conflicts due to 3rd party plugin asks for `aurelia-binding` v1. -2. reduce the burden for npm/yarn when installing this plugin. - -If you are a perfectionist who could not stand leaving out dependencies, I recommend you to add `aurelia-pal` (`aurelia-binding`...) to "peerDependencies" in package.json. So at least it could not cause a duplicated Aurelia core package. - -If your plugin depends on other npm package, like `lodash` or `jquery`, **you have to add them to "dependencies" in package.json**. - -## Build Plugin - -Run `au build-plugin`. This will transpile all files from `src/` folder to `dist/native-modules/` and `dist/commonjs/`. - -For example, `src/index./* @if feat.babel */js/* @endif *//* @if feat.typescript */ts/* @endif */` will become `dist/native-modules/index.js` and `dist/commonjs/index.js`. - -Note all other files in `dev-app/` folder are for the dev app, they would not appear in the published npm package. - -## Consume Plugin - -By default, the `dist/` folder is not committed to git. (We have `/dist` in `.gitignore`). But that would not prevent you from consuming this plugin through direct git reference. - -You can consume this plugin directly by: -```shell -npm i github:your_github_username//* @echo projectName */ -# or if you use bitbucket -npm i bitbucket:your_github_username//* @echo projectName */ -# or if you use gitlab -npm i gitlab:your_github_username//* @echo projectName */ -# or plain url -npm i https:/github.com/your_github_username//* @echo projectName */.git -``` - -Then load the plugin in app's `main./* @if feat.babel **js/* @endif *//* @if feat.typescript **ts/* @endif */` like this. -```js -aurelia.use.plugin('/* @echo projectName */'); -// for webpack user, use PLATFORM.moduleName wrapper -aurelia.use.plugin(PLATFORM.moduleName('/* @echo projectName */')); -``` - -The missing `dist/` files will be filled up by npm through `"prepare": "npm run build"` (in `"scripts"` section of package.json). - -Yarn has a [bug](https://github.com/yarnpkg/yarn/issues/5235) that ignores `"prepare"` script. If you want to use yarn to consume your plugin through direct git reference, remove `/dist` from `.gitignore` and commit all the files. Note you don't need to commit `dist/` files if you only use yarn to consume this plugin through published npm package (`npm i /* @echo projectName */`). - -## Publish npm package - -By default, `"private"` field in package.json has been turned on, this prevents you from accidentally publish a private plugin to npm. - -To publish the plugin to npm for public consumption: - -1. Remove `"private": true,` from package.json. -2. Pump up project version. This will run through `au test` (in "preversion" in package.json) first. -```shell -npm version patch # or minor or major -``` -3. Push up changes to your git server -```shell -git push && git push --tags -``` -4. Then publish to npm, you need to have your npm account logged in. -```shell -npm publish -``` - -## Automate changelog, git push, and npm publish - -You can enable `npm version patch # or minor or major` to automatically update changelog, push commits and version tag to the git server, and publish to npm. - -Here is one simple setup. -1. `npm i -D standard-changelog`. We use [`standard-changelog`](https://github.com/conventional-changelog/conventional-changelog) as a minimum example to support conventional changelog. - * Alternatively you can use high level [standard-version](https://github.com/conventional-changelog/standard-version). -2. Add two commands to `"scripts"` section of package.json. -``` -"scripts": { - // ... - "version": "standard-changelog && git add CHANGELOG.md", - "postversion": "git push && git push --tags && npm publish" -}, -``` -3. you can remove `&& npm publish` if your project is private diff --git a/skeleton/plugin/aurelia_project/aurelia.json b/skeleton/plugin/aurelia_project/aurelia.json deleted file mode 100644 index ae48a5e48..000000000 --- a/skeleton/plugin/aurelia_project/aurelia.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "project:plugin", - "paths": { - "root": "dev-app", - "resources": "../src", - "elements": "../src/elements", - "attributes": "../src/attributes", - "valueConverters": "../src/value-converters", - "bindingBehaviors": "../src/binding-behaviors" - }, - "plugin": { - "source": { - // @if feat.babel - "js": "src/**/*.js", - // @endif - - // @if feat.typescript - "js": "src/**/*.ts", - // @endif - - // @if ! (feat.less || feat.sass || feat.stylus) - "css": "src/**/*.css", - // @endif - - // @if feat.less - "css": "src/**/*.less", - // @endif - - // @if feat.sass - "css": "src/**/*.scss", - // @endif - - // @if feat.stylus - "css": "src/**/*.styl", - // @endif - - "html": "src/**/*.html", - "json": "src/**/*.json" - } - } -} \ No newline at end of file diff --git a/skeleton/plugin/aurelia_project/tasks/build-plugin.ext b/skeleton/plugin/aurelia_project/tasks/build-plugin.ext deleted file mode 100644 index 7e1193153..000000000 --- a/skeleton/plugin/aurelia_project/tasks/build-plugin.ext +++ /dev/null @@ -1,54 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -import del from 'del'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -import * as del from 'del'; -// @endif -import { pluginMarkup } from './process-markup'; -import { pluginCSS } from './process-css'; -import { pluginJson } from './process-json'; -import { buildPluginJavaScript } from './transpile'; -import { CLIOptions } from 'aurelia-cli'; - -function clean() { - return del('dist'); -} - -let build = gulp.series( - gulp.parallel( - // package.json "module" field pointing to dist/native-modules/index.js - pluginMarkup('dist/native-modules'), - pluginCSS('dist/native-modules'), - pluginJson('dist/native-modules'), - buildPluginJavaScript('dist/native-modules', 'es2015'), - - // package.json "main" field pointing to dist/native-modules/index.js - pluginMarkup('dist/commonjs'), - pluginCSS('dist/commonjs'), - pluginJson('dist/commonjs'), - buildPluginJavaScript('dist/commonjs', 'commonjs'), - ), (done) => { - console.log('Finish building Aurelia plugin to dist/commonjs and dist/native-modules.'); - done(); - } -); - -let main; -if (CLIOptions.hasFlag('watch')) { - main = gulp.series( - clean, - () => { - console.log('Watching plugin sources for changes ...'); - return gulp.watch('src/**/*', { ignoreInitial: false }, build); - } - ); -} else { - main = gulp.series( - clean, - build - ); -} - -export { main as default }; diff --git a/skeleton/plugin/dev-app/app.ext b/skeleton/plugin/dev-app/app.ext deleted file mode 100644 index f0f8240bb..000000000 --- a/skeleton/plugin/dev-app/app.ext +++ /dev/null @@ -1,13 +0,0 @@ -export class App { - // @if feat.babel - message = 'from Aurelia!'; - // @endif - // @if feat.typescript - public message: string = 'from Aurelia!'; - // @endif - - clicked() { - // eslint-disable-next-line no-alert - alert('A primary button click or a touch'); - } -} diff --git a/skeleton/plugin/dev-app/app.html b/skeleton/plugin/dev-app/app.html deleted file mode 100644 index 57b19e292..000000000 --- a/skeleton/plugin/dev-app/app.html +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/skeleton/plugin/dev-app/environment.ext b/skeleton/plugin/dev-app/environment.ext deleted file mode 100644 index 3495e9a9d..000000000 --- a/skeleton/plugin/dev-app/environment.ext +++ /dev/null @@ -1,4 +0,0 @@ -export default { - debug: true, - testing: true -}; diff --git a/skeleton/plugin/dev-app/main.ext b/skeleton/plugin/dev-app/main.ext deleted file mode 100644 index 85d5f0ac5..000000000 --- a/skeleton/plugin/dev-app/main.ext +++ /dev/null @@ -1,25 +0,0 @@ -// @if feat.babel -// regenerator-runtime is to support async/await syntax in ESNext. -// If you target latest browsers (have native support), or don't use async/await, you can remove regenerator-runtime. -import 'regenerator-runtime/runtime'; -// @endif -// @if feat.typescript -import {Aurelia} from 'aurelia-framework'; -// @endif -import environment from './environment'; - -export function configure(aurelia/* @if feat.typescript **: Aurelia/* @endif */) { - aurelia.use - .standardConfiguration() - // load the plugin ../src - // The "resources" is mapped to "../src" in aurelia.json "paths" - .feature('resources'); - - aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn'); - - if (environment.testing) { - aurelia.use.plugin('aurelia-testing'); - } - - aurelia.start().then(() => aurelia.setRoot()); -} diff --git a/skeleton/plugin/package.json b/skeleton/plugin/package.json deleted file mode 100644 index 45710f655..000000000 --- a/skeleton/plugin/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "An Aurelia plugin project.", - "main": "dist/commonjs/index.js", - "module": "dist/native-modules/index.js", - "private": true, - "license": "UNLICENSED", - "scripts": { - "build": "au build-plugin", - "watch": "au build-plugin --watch", - "prepare": "npm run build", - // @if feat.karma || feat.jest - "pretest": "au lint", - "preversion": "au test", - // @endif - - }, - "files": [ - "dist", - "src" - ], - "devDependencies": { - "del": "", - "gulp-sourcemaps": "" - } -} diff --git a/skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.js__if_babel b/skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.js__if_babel deleted file mode 100644 index 54bbfa83d..000000000 --- a/skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.js__if_babel +++ /dev/null @@ -1,12 +0,0 @@ -import {inject} from 'aurelia-framework'; - -@inject(Element) -export class ColorCustomAttribute { - constructor(element) { - this.element = element; - } - - valueChanged(newValue, oldValue) { - this.element.style.color = newValue; - } -} diff --git a/skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.ts__if_typescript b/skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.ts__if_typescript deleted file mode 100644 index 35ed60592..000000000 --- a/skeleton/plugin/src/attributes__if_plugin-scaffold-basic/color.ts__if_typescript +++ /dev/null @@ -1,10 +0,0 @@ -import {autoinject} from 'aurelia-framework'; - -@autoinject -export class ColorCustomAttribute { - constructor(private element: Element) {} - - valueChanged(newValue: string, oldValue: string) { - (this.element).style.color = newValue; - } -} diff --git a/skeleton/plugin/src/binding-behaviors__if_plugin-scaffold-basic/primary-click.ext b/skeleton/plugin/src/binding-behaviors__if_plugin-scaffold-basic/primary-click.ext deleted file mode 100644 index 55e7f9687..000000000 --- a/skeleton/plugin/src/binding-behaviors__if_plugin-scaffold-basic/primary-click.ext +++ /dev/null @@ -1,21 +0,0 @@ -// handle primary button click or a touch -function handlePrimaryClick(event) { - // mouse event primary button is 0, - // touch event button is undefined. - if (event.button) return; - // only call real callback when it is either primary mouse click or touch event. - this.primaryClickCallSource(event); -} - -export class PrimaryClickBindingBehavior { - bind(binding) { - if (!binding.callSource || !binding.targetEvent) throw new Error('primaryClick binding behavior only supports event.'); - binding.primaryClickCallSource = binding.callSource; - binding.callSource = handlePrimaryClick; - } - - unbind(binding) { - binding.callSource = binding.primaryClickCallSource; - binding.primaryClickCallSource = null; - } -} diff --git a/skeleton/plugin/src/elements/hello-world.css__if_not_less_and_not_sass_and_not_stylus b/skeleton/plugin/src/elements/hello-world.css__if_not_less_and_not_sass_and_not_stylus deleted file mode 100644 index a55799ac5..000000000 --- a/skeleton/plugin/src/elements/hello-world.css__if_not_less_and_not_sass_and_not_stylus +++ /dev/null @@ -1,3 +0,0 @@ -.hello-world { - background-color: lightgreen; -} diff --git a/skeleton/plugin/src/elements/hello-world.ext b/skeleton/plugin/src/elements/hello-world.ext deleted file mode 100644 index 673843141..000000000 --- a/skeleton/plugin/src/elements/hello-world.ext +++ /dev/null @@ -1,10 +0,0 @@ -import {bindable} from 'aurelia-framework'; - -export class HelloWorld { - // @if feat.babel - @bindable message = ''; - // @endif - // @if feat.typescript - @bindable public message: string = ''; - // @endif -} diff --git a/skeleton/plugin/src/elements/hello-world.html b/skeleton/plugin/src/elements/hello-world.html deleted file mode 100644 index 02621f866..000000000 --- a/skeleton/plugin/src/elements/hello-world.html +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/skeleton/plugin/src/elements/hello-world.less__if_less b/skeleton/plugin/src/elements/hello-world.less__if_less deleted file mode 100644 index a55799ac5..000000000 --- a/skeleton/plugin/src/elements/hello-world.less__if_less +++ /dev/null @@ -1,3 +0,0 @@ -.hello-world { - background-color: lightgreen; -} diff --git a/skeleton/plugin/src/elements/hello-world.scss__if_sass b/skeleton/plugin/src/elements/hello-world.scss__if_sass deleted file mode 100644 index a55799ac5..000000000 --- a/skeleton/plugin/src/elements/hello-world.scss__if_sass +++ /dev/null @@ -1,3 +0,0 @@ -.hello-world { - background-color: lightgreen; -} diff --git a/skeleton/plugin/src/elements/hello-world.styl__if_stylus b/skeleton/plugin/src/elements/hello-world.styl__if_stylus deleted file mode 100644 index 0e2a0a261..000000000 --- a/skeleton/plugin/src/elements/hello-world.styl__if_stylus +++ /dev/null @@ -1,2 +0,0 @@ -.hello-world - background-color: lightgreen diff --git a/skeleton/plugin/src/index.ext b/skeleton/plugin/src/index.ext deleted file mode 100644 index 1bc8b46bb..000000000 --- a/skeleton/plugin/src/index.ext +++ /dev/null @@ -1,15 +0,0 @@ -// @if feat.typescript -import {FrameworkConfiguration} from 'aurelia-framework'; -// @endif -import {PLATFORM} from 'aurelia-pal'; - -export function configure(config/* @if feat.typescript **: FrameworkConfiguration/* @endif */) { - config.globalResources([ - // @if feat['plugin-scaffold-basic'] - PLATFORM.moduleName('./attributes/color'), - PLATFORM.moduleName('./value-converters/upcase'), - PLATFORM.moduleName('./binding-behaviors/primary-click'), - // @endif - PLATFORM.moduleName('./elements/hello-world') - ]); -} diff --git a/skeleton/plugin/src/value-converters__if_plugin-scaffold-basic/upcase.ext b/skeleton/plugin/src/value-converters__if_plugin-scaffold-basic/upcase.ext deleted file mode 100644 index 22d002075..000000000 --- a/skeleton/plugin/src/value-converters__if_plugin-scaffold-basic/upcase.ext +++ /dev/null @@ -1,10 +0,0 @@ -export class UpcaseValueConverter { - // @if feat.babel - toView(value) { - // @endif - /* @if feat.typescript ** - toView(value: any): string { - /* @endif */ - return typeof value === 'string' ? value.toUpperCase() : ''; - } -} diff --git a/skeleton/plugin/test__if_karma_or_jest/unit/.eslintrc__if_babel b/skeleton/plugin/test__if_karma_or_jest/unit/.eslintrc__if_babel deleted file mode 100644 index 92629674b..000000000 --- a/skeleton/plugin/test__if_karma_or_jest/unit/.eslintrc__if_babel +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "no-var": 0 - } -} diff --git a/skeleton/plugin/test__if_karma_or_jest/unit/attributes__if_plugin-scaffold-basic/color.spec.ext b/skeleton/plugin/test__if_karma_or_jest/unit/attributes__if_plugin-scaffold-basic/color.spec.ext deleted file mode 100644 index 88149a1c9..000000000 --- a/skeleton/plugin/test__if_karma_or_jest/unit/attributes__if_plugin-scaffold-basic/color.spec.ext +++ /dev/null @@ -1,36 +0,0 @@ -import {StageComponent} from 'aurelia-testing'; -import {bootstrap} from 'aurelia-bootstrapper'; - -describe('color attribute', () => { - let component; - - afterEach(() => { - if (component) { - component.dispose(); - component = null; - } - }); - - it('sets font color', done => { - let model = {color: 'green'}; - - component = StageComponent - // @if feat.karma - .withResources('resources/attributes/color') - // @endif - // @if feat.jest - .withResources('attributes/color') - // @endif - .inView('

') - .boundTo(model); - - component.create(bootstrap).then(() => { - const view = component.element; - expect(view.style.color).toBe('green'); - done(); - }).catch(e => { - fail(e); - done(); - }); - }); -}); diff --git a/skeleton/plugin/test__if_karma_or_jest/unit/binding-behaviors__if_plugin-scaffold-basic/primary-click.spec.ext b/skeleton/plugin/test__if_karma_or_jest/unit/binding-behaviors__if_plugin-scaffold-basic/primary-click.spec.ext deleted file mode 100644 index 1d88638c8..000000000 --- a/skeleton/plugin/test__if_karma_or_jest/unit/binding-behaviors__if_plugin-scaffold-basic/primary-click.spec.ext +++ /dev/null @@ -1,63 +0,0 @@ -import {StageComponent} from 'aurelia-testing'; -import {bootstrap} from 'aurelia-bootstrapper'; - -function fireEvent(el, type, options) { - var o = options || {}; - var e = document.createEvent('Event'); - e.initEvent(type, true, true); - Object.keys(o).forEach(apply); - el.dispatchEvent(e); - function apply(key) { - e[key] = o[key]; - } -} - -function delay() { - return new Promise(resolve => { - setTimeout(resolve, 20); - }); -} - -describe('primaryClick binding behavior', () => { - let component; - - afterEach(() => { - if (component) { - component.dispose(); - component = null; - } - }); - - it('sets font color', done => { - let hitted = false; - function hit() { hitted = true; } - - let model = {hit}; - - component = StageComponent - // @if feat.karma - .withResources('resources/binding-behaviors/primary-click') - // @endif - // @if feat.jest - .withResources('binding-behaviors/primary-click') - // @endif - .inView('') - .boundTo(model); - - let view; - component.create(bootstrap).then(() => { - view = component.element; - fireEvent(view, 'click', {button: 0}); - }).then(delay).then(() => { - expect(hitted).toBe(true); - hitted = false; - fireEvent(view, 'click', {button: 1}); - }).then(delay).then(() => { - expect(hitted).toBe(false); - done(); - }).catch(e => { - fail(e); - done(); - }); - }); -}); diff --git a/skeleton/plugin/test__if_karma_or_jest/unit/elements/hello-world.spec.ext b/skeleton/plugin/test__if_karma_or_jest/unit/elements/hello-world.spec.ext deleted file mode 100644 index 99b579c2f..000000000 --- a/skeleton/plugin/test__if_karma_or_jest/unit/elements/hello-world.spec.ext +++ /dev/null @@ -1,36 +0,0 @@ -import {StageComponent} from 'aurelia-testing'; -import {bootstrap} from 'aurelia-bootstrapper'; - -describe('hello-world element', () => { - let component; - - afterEach(() => { - if (component) { - component.dispose(); - component = null; - } - }); - - it('says hello world with message', done => { - let model = {message: 'from me'}; - - component = StageComponent - // @if feat.karma - .withResources('resources/elements/hello-world') - // @endif - // @if feat.jest - .withResources('elements/hello-world') - // @endif - .inView('') - .boundTo(model); - - component.create(bootstrap).then(() => { - const view = component.element; - expect(view.textContent.trim()).toBe('Hello world from me'); - done(); - }).catch(e => { - fail(e); - done(); - }); - }); -}); diff --git a/skeleton/plugin/test__if_karma_or_jest/unit/value-converters__if_plugin-scaffold-basic/upcase.spec.ext b/skeleton/plugin/test__if_karma_or_jest/unit/value-converters__if_plugin-scaffold-basic/upcase.spec.ext deleted file mode 100644 index f209da061..000000000 --- a/skeleton/plugin/test__if_karma_or_jest/unit/value-converters__if_plugin-scaffold-basic/upcase.spec.ext +++ /dev/null @@ -1,23 +0,0 @@ -// @if feat.karma -import {UpcaseValueConverter} from 'resources/value-converters/upcase'; -// @endif -// @if feat.jest -import {UpcaseValueConverter} from '../../../src/value-converters/upcase'; -// @endif - -describe('upcase value converter', () => { - let upcase = new UpcaseValueConverter(); - - it('ignores non string input', () => { - expect(upcase.toView(2)).toBe(''); - expect(upcase.toView(null)).toBe(''); - expect(upcase.toView(undefined)).toBe(''); - expect(upcase.toView({})).toBe(''); - expect(upcase.toView(true)).toBe(''); - }); - - it('convert string to upper case', () => { - expect(upcase.toView('aBc')).toBe('ABC'); - expect(upcase.toView(' x y z ')).toBe(' X Y Z '); - }); -}); diff --git a/skeleton/protractor/README.md b/skeleton/protractor/README.md deleted file mode 100644 index c32868af3..000000000 --- a/skeleton/protractor/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Integration (e2e) tests - -You need the app running for integration test. - -First, run `au run` and keep it running. - -Then run `au protractor`. - -To perform a test-run in interactive mode, do `au protractor`. - -To ask the `protractor` to start the application first and then start testing: `au protractor --headless --start` - -The two following flags are useful when using `--start` flag: - * To change dev server port, do `au protractor --start --port 8888`. - * To change dev server host, do `au protractor --start --host 127.0.0.1` - - -**PS:** It is also possible to mix the flags `au protractor --headless --start --port 7070 --host 127.0.0.1` diff --git a/skeleton/protractor/aurelia_project/tasks/protractor.ext b/skeleton/protractor/aurelia_project/tasks/protractor.ext deleted file mode 100644 index bb4c04a2d..000000000 --- a/skeleton/protractor/aurelia_project/tasks/protractor.ext +++ /dev/null @@ -1,49 +0,0 @@ -// @if feat.babel -import gulp from 'gulp'; -// @endif -// @if feat.typescript -import * as gulp from 'gulp'; -// @endif -const {protractor, webdriver_update } = require('gulp-protractor'); - -import { CLIOptions } from 'aurelia-cli'; -// @if feat["cli-bundler"] -import { serve as runAppServer, shutdownAppServer } from './run'; -// @endif -// @if feat.webpack -import { default as runAppServer, shutdownAppServer } from './run'; -// @endif - - -function runApp(cb) { - if (CLIOptions.hasFlag('start')) { - runAppServer(); - } - cb(); -} - -function runProtractor(cb) { - // @if feat.babel - gulp.src('test/e2e/**/*.e2e.js') - // @endif - // @if feat.typescript - gulp.src('test/e2e/**/*.e2e.ts') - // @endif - .pipe(protractor({ configFile: 'protractor.conf.js', args: process.argv.slice(3) })) - .on('end', () => { - shutdownAppServer(); - cb(); - }) - .on('error', err => { - shutdownAppServer(); - cb(err); - }); -} - -// Setting up the test task -export default gulp.series( - runApp, - webdriver_update, - runProtractor -); - diff --git a/skeleton/protractor/aurelia_project/tasks/protractor.json b/skeleton/protractor/aurelia_project/tasks/protractor.json deleted file mode 100644 index bdaef0cb2..000000000 --- a/skeleton/protractor/aurelia_project/tasks/protractor.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "protractor", - "description": "Runs Protractor and reports the results. Start the application before running this task.", - "flags": [ - { - "name": "host", - "description": "Set host address of the dev server, the accessible URL", - "type": "string" - }, - { - "name": "port", - "description": "Set port number of the dev server", - "type": "string" - }, - { - "name": "start", - "description": "Runs the application before starting to perform a testrun", - "type": "boolean" - } - ] -} diff --git a/skeleton/protractor/e2e/tsconfig.json__if_typescript b/skeleton/protractor/e2e/tsconfig.json__if_typescript deleted file mode 100644 index 02ec021f6..000000000 --- a/skeleton/protractor/e2e/tsconfig.json__if_typescript +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "strict": true, - "baseUrl": "../node_modules", - "target": "es5", - "types": [ - "node", - "jasmine" - ] - }, - "include": [ - "**/*.ts" - ] -} diff --git a/skeleton/protractor/package.json b/skeleton/protractor/package.json deleted file mode 100644 index 8e27e18f8..000000000 --- a/skeleton/protractor/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "scripts": { - "e2e": "au protractor", - "e2e:headless": "au protractor --start --headless" - }, - "devDependencies": { - // @if feat.typescript - "ts-node": "", - "@types/jasmine": "", - // @endif - "aurelia-protractor-plugin": "", - "protractor": "", - "gulp-protractor": "", - "wait-on": "", - } -} diff --git a/skeleton/protractor/protractor.conf.js b/skeleton/protractor/protractor.conf.js deleted file mode 100644 index 795c7977e..000000000 --- a/skeleton/protractor/protractor.conf.js +++ /dev/null @@ -1,86 +0,0 @@ -const CLIOptions = require('aurelia-cli').CLIOptions; -const aureliaConfig = require('./aurelia_project/aurelia.json'); -const cliOptions = new CLIOptions(); - -Object.assign(cliOptions, { - args: process.argv.slice(3) -}); - -const port = cliOptions.getFlagValue('port') || aureliaConfig.platform.port; -const host = cliOptions.getFlagValue('host') || aureliaConfig.platform.host || "localhost"; -const headless = cliOptions.hasFlag('headless'); - -const config = { - port: port, - host: host, - baseUrl: `http://${host}:${port}/`, - - specs: [ -// @if feat.babel - 'e2e/**/*.e2e.js' -// @endif -// @if feat.typescript - 'e2e/**/*.e2e.ts' -// @endif - ], - - exclude: [], - - framework: 'jasmine', - - allScriptsTimeout: 110000, - - jasmineNodeOpts: { - showTiming: true, - showColors: true, - isVerbose: true, - includeStackTrace: false, - defaultTimeoutInterval: 400000 - }, - - SELENIUM_PROMISE_MANAGER: false, - - directConnect: true, - - capabilities: { - 'browserName': 'chrome', - 'chromeOptions': { - 'args': [ - '--show-fps-counter', - '--no-default-browser-check', - '--no-first-run', - '--disable-default-apps', - '--disable-popup-blocking', - '--disable-translate', - '--disable-background-timer-throttling', - '--disable-renderer-backgrounding', - '--disable-device-discovery-notifications', - '--no-sandbox', - '--disable-dev-shm-usage', - '--window-size=1024,768' - ] - } - }, - - onPrepare: function() { -// @if feat.babel - process.env.BABEL_TARGET = 'node'; - process.env.IN_PROTRACTOR = 'true'; - require('@babel/register'); -// @endif -// @if feat.typescript - require('ts-node').register({ compilerOptions: { module: 'commonjs' }, disableWarnings: true, fast: true }); -// @endif - }, - - plugins: [{ - package: 'aurelia-protractor-plugin' - }], -}; - -if (headless) { - config.capabilities.chromeOptions.args.push("--no-gpu"); - config.capabilities.chromeOptions.args.push("--headless"); -} - -exports.config = config; diff --git a/skeleton/scaffold-minimum/cypress__if_cypress/integration/app.e2e.ext b/skeleton/scaffold-minimum/cypress__if_cypress/integration/app.e2e.ext deleted file mode 100644 index 818d73f3c..000000000 --- a/skeleton/scaffold-minimum/cypress__if_cypress/integration/app.e2e.ext +++ /dev/null @@ -1,11 +0,0 @@ -/// - -context('Aurelia skeleton app', () => { - beforeEach(() => { - cy.visit('/'); - }); - - it('should display greeting', () => { - cy.get('h1').contains('Hello World!'); - }); -}); diff --git a/skeleton/scaffold-minimum/e2e__if_protractor/demo.e2e.ext b/skeleton/scaffold-minimum/e2e__if_protractor/demo.e2e.ext deleted file mode 100644 index b14997ead..000000000 --- a/skeleton/scaffold-minimum/e2e__if_protractor/demo.e2e.ext +++ /dev/null @@ -1,27 +0,0 @@ -import {PageObjectWelcome} from './welcome.po'; -import {PageObjectSkeleton} from './skeleton.po'; -import {config} from '../protractor.conf'; -// @if feat.typescript -import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor'; -// @endif - -describe('aurelia skeleton app', function() { - let poWelcome/* @if feat.typescript **: PageObjectWelcome/* @endif */; - let poSkeleton/* @if feat.typescript **: PageObjectSkeleton/* @endif */; - - - beforeEach(async () => { - poSkeleton = new PageObjectSkeleton(); - poWelcome = new PageObjectWelcome(); - - await browser.loadAndWaitForAureliaPage(`${config.baseUrl}`); - }); - - it('should load the page and display the initial page title', async () => { - await expect(await poSkeleton.getCurrentPageTitle()).toContain('Aurelia'); - }); - - it('should display greeting', async () => { - await expect(await poWelcome.getGreeting()).toBe('Hello World!'); - }); -}); diff --git a/skeleton/scaffold-minimum/e2e__if_protractor/skeleton.po.ext b/skeleton/scaffold-minimum/e2e__if_protractor/skeleton.po.ext deleted file mode 100644 index ceb309b52..000000000 --- a/skeleton/scaffold-minimum/e2e__if_protractor/skeleton.po.ext +++ /dev/null @@ -1,9 +0,0 @@ -// @if feat.typescript -import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor'; - -// @endif -export class PageObjectSkeleton { - getCurrentPageTitle() { - return browser.getTitle(); - } -} diff --git a/skeleton/scaffold-minimum/e2e__if_protractor/welcome.po.ext b/skeleton/scaffold-minimum/e2e__if_protractor/welcome.po.ext deleted file mode 100644 index 28346bd70..000000000 --- a/skeleton/scaffold-minimum/e2e__if_protractor/welcome.po.ext +++ /dev/null @@ -1,9 +0,0 @@ -// @if feat.typescript -import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor'; - -// @endif -export class PageObjectWelcome { - getGreeting() { - return element(by.tagName('h1')).getText(); - } -} diff --git a/skeleton/scaffold-minimum/src/app.ext b/skeleton/scaffold-minimum/src/app.ext deleted file mode 100644 index c10ace480..000000000 --- a/skeleton/scaffold-minimum/src/app.ext +++ /dev/null @@ -1,8 +0,0 @@ -export class App { - // @if feat.babel - message = 'Hello World!'; - // @endif - // @if feat.typescript - public message = 'Hello World!'; - // @endif -} diff --git a/skeleton/scaffold-minimum/src/app.html b/skeleton/scaffold-minimum/src/app.html deleted file mode 100644 index dfa5fbf14..000000000 --- a/skeleton/scaffold-minimum/src/app.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/skeleton/scaffold-minimum/src/main.ext b/skeleton/scaffold-minimum/src/main.ext deleted file mode 100644 index a07b399de..000000000 --- a/skeleton/scaffold-minimum/src/main.ext +++ /dev/null @@ -1,44 +0,0 @@ -// @if feat.babel -// regenerator-runtime is to support async/await syntax in ESNext. -// If you target latest browsers (have native support), or don't use async/await, you can remove regenerator-runtime. -import 'regenerator-runtime/runtime'; -// @endif -// @if feat.typescript -import {Aurelia} from 'aurelia-framework'; -// @endif -// @if ! feat.webpack -import environment from './environment'; -// @endif -// @if feat.webpack -import * as environment from '../config/environment.json'; -import {PLATFORM} from 'aurelia-pal'; -// @endif - -export function configure(aurelia/* @if feat.typescript **: Aurelia/* @endif */)/* @if feat.typescript **: void/* @endif */ { - aurelia.use - .standardConfiguration() - // @if feat.webpack - .feature(PLATFORM.moduleName('resources/index')); - // @endif - // @if feat['cli-bundler'] - .feature('resources'); - // @endif - - aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn'); - - if (environment.testing) { - // @if feat.webpack - aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing')); - // @endif - // @if feat['cli-bundler'] - aurelia.use.plugin('aurelia-testing'); - // @endif - } - - // @if feat.webpack - aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app'))); - // @endif - // @if feat['cli-bundler'] - aurelia.start().then(() => aurelia.setRoot()); - // @endif -} diff --git a/skeleton/scaffold-minimum/src/resources/index.ext b/skeleton/scaffold-minimum/src/resources/index.ext deleted file mode 100644 index f1f60786f..000000000 --- a/skeleton/scaffold-minimum/src/resources/index.ext +++ /dev/null @@ -1,7 +0,0 @@ -// @if feat.typescript -import {FrameworkConfiguration} from 'aurelia-framework'; - -// @endif -export function configure(config/* @if feat.typescript **: FrameworkConfiguration/* @endif */)/* @if feat.typescript **: void/* @endif */ { - //config.globalResources([]); -} diff --git a/skeleton/scaffold-minimum/test__if_karma_or_jest/unit/app.spec.ext b/skeleton/scaffold-minimum/test__if_karma_or_jest/unit/app.spec.ext deleted file mode 100644 index 5d5ab411a..000000000 --- a/skeleton/scaffold-minimum/test__if_karma_or_jest/unit/app.spec.ext +++ /dev/null @@ -1,33 +0,0 @@ -import {bootstrap} from 'aurelia-bootstrapper'; -import {StageComponent} from 'aurelia-testing'; -// @if feat.webpack -import {PLATFORM} from 'aurelia-pal'; -// @endif - -describe('Stage App Component', () => { - let component; - - beforeEach(() => { - component = StageComponent - // @if feat.webpack - .withResources(PLATFORM.moduleName('app')) - // @endif - // @if feat['cli-bundler'] - .withResources('app') - // @endif - .inView(''); - }); - - afterEach(() => component.dispose()); - - it('should render message', done => { - component.create(bootstrap).then(() => { - const view = component.element; - expect(view.textContent.trim()).toBe('Hello World!'); - done(); - }).catch(e => { - fail(e); - done(); - }); - }); -}); diff --git a/skeleton/scaffold-navigation/aurelia_project__if_cli-bundler/aurelia.json b/skeleton/scaffold-navigation/aurelia_project__if_cli-bundler/aurelia.json deleted file mode 100644 index 980c36d90..000000000 --- a/skeleton/scaffold-navigation/aurelia_project__if_cli-bundler/aurelia.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "build": { - "bundles": [ - { - "name": "vendor-bundle.js", - "prepend": [ - "node_modules/whatwg-fetch/dist/fetch.umd.js" - ] - } - ], - "copyFiles": { - // @if feat.web - "node_modules/@fortawesome/fontawesome-free/webfonts/*": "@fortawesome/fontawesome-free/webfonts", - // @endif - // @if feat['dotnet-core'] - "node_modules/@fortawesome/fontawesome-free/webfonts/*": "wwwroot/@fortawesome/fontawesome-free/webfonts", - // @endif - } - } -} diff --git a/skeleton/scaffold-navigation/cypress__if_cypress/integration/app.e2e.ext b/skeleton/scaffold-navigation/cypress__if_cypress/integration/app.e2e.ext deleted file mode 100644 index 7b4d8b191..000000000 --- a/skeleton/scaffold-navigation/cypress__if_cypress/integration/app.e2e.ext +++ /dev/null @@ -1,13 +0,0 @@ -describe('Aurelia navigation app', () => { - beforeEach(() => { - cy.visit('/'); - }); - - it('should load the page and display the initial page title', () => { - cy.title().should('equal', 'Welcome | Aurelia'); - }); - - it('should display greeting', () => { - cy.get('h2').contains('Welcome to the Aurelia Navigation App!'); - }); -}); diff --git a/skeleton/scaffold-navigation/e2e__if_protractor/demo.e2e.ext b/skeleton/scaffold-navigation/e2e__if_protractor/demo.e2e.ext deleted file mode 100644 index f3fce26df..000000000 --- a/skeleton/scaffold-navigation/e2e__if_protractor/demo.e2e.ext +++ /dev/null @@ -1,48 +0,0 @@ -import {PageObjectWelcome} from './welcome.po'; -import {PageObjectSkeleton} from './skeleton.po'; -import {config} from '../protractor.conf'; -// @if feat.typescript -import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor'; -// @endif - -describe('aurelia skeleton app', function() { - let poWelcome/* @if feat.typescript **: PageObjectWelcome/* @endif */; - let poSkeleton/* @if feat.typescript **: PageObjectSkeleton/* @endif */; - - beforeEach(async () => { - poSkeleton = new PageObjectSkeleton(); - poWelcome = new PageObjectWelcome(); - - await browser.loadAndWaitForAureliaPage(`${config.baseUrl}`); - }); - - it('should load the page and display the initial page title', async () => { - await expect(await poSkeleton.getCurrentPageTitle()).toContain('Aurelia'); - }); - - it('should display greeting', async () => { - await expect(await poWelcome.getGreeting()).toBe('Welcome to the Aurelia Navigation App!'); - }); - - it('should automatically write down the fullname', async () => { - await poWelcome.setFirstname('Jane'); - await poWelcome.setLastname('Doe'); - - // binding is not synchronous, - // therefore we should wait some time until the binding is updated - await browser.wait( - ExpectedConditions.textToBePresentInElement( - poWelcome.getFullnameElement(), 'JANE DOE' - ), 200 - ); - }); - - it('should show alert message when clicking submit button', async () => { - await expect(await poWelcome.openAlertDialog()).toBe(true); - }); - - it('should navigate to users page', async () => { - await poSkeleton.navigateTo('#/users'); - await expect(await poSkeleton.getCurrentPageTitle()).toBe('Github Users | Aurelia'); - }); -}); diff --git a/skeleton/scaffold-navigation/e2e__if_protractor/skeleton.po.ext b/skeleton/scaffold-navigation/e2e__if_protractor/skeleton.po.ext deleted file mode 100644 index 805def298..000000000 --- a/skeleton/scaffold-navigation/e2e__if_protractor/skeleton.po.ext +++ /dev/null @@ -1,16 +0,0 @@ -// @if feat.typescript -import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor'; - -// @endif -export class PageObjectSkeleton { - getCurrentPageTitle() { - return browser.getTitle(); - } - - async navigateTo(href) { - const navigatingReady = browser.waitForRouterComplete(); - await element(by.css('a[href="' + href + '"]')).click(); - await navigatingReady; - await browser.sleep(200); - } -} diff --git a/skeleton/scaffold-navigation/e2e__if_protractor/welcome.po.ext b/skeleton/scaffold-navigation/e2e__if_protractor/welcome.po.ext deleted file mode 100644 index fb76b7a1c..000000000 --- a/skeleton/scaffold-navigation/e2e__if_protractor/welcome.po.ext +++ /dev/null @@ -1,54 +0,0 @@ -// @if feat.typescript -import {browser, element, by, By, $, $$, ExpectedConditions} from 'aurelia-protractor-plugin/protractor'; - -// @endif -export class PageObjectWelcome { - getGreeting() { - return element(by.tagName('h2')).getText(); - } - - setFirstname(value) { - // @if feat.babel - return element(by.valueBind('firstName')).clear().sendKeys(value); - // @endif - // @if feat.typescript - let firstName = element(by.valueBind('firstName')); - return firstName.clear().then(() => firstName.sendKeys(value)); - // @endif - } - - setLastname(value) { - // @if feat.babel - return element(by.valueBind('lastName')).clear().sendKeys(value); - // @endif - // @if feat.typescript - let lastName = element(by.valueBind('lastName')); - return lastName.clear().then(() => lastName.sendKeys(value)); - // @endif - } - - getFullnameElement() { - return element(by.css('.help-block')); - } - - getFullname() { - return this.getFullnameElement().getText(); - } - - pressSubmitButton() { - return element(by.css('button[type="submit"]')).click(); - } - - async openAlertDialog() { - await this.pressSubmitButton(); - - await browser.wait(ExpectedConditions.alertIsPresent(), 5000); - - try { - await browser.switchTo().alert().accept(); - return true; - } catch (e) { - return false; - } - } -} diff --git a/skeleton/scaffold-navigation/package.json b/skeleton/scaffold-navigation/package.json deleted file mode 100644 index 4f853a23d..000000000 --- a/skeleton/scaffold-navigation/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "dependencies": { - "whatwg-fetch": "^3.0.0", - "aurelia-fetch-client": "^1.0.0", - "bootstrap": "^4.4.1", - "popper.js": "^1.16.1", - "@fortawesome/fontawesome-free": "^5.12.1", - "jquery": "^3.3.1" - } -} \ No newline at end of file diff --git a/skeleton/scaffold-navigation/src/app.ext b/skeleton/scaffold-navigation/src/app.ext deleted file mode 100644 index 2ce6927d3..000000000 --- a/skeleton/scaffold-navigation/src/app.ext +++ /dev/null @@ -1,59 +0,0 @@ -// @if feat.webpack -import {PLATFORM} from 'aurelia-pal'; -// @endif -// @if feat.typescript -import {Router, RouterConfiguration} from 'aurelia-router'; -// @endif - -export class App { - // @if feat.babel - configureRouter(config, router) { - // @endif - // @if feat.typescript - public router: Router; - - public configureRouter(config: RouterConfiguration, router: Router): Promise | PromiseLike | void { - // @endif - config.title = 'Aurelia'; - config.map([ - { - route: ['', 'welcome'], - name: 'welcome', - // @if feat.webpack - moduleId: PLATFORM.moduleName('./welcome'), - // @endif - // @if feat['cli-bundler'] - moduleId: './welcome', - // @endif - nav: true, - title: 'Welcome' - }, - { - route: 'users', - name: 'users', - // @if feat.webpack - moduleId: PLATFORM.moduleName('./users'), - // @endif - // @if feat['cli-bundler'] - moduleId: './users', - // @endif - nav: true, - title: 'Github Users' - }, - { - route: 'child-router', - name: 'child-router', - // @if feat.webpack - moduleId: PLATFORM.moduleName('./child-router'), - // @endif - // @if feat['cli-bundler'] - moduleId: './child-router', - // @endif - nav: true, - title: 'Child Router' - } - ]); - - this.router = router; - } -} diff --git a/skeleton/scaffold-navigation/src/app.html b/skeleton/scaffold-navigation/src/app.html deleted file mode 100644 index 20aae306f..000000000 --- a/skeleton/scaffold-navigation/src/app.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/skeleton/scaffold-navigation/src/blur-image.ext b/skeleton/scaffold-navigation/src/blur-image.ext deleted file mode 100644 index 349920839..000000000 --- a/skeleton/scaffold-navigation/src/blur-image.ext +++ /dev/null @@ -1,379 +0,0 @@ -/* eslint-disable */ -// @if feat.babel -import {inject} from 'aurelia-framework'; - -@inject(Element) -export class BlurImageCustomAttribute { - constructor(element) { - this.element = element; - } - - valueChanged(newImage) { -// @endif -// @if feat.typescript -import {autoinject} from 'aurelia-framework'; - -@autoinject -export class BlurImageCustomAttribute { - constructor(private element: Element) { - } - - public valueChanged(newImage: HTMLImageElement): void { -// @endif - if (newImage.complete) { - drawBlur(this.element, newImage); - } else { - newImage.onload = () => drawBlur(this.element, newImage); - } - } -} - -/* -This Snippet is using a modified Stack Blur js lib for blurring the header images. -*/ - -/* - -StackBlur - a fast almost Gaussian Blur For Canvas - -Version: 0.5 -Author: Mario Klingemann -Contact: mario@quasimondo.com -Website: http://www.quasimondo.com/StackBlurForCanvas -Twitter: @quasimondo - -In case you find this class useful - especially in commercial projects - -I am not totally unhappy for a small donation to my PayPal account -mario@quasimondo.de - -Or support me on flattr: -https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript - -Copyright (c) 2010 Mario Klingemann - -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. -*/ - -var mul_table = [ - 512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512, - 454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512, - 482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456, - 437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512, - 497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328, - 320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456, - 446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335, - 329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512, - 505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405, - 399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328, - 324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271, - 268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456, - 451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388, - 385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335, - 332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292, - 289,287,285,282,280,278,275,273,271,269,267,265,263,261,259]; - - -var shg_table = [ - 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, - 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 ]; - -var BLUR_RADIUS = 40; - -function stackBlurCanvasRGBA( canvas, top_x, top_y, width, height, radius ) -{ - if ( isNaN(radius) || radius < 1 ) return; - radius |= 0; - - var context = canvas.getContext("2d"); - var imageData; - - try { - imageData = context.getImageData( top_x, top_y, width, height ); - } catch(e) { - throw new Error("unable to access image data: " + e); - } - - var pixels = imageData.data; - - var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, - r_out_sum, g_out_sum, b_out_sum, a_out_sum, - r_in_sum, g_in_sum, b_in_sum, a_in_sum, - pr, pg, pb, pa, rbs; - - var div = radius + radius + 1; - var w4 = width << 2; - var widthMinus1 = width - 1; - var heightMinus1 = height - 1; - var radiusPlus1 = radius + 1; - var sumFactor = radiusPlus1 * ( radiusPlus1 + 1 ) / 2; - - var stackStart = new BlurStack(); - var stack = stackStart; - for ( i = 1; i < div; i++ ) - { - stack = stack.next = new BlurStack(); - if ( i == radiusPlus1 ) var stackEnd = stack; - } - stack.next = stackStart; - var stackIn = null; - var stackOut = null; - - yw = yi = 0; - - var mul_sum = mul_table[radius]; - var shg_sum = shg_table[radius]; - - for ( y = 0; y < height; y++ ) - { - r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0; - - r_out_sum = radiusPlus1 * ( pr = pixels[yi] ); - g_out_sum = radiusPlus1 * ( pg = pixels[yi+1] ); - b_out_sum = radiusPlus1 * ( pb = pixels[yi+2] ); - a_out_sum = radiusPlus1 * ( pa = pixels[yi+3] ); - - r_sum += sumFactor * pr; - g_sum += sumFactor * pg; - b_sum += sumFactor * pb; - a_sum += sumFactor * pa; - - stack = stackStart; - - for( i = 0; i < radiusPlus1; i++ ) - { - stack.r = pr; - stack.g = pg; - stack.b = pb; - stack.a = pa; - stack = stack.next; - } - - for( i = 1; i < radiusPlus1; i++ ) - { - p = yi + (( widthMinus1 < i ? widthMinus1 : i ) << 2 ); - r_sum += ( stack.r = ( pr = pixels[p])) * ( rbs = radiusPlus1 - i ); - g_sum += ( stack.g = ( pg = pixels[p+1])) * rbs; - b_sum += ( stack.b = ( pb = pixels[p+2])) * rbs; - a_sum += ( stack.a = ( pa = pixels[p+3])) * rbs; - - r_in_sum += pr; - g_in_sum += pg; - b_in_sum += pb; - a_in_sum += pa; - - stack = stack.next; - } - - - stackIn = stackStart; - stackOut = stackEnd; - for ( x = 0; x < width; x++ ) - { - pixels[yi+3] = pa = (a_sum * mul_sum) >> shg_sum; - if ( pa != 0 ) - { - pa = 255 / pa; - pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa; - pixels[yi+1] = ((g_sum * mul_sum) >> shg_sum) * pa; - pixels[yi+2] = ((b_sum * mul_sum) >> shg_sum) * pa; - } else { - pixels[yi] = pixels[yi+1] = pixels[yi+2] = 0; - } - - r_sum -= r_out_sum; - g_sum -= g_out_sum; - b_sum -= b_out_sum; - a_sum -= a_out_sum; - - r_out_sum -= stackIn.r; - g_out_sum -= stackIn.g; - b_out_sum -= stackIn.b; - a_out_sum -= stackIn.a; - - p = ( yw + ( ( p = x + radius + 1 ) < widthMinus1 ? p : widthMinus1 ) ) << 2; - - r_in_sum += ( stackIn.r = pixels[p]); - g_in_sum += ( stackIn.g = pixels[p+1]); - b_in_sum += ( stackIn.b = pixels[p+2]); - a_in_sum += ( stackIn.a = pixels[p+3]); - - r_sum += r_in_sum; - g_sum += g_in_sum; - b_sum += b_in_sum; - a_sum += a_in_sum; - - stackIn = stackIn.next; - - r_out_sum += ( pr = stackOut.r ); - g_out_sum += ( pg = stackOut.g ); - b_out_sum += ( pb = stackOut.b ); - a_out_sum += ( pa = stackOut.a ); - - r_in_sum -= pr; - g_in_sum -= pg; - b_in_sum -= pb; - a_in_sum -= pa; - - stackOut = stackOut.next; - - yi += 4; - } - yw += width; - } - - - for ( x = 0; x < width; x++ ) - { - g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0; - - yi = x << 2; - r_out_sum = radiusPlus1 * ( pr = pixels[yi]); - g_out_sum = radiusPlus1 * ( pg = pixels[yi+1]); - b_out_sum = radiusPlus1 * ( pb = pixels[yi+2]); - a_out_sum = radiusPlus1 * ( pa = pixels[yi+3]); - - r_sum += sumFactor * pr; - g_sum += sumFactor * pg; - b_sum += sumFactor * pb; - a_sum += sumFactor * pa; - - stack = stackStart; - - for( i = 0; i < radiusPlus1; i++ ) - { - stack.r = pr; - stack.g = pg; - stack.b = pb; - stack.a = pa; - stack = stack.next; - } - - yp = width; - - for( i = 1; i <= radius; i++ ) - { - yi = ( yp + x ) << 2; - - r_sum += ( stack.r = ( pr = pixels[yi])) * ( rbs = radiusPlus1 - i ); - g_sum += ( stack.g = ( pg = pixels[yi+1])) * rbs; - b_sum += ( stack.b = ( pb = pixels[yi+2])) * rbs; - a_sum += ( stack.a = ( pa = pixels[yi+3])) * rbs; - - r_in_sum += pr; - g_in_sum += pg; - b_in_sum += pb; - a_in_sum += pa; - - stack = stack.next; - - if( i < heightMinus1 ) - { - yp += width; - } - } - - yi = x; - stackIn = stackStart; - stackOut = stackEnd; - for ( y = 0; y < height; y++ ) - { - p = yi << 2; - pixels[p+3] = pa = (a_sum * mul_sum) >> shg_sum; - if ( pa > 0 ) - { - pa = 255 / pa; - pixels[p] = ((r_sum * mul_sum) >> shg_sum ) * pa; - pixels[p+1] = ((g_sum * mul_sum) >> shg_sum ) * pa; - pixels[p+2] = ((b_sum * mul_sum) >> shg_sum ) * pa; - } else { - pixels[p] = pixels[p+1] = pixels[p+2] = 0; - } - - r_sum -= r_out_sum; - g_sum -= g_out_sum; - b_sum -= b_out_sum; - a_sum -= a_out_sum; - - r_out_sum -= stackIn.r; - g_out_sum -= stackIn.g; - b_out_sum -= stackIn.b; - a_out_sum -= stackIn.a; - - p = ( x + (( ( p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1 ) * width )) << 2; - - r_sum += ( r_in_sum += ( stackIn.r = pixels[p])); - g_sum += ( g_in_sum += ( stackIn.g = pixels[p+1])); - b_sum += ( b_in_sum += ( stackIn.b = pixels[p+2])); - a_sum += ( a_in_sum += ( stackIn.a = pixels[p+3])); - - stackIn = stackIn.next; - - r_out_sum += ( pr = stackOut.r ); - g_out_sum += ( pg = stackOut.g ); - b_out_sum += ( pb = stackOut.b ); - a_out_sum += ( pa = stackOut.a ); - - r_in_sum -= pr; - g_in_sum -= pg; - b_in_sum -= pb; - a_in_sum -= pa; - - stackOut = stackOut.next; - - yi += width; - } - } - - context.putImageData( imageData, top_x, top_y ); - -} - -function BlurStack() -{ - this.r = 0; - this.g = 0; - this.b = 0; - this.a = 0; - this.next = null; -} - -function drawBlur(canvas, image) { - var w = canvas.width; - var h = canvas.height; - var canvasContext = canvas.getContext('2d'); - canvasContext.drawImage(image, 0, 0, w, h); - stackBlurCanvasRGBA(canvas, 0, 0, w, h, BLUR_RADIUS); -} diff --git a/skeleton/scaffold-navigation/src/child-router.ext b/skeleton/scaffold-navigation/src/child-router.ext deleted file mode 100644 index 18cb74e38..000000000 --- a/skeleton/scaffold-navigation/src/child-router.ext +++ /dev/null @@ -1,61 +0,0 @@ -// @if feat.webpack -import {PLATFORM} from 'aurelia-pal'; -// @endif -// @if feat.typescript -import {Router, RouterConfiguration} from 'aurelia-router'; -// @endif - -export class ChildRouter { - // @if feat.babel - heading = 'Child Router'; - - configureRouter(config, router) { - // @endif - // @if feat.typescript - public heading = 'Child Router'; - public router: Router; - - public configureRouter(config: RouterConfiguration, router: Router): Promise | PromiseLike | void { - // @endif - config.map([ - { - route: ['', 'welcome'], - name: 'welcome', - // @if feat.webpack - moduleId: PLATFORM.moduleName('./welcome'), - // @endif - // @if feat['cli-bundler'] - moduleId: './welcome', - // @endif - nav: true, - title: 'Welcome' - }, - { - route: 'users', - name: 'users', - // @if feat.webpack - moduleId: PLATFORM.moduleName('./users'), - // @endif - // @if feat['cli-bundler'] - moduleId: './users', - // @endif - nav: true, - title: 'Github Users' - }, - { - route: 'child-router', - name: 'child-router', - // @if feat.webpack - moduleId: PLATFORM.moduleName('./child-router'), - // @endif - // @if feat['cli-bundler'] - moduleId: './child-router', - // @endif - nav: true, - title: 'Child Router' - } - ]); - - this.router = router; - } -} diff --git a/skeleton/scaffold-navigation/src/child-router.html b/skeleton/scaffold-navigation/src/child-router.html deleted file mode 100644 index 8548b23c5..000000000 --- a/skeleton/scaffold-navigation/src/child-router.html +++ /dev/null @@ -1,22 +0,0 @@ - diff --git a/skeleton/scaffold-navigation/src/main.ext b/skeleton/scaffold-navigation/src/main.ext deleted file mode 100644 index acbebb278..000000000 --- a/skeleton/scaffold-navigation/src/main.ext +++ /dev/null @@ -1,62 +0,0 @@ -// @if feat.babel -// regenerator-runtime is to support async/await syntax in ESNext. -// If you target latest browsers (have native support), or don't use async/await, you can remove regenerator-runtime. -import 'regenerator-runtime/runtime'; -// @endif -import 'bootstrap'; -// @if feat.typescript -import {Aurelia} from 'aurelia-framework'; -// @endif -// @if ! feat.webpack -import environment from './environment'; -// @endif -// @if feat.webpack -import * as environment from '../config/environment.json'; -import {PLATFORM} from 'aurelia-pal'; -// @endif - -export function configure(aurelia/* @if feat.typescript **: Aurelia/* @endif */)/* @if feat.typescript **: void/* @endif */ { - aurelia.use - .standardConfiguration() - // @if feat.webpack - .feature(PLATFORM.moduleName('resources/index')); - // @endif - // @if feat['cli-bundler'] - .feature('resources'); - // @endif - - aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn'); - - if (environment.testing) { - // @if feat.webpack - aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing')); - // @endif - // @if feat['cli-bundler'] - aurelia.use.plugin('aurelia-testing'); - // @endif - } - - //Uncomment the line below to enable animation. - // @if feat.webpack - // aurelia.use.plugin(PLATFORM.moduleName('aurelia-animator-css')); - // @endif - // @if feat['cli-bundler'] - // aurelia.use.plugin('aurelia-animator-css'); - // @endif - //if the css animator is enabled, add swap-order="after" to all router-view elements - - //Anyone wanting to use HTMLImports to load views, will need to install the following plugin. - // @if feat.webpack - // aurelia.use.plugin(PLATFORM.moduleName('aurelia-html-import-template-loader')); - // @endif - // @if feat['cli-bundler'] - // aurelia.use.plugin('aurelia-html-import-template-loader'); - // @endif - - // @if feat.webpack - aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app'))); - // @endif - // @if feat['cli-bundler'] - aurelia.start().then(() => aurelia.setRoot()); - // @endif -} diff --git a/skeleton/scaffold-navigation/src/nav-bar.html b/skeleton/scaffold-navigation/src/nav-bar.html deleted file mode 100644 index 9b58ac26b..000000000 --- a/skeleton/scaffold-navigation/src/nav-bar.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/skeleton/scaffold-navigation/src/resources/index.ext b/skeleton/scaffold-navigation/src/resources/index.ext deleted file mode 100644 index f1f60786f..000000000 --- a/skeleton/scaffold-navigation/src/resources/index.ext +++ /dev/null @@ -1,7 +0,0 @@ -// @if feat.typescript -import {FrameworkConfiguration} from 'aurelia-framework'; - -// @endif -export function configure(config/* @if feat.typescript **: FrameworkConfiguration/* @endif */)/* @if feat.typescript **: void/* @endif */ { - //config.globalResources([]); -} diff --git a/skeleton/scaffold-navigation/src/styles.css__if_not_less_and_not_sass_and_not_stylus b/skeleton/scaffold-navigation/src/styles.css__if_not_less_and_not_sass_and_not_stylus deleted file mode 100644 index 41eb5c66b..000000000 --- a/skeleton/scaffold-navigation/src/styles.css__if_not_less_and_not_sass_and_not_stylus +++ /dev/null @@ -1,154 +0,0 @@ -body { - margin: 0; -} - -.page-host { - position: absolute; - left: 0; - right: 0; - top: 56px; - bottom: 0; - overflow-x: hidden; - overflow-y: auto; -} - -@media print { - .page-host { - position: absolute; - left: 10px; - right: 0; - top: 56px; - bottom: 0; - overflow-y: inherit; - overflow-x: inherit; - } -} - -section { - margin: 1rem; -} - -.navbar-nav li.loader { - margin: 12px 24px 0 6px; -} - -.pictureDetail { - max-width: 425px; -} - -/* animate page transitions */ -section.au-enter-active { - -webkit-animation: fadeInRight 1s; - animation: fadeInRight 1s; -} - -div.au-stagger { - /* 50ms will be applied between each successive enter operation */ - -webkit-animation-delay: 50ms; - animation-delay: 50ms; -} - -.user-card-container.au-enter { - opacity: 0; -} - -.user-card-container.au-enter-active { - -webkit-animation: fadeIn 2s; - animation: fadeIn 2s; -} - -.user-card { - overflow: hidden; - position: relative; - border: 1px solid #CCC; - border-radius: 8px; - text-align: center; - padding: 0; - background-color: #337ab7; - color: rgb(136, 172, 217); - margin-bottom: 32px; - box-shadow: 0 0 5px rgba(0, 0, 0, .5); -} - -.user-card .content { - margin-top: 10px; -} - -.user-card .content .name { - color: white; - text-shadow: 0 0 6px rgba(0, 0, 0, .5); - font-size: 18px; -} - -.user-card .header-bg { - /* This stretches the canvas across the entire hero unit */ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 70px; - border-bottom: 1px #FFF solid; - border-radius: 6px 6px 0 0; -} - -.user-card .avatar { - position: relative; - margin-top: 15px; - z-index: 100; -} - -.user-card .avatar img { - width: 100px; - height: 100px; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; - border: 2px #FFF solid; -} - -/* animation definitions */ -@-webkit-keyframes fadeInRight { - 0% { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) - } - 100% { - opacity: 1; - -webkit-transform: none; - transform: none - } -} - -@keyframes fadeInRight { - 0% { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) - } - 100% { - opacity: 1; - -webkit-transform: none; - -ms-transform: none; - transform: none - } -} - -@-webkit-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -@keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} diff --git a/skeleton/scaffold-navigation/src/styles.less__if_less b/skeleton/scaffold-navigation/src/styles.less__if_less deleted file mode 100644 index 41eb5c66b..000000000 --- a/skeleton/scaffold-navigation/src/styles.less__if_less +++ /dev/null @@ -1,154 +0,0 @@ -body { - margin: 0; -} - -.page-host { - position: absolute; - left: 0; - right: 0; - top: 56px; - bottom: 0; - overflow-x: hidden; - overflow-y: auto; -} - -@media print { - .page-host { - position: absolute; - left: 10px; - right: 0; - top: 56px; - bottom: 0; - overflow-y: inherit; - overflow-x: inherit; - } -} - -section { - margin: 1rem; -} - -.navbar-nav li.loader { - margin: 12px 24px 0 6px; -} - -.pictureDetail { - max-width: 425px; -} - -/* animate page transitions */ -section.au-enter-active { - -webkit-animation: fadeInRight 1s; - animation: fadeInRight 1s; -} - -div.au-stagger { - /* 50ms will be applied between each successive enter operation */ - -webkit-animation-delay: 50ms; - animation-delay: 50ms; -} - -.user-card-container.au-enter { - opacity: 0; -} - -.user-card-container.au-enter-active { - -webkit-animation: fadeIn 2s; - animation: fadeIn 2s; -} - -.user-card { - overflow: hidden; - position: relative; - border: 1px solid #CCC; - border-radius: 8px; - text-align: center; - padding: 0; - background-color: #337ab7; - color: rgb(136, 172, 217); - margin-bottom: 32px; - box-shadow: 0 0 5px rgba(0, 0, 0, .5); -} - -.user-card .content { - margin-top: 10px; -} - -.user-card .content .name { - color: white; - text-shadow: 0 0 6px rgba(0, 0, 0, .5); - font-size: 18px; -} - -.user-card .header-bg { - /* This stretches the canvas across the entire hero unit */ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 70px; - border-bottom: 1px #FFF solid; - border-radius: 6px 6px 0 0; -} - -.user-card .avatar { - position: relative; - margin-top: 15px; - z-index: 100; -} - -.user-card .avatar img { - width: 100px; - height: 100px; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; - border: 2px #FFF solid; -} - -/* animation definitions */ -@-webkit-keyframes fadeInRight { - 0% { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) - } - 100% { - opacity: 1; - -webkit-transform: none; - transform: none - } -} - -@keyframes fadeInRight { - 0% { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) - } - 100% { - opacity: 1; - -webkit-transform: none; - -ms-transform: none; - transform: none - } -} - -@-webkit-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -@keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} diff --git a/skeleton/scaffold-navigation/src/styles.scss__if_sass b/skeleton/scaffold-navigation/src/styles.scss__if_sass deleted file mode 100644 index 41eb5c66b..000000000 --- a/skeleton/scaffold-navigation/src/styles.scss__if_sass +++ /dev/null @@ -1,154 +0,0 @@ -body { - margin: 0; -} - -.page-host { - position: absolute; - left: 0; - right: 0; - top: 56px; - bottom: 0; - overflow-x: hidden; - overflow-y: auto; -} - -@media print { - .page-host { - position: absolute; - left: 10px; - right: 0; - top: 56px; - bottom: 0; - overflow-y: inherit; - overflow-x: inherit; - } -} - -section { - margin: 1rem; -} - -.navbar-nav li.loader { - margin: 12px 24px 0 6px; -} - -.pictureDetail { - max-width: 425px; -} - -/* animate page transitions */ -section.au-enter-active { - -webkit-animation: fadeInRight 1s; - animation: fadeInRight 1s; -} - -div.au-stagger { - /* 50ms will be applied between each successive enter operation */ - -webkit-animation-delay: 50ms; - animation-delay: 50ms; -} - -.user-card-container.au-enter { - opacity: 0; -} - -.user-card-container.au-enter-active { - -webkit-animation: fadeIn 2s; - animation: fadeIn 2s; -} - -.user-card { - overflow: hidden; - position: relative; - border: 1px solid #CCC; - border-radius: 8px; - text-align: center; - padding: 0; - background-color: #337ab7; - color: rgb(136, 172, 217); - margin-bottom: 32px; - box-shadow: 0 0 5px rgba(0, 0, 0, .5); -} - -.user-card .content { - margin-top: 10px; -} - -.user-card .content .name { - color: white; - text-shadow: 0 0 6px rgba(0, 0, 0, .5); - font-size: 18px; -} - -.user-card .header-bg { - /* This stretches the canvas across the entire hero unit */ - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 70px; - border-bottom: 1px #FFF solid; - border-radius: 6px 6px 0 0; -} - -.user-card .avatar { - position: relative; - margin-top: 15px; - z-index: 100; -} - -.user-card .avatar img { - width: 100px; - height: 100px; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; - border: 2px #FFF solid; -} - -/* animation definitions */ -@-webkit-keyframes fadeInRight { - 0% { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) - } - 100% { - opacity: 1; - -webkit-transform: none; - transform: none - } -} - -@keyframes fadeInRight { - 0% { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) - } - 100% { - opacity: 1; - -webkit-transform: none; - -ms-transform: none; - transform: none - } -} - -@-webkit-keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -@keyframes fadeIn { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} diff --git a/skeleton/scaffold-navigation/src/styles.styl__if_stylus b/skeleton/scaffold-navigation/src/styles.styl__if_stylus deleted file mode 100644 index 66dc228fb..000000000 --- a/skeleton/scaffold-navigation/src/styles.styl__if_stylus +++ /dev/null @@ -1,129 +0,0 @@ -body - margin: 0 - -.page-host - position: absolute - left: 0 - right: 0 - top: 56px - bottom: 0 - overflow-x: hidden - overflow-y: auto - -@media print - .page-host - position: absolute - left: 10px - right: 0 - top: 56px - bottom: 0 - overflow-y: inherit - overflow-x: inherit - -section - margin: 1rem - -.navbar-nav li.loader - margin: 12px 24px 0 6px - -.pictureDetail - max-width: 425px - -/* animate page transitions */ -section.au-enter-active - -webkit-animation: fadeInRight 1s - animation: fadeInRight 1s - -div.au-stagger - /* 50ms will be applied between each successive enter operation */ - -webkit-animation-delay: 50ms - animation-delay: 50ms - -.user-card-container.au-enter - opacity: 0 - -.user-card-container.au-enter-active - -webkit-animation: fadeIn 2s - animation: fadeIn 2s - -.user-card - overflow: hidden - position: relative - border: 1px solid #CCC - border-radius: 8px - text-align: center - padding: 0 - background-color: #337ab7 - color: rgb(136, 172, 217) - margin-bottom: 32px - box-shadow: 0 0 5px rgba(0, 0, 0, .5) - -.user-card .content - margin-top: 10px - -.user-card .content .name - color: white - text-shadow: 0 0 6px rgba(0, 0, 0, .5) - font-size: 18px - -.user-card .header-bg - /* This stretches the canvas across the entire hero unit */ - position: absolute - top: 0 - left: 0 - width: 100% - height: 70px - border-bottom: 1px #FFF solid - border-radius: 6px 6px 0 0 - -.user-card .avatar - position: relative - margin-top: 15px - z-index: 100 - -.user-card .avatar img - width: 100px - height: 100px - -webkit-border-radius: 50% - -moz-border-radius: 50% - border-radius: 50% - border: 2px #FFF solid - -/* animation definitions */ -@-webkit-keyframes fadeInRight - 0% - opacity: 0 - -webkit-transform: translate3d(100%, 0, 0) - transform: translate3d(100%, 0, 0) - - 100% - opacity: 1 - -webkit-transform: none - transform: none - -@keyframes fadeInRight - 0% - opacity: 0 - -webkit-transform: translate3d(100%, 0, 0) - -ms-transform: translate3d(100%, 0, 0) - transform: translate3d(100%, 0, 0) - - 100% - opacity: 1 - -webkit-transform: none - -ms-transform: none - transform: none - -@-webkit-keyframes fadeIn - 0% - opacity: 0 - - 100% - opacity: 1 - -@keyframes fadeIn - 0% - opacity: 0 - - 100% - opacity: 1 diff --git a/skeleton/scaffold-navigation/src/users.html b/skeleton/scaffold-navigation/src/users.html deleted file mode 100644 index 40e987a60..000000000 --- a/skeleton/scaffold-navigation/src/users.html +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/skeleton/scaffold-navigation/src/welcome.html b/skeleton/scaffold-navigation/src/welcome.html deleted file mode 100644 index 92205f277..000000000 --- a/skeleton/scaffold-navigation/src/welcome.html +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/skeleton/scaffold-navigation/src__if_babel/users.js b/skeleton/scaffold-navigation/src__if_babel/users.js deleted file mode 100644 index a1b12e3dd..000000000 --- a/skeleton/scaffold-navigation/src__if_babel/users.js +++ /dev/null @@ -1,24 +0,0 @@ -import {inject} from 'aurelia-framework'; -import {HttpClient} from 'aurelia-fetch-client'; - -@inject(HttpClient) -export class Users { - heading = 'Github Users'; - users = []; - - constructor(http) { - http.configure(config => { - config - .useStandardConfiguration() - .withBaseUrl('https://api.github.com/'); - }); - - this.http = http; - } - - activate() { - return this.http.fetch('users') - .then(response => response.json()) - .then(users => this.users = users); - } -} diff --git a/skeleton/scaffold-navigation/src__if_babel/welcome.js b/skeleton/scaffold-navigation/src__if_babel/welcome.js deleted file mode 100644 index 63bbbef5e..000000000 --- a/skeleton/scaffold-navigation/src__if_babel/welcome.js +++ /dev/null @@ -1,34 +0,0 @@ -import {computedFrom} from 'aurelia-framework'; - -export class Welcome { - heading = 'Welcome to the Aurelia Navigation App!'; - firstName = 'John'; - lastName = 'Doe'; - previousValue = this.fullName; - - //Getters can't be directly observed, so they must be dirty checked. - //However, if you tell Aurelia the dependencies, it no longer needs to dirty check the property. - @computedFrom('firstName', 'lastName') - get fullName() { - return `${this.firstName} ${this.lastName}`; - } - - submit() { - this.previousValue = this.fullName; - // eslint-disable-next-line no-alert - alert(`Welcome, ${this.fullName}!`); - } - - canDeactivate() { - if (this.fullName !== this.previousValue) { - // eslint-disable-next-line no-alert - return confirm('Are you sure you want to leave?'); - } - } -} - -export class UpperValueConverter { - toView(value) { - return value && value.toUpperCase(); - } -} diff --git a/skeleton/scaffold-navigation/src__if_typescript/users.ts b/skeleton/scaffold-navigation/src__if_typescript/users.ts deleted file mode 100644 index c002b42d8..000000000 --- a/skeleton/scaffold-navigation/src__if_typescript/users.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {autoinject} from 'aurelia-framework'; -import {HttpClient} from 'aurelia-fetch-client'; - -@autoinject -export class Users { - public heading = 'Github Users'; - public users: any[] = []; - - constructor(private http: HttpClient) { - http.configure(config => { - config - .useStandardConfiguration() - .withBaseUrl('https://api.github.com/'); - }); - } - - async activate(): Promise { - const response = await this.http.fetch('users'); - this.users = await response.json(); - } -} diff --git a/skeleton/scaffold-navigation/src__if_typescript/welcome.ts b/skeleton/scaffold-navigation/src__if_typescript/welcome.ts deleted file mode 100644 index 7f9243332..000000000 --- a/skeleton/scaffold-navigation/src__if_typescript/welcome.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {computedFrom} from 'aurelia-framework'; - -export class Welcome { - public heading = 'Welcome to the Aurelia Navigation App!'; - public firstName = 'John'; - public lastName = 'Doe'; - private previousValue: string = this.fullName; - - // Getters can't be directly observed, so they must be dirty checked. - // However, if you tell Aurelia the dependencies, it no longer needs to dirty check the property. - @computedFrom('firstName', 'lastName') - get fullName(): string { - return `${this.firstName} ${this.lastName}`; - } - - public submit() { - this.previousValue = this.fullName; - alert(`Welcome, ${this.fullName}!`); - } - - public canDeactivate(): boolean | undefined { - if (this.fullName !== this.previousValue) { - return confirm('Are you sure you want to leave?'); - } - } -} - -export class UpperValueConverter { - public toView(value: string): string { - return value && value.toUpperCase(); - } -} diff --git a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/.eslintrc__if_babel b/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/.eslintrc__if_babel deleted file mode 100644 index 92629674b..000000000 --- a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/.eslintrc__if_babel +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "no-var": 0 - } -} diff --git a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/app.spec.ext b/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/app.spec.ext deleted file mode 100644 index 64c21d780..000000000 --- a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/app.spec.ext +++ /dev/null @@ -1,67 +0,0 @@ -import {App} from '../../src/app'; - -class RouterStub { - // @if feat.typescript - routes; - - // @endif - configure(handler) { - handler(this); - } - - map(routes) { - this.routes = routes; - } -} - -describe('the App module', () => { - var sut; - var mockedRouter; - - beforeEach(() => { - mockedRouter = new RouterStub(); - sut = new App(); - sut.configureRouter(mockedRouter, mockedRouter); - }); - - it('contains a router property', () => { - expect(sut.router).toBeDefined(); - }); - - it('configures the router title', () => { - expect(sut.router.title).toEqual('Aurelia'); - }); - - it('should have a welcome route', () => { - // @if feat.karma - expect(sut.router.routes).toContain({ - // @endif - // @if feat.jest - expect(sut.router.routes).toContainEqual({ - // @endif - route: ['', 'welcome'], name: 'welcome', moduleId: './welcome', nav: true, title: 'Welcome' - }); - }); - - it('should have a users route', () => { - // @if feat.karma - expect(sut.router.routes).toContain({ - // @endif - // @if feat.jest - expect(sut.router.routes).toContainEqual({ - // @endif - route: 'users', name: 'users', moduleId: './users', nav: true, title: 'Github Users' - }); - }); - - it('should have a child router route', () => { - // @if feat.karma - expect(sut.router.routes).toContain({ - // @endif - // @if feat.jest - expect(sut.router.routes).toContainEqual({ - // @endif - route: 'child-router', name: 'child-router', moduleId: './child-router', nav: true, title: 'Child Router' - }); - }); -}); diff --git a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/child-router.spec.ext b/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/child-router.spec.ext deleted file mode 100644 index 33147aef4..000000000 --- a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit/child-router.spec.ext +++ /dev/null @@ -1,52 +0,0 @@ -import {ChildRouter} from '../../src/child-router'; - -class RouterStub { - // @if feat.typescript - routes; - - // @endif - configure(handler) { - handler(this); - } - - map(routes) { - this.routes = routes; - } -} - -describe('the Child Router module', () => { - var sut; - var mockedRouter; - - beforeEach(() => { - mockedRouter = new RouterStub(); - sut = new ChildRouter(); - sut.configureRouter(mockedRouter, mockedRouter); - }); - - it('contains a router property', () => { - expect(sut.router).toBeDefined(); - }); - - it('configures the heading', () => { - expect(sut.heading).toEqual('Child Router'); - }); - - it('should have a welcome route', () => { - expect(sut.router.routes).toContain/* @if feat.jest **Equal/* @endif */({ - route: ['', 'welcome'], name: 'welcome', moduleId: './welcome', nav: true, title: 'Welcome' - }); - }); - - it('should have a users route', () => { - expect(sut.router.routes).toContain/* @if feat.jest **Equal/* @endif */({ - route: 'users', name: 'users', moduleId: './users', nav: true, title: 'Github Users' - }); - }); - - it('should have a child router route', () => { - expect(sut.router.routes).toContain/* @if feat.jest **Equal/* @endif */({ - route: 'child-router', name: 'child-router', moduleId: './child-router', nav: true, title: 'Child Router' - }); - }); -}); diff --git a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_babel/users.spec.js b/skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_babel/users.spec.js deleted file mode 100644 index 5b557045f..000000000 --- a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_babel/users.spec.js +++ /dev/null @@ -1,30 +0,0 @@ -import {Users} from '../../src/users'; - -class HttpStub { - fetch(url) { - var response = this.itemStub; - this.url = url; - return new Promise((resolve) => { - resolve({ json: () => response }); - }); - } - - configure(func) { - } -} - -describe('the Users module', () => { - it('sets fetch response to users', (done) => { - var http = new HttpStub(); - var sut = new Users(http); - var itemStubs = [1]; - var itemFake = [2]; - - http.itemStub = itemStubs; - sut.activate().then(() => { - expect(sut.users).toBe(itemStubs); - expect(sut.users).not.toBe(itemFake); - done(); - }); - }); -}); diff --git a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_typescript/users.spec.ts b/skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_typescript/users.spec.ts deleted file mode 100644 index 070253030..000000000 --- a/skeleton/scaffold-navigation/test__if_karma_or_jest/unit__if_typescript/users.spec.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Users} from '../../src/users'; -import {HttpClient} from 'aurelia-fetch-client'; - -class HttpStub { - items: any[]; - - fetch(url) { - return new Promise(resolve => { - resolve({ json: () => this.items }); - }); - } - - configure(func) { } -} - -function createHttpStub(): any { - return new HttpStub(); -} - -describe('the Users module', () => { - - it('sets fetch response to users', (done) => { - var http = createHttpStub(), - sut = new Users(http), - itemStubs = [1], - itemFake = [2]; - - http.items = itemStubs; - - sut.activate().then(() => { - expect(sut.users).toBe(itemStubs); - expect(sut.users).not.toBe(itemFake); - done(); - }); - }); -}); diff --git a/skeleton/vscode/.vscode/extensions.json b/skeleton/vscode/.vscode/extensions.json deleted file mode 100644 index c8227c3c1..000000000 --- a/skeleton/vscode/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recommendations": [ - "AureliaEffect.aurelia", - "msjsdiag.debugger-for-chrome", - "steoates.autoimport", - "EditorConfig.EditorConfig", - "christian-kohler.path-intellisense", - "behzad88.Aurelia" - ] -} \ No newline at end of file diff --git a/skeleton/vscode/.vscode/launch.json__if_cli-bundler b/skeleton/vscode/.vscode/launch.json__if_cli-bundler deleted file mode 100644 index 8e4e51b8d..000000000 --- a/skeleton/vscode/.vscode/launch.json__if_cli-bundler +++ /dev/null @@ -1,32 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for node debugging - // Use hover for the description of the existing attributes - // For further information visit https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Chrome Debugger", - "type": "chrome", - "request": "launch", - "url": "http://localhost:9000", - "webRoot": "${workspaceRoot}/src", - "userDataDir": "${workspaceRoot}/.chrome", - "sourceMapPathOverrides": { - "../src/*": "${webRoot}/*" - } - }, - { - "type": "chrome", - "request": "attach", - "name": "Attach Karma Chrome", - "address": "localhost", - "port": 9333, - "sourceMaps": true, - "pathMapping": { - "/": "${workspaceRoot}", - "/base/": "${workspaceRoot}/" - }, - "sourceMapPathOverrides": { "../src/*": "${webRoot}/*" } - } - ] -} diff --git a/skeleton/vscode/.vscode/launch.json__if_webpack b/skeleton/vscode/.vscode/launch.json__if_webpack deleted file mode 100644 index 3a5f9b45e..000000000 --- a/skeleton/vscode/.vscode/launch.json__if_webpack +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to find out which attributes exist for node debugging - // Use hover for the description of the existing attributes - // For further information visit https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Chrome", - "type": "chrome", - "request": "launch", - "url": "http://localhost:8080", - "webRoot": "${workspaceRoot}/src", - "userDataDir": "${workspaceRoot}/.chrome", - "sourceMapPathOverrides": { - "webpack:///./src/*": "${webRoot}/*" - } - } - ] -} \ No newline at end of file diff --git a/skeleton/vscode/.vscode/settings.json__if_typescript b/skeleton/vscode/.vscode/settings.json__if_typescript deleted file mode 100644 index a049a370d..000000000 --- a/skeleton/vscode/.vscode/settings.json__if_typescript +++ /dev/null @@ -1,6 +0,0 @@ -{ - // Place your settings in this file to overwrite default and user settings. - "typescript.tsdk": "node_modules/typescript/lib", - "html.suggest.angular1": false, - "html.suggest.ionic": false -} diff --git a/skeleton/vscode/jsconfig.json__if_babel b/skeleton/vscode/jsconfig.json__if_babel deleted file mode 100644 index 06670f1da..000000000 --- a/skeleton/vscode/jsconfig.json__if_babel +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "target": "es2015", - "experimentalDecorators": true - } -} diff --git a/skeleton/webpack/README.md b/skeleton/webpack/README.md deleted file mode 100644 index 17abcd7cc..000000000 --- a/skeleton/webpack/README.md +++ /dev/null @@ -1,23 +0,0 @@ -For more information, go to https://aurelia.io/docs/cli/webpack - -## Run dev app - -Run `npm start`, then open `http://localhost:/* @if feat.web */8080/* @endif *//* @if feat['dotnet-core'] */5000/* @endif */` - -You can change the standard webpack configurations from CLI easily with something like this: `npm start -- --open --port 8888`. However, it is better to change the respective npm scripts or `webpack.config.js` with these options, as per your need. - -To enable Webpack Bundle Analyzer, do `npm run analyze` (production build). - -To enable hot module reload, do `npm start -- --hmr`. - -To change dev server port, do `npm start -- --port 8888`. - -To change dev server host, do `npm start -- --host 127.0.0.1` - -**PS:** You could mix all the flags as well, `npm start -- --host 127.0.0.1 --port 7070 --open --hmr` - -For long time aurelia-cli user, you can still use `au run` with those arguments like `au run --env prod --open --hmr`. But `au run` now simply executes `npm start` command. - -## Build for production - -Run `npm run build`, or the old way `au build --env prod`. diff --git a/skeleton/webpack/aurelia_project/aurelia.json b/skeleton/webpack/aurelia_project/aurelia.json deleted file mode 100644 index 19d570eb9..000000000 --- a/skeleton/webpack/aurelia_project/aurelia.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "build": { - "options": { - "server": "dev", - "extractCss": "prod", - "coverage": false - } - }, - "platform": { - "hmr": false, - "open": false, - - // @if feat.web - "port": 8080, - "host": "localhost", - "output": "dist", - // @endif - - // @if feat['dotnet-core'] - "port": 5000, - "host": "localhost", - "output": "wwwroot/dist", - // @endif - } -} diff --git a/skeleton/webpack/aurelia_project/tasks/build.ext b/skeleton/webpack/aurelia_project/tasks/build.ext deleted file mode 100644 index eb1dbe240..000000000 --- a/skeleton/webpack/aurelia_project/tasks/build.ext +++ /dev/null @@ -1,26 +0,0 @@ -import { NPM } from 'aurelia-cli'; - -export default function() { - console.log('`au build` is an alias of the `npm run build:dev`, you may use either of those; see README for more details.'); - const args = process.argv.slice(3); - return (new NPM()).run('run', ['build:dev', '--', ... cleanArgs(args)]); -} - -// Cleanup --env prod to --env.production -// for backwards compatibility -function cleanArgs(args) { - const cleaned = []; - for (let i = 0, ii = args.length; i < ii; i++) { - if (args[i] === '--env' && i < ii - 1) { - const env = args[++i].toLowerCase(); - if (env.startsWith('prod')) { - cleaned.push('--env.production'); - } else if (env.startsWith('test')) { - cleaned.push('--tests'); - } - } else { - cleaned.push(args[i]); - } - } - return cleaned; -} diff --git a/skeleton/webpack/aurelia_project/tasks/build.json b/skeleton/webpack/aurelia_project/tasks/build.json deleted file mode 100644 index 04198c200..000000000 --- a/skeleton/webpack/aurelia_project/tasks/build.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "build", - "description": "Builds and processes all application assets. It is an alias of the `npm run build:dev`, you may use either of those; see README for more details.", - "flags": [ - { - "name": "analyze", - "description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod", - "type": "boolean" - }, - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "watch", - "description": "Watches source files for changes and refreshes the bundles automatically.", - "type": "boolean" - } - ] -} diff --git a/skeleton/webpack/aurelia_project/tasks/run.ext b/skeleton/webpack/aurelia_project/tasks/run.ext deleted file mode 100644 index 89574aa5a..000000000 --- a/skeleton/webpack/aurelia_project/tasks/run.ext +++ /dev/null @@ -1,52 +0,0 @@ -import { NPM } from 'aurelia-cli'; -// @if feat.babel -import kill from 'tree-kill'; -// @endif -// @if feat.typescript -import * as kill from 'tree-kill'; -// @endif -import { platform } from '../aurelia.json'; - -const npm = new NPM(); - -function run() { - console.log('`au run` is an alias of the `npm start`, you may use either of those; see README for more details.'); - const args = process.argv.slice(3); - return npm.run('start', ['--', ... cleanArgs(args)]); -} - -// Cleanup --env prod to --env.production -// for backwards compatibility -function cleanArgs(args) { - let host; - const cleaned = []; - - for (let i = 0, ii = args.length; i < ii; i++) { - if (args[i] === '--env' && i < ii - 1) { - const env = args[++i].toLowerCase(); - if (env.startsWith('prod')) { - cleaned.push('--env.production'); - } else if (env.startsWith('test')) { - cleaned.push('--tests'); - } - } else if (args[i] === '--host' && i < ii -1) { - host = args[++i]; - } else { - cleaned.push(args[i]); - } - } - - // Deal with --host before webpack-dev-server calls webpack config. - // Because of https://discourse.aurelia.io/t/changing-platform-host-in-aurelia-json-doesnt-change-the-host-ip/3043/10?u=huochunpeng - if (!host) host = platform.host; - if (host) cleaned.push('--host', host); - return cleaned; -} - -const shutdownAppServer = () => { - if (npm && npm.proc) { - kill(npm.proc.pid); - } -}; - -export { run as default, shutdownAppServer }; diff --git a/skeleton/webpack/aurelia_project/tasks/run.json b/skeleton/webpack/aurelia_project/tasks/run.json deleted file mode 100644 index 8b4c4c821..000000000 --- a/skeleton/webpack/aurelia_project/tasks/run.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "run", - "description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work. It is an alias of the `npm start`, you may use either of those; see README for more details.", - "flags": [ - { - "name": "analyze", - "description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod", - "type": "boolean" - }, - { - "name": "env", - "description": "Sets the build environment.", - "type": "string" - }, - { - "name": "hmr", - "description": "Enable Hot Module Reload", - "type": "boolean" - }, - { - "name": "port", - "description": "Set port number of the dev server", - "type": "string" - }, - { - "name": "host", - "description": "Set host address of the dev server, the accessible URL", - "type": "string" - }, - { - "name": "open", - "description": "Open the default browser at the application location.", - "type": "boolean" - } - ] -} diff --git a/skeleton/webpack/index.ejs b/skeleton/webpack/index.ejs deleted file mode 100644 index adf4c111b..000000000 --- a/skeleton/webpack/index.ejs +++ /dev/null @@ -1,12 +0,0 @@ - - - - - <%- htmlWebpackPlugin.options.metadata.title %> - - - - - - - diff --git a/skeleton/webpack/package.json b/skeleton/webpack/package.json deleted file mode 100644 index da19bf73f..000000000 --- a/skeleton/webpack/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "devDependencies": { - // @if feat['dotnet-core'] - "aspnet-webpack": "", - "webpack-hot-middleware": "", - // @endif - - // @if feat.babel - "babel-eslint": "", - "eslint": "", - "babel-loader": "", - "babel-plugin-istanbul": "", - "@babel/plugin-proposal-decorators": "", - "@babel/plugin-proposal-class-properties": "", - "@babel/preset-env": "", - "@babel/core": "", - "@babel/register": "", - // @endif - - // @if feat.typescript - "ts-loader": "", - "ts-node": "", - "@types/node": "", - "@types/lodash": "", - "@types/webpack": "", - "typescript": "", - // @endif - - // @if feat.less - "less-loader": "", - "less": "", - // @endif - - // @if feat['postcss-basic'] || feat['postcss-typical'] - "postcss-loader": "", - "autoprefixer": "", - // @endif - // @if feat['postcss-typical'] - "cssnano": "", - // @endif - - // @if feat.sass - "sass-loader": "", - "sass": "", - // @endif - - // @if feat.stylus - "stylus-loader": "", - "stylus": "", - // @endif - - "html-webpack-plugin": "", - "copy-webpack-plugin": "", - "mini-css-extract-plugin": "", - "aurelia-webpack-plugin": "", - "duplicate-package-checker-webpack-plugin": "", - "clean-webpack-plugin": "", - "webpack": "", - "webpack-cli": "", - "webpack-dev-server": "", - "expose-loader": "", - "style-loader": "", - "url-loader": "", - "css-loader": "", - "file-loader": "", - "app-settings-loader": "", - "json-loader": "", - "html-loader": "", - "istanbul-instrumenter-loader": "", - "webpack-bundle-analyzer": "", - "tree-kill": "^1.2.1", - }, - "scripts": { - "build": "webpack --env.production --extractCss", - "build:dev": "webpack --extractCss", - "analyze": "webpack --env.production --analyze", - // @if feat['dotnet-core'] - "start": "webpack-dev-server --extractCss" - // @endif - - // @if feat.web - "start": "webpack-dev-server --extractCss" - // @endif - } -} diff --git a/skeleton/webpack/static/favicon.ico b/skeleton/webpack/static/favicon.ico deleted file mode 100644 index 330515e9c1d77fdfe88d7989060380932ca13e99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15086 zcmdU$3s{v^*2iB&MJ)y8rl5$Lrg=*<(=2f+Q&TiWEh}#|Up1A23Y>G`00#uQh@v2< zs0f0opk^0GO-stu@-k+ZvFWR%>86&7*`sD~_V-)wxp48wFw@iX%y*t=x#94>d#}rX zueJADOHFgr+_gLJ)EI-c&D}L^u%>Cj!S>(1H0>+C^J0|0Ki^c-7V$t&p5Ya379`*6 zpWAH1f7`zWkIr%XZ{w-4{H%N={Fc?@=0@a?n>+OXqZ}(nMa;|_6Ml8|*zoU=A#zRV zT#)p~eTu^@?$8s^{gBh{8>S?-*)YWddK>>)`oR32%O09{D(B${l{Y#m-scd9efeheDfv0bgVZraQ#kvV|nqX5Cw#{MgAmIaETS8kQWv4xiUhp4RJSEYJ z3{~*IXTxO6unm*ro7{|d`9AsH$eF44MP5lCzCdLn!%}2eK60MQ8HFvzAVV!%tQ$Yq zY3GLKto=81@F#R}4t%Pthvxll@re14W<6-|D4A?|0G{82et_;To|-(oc{u^T)`8z!2S+fc-H2x zp`Urj7c9OlbBIpF#^~wi5APu*QHDmfE&WgFyd?jX}Ntp*3RKnnBl{h3yfhXM- zf+w*Bdt0}K4Nnn^*N>DBpnYL%_{hkzH&lbBS&iGQX@9dzV4Q3^4r+580-E@trnJ zOYXROY-DcU=y{hR^fh0t9dA@clM|3bWJoB0S_=QBUWn6l;BBhk!H7r;0f#=Mvs9G`5PMH-3Q$4t%nfP$RLDFf~im04?Sc}W4Bc;O+A(unR+f!raRJ=sZX-veSI$Q zqy$f*A8f4Kg1xQMLl#_QZ;x$=XUE@4CchxKiLJrSyc*n~7tvAdK+$~+YsRs5f-?0@ zf{&C-=yZ8>k0k;5q2Zn2JrDW?x{57kI_5WaT|3LzZRJ%{_Z(%qJxiH-WhhhcMa+>X zx)7TxGq#m=L|0;OFq;AY&b{N9%hibP?`OaN;J{6$Yuv!QS+~8cD>~G9xFg+a>Xmui z*dr@6W0*y3F_rz0v~tXXRytucFO;UvCBGT?6z8&y5}OpGGxf){WN3%Pv}GJ zDmsd@;ps4YyRo=w2X6K_aRcsT9|;yk7h>C5xY6w{YodFw!1}!wD;*cNFS~?(ml?XQ z3jF?+0NrQ5=(p^a7yOoPdeMKWiU`P4hR(>)b&WFKmZwZTvUzW*9ZxBCJeiTfcmb?F z;!4l;zbkvREfWG;s!tPZ{P;rb96pLr#e0a>zxa&#-QS3 z#!fGX&g+oh0vW>K|09t>$Yu*<)$z0v8FDUQ$423%HjX&|`4IEsiGSzxICX=+sf`=i zvku&_|D3p40skv)`V`)S*Teq?W$d(389Q#eWC$!>W(?R7@E5;Khb?~5Z6W(2Fjqwf zvnRT(&R{?2{-$tJtQT}g;l$Vm&ruFJh<8oE%?RS){)E9%)it;gUr(%QEN;4jiQocw zFH**!68L{v83MN`L%>$6p~LoLhW4+Gi||`7wwMgnw#EC=o!2^XQy6BBE)0wP1{n-c zTL+*2Y9yBXf*T9|=A1oFHRNx^<~QOdxDeip?YiF#|7GyMO&QwnPzL|kFB$xHX2tmJ z#TJXj7OSztw~V0<-U=s~hZcp!eODA_R><%h{O^K>LXEP8X<$?n_Us7uY&rg>+7_o8 zgB#Jk9XCNbZs5Jt#(RfX;QuxFe?uAl{%SS)?LKDm-8(MaZyo-1Nk9CQhwz^}D%^Y3 zBlCB!n_%KR7zc?A(4^RJp%D%l|JC@_@|{f#eat?@sYFwsg+JQkl-<`m{Eg_|?r&V+ z#@JEEjRH6D{;KF6-giQ~l*xAw^yVd#&%P|P&$|H*esV`eL?c7B+{f00M%R|%F#LCP zJlD`zHe*$LD0}P7m7`aTNpEWGoic(r^$u~W+8(F=6Wl0pBf3{c-`&Eyf_D|;^OiNn zd;if`?{~(>wmaA?Z*=&0`2QGEYsMQm2gZvG7oaf>@$C59)|qRYY@N9}aqG-g)|aPc zUnrcEo>4M2-9NH>hPSC_W)lA9CtIAV?Qd%1hCSPHlN~o((S04<)YAQ4;a$aezpY}u z%T;WkGZmRV-CBD0!zi9++?7Dv&{^8yG9r!<>%W0$Me)@5DV)6vk)ctz**0sf-?mw6_QSs_oxVyHPhBefJLn=mXOuja=5Oeh z=SQ4cNZk2JKa(}=Z@_(h+&FZ<-_HBH@cy1Mw>_ld+P<&iygs-T=Xq?Y`PP#GyW+<; z>fW+#_WCC9p9oozL2aG6MwQK2tu{@|cG$sTi?<5H(gQ|mWp11i9>U)oAWl{5zWzVM z4Z0WJ4?>59cj%~!_dI4z@H%lc!TY07i|?n+9QeN3xP5lPgWG1WI|u*DM#!Mcfi0fO zt8I%SaHZd;WG+*eLSKA+GI8p>4LA6D7yia*^EWrcjh%PV{So0^#e4ltCA9lcS$saO zO!WWz(xeWb-4sLHXRp5n{$GO>GQhu($WbGM-4>s)5A^#~MC;Pl;jK3(LXSlHZfR!h zxcNci)O*CKYFnHVU;l68#;*J0DxvKOc>hQx`hBXB+Mlu}1%7^XVW%%clY=X6um$|P zL!t106tdn#hF{nh(;W7L?`OkXZ~7Iw$j|BFw{Gz>cHHKRzga|_I&Y6tH~JeNr@y%w zZWOpt3En4_#rG4H*#4AC3iyXw*zpUM-1)1@lrCQ{U3A;GE^UDf9pOILKFPLE=>Pjks~_S>4~*_Ns72kru`cTV{gKq3XU3)V{;5uGP;`q7&EUVr7B(z>1fKNlJA11Y zR4h1+@jRd++q?$pUHo>FK2{Q;?xC`&%g9HH^YqrHwxUSQ-=)jJqY>=dK(%JInS&3 zu~zuA67g%uVe@hLIfoqtPcCfnQ$*`6_sRV8+&^@WX?tK4aq2K}%4&~Ob#deE^fwLR zM!|bdM&Ao{un(`dK-(dFs7`M%-s+GIKlThVTuo?qQuhzFWdKihIgT*a*aF@cN3GnzKQqhXJ zO2mhWUc?_uOp(|k>(-aSZj1BicC=&u4O13}6g;}w;(iyMn0Cxxe}s2uy#Sx}41V{T_}_({zR>3v9f__i zz8~xULbpY&J%J3V=C()l^DcJ?pVH~MdpABVXTem?!s%-BliAiSPh}t2GJW~&6E)QY zn~ue{AD|zrJx&zF(yqVa#QsR^oH@AzwId>Y~ z>-b8UzoAchp9{C(r#7YHYsKe^@0Iw$`9qI|H{uCfwEOUUyw{0Qj(NEQ4d)(r1{pZZ z=5Zz$%7s>3D4m{jL!JlSH$_L|Smy}qS?##F3Lnop=4|XpZ196#0drMpy^sM6ivO*# zMSVQ|-3ks;@k@5xYSfe94TS}bz8Q#~Ud*^w#vHZ(( z@ZT1S=Kb%9*T`^2rFO>_;8NnD#B}i!c3Zp$hIQP?yPTEAKo^lgmDQEu5d1rFBhR|} zuvRm0^8ow@yZU=$zf13X!3`OPBEv4``b}bYY7cB-$CF@{y?q|rJ8>g(%UKT!gHGr& z*lchCJKTVq#`5xep0nG+P}>%EJXx{DBKDq3Jivc2{O3ZK!4bI0bNSrw;jOXnX7s!0 zu*Gg{`O;lz!rx!@gJtbPz`@HtoS{t@5lw&?wn0X%)o-mZh2KVrQBC)m_Gj!&Z&aI&@)`mY``>p4v4ngwaDY z%6QGq5+UDLY84goT%|TZA1ky@dl@S=txXW) zHBEEBFNF1IU%J+r^%26zSY57ZL-_vMEKR#r#vz*Kk-&SLG-aI%4<6J~2s!Cx^(=J!Q0^`>eu)y<|%iS($RQ{F4{eaBF zm{=~O=8;&z{8r7={aS*IZQQFEl_khSDaP^;PkpQm$N7*=SNK+XE~Hi|{X5bt zAvH{7x(*Me=%T&j`T8TedW1Uv1$jq$PN;SM$eam@_rwHjd^}}hVOYY?`QxHFZ=3Bs z6qc*3pLoD%ax?Zx_M)z`(|ngv?>BJt;K)4EYa%sZ=6(wvyz8$kzw>>7U`C!3z86vB zrd}pB=W6Or`xEX;9GyST@EH9AC#9ET4ZR$NVewb6!%TUf8bTCx@2Z&o3A|&{Ywgm1 zBDHdz6R=a)QZj-??{cyyg&Aym181S z!pD_WV*?YeC-hG)8FYebG`0Q?*cV{d0+ZRutzn$D(0d|t}%$-N1>bZ4!w*0 zq~AfWFG~-EUL#DAdc4$0-ZJ-EI*LAoP_Wwd&t6$=BLZ@F>2=E6sC!GjSb8X=4}^E6 z2ZXuyVvn2YUGV;{Q}6VL2+#7KUgwj#d>?uWq_!&k1X5S+zT%vr>*_dT@CGmHbEBwp zRo2ve^YxmsUeBSAgI<&~^oF?9yVwD}N2B-ab@WdEkls&X(>rU^4thDtZH-?8yoWEP4_;s2ch?LaC)%;z1wQ=dM!WK zUdNX@IJMYL8_yX#mYT!;^Y4KNspbEo>mrDHdAC(>8oOtEZ+zU?iW-@-mR28s$lesc zF$TTAkKU~}*E@B+Zc@vZ+6?tbsijJ7AfT+;&|$~EX#ZCqw(H^(`Z~^n3tjKjxaLx8 zJOK~WAc>?dKe2a32bk_OrGxj2dTrFT-tBcEsi8{^nmVYS*ME(i^3HQ6zddGZpZC7t zmpR5u+v7&h%-!oI7{AtQonhuHtiKo{NZ%}?fai|wB{4*VX*c2*rnuJw-W zQpc3~vD7f7{;Jn6tEr#uBd2$NM&H7w)ccl8%@Q7@-d7DDaqA{TyTk+M;BlqXSDq@F zy2O}vZ)zW7&&BCrs8a8NaIJS+9Z#>HO8rr4r;^jvbLr>EDJEnNS~7Ii*oalsuCGw9 z+Y1ja_aS-kK<*UpZ+ap}>Oob|o`OfyL#Qc+Qj`0Deh{mz9_Lc;$Zo5B+G>a7!rMvh z>R>hbs(lu}_eSEU!-}VxUFHhN%QPjAy;$lZQV)6g@#WN|(}j<-g<)xb2FHQ;xJ>X~ zY3rMCsdrlq$J>^Nch=3QJCXM|8}E5CHqP^Nm$H+`9Y<}W(pj6K&bQ^MTw=_UtLrDF z;op^8gy-hY;C(!J{{Xzx^FaO7sdtgxsdr?j20-1*mJ6lkMQ+vNeX@#s^xH`RpNDWa zt&^)Fw?7dcPTT4$HT5Cxb?f#TEX}B)+(#YaLvr7yNWU$84FTITsijof>dr3p&iYbw zBai7t%}4508I0G4?+P&5fy=Q^0;-+Hf3F?HHU)tW8hut%r?DC{|IY?)1M0BwmU6j2w_m<7xue=cDk=kQN?^v(HSyCgGT&u0lcZ1&b90@s} zFOa>ztRo-R^nm6=2cZG-9l2=(^}#B^jpWvC`CRIsHM;mA#`E3#>?<$zE zcm!)t51rb9nb>J?|>@wHm$Wqj%?-RpzMufj4ik zxm(YL@t)*WrPh_$UUI5>E>d){C$`mzwy*rpiZa`c* zMHD`ws#XqhFFDXUK8_qxXXeQzKlU~AI%^O0*LD1E&mWA0j|1$HYT;XQzLFCpPhL$f zTi5%x*{fR+FIL0DZ}vPU`Pe*{=PcH4L0+hjtGcFR-TEUo@`r~M-aD`7SS7F5x)edbZ+ zp6PMT-P7}$hv)jLHl3B#bH7sSZ7cVLc~M+2{cjx~TwCDeOL>Es^4CPM!XYSLw--+&TaHp?7BYPx0;*W&C%$=~$`iV9F--mlr z7w+{(xXF&gw+))b=b9Rk45Z0_@yUV*=vLtlm$>o;YNk(^ETZkUb4NyxeX;aaos_smPewI9BQA5`FV6EOzIYz7uv+S# zQnO8H_fhGF@g>9X-4(>He-c0YCitEXhVONpQ?}uE>co@uK0kHFCub8EE_04NZSnuI z|MsWz`ccm+Cl0;jur)HbWbHcdI{t=VZH`Pc@Tt!@zQcd|Ku)|lzITjzZu79Fy?=n% pn#%bIlKg3TAURl8N#j config && (Array.isArray(config) ? config : [config]) || []; -const when = (condition, config, negativeConfig) => - condition ? ensureArray(config) : ensureArray(negativeConfig); - -// primary config: -const title = 'Aurelia Navigation Skeleton'; -const outDir = path.resolve(__dirname, project.platform.output); -const srcDir = path.resolve(__dirname, 'src'); -const nodeModulesDir = path.resolve(__dirname, 'node_modules'); -const baseUrl = '/'; - -const cssRules = [ - { loader: 'css-loader' }, - // @if feat['postcss-basic'] - { - loader: 'postcss-loader', - options: { plugins: () => [require('autoprefixer')()] } - } - // @endif - // @if feat['postcss-typical'] - { - loader: 'postcss-loader', - options: { plugins: () => [ - require('autoprefixer')(), - require('cssnano')() - ] } - } - // @endif -]; - -// @if feat.sass -const sassRules = [ - { - loader: "sass-loader", - options: { - sassOptions: { - includePaths: ['node_modules'] - } - } - } -]; -// @endif - -module.exports = ({ production } = {}, {extractCss, analyze, tests, hmr, port, host } = {}) => ({ - resolve: { - // @if feat.typescript - extensions: ['.ts', '.js'], - // @endif - // @if feat.babel - extensions: ['.js'], - // @endif - modules: [srcDir, 'node_modules'], - - alias: { - // https://github.com/aurelia/dialog/issues/387 - // Uncomment next line if you had trouble to run aurelia-dialog on IE11 - // 'aurelia-dialog': path.resolve(__dirname, 'node_modules/aurelia-dialog/dist/umd/aurelia-dialog.js'), - - // https://github.com/aurelia/binding/issues/702 - // Enforce single aurelia-binding, to avoid v1/v2 duplication due to - // out-of-date dependencies on 3rd party aurelia plugins - 'aurelia-binding': path.resolve(__dirname, 'node_modules/aurelia-binding') - } - }, - entry: { - app: [ - // Uncomment next line if you need to support IE11 - // 'promise-polyfill/src/polyfill', - 'aurelia-bootstrapper' - ] - }, - mode: production ? 'production' : 'development', - output: { - path: outDir, - publicPath: baseUrl, - filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js', - sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map', - chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js' - }, - optimization: { - runtimeChunk: true, // separates the runtime chunk, required for long term cacheability - // moduleIds is the replacement for HashedModuleIdsPlugin and NamedModulesPlugin deprecated in https://github.com/webpack/webpack/releases/tag/v4.16.0 - // changes module id's to use hashes be based on the relative path of the module, required for long term cacheability - moduleIds: 'hashed', - // Use splitChunks to breakdown the App/Aurelia bundle down into smaller chunks - // https://webpack.js.org/plugins/split-chunks-plugin/ - splitChunks: { - hidePathInfo: true, // prevents the path from being used in the filename when using maxSize - chunks: "initial", - // sizes are compared against source before minification - // @if feat.http1 - maxSize: 200000, // splits chunks if bigger than 200k, adjust as required (maxSize added in webpack v4.15) - // @endif - // @if feat.http2 - maxInitialRequests: Infinity, // Default is 3, make this unlimited if using HTTP/2 - maxAsyncRequests: Infinity, // Default is 5, make this unlimited if using HTTP/2 - minSize: 10000, // chunk is only created if it would be bigger than minSize, adjust as required - maxSize: 40000, // splits chunks if bigger than 40k, adjust as required (maxSize added in webpack v4.15) - // @endif - cacheGroups: { - default: false, // Disable the built-in groups default & vendors (vendors is redefined below) - // You can insert additional cacheGroup entries here if you want to split out specific modules - // This is required in order to split out vendor css from the app css when using --extractCss - // For example to separate font-awesome and bootstrap: - // fontawesome: { // separates font-awesome css from the app css (font-awesome is only css/fonts) - // name: 'vendor.font-awesome', - // test: /[\\/]node_modules[\\/]font-awesome[\\/]/, - // priority: 100, - // enforce: true - // }, - // bootstrap: { // separates bootstrap js from vendors and also bootstrap css from app css - // name: 'vendor.font-awesome', - // test: /[\\/]node_modules[\\/]bootstrap[\\/]/, - // priority: 90, - // enforce: true - // }, - - // @if feat.http1 - // This is the HTTP/1.1 optimised cacheGroup configuration - vendors: { // picks up everything from node_modules as long as the sum of node modules is larger than minSize - test: /[\\/]node_modules[\\/]/, - name: 'vendors', - priority: 19, - enforce: true, // causes maxInitialRequests to be ignored, minSize still respected if specified in cacheGroup - minSize: 30000 // use the default minSize - }, - vendorsAsync: { // vendors async chunk, remaining asynchronously used node modules as single chunk file - test: /[\\/]node_modules[\\/]/, - name: 'vendors.async', - chunks: 'async', - priority: 9, - reuseExistingChunk: true, - minSize: 10000 // use smaller minSize to avoid too much potential bundle bloat due to module duplication. - }, - commonsAsync: { // commons async chunk, remaining asynchronously used modules as single chunk file - name: 'commons.async', - minChunks: 2, // Minimum number of chunks that must share a module before splitting - chunks: 'async', - priority: 0, - reuseExistingChunk: true, - minSize: 10000 // use smaller minSize to avoid too much potential bundle bloat due to module duplication. - } - // @endif - // @if feat.http2 - // This is the HTTP/2 optimised cacheGroup configuration - // generic 'initial/sync' vendor node module splits: separates out larger modules - vendorSplit: { // each node module as separate chunk file if module is bigger than minSize - test: /[\\/]node_modules[\\/]/, - name(module) { - // Extract the name of the package from the path segment after node_modules - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `vendor.${packageName.replace('@', '')}`; - }, - priority: 20 - }, - vendors: { // picks up everything else being used from node_modules that is less than minSize - test: /[\\/]node_modules[\\/]/, - name: "vendors", - priority: 19, - enforce: true // create chunk regardless of the size of the chunk - }, - // generic 'async' vendor node module splits: separates out larger modules - vendorAsyncSplit: { // vendor async chunks, create each asynchronously used node module as separate chunk file if module is bigger than minSize - test: /[\\/]node_modules[\\/]/, - name(module) { - // Extract the name of the package from the path segment after node_modules - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `vendor.async.${packageName.replace('@', '')}`; - }, - chunks: 'async', - priority: 10, - reuseExistingChunk: true, - minSize: 5000 // only create if 5k or larger - }, - vendorsAsync: { // vendors async chunk, remaining asynchronously used node modules as single chunk file - test: /[\\/]node_modules[\\/]/, - name: 'vendors.async', - chunks: 'async', - priority: 9, - reuseExistingChunk: true, - enforce: true // create chunk regardless of the size of the chunk - }, - // generic 'async' common module splits: separates out larger modules - commonAsync: { // common async chunks, each asynchronously used module a separate chunk file if module is bigger than minSize - name(module) { - // Extract the name of the module from last path component. 'src/modulename/' results in 'modulename' - const moduleName = module.context.match(/[^\\/]+(?=\/$|$)/)[0]; - return `common.async.${moduleName.replace('@', '')}`; - }, - minChunks: 2, // Minimum number of chunks that must share a module before splitting - chunks: 'async', - priority: 1, - reuseExistingChunk: true, - minSize: 5000 // only create if 5k or larger - }, - commonsAsync: { // commons async chunk, remaining asynchronously used modules as single chunk file - name: 'commons.async', - minChunks: 2, // Minimum number of chunks that must share a module before splitting - chunks: 'async', - priority: 0, - reuseExistingChunk: true, - enforce: true // create chunk regardless of the size of the chunk - } - // @endif - } - } - }, - performance: { hints: false }, - devServer: { - contentBase: outDir, - // serve index.html for all 404 (required for push-state) - historyApiFallback: true, - hot: hmr || project.platform.hmr, - port: port || project.platform.port, - host: host - }, - devtool: production ? 'nosources-source-map' : 'cheap-module-eval-source-map', - module: { - rules: [ - // CSS required in JS/TS files should use the style-loader that auto-injects it into the website - // only when the issuer is a .js/.ts file, so the loaders are not applied inside html templates - { - test: /\.css$/i, - issuer: [{ not: [{ test: /\.html$/i }] }], - use: extractCss ? [{ - loader: MiniCssExtractPlugin.loader - }, ...cssRules - ] : ['style-loader', ...cssRules] - }, - { - test: /\.css$/i, - issuer: [{ test: /\.html$/i }], - // CSS required in templates cannot be extracted safely - // because Aurelia would try to require it again in runtime - use: cssRules - }, - // @if feat.less - { - test: /\.less$/i, - use: extractCss ? [{ - loader: MiniCssExtractPlugin.loader - }, ...cssRules, 'less-loader' - ]: ['style-loader', ...cssRules, 'less-loader'], - issuer: /\.[tj]s$/i - }, - { - test: /\.less$/i, - use: [...cssRules, 'less-loader'], - issuer: /\.html?$/i - }, - // @endif - // @if feat.stylus - { - test: /\.styl$/i, - use: extractCss ? [{ - loader: MiniCssExtractPlugin.loader - }, ...cssRules, 'stylus-loader' - ]: ['style-loader', ...cssRules, 'stylus-loader'], - issuer: /\.[tj]s$/i - }, - { - test: /\.styl$/i, - use: [...cssRules, 'stylus-loader'], - issuer: /\.html?$/i - }, - // @endif - // @if feat.sass - { - test: /\.scss$/, - use: extractCss ? [{ - loader: MiniCssExtractPlugin.loader - }, ...cssRules, ...sassRules - ]: ['style-loader', ...cssRules, ...sassRules], - issuer: /\.[tj]s$/i - }, - { - test: /\.scss$/, - use: [...cssRules, ...sassRules], - issuer: /\.html?$/i - }, - // @endif - { test: /\.html$/i, loader: 'html-loader' }, - // @if feat.babel - { - test: /\.js$/i, loader: 'babel-loader', exclude: nodeModulesDir, - options: tests ? { sourceMap: 'inline', plugins: ['istanbul'] } : {} - }, - // @endif - // @if feat.typescript - { test: /\.ts$/, loader: "ts-loader" }, - // @endif - // embed small images and fonts as Data Urls and larger ones as files: - { test: /\.(png|gif|jpg|cur)$/i, loader: 'url-loader', options: { limit: 8192 } }, - { test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/i, loader: 'url-loader', options: { limit: 10000, mimetype: 'application/font-woff2' } }, - { test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/i, loader: 'url-loader', options: { limit: 10000, mimetype: 'application/font-woff' } }, - // load these fonts normally, as files: - { test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i, loader: 'file-loader' }, - { test: /environment\.json$/i, use: [ - {loader: "app-settings-loader", options: {env: production ? 'production' : 'development' }}, - ]}, - // @if feat.typescript - ...when(tests, { - test: /\.[jt]s$/i, loader: 'istanbul-instrumenter-loader', - include: srcDir, exclude: [/\.(spec|test)\.[jt]s$/i], - enforce: 'post', options: { esModules: true }, - }) - // @endif - ] - }, - plugins: [ - ...when(!tests, new DuplicatePackageCheckerPlugin()), - new AureliaPlugin(), - // @if feat['scaffold-navigation'] - new ProvidePlugin({ - 'jQuery': 'jquery', - '$': 'jquery', - 'window.jQuery': 'jquery', - 'window.$': 'jquery' - }), - // @endif - new ModuleDependenciesPlugin({ - 'aurelia-testing': ['./compile-spy', './view-spy'] - }), - new HtmlWebpackPlugin({ - template: 'index.ejs', - // @if feat['htmlmin-min'] - minify: production ? { - removeComments: true, - collapseWhitespace: true - } : undefined, - // @endif - // @if feat['htmlmin-max'] - minify: production ? { - removeComments: true, - collapseWhitespace: true, - collapseInlineTagWhitespace: true, - collapseBooleanAttributes: true, - removeAttributeQuotes: true, - minifyCSS: true, - minifyJS: true, - removeScriptTypeAttributes: true, - removeStyleLinkTypeAttributes: true, - ignoreCustomFragments: [/\${.*?}/g] - } : undefined, - // @endif - metadata: { - // available in index.ejs // - title, baseUrl - } - }), - // ref: https://webpack.js.org/plugins/mini-css-extract-plugin/ - ...when(extractCss, new MiniCssExtractPlugin({ // updated to match the naming conventions for the js files - filename: production ? 'css/[name].[contenthash].bundle.css' : 'css/[name].[hash].bundle.css', - chunkFilename: production ? 'css/[name].[contenthash].chunk.css' : 'css/[name].[hash].chunk.css' - })), - ...when(!tests, new CopyWebpackPlugin([ - { from: 'static', to: outDir, ignore: ['.*'] }])), // ignore dot (hidden) files - ...when(analyze, new BundleAnalyzerPlugin()), - /** - * Note that the usage of following plugin cleans the webpack output directory before build. - * In case you want to generate any file in the output path as a part of pre-build step, this plugin will likely - * remove those before the webpack build. In that case consider disabling the plugin, and instead use something like - * `del` (https://www.npmjs.com/package/del), or `rimraf` (https://www.npmjs.com/package/rimraf). - */ - new CleanWebpackPlugin() - ] -}); diff --git a/spec/lib/workflow/applicable.spec.js b/spec/lib/workflow/applicable.spec.js deleted file mode 100644 index b2bd9ce3c..000000000 --- a/spec/lib/workflow/applicable.spec.js +++ /dev/null @@ -1,74 +0,0 @@ -const applicable = require('../../../lib/workflow/applicable'); - -describe('The applicable func', () => { - it('supports logical not', () => { - expect(applicable(['a', 'b'], 'not_c')).toBeTruthy(); - expect(applicable(['a', 'b'], 'not_a')).toBeFalsy(); - expect(applicable(['a', 'b'], 'not_b')).toBeFalsy(); - expect(applicable(['a', 'b'], '!c')).toBeTruthy(); - expect(applicable(['a', 'b'], '!a')).toBeFalsy(); - expect(applicable(['a', 'b'], '!b')).toBeFalsy(); - expect(applicable(['a', 'b'], '! c')).toBeTruthy(); - expect(applicable(['a', 'b'], '! a')).toBeFalsy(); - expect(applicable(['a', 'b'], '! b')).toBeFalsy(); - }); - - it('supports logical and', () => { - expect(applicable(['a', 'b'], 'a_and_b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'a_and_c')).toBeFalsy(); - expect(applicable(['a', 'b'], 'c_and_b')).toBeFalsy(); - expect(applicable(['a', 'b'], 'c_and_d')).toBeFalsy(); - expect(applicable(['a', 'b'], 'a&&b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'a&&c')).toBeFalsy(); - expect(applicable(['a', 'b'], 'c&&b')).toBeFalsy(); - expect(applicable(['a', 'b'], 'c&&d')).toBeFalsy(); - expect(applicable(['a', 'b'], 'a && b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'a && c')).toBeFalsy(); - expect(applicable(['a', 'b'], 'c && b')).toBeFalsy(); - expect(applicable(['a', 'b'], 'c && d')).toBeFalsy(); - }); - - it('supports logical or', () => { - expect(applicable(['a', 'b'], 'a_or_b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'a_or_c')).toBeTruthy(); - expect(applicable(['a', 'b'], 'c_or_b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'c_or_d')).toBeFalsy(); - expect(applicable(['a', 'b'], 'a||b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'a||c')).toBeTruthy(); - expect(applicable(['a', 'b'], 'c||b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'c||d')).toBeFalsy(); - expect(applicable(['a', 'b'], 'a || b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'a || c')).toBeTruthy(); - expect(applicable(['a', 'b'], 'c || b')).toBeTruthy(); - expect(applicable(['a', 'b'], 'c || d')).toBeFalsy(); - }); - - it('supports long logical expression', () => { - expect(applicable(['a-c', 'b'], 'not_a-c_or_b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], 'not_a-c_or_c')).toBeFalsy(); - expect(applicable(['a-c', 'b'], 'not_c_or_b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], 'not_c_or_d')).toBeTruthy(); - expect(applicable(['a-c', 'b'], 'not_a-c_and_b')).toBeFalsy(); - expect(applicable(['a-c', 'b'], 'not_a_and_c')).toBeFalsy(); - expect(applicable(['a-c', 'b'], 'not_c_and_b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], 'not_c_and_d')).toBeFalsy(); - - expect(applicable(['a-c', 'b'], '!a-c||b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '!a-c||c')).toBeFalsy(); - expect(applicable(['a-c', 'b'], '!c||b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '!c||d')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '!a-c&&b')).toBeFalsy(); - expect(applicable(['a-c', 'b'], '!a-c&&c')).toBeFalsy(); - expect(applicable(['a-c', 'b'], '!c&&b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '!c&&d')).toBeFalsy(); - - expect(applicable(['a-c', 'b'], '! a-c || b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '! a-c || c')).toBeFalsy(); - expect(applicable(['a-c', 'b'], '! c || b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '! c || d')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '! a-c && b')).toBeFalsy(); - expect(applicable(['a-c', 'b'], '! a-c && c')).toBeFalsy(); - expect(applicable(['a-c', 'b'], '! c && b')).toBeTruthy(); - expect(applicable(['a-c', 'b'], '! c && d')).toBeFalsy(); - }); -}); diff --git a/spec/lib/workflow/run-questionnaire.spec.js b/spec/lib/workflow/run-questionnaire.spec.js deleted file mode 100644 index d2503a5e9..000000000 --- a/spec/lib/workflow/run-questionnaire.spec.js +++ /dev/null @@ -1,311 +0,0 @@ -const run = require('../../../lib/workflow/run-questionnaire'); - -describe('The run-questionaire module', () => { - describe('in unattended mode', () => { - it('returns first choice by default', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], true); - expect(result).toEqual(['webpack', 'web']); - }); - - it('returns first choice by default, ignore none', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'none', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], true); - expect(result).toEqual(['webpack']); - }); - - it('returns preselected choice, case1', async() => { - const result = await run(['cli-bundler'], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], true); - expect(result).toEqual(['cli-bundler', 'web']); - }); - - it('returns preselected choice, case2', async() => { - const result = await run(['dotnet-core'], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], true); - expect(result).toEqual(['webpack', 'dotnet-core']); - }); - - it('returns preselected choice, but cleaned up', async() => { - const result = await run(['webpack', 'cli-bundler', 'dotnet-core', 'web'], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], true); - expect(result).toEqual(['cli-bundler', 'web']); - }); - - it('supports condition', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ], - if: 'webpack' - } - ], true); - expect(result).toEqual(['webpack', 'web']); - }); - - it('supports condition, case2', async() => { - const result = await run(['cli-bundler'], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ], - if: 'webpack' - } - ], true); - expect(result).toEqual(['cli-bundler']); - }); - - it('supports choice condition', async() => { - const result = await run(['cli-bundler', 'dotnet-core'], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core', if: 'webpack'} - ] - } - ], true); - expect(result).toEqual(['cli-bundler', 'web']); - }); - }); - - describe('in interactive mode', () => { - it('pick choices', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], false, [2, 1]); - expect(result).toEqual(['cli-bundler', 'web']); - }); - - it('pick choices, case2', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], false, [1, 2]); - expect(result).toEqual(['webpack', 'dotnet-core']); - }); - - it('pick choices, ignore none', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'none', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ] - } - ], false, [2, 1]); - expect(result).toEqual(['cli-bundler']); - }); - - it('supports condition', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ], - if: 'webpack' - } - ], false, [1, 2]); - expect(result).toEqual(['webpack', 'dotnet-core']); - }); - - it('supports condition, case2', async() => { - const result = await run(['cli-bundler'], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core'} - ], - if: 'webpack' - } - ], false, [2, 2]); - expect(result).toEqual(['cli-bundler']); - }); - - it('supports choice condition, do not ask single choice question', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web'}, - {value: 'dotnet-core', message: '.NET Core', if: 'webpack'} - ] - } - ], false, [2]); - expect(result).toEqual(['cli-bundler', 'web']); - }); - - it('supports choice condition, do not ask zero choice question', async() => { - const result = await run([], [ - { - message: 'bundler', - choices: [ - {value: 'webpack', message: 'Webpack'}, - {value: 'cli-bundler', message: 'CLI Bundler'} - ] - }, - { - message: 'platform', - choices: [ - {value: 'web', message: 'Web', if: 'webpack'}, - {value: 'dotnet-core', message: '.NET Core', if: 'webpack'} - ] - } - ], false, [2]); - expect(result).toEqual(['cli-bundler']); - }); - }); -}); diff --git a/spec/lib/workflow/select-features.spec.js b/spec/lib/workflow/select-features.spec.js deleted file mode 100644 index f50d1ca58..000000000 --- a/spec/lib/workflow/select-features.spec.js +++ /dev/null @@ -1,319 +0,0 @@ -const selectFeatures = require('../../../lib/workflow/select-features'); - -describe('The selectFeatures for app project', () => { - describe('in unattended mode', () => { - it('sets default esnext features', async() => { - const result = await selectFeatures(undefined, {unattended: true}); - expect(result).toEqual(['webpack', 'http1', 'web', 'babel', 'scaffold-minimum']); - }); - - it('sets features with overwrite on typescript', async() => { - const result = await selectFeatures(['typescript'], {unattended: true}); - expect(result).toEqual(['webpack', 'http1', 'web', 'typescript', 'scaffold-minimum']); - }); - - it('sets features with overwrite on bundler', async() => { - const result = await selectFeatures(['typescript', 'cli-bundler'], {unattended: true}); - expect(result).toEqual(['cli-bundler', 'requirejs', 'web', 'typescript', 'scaffold-minimum']); - }); - - it('sets features with overwrite on bundler and loader', async() => { - const result = await selectFeatures(['typescript', 'cli-bundler', 'alameda'], {unattended: true}); - expect(result).toEqual(['cli-bundler', 'alameda', 'web', 'typescript', 'scaffold-minimum']); - }); - - it('sets features with conflicting overwrites, only honour the last choice', async() => { - const result = await selectFeatures(['webpack', 'cli-bundler'], {unattended: true}); - expect(result).toEqual(['cli-bundler', 'requirejs', 'web', 'babel', 'scaffold-minimum']); - }); - - it('sets features with conflicting overwrites, only honour the last choice', async() => { - const result = await selectFeatures(['webpack', 'alameda', 'systemjs', 'cli-bundler'], {unattended: true}); - expect(result).toEqual(['cli-bundler', 'systemjs', 'web', 'babel', 'scaffold-minimum']); - }); - - it('sets features with multiple overwrites', async() => { - const result = await selectFeatures([ - 'postcss-basic', - 'sass', - 'karma', - 'htmlmin-min', - 'cli-bundler', - 'vscode', - 'scaffold-navigation' - ], {unattended: true}); - expect(result).toEqual([ - 'cli-bundler', - 'requirejs', - 'web', - 'babel', - 'htmlmin-min', - 'sass', - 'postcss-basic', - 'karma', - 'vscode', - 'scaffold-navigation' - ]); - }); - }); - - describe('in interactive mode', () => { - it('gets default esnext features', async() => { - const result = await selectFeatures(undefined, {}, [ - 1 // default esnext app - ]); - - expect(result).toEqual(['webpack', 'http1', 'web', 'babel', 'jest', 'vscode', 'scaffold-minimum']); - }); - - it('gets default typescript features', async() => { - const result = await selectFeatures(undefined, {}, [ - 2 // default typescript app - ]); - - expect(result).toEqual(['webpack', 'http1', 'web', 'typescript', 'jest', 'vscode', 'scaffold-minimum']); - }); - - it('gets customised features', async() => { - const result = await selectFeatures(undefined, {}, [ - 3, // custom app - 1, // webpack - 2, // http2 - 2, // dotnet-core - 1, // babel - 2, // htmlmin-min - 4, // stylus - 3, // postcss-typical - 2, // karma - 3, // cypress - 1, // no editor - 2, // scaffold-navigation - 1 // no docker file - ]); - - expect(result).toEqual([ - 'webpack', - 'http2', - 'dotnet-core', - 'babel', - 'htmlmin-min', - 'stylus', - 'postcss-typical', - 'karma', - 'cypress', - 'scaffold-navigation' - ]); - }); - - it('gets customised features (cli bundler)', async() => { - const result = await selectFeatures(undefined, {}, [ - 3, // custom app - 2, // cli-bundler - 2, // alameda - 1, // web - 2, // typescript - 1, // no htmlmin - 2, // less - 2, // postcss-basic - 1, // no unit test - 2, // protractor - 1, // no editor - 1, // scaffold-minimum - 2 // docker file - ]); - - expect(result).toEqual([ - 'cli-bundler', - 'alameda', - 'web', - 'typescript', - 'less', - 'postcss-basic', - 'protractor', - 'scaffold-minimum', - 'docker' - ]); - }); - - it('gets all default customised features', async() => { - const result = await selectFeatures(undefined, {}, [ - 3, // custom app - 1, // webpack - 1, // http1 - 1, // web - 1, // babel - 1, // no htmlmin - 1, // css - 1, // no postcss - 1, // no unit test - 1, // no e2e test - 1, // no editor - 1, // scaffold-minimum - 1 // no docker file - ]); - - expect(result).toEqual(['webpack', 'http1', 'web', 'babel', 'scaffold-minimum']); - }); - - it('gets customised features with overwrites that skips some questions', async() => { - const result = await selectFeatures(['webpack', 'http2', 'stylus', 'karma', 'cypress'], {}, [ - // First workflow question is skipped - 2, // dotnet-core - 1, // babel - 2, // htmlmin-min - 3, // postcss-typical - 2, // vscode - 2, // scaffold-navigation - 2 // docker - ]); - - expect(result).toEqual([ - 'webpack', - 'http2', - 'dotnet-core', - 'babel', - 'htmlmin-min', - 'stylus', - 'postcss-typical', - 'karma', - 'cypress', - 'vscode', - 'scaffold-navigation', - 'docker' - ]); - }); - }); -}); - -describe('The selectFeatures for plugin project', () => { - describe('in unattended mode', () => { - it('sets default esnext features', async() => { - const result = await selectFeatures(undefined, {unattended: true, plugin: true}); - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'babel', 'plugin-scaffold-minimum']); - }); - - it('sets features with overwrite on typescript', async() => { - const result = await selectFeatures(['typescript'], {unattended: true, plugin: true}); - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'typescript', 'plugin-scaffold-minimum']); - }); - - it('cannot overwrite bundler', async() => { - const result = await selectFeatures(['webpack'], {unattended: true, plugin: true}); - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'babel', 'plugin-scaffold-minimum']); - }); - - it('cannot overwrite loader', async() => { - const result = await selectFeatures(['systemjs'], {unattended: true, plugin: true}); - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'babel', 'plugin-scaffold-minimum']); - }); - - it('sets features with multiple overwrites', async() => { - const result = await selectFeatures([ - 'postcss-basic', - 'sass', - 'karma', - 'htmlmin-min', - 'vscode', - 'scaffold-navigation', // this is ignore because not in plugin questionnaire - 'plugin-scaffold-basic' - ], {unattended: true, plugin: true}); - expect(result).toEqual([ - 'plugin', - 'cli-bundler', - 'requirejs', - 'web', - 'babel', - 'htmlmin-min', - 'sass', - 'postcss-basic', - 'karma', - 'vscode', - 'plugin-scaffold-basic' - ]); - }); - }); - - describe('in interactive mode', () => { - it('gets default esnext features', async() => { - const result = await selectFeatures(undefined, {plugin: true}, [ - 1 // default esnext plugin - ]); - - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'babel', 'jest', 'vscode', 'plugin-scaffold-minimum']); - }); - - it('gets default typescript features', async() => { - const result = await selectFeatures(undefined, {plugin: true}, [ - 2 // default typescript plugin - ]); - - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'typescript', 'jest', 'vscode', 'plugin-scaffold-minimum']); - }); - - it('gets customised features', async() => { - const result = await selectFeatures(undefined, {plugin: true}, [ - 3, // custom app - 1, // babel - 2, // htmlmin-min - 4, // stylus - 3, // postcss-typical - 2, // karma - 1, // no editor - 2 // plugin-scaffold-basic - ]); - - expect(result).toEqual([ - 'plugin', - 'cli-bundler', - 'requirejs', - 'web', - 'babel', - 'htmlmin-min', - 'stylus', - 'postcss-typical', - 'karma', - 'plugin-scaffold-basic' - ]); - }); - - it('gets all default customised features', async() => { - const result = await selectFeatures(undefined, {plugin: true}, [ - 3, // custom app - 1, // babel - 1, // no htmlmin - 1, // css - 1, // no postcss - 1, // no unit test - 1, // no editor - 1 // plugin-scaffold-minimum - ]); - - expect(result).toEqual(['plugin', 'cli-bundler', 'requirejs', 'web', 'babel', 'plugin-scaffold-minimum']); - }); - - it('gets customised features with overwrites that skips some questions', async() => { - const result = await selectFeatures(['stylus', 'karma'], {plugin: true}, [ - // First workflow question is skipped - 1, // babel - 2, // htmlmin-min - 3, // postcss-typical - 2, // vscode - 2 // plugin-scaffold-basic - ]); - - expect(result).toEqual([ - 'plugin', - 'cli-bundler', - 'requirejs', - 'web', - 'babel', - 'htmlmin-min', - 'stylus', - 'postcss-typical', - 'karma', - 'vscode', - 'plugin-scaffold-basic' - ]); - }); - }); -}); diff --git a/spec/lib/workflow/write-project/prepare-project.spec.js b/spec/lib/workflow/write-project/prepare-project.spec.js deleted file mode 100644 index e6c172bf7..000000000 --- a/spec/lib/workflow/write-project/prepare-project.spec.js +++ /dev/null @@ -1,527 +0,0 @@ -const prepareProject = require('../../../../lib/workflow/write-project/prepare-project'); -const {getSupportedVersion} = require('../../../../lib/dependencies'); -const mockfs = require('mock-fs'); -const through2 = require('through2'); - -const gatherFiles = function(box) { - return through2.obj((file, enc, cb) => { - if (file.isBuffer()) { - box[file.relative.replace(/\\/g, '/')] = { - contents: file.contents.toString('utf8'), - writePolicy: file.writePolicy || null - }; - } - cb(); - }); -}; - -describe('The prepareProject func', () => { - beforeEach(() => { - mockfs({}); - }); - - afterEach(() => { - mockfs.restore(); - }); - - it('merges all features folders', done => { - mockfs({ - 'skeleton/common/file-a.js': 'file-a', - 'skeleton/feature1/file-b.js': 'file-b', - 'skeleton/feature1/folder/file-b2.js': 'file-b2', - 'skeleton/feature2/file-c.json': '{"file":"c"}', - 'skeleton/feature3/file-d.js': 'file-d' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'file-a.js': {contents: 'file-a', writePolicy: null}, - 'file-b.js': {contents: 'file-b', writePolicy: null}, - 'file-c.json': {contents: '{\n "file": "c"\n}', writePolicy: null}, - 'folder/file-b2.js': {contents: 'file-b2', writePolicy: null} - }); - done(); - }); - }); - - it('extracts write policy from file name', done => { - mockfs({ - 'skeleton/common/file-a.js__skip-if-exists': 'file-a', - 'skeleton/feature1/file-b.js': 'file-b', - 'skeleton/feature1/folder/file-b2.js__append-if-exists': 'file-b2', - 'skeleton/feature2/file-c.json__ask-if-exists': '{"file":"c"}', - 'skeleton/feature3/file-d.js': 'file-d' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'file-a.js': {contents: 'file-a', writePolicy: 'skip'}, - 'file-b.js': {contents: 'file-b', writePolicy: null}, - 'file-c.json': {contents: '{\n "file": "c"\n}', writePolicy: 'ask'}, - 'folder/file-b2.js': {contents: 'file-b2', writePolicy: 'append'} - }); - done(); - }); - }); - - it('filters by filename condition', done => { - mockfs({ - 'skeleton/common/.file-a.js__if_feature1_and_feature2': 'file-a', - 'skeleton/common/file-a2.js__if_feature3': 'file-a2', - 'skeleton/feature1/file-b.js__if_feature2': 'file-b', - 'skeleton/feature1/folder/file-b2.js__if_not_feature2_or_not_feature3': 'file-b2', - 'skeleton/feature1/folder/file-b3.js__if_not_feature3': 'file-b3', - 'skeleton/feature2/file-c.json': '{"file":"c"}', - 'skeleton/feature3/file-d.js': 'file-d' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - '.file-a.js': {contents: 'file-a', writePolicy: null}, - 'file-b.js': {contents: 'file-b', writePolicy: null}, - 'file-c.json': {contents: '{\n "file": "c"\n}', writePolicy: null}, - 'folder/file-b2.js': {contents: 'file-b2', writePolicy: null}, - 'folder/file-b3.js': {contents: 'file-b3', writePolicy: null} - }); - done(); - }); - }); - - it('filters by folder condition', done => { - mockfs({ - 'skeleton/common/f1__if_a/f2__if_b/app.js__if_c': 'app-abc', - 'skeleton/common/f1__if_a/f2__if_b/app.js__if_d': 'app-abd', - 'skeleton/common/f1__if_a/f2/main.js__if_b': 'main-ab', - 'skeleton/common/f1/f2__if_d/main.js__if_b': 'main-db' - }); - - const box = {}; - prepareProject('aurelia-app', ['a', 'b', 'c'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'f1/f2/app.js': {contents: 'app-abc', writePolicy: null}, - 'f1/f2/main.js': {contents: 'main-ab', writePolicy: null} - }); - done(); - }); - }); - - it('filters by filename conditioni, and extracts write policy from file name', done => { - mockfs({ - 'skeleton/common/file-a.js__if_feature1_and_feature2__skip-if-exists': 'file-a', - 'skeleton/common/file-a2.js__ask-if-exists__if_feature3': 'file-a2', - 'skeleton/feature1/file-b.js__ask-if-exists__if_feature2': 'file-b', - 'skeleton/feature1/folder/file-b2.js__if_not_feature2_or_not_feature3__append-if-exists': 'file-b2', - 'skeleton/feature1/folder/file-b3.js__if_not_feature3__append-if-exists': 'file-b3', - 'skeleton/feature2/file-c.json': '{"file":"c"}', - 'skeleton/feature3/file-d.js': 'file-d' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'file-a.js': {contents: 'file-a', writePolicy: 'skip'}, - 'file-b.js': {contents: 'file-b', writePolicy: 'ask'}, - 'file-c.json': {contents: '{\n "file": "c"\n}', writePolicy: null}, - 'folder/file-b2.js': {contents: 'file-b2', writePolicy: 'append'}, - 'folder/file-b3.js': {contents: 'file-b3', writePolicy: 'append'} - }); - done(); - }); - }); - - - it('preprocesses file content, with projectName and features', done => { - const fileA = `// @if feat.feature1 -feature1 -// @endif -// @if feat.feature2 -feature2 -// @endif`; - const fileB2 = ``; - const fileC = `{ -// @if feat.feature1 -"feature1": true -// @endif -// @if feat.feature3 -"feature3": true -// @endif -}`; - mockfs({ - 'skeleton/common/file-a.js__if_feature1_and_feature2': fileA, - 'skeleton/common/file-a2.js__if_feature3': 'file-a2', - 'skeleton/feature1/file-b.js__if_feature2': 'file-b', - 'skeleton/feature1/folder/file-b2.html__if_not_feature2_or_not_feature3': fileB2, - 'skeleton/feature1/folder/file-b3.js__if_not_feature3': 'file-b3', - 'skeleton/feature2/file-c.json': fileC, - 'skeleton/feature3/file-d.js': 'file-d' - }); - - const box = {}; - prepareProject('Aurelia App', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'file-a.js': {contents: 'feature1\nfeature2\n', writePolicy: null}, - 'file-b.js': {contents: 'file-b', writePolicy: null}, - 'file-c.json': {contents: '{\n "feature1": true\n}', writePolicy: null}, - 'folder/file-b2.html': {contents: '', writePolicy: null}, - 'folder/file-b3.js': {contents: 'file-b3', writePolicy: null} - }); - done(); - }); - }); - - it('Rename file.ext to file.js if feature babel is in use', done => { - mockfs({ - 'skeleton/common/file.ext': `// @if feat.babel -babel-file.js -// @endif -// @if feat.typescript -typescript-file.ts -// @endif -`, - 'skeleton/feature1/folder/foo.ext': `// @if feat.babel -babel-folder/foo.js -// @endif -// @if feat.typescript -typescript-folder/foo.ts -// @endif -` - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'babel'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'file.js': {contents: 'babel-file.js\n', writePolicy: null}, - 'folder/foo.js': {contents: 'babel-folder/foo.js\n', writePolicy: null} - }); - done(); - }); - }); - - it('Rename file.ext to file.ts if feature typescript is in use', done => { - mockfs({ - 'skeleton/common/file.ext': `// @if feat.babel -babel-file.js -// @endif -// @if feat.typescript -typescript-file.ts -// @endif -`, - 'skeleton/feature1/folder/foo.ext': `// @if feat.babel -babel-folder/foo.js -// @endif -// @if feat.typescript -typescript-folder/foo.ts -// @endif -` - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'typescript'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'file.ts': {contents: 'typescript-file.ts\n', writePolicy: null}, - 'folder/foo.ts': {contents: 'typescript-folder/foo.ts\n', writePolicy: null} - }); - done(); - }); - }); - - it('merges package.json', done => { - mockfs({ - 'skeleton/common/package.json': '{"name": "aurelia-app","dependencies":{"aurelia-cli":""}}', - 'skeleton/feature1/package.json': '{"dependencies":{"bar":"","foo":""}}', - 'skeleton/feature2/package.json': '{"dependencies":{"bar":"^2.1.3"}}' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(Object.keys(box)).toEqual(['package.json']); - expect(box['package.json'].writePolicy).toBe(null); - - expect(JSON.parse(box['package.json'].contents)).toEqual({ - name: 'aurelia-app', - dependencies: { - 'aurelia-cli': getSupportedVersion('aurelia-cli'), - bar: '^2.1.3', - foo: 'latest' - } - }); - done(); - }); - }); - - it('merges aurelia.json', done => { - mockfs({ - 'skeleton/common/aurelia_project/aurelia.json': ` - { - "name": "aurelia-app", - "type": "project:application", - "bundler": { - "id": "cli", - "displayName": "Aurelia-CLI" - } - } - `, - 'skeleton/cli-bundler/aurelia_project/aurelia.json': ` - { - // @if feat.babel - "transpiler": { - "id": "babel", - "displayName": "Babel", - "fileExtension": ".js", - "options": { - "plugins": [ - [ - "@babel/plugin-transform-modules-amd", - { - "loose": true - } - ] - ] - }, - }, - // @endif - // @if feat.typescript - "transpiler": { - "id": "typescript", - "displayName": "TypeScript", - "fileExtension": ".ts", - "dtsSource": [ - "./types/**/*.d.ts" - ], - "source": "src/**/*.ts" - }, - // @endif - "build": { - "loader": { - // @if feat.requirejs - "type": "require", - // @endif - // @if feat.systemjs - "type": "system", - // @endif - "configTarget": "vendor-bundle.js", - "includeBundleMetadataInConfig": "auto", - "plugins": [ - { - "name": "text", - "extensions": [ - ".html", - ".css" - ], - "stub": true - } - ] - }, - "bundles": [ - { - "name": "app-bundle.js", - "source": [ - "**/*.{js,json,css,html}" - ] - }, - { - "name": "vendor-bundle.js", - "prepend": [ - // @if feat.requirejs - "node_modules/requirejs/requirejs.js" - // @endif - // @if feat.systemjs - "node_modules/systemjs/dist/system.js" - // @endif - ], - "dependencies": [ - "aurelia-bootstrapper", - "aurelia-loader-default", - "aurelia-pal-browser", - { - "name": "aurelia-testing", - "env": "dev" - }, - // @if feat.requirejs - "text" - // @endif - // @if feat.systemjs - { - "name": "text", - "path": "../node_modules/systemjs-plugin-text", - "main": "text" - } - // @endif - ] - } - ] - } - } - `, - 'skeleton/lorem/aurelia_project/aurelia.json': ` - { - "build": { - "bundles": [ - { - "name": "vendor-bundle.js", - "prepend": [ - "node_modules/lorem/boot.js" - ], - "dependencies": [ - "lorem" - ] - } - ] - } - } - ` - }); - - const box = {}; - prepareProject('aurelia-app', ['cli-bundler', 'requirejs', 'babel', 'lorem'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(Object.keys(box)).toEqual(['aurelia_project/aurelia.json']); - expect(box['aurelia_project/aurelia.json'].writePolicy).toBe(null); - - expect(JSON.parse(box['aurelia_project/aurelia.json'].contents)).toEqual({ - name: 'aurelia-app', - type: 'project:application', - bundler: { - id: 'cli', - displayName: 'Aurelia-CLI' - }, - transpiler: { - id: 'babel', - displayName: 'Babel', - fileExtension: '.js', - options: { - plugins: [ - [ - '@babel/plugin-transform-modules-amd', - { - loose: true - } - ] - ] - } - }, - build: { - loader: { - type: 'require', - configTarget: 'vendor-bundle.js', - includeBundleMetadataInConfig: 'auto', - plugins: [ - { - name: 'text', - extensions: [ - '.html', - '.css' - ], - stub: true - } - ] - }, - bundles: [ - { - name: 'app-bundle.js', - source: [ - '**/*.{js,json,css,html}' - ] - }, - { - name: 'vendor-bundle.js', - prepend: [ - 'node_modules/lorem/boot.js', - 'node_modules/requirejs/requirejs.js' - ], - dependencies: [ - 'lorem', - 'aurelia-bootstrapper', - 'aurelia-loader-default', - 'aurelia-pal-browser', - { - name: 'aurelia-testing', - env: 'dev' - }, - 'text' - ] - } - ] - } - }); - done(); - }); - }); - - it('merges README.md', done => { - mockfs({ - 'skeleton/common/README.md': 'common', - 'skeleton/feature1/README.md': 'feature1', - 'skeleton/feature2/README.md': 'feature2' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'README.md': {contents: 'common\nfeature1\nfeature2', writePolicy: null} - }); - done(); - }); - }); - - it('takes last overwrite, retain write policy', done => { - mockfs({ - 'skeleton/common/some-file': 'common', - 'skeleton/feature1/some-file__skip-if-exists': 'feature1', - 'skeleton/feature2/some-file': 'feature2' - }); - - const box = {}; - prepareProject('aurelia-app', ['feature1', 'feature2'], 'skeleton') - .pipe(gatherFiles(box)) - .once('error', done) - .on('finish', () => { - expect(box).toEqual({ - 'some-file': {contents: 'feature2', writePolicy: 'skip'} - }); - done(); - }); - }); -}); diff --git a/spec/lib/workflow/write-project/write-project.spec.js b/spec/lib/workflow/write-project/write-project.spec.js deleted file mode 100644 index 0de97a4a3..000000000 --- a/spec/lib/workflow/write-project/write-project.spec.js +++ /dev/null @@ -1,311 +0,0 @@ -const prepareProject = require('../../../../lib/workflow/write-project/prepare-project'); -const writeProject = require('../../../../lib/workflow/write-project/write-project'); -const mockfs = require('mock-fs'); -const fs = require('../../../../lib/file-system'); -const path = require('path'); - -describe('The writeProejct func', () => { - beforeEach(() => { - mockfs({}); - }); - - afterEach(() => { - mockfs.restore(); - }); - - it('overwrites existing file by default', done => { - mockfs({ - 'skeleton/common/file.js': 'new-file', - 'skeleton/common/f/file2.js': 'new-file2', - 'output/file.js': 'file', - 'output/f/file2.js': 'file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['f', 'file.js']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('new-file'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js'), 'utf8')).toBe('new-file2'); - done(); - }); - }); - - it('can skip existing file', done => { - mockfs({ - 'skeleton/common/file.js__skip-if-exists': 'new-file', - 'skeleton/common/f/file2.js__skip-if-exists': 'new-file2', - 'output/file.js': 'file', - 'output/f/file2.js': 'file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['f', 'file.js']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('file'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js'), 'utf8')).toBe('file2'); - done(); - }); - }); - - it('can append existing file', done => { - mockfs({ - 'skeleton/common/file.js__append-if-exists': 'new-file', - 'skeleton/common/f/file2.js__append-if-exists': 'new-file2', - 'output/file.js': 'file', - 'output/f/file2.js': 'file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['f', 'file.js']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('filenew-file'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js'), 'utf8')).toBe('file2new-file2'); - done(); - }); - }); - - it('in unattended mode, ask-if-exists will keep existing file, but generate new file with suffix', done => { - mockfs({ - 'skeleton/common/file.js__ask-if-exists': 'new-file', - 'skeleton/common/f/file2.js__ask-if-exists': 'new-file2', - 'output/file.js': 'file', - 'output/f/file2.js': 'file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output', {unattended: true})) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['f', 'file.js', 'file.js__au-cli']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('file'); - expect(fs.readFileSync(path.join('output', 'file.js__au-cli'), 'utf8')).toBe('new-file'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js'), 'utf8')).toBe('file2'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js__au-cli'), 'utf8')).toBe('new-file2'); - done(); - }); - }); - - it('in interactive mode, ask-if-exists will ask user, simulate selection of "keep the existing file"', done => { - mockfs({ - 'skeleton/common/file.js__ask-if-exists': 'new-file', - 'skeleton/common/f/file2.js__ask-if-exists': 'new-file2', - 'output/file.js': 'file', - 'output/f/file2.js': 'file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output', {_question: () => Promise.resolve(false)})) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['f', 'file.js', 'file.js__au-cli']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('file'); - expect(fs.readFileSync(path.join('output', 'file.js__au-cli'), 'utf8')).toBe('new-file'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js'), 'utf8')).toBe('file2'); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js__au-cli'), 'utf8')).toBe('new-file2'); - done(); - }); - }); - - it('in interactive mode, ask-if-exists will ask user, simulate selection of "replace the existing file"', done => { - mockfs({ - 'skeleton/common/file.js__ask-if-exists': 'new-file', - 'skeleton/common/f/file2.js__ask-if-exists': 'new-file2', - 'output/file.js': 'file', - 'output/f/file2.js': 'file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output', {_question: () => Promise.resolve(true)})) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['f', 'file.js']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('new-file'); - expect(fs.readdirSync(path.join('output', 'f')).sort()).toEqual(['file2.js']); - expect(fs.readFileSync(path.join('output', 'f', 'file2.js'), 'utf8')).toBe('new-file2'); - done(); - }); - }); - - it('appends readme by default, but can overwrite the behaviour', done => { - mockfs({ - 'skeleton/common/a-readme': 'new-a\n', - 'skeleton/common/b-readme.md__skip-if-exists': 'new-b\n', - 'output/a-readme': 'old-a\n', - 'output/b-readme.md': 'old-b\n' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['a-readme', 'b-readme.md']); - expect(fs.readFileSync(path.join('output', 'a-readme'), 'utf8')).toBe('old-a\nnew-a\n'); - expect(fs.readFileSync(path.join('output', 'b-readme.md'), 'utf8')).toBe('old-b\n'); - done(); - }); - }); - - it('merges deps for package.json', done => { - mockfs({ - 'skeleton/common/package.json': ` - { - "name": "aurelia-app", - "dependencies": { - "aurelia-bootstrapper": "^1.0.0" - }, - "devDependencies": { - "aurelia-cli": "^1.0.0", - "gulp": "^4.0.0" - }, - "peerDependencies": { - "foo": "^1.0.0" - } - } - `, - 'output/package.json': ` - { - "name": "awesome-app", - "dependencies": { - "awesome": "^1.0.0" - }, - "devDependencies": { - "tool": "^2.0.0" - } - } - ` - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['package.json']); - const writtenJson = fs.readFileSync(path.join('output', 'package.json'), 'utf8'); - expect(JSON.parse(writtenJson)).toEqual({ - name: 'awesome-app', - dependencies: { - awesome: '^1.0.0', - 'aurelia-bootstrapper': '^1.0.0' - }, - devDependencies: { - tool: '^2.0.0', - 'aurelia-cli': '^1.0.0', - gulp: '^4.0.0' - }, - peerDependencies: { - foo: '^1.0.0' - } - }); - done(); - }); - }); - - it('skips project.csproj if project.csproj file exists', done => { - mockfs({ - 'skeleton/common/project.csproj': 'new csproj', - 'output/project.csproj': 'csproj' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['project.csproj']); - expect(fs.readFileSync(path.join('output', 'project.csproj'), 'utf8')).toBe('csproj'); - done(); - }); - }); - - it('skips project.csproj if any .csproj file exists', done => { - mockfs({ - 'skeleton/common/project.csproj': 'new csproj', - 'output/some.csproj': 'csproj' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['some.csproj']); - expect(fs.readFileSync(path.join('output', 'some.csproj'), 'utf8')).toBe('csproj'); - done(); - }); - }); - - it('writes project.csproj if no .csproj file exists', done => { - mockfs({ - 'skeleton/common/project.csproj': 'new csproj' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['project.csproj']); - expect(fs.readFileSync(path.join('output', 'project.csproj'), 'utf8')).toBe('new csproj'); - done(); - }); - }); - - it('does not write instructions if file is not skipped', done => { - mockfs({ - 'skeleton/common/file.js__instructions': 'do something', - 'skeleton/common/file.js__skip-if-exists': 'new file' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['file.js']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('new file'); - done(); - }); - }); - - it('writes instructions if file is skipped', done => { - mockfs({ - 'skeleton/common/file.js__instructions': 'do something', - 'skeleton/common/file.js__skip-if-exists': 'new file', - 'output/file.js': 'old file' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['file.js', 'instructions.txt']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('old file'); - expect(fs.readFileSync(path.join('output', 'instructions.txt'), 'utf8')).toBe('do something'); - done(); - }); - }); - - it('merges instructions if multiple files are skipped', done => { - mockfs({ - 'skeleton/common/file.js__instructions': 'do something', - 'skeleton/common/file.js__skip-if-exists': 'new file', - 'skeleton/common/file2.js__instructions': 'do something2', - 'skeleton/common/file2.js__skip-if-exists': 'new file2', - 'output/file.js': 'old file', - 'output/file2.js': 'old file2' - }); - - prepareProject('aurelia-app', [], 'skeleton') - .pipe(writeProject('output')) - .once('error', done) - .on('finish', () => { - expect(fs.readdirSync('output').sort()).toEqual(['file.js', 'file2.js', 'instructions.txt']); - expect(fs.readFileSync(path.join('output', 'file.js'), 'utf8')).toBe('old file'); - expect(fs.readFileSync(path.join('output', 'file2.js'), 'utf8')).toBe('old file2'); - expect(fs.readFileSync(path.join('output', 'instructions.txt'), 'utf8')).toBe('do something\ndo something2'); - done(); - }); - }); -}); diff --git a/wallaby.conf.js b/wallaby.conf.js index 786cac139..6aaf7abbd 100644 --- a/wallaby.conf.js +++ b/wallaby.conf.js @@ -2,7 +2,6 @@ module.exports = function() { return { files: [ 'lib/**/*.js', - '!lib/resources/generators/**/*', 'package.json', {pattern: 'spec/mocks/**/*', load: false}, {pattern: 'spec/helpers/polyfills.js', load: false}