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

Commit

Permalink
Merge pull request #492 from ice-lab/release-next
Browse files Browse the repository at this point in the history
Release rc.3
  • Loading branch information
ClarkXia authored Sep 16, 2022
2 parents 6857c74 + 9d0b27b commit 854b7b3
Show file tree
Hide file tree
Showing 255 changed files with 9,264 additions and 2,138 deletions.
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# 忽略目录
build/
test/
tests/
fixtures/
node_modules/
dist/
out/
Expand All @@ -11,7 +10,6 @@ compiled/
coverage/

# 忽略测试文件
/packages/*/__tests__
/packages/*/lib/
/packages/*/esm/
/packages/*/es2017/
Expand Down
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const commonRules = {
'no-multiple-empty-lines': 1,
'react/jsx-no-bind': 0,
'import/order': 1,
'no-multi-assign': 0,
};

module.exports = getESLintConfig('react-ts', {
Expand All @@ -32,7 +33,9 @@ module.exports = getESLintConfig('react-ts', {
'id-length': 0,
'no-use-before-define': 0,
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/no-unused-vars': ['warn', {
varsIgnorePattern: '[iI]gnored|createElement',
}],
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-confusing-void-expression': 0,
'@typescript-eslint/promise-function-async': 0,
Expand Down
1 change: 1 addition & 0 deletions examples/app-config/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chrome 55
3 changes: 3 additions & 0 deletions examples/app-config/ice.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from '@ice/app';

export default defineConfig({});
28 changes: 28 additions & 0 deletions examples/app-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "app-config",
"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"
}
}
Binary file added examples/app-config/public/favicon.ico
Binary file not shown.
13 changes: 13 additions & 0 deletions examples/app-config/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineAppConfig } from 'ice';

export default defineAppConfig({
app: {
rootId: 'app',
strict: true,
errorBoundary: true,
},
router: {
type: 'browser',
basename: '/ice',
},
});
22 changes: 22 additions & 0 deletions examples/app-config/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/app-config/src/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
font-size: 14px;
}
5 changes: 5 additions & 0 deletions examples/app-config/src/pages/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function Error() {
// @ts-ignore
window.test();
return <>error</>;
}
3 changes: 3 additions & 0 deletions examples/app-config/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Home() {
return <h1>home</h1>;
}
14 changes: 14 additions & 0 deletions examples/app-config/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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;
}
32 changes: 32 additions & 0 deletions examples/app-config/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"]
}
11 changes: 10 additions & 1 deletion examples/basic-project/ice.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from '@ice/app';
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
import auth from '@ice/plugin-auth';
import custom from './plugin';

export default defineConfig({
publicPath: '/',
Expand All @@ -21,6 +22,14 @@ export default defineConfig({
return webpackConfig;
},
dropLogLevel: 'warn',
plugins: [auth()],
plugins: [
auth(),
{
name: 'runtime-donot-exsist',
setup() {},
runtime: './test',
},
custom,
],
eslint: true,
});
24 changes: 24 additions & 0 deletions examples/basic-project/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import fs from 'fs';

export default {
name: 'custom-plugin',
setup({ onGetConfig }) {
onGetConfig((config) => {
config.transformPlugins = [...(config.transformPlugins || []), {
name: 'custom-transform',
transformInclude(id) {
return !!id.match(/app.tsx$/);
},
loadInclude(id) {
return !!id.match(/app.tsx$/);
},
load(id) {
return fs.readFileSync(id, 'utf-8');
},
transform(code) {
return code;
},
}];
});
},
};
4 changes: 2 additions & 2 deletions examples/basic-project/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ if (isNode) {
console.error('__IS_NODE__');
}

export const auth = defineAuthConfig(() => {
export const auth = defineAuthConfig((data) => {
// fetch auth data
return {
initialAuth: {
admin: true,
admin: data?.auth?.admin,
},
};
});
Expand Down
6 changes: 5 additions & 1 deletion examples/basic-project/src/components/bar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import style from './cssWithEscapedSymbols.module.css';

console.log('style', style);

export default function Bar() {
return (
<div>
<div className={style.test}>
bar
</div>
);
Expand Down
114 changes: 114 additions & 0 deletions examples/basic-project/src/components/cssWithEscapedSymbols.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.test {
background: red;
}

._test {
background: blue;
}

.className {
background: red;
}

#someId {
background: green;
}

.className .subClass {
color: green;
}

#someId .subClass {
color: blue;
}

.-a0-34a___f {
color: red;
}

.m_x_\@ {
margin-left: auto !important;
margin-right: auto !important;
}

.B\&W\? {
margin-left: auto !important;
margin-right: auto !important;
}

/* matches elements with class=":`(" */
.\3A \`\( {
color: aqua;
}

/* matches elements with class="1a2b3c" */
.\31 a2b3c {
color: aliceblue;
}

/* matches the element with id="#fake-id" */
#\#fake-id {
color: antiquewhite;
}

/* matches the element with id="-a-b-c-" */
#-a-b-c- {
color: azure;
}

/* matches the element with id="©" */
#© {
color: black;
}

.♥ { background: lime; }
.© { background: lime; }
.😍 { background: lime; }
.“‘’” { background: lime; }
.☺☃ { background: lime; }
.⌘⌥ { background: lime; }
.𝄞♪♩♫♬ { background: lime; }
.💩 { background: lime; }
.\? { background: lime; }
.\@ { background: lime; }
.\. { background: lime; }
.\3A \) { background: lime; }
.\3A \`\( { background: lime; }
.\31 23 { background: lime; }
.\31 a2b3c { background: lime; }
.\<p\> { background: lime; }
.\<\>\<\<\<\>\>\<\> { background: lime; }
.\+\+\+\+\+\+\+\+\+\+\[\>\+\+\+\+\+\+\+\>\+\+\+\+\+\+\+\+\+\+\>\+\+\+\>\+\<\<\<\<\-\]\>\+\+\.\>\+\.\+\+\+\+\+\+\+\.\.\+\+\+\.\>\+\+\.\<\<\+\+\+\+\+\+\+\+\+\+\+\+\+\+\+\.\>\.\+\+\+\.\-\-\-\-\-\-\.\-\-\-\-\-\-\-\-\.\>\+\.\>\. { background: lime; }
.\# { background: lime; }
.\#\# { background: lime; }
.\#\.\#\.\# { background: lime; }
.\_ { background: lime; }
.\{\} { background: lime; }
.\#fake\-id { background: lime; }
.foo\.bar { background: lime; }
.\3A hover { background: lime; }
.\3A hover\3A focus\3A active { background: lime; }
.\[attr\=value\] { background: lime; }
.f\/o\/o { background: lime; }
.f\\o\\o { background: lime; }
.f\*o\*o { background: lime; }
.f\!o\!o { background: lime; }
.f\'o\'o { background: lime; }
.f\~o\~o { background: lime; }
.f\+o\+o { background: lime; }

.foo\/bar {
background: hotpink;
}

.foo\\bar {
background: hotpink;
}

.foo\/bar\/baz {
background: hotpink;
}

.foo\\bar\\baz {
background: hotpink;
}
3 changes: 3 additions & 0 deletions examples/basic-project/src/pages/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h2 {
color: #000;
}
3 changes: 3 additions & 0 deletions examples/basic-project/src/pages/index.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.data {
margin-top: 10px;
}
3 changes: 3 additions & 0 deletions examples/basic-project/src/pages/index.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.data {
margin-top: 10px;
}
Loading

0 comments on commit 854b7b3

Please sign in to comment.