Skip to content

Commit 86f5998

Browse files
authored
feat: use mako
feat: use mako
2 parents 3736e38 + 07a233b commit 86f5998

File tree

19 files changed

+608
-184
lines changed

19 files changed

+608
-184
lines changed

.changeset/config.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@examples/legacy",
2424
"@example/lint",
2525
"@examples/locale",
26+
"@examples/mako",
2627
"@examples/min",
2728
"@examples/mobile2",
2829
"@examples/mobile5",

.changeset/quiet-rivers-chew.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@alita/plugin-lowcode': minor
3+
'create-alita': minor
4+
'@alita/plugin-azure': minor
5+
'@alita/autoimport': minor
6+
'@alita/plugins': minor
7+
'@alita/native': minor
8+
'alita': minor
9+
---
10+
11+
feat: use mako

examples/mako/.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PORT=9999

examples/mako/config/config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'alita';
2+
3+
export default defineConfig({
4+
appType: 'pc',
5+
keepalive: [/./],
6+
mako: {},
7+
});

examples/mako/e2e/boilerplate.test.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
test.beforeEach(async ({ page }) => {
4+
await page.goto('http://localhost:9999/');
5+
});
6+
7+
test.describe('basic', () => {
8+
test('render', async ({ page }) => {
9+
await expect(page.getByText('Hello Mako')).toBeVisible();
10+
});
11+
});

examples/mako/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@examples/mako",
3+
"private": true,
4+
"scripts": {
5+
"dev": "alita dev",
6+
"build": "alita build",
7+
"plugin": "alita plugin list",
8+
"test:e2e": "start-test dev :9999/__umi/api/status test:pw",
9+
"test:pw": "playwright test",
10+
"start": "npm run dev"
11+
},
12+
"dependencies": {
13+
"alita": "workspace:*"
14+
}
15+
}

examples/mako/playwright.config.ts

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
3+
/**
4+
* Read environment variables from file.
5+
* https://github.com/motdotla/dotenv
6+
*/
7+
// require('dotenv').config();
8+
9+
/**
10+
* See https://playwright.dev/docs/test-configuration.
11+
*/
12+
export default defineConfig({
13+
testDir: './e2e',
14+
/* Maximum time one test can run for. */
15+
timeout: 30 * 1000,
16+
expect: {
17+
/**
18+
* Maximum time expect() should wait for the condition to be met.
19+
* For example in `await expect(locator).toHaveText();`
20+
*/
21+
timeout: 5000,
22+
},
23+
/* Run tests in files in parallel */
24+
fullyParallel: true,
25+
/* Fail the build on CI if you accidentally left test.only in the source code. */
26+
forbidOnly: !!process.env.CI,
27+
/* Retry on CI only */
28+
retries: process.env.CI ? 2 : 0,
29+
/* Opt out of parallel tests on CI. */
30+
workers: process.env.CI ? 1 : undefined,
31+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
32+
reporter: 'html',
33+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
34+
use: {
35+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
36+
actionTimeout: 0,
37+
/* Base URL to use in actions like `await page.goto('/')`. */
38+
// baseURL: 'http://localhost:8000',
39+
40+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
41+
trace: 'on-first-retry',
42+
43+
// See https://playwright.dev/docs/network#missing-network-events-and-service-workers
44+
serviceWorkers: 'block',
45+
},
46+
47+
/* Configure projects for major browsers */
48+
projects: [
49+
{
50+
name: 'chromium',
51+
use: { ...devices['Desktop Chrome'] },
52+
},
53+
54+
// {
55+
// name: 'firefox',
56+
// use: { ...devices['Desktop Firefox'] },
57+
// },
58+
59+
// {
60+
// name: 'webkit',
61+
// use: { ...devices['Desktop Safari'] },
62+
// },
63+
64+
/* Test against mobile viewports. */
65+
// {
66+
// name: 'Mobile Chrome',
67+
// use: { ...devices['Pixel 5'] },
68+
// },
69+
// {
70+
// name: 'Mobile Safari',
71+
// use: { ...devices['iPhone 12'] },
72+
// },
73+
74+
/* Test against branded browsers. */
75+
// {
76+
// name: 'Microsoft Edge',
77+
// use: { channel: 'msedge' },
78+
// },
79+
// {
80+
// name: 'Google Chrome',
81+
// use: { channel: 'chrome' },
82+
// },
83+
],
84+
85+
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
86+
// outputDir: 'test-results/',
87+
88+
/* Run your local dev server before starting the tests */
89+
// webServer: {
90+
// command: 'pnpm start',
91+
// port: 3000,
92+
// },
93+
});
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
3+
export default () => {
4+
return <div>Hello Mako</div>;
5+
};

examples/mako/tsconfig.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"baseUrl": "./",
5+
"outDir": "dist",
6+
"sourceMap": true,
7+
"jsx": "react",
8+
"declaration": false,
9+
"module": "esnext",
10+
"moduleResolution": "node",
11+
"emitDecoratorMetadata": true,
12+
"experimentalDecorators": true,
13+
"importHelpers": true,
14+
"target": "es2017",
15+
"typeRoots": ["node_modules/@types"],
16+
"lib": ["es2018", "dom"],
17+
"allowSyntheticDefaultImports": true,
18+
"rootDirs": ["/src", "/test", "/mock", "./typings"],
19+
"forceConsistentCasingInFileNames": true,
20+
"noImplicitReturns": true,
21+
"suppressImplicitAnyIndexErrors": true,
22+
"noUnusedLocals": true,
23+
"allowJs": true,
24+
"strict": true,
25+
"paths": {
26+
"@/*": ["./src/*"],
27+
"@@/*": ["./src/.umi/*"],
28+
"alita": ["./src/.umi/*"]
29+
}
30+
}
31+
}

examples/mako/typings.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
declare module '*.css';
2+
declare module '*.less';
3+
declare module '*.scss';
4+
declare module '*.sass';
5+
declare module '*.svg';
6+
declare module '*.png';
7+
declare module '*.jpg';
8+
declare module '*.jpeg';
9+
declare module '*.gif';
10+
declare module '*.bmp';
11+
declare module '*.tiff';
12+
declare module '*.json';
13+

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"@types/react-dom": "^18.0.5",
5050
"@types/resolve": "^1.20.2",
5151
"@types/rimraf": "3.0.2",
52-
"@umijs/plugin-docs": "4.2.5",
53-
"@umijs/utils": "4.2.5",
52+
"@umijs/plugin-docs": "4.2.8",
53+
"@umijs/utils": "4.2.8",
5454
"@vercel/ncc": "0.33.3",
5555
"start-server-and-test": "^1.15.3",
5656
"all-contributors-cli": "^6.20.4",
@@ -82,7 +82,7 @@
8282
"turbo": "^1.3.1",
8383
"typescript": "^4.7.2",
8484
"uglify-js": "^3.15.4",
85-
"umi": "4.2.5",
85+
"umi": "4.2.8",
8686
"umi-scripts": "workspace:*",
8787
"yorkie": "^2.0.0",
8888
"zx": "^7.2.0",

packages/alita/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
"@alita/native": "3.3.0",
4848
"@alita/plugins": "3.4.0",
4949
"@alita/plugin-azure": "3.1.0",
50-
"@umijs/core": "4.2.5",
51-
"@umijs/bundler-webpack": "4.2.5",
52-
"@umijs/babel-preset-umi": "4.2.5",
53-
"@umijs/preset-umi": "4.2.5",
54-
"@umijs/utils": "4.2.5",
55-
"umi": "4.2.5"
50+
"@umijs/core": "4.2.8",
51+
"@umijs/bundler-webpack": "4.2.8",
52+
"@umijs/babel-preset-umi": "4.2.8",
53+
"@umijs/preset-umi": "4.2.8",
54+
"@umijs/utils": "4.2.8",
55+
"umi": "4.2.8"
5656
}
5757
}

packages/autoimport/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"access": "public"
2727
},
2828
"dependencies": {
29-
"@umijs/bundler-utils": "4.2.5",
30-
"@umijs/utils": "4.2.5"
29+
"@umijs/bundler-utils": "4.2.8",
30+
"@umijs/utils": "4.2.8"
3131
}
3232
}

packages/create-alita/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"create-alita": "bin/create-alita.js"
3232
},
3333
"dependencies": {
34-
"@umijs/utils": "4.2.5"
34+
"@umijs/utils": "4.2.8"
3535
}
3636
}

packages/native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"dependencies": {
3030
"@alita/types": "3.1.2",
31-
"@umijs/utils": "4.2.5"
31+
"@umijs/utils": "4.2.8"
3232
},
3333
"license": "MIT"
3434
}

packages/plugin-azure/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"access": "public"
2727
},
2828
"dependencies": {
29-
"@umijs/utils": "4.2.5",
29+
"@umijs/utils": "4.2.8",
3030
"openai": "^4.19.1"
3131
}
3232
}

packages/plugin-lowcode/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
},
2929
"dependencies": {
3030
"@alita/types": "3.1.2",
31-
"@umijs/utils": "4.2.5"
31+
"@umijs/utils": "4.2.8"
3232
}
3333
}

packages/plugins/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"@alita/inspx": "0.0.2",
3434
"@alita/request": "3.1.2",
3535
"@alita/types": "3.1.2",
36-
"@umijs/bundler-utils": "4.2.5",
37-
"@umijs/plugins": "4.2.5",
38-
"@umijs/utils": "4.2.5",
36+
"@umijs/bundler-utils": "4.2.8",
37+
"@umijs/plugins": "4.2.8",
38+
"@umijs/utils": "4.2.8",
3939
"ahooks": "^3.0.8",
4040
"antd-mobile-alita": "^2.3.4",
4141
"antd-mobile-icons": "^0.2.2",

0 commit comments

Comments
 (0)