Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
fix: conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
luhc228 committed Sep 26, 2022
2 parents b761f58 + 34a83a6 commit 7bd7a01
Show file tree
Hide file tree
Showing 243 changed files with 14,536 additions and 537 deletions.
15 changes: 1 addition & 14 deletions examples/app-config/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
declare module '*.module.less' {
const classes: { [key: string]: string };
export default classes;
}

declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}

declare module '*.module.scss' {
const classes: { [key: string]: string };
export default classes;
}
/// <reference types="@ice/app/types" />
2 changes: 1 addition & 1 deletion examples/app-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
}
},
"include": ["src", ".ice", "ice.config.*"],
"exclude": ["node_modules", "build", "public"]
"exclude": ["build", "public"]
}
1 change: 0 additions & 1 deletion examples/basic-project/src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Link, useData, useConfig, history } from 'ice';
import { isWeb } from '@uni/env';
// @ts-expect-error
import url from './ice.png';

interface Data {
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-project/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ export function getStaticData() {
count: 100,
from: 'getStaticData',
};
}
}
15 changes: 1 addition & 14 deletions examples/basic-project/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
declare module '*.module.less' {
const classes: { [key: string]: string };
export default classes;
}

declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}

declare module '*.module.scss' {
const classes: { [key: string]: string };
export default classes;
}
/// <reference types="@ice/app/types" />
2 changes: 1 addition & 1 deletion examples/basic-project/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
}
},
"include": ["src", ".ice", "ice.config.*"],
"exclude": ["node_modules", "build", "public"]
"exclude": ["build", "public"]
}
15 changes: 1 addition & 14 deletions examples/csr-project/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
declare module '*.module.less' {
const classes: { [key: string]: string };
export default classes;
}

declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}

declare module '*.module.scss' {
const classes: { [key: string]: string };
export default classes;
}
/// <reference types="@ice/app/types" />
2 changes: 1 addition & 1 deletion examples/csr-project/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
}
},
"include": ["src", ".ice", "ice.config.*"],
"exclude": ["node_modules", "build", "public"]
"exclude": ["build", "public"]
}
5 changes: 5 additions & 0 deletions examples/disable-data-loader/ice.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@ice/app';

export default defineConfig({
dataLoader: false,
});
28 changes: 28 additions & 0 deletions examples/disable-data-loader/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "disable-data-loader",
"version": "1.0.0",
"scripts": {
"start": "ice start",
"build": "ice build",
"build:splitChunks": "ice build --config splitChunks.config.mts"
},
"description": "",
"author": "",
"license": "MIT",
"dependencies": {
"@ice/app": "workspace:*",
"@ice/plugin-auth": "workspace:*",
"@ice/plugin-rax-compat": "workspace:*",
"@ice/runtime": "workspace:*",
"@uni/env": "^1.1.0",
"ahooks": "^3.3.8",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.2",
"speed-measure-webpack-plugin": "^1.5.0",
"webpack": "^5.73.0"
}
}
19 changes: 19 additions & 0 deletions examples/disable-data-loader/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineAppConfig } from 'ice';
import type { GetAppData } from 'ice';

export default defineAppConfig({
app: {
rootId: 'app',
},
});

export const getAppData: GetAppData = () => {
return new Promise((resolve) => {
resolve({
title: 'gogogogo',
auth: {
admin: true,
},
});
});
};
22 changes: 22 additions & 0 deletions examples/disable-data-loader/src/document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, Title, Links, Main, Scripts } from 'ice';

function Document() {
return (
<html>
<head>
<meta charSet="utf-8" />
<meta name="description" content="ICE 3.0 Demo" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Title />
<Links />
</head>
<body>
<Main />
<Scripts />
</body>
</html>
);
}

export default Document;
37 changes: 37 additions & 0 deletions examples/disable-data-loader/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export default function Home() {
return (
<>
<h2 className="title">Home Page</h2>
</>
);
}

export function getConfig() {
return {
title: 'Home',
meta: [
{
name: 'theme-color',
content: '#000',
},
{
name: 'title-color',
content: '#f00',
},
],
auth: ['admin'],
};
}

export function getData({ pathname, query }) {
return new Promise((resolve) => {
setTimeout(() => {
resolve({
name: 'Home',
count: 100,
pathname,
query,
});
}, 1 * 100);
});
}
32 changes: 32 additions & 0 deletions examples/disable-data-loader/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compileOnSave": false,
"buildOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react-jsx",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"rootDir": "./",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": false,
"importHelpers": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"paths": {
"@/*": ["./src/*"],
"ice": [".ice"]
}
},
"include": ["src", ".ice", "ice.config.*"],
"exclude": ["node_modules", "build", "public"]
}
1 change: 1 addition & 0 deletions examples/miniapp-project/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chrome 55
11 changes: 11 additions & 0 deletions examples/miniapp-project/ice.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from '@ice/app';

export default defineConfig({
alias: {
components: './src/components',
},
// TODO:
// proxy: {}
sourceMap: false,
// eslint: false,
});
3 changes: 3 additions & 0 deletions examples/miniapp-project/mock/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
'/api/foo': { foo: 'foo' },
};
9 changes: 9 additions & 0 deletions examples/miniapp-project/mock/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Request, Response } from 'express';

export default {
'GET /api/users': ['a', 'b'],
'POST /api/users/:id': (req: Request, res: Response) => {
const { id } = req.params;
res.send({ id: id });
},
};
28 changes: 28 additions & 0 deletions examples/miniapp-project/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "miniapp-project",
"version": "1.0.0",
"scripts": {
"start": "ice start",
"start:wechat": "ice start --platform wechat-miniprogram",
"start:ali": "ice start --platform ali-miniapp",
"build": "ice build",
"build:wechat": "ice build --platform wechat-miniprogram"
},
"description": "",
"author": "",
"license": "MIT",
"dependencies": {
"@ice/app": "workspace:*",
"@ice/runtime": "workspace:*",
"ahooks": "^3.3.8",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.2",
"browserslist": "^4.19.3",
"speed-measure-webpack-plugin": "^1.5.0",
"webpack": "^5.73.0"
}
}
Binary file added examples/miniapp-project/public/favicon.ico
Binary file not shown.
26 changes: 26 additions & 0 deletions examples/miniapp-project/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineAppConfig, type GetAppData } from 'ice';

export const getAppData: GetAppData = () => {
return new Promise((resolve) => {
resolve({
success: true,
id: 34293,
});
});
};


export const miniappManifest = {
title: 'miniapp test',
routes: [
'index',
'about',
'second/profile',
],
};

export default defineAppConfig({
app: {
rootId: 'app',
},
});
5 changes: 5 additions & 0 deletions examples/miniapp-project/src/components/Logo/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
7 changes: 7 additions & 0 deletions examples/miniapp-project/src/components/bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Bar() {
return (
<view>
bar
</view>
);
}
22 changes: 22 additions & 0 deletions examples/miniapp-project/src/document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, Title, Links, Main, Scripts } from 'ice';

function Document() {
return (
<html>
<head>
<meta charSet="utf-8" />
<meta name="description" content="ICE 3.0 Demo" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Title />
<Links />
</head>
<body>
<Main />
<Scripts />
</body>
</html>
);
}

export default Document;
3 changes: 3 additions & 0 deletions examples/miniapp-project/src/global.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.global {
font-size: 14px;
}
15 changes: 15 additions & 0 deletions examples/miniapp-project/src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// import './index.css';

export default function Home() {
return (
<>
<view className="title">About</view>
</>
);
}

export function getConfig() {
return {
title: 'About',
};
}
Binary file added examples/miniapp-project/src/pages/ice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7bd7a01

Please sign in to comment.