Skip to content

Commit

Permalink
chore: init umi-next (#106)
Browse files Browse the repository at this point in the history
* chore: init umi-next

* chore: add github ci build status badge
  • Loading branch information
sorrycc committed Jun 23, 2022
1 parent 3203d2c commit 7cf1178
Show file tree
Hide file tree
Showing 38 changed files with 3,807 additions and 16 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Node CI

env:
NODE_OPTIONS: --max-old-space-size=6144

on:
push:
paths-ignore:
- 'examples/**'
- 'docs/**'
- '**/*.md'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14.x, 16.x]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
registry-url: 'https://registry.npmjs.org/'
- name: Cache .pnpm-store
id: cache
uses: actions/cache@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.7.js | node - add --global pnpm@6
- name: install
run: pnpm install
- run: pnpm build
- run: pnpm tsc --noEmit
- run: pnpm test
env:
CI: true
NODE_ENV: test
14 changes: 14 additions & 0 deletions .github/workflows/emoji-helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Emoji Helper

on:
release:
types: [published]

jobs:
emoji:
runs-on: ubuntu-latest
steps:
- uses: actions-cool/emoji-helper@v1.0.0
with:
type: 'release'
emoji: '+1, laugh, heart, hooray, rocket, eyes'
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
**/node_modules/**
node_modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017-present ChenCheng (sorrycc@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# umi (v4 develop version)

[![GitHub Actions status](https://github.com/umijs/umi-next/workflows/Node%20CI/badge.svg)](https://github.com/umijs/umi-next)

A framework in react community.

> Please consider following this project's author, [sorrycc](https://github.com/sorrycc), and consider starring the project to show your ❤️ and support.
Expand Down
8 changes: 8 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Config } from '@jest/types';

export default {
testMatch: ['**/packages/*/src/*.test.ts'],
transform: {
'^.+\\.(ts)$': 'ts-jest',
},
} as Config.InitialOptions;
33 changes: 31 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
{
"private": true,
"version": "4.0.0-alpha.1",
"scripts": {
"bootstrap": "zx scripts/bootstrap.mjs",
"build": "pnpm -r --filter ./packages run build",
"dev": "pnpm -r --filter ./packages --parallel run dev",
"test": "jest"
},
"devDependencies": {
"prettier": "^2.3.0",
"prettier-plugin-organize-imports": "^2.1.0"
"@types/jest": "^26.0.24",
"@types/node": "^16.4.7",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"prettier-plugin-organize-imports": "^2.3.3",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.4",
"ts-node": "^10.1.0",
"tsup": "^4.12.5",
"typescript": "^4.3.5",
"yorkie": "^2.0.0",
"zx": "^2.0.0"
},
"gitHooks": {
"pre-commit": "lint-staged",
"commit-msg": "zx scripts/verifyCommit.mjs"
},
"lint-staged": {
"*.{jsx,less,md,json}": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
}
}
1 change: 1 addition & 0 deletions packages/babel-preset-umi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @umijs/babel-preset-umi
3 changes: 3 additions & 0 deletions packages/babel-preset-umi/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: () => string;

export { _default as default };
7 changes: 7 additions & 0 deletions packages/babel-preset-umi/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts
var src_default = () => {
return "@umijs/babel-preset-umi";
};


exports.default = src_default;
27 changes: 27 additions & 0 deletions packages/babel-preset-umi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@umijs/babel-preset-umi",
"version": "4.0.0-alpha.1",
"description": "Official babel preset for umi.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rimraf dist && tsup src/index.ts --dts --format cjs",
"dev": "npm run build -- --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/umijs/umi-next"
},
"authors": [
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
],
"license": "MIT",
"bugs": "http://github.com/umijs/umi-next/issues",
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/babel-preset-umi#readme",
"publishConfig": {
"access": "public"
}
}
5 changes: 5 additions & 0 deletions packages/babel-preset-umi/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import index from './index';

test('normal', () => {
expect(index()).toEqual('@umijs/babel-preset-umi');
});
3 changes: 3 additions & 0 deletions packages/babel-preset-umi/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => {
return '@umijs/babel-preset-umi';
};
1 change: 1 addition & 0 deletions packages/bundler-vite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @umijs/bundler-vite
3 changes: 3 additions & 0 deletions packages/bundler-vite/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: () => string;

export { _default as default };
7 changes: 7 additions & 0 deletions packages/bundler-vite/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts
var src_default = () => {
return "@umijs/bundler-vite";
};


exports.default = src_default;
27 changes: 27 additions & 0 deletions packages/bundler-vite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@umijs/bundler-vite",
"version": "4.0.0-alpha.1",
"description": "@umijs/bundler-vite",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rimraf dist && tsup src/index.ts --dts --format cjs",
"dev": "npm run build -- --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/umijs/umi-next"
},
"authors": [
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
],
"license": "MIT",
"bugs": "http://github.com/umijs/umi-next/issues",
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-vite#readme",
"publishConfig": {
"access": "public"
}
}
5 changes: 5 additions & 0 deletions packages/bundler-vite/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import index from './index';

test('normal', () => {
expect(index()).toEqual('@umijs/bundler-vite');
});
3 changes: 3 additions & 0 deletions packages/bundler-vite/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => {
return '@umijs/bundler-vite';
};
1 change: 1 addition & 0 deletions packages/bundler-webpack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @umijs/bundler-webpack
3 changes: 3 additions & 0 deletions packages/bundler-webpack/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: () => string;

export { _default as default };
7 changes: 7 additions & 0 deletions packages/bundler-webpack/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts
var src_default = () => {
return "@umijs/bundler-webpack";
};


exports.default = src_default;
27 changes: 27 additions & 0 deletions packages/bundler-webpack/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@umijs/bundler-webpack",
"version": "4.0.0-alpha.1",
"description": "@umijs/bundler-webpack",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rimraf dist && tsup src/index.ts --dts --format cjs",
"dev": "npm run build -- --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/umijs/umi-next"
},
"authors": [
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
],
"license": "MIT",
"bugs": "http://github.com/umijs/umi-next/issues",
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
"publishConfig": {
"access": "public"
}
}
5 changes: 5 additions & 0 deletions packages/bundler-webpack/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import index from './index';

test('normal', () => {
expect(index()).toEqual('@umijs/bundler-webpack');
});
3 changes: 3 additions & 0 deletions packages/bundler-webpack/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => {
return '@umijs/bundler-webpack';
};
1 change: 1 addition & 0 deletions packages/umi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# umi
3 changes: 3 additions & 0 deletions packages/umi/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: () => string;

export { _default as default };
7 changes: 7 additions & 0 deletions packages/umi/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts
var src_default = () => {
return "umi";
};


exports.default = src_default;
27 changes: 27 additions & 0 deletions packages/umi/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "umi",
"version": "4.0.0-alpha.1",
"description": "umi",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rimraf dist && tsup src/index.ts --dts --format cjs",
"dev": "npm run build -- --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/umijs/umi-next"
},
"authors": [
"chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
],
"license": "MIT",
"bugs": "http://github.com/umijs/umi-next/issues",
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/umi#readme",
"publishConfig": {
"access": "public"
}
}
5 changes: 5 additions & 0 deletions packages/umi/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import index from './index';

test('normal', () => {
expect(index()).toEqual('umi');
});
3 changes: 3 additions & 0 deletions packages/umi/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => {
return 'umi';
};
Loading

0 comments on commit 7cf1178

Please sign in to comment.