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