refactor(ct-angular): bump to Angular 17 and move out analogjs plugin
Co-authored-by: Edouard Bozon <bozonedouard@gmail.com>
This commit is contained in:
parent
d5aa4d5604
commit
0cb6fe3337
4155
package-lock.json
generated
4155
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -14,4 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
module.exports = require('@playwright/experimental-ct-core/cli');
|
||||
|
||||
const { program } = require('@playwright/experimental-ct-core/lib/program');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
|
|
|||
|
|
@ -14,25 +14,23 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const { test, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/experimental-ct-core');
|
||||
const path = require('path');
|
||||
|
||||
const { test, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/experimental-ct-core');
|
||||
|
||||
process.env['NODE_ENV'] = 'test';
|
||||
|
||||
function plugin() {
|
||||
// Only fetch upon request to avoid resolution in workers.
|
||||
const { createPlugin } = require('@playwright/experimental-ct-core/lib/vitePlugin');
|
||||
return createPlugin(
|
||||
path.join(__dirname, 'registerSource.mjs'),
|
||||
() => import('@analogjs/vite-plugin-angular').then(plugin => {
|
||||
// TODO: remove the typeof plugin.default check
|
||||
if (typeof plugin.default === 'function')
|
||||
return plugin.default({ jit: false });
|
||||
return plugin.default.default({ jit: false });
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const defineConfig = config => originalDefineConfig({ ...config, _plugins: [plugin] });
|
||||
const defineConfig = (config, ...configs) => {
|
||||
return originalDefineConfig({
|
||||
...config,
|
||||
'@playwright/test': {
|
||||
packageJSON: require.resolve('./package.json'),
|
||||
},
|
||||
'@playwright/experimental-ct-core': {
|
||||
registerSourceFile: path.join(__dirname, 'registerSource.mjs'),
|
||||
frameworkPluginFactory: () => {},
|
||||
},
|
||||
}, ...configs);
|
||||
};
|
||||
|
||||
module.exports = { test, expect, devices, defineConfig };
|
||||
|
|
|
|||
|
|
@ -29,20 +29,18 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@analogjs/vite-plugin-angular": "0.2.28",
|
||||
"@angular-devkit/build-angular": "^16.1.0",
|
||||
"@playwright/experimental-ct-core": "1.42.0-next",
|
||||
"vite": "^4.4.9"
|
||||
"@angular-devkit/build-angular": "^17.0.0",
|
||||
"@playwright/experimental-ct-core": "1.42.0-next"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/animations": "^16.1.7",
|
||||
"@angular/common": "^16.1.7",
|
||||
"@angular/compiler": "^16.1.7",
|
||||
"@angular/compiler-cli": "^16.1.7",
|
||||
"@angular/core": "^16.1.7",
|
||||
"@angular/platform-browser": "^16.1.7",
|
||||
"@angular/platform-browser-dynamic": "^16.1.7",
|
||||
"@angular/router": "^16.1.7",
|
||||
"@angular/animations": "^17.0.0",
|
||||
"@angular/common": "^17.0.0",
|
||||
"@angular/compiler": "^17.0.0",
|
||||
"@angular/compiler-cli": "^17.0.0",
|
||||
"@angular/core": "^17.0.0",
|
||||
"@angular/platform-browser": "^17.0.0",
|
||||
"@angular/platform-browser-dynamic": "^17.0.0",
|
||||
"@angular/router": "^17.0.0",
|
||||
"@playwright/test": "1.38.1",
|
||||
"rxjs": "~7.8.1",
|
||||
"tslib": "^2.5.0",
|
||||
|
|
@ -51,11 +49,11 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@playwright/test": ">=1.38.1",
|
||||
"typescript": ">=4.9.3",
|
||||
"@angular/common": ">=15.1.0 || >=16.0.0",
|
||||
"@angular/platform-browser": ">=15.1.0 || >=16.0.0",
|
||||
"@angular/router": ">=15.1.0 || >=16.0.0",
|
||||
"@angular/core": ">=15.1.0 || >=16.0.0"
|
||||
"typescript": ">=5.2.0",
|
||||
"@angular/common": "^17.0.0",
|
||||
"@angular/platform-browser": "^17.0.0",
|
||||
"@angular/router": "^17.0.0",
|
||||
"@angular/core": "^17.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "./cli.js"
|
||||
|
|
|
|||
|
|
@ -11,22 +11,24 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "^15.1.0",
|
||||
"@angular/common": "^15.1.0",
|
||||
"@angular/compiler": "^15.1.0",
|
||||
"@angular/core": "^15.1.0",
|
||||
"@angular/forms": "^15.1.0",
|
||||
"@angular/platform-browser": "^15.1.0",
|
||||
"@angular/platform-browser-dynamic": "^15.1.0",
|
||||
"@angular/router": "^15.1.0",
|
||||
"@analogjs/vite-plugin-angular": "0.2.39",
|
||||
"@angular/animations": "^17.0.0",
|
||||
"@angular/common": "^17.0.0",
|
||||
"@angular/compiler": "^17.0.0",
|
||||
"@angular/core": "^17.0.0",
|
||||
"@angular/forms": "^17.0.0",
|
||||
"@angular/platform-browser": "^17.0.0",
|
||||
"@angular/platform-browser-dynamic": "^17.0.0",
|
||||
"@angular/router": "^17.0.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.12.0"
|
||||
"zone.js": "~0.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^15.1.0",
|
||||
"@angular/cli": "~15.1.0",
|
||||
"@angular/compiler-cli": "^15.1.0",
|
||||
"typescript": "~4.9.4"
|
||||
"@angular-devkit/build-angular": "^17.0.0",
|
||||
"@angular/cli": "~17.0.0",
|
||||
"@angular/compiler-cli": "^17.0.0",
|
||||
"typescript": "~5.2.0",
|
||||
"vite": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import analogVitePlugin from '@analogjs/vite-plugin-angular';
|
||||
import { defineConfig, devices } from '@playwright/experimental-ct-angular';
|
||||
import { resolve } from 'path';
|
||||
|
||||
|
|
@ -25,6 +26,9 @@ export default defineConfig({
|
|||
use: {
|
||||
trace: 'on-first-retry',
|
||||
ctViteConfig: {
|
||||
plugins: [
|
||||
...analogVitePlugin()
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('./src'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue